Skip to content

Commit

Permalink
Add --version to sample app (#65)
Browse files Browse the repository at this point in the history
- Added --help and --version to sample app
- Updated .gitignore to ignore EbApiVersion.h
- Changed version to v0.1.0

Signed-off-by: Mark Feldman <[email protected]>
  • Loading branch information
intelmark authored and tianjunwork committed Oct 14, 2019
1 parent 07b192b commit 4d7f6c6
Show file tree
Hide file tree
Showing 5 changed files with 172 additions and 165 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ Bin
Build
!Build/linux/build.sh
!Build/windows/generate_vs17.bat
Source/API/EbApiVersion.h
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")

set(SVT_VP9_VERSION_MAJOR "0")
set(SVT_VP9_VERSION_MINOR "1")
set(SVT_VP9_VERSION_PATCHLEVEL "1")
set(SVT_VP9_VERSION_PATCHLEVEL "0")

configure_file(${PROJECT_SOURCE_DIR}/Source/API/EbApiVersion.h.in ${PROJECT_SOURCE_DIR}/Source/API/EbApiVersion.h @ONLY)

Expand Down
29 changes: 17 additions & 12 deletions Source/App/EbAppConfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "EbApiVersion.h"
#include "EbAppConfig.h"

#ifdef _WIN32
Expand All @@ -17,7 +17,8 @@
/**********************************
* Defines
**********************************/
#define HELP_TOKEN "-help"
#define HELP_TOKEN "--help"
#define VERSION_TOKEN "--version"
#define CHANNEL_NUMBER_TOKEN "-nch"
#define COMMAND_LINE_MAX_SIZE 2048
#define CONFIG_FILE_TOKEN "-c"
Expand Down Expand Up @@ -739,25 +740,29 @@ uint32_t get_help(int argc, char *const argv[])
char config_string[COMMAND_LINE_MAX_SIZE];
if (find_token(argc, argv, HELP_TOKEN, config_string) == 0) {
int token_index = -1;

printf("\n%-25s\t%-25s\t%-25s\t\n\n" ,"TOKEN", "DESCRIPTION", "INPUT TYPE");
printf("%-25s\t%-25s\t%-25s\t\n" ,"-nch", "NumberOfChannels", "Single input");
while (config_entry[++token_index].token != NULL) {

printf("%-25s\t%-25s\t%-25s\t\n", config_entry[token_index].token, config_entry[token_index].name, config_entry[token_index].type ? "Array input": "Single input");

}
return 1;

}
else {
return 0;
}



return 0;
}

uint32_t get_svt_version(int argc, char *const argv[])
{
char config_string[COMMAND_LINE_MAX_SIZE];
if (find_token(argc, argv, VERSION_TOKEN, config_string) == 0) {
printf("SVT-VP9 version %d.%d.%d\n", SVT_VERSION_MAJOR, SVT_VERSION_MINOR, SVT_VERSION_PATCHLEVEL);
printf("Copyright(c) 2018 Intel Corporation\n");
printf("BSD-2-Clause Plus Patent License\n");
printf("https://github.com/OpenVisualCloud/SVT-VP9\n");
return 1;
}
return 0;
}

/******************************************************
* Get the number of channels and validate it with input
Expand Down Expand Up @@ -952,4 +957,4 @@ EbErrorType read_command_line(
}

return return_error;
}
}
2 changes: 1 addition & 1 deletion Source/App/EbAppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ extern EbErrorType read_command_line(
EbErrorType *return_errors);

extern uint32_t get_help(int argc, char *const argv[]);

extern uint32_t get_svt_version(int argc, char *const argv[]);
extern uint32_t get_number_of_channels(int argc, char *const argv[]);

#endif //EbAppConfig_h
Loading

0 comments on commit 4d7f6c6

Please sign in to comment.