"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "conf.c" between
motion-release-4.2.2.tar.gz and motion-Release-4.3.0.tar.gz

About: Motion monitors the video signal from one or more cameras and is able to detect motion.

conf.c  (motion-release-4.2.2):conf.c  (motion-Release-4.3.0)
skipping to change at line 71 skipping to change at line 71
.roundrobin_skip = 1, .roundrobin_skip = 1,
.roundrobin_switchfilter = FALSE, .roundrobin_switchfilter = FALSE,
.netcam_url = NULL, .netcam_url = NULL,
.netcam_highres= NULL, .netcam_highres= NULL,
.netcam_userpass = NULL, .netcam_userpass = NULL,
.netcam_keepalive = "off", .netcam_keepalive = "off",
.netcam_proxy = NULL, .netcam_proxy = NULL,
.netcam_tolerant_check = FALSE, .netcam_tolerant_check = FALSE,
.netcam_use_tcp = TRUE, .netcam_use_tcp = TRUE,
.netcam_decoder = NULL,
.mmalcam_name = NULL, .mmalcam_name = NULL,
.mmalcam_control_params = NULL, .mmalcam_control_params = NULL,
/* Image processing configuration parameters */ /* Image processing configuration parameters */
.width = DEF_WIDTH, .width = DEF_WIDTH,
.height = DEF_HEIGHT, .height = DEF_HEIGHT,
.framerate = DEF_MAXFRAMERATE, .framerate = DEF_MAXFRAMERATE,
.minimum_frame_time = 0, .minimum_frame_time = 0,
.rotate = 0, .rotate = 0,
skipping to change at line 500 skipping to change at line 501
{ {
"netcam_use_tcp", "netcam_use_tcp",
"# Use TCP transport for RTSP/RTMP connections to camera.", "# Use TCP transport for RTSP/RTMP connections to camera.",
1, 1,
CONF_OFFSET(netcam_use_tcp), CONF_OFFSET(netcam_use_tcp),
copy_bool, copy_bool,
print_bool, print_bool,
WEBUI_LEVEL_ADVANCED WEBUI_LEVEL_ADVANCED
}, },
{ {
"netcam_decoder",
"# User requested decoder for netcam.",
0,
CONF_OFFSET(netcam_decoder),
copy_string,
print_string,
WEBUI_LEVEL_ADVANCED
},
{
"mmalcam_name", "mmalcam_name",
"# Name of mmal camera (e.g. vc.ril.camera for pi camera).", "# Name of mmal camera (e.g. vc.ril.camera for pi camera).",
0, 0,
CONF_OFFSET(mmalcam_name), CONF_OFFSET(mmalcam_name),
copy_string, copy_string,
print_string, print_string,
WEBUI_LEVEL_ADVANCED WEBUI_LEVEL_ADVANCED
}, },
{ {
"mmalcam_control_params", "mmalcam_control_params",
skipping to change at line 2083 skipping to change at line 2093
} }
/* /*
* We reached the end of config_params without finding a matching option. * We reached the end of config_params without finding a matching option.
* Check if it's a deprecated option, log a warning, and if applicable * Check if it's a deprecated option, log a warning, and if applicable
* set the replacement option to the given value. * set the replacement option to the given value.
*/ */
i = 0; i = 0;
while (dep_config_params[i].name != NULL) { while (dep_config_params[i].name != NULL) {
if (!strncasecmp(cmd, dep_config_params[i].name, 255 + 50)) { if (!strncasecmp(cmd, dep_config_params[i].name, 255 + 50)) {
MOTION_LOG(ALR, TYPE_ALL, NO_ERRNO, "%s after version %s" MOTION_LOG(ALR, TYPE_ALL, NO_ERRNO, _("%s after version %s")
, dep_config_params[i].info, dep_config_params[i].last_version); , dep_config_params[i].info, dep_config_params[i].last_version);
if (dep_config_params[i].copy != NULL){ if (dep_config_params[i].copy != NULL){
/* If the depreciated option is a vid item, copy_vid_ctrl is cal led /* If the depreciated option is a vid item, copy_vid_ctrl is cal led
* with the array index sent instead of the context structure me mber pointer. * with the array index sent instead of the context structure me mber pointer.
*/ */
if (!strcmp(dep_config_params[i].name,"brightness") || if (!strcmp(dep_config_params[i].name,"brightness") ||
!strcmp(dep_config_params[i].name,"contrast") || !strcmp(dep_config_params[i].name,"contrast") ||
!strcmp(dep_config_params[i].name,"saturation") || !strcmp(dep_config_params[i].name,"saturation") ||
!strcmp(dep_config_params[i].name,"hue") || !strcmp(dep_config_params[i].name,"hue") ||
skipping to change at line 2249 skipping to change at line 2259
* If it is a camera parameter write it out. * If it is a camera parameter write it out.
* Else write the disabled option to the config file but with a * Else write the disabled option to the config file but with a
* comment mark in front of the parameter name. * comment mark in front of the parameter name.
*/ */
if (val) { if (val) {
fprintf(conffile, "%s\n", config_params[i].param_help); fprintf(conffile, "%s\n", config_params[i].param_help);
if (strlen(val) > 0) if (strlen(val) > 0)
fprintf(conffile, "%s\n", val); fprintf(conffile, "%s\n", val);
else else
fprintf(conffile, "; camera %s/motion/camera1.conf\n", s ysconfdir); fprintf(conffile, "; camera %s/camera1.conf\n", sysconfd ir);
free(val); free(val);
} else if (thread == 0) { } else if (thread == 0) {
char value[PATH_MAX]; char value[PATH_MAX];
/* The 'camera_dir' option should keep the installed default value */ /* The 'camera_dir' option should keep the installed default value */
if (!strncmp(config_params[i].param_name, "camera_dir", 10)) if (!strncmp(config_params[i].param_name, "camera_dir", 10))
sprintf(value, "%s", sysconfdir"/motion/conf.d"); sprintf(value, "%s", sysconfdir"/conf.d");
else else
sprintf(value, "%s", "value"); sprintf(value, "%s", "value");
fprintf(conffile, "%s\n", config_params[i].param_help); fprintf(conffile, "%s\n", config_params[i].param_help);
fprintf(conffile, "; %s %s\n\n", config_params[i].param_name , value); fprintf(conffile, "; %s %s\n\n", config_params[i].param_name , value);
} }
} }
} }
fprintf(conffile, "\n"); fprintf(conffile, "\n");
skipping to change at line 2297 skipping to change at line 2307
* - Finally it processes the options given in the Command-line. This is done * - Finally it processes the options given in the Command-line. This is done
* for each camera cnt[i] so that the Command-line options overrides any * for each camera cnt[i] so that the Command-line options overrides any
* option given by motion.conf or a camera config file. * option given by motion.conf or a camera config file.
* *
* Returns context struct. * Returns context struct.
*/ */
struct context **conf_load(struct context **cnt) struct context **conf_load(struct context **cnt)
{ {
FILE *fp = NULL; FILE *fp = NULL;
char filename[PATH_MAX]; char filename[PATH_MAX];
int i; int i, retcd;
/* We preserve argc and argv because they get overwritten by the memcpy comm and. */ /* We preserve argc and argv because they get overwritten by the memcpy comm and. */
char **argv = cnt[0]->conf.argv; char **argv = cnt[0]->conf.argv;
int argc = cnt[0]->conf.argc; int argc = cnt[0]->conf.argc;
/* /*
* Copy the template config structure with all the default config values * Copy the template config structure with all the default config values
* into cnt[0]->conf * into cnt[0]->conf
*/ */
memcpy(&cnt[0]->conf, &conf_template, sizeof(struct config)); memcpy(&cnt[0]->conf, &conf_template, sizeof(struct config));
skipping to change at line 2369 skipping to change at line 2379
, (int)(PATH_MAX-1-strlen("/motion.conf")) , (int)(PATH_MAX-1-strlen("/motion.conf"))
, path); , path);
fp = fopen (filename, "r"); fp = fopen (filename, "r");
} }
if (!fp) { /* Specified file does not exist... try default file. */ if (!fp) { /* Specified file does not exist... try default file. */
snprintf(filename, PATH_MAX, "%s/.motion/motion.conf", getenv("HOME")); snprintf(filename, PATH_MAX, "%s/.motion/motion.conf", getenv("HOME"));
fp = fopen(filename, "r"); fp = fopen(filename, "r");
if (!fp) { if (!fp) {
snprintf(filename, PATH_MAX, "%s/motion/motion.conf", sysconfdir); snprintf(filename, PATH_MAX, "%s/motion.conf", sysconfdir);
fp = fopen(filename, "r"); fp = fopen(filename, "r");
if (!fp) /* There is no config file.... use defaults. */ if (!fp) /* There is no config file.... use defaults. */
MOTION_LOG(ALR, TYPE_ALL, SHOW_ERRNO MOTION_LOG(ALR, TYPE_ALL, SHOW_ERRNO
,_("could not open configfile %s") ,_("could not open configfile %s")
,filename); ,filename);
} }
} }
/* Now we process the motion.conf config file and close it. */ /* Now we process the motion.conf config file and close it. */
if (fp) { if (fp) {
strncpy(cnt[0]->conf_filename, filename, sizeof(cnt[0]->conf_filename) - 1 retcd = snprintf(cnt[0]->conf_filename
); ,sizeof(cnt[0]->conf_filename)
cnt[0]->conf_filename[sizeof(cnt[0]->conf_filename) - 1] = '\0'; ,"%s",filename);
MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO if ((retcd < 0) || (retcd >= (int)sizeof(cnt[0]->conf_filename))){
,_("Processing thread 0 - config file %s"), filename); MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO
cnt = conf_process(cnt, fp); ,_("Invalid file name %s"), filename);
myfclose(fp); } else {
MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO
,_("Processing thread 0 - config file %s"), filename);
cnt = conf_process(cnt, fp);
myfclose(fp);
}
} else { } else {
MOTION_LOG(CRT, TYPE_ALL, NO_ERRNO MOTION_LOG(CRT, TYPE_ALL, NO_ERRNO
,_("No config file to process, using default values")); ,_("No config file to process, using default values"));
} }
/* /*
* For each thread (given by cnt[i]) being not null * For each thread (given by cnt[i]) being not null
* cnt is an array of pointers to a context type structure * cnt is an array of pointers to a context type structure
* cnt[0] is the default context structure * cnt[0] is the default context structure
* cnt[1], cnt[2], ... are context structures for each thread * cnt[1], cnt[2], ... are context structures for each thread
skipping to change at line 3136 skipping to change at line 3152
printf("-s\t\t\tRun in setup mode.\n"); printf("-s\t\t\tRun in setup mode.\n");
printf("-c config\t\tFull path and filename of config file.\n"); printf("-c config\t\tFull path and filename of config file.\n");
printf("-d level\t\tLog level (1-9) (EMG, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL). default: 6 / NTC.\n"); printf("-d level\t\tLog level (1-9) (EMG, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL). default: 6 / NTC.\n");
printf("-k type\t\t\tType of log (COR, STR, ENC, NET, DBL, EVT, TRK, VID, AL L). default: ALL.\n"); printf("-k type\t\t\tType of log (COR, STR, ENC, NET, DBL, EVT, TRK, VID, AL L). default: ALL.\n");
printf("-p process_id_file\tFull path and filename of process id file (pid f ile).\n"); printf("-p process_id_file\tFull path and filename of process id file (pid f ile).\n");
printf("-l log file \t\tFull path and filename of log file.\n"); printf("-l log file \t\tFull path and filename of log file.\n");
printf("-m\t\t\tDisable motion detection at startup.\n"); printf("-m\t\t\tDisable motion detection at startup.\n");
printf("-h\t\t\tShow this screen.\n"); printf("-h\t\t\tShow this screen.\n");
printf("\n"); printf("\n");
printf("Motion is configured using a config file only. If none is supplied,\ n"); printf("Motion is configured using a config file only. If none is supplied,\ n");
printf("it will read motion.conf from current directory, ~/.motion or %s/mot ion.\n", sysconfdir); printf("it will read motion.conf from current directory, ~/.motion or %s.\n" , sysconfdir);
printf("\n"); printf("\n");
} }
static void config_parms_intl(){ static void config_parms_intl(){
/* This function prints out the configuration parms side by side /* This function prints out the configuration parms side by side
* with the translations. It is currently disabled but put into * with the translations. It is currently disabled but put into
* the code so that they can be found by xgettext. If enabled, then * the code so that they can be found by xgettext. If enabled, then
* it will be printed when called from the conf_load. * it will be printed when called from the conf_load.
*/ */
skipping to change at line 3177 skipping to change at line 3193
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","roundrobin_frames",_("roundr obin_frames")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","roundrobin_frames",_("roundr obin_frames"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","roundrobin_skip",_("roundrob in_skip")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","roundrobin_skip",_("roundrob in_skip"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","roundrobin_switchfilter",_(" roundrobin_switchfilter")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","roundrobin_switchfilter",_(" roundrobin_switchfilter"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_url",_("netcam_url")) ; MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_url",_("netcam_url")) ;
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_highres",_("netcam_hi ghres")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_highres",_("netcam_hi ghres"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_userpass",_("netcam_u serpass")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_userpass",_("netcam_u serpass"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_keepalive",_("netcam_ keepalive")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_keepalive",_("netcam_ keepalive"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_proxy",_("netcam_prox y")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_proxy",_("netcam_prox y"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_tolerant_check",_("ne tcam_tolerant_check")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_tolerant_check",_("ne tcam_tolerant_check"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_use_tcp",_("netcam_us e_tcp")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_use_tcp",_("netcam_us e_tcp"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_decoder",_("netcam_de coder"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","mmalcam_name",_("mmalcam_nam e")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","mmalcam_name",_("mmalcam_nam e"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","mmalcam_control_params",_("m malcam_control_params")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","mmalcam_control_params",_("m malcam_control_params"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","width",_("width")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","width",_("width"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","height",_("height")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","height",_("height"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","framerate",_("framerate")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","framerate",_("framerate"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","minimum_frame_time",_("minim um_frame_time")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","minimum_frame_time",_("minim um_frame_time"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","rotate",_("rotate")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","rotate",_("rotate"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","flip_axis",_("flip_axis")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","flip_axis",_("flip_axis"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","locate_motion_mode",_("locat e_motion_mode")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","locate_motion_mode",_("locat e_motion_mode"));
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","locate_motion_style",_("loca te_motion_style")); MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","locate_motion_style",_("loca te_motion_style"));
 End of changes. 10 change blocks. 
13 lines changed or deleted 29 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)