@@ -78,16 +78,6 @@ int save_app_config(void) {
7878 fprintf (file , " flip: %s\n" , app_config .flip ? "true" : "false" );
7979 fprintf (file , " antiflicker: %d\n" , app_config .antiflicker );
8080
81- fprintf (file , "stream:\n" );
82- fprintf (file , " enable: %s\n" , app_config .stream_enable ? "true" : "false" );
83- fprintf (file , " udp_srcport: %d\n" , app_config .stream_udp_srcport );
84- if (!EMPTY (* app_config .stream_dests )) {
85- fprintf (file , " dests: " );
86- for (int i = 0 ; app_config .stream_dests [i ] && * app_config .stream_dests [i ]; i ++ ) {
87- fprintf (file , " - %s\n" , app_config .stream_dests [i ]);
88- }
89- }
90-
9181 fprintf (file , "mdns:\n" );
9282 fprintf (file , " enable: %s\n" , app_config .mdns_enable ? "true" : "false" );
9383
@@ -104,6 +94,22 @@ int save_app_config(void) {
10494 fprintf (file , " auth_user: %s\n" , app_config .rtsp_auth_user );
10595 fprintf (file , " auth_pass: %s\n" , app_config .rtsp_auth_pass );
10696
97+ fprintf (file , "record:\n" );
98+ fprintf (file , " enable: %s\n" , app_config .record_enable ? "true" : "false" );
99+ fprintf (file , " path: %s\n" , app_config .record_path );
100+ fprintf (file , " filename: %s\n" , app_config .record_filename );
101+ fprintf (file , " segment_size: %d\n" , app_config .record_segment_size );
102+
103+ fprintf (file , "stream:\n" );
104+ fprintf (file , " enable: %s\n" , app_config .stream_enable ? "true" : "false" );
105+ fprintf (file , " udp_srcport: %d\n" , app_config .stream_udp_srcport );
106+ if (!EMPTY (* app_config .stream_dests )) {
107+ fprintf (file , " dests: " );
108+ for (int i = 0 ; app_config .stream_dests [i ] && * app_config .stream_dests [i ]; i ++ ) {
109+ fprintf (file , " - %s\n" , app_config .stream_dests [i ]);
110+ }
111+ }
112+
107113 fprintf (file , "audio:\n" );
108114 fprintf (file , " enable: %s\n" , app_config .audio_enable ? "true" : "false" );
109115 fprintf (file , " bitrate: %d\n" , app_config .audio_bitrate );
@@ -198,6 +204,11 @@ enum ConfigError parse_app_config(void) {
198204 app_config .rtsp_auth_user [0 ] = '\0' ;
199205 app_config .rtsp_auth_pass [0 ] = '\0' ;
200206
207+ app_config .record_enable = false;
208+ app_config .record_filename [0 ] = '\0' ;
209+ strcpy (app_config .record_path , "/mnt/sdcard/recordings" );
210+ app_config .record_segment_size = 0 ;
211+
201212 app_config .stream_enable = false;
202213 app_config .stream_udp_srcport = 0 ;
203214 * app_config .stream_dests [0 ] = '\0' ;
@@ -368,6 +379,14 @@ enum ConfigError parse_app_config(void) {
368379 & ini , "onvif" , "auth_pass" , app_config .onvif_auth_pass );
369380 }
370381
382+ parse_bool (& ini , "record" , "enable" , & app_config .record_enable );
383+ parse_param_value (
384+ & ini , "record" , "path" , app_config .record_path );
385+ parse_param_value (
386+ & ini , "record" , "filename" , app_config .record_filename );
387+ parse_int (& ini , "record" , "segment_size" , 0 , INT_MAX ,
388+ & app_config .record_segment_size );
389+
371390 parse_bool (& ini , "rtsp" , "enable" , & app_config .rtsp_enable );
372391 parse_int (& ini , "rtsp" , "port" , 0 , USHRT_MAX , & app_config .rtsp_port );
373392 if (app_config .rtsp_enable ) {
0 commit comments