@@ -80,6 +80,9 @@ struct ProgramConfig {
8080 outputcrcPerFrame = false ;
8181 outputcrc = false ;
8282 crcOutputFile = nullptr ;
83+ numberOfDecodeWorkers = 0 ;
84+ enableWorkerProcessesPoll = false ;
85+ ipcType = 0 ;
8386 }
8487
8588 using ProgramArgs = std::vector<ArgSpec>;
@@ -187,8 +190,7 @@ struct ProgramConfig {
187190 {" --input" , " -i" , 1 , " Input filename to decode" ,
188191 [this ](const char **args, const ProgramArgs &a) {
189192 videoFileName = args[0 ];
190- std::ifstream validVideoFileStream (videoFileName, std::ifstream::in);
191- return (bool )validVideoFileStream;
193+ return true ;
192194 }},
193195 {" --output" , " -o" , 1 , " Output filename to dump raw video to" ,
194196 [this ](const char **args, const ProgramArgs &a) {
@@ -322,6 +324,17 @@ struct ProgramConfig {
322324 crcInitValue = crcInitValueTemp;
323325 return true ;
324326 }},
327+ {" --poll-of-processes" , nullptr , 1 , " Use poll of worker processes and specify number of workers." ,
328+ [this ](const char **args, const ProgramArgs &a) {
329+ enableWorkerProcessesPoll = true ;
330+ numberOfDecodeWorkers = std::atoi (args[0 ]);
331+ return true ;
332+ }},
333+ {" --files-to-decode" , nullptr , 1 , " Specify a file location where command lines for the poll of worker processes are saved." ,
334+ [this ](const char **args, const ProgramArgs &a) {
335+ fileListIpc = args[0 ];
336+ return true ;
337+ }},
325338 };
326339
327340 for (int i = 1 ; i < argc; i++) {
@@ -391,6 +404,18 @@ struct ProgramConfig {
391404 crcOutputFile = stdout;
392405 }
393406 }
407+
408+ if (!enableWorkerProcessesPoll) {
409+ if (videoFileName.length () == 0 ) {
410+ std::cerr << " Input file should be specified" << std::endl;
411+ exit (EXIT_FAILURE );
412+ }
413+ std::ifstream validVideoFileStream (videoFileName, std::ifstream::in);
414+ if (!(bool )validVideoFileStream) {
415+ std::cerr << " Can't open input file: invalid file name" << std::endl;
416+ exit (EXIT_FAILURE );
417+ }
418+ }
394419 }
395420
396421 // Assuming we have the length as a parameter:
@@ -461,6 +486,7 @@ struct ProgramConfig {
461486 uint32_t decoderQueueSize;
462487 int32_t enablePostProcessFilter;
463488 uint32_t *crcOutput;
489+ uint32_t numberOfDecodeWorkers;
464490 uint32_t enableStreamDemuxing : 1 ;
465491 uint32_t directMode : 1 ;
466492 uint32_t vsync : 1 ;
@@ -474,6 +500,9 @@ struct ProgramConfig {
474500 uint32_t outputy4m : 1 ;
475501 uint32_t outputcrc : 1 ;
476502 uint32_t outputcrcPerFrame : 1 ;
503+ uint32_t enableWorkerProcessesPoll : 1 ;
504+ uint32_t ipcType : 1 ;
505+ std::string fileListIpc;
477506};
478507
479508#endif /* _PROGRAMSETTINGS_H_ */
0 commit comments