Skip to content

Commit 4d7f6c6

Browse files
intelmarktianjunwork
authored andcommitted
Add --version to sample app (#65)
- Added --help and --version to sample app - Updated .gitignore to ignore EbApiVersion.h - Changed version to v0.1.0 Signed-off-by: Mark Feldman <mark.feldman@intel.com>
1 parent 07b192b commit 4d7f6c6

File tree

5 files changed

+172
-165
lines changed

5 files changed

+172
-165
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ Bin
1818
Build
1919
!Build/linux/build.sh
2020
!Build/windows/generate_vs17.bat
21+
Source/API/EbApiVersion.h

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")
3939

4040
set(SVT_VP9_VERSION_MAJOR "0")
4141
set(SVT_VP9_VERSION_MINOR "1")
42-
set(SVT_VP9_VERSION_PATCHLEVEL "1")
42+
set(SVT_VP9_VERSION_PATCHLEVEL "0")
4343

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

Source/App/EbAppConfig.c

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <stdio.h>
77
#include <stdlib.h>
88
#include <string.h>
9-
9+
#include "EbApiVersion.h"
1010
#include "EbAppConfig.h"
1111

1212
#ifdef _WIN32
@@ -17,7 +17,8 @@
1717
/**********************************
1818
* Defines
1919
**********************************/
20-
#define HELP_TOKEN "-help"
20+
#define HELP_TOKEN "--help"
21+
#define VERSION_TOKEN "--version"
2122
#define CHANNEL_NUMBER_TOKEN "-nch"
2223
#define COMMAND_LINE_MAX_SIZE 2048
2324
#define CONFIG_FILE_TOKEN "-c"
@@ -739,25 +740,29 @@ uint32_t get_help(int argc, char *const argv[])
739740
char config_string[COMMAND_LINE_MAX_SIZE];
740741
if (find_token(argc, argv, HELP_TOKEN, config_string) == 0) {
741742
int token_index = -1;
742-
743743
printf("\n%-25s\t%-25s\t%-25s\t\n\n" ,"TOKEN", "DESCRIPTION", "INPUT TYPE");
744744
printf("%-25s\t%-25s\t%-25s\t\n" ,"-nch", "NumberOfChannels", "Single input");
745745
while (config_entry[++token_index].token != NULL) {
746-
747746
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");
748-
749747
}
750748
return 1;
751749

752750
}
753-
else {
754-
return 0;
755-
}
756-
757-
758-
751+
return 0;
759752
}
760753

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

762767
/******************************************************
763768
* Get the number of channels and validate it with input
@@ -952,4 +957,4 @@ EbErrorType read_command_line(
952957
}
953958

954959
return return_error;
955-
}
960+
}

Source/App/EbAppConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ extern EbErrorType read_command_line(
310310
EbErrorType *return_errors);
311311

312312
extern uint32_t get_help(int argc, char *const argv[]);
313-
313+
extern uint32_t get_svt_version(int argc, char *const argv[]);
314314
extern uint32_t get_number_of_channels(int argc, char *const argv[]);
315315

316316
#endif //EbAppConfig_h

0 commit comments

Comments
 (0)