@@ -46,6 +46,8 @@ void runtimeReset(Runtime* _runtime)
4646 pthread_mutex_init (& _runtime -> m_state .m_mutex , NULL );
4747 memset (& _runtime -> m_state .m_targetDetectParams , 0 , sizeof (_runtime -> m_state .m_targetDetectParams ));
4848 memset (& _runtime -> m_state .m_targetDetectCommand , 0 , sizeof (_runtime -> m_state .m_targetDetectCommand ));
49+ memset (& _runtime -> m_state .m_targetJpgParams , 0 , sizeof (_runtime -> m_state .m_targetJpgParams ));//maybe not
50+ _runtime -> m_state .m_targetJpgParams .jpgQuality = 40 ;
4951}
5052
5153
@@ -70,6 +72,8 @@ bool runtimeParseArgs(Runtime* _runtime, int _argc, char* const _argv[])
7072 { "rc-fifo-in" , 1 , NULL , 0 }, // 7
7173 { "rc-fifo-out" , 1 , NULL , 0 },
7274 { "video-out" , 1 , NULL , 0 },
75+ { "jpeg-qual" , 1 , NULL , 0 },
76+ { "white-black" , 1 , NULL , 0 },
7377 { "verbose" , 0 , NULL , 'v' },
7478 { "help" , 0 , NULL , 'h' },
7579 { NULL , 0 , NULL , 0 }
@@ -117,7 +121,11 @@ bool runtimeParseArgs(Runtime* _runtime, int _argc, char* const _argv[])
117121 case 7 : cfg -> m_rcConfig .m_fifoInput = optarg ; break ;
118122 case 7 + 1 : cfg -> m_rcConfig .m_fifoOutput = optarg ; break ;
119123 case 7 + 2 : cfg -> m_rcConfig .m_videoOutEnable = atoi (optarg ); break ;
120-
124+ case 7 + 3 : _runtime -> m_state .m_targetJpgParams .jpgQuality = atoi (optarg ); break ;
125+ case 7 + 4 :
126+ if (strcmp (optarg , "false" ) == 0 ) _runtime -> m_state .m_targetJpgParams .ifBlackAndWhite = false;
127+ else _runtime -> m_state .m_targetJpgParams .ifBlackAndWhite = true;
128+ break ;
121129 default :
122130 return false;
123131 }
@@ -153,6 +161,8 @@ void runtimeArgsHelpMessage(Runtime* _runtime, const char* _arg0)
153161 " --rc-fifo-in <remote-control-fifo-input>\n"
154162 " --rc-fifo-out <remote-control-fifo-output>\n"
155163 " --video-out <enable-video-output>\n"
164+ " --jpeg-qual <desired-video-quality>\n"
165+ " --black-white <if-video-should-be-black-and-white>\n"
156166 " --verbose\n"
157167 " --help\n" ,
158168 _arg0 );
@@ -404,6 +414,17 @@ int runtimeGetTargetDetectParams(Runtime* _runtime, TargetDetectParams* _targetD
404414 return 0 ;
405415}
406416
417+ int runtimeGetTargetJpgParams (Runtime * _runtime , TargetJpgParams * _targetJpgParams )
418+ {
419+ if (_runtime == NULL || _targetJpgParams == NULL )
420+ return EINVAL ;
421+
422+ pthread_mutex_lock (& _runtime -> m_state .m_mutex );
423+ * _targetJpgParams = _runtime -> m_state .m_targetJpgParams ;
424+ pthread_mutex_unlock (& _runtime -> m_state .m_mutex );
425+ return 0 ;
426+ }
427+
407428int runtimeSetTargetDetectParams (Runtime * _runtime , const TargetDetectParams * _targetDetectParams )
408429{
409430 if (_runtime == NULL || _targetDetectParams == NULL )
0 commit comments