@@ -80,6 +80,9 @@ struct ProgramConfig {
80
80
outputcrcPerFrame = false ;
81
81
outputcrc = false ;
82
82
crcOutputFile = nullptr ;
83
+ numberOfDecodeWorkers = 0 ;
84
+ enableWorkerProcessesPoll = false ;
85
+ ipcType = 0 ;
83
86
}
84
87
85
88
using ProgramArgs = std::vector<ArgSpec>;
@@ -187,8 +190,9 @@ struct ProgramConfig {
187
190
{" --input" , " -i" , 1 , " Input filename to decode" ,
188
191
[this ](const char **args, const ProgramArgs &a) {
189
192
videoFileName = args[0 ];
190
- std::ifstream validVideoFileStream (videoFileName, std::ifstream::in);
191
- return (bool )validVideoFileStream;
193
+ // std::ifstream validVideoFileStream(videoFileName, std::ifstream::in);
194
+ // return (bool)validVideoFileStream;
195
+ return true ;
192
196
}},
193
197
{" --output" , " -o" , 1 , " Output filename to dump raw video to" ,
194
198
[this ](const char **args, const ProgramArgs &a) {
@@ -322,6 +326,17 @@ struct ProgramConfig {
322
326
crcInitValue = crcInitValueTemp;
323
327
return true ;
324
328
}},
329
+ {" --poll-of-processes" , nullptr , 1 , " Use poll of worker processes and specify number of workers." ,
330
+ [this ](const char **args, const ProgramArgs &a) {
331
+ enableWorkerProcessesPoll = true ;
332
+ numberOfDecodeWorkers = std::atoi (args[0 ]);
333
+ return true ;
334
+ }},
335
+ {" --files-to-decode" , nullptr , 1 , " Specify a file location where command lines for the poll of worker processes are saved." ,
336
+ [this ](const char **args, const ProgramArgs &a) {
337
+ fileListIpc = args[0 ];
338
+ return true ;
339
+ }},
325
340
};
326
341
327
342
for (int i = 1 ; i < argc; i++) {
@@ -391,6 +406,18 @@ struct ProgramConfig {
391
406
crcOutputFile = stdout;
392
407
}
393
408
}
409
+
410
+ if (!enableWorkerProcessesPoll) {
411
+ if (videoFileName.length () == 0 ) {
412
+ std::cerr << " Input file should be specified" << std::endl;
413
+ exit (EXIT_FAILURE);
414
+ }
415
+ std::ifstream validVideoFileStream (videoFileName, std::ifstream::in);
416
+ if (!(bool )validVideoFileStream) {
417
+ std::cerr << " Can't open input file: invalid file name" << std::endl;
418
+ exit (EXIT_FAILURE);
419
+ }
420
+ }
394
421
}
395
422
396
423
// Assuming we have the length as a parameter:
@@ -461,6 +488,7 @@ struct ProgramConfig {
461
488
uint32_t decoderQueueSize;
462
489
int32_t enablePostProcessFilter;
463
490
uint32_t *crcOutput;
491
+ uint32_t numberOfDecodeWorkers;
464
492
uint32_t enableStreamDemuxing : 1 ;
465
493
uint32_t directMode : 1 ;
466
494
uint32_t vsync : 1 ;
@@ -474,6 +502,9 @@ struct ProgramConfig {
474
502
uint32_t outputy4m : 1 ;
475
503
uint32_t outputcrc : 1 ;
476
504
uint32_t outputcrcPerFrame : 1 ;
505
+ uint32_t enableWorkerProcessesPoll : 1 ;
506
+ uint32_t ipcType : 1 ;
507
+ std::string fileListIpc;
477
508
};
478
509
479
510
#endif /* _PROGRAMSETTINGS_H_ */
0 commit comments