From c3f68fcaa2fa977d1e64a9b7fb4b7a1604263388 Mon Sep 17 00:00:00 2001 From: Mr-Dave Date: Fri, 14 Oct 2022 22:56:42 -0600 Subject: [PATCH] Remove excess struct usage for ctx items --- src/alg.cpp | 8 +- src/alg_sec.cpp | 4 +- src/alg_sec.hpp | 4 +- src/conf.cpp | 408 ++++++++++++++++++++--------------------- src/conf.hpp | 31 ++-- src/dbse.cpp | 60 +++--- src/draw.cpp | 26 +-- src/draw.hpp | 12 +- src/event.cpp | 104 +++++------ src/event.hpp | 8 +- src/exif.cpp | 6 +- src/exif.hpp | 4 +- src/jpegutils.cpp | 8 +- src/jpegutils.hpp | 4 +- src/libcam.cpp | 6 +- src/logger.cpp | 8 +- src/logger.hpp | 8 +- src/mmalcam.cpp | 8 +- src/mmalcam.hpp | 8 +- src/motion_loop.cpp | 94 +++++----- src/motion_loop.hpp | 2 +- src/motionplus.cpp | 32 ++-- src/motionplus.hpp | 71 +++---- src/movie.cpp | 82 ++++----- src/movie.hpp | 21 +-- src/netcam.cpp | 90 ++++----- src/netcam.hpp | 12 +- src/picture.cpp | 28 +-- src/rotate.cpp | 8 +- src/rotate.hpp | 8 +- src/util.cpp | 28 +-- src/util.hpp | 12 +- src/video_loopback.cpp | 2 +- src/video_loopback.hpp | 2 +- src/video_v4l2.cpp | 12 +- src/video_v4l2.hpp | 8 +- src/webu.cpp | 72 ++++---- src/webu.hpp | 10 +- src/webu_file.cpp | 8 +- src/webu_file.hpp | 4 +- src/webu_html.cpp | 88 ++++----- src/webu_html.hpp | 6 +- src/webu_json.cpp | 18 +- src/webu_json.hpp | 4 +- src/webu_post.cpp | 54 +++--- src/webu_post.hpp | 2 +- src/webu_stream.cpp | 42 ++--- src/webu_stream.hpp | 10 +- 48 files changed, 772 insertions(+), 783 deletions(-) diff --git a/src/alg.cpp b/src/alg.cpp index aba2b5a6..888d07a6 100644 --- a/src/alg.cpp +++ b/src/alg.cpp @@ -41,7 +41,7 @@ typedef struct { void alg_noise_tune(ctx_cam *cam) { - struct ctx_images *imgs = &cam->imgs; + ctx_images *imgs = &cam->imgs; int i; unsigned char *ref = imgs->ref; int diff, sum = 0, count = 0; @@ -199,7 +199,7 @@ static int alg_iflood(int x, int y, int width, int height, static int alg_labeling(ctx_cam *cam) { - struct ctx_images *imgs = &cam->imgs; + ctx_images *imgs = &cam->imgs; unsigned char *out = imgs->image_motion.image_norm; int *labels = imgs->labels; int ix, iy, pixelpos; @@ -836,7 +836,7 @@ static void alg_diff_masksmart(ctx_cam *cam) static bool alg_diff_fast(ctx_cam *cam) { - struct ctx_images *imgs = &cam->imgs; + ctx_images *imgs = &cam->imgs; int i, curdiff, diffs = 0; int step = cam->imgs.motionsize / 10000; int noise = cam->noise; @@ -910,7 +910,7 @@ static void alg_lightswitch(ctx_cam *cam) * * Parameters: * - * cam - current thread's context struct + * cam - current thread's context * action - UPDATE_REF_FRAME or RESET_REF_FRAME * */ diff --git a/src/alg_sec.cpp b/src/alg_sec.cpp index 23351f8c..47fb3d34 100644 --- a/src/alg_sec.cpp +++ b/src/alg_sec.cpp @@ -395,8 +395,8 @@ static void algsec_params_deinit(ctx_algsec_model &algmdl) static void algsec_params_init(ctx_algsec_model &algmdl) { - algmdl.algsec_params = (struct ctx_params*) mymalloc(sizeof(struct ctx_params)); - memset(algmdl.algsec_params, 0, sizeof(struct ctx_params)); + algmdl.algsec_params = (ctx_params*) mymalloc(sizeof(ctx_params)); + memset(algmdl.algsec_params, 0, sizeof(ctx_params)); algmdl.algsec_params->params_array = NULL; algmdl.algsec_params->params_count = 0; algmdl.algsec_params->update_params = true; /*Set trigger to update parameters */ diff --git a/src/alg_sec.hpp b/src/alg_sec.hpp index e29cd620..2ca79fee 100644 --- a/src/alg_sec.hpp +++ b/src/alg_sec.hpp @@ -33,7 +33,7 @@ struct ctx_algsec_model { std::string config; //Source params line - struct ctx_params *algsec_params; + ctx_params *algsec_params; std::string model_file; @@ -74,7 +74,7 @@ struct ctx_algsec { int height; bool isdetected; /* Bool reset for each Motion event as to whether a detection occurred */ pthread_mutex_t mutex; - struct ctx_algsec_model models; + ctx_algsec_model models; }; diff --git a/src/conf.cpp b/src/conf.cpp index f1225be9..8365d2bb 100644 --- a/src/conf.cpp +++ b/src/conf.cpp @@ -33,10 +33,10 @@ enum PARM_ACT{ }; /* Forward Declares */ -void conf_process(struct ctx_motapp *motapp, bool ismotapp, FILE *fp, int threadnbr); +void conf_process(ctx_motapp *motapp, bool ismotapp, FILE *fp, int threadnbr); /*Configuration parameters */ -struct ctx_parm config_parms[] = { +ctx_parm config_parms[] = { {"daemon", PARM_TYP_BOOL, PARM_CAT_00, WEBUI_LEVEL_ADVANCED }, {"setup_mode", PARM_TYP_BOOL, PARM_CAT_00, WEBUI_LEVEL_LIMITED }, {"conf_filename", PARM_TYP_STRING, PARM_CAT_00, WEBUI_LEVEL_ADVANCED }, @@ -219,7 +219,7 @@ struct ctx_parm config_parms[] = { */ /* Array of deprecated config options */ -struct ctx_parm_depr config_parms_depr[] = { +ctx_parm_depr config_parms_depr[] = { { "thread", "3.4.1", @@ -427,7 +427,7 @@ static void conf_edit_get_bool(std::string &parm_dest, bool &parm_in) } } -static void conf_edit_daemon(struct ctx_motapp *motapp, std::string &parm, enum PARM_ACT pact) +static void conf_edit_daemon(ctx_motapp *motapp, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { motapp->daemon = false; @@ -440,7 +440,7 @@ static void conf_edit_daemon(struct ctx_motapp *motapp, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","daemon",_("daemon")); } -static void conf_edit_setup_mode(struct ctx_motapp *motapp, std::string &parm, int pact) +static void conf_edit_setup_mode(ctx_motapp *motapp, std::string &parm, int pact) { if (pact == PARM_ACT_DFLT) { motapp->setup_mode = false; @@ -453,7 +453,7 @@ static void conf_edit_setup_mode(struct ctx_motapp *motapp, std::string &parm, i MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","setup_mode",_("setup_mode")); } -static void conf_edit_conf_filename(struct ctx_motapp *motapp, std::string &parm, enum PARM_ACT pact) +static void conf_edit_conf_filename(ctx_motapp *motapp, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { motapp->conf_filename = ""; @@ -466,7 +466,7 @@ static void conf_edit_conf_filename(struct ctx_motapp *motapp, std::string &parm MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","log_file",_("log_file")); } -static void conf_edit_pid_file(struct ctx_motapp *motapp, std::string &parm, int pact) +static void conf_edit_pid_file(ctx_motapp *motapp, std::string &parm, int pact) { if (pact == PARM_ACT_DFLT) { motapp->pid_file = ""; @@ -479,10 +479,10 @@ static void conf_edit_pid_file(struct ctx_motapp *motapp, std::string &parm, int MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","pid_file",_("pid_file")); } -static void conf_edit_log_file(struct ctx_motapp *motapp, std::string &parm, enum PARM_ACT pact) +static void conf_edit_log_file(ctx_motapp *motapp, std::string &parm, enum PARM_ACT pact) { char lognm[4096]; - struct tm *logtm; + tm *logtm; time_t logt; if (pact == PARM_ACT_DFLT) { @@ -499,7 +499,7 @@ static void conf_edit_log_file(struct ctx_motapp *motapp, std::string &parm, enu MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","log_file",_("log_file")); } -static void conf_edit_log_level(struct ctx_motapp *motapp, std::string &parm, enum PARM_ACT pact) +static void conf_edit_log_level(ctx_motapp *motapp, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -524,7 +524,7 @@ static void conf_edit_log_level(struct ctx_motapp *motapp, std::string &parm, en MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","log_level",_("log_level")); } -static void conf_edit_log_type(struct ctx_motapp *motapp, std::string &parm, enum PARM_ACT pact) +static void conf_edit_log_type(ctx_motapp *motapp, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { motapp->log_type_str = "ALL"; @@ -550,7 +550,7 @@ static void conf_edit_log_type(struct ctx_motapp *motapp, std::string &parm, enu MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","log_type",_("log_type")); } -static void conf_edit_native_language(struct ctx_motapp *motapp, std::string &parm, enum PARM_ACT pact) +static void conf_edit_native_language(ctx_motapp *motapp, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { motapp->native_language = true; @@ -567,7 +567,7 @@ static void conf_edit_native_language(struct ctx_motapp *motapp, std::string &pa /************************************************************************/ /************************************************************************/ -static void conf_edit_camera(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_camera(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { /* This edit routine is special for the camera. * We are dealing with the file name that is still a char @@ -587,7 +587,7 @@ static void conf_edit_camera(struct ctx_cam *cam, std::string &parm, enum PARM_A MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","camera",_("camera")); } -static void conf_edit_camera_name(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_camera_name(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->camera_name= ""; @@ -600,7 +600,7 @@ static void conf_edit_camera_name(struct ctx_cam *cam, std::string &parm, enum P MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","camera_name",_("camera_name")); } -static void conf_edit_camera_id(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_camera_id(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; @@ -628,7 +628,7 @@ static void conf_edit_camera_id(struct ctx_cam *cam, std::string &parm, enum PAR MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","camera_id",_("camera_id")); } -static void conf_edit_camera_tmo(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_camera_tmo(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -647,7 +647,7 @@ static void conf_edit_camera_tmo(struct ctx_cam *cam, std::string &parm, enum PA MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","camera_tmo",_("camera_tmo")); } -static void conf_edit_camera_dir(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_camera_dir(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->camera_dir = ""; @@ -660,7 +660,7 @@ static void conf_edit_camera_dir(struct ctx_cam *cam, std::string &parm, enum PA MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","camera_dir",_("camera_dir")); } -static void conf_edit_target_dir(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_target_dir(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->target_dir = "."; @@ -679,7 +679,7 @@ static void conf_edit_target_dir(struct ctx_cam *cam, std::string &parm, enum PA MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","target_dir",_("target_dir")); } -static void conf_edit_watchdog_tmo(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_watchdog_tmo(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -698,7 +698,7 @@ static void conf_edit_watchdog_tmo(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","watchdog_tmo",_("watchdog_tmo")); } -static void conf_edit_watchdog_kill(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_watchdog_kill(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -717,7 +717,7 @@ static void conf_edit_watchdog_kill(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","watchdog_kill",_("watchdog_kill")); } -static void conf_edit_v4l2_device(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_v4l2_device(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->v4l2_device = "/dev/video0"; @@ -730,7 +730,7 @@ static void conf_edit_v4l2_device(struct ctx_cam *cam, std::string &parm, enum P MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","v4l2_device",_("v4l2_device")); } -static void conf_edit_v4l2_params(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_v4l2_params(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->v4l2_params = ""; @@ -743,7 +743,7 @@ static void conf_edit_v4l2_params(struct ctx_cam *cam, std::string &parm, enum P MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","v4l2_params",_("v4l2_params")); } -static void conf_edit_netcam_url(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_netcam_url(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->netcam_url = ""; @@ -756,7 +756,7 @@ static void conf_edit_netcam_url(struct ctx_cam *cam, std::string &parm, enum PA MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_url",_("netcam_url")); } -static void conf_edit_netcam_params(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_netcam_params(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->netcam_params = ""; @@ -769,7 +769,7 @@ static void conf_edit_netcam_params(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_params",_("netcam_params")); } -static void conf_edit_netcam_high_url(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_netcam_high_url(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->netcam_high_url = ""; @@ -782,7 +782,7 @@ static void conf_edit_netcam_high_url(struct ctx_cam *cam, std::string &parm, en MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_high_url",_("netcam_high_url")); } -static void conf_edit_netcam_high_params(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_netcam_high_params(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->netcam_high_params = ""; @@ -795,7 +795,7 @@ static void conf_edit_netcam_high_params(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_high_params",_("netcam_high_params")); } -static void conf_edit_netcam_userpass(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_netcam_userpass(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->netcam_userpass = ""; @@ -808,7 +808,7 @@ static void conf_edit_netcam_userpass(struct ctx_cam *cam, std::string &parm, en MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","netcam_userpass",_("netcam_userpass")); } -static void conf_edit_mmalcam_name(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_mmalcam_name(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->mmalcam_name = ""; @@ -821,7 +821,7 @@ static void conf_edit_mmalcam_name(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","mmalcam_name",_("mmalcam_name")); } -static void conf_edit_mmalcam_params(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_mmalcam_params(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->mmalcam_params = ""; @@ -834,7 +834,7 @@ static void conf_edit_mmalcam_params(struct ctx_cam *cam, std::string &parm, enu MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","mmalcam_params",_("mmalcam_params")); } -static void conf_edit_libcam_name(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_libcam_name(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->libcam_name = ""; @@ -847,7 +847,7 @@ static void conf_edit_libcam_name(struct ctx_cam *cam, std::string &parm, enum P MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","libcam_name",_("libcam_name")); } -static void conf_edit_libcam_params(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_libcam_params(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->libcam_params = ""; @@ -860,7 +860,7 @@ static void conf_edit_libcam_params(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","libcam_params",_("libcam_params")); } -static void conf_edit_width(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_width(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -886,7 +886,7 @@ static void conf_edit_width(struct ctx_cam *cam, std::string &parm, enum PARM_AC MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","width",_("width")); } -static void conf_edit_height(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_height(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -912,7 +912,7 @@ static void conf_edit_height(struct ctx_cam *cam, std::string &parm, enum PARM_A MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","height",_("height")); } -static void conf_edit_framerate(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_framerate(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -931,7 +931,7 @@ static void conf_edit_framerate(struct ctx_cam *cam, std::string &parm, enum PAR MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","framerate",_("framerate")); } -static void conf_edit_minimum_frame_time(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_minimum_frame_time(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -950,7 +950,7 @@ static void conf_edit_minimum_frame_time(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","minimum_frame_time",_("minimum_frame_time")); } -static void conf_edit_rotate(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_rotate(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -972,7 +972,7 @@ static void conf_edit_rotate(struct ctx_cam *cam, std::string &parm, enum PARM_A MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","rotate",_("rotate")); } -static void conf_edit_flip_axis(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_flip_axis(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->flip_axis = "none"; @@ -994,7 +994,7 @@ static void conf_edit_flip_axis(struct ctx_cam *cam, std::string &parm, enum PAR MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","flip_axis",_("flip_axis")); } -static void conf_edit_locate_motion_mode(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_locate_motion_mode(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->locate_motion_mode = "off"; @@ -1015,7 +1015,7 @@ static void conf_edit_locate_motion_mode(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","locate_motion_mode",_("locate_motion_mode")); } -static void conf_edit_locate_motion_style(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_locate_motion_style(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->locate_motion_style = "box"; @@ -1037,7 +1037,7 @@ static void conf_edit_locate_motion_style(struct ctx_cam *cam, std::string &parm MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","locate_motion_style",_("locate_motion_style")); } -static void conf_edit_text_left(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_text_left(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->text_left = ""; @@ -1050,7 +1050,7 @@ static void conf_edit_text_left(struct ctx_cam *cam, std::string &parm, enum PAR MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","text_left",_("text_left")); } -static void conf_edit_text_right(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_text_right(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->text_right = "%Y-%m-%d\\n%T"; @@ -1063,7 +1063,7 @@ static void conf_edit_text_right(struct ctx_cam *cam, std::string &parm, enum PA MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","text_right",_("text_right")); } -static void conf_edit_text_changes(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_text_changes(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->text_changes = false; @@ -1076,7 +1076,7 @@ static void conf_edit_text_changes(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","text_changes",_("text_changes")); } -static void conf_edit_text_scale(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_text_scale(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1100,7 +1100,7 @@ static void conf_edit_text_scale(struct ctx_cam *cam, std::string &parm, enum PA MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","text_scale",_("text_scale")); } -static void conf_edit_text_event(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_text_event(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->text_event = "%Y%m%d%H%M%S"; @@ -1113,7 +1113,7 @@ static void conf_edit_text_event(struct ctx_cam *cam, std::string &parm, enum PA MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","text_event",_("text_event")); } -static void conf_edit_emulate_motion(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_emulate_motion(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->emulate_motion = false; @@ -1126,7 +1126,7 @@ static void conf_edit_emulate_motion(struct ctx_cam *cam, std::string &parm, enu MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","emulate_motion",_("emulate_motion")); } -static void conf_edit_threshold(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_threshold(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1145,7 +1145,7 @@ static void conf_edit_threshold(struct ctx_cam *cam, std::string &parm, enum PAR MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","threshold",_("threshold")); } -static void conf_edit_threshold_maximum(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_threshold_maximum(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1164,7 +1164,7 @@ static void conf_edit_threshold_maximum(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","threshold_maximum",_("threshold_maximum")); } -static void conf_edit_threshold_sdevx(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_threshold_sdevx(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1183,7 +1183,7 @@ static void conf_edit_threshold_sdevx(struct ctx_cam *cam, std::string &parm, en MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","threshold_sdevx",_("threshold_sdevx")); } -static void conf_edit_threshold_sdevy(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_threshold_sdevy(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1202,7 +1202,7 @@ static void conf_edit_threshold_sdevy(struct ctx_cam *cam, std::string &parm, en MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","threshold_sdevy",_("threshold_sdevy")); } -static void conf_edit_threshold_sdevxy(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_threshold_sdevxy(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1221,7 +1221,7 @@ static void conf_edit_threshold_sdevxy(struct ctx_cam *cam, std::string &parm, e MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","threshold_sdevxy",_("threshold_sdevxy")); } -static void conf_edit_threshold_ratio(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_threshold_ratio(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1240,7 +1240,7 @@ static void conf_edit_threshold_ratio(struct ctx_cam *cam, std::string &parm, en MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","threshold_ratio",_("threshold_ratio")); } -static void conf_edit_threshold_ratio_change(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_threshold_ratio_change(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1259,7 +1259,7 @@ static void conf_edit_threshold_ratio_change(struct ctx_cam *cam, std::string &p MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","threshold_ratio_change",_("threshold_ratio_change")); } -static void conf_edit_threshold_tune(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_threshold_tune(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->threshold_tune = false; @@ -1272,7 +1272,7 @@ static void conf_edit_threshold_tune(struct ctx_cam *cam, std::string &parm, enu MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","threshold_tune",_("threshold_tune")); } -static void conf_edit_secondary_interval(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_secondary_interval(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1291,7 +1291,7 @@ static void conf_edit_secondary_interval(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","secondary_interval",_("secondary_interval")); } -static void conf_edit_secondary_method(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_secondary_method(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->secondary_method = "none"; @@ -1313,7 +1313,7 @@ static void conf_edit_secondary_method(struct ctx_cam *cam, std::string &parm, e MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","secondary_method",_("secondary_method")); } -static void conf_edit_secondary_params(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_secondary_params(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->secondary_params = ""; @@ -1326,7 +1326,7 @@ static void conf_edit_secondary_params(struct ctx_cam *cam, std::string &parm, e MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","secondary_params",_("secondary_params")); } -static void conf_edit_noise_level(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_noise_level(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1345,7 +1345,7 @@ static void conf_edit_noise_level(struct ctx_cam *cam, std::string &parm, enum P MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","noise_level",_("noise_level")); } -static void conf_edit_noise_tune(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_noise_tune(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->noise_tune = true; @@ -1358,7 +1358,7 @@ static void conf_edit_noise_tune(struct ctx_cam *cam, std::string &parm, enum PA MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","noise_tune",_("noise_tune")); } -static void conf_edit_despeckle_filter(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_despeckle_filter(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->despeckle_filter = ""; @@ -1371,7 +1371,7 @@ static void conf_edit_despeckle_filter(struct ctx_cam *cam, std::string &parm, e MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","despeckle_filter",_("despeckle_filter")); } -static void conf_edit_area_detect(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_area_detect(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->area_detect = ""; @@ -1384,7 +1384,7 @@ static void conf_edit_area_detect(struct ctx_cam *cam, std::string &parm, enum P MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","area_detect",_("area_detect")); } -static void conf_edit_mask_file(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_mask_file(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->mask_file = ""; @@ -1397,7 +1397,7 @@ static void conf_edit_mask_file(struct ctx_cam *cam, std::string &parm, enum PAR MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","mask_file",_("mask_file")); } -static void conf_edit_mask_privacy(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_mask_privacy(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->mask_privacy = ""; @@ -1410,7 +1410,7 @@ static void conf_edit_mask_privacy(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","mask_privacy",_("mask_privacy")); } -static void conf_edit_smart_mask_speed(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_smart_mask_speed(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1434,7 +1434,7 @@ static void conf_edit_smart_mask_speed(struct ctx_cam *cam, std::string &parm, e MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","smart_mask_speed",_("smart_mask_speed")); } -static void conf_edit_lightswitch_percent(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_lightswitch_percent(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1453,7 +1453,7 @@ static void conf_edit_lightswitch_percent(struct ctx_cam *cam, std::string &parm MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","lightswitch_percent",_("lightswitch_percent")); } -static void conf_edit_lightswitch_frames(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_lightswitch_frames(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1472,7 +1472,7 @@ static void conf_edit_lightswitch_frames(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","lightswitch_frames",_("lightswitch_frames")); } -static void conf_edit_minimum_motion_frames(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_minimum_motion_frames(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1491,7 +1491,7 @@ static void conf_edit_minimum_motion_frames(struct ctx_cam *cam, std::string &pa MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","minimum_motion_frames",_("minimum_motion_frames")); } -static void conf_edit_static_object_time(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_static_object_time(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1510,7 +1510,7 @@ static void conf_edit_static_object_time(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","static_object_time",_("static_object_time")); } -static void conf_edit_event_gap(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_event_gap(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1529,7 +1529,7 @@ static void conf_edit_event_gap(struct ctx_cam *cam, std::string &parm, enum PAR MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","event_gap",_("event_gap")); } -static void conf_edit_pre_capture(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_pre_capture(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1548,7 +1548,7 @@ static void conf_edit_pre_capture(struct ctx_cam *cam, std::string &parm, enum P MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","pre_capture",_("pre_capture")); } -static void conf_edit_post_capture(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_post_capture(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1567,7 +1567,7 @@ static void conf_edit_post_capture(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","post_capture",_("post_capture")); } -static void conf_edit_on_event_start(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_on_event_start(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->on_event_start = ""; @@ -1580,7 +1580,7 @@ static void conf_edit_on_event_start(struct ctx_cam *cam, std::string &parm, enu MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","on_event_start",_("on_event_start")); } -static void conf_edit_on_event_end(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_on_event_end(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->on_event_end = ""; @@ -1593,7 +1593,7 @@ static void conf_edit_on_event_end(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","on_event_end",_("on_event_end")); } -static void conf_edit_on_picture_save(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_on_picture_save(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->on_picture_save = ""; @@ -1606,7 +1606,7 @@ static void conf_edit_on_picture_save(struct ctx_cam *cam, std::string &parm, en MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","on_picture_save",_("on_picture_save")); } -static void conf_edit_on_area_detected(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_on_area_detected(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->on_area_detected = ""; @@ -1619,7 +1619,7 @@ static void conf_edit_on_area_detected(struct ctx_cam *cam, std::string &parm, e MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","on_area_detected",_("on_area_detected")); } -static void conf_edit_on_motion_detected(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_on_motion_detected(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->on_motion_detected = ""; @@ -1632,7 +1632,7 @@ static void conf_edit_on_motion_detected(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","on_motion_detected",_("on_motion_detected")); } -static void conf_edit_on_movie_start(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_on_movie_start(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->on_movie_start = ""; @@ -1645,7 +1645,7 @@ static void conf_edit_on_movie_start(struct ctx_cam *cam, std::string &parm, enu MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","on_movie_start",_("on_movie_start")); } -static void conf_edit_on_movie_end(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_on_movie_end(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->on_movie_end = ""; @@ -1658,7 +1658,7 @@ static void conf_edit_on_movie_end(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","on_movie_end",_("on_movie_end")); } -static void conf_edit_on_camera_lost(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_on_camera_lost(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->on_camera_lost = ""; @@ -1671,7 +1671,7 @@ static void conf_edit_on_camera_lost(struct ctx_cam *cam, std::string &parm, enu MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","on_camera_lost",_("on_camera_lost")); } -static void conf_edit_on_camera_found(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_on_camera_found(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->on_camera_found = ""; @@ -1684,7 +1684,7 @@ static void conf_edit_on_camera_found(struct ctx_cam *cam, std::string &parm, en MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","on_camera_found",_("on_camera_found")); } -static void conf_edit_on_secondary_detect(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_on_secondary_detect(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->on_secondary_detect = ""; @@ -1697,7 +1697,7 @@ static void conf_edit_on_secondary_detect(struct ctx_cam *cam, std::string &parm MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","on_secondary_detect",_("on_secondary_detect")); } -static void conf_edit_picture_output(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_picture_output(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->picture_output = "off"; @@ -1721,7 +1721,7 @@ static void conf_edit_picture_output(struct ctx_cam *cam, std::string &parm, enu MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","picture_output",_("picture_output")); } -static void conf_edit_picture_output_motion(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_picture_output_motion(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->picture_output_motion = "off"; @@ -1744,7 +1744,7 @@ static void conf_edit_picture_output_motion(struct ctx_cam *cam, std::string &pa MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","picture_output_motion",_("picture_output_motion")); } -static void conf_edit_picture_type(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_picture_type(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->picture_type = "jpeg"; @@ -1767,7 +1767,7 @@ static void conf_edit_picture_type(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","picture_type",_("picture_type")); } -static void conf_edit_picture_quality(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_picture_quality(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1786,7 +1786,7 @@ static void conf_edit_picture_quality(struct ctx_cam *cam, std::string &parm, en MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","picture_quality",_("picture_quality")); } -static void conf_edit_picture_exif(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_picture_exif(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->picture_exif = ""; @@ -1799,7 +1799,7 @@ static void conf_edit_picture_exif(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","picture_exif",_("picture_exif")); } -static void conf_edit_picture_filename(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_picture_filename(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->picture_filename = "%v-%Y%m%d%H%M%S-%q"; @@ -1812,7 +1812,7 @@ static void conf_edit_picture_filename(struct ctx_cam *cam, std::string &parm, e MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","picture_filename",_("picture_filename")); } -static void conf_edit_snapshot_interval(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_snapshot_interval(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1831,7 +1831,7 @@ static void conf_edit_snapshot_interval(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","snapshot_interval",_("snapshot_interval")); } -static void conf_edit_snapshot_filename(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_snapshot_filename(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->snapshot_filename = "%v-%Y%m%d%H%M%S-snapshot"; @@ -1844,7 +1844,7 @@ static void conf_edit_snapshot_filename(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","snapshot_filename",_("snapshot_filename")); } -static void conf_edit_movie_output(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_movie_output(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->movie_output = true; @@ -1857,7 +1857,7 @@ static void conf_edit_movie_output(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","movie_output",_("movie_output")); } -static void conf_edit_movie_output_motion(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_movie_output_motion(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->movie_output_motion = false; @@ -1870,7 +1870,7 @@ static void conf_edit_movie_output_motion(struct ctx_cam *cam, std::string &parm MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","movie_output_motion",_("movie_output_motion")); } -static void conf_edit_movie_max_time(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_movie_max_time(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1889,7 +1889,7 @@ static void conf_edit_movie_max_time(struct ctx_cam *cam, std::string &parm, enu MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","movie_max_time",_("movie_max_time")); } -static void conf_edit_movie_bps(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_movie_bps(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1908,7 +1908,7 @@ static void conf_edit_movie_bps(struct ctx_cam *cam, std::string &parm, enum PAR MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","movie_bps",_("movie_bps")); } -static void conf_edit_movie_quality(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_movie_quality(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -1927,7 +1927,7 @@ static void conf_edit_movie_quality(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","movie_quality",_("movie_quality")); } -static void conf_edit_movie_container(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_movie_container(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->movie_container = "mkv"; @@ -1940,7 +1940,7 @@ static void conf_edit_movie_container(struct ctx_cam *cam, std::string &parm, en MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","movie_container",_("movie_container")); } -static void conf_edit_movie_passthrough(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_movie_passthrough(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->movie_passthrough = false; @@ -1953,7 +1953,7 @@ static void conf_edit_movie_passthrough(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","movie_passthrough",_("movie_passthrough")); } -static void conf_edit_movie_filename(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_movie_filename(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->movie_filename = "%v-%Y%m%d%H%M%S"; @@ -1966,7 +1966,7 @@ static void conf_edit_movie_filename(struct ctx_cam *cam, std::string &parm, enu MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","movie_filename",_("movie_filename")); } -static void conf_edit_movie_retain(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_movie_retain(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->movie_retain = "all"; @@ -1989,7 +1989,7 @@ static void conf_edit_movie_retain(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","movie_retain",_("movie_retain")); } -static void conf_edit_movie_extpipe_use(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_movie_extpipe_use(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->movie_extpipe_use = false; @@ -2002,7 +2002,7 @@ static void conf_edit_movie_extpipe_use(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","movie_extpipe_use",_("movie_extpipe_use")); } -static void conf_edit_movie_extpipe(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_movie_extpipe(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->movie_extpipe = ""; @@ -2015,7 +2015,7 @@ static void conf_edit_movie_extpipe(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","movie_extpipe",_("movie_extpipe")); } -static void conf_edit_timelapse_interval(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_timelapse_interval(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -2034,7 +2034,7 @@ static void conf_edit_timelapse_interval(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","timelapse_interval",_("timelapse_interval")); } -static void conf_edit_timelapse_mode(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_timelapse_mode(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->timelapse_mode = "daily"; @@ -2060,7 +2060,7 @@ static void conf_edit_timelapse_mode(struct ctx_cam *cam, std::string &parm, enu MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","timelapse_mode",_("timelapse_mode")); } -static void conf_edit_timelapse_fps(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_timelapse_fps(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -2079,7 +2079,7 @@ static void conf_edit_timelapse_fps(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","timelapse_fps",_("timelapse_fps")); } -static void conf_edit_timelapse_container(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_timelapse_container(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->timelapse_container = "mpg"; @@ -2102,7 +2102,7 @@ static void conf_edit_timelapse_container(struct ctx_cam *cam, std::string &parm MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","timelapse_container",_("timelapse_container")); } -static void conf_edit_timelapse_filename(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_timelapse_filename(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->timelapse_filename = "%Y%m%d-timelapse"; @@ -2115,7 +2115,7 @@ static void conf_edit_timelapse_filename(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","timelapse_filename",_("timelapse_filename")); } -static void conf_edit_video_pipe(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_video_pipe(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->video_pipe = ""; @@ -2128,7 +2128,7 @@ static void conf_edit_video_pipe(struct ctx_cam *cam, std::string &parm, enum PA MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","video_pipe",_("video_pipe")); } -static void conf_edit_video_pipe_motion(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_video_pipe_motion(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->video_pipe_motion = ""; @@ -2141,7 +2141,7 @@ static void conf_edit_video_pipe_motion(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","video_pipe_motion",_("video_pipe_motion")); } -static void conf_edit_webcontrol_port(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_webcontrol_port(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -2160,7 +2160,7 @@ static void conf_edit_webcontrol_port(struct ctx_cam *cam, std::string &parm, en MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","webcontrol_port",_("webcontrol_port")); } -static void conf_edit_webcontrol_base_path(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_webcontrol_base_path(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->webcontrol_base_path = ""; @@ -2187,7 +2187,7 @@ static void conf_edit_webcontrol_base_path(struct ctx_cam *cam, std::string &par MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","webcontrol_base_path",_("webcontrol_base_path")); } -static void conf_edit_webcontrol_ipv6(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_webcontrol_ipv6(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->webcontrol_ipv6 = false; @@ -2200,7 +2200,7 @@ static void conf_edit_webcontrol_ipv6(struct ctx_cam *cam, std::string &parm, en MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","webcontrol_ipv6",_("webcontrol_ipv6")); } -static void conf_edit_webcontrol_localhost(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_webcontrol_localhost(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->webcontrol_localhost = true; @@ -2213,7 +2213,7 @@ static void conf_edit_webcontrol_localhost(struct ctx_cam *cam, std::string &par MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","webcontrol_localhost",_("webcontrol_localhost")); } -static void conf_edit_webcontrol_parms(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_webcontrol_parms(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -2236,7 +2236,7 @@ static void conf_edit_webcontrol_parms(struct ctx_cam *cam, std::string &parm, e MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","webcontrol_parms",_("webcontrol_parms")); } -static void conf_edit_webcontrol_interface(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_webcontrol_interface(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->webcontrol_interface = "default"; @@ -2259,7 +2259,7 @@ static void conf_edit_webcontrol_interface(struct ctx_cam *cam, std::string &par MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","webcontrol_interface",_("webcontrol_interface")); } -static void conf_edit_webcontrol_auth_method(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_webcontrol_auth_method(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->webcontrol_auth_method = "none"; @@ -2282,7 +2282,7 @@ static void conf_edit_webcontrol_auth_method(struct ctx_cam *cam, std::string &p MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","webcontrol_auth_method",_("webcontrol_auth_method")); } -static void conf_edit_webcontrol_authentication(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_webcontrol_authentication(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->webcontrol_authentication = ""; @@ -2295,7 +2295,7 @@ static void conf_edit_webcontrol_authentication(struct ctx_cam *cam, std::string MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","webcontrol_authentication",_("webcontrol_authentication")); } -static void conf_edit_webcontrol_tls(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_webcontrol_tls(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->webcontrol_tls = false; @@ -2308,7 +2308,7 @@ static void conf_edit_webcontrol_tls(struct ctx_cam *cam, std::string &parm, enu MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","webcontrol_tls",_("webcontrol_tls")); } -static void conf_edit_webcontrol_cert(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_webcontrol_cert(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->webcontrol_cert = ""; @@ -2321,7 +2321,7 @@ static void conf_edit_webcontrol_cert(struct ctx_cam *cam, std::string &parm, en MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","webcontrol_cert",_("webcontrol_cert")); } -static void conf_edit_webcontrol_key(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_webcontrol_key(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->webcontrol_key = ""; @@ -2334,7 +2334,7 @@ static void conf_edit_webcontrol_key(struct ctx_cam *cam, std::string &parm, enu MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","webcontrol_key",_("webcontrol_key")); } -static void conf_edit_webcontrol_headers(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_webcontrol_headers(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->webcontrol_headers = ""; @@ -2347,7 +2347,7 @@ static void conf_edit_webcontrol_headers(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","webcontrol_headers",_("webcontrol_headers")); } -static void conf_edit_webcontrol_html(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_webcontrol_html(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->webcontrol_html = ""; @@ -2360,7 +2360,7 @@ static void conf_edit_webcontrol_html(struct ctx_cam *cam, std::string &parm, en MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","webcontrol_html",_("webcontrol_html")); } -static void conf_edit_webcontrol_actions(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_webcontrol_actions(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->webcontrol_actions = ""; @@ -2373,7 +2373,7 @@ static void conf_edit_webcontrol_actions(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","webcontrol_actions",_("webcontrol_actions")); } -static void conf_edit_webcontrol_lock_minutes(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_webcontrol_lock_minutes(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -2392,7 +2392,7 @@ static void conf_edit_webcontrol_lock_minutes(struct ctx_cam *cam, std::string & MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","webcontrol_lock_minutes",_("webcontrol_lock_minutes")); } -static void conf_edit_webcontrol_lock_attempts(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_webcontrol_lock_attempts(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -2411,7 +2411,7 @@ static void conf_edit_webcontrol_lock_attempts(struct ctx_cam *cam, std::string MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","webcontrol_lock_attempts",_("webcontrol_lock_attempts")); } -static void conf_edit_stream_preview_scale(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_stream_preview_scale(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -2430,7 +2430,7 @@ static void conf_edit_stream_preview_scale(struct ctx_cam *cam, std::string &par MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","stream_preview_scale",_("stream_preview_scale")); } -static void conf_edit_stream_preview_newline(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_stream_preview_newline(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->stream_preview_newline = false; @@ -2443,7 +2443,7 @@ static void conf_edit_stream_preview_newline(struct ctx_cam *cam, std::string &p MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","stream_preview_newline",_("stream_preview_newline")); } -static void conf_edit_stream_preview_method(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_stream_preview_method(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->stream_preview_method = "mjpg"; @@ -2466,7 +2466,7 @@ static void conf_edit_stream_preview_method(struct ctx_cam *cam, std::string &pa MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","stream_preview_method",_("stream_preview_method")); } -static void conf_edit_stream_preview_ptz(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_stream_preview_ptz(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->stream_preview_ptz = true; @@ -2479,7 +2479,7 @@ static void conf_edit_stream_preview_ptz(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","stream_preview_ptz",_("stream_preview_ptz")); } -static void conf_edit_stream_quality(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_stream_quality(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -2498,7 +2498,7 @@ static void conf_edit_stream_quality(struct ctx_cam *cam, std::string &parm, enu MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","stream_quality",_("stream_quality")); } -static void conf_edit_stream_grey(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_stream_grey(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->stream_grey = false; @@ -2511,7 +2511,7 @@ static void conf_edit_stream_grey(struct ctx_cam *cam, std::string &parm, enum P MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","stream_grey",_("stream_grey")); } -static void conf_edit_stream_motion(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_stream_motion(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->stream_motion = false; @@ -2524,7 +2524,7 @@ static void conf_edit_stream_motion(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","stream_motion",_("stream_motion")); } -static void conf_edit_stream_maxrate(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_stream_maxrate(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -2543,7 +2543,7 @@ static void conf_edit_stream_maxrate(struct ctx_cam *cam, std::string &parm, enu MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","stream_maxrate",_("stream_maxrate")); } -static void conf_edit_stream_scan_time(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_stream_scan_time(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -2562,7 +2562,7 @@ static void conf_edit_stream_scan_time(struct ctx_cam *cam, std::string &parm, e MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","stream_scan_time",_("stream_scan_time")); } -static void conf_edit_stream_scan_scale(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_stream_scan_scale(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -2581,7 +2581,7 @@ static void conf_edit_stream_scan_scale(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","stream_scan_scale",_("stream_scan_scale")); } -static void conf_edit_database_type(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_database_type(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->database_type = ""; @@ -2603,7 +2603,7 @@ static void conf_edit_database_type(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","database_type",_("database_type")); } -static void conf_edit_database_dbname(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_database_dbname(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->database_dbname = ""; @@ -2616,7 +2616,7 @@ static void conf_edit_database_dbname(struct ctx_cam *cam, std::string &parm, en MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","database_dbname",_("database_dbname")); } -static void conf_edit_database_host(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_database_host(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->database_host = ""; @@ -2629,7 +2629,7 @@ static void conf_edit_database_host(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","database_host",_("database_host")); } -static void conf_edit_database_port(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_database_port(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -2648,7 +2648,7 @@ static void conf_edit_database_port(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","database_port",_("database_port")); } -static void conf_edit_database_user(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_database_user(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->database_user = ""; @@ -2661,7 +2661,7 @@ static void conf_edit_database_user(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","database_user",_("database_user")); } -static void conf_edit_database_password(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_database_password(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->database_password = ""; @@ -2674,7 +2674,7 @@ static void conf_edit_database_password(struct ctx_cam *cam, std::string &parm, MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","database_password",_("database_password")); } -static void conf_edit_database_busy_timeout(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_database_busy_timeout(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -2693,7 +2693,7 @@ static void conf_edit_database_busy_timeout(struct ctx_cam *cam, std::string &pa MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","database_busy_timeout",_("database_busy_timeout")); } -static void conf_edit_sql_event_start(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_sql_event_start(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->sql_event_start = ""; @@ -2706,7 +2706,7 @@ static void conf_edit_sql_event_start(struct ctx_cam *cam, std::string &parm, en MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","sql_event_start",_("sql_event_start")); } -static void conf_edit_sql_event_end(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_sql_event_end(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->sql_event_end = ""; @@ -2719,7 +2719,7 @@ static void conf_edit_sql_event_end(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","sql_event_end",_("sql_event_end")); } -static void conf_edit_sql_movie_start(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_sql_movie_start(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->sql_movie_start = ""; @@ -2732,7 +2732,7 @@ static void conf_edit_sql_movie_start(struct ctx_cam *cam, std::string &parm, en MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","sql_movie_start",_("sql_movie_start")); } -static void conf_edit_sql_movie_end(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_sql_movie_end(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->sql_movie_end = ""; @@ -2745,7 +2745,7 @@ static void conf_edit_sql_movie_end(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","sql_movie_end",_("sql_movie_end")); } -static void conf_edit_sql_pic_save(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_sql_pic_save(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->sql_pic_save = ""; @@ -2758,7 +2758,7 @@ static void conf_edit_sql_pic_save(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","sql_pic_save",_("sql_pic_save")); } -static void conf_edit_ptz_auto_track(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_ptz_auto_track(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->ptz_auto_track = false; @@ -2771,7 +2771,7 @@ static void conf_edit_ptz_auto_track(struct ctx_cam *cam, std::string &parm, enu MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","ptz_auto_track",_("ptz_auto_track")); } -static void conf_edit_ptz_wait(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_ptz_wait(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { int parm_in; if (pact == PARM_ACT_DFLT) { @@ -2790,7 +2790,7 @@ static void conf_edit_ptz_wait(struct ctx_cam *cam, std::string &parm, enum PARM MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","ptz_wait",_("ptz_wait")); } -static void conf_edit_ptz_move_track(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_ptz_move_track(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->ptz_move_track = ""; @@ -2803,7 +2803,7 @@ static void conf_edit_ptz_move_track(struct ctx_cam *cam, std::string &parm, enu MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","ptz_move_track",_("ptz_move_track")); } -static void conf_edit_ptz_pan_left(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_ptz_pan_left(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->ptz_pan_left = ""; @@ -2816,7 +2816,7 @@ static void conf_edit_ptz_pan_left(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","ptz_pan_left",_("ptz_pan_left")); } -static void conf_edit_ptz_pan_right(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_ptz_pan_right(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->ptz_pan_right = ""; @@ -2829,7 +2829,7 @@ static void conf_edit_ptz_pan_right(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","ptz_pan_right",_("ptz_pan_right")); } -static void conf_edit_ptz_tilt_up(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_ptz_tilt_up(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->ptz_tilt_up = ""; @@ -2842,7 +2842,7 @@ static void conf_edit_ptz_tilt_up(struct ctx_cam *cam, std::string &parm, enum P MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","ptz_tilt_up",_("ptz_tilt_up")); } -static void conf_edit_ptz_tilt_down(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_ptz_tilt_down(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->ptz_tilt_down = ""; @@ -2855,7 +2855,7 @@ static void conf_edit_ptz_tilt_down(struct ctx_cam *cam, std::string &parm, enum MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","ptz_tilt_down",_("ptz_tilt_down")); } -static void conf_edit_ptz_zoom_in(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_ptz_zoom_in(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->ptz_zoom_in = ""; @@ -2868,7 +2868,7 @@ static void conf_edit_ptz_zoom_in(struct ctx_cam *cam, std::string &parm, enum P MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,"%s:%s","ptz_zoom_in",_("ptz_zoom_in")); } -static void conf_edit_ptz_zoom_out(struct ctx_cam *cam, std::string &parm, enum PARM_ACT pact) +static void conf_edit_ptz_zoom_out(ctx_cam *cam, std::string &parm, enum PARM_ACT pact) { if (pact == PARM_ACT_DFLT) { cam->conf->ptz_zoom_out = ""; @@ -2882,7 +2882,7 @@ static void conf_edit_ptz_zoom_out(struct ctx_cam *cam, std::string &parm, enum } /* Application level parameters */ -static void conf_edit_cat00(struct ctx_motapp *motapp, std::string cmd +static void conf_edit_cat00(ctx_motapp *motapp, std::string cmd , std::string &parm_val, enum PARM_ACT pact) { if (cmd == "daemon") { conf_edit_daemon(motapp, parm_val, pact); @@ -2897,7 +2897,7 @@ static void conf_edit_cat00(struct ctx_motapp *motapp, std::string cmd } -static void conf_edit_cat01(struct ctx_cam *cam, std::string parm_nm +static void conf_edit_cat01(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_ACT pact) { if (parm_nm == "camera_dir") { conf_edit_camera_dir(cam, parm_val, pact); @@ -2912,7 +2912,7 @@ static void conf_edit_cat01(struct ctx_cam *cam, std::string parm_nm } -static void conf_edit_cat02(struct ctx_cam *cam, std::string parm_nm +static void conf_edit_cat02(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_ACT pact) { @@ -2931,7 +2931,7 @@ static void conf_edit_cat02(struct ctx_cam *cam, std::string parm_nm } -static void conf_edit_cat03(struct ctx_cam *cam, std::string parm_nm +static void conf_edit_cat03(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_ACT pact) { if (parm_nm == "width") { conf_edit_width(cam, parm_val, pact); @@ -2944,7 +2944,7 @@ static void conf_edit_cat03(struct ctx_cam *cam, std::string parm_nm } -static void conf_edit_cat04(struct ctx_cam *cam, std::string parm_nm +static void conf_edit_cat04(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_ACT pact) { if (parm_nm == "locate_motion_mode") { conf_edit_locate_motion_mode(cam, parm_val, pact); @@ -2958,7 +2958,7 @@ static void conf_edit_cat04(struct ctx_cam *cam, std::string parm_nm } -static void conf_edit_cat05(struct ctx_cam *cam, std::string parm_nm +static void conf_edit_cat05(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_ACT pact) { if (parm_nm == "emulate_motion") { conf_edit_emulate_motion(cam, parm_val, pact); @@ -2977,7 +2977,7 @@ static void conf_edit_cat05(struct ctx_cam *cam, std::string parm_nm } -static void conf_edit_cat06(struct ctx_cam *cam, std::string parm_nm +static void conf_edit_cat06(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_ACT pact) { if (parm_nm == "noise_level") { conf_edit_noise_level(cam, parm_val, pact); @@ -2991,7 +2991,7 @@ static void conf_edit_cat06(struct ctx_cam *cam, std::string parm_nm } -static void conf_edit_cat07(struct ctx_cam *cam, std::string parm_nm +static void conf_edit_cat07(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_ACT pact) { if (parm_nm == "lightswitch_percent") { conf_edit_lightswitch_percent(cam, parm_val, pact); @@ -3005,7 +3005,7 @@ static void conf_edit_cat07(struct ctx_cam *cam, std::string parm_nm } -static void conf_edit_cat08(struct ctx_cam *cam, std::string parm_nm +static void conf_edit_cat08(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_ACT pact) { if (parm_nm == "on_event_start") { conf_edit_on_event_start(cam, parm_val, pact); @@ -3022,7 +3022,7 @@ static void conf_edit_cat08(struct ctx_cam *cam, std::string parm_nm } -static void conf_edit_cat09(struct ctx_cam *cam, std::string parm_nm +static void conf_edit_cat09(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_ACT pact) { if (parm_nm == "picture_output") { conf_edit_picture_output(cam, parm_val, pact); @@ -3037,7 +3037,7 @@ static void conf_edit_cat09(struct ctx_cam *cam, std::string parm_nm } -static void conf_edit_cat10(struct ctx_cam *cam, std::string parm_nm +static void conf_edit_cat10(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_ACT pact) { if (parm_nm == "movie_output") { conf_edit_movie_output(cam, parm_val, pact); @@ -3055,7 +3055,7 @@ static void conf_edit_cat10(struct ctx_cam *cam, std::string parm_nm } -static void conf_edit_cat11(struct ctx_cam *cam, std::string parm_nm +static void conf_edit_cat11(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_ACT pact) { if (parm_nm == "timelapse_interval") { conf_edit_timelapse_interval(cam, parm_val, pact); @@ -3067,7 +3067,7 @@ static void conf_edit_cat11(struct ctx_cam *cam, std::string parm_nm } -static void conf_edit_cat12(struct ctx_cam *cam, std::string parm_nm +static void conf_edit_cat12(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_ACT pact) { if (parm_nm == "video_pipe") { conf_edit_video_pipe(cam, parm_val, pact); @@ -3076,7 +3076,7 @@ static void conf_edit_cat12(struct ctx_cam *cam, std::string parm_nm } -static void conf_edit_cat13(struct ctx_cam *cam, std::string parm_nm +static void conf_edit_cat13(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_ACT pact) { if (parm_nm == "webcontrol_port") { conf_edit_webcontrol_port(cam, parm_val, pact); @@ -3099,7 +3099,7 @@ static void conf_edit_cat13(struct ctx_cam *cam, std::string parm_nm } -static void conf_edit_cat14(struct ctx_cam *cam, std::string parm_nm +static void conf_edit_cat14(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_ACT pact) { if (parm_nm == "stream_preview_scale") { conf_edit_stream_preview_scale(cam, parm_val, pact); @@ -3116,7 +3116,7 @@ static void conf_edit_cat14(struct ctx_cam *cam, std::string parm_nm } -static void conf_edit_cat15(struct ctx_cam *cam, std::string parm_nm, std::string &parm_val, enum PARM_ACT pact) +static void conf_edit_cat15(ctx_cam *cam, std::string parm_nm, std::string &parm_val, enum PARM_ACT pact) { if (parm_nm == "database_type") { conf_edit_database_type(cam, parm_val, pact); } else if (parm_nm == "database_dbname") { conf_edit_database_dbname(cam, parm_val, pact); @@ -3129,7 +3129,7 @@ static void conf_edit_cat15(struct ctx_cam *cam, std::string parm_nm, std::strin } -static void conf_edit_cat16(struct ctx_cam *cam, std::string parm_nm +static void conf_edit_cat16(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_ACT pact) { if (parm_nm == "sql_event_start") { conf_edit_sql_event_start(cam, parm_val, pact); @@ -3141,7 +3141,7 @@ static void conf_edit_cat16(struct ctx_cam *cam, std::string parm_nm } -static void conf_edit_cat17(struct ctx_cam *cam, std::string parm_nm +static void conf_edit_cat17(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_ACT pact) { if (parm_nm == "ptz_auto_track") { conf_edit_ptz_auto_track(cam, parm_val, pact); @@ -3157,7 +3157,7 @@ static void conf_edit_cat17(struct ctx_cam *cam, std::string parm_nm } -static void conf_edit_cat(struct ctx_cam *cam, std::string parm_nm +static void conf_edit_cat(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_ACT pact, enum PARM_CAT pcat) { @@ -3184,7 +3184,7 @@ static void conf_edit_cat(struct ctx_cam *cam, std::string parm_nm } -static void conf_edit_dflt_app(struct ctx_motapp *motapp) +static void conf_edit_dflt_app(ctx_motapp *motapp) { std::string dflt = ""; @@ -3203,7 +3203,7 @@ static void conf_edit_dflt_app(struct ctx_motapp *motapp) } -static void conf_edit_dflt_cam(struct ctx_cam *cam) +static void conf_edit_dflt_cam(ctx_cam *cam) { int indx; enum PARM_CAT pcat; @@ -3222,7 +3222,7 @@ static void conf_edit_dflt_cam(struct ctx_cam *cam) } -int conf_edit_set_active(struct ctx_motapp *motapp, bool ismotapp, int threadnbr +int conf_edit_set_active(ctx_motapp *motapp, bool ismotapp, int threadnbr , std::string parm_nm, std::string parm_val) { int indx; @@ -3250,7 +3250,7 @@ int conf_edit_set_active(struct ctx_motapp *motapp, bool ismotapp, int threadnbr } -static void conf_edit_depr_vid(struct ctx_motapp *motapp, int threadnbr +static void conf_edit_depr_vid(ctx_motapp *motapp, int threadnbr , std::string parm_nm, std::string newname, std::string parm_val) { std::string parm_curr, parm_new; @@ -3273,7 +3273,7 @@ static void conf_edit_depr_vid(struct ctx_motapp *motapp, int threadnbr } -static void conf_edit_depr_web(struct ctx_motapp *motapp, int threadnbr +static void conf_edit_depr_web(ctx_motapp *motapp, int threadnbr , std::string newname, std::string &parm_val) { std::string parm_new; @@ -3286,7 +3286,7 @@ static void conf_edit_depr_web(struct ctx_motapp *motapp, int threadnbr conf_edit_set_active(motapp, false, threadnbr, newname, parm_new); } -static void conf_edit_depr_tdbl(struct ctx_motapp *motapp, int threadnbr +static void conf_edit_depr_tdbl(ctx_motapp *motapp, int threadnbr , std::string newname, std::string &parm_val) { std::string parm_new; @@ -3300,7 +3300,7 @@ static void conf_edit_depr_tdbl(struct ctx_motapp *motapp, int threadnbr } -static int conf_edit_set_depr(struct ctx_motapp *motapp, bool ismotapp, int threadnbr +static int conf_edit_set_depr(ctx_motapp *motapp, bool ismotapp, int threadnbr ,std::string &parm_nm, std::string &parm_val) { int indx; @@ -3335,7 +3335,7 @@ static int conf_edit_set_depr(struct ctx_motapp *motapp, bool ismotapp, int thre return -1; } -void conf_edit_get(struct ctx_cam *cam, std::string parm_nm, std::string &parm_val, enum PARM_CAT parm_cat) +void conf_edit_get(ctx_cam *cam, std::string parm_nm, std::string &parm_val, enum PARM_CAT parm_cat) { if (parm_cat == PARM_CAT_00) { conf_edit_cat00(cam->motapp, parm_nm, parm_val, PARM_ACT_GET); @@ -3346,7 +3346,7 @@ void conf_edit_get(struct ctx_cam *cam, std::string parm_nm, std::string &parm_v } /* Interim overload until webu goes to c++ with std::string */ -void conf_edit_get(struct ctx_cam *cam, std::string parm_nm, char *parm_chr, enum PARM_CAT parm_cat) +void conf_edit_get(ctx_cam *cam, std::string parm_nm, char *parm_chr, enum PARM_CAT parm_cat) { std::string parm_val(parm_chr); int retcd; @@ -3366,7 +3366,7 @@ void conf_edit_get(struct ctx_cam *cam, std::string parm_nm, char *parm_chr, enu } /* parm_name and parm_val as string */ -void conf_edit_set(struct ctx_motapp *motapp, bool ismotapp, int threadnbr +void conf_edit_set(ctx_motapp *motapp, bool ismotapp, int threadnbr ,std::string parm_nm, std::string parm_val) { if (conf_edit_set_active(motapp, ismotapp, threadnbr, parm_nm, parm_val) == 0) { @@ -3384,7 +3384,7 @@ void conf_edit_set(struct ctx_motapp *motapp, bool ismotapp, int threadnbr } /* parm_name as char pointer and parm_val as string */ -void conf_edit_set(struct ctx_motapp *motapp, bool ismotapp, int threadnbr +void conf_edit_set(ctx_motapp *motapp, bool ismotapp, int threadnbr ,const char *parm_nm_chr, std::string parm_val) { std::string parm_nm(parm_nm_chr); @@ -3404,7 +3404,7 @@ void conf_edit_set(struct ctx_motapp *motapp, bool ismotapp, int threadnbr } /* parm_name as string and parm_val as char pointer */ -void conf_edit_set(struct ctx_motapp *motapp, bool ismotapp, int threadnbr +void conf_edit_set(ctx_motapp *motapp, bool ismotapp, int threadnbr ,std::string parm_nm, const char *parm_val_chr) { std::string parm_val(parm_val_chr); @@ -3424,7 +3424,7 @@ void conf_edit_set(struct ctx_motapp *motapp, bool ismotapp, int threadnbr } /* parm_name and parm_val as char pointers */ -void conf_edit_set(struct ctx_motapp *motapp, bool ismotapp, int threadnbr +void conf_edit_set(ctx_motapp *motapp, bool ismotapp, int threadnbr ,const char *parm_nm_chr, const char *parm_val_chr) { std::string parm_val(parm_val_chr); @@ -3444,7 +3444,7 @@ void conf_edit_set(struct ctx_motapp *motapp, bool ismotapp, int threadnbr } -void conf_edit_list(struct ctx_cam *cam, std::string parm_nm, std::string &parm_val, enum PARM_CAT parm_cat) +void conf_edit_list(ctx_cam *cam, std::string parm_nm, std::string &parm_val, enum PARM_CAT parm_cat) { if (parm_cat == PARM_CAT_00) { conf_edit_cat00(cam->motapp, parm_nm, parm_val, PARM_ACT_LIST); @@ -3455,7 +3455,7 @@ void conf_edit_list(struct ctx_cam *cam, std::string parm_nm, std::string &parm_ } /* Interim overload until webu goes to c++ with std::string */ -void conf_edit_list(struct ctx_cam *cam, std::string parm_nm, char *parm_chr, enum PARM_CAT parm_cat) +void conf_edit_list(ctx_cam *cam, std::string parm_nm, char *parm_chr, enum PARM_CAT parm_cat) { std::string parm_val(parm_chr); int retcd; @@ -3553,7 +3553,7 @@ static void usage(void) } /** Process Command-line options specified */ -static void conf_cmdline(struct ctx_motapp *motapp) +static void conf_cmdline(ctx_motapp *motapp) { int c; @@ -3597,7 +3597,7 @@ static void conf_cmdline(struct ctx_motapp *motapp) } /* Add in a default filename for the last camera config if it wasn't provided. */ -static void conf_camera_filenm(struct ctx_motapp *motapp) +static void conf_camera_filenm(ctx_motapp *motapp) { int indx_cam, indx, retcd; std::string src_nm, fullnm; @@ -3639,7 +3639,7 @@ static void conf_camera_filenm(struct ctx_motapp *motapp) } -void conf_camera_add(struct ctx_motapp *motapp) +void conf_camera_add(ctx_motapp *motapp) { int indx_cams, indx; std::string parm_val; @@ -3651,11 +3651,11 @@ void conf_camera_add(struct ctx_motapp *motapp) }; /* Index starts at zero (+1) plus another for our new camera(+2)*/ - motapp->cam_list = (struct ctx_cam **)myrealloc( - motapp->cam_list, sizeof(struct ctx_cam *) * (indx_cams + 2), "config_camera"); + motapp->cam_list = (ctx_cam **)myrealloc( + motapp->cam_list, sizeof(ctx_cam *) * (indx_cams + 2), "config_camera"); motapp->cam_list[indx_cams] = new ctx_cam; - memset(motapp->cam_list[indx_cams],0,sizeof(struct ctx_cam)); + memset(motapp->cam_list[indx_cams],0,sizeof(ctx_cam)); motapp->cam_list[indx_cams]->conf = new ctx_config; @@ -3680,7 +3680,7 @@ void conf_camera_add(struct ctx_motapp *motapp) } -static void conf_parm_camera(struct ctx_motapp *motapp, std::string filename) +static void conf_parm_camera(ctx_motapp *motapp, std::string filename) { int indx_cam, retcd; FILE *fp; @@ -3726,10 +3726,10 @@ static void conf_parm_camera(struct ctx_motapp *motapp, std::string filename) } /** Process camera_dir */ -static void conf_parm_camera_dir(struct ctx_motapp *motapp, std::string str) +static void conf_parm_camera_dir(ctx_motapp *motapp, std::string str) { DIR *dp; - struct dirent *ep; + dirent *ep; size_t name_len; int i, retcd; @@ -3772,7 +3772,7 @@ static void conf_parm_camera_dir(struct ctx_motapp *motapp, std::string str) } /** Process each line from the config file. */ -void conf_process(struct ctx_motapp *motapp, bool ismotapp, FILE *fp, int threadnbr) +void conf_process(ctx_motapp *motapp, bool ismotapp, FILE *fp, int threadnbr) { char line[PATH_MAX], *cmd = NULL, *arg1 = NULL; @@ -3845,7 +3845,7 @@ void conf_process(struct ctx_motapp *motapp, bool ismotapp, FILE *fp, int threa } /** Write the configuration(s) to the log */ -void conf_parms_log(struct ctx_cam **cam_list) +void conf_parms_log(ctx_cam **cam_list) { int i, threadnbr; bool diff_val; @@ -3899,7 +3899,7 @@ void conf_parms_log(struct ctx_cam **cam_list) } /** Write the configuration(s) to file */ -void conf_parms_write(struct ctx_motapp *motapp) +void conf_parms_write(ctx_motapp *motapp) { std::string parm_val, parm_main; int indx, indx_cam, indx_next; @@ -4012,7 +4012,7 @@ void conf_parms_write(struct ctx_motapp *motapp) } -void conf_init_app(struct ctx_motapp *motapp, int argc, char *argv[]) +void conf_init_app(ctx_motapp *motapp, int argc, char *argv[]) { FILE *fp = NULL; std::string filename; @@ -4081,14 +4081,14 @@ void conf_init_app(struct ctx_motapp *motapp, int argc, char *argv[]) return; } -void conf_init_cams(struct ctx_motapp *motapp) +void conf_init_cams(ctx_motapp *motapp) { FILE *fp = NULL; int indx, retcd; - motapp->cam_list = (struct ctx_cam**)calloc(sizeof(struct ctx_cam *), 2); + motapp->cam_list = (ctx_cam**)calloc(sizeof(ctx_cam *), 2); motapp->cam_list[0] = new ctx_cam; - memset(motapp->cam_list[0],0,sizeof(struct ctx_cam)); + memset(motapp->cam_list[0],0,sizeof(ctx_cam)); motapp->cam_list[1] = NULL; @@ -4133,7 +4133,7 @@ void conf_init_cams(struct ctx_motapp *motapp) return; } -void conf_deinit(struct ctx_motapp *motapp) +void conf_deinit(ctx_motapp *motapp) { int indx; diff --git a/src/conf.hpp b/src/conf.hpp index 0ed4a272..f3b5e070 100644 --- a/src/conf.hpp +++ b/src/conf.hpp @@ -21,9 +21,6 @@ #ifndef _INCLUDE_CONF_HPP_ #define _INCLUDE_CONF_HPP_ - struct ctx_cam; - struct ctx_motapp; - struct ctx_config { /* Overall system configuration parameters */ std::string camera_name; @@ -247,30 +244,30 @@ extern struct ctx_parm config_parms[]; extern struct ctx_parm_depr config_parms_depr[]; - void conf_init_app(struct ctx_motapp *motapp, int argc, char* argv[]); - void conf_init_cams(struct ctx_motapp *motapp); - void conf_deinit(struct ctx_motapp *motapp); - void conf_parms_log(struct ctx_cam **cam_list); - void conf_parms_write(struct ctx_motapp *motapp); - void conf_camera_add(struct ctx_motapp *motapp); + void conf_init_app(ctx_motapp *motapp, int argc, char* argv[]); + void conf_init_cams(ctx_motapp *motapp); + void conf_deinit(ctx_motapp *motapp); + void conf_parms_log(ctx_cam **cam_list); + void conf_parms_write(ctx_motapp *motapp); + void conf_camera_add(ctx_motapp *motapp); - void conf_edit_set(struct ctx_motapp *motapp, bool ismotapp, int threadnbr + void conf_edit_set(ctx_motapp *motapp, bool ismotapp, int threadnbr ,std::string parm_nm, std::string parm_val); - void conf_edit_set(struct ctx_motapp *motapp, bool ismotapp, int threadnbr + void conf_edit_set(ctx_motapp *motapp, bool ismotapp, int threadnbr ,const char *parm_nm_chr, std::string parm_val); - void conf_edit_set(struct ctx_motapp *motapp, bool ismotapp, int threadnbr + void conf_edit_set(ctx_motapp *motapp, bool ismotapp, int threadnbr ,std::string parm_nm, const char *parm_val_chr); - void conf_edit_set(struct ctx_motapp *motapp, bool ismotapp, int threadnbr + void conf_edit_set(ctx_motapp *motapp, bool ismotapp, int threadnbr ,const char *parm_nm_chr, const char *parm_val_chr); - void conf_edit_get(struct ctx_cam *cam, std::string parm_nm + void conf_edit_get(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_CAT parm_cat); - void conf_edit_get(struct ctx_cam *cam, std::string parm_nm + void conf_edit_get(ctx_cam *cam, std::string parm_nm , char *parm_chr, enum PARM_CAT parm_cat); - void conf_edit_list(struct ctx_cam *cam, std::string parm_nm + void conf_edit_list(ctx_cam *cam, std::string parm_nm , std::string &parm_val, enum PARM_CAT parm_cat); - void conf_edit_list(struct ctx_cam *cam, std::string parm_nm + void conf_edit_list(ctx_cam *cam, std::string parm_nm , char *parm_chr, enum PARM_CAT parm_cat); std::string conf_type_desc(enum PARM_TYP ptype); diff --git a/src/dbse.cpp b/src/dbse.cpp index c41753ad..3dc5c0c4 100644 --- a/src/dbse.cpp +++ b/src/dbse.cpp @@ -25,9 +25,9 @@ #include "dbse.hpp" /* Forward Declare */ -void dbse_close(struct ctx_motapp *motapp); +void dbse_close(ctx_motapp *motapp); -static int dbse_edits(struct ctx_motapp *motapp) +static int dbse_edits(ctx_motapp *motapp) { int retcd = 0; @@ -62,7 +62,7 @@ static int dbse_edits(struct ctx_motapp *motapp) } /* Free the cols lists*/ -static void dbse_cols_free(struct ctx_motapp *motapp) +static void dbse_cols_free(ctx_motapp *motapp) { int indx; @@ -82,7 +82,7 @@ static void dbse_cols_free(struct ctx_motapp *motapp) } /* Create array of all the columns in current version */ -static void dbse_cols_list(struct ctx_motapp *motapp) +static void dbse_cols_list(ctx_motapp *motapp) { int indx; @@ -151,7 +151,7 @@ static void dbse_cols_list(struct ctx_motapp *motapp) } /* Free the movies lists*/ -static void dbse_movies_free(struct ctx_motapp *motapp) +static void dbse_movies_free(ctx_motapp *motapp) { int indx; @@ -371,7 +371,7 @@ static void dbse_sql_motpls(ctx_dbse *dbse #ifdef HAVE_SQLITE3 -static void dbse_sqlite3_exec(struct ctx_motapp *motapp, const char *sqlquery) +static void dbse_sqlite3_exec(ctx_motapp *motapp, const char *sqlquery) { int retcd; char *errmsg = NULL; @@ -438,7 +438,7 @@ static int dbse_sqlite3_cb ( return 0; } -static void dbse_sqlite3_cols(struct ctx_motapp *motapp) +static void dbse_sqlite3_cols(ctx_motapp *motapp) { int retcd, indx; char *errmsg = 0; @@ -471,7 +471,7 @@ static void dbse_sqlite3_cols(struct ctx_motapp *motapp) } -static void dbse_sqlite3_init(struct ctx_motapp *motapp) +static void dbse_sqlite3_init(ctx_motapp *motapp) { int retcd; const char *err_open = NULL; @@ -547,7 +547,7 @@ static void dbse_sqlite3_init(struct ctx_motapp *motapp) } -static void dbse_sqlite3_movlst(struct ctx_motapp *motapp, int camera_id) +static void dbse_sqlite3_movlst(ctx_motapp *motapp, int camera_id) { int retcd; char *errmsg = NULL; @@ -593,7 +593,7 @@ static void dbse_sqlite3_movlst(struct ctx_motapp *motapp, int camera_id) return; } -static void dbse_sqlite3_close(struct ctx_motapp *motapp) +static void dbse_sqlite3_close(ctx_motapp *motapp) { if ((motapp->dbse->database_type == "sqlite3") && (motapp->dbse->database_sqlite3 != NULL)) { @@ -606,7 +606,7 @@ static void dbse_sqlite3_close(struct ctx_motapp *motapp) #ifdef HAVE_MARIADB -static void dbse_mariadb_exec (struct ctx_motapp *motapp, const char *sqlquery) +static void dbse_mariadb_exec (ctx_motapp *motapp, const char *sqlquery) { int retcd; @@ -661,7 +661,7 @@ static void dbse_mariadb_exec (struct ctx_motapp *motapp, const char *sqlquery) } -static void dbse_mariadb_recs (struct ctx_motapp *motapp, const char *sqlquery) +static void dbse_mariadb_recs (ctx_motapp *motapp, const char *sqlquery) { int retcd, indx, indx2; int qry_fields, rnbr; @@ -760,7 +760,7 @@ static void dbse_mariadb_recs (struct ctx_motapp *motapp, const char *sqlquery) return; } -static void dbse_mariadb_cols(struct ctx_motapp *motapp) +static void dbse_mariadb_cols(ctx_motapp *motapp) { int indx; std::string sql; @@ -785,7 +785,7 @@ static void dbse_mariadb_cols(struct ctx_motapp *motapp) } -static void dbse_mariadb_setup(struct ctx_motapp *motapp) +static void dbse_mariadb_setup(ctx_motapp *motapp) { std::string sql; @@ -805,7 +805,7 @@ static void dbse_mariadb_setup(struct ctx_motapp *motapp) } -static void dbse_mariadb_init(struct ctx_motapp *motapp) +static void dbse_mariadb_init(ctx_motapp *motapp) { bool my_true = true; @@ -858,7 +858,7 @@ static void dbse_mariadb_init(struct ctx_motapp *motapp) , motapp->dbse->database_dbname.c_str() ); } -static void dbse_mariadb_close(struct ctx_motapp *motapp) +static void dbse_mariadb_close(ctx_motapp *motapp) { if (motapp->dbse->database_type == "mariadb") { mysql_library_end(); @@ -870,7 +870,7 @@ static void dbse_mariadb_close(struct ctx_motapp *motapp) } } -static void dbse_mariadb_movlst(struct ctx_motapp *motapp, int camera_id ) +static void dbse_mariadb_movlst(ctx_motapp *motapp, int camera_id ) { std::string sql; @@ -896,7 +896,7 @@ static void dbse_mariadb_movlst(struct ctx_motapp *motapp, int camera_id ) #ifdef HAVE_PGSQL -static void dbse_pgsql_exec(struct ctx_motapp *motapp, const char *sqlquery) +static void dbse_pgsql_exec(ctx_motapp *motapp, const char *sqlquery) { PGresult *res; @@ -937,7 +937,7 @@ static void dbse_pgsql_exec(struct ctx_motapp *motapp, const char *sqlquery) PQclear(res); } -static void dbse_pgsql_close(struct ctx_motapp *motapp) +static void dbse_pgsql_close(ctx_motapp *motapp) { if ((motapp->dbse->database_type == "postgresql") && (motapp->dbse->database_pgsql != NULL)) { @@ -947,7 +947,7 @@ static void dbse_pgsql_close(struct ctx_motapp *motapp) } -static void dbse_pgsql_recs (struct ctx_motapp *motapp, const char *sqlquery) +static void dbse_pgsql_recs (ctx_motapp *motapp, const char *sqlquery) { PGresult *res; int indx, indx2, rows, cols, rnbr; @@ -1034,7 +1034,7 @@ static void dbse_pgsql_recs (struct ctx_motapp *motapp, const char *sqlquery) return; } -static void dbse_pgsql_cols(struct ctx_motapp *motapp) +static void dbse_pgsql_cols(ctx_motapp *motapp) { int indx; std::string sql; @@ -1059,7 +1059,7 @@ static void dbse_pgsql_cols(struct ctx_motapp *motapp) } -static void dbse_pgsql_setup(struct ctx_motapp *motapp) +static void dbse_pgsql_setup(ctx_motapp *motapp) { std::string sql; @@ -1079,7 +1079,7 @@ static void dbse_pgsql_setup(struct ctx_motapp *motapp) } -static void dbse_pgsql_init(struct ctx_motapp *motapp) +static void dbse_pgsql_init(ctx_motapp *motapp) { std::string constr; @@ -1114,7 +1114,7 @@ static void dbse_pgsql_init(struct ctx_motapp *motapp) , motapp->dbse->database_dbname.c_str() ); } -static void dbse_pgsql_movlst(struct ctx_motapp *motapp, int camera_id) +static void dbse_pgsql_movlst(ctx_motapp *motapp, int camera_id) { std::string sql; @@ -1139,7 +1139,7 @@ static void dbse_pgsql_movlst(struct ctx_motapp *motapp, int camera_id) #endif /*HAVE_PGSQL*/ -void dbse_init(struct ctx_motapp *motapp) +void dbse_init(ctx_motapp *motapp) { motapp->dbse = new ctx_dbse; motapp->dbse->database_busy_timeout = motapp->cam_list[0]->conf->database_busy_timeout; @@ -1183,7 +1183,7 @@ void dbse_init(struct ctx_motapp *motapp) } /* Populate the list of the movies from the database*/ -void dbse_movies_getlist(struct ctx_motapp *motapp, int camera_id) +void dbse_movies_getlist(ctx_motapp *motapp, int camera_id) { if (motapp->dbse->database_type == "") { @@ -1212,7 +1212,7 @@ void dbse_movies_getlist(struct ctx_motapp *motapp, int camera_id) } -void dbse_close(struct ctx_motapp *motapp) +void dbse_close(ctx_motapp *motapp) { #ifdef HAVE_MARIADB dbse_mariadb_close(motapp); @@ -1225,7 +1225,7 @@ void dbse_close(struct ctx_motapp *motapp) #endif } -void dbse_deinit(struct ctx_motapp *motapp) +void dbse_deinit(ctx_motapp *motapp) { dbse_movies_free(motapp); @@ -1242,7 +1242,7 @@ void dbse_deinit(struct ctx_motapp *motapp) } /* Execute sql against database with mutex lock */ -void dbse_exec_sql(struct ctx_motapp *motapp, const char *sqlquery) +void dbse_exec_sql(ctx_motapp *motapp, const char *sqlquery) { if (motapp->dbse->database_type == "") { @@ -1270,7 +1270,7 @@ void dbse_exec_sql(struct ctx_motapp *motapp, const char *sqlquery) } /* Create and execute user provided sql with mutex lock*/ -void dbse_exec(struct ctx_cam *cam, char *filename +void dbse_exec(ctx_cam *cam, char *filename , int sqltype, struct timespec *ts1, const char *cmd) { char sqlquery[PATH_MAX]; diff --git a/src/draw.cpp b/src/draw.cpp index 0c8b51ad..ecb43144 100644 --- a/src/draw.cpp +++ b/src/draw.cpp @@ -1219,7 +1219,7 @@ int draw_init_chars(void) return 0; } -void draw_init_scale(struct ctx_cam *cam) +void draw_init_scale(ctx_cam *cam) { /* Consider that web interface may change conf values at any moment. @@ -1255,7 +1255,7 @@ void draw_init_scale(struct ctx_cam *cam) } -static void draw_location(struct ctx_coord *cent, struct ctx_images *imgs, int width +static void draw_location(ctx_coord *cent, ctx_images *imgs, int width , unsigned char *new_var, int style, int mode) { unsigned char *out = imgs->image_motion.image_norm; @@ -1318,7 +1318,7 @@ static void draw_location(struct ctx_coord *cent, struct ctx_images *imgs, int w } } -static void draw_red_location(struct ctx_coord *cent, struct ctx_images *imgs, int width +static void draw_red_location(ctx_coord *cent, ctx_images *imgs, int width , unsigned char *new_var, int style, int mode) { unsigned char *out = imgs->image_motion.image_norm; @@ -1427,7 +1427,7 @@ static void draw_red_location(struct ctx_coord *cent, struct ctx_images *imgs, i } } -void draw_locate_preview(struct ctx_cam *cam, struct ctx_image_data *img) +void draw_locate_preview(ctx_cam *cam, ctx_image_data *img) { /* draw locate box here when mode = LOCATE_PREVIEW */ if (cam->locate_motion_mode == LOCATE_PREVIEW) { @@ -1448,10 +1448,10 @@ void draw_locate_preview(struct ctx_cam *cam, struct ctx_image_data *img) } } -void draw_locate(struct ctx_cam *cam, struct ctx_image_data *img) +void draw_locate(ctx_cam *cam, ctx_image_data *img) { - struct ctx_images *imgs = &cam->imgs; - struct ctx_coord *location = &img->location; + ctx_images *imgs = &cam->imgs; + ctx_coord *location = &img->location; if (cam->locate_motion_mode == LOCATE_ON) { @@ -1471,10 +1471,10 @@ void draw_locate(struct ctx_cam *cam, struct ctx_image_data *img) } } -void draw_smartmask(struct ctx_cam *cam, unsigned char *out) +void draw_smartmask(ctx_cam *cam, unsigned char *out) { int i, x, v, width, height, line; - struct ctx_images *imgs = &cam->imgs; + ctx_images *imgs = &cam->imgs; unsigned char *smartmask = imgs->smartmask_final; unsigned char *out_y, *out_u, *out_v; @@ -1510,10 +1510,10 @@ void draw_smartmask(struct ctx_cam *cam, unsigned char *out) } } -void draw_fixed_mask(struct ctx_cam *cam, unsigned char *out) +void draw_fixed_mask(ctx_cam *cam, unsigned char *out) { int i, x, v, width, height, line; - struct ctx_images *imgs = &cam->imgs; + ctx_images *imgs = &cam->imgs; unsigned char *mask = imgs->mask; unsigned char *out_y, *out_u, *out_v; @@ -1549,10 +1549,10 @@ void draw_fixed_mask(struct ctx_cam *cam, unsigned char *out) } } -void draw_largest_label(struct ctx_cam *cam, unsigned char *out) +void draw_largest_label(ctx_cam *cam, unsigned char *out) { int i, x, v, width, height, line; - struct ctx_images *imgs = &cam->imgs; + ctx_images *imgs = &cam->imgs; int *labels = imgs->labels; unsigned char *out_y, *out_u, *out_v; diff --git a/src/draw.hpp b/src/draw.hpp index b37f5800..cf3f390e 100644 --- a/src/draw.hpp +++ b/src/draw.hpp @@ -26,12 +26,12 @@ int startx, int starty, const char *text, int factor); int draw_init_chars(void); - void draw_init_scale(struct ctx_cam *cam); + void draw_init_scale(ctx_cam *cam); - void draw_locate_preview(struct ctx_cam *cam, struct ctx_image_data *img); - void draw_locate(struct ctx_cam *cam, struct ctx_image_data *img); - void draw_smartmask(struct ctx_cam *cam, unsigned char *out); - void draw_fixed_mask(struct ctx_cam *cam, unsigned char *out); - void draw_largest_label(struct ctx_cam *cam, unsigned char *out); + void draw_locate_preview(ctx_cam *cam, ctx_image_data *img); + void draw_locate(ctx_cam *cam, ctx_image_data *img); + void draw_smartmask(ctx_cam *cam, unsigned char *out); + void draw_fixed_mask(ctx_cam *cam, unsigned char *out); + void draw_largest_label(ctx_cam *cam, unsigned char *out); #endif /* _INCLUDE_DRAW_HPP_ */ \ No newline at end of file diff --git a/src/event.cpp b/src/event.cpp index 1e62b0af..7da2c380 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -55,8 +55,8 @@ const char *eventList[] = { "EVENT_LAST" }; -static void event_newfile(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void event_newfile(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { (void)cam; @@ -78,8 +78,8 @@ static void event_newfile(struct ctx_cam *cam, motion_event evnt * The scripts are executed with the filename of picture or movie appended * to the config parameter. */ -static void on_picture_save_command(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void on_picture_save_command(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { int filetype = (unsigned long)ftype; @@ -97,8 +97,8 @@ static void on_picture_save_command(struct ctx_cam *cam, motion_event evnt } } -static void on_motion_detected_command(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void on_motion_detected_command(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { (void)evnt; @@ -112,8 +112,8 @@ static void on_motion_detected_command(struct ctx_cam *cam, motion_event evnt } } -static void on_area_command(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void on_area_command(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { (void)evnt; @@ -127,8 +127,8 @@ static void on_area_command(struct ctx_cam *cam, motion_event evnt } } -static void on_event_start_command(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void on_event_start_command(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { (void)evnt; @@ -142,8 +142,8 @@ static void on_event_start_command(struct ctx_cam *cam, motion_event evnt } } -static void on_event_end_command(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void on_event_end_command(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { (void)evnt; @@ -157,8 +157,8 @@ static void on_event_end_command(struct ctx_cam *cam, motion_event evnt } } -static void event_stream_put(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void event_stream_put(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { (void)evnt; @@ -171,8 +171,8 @@ static void event_stream_put(struct ctx_cam *cam, motion_event evnt } -static void event_vlp_putpipe(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void event_vlp_putpipe(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { (void)evnt; @@ -187,15 +187,15 @@ static void event_vlp_putpipe(struct ctx_cam *cam, motion_event evnt } } -const char *imageext(struct ctx_cam *cam) { +const char *imageext(ctx_cam *cam) { if (cam->conf->picture_type == "ppm") return "ppm"; if (cam->conf->picture_type == "webp") return "webp"; return "jpg"; } -static void event_image_detect(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void event_image_detect(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { char fullfilename[PATH_MAX]; @@ -226,8 +226,8 @@ static void event_image_detect(struct ctx_cam *cam, motion_event evnt } } -static void event_imagem_detect(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void event_imagem_detect(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { char fullfilename[PATH_MAX]; @@ -266,8 +266,8 @@ static void event_imagem_detect(struct ctx_cam *cam, motion_event evnt } } -static void event_image_snapshot(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void event_image_snapshot(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { char fullfilename[PATH_MAX]; @@ -330,13 +330,13 @@ static void event_image_snapshot(struct ctx_cam *cam, motion_event evnt cam->snapshot = 0; } -static void event_image_preview(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void event_image_preview(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { char previewname[PATH_MAX]; char filename[PATH_MAX]; - struct ctx_image_data *saved_current_image; + ctx_image_data *saved_current_image; int passthrough, retcd; (void)evnt; @@ -371,8 +371,8 @@ static void event_image_preview(struct ctx_cam *cam, motion_event evnt } } -static void event_camera_lost(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void event_camera_lost(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { (void)evnt; @@ -386,8 +386,8 @@ static void event_camera_lost(struct ctx_cam *cam, motion_event evnt } } -static void event_secondary_detect(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void event_secondary_detect(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { (void)evnt; @@ -403,8 +403,8 @@ static void event_secondary_detect(struct ctx_cam *cam, motion_event evnt } } -static void event_camera_found(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void event_camera_found(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { (void)evnt; @@ -418,8 +418,8 @@ static void event_camera_found(struct ctx_cam *cam, motion_event evnt } } -static void on_movie_end_command(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void on_movie_end_command(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { int filetype = (unsigned long) ftype; @@ -433,8 +433,8 @@ static void on_movie_end_command(struct ctx_cam *cam, motion_event evnt } } -static void event_extpipe_end(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void event_extpipe_end(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { int retcd; @@ -471,8 +471,8 @@ static void event_extpipe_end(struct ctx_cam *cam, motion_event evnt } } -static void event_extpipe_start(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void event_extpipe_start(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { int retcd; @@ -544,8 +544,8 @@ static void event_extpipe_start(struct ctx_cam *cam, motion_event evnt } } -static void event_extpipe_put(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void event_extpipe_put(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { int passthrough; @@ -579,8 +579,8 @@ static void event_extpipe_put(struct ctx_cam *cam, motion_event evnt } } -static void event_movie_start(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void event_movie_start(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { int retcd; @@ -621,8 +621,8 @@ static void event_movie_start(struct ctx_cam *cam, motion_event evnt } } -static void event_movie_put(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void event_movie_put(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { (void)evnt; @@ -641,8 +641,8 @@ static void event_movie_put(struct ctx_cam *cam, motion_event evnt } } -static void event_movie_end(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void event_movie_end(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { int retcd; @@ -709,8 +709,8 @@ static void event_movie_end(struct ctx_cam *cam, motion_event evnt } -static void event_tlapse_start(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void event_tlapse_start(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { int retcd; @@ -739,8 +739,8 @@ static void event_tlapse_start(struct ctx_cam *cam, motion_event evnt } -static void event_tlapse_end(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) +static void event_tlapse_end(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname, void *ftype, struct timespec *ts1) { (void)evnt; @@ -905,8 +905,8 @@ struct event_handlers event_handlers[] = { * The split between unsigned images and signed filenames was introduced in 3.2.2 * as a code reading friendly solution to avoid a stream of compiler warnings in gcc 4.0. */ -void event(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname,void *ftype, struct timespec *ts1) +void event(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname,void *ftype, struct timespec *ts1) { int i=-1; diff --git a/src/event.hpp b/src/event.hpp index af117a6f..b758cc3b 100644 --- a/src/event.hpp +++ b/src/event.hpp @@ -44,11 +44,11 @@ typedef enum { EVENT_LAST, } motion_event; -typedef void(* event_handler)(struct ctx_cam *cam, motion_event, struct ctx_image_data *, +typedef void(* event_handler)(ctx_cam *cam, motion_event, ctx_image_data *, char *, void *, struct timespec *); -void event(struct ctx_cam *cam, motion_event evnt - ,struct ctx_image_data *img_data, char *fname,void *ftype, struct timespec *ts1); -const char * imageext(struct ctx_cam *cam); +void event(ctx_cam *cam, motion_event evnt + ,ctx_image_data *img_data, char *fname,void *ftype, struct timespec *ts1); +const char * imageext(ctx_cam *cam); #endif /* _INCLUDE_EVENT_HPP_ */ diff --git a/src/exif.cpp b/src/exif.cpp index bacad750..a66a9c90 100644 --- a/src/exif.cpp +++ b/src/exif.cpp @@ -144,7 +144,7 @@ static void put_stringentry(struct tiff_writing *into, unsigned tag, const char into->buf += 4; } -static void put_subjectarea(struct tiff_writing *into, const struct ctx_coord *box) +static void put_subjectarea(struct tiff_writing *into, ctx_coord *box) { put_uint16(into->buf , EXIF_TAG_SUBJECT_AREA); put_uint16(into->buf + 2, TIFF_TYPE_USHORT); @@ -164,8 +164,8 @@ static void put_subjectarea(struct tiff_writing *into, const struct ctx_coord *b * exif data to be inserted into jpeg or webp files * */ -unsigned exif_prepare(unsigned char **exif, const struct ctx_cam *cam, - const struct timespec *ts_in1, const struct ctx_coord *box) +unsigned exif_prepare(unsigned char **exif, ctx_cam *cam, + const struct timespec *ts_in1, ctx_coord *box) { /* description, datetime, and subtime are the values that are actually * put into the EXIF data diff --git a/src/exif.hpp b/src/exif.hpp index 48f0ee5d..05134e9e 100644 --- a/src/exif.hpp +++ b/src/exif.hpp @@ -24,7 +24,7 @@ #ifndef _INCLUDE_EXIF_HPP_ #define _INCLUDE_EXIF_HPP_ - unsigned exif_prepare(unsigned char **exif, const struct ctx_cam *cam, - const struct timespec *ts_in1, const struct ctx_coord *box); + unsigned exif_prepare(unsigned char **exif, ctx_cam *cam, + const struct timespec *ts_in1, ctx_coord *box); #endif /* _INCLUDE_EXIF_HPP_ */ \ No newline at end of file diff --git a/src/jpegutils.cpp b/src/jpegutils.cpp index df700268..6f0c1ca4 100644 --- a/src/jpegutils.cpp +++ b/src/jpegutils.cpp @@ -394,8 +394,8 @@ static GLOBAL(int) _jpeg_mem_size(j_compress_ptr cinfo) * It must be called after jpeg_start_compress() but before * any image data is written by jpeg_write_scanlines(). */ -static void put_jpeg_exif(j_compress_ptr cinfo, const struct ctx_cam *cam, - const struct timespec *ts1, const struct ctx_coord *box) +static void put_jpeg_exif(j_compress_ptr cinfo, ctx_cam *cam, + const struct timespec *ts1, ctx_coord *box) { unsigned char *exif = NULL; unsigned exif_len = exif_prepare(&exif, cam, ts1, box); @@ -523,7 +523,7 @@ int jpgutl_decode_jpeg (unsigned char *jpeg_data_in, int jpeg_data_len, int jpgutl_put_yuv420p(unsigned char *dest_image, int image_size, unsigned char *input_image, int width, int height, int quality, - struct ctx_cam *cam, struct timespec *ts1, struct ctx_coord *box) + ctx_cam *cam, struct timespec *ts1, ctx_coord *box) { int i, j, jpeg_image_size; @@ -612,7 +612,7 @@ int jpgutl_put_yuv420p(unsigned char *dest_image, int image_size, int jpgutl_put_grey(unsigned char *dest_image, int image_size, unsigned char *input_image, int width, int height, int quality, - struct ctx_cam *cam, struct timespec *ts1, struct ctx_coord *box) + ctx_cam *cam, struct timespec *ts1, ctx_coord *box) { int y, dest_image_size; JSAMPROW row_ptr[1]; diff --git a/src/jpegutils.hpp b/src/jpegutils.hpp index 75bee0ea..863a7e69 100644 --- a/src/jpegutils.hpp +++ b/src/jpegutils.hpp @@ -26,9 +26,9 @@ unsigned int width, unsigned int height, unsigned char *volatile img_out); int jpgutl_put_yuv420p(unsigned char *dest_image, int image_size, unsigned char *input_image, int width, int height, int quality, - struct ctx_cam *cam, struct timespec *ts1, struct ctx_coord *box); + ctx_cam *cam, struct timespec *ts1, ctx_coord *box); int jpgutl_put_grey(unsigned char *dest_image, int image_size, unsigned char *input_image, int width, int height, int quality, - struct ctx_cam *cam, struct timespec *ts1, struct ctx_coord *box); + ctx_cam *cam, struct timespec *ts1, ctx_coord *box); #endif /* _INCLUDE_JPEGUTILS_HPP_ */ diff --git a/src/libcam.cpp b/src/libcam.cpp index 1924aec9..7f2f40c1 100644 --- a/src/libcam.cpp +++ b/src/libcam.cpp @@ -54,7 +54,7 @@ void cls_libcam::cam_start_params(ctx_cam *ptr) camctx = ptr; - camctx->libcam->params = (ctx_params*)mymalloc(sizeof(struct ctx_params)); + camctx->libcam->params = (ctx_params*)mymalloc(sizeof(ctx_params)); camctx->libcam->params->update_params = true; util_parms_parse(camctx->libcam->params, camctx->conf->libcam_params); @@ -387,7 +387,7 @@ int libcam_start(ctx_cam *cam) } /** close and stop libcam */ -void libcam_cleanup(struct ctx_cam *cam) +void libcam_cleanup(ctx_cam *cam) { #ifdef HAVE_LIBCAM cam->libcam->cam_stop(); @@ -399,7 +399,7 @@ void libcam_cleanup(struct ctx_cam *cam) } /** get next image from libcam */ -int libcam_next(struct ctx_cam *cam, struct ctx_image_data *img_data) +int libcam_next(ctx_cam *cam, ctx_image_data *img_data) { #ifdef HAVE_LIBCAM int retcd; diff --git a/src/logger.cpp b/src/logger.cpp index 0c085c81..ee8e7c39 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -30,7 +30,7 @@ static int log_type = TYPE_DEFAULT; static const char *log_type_str[] = {NULL, "COR", "STR", "ENC", "NET", "DBS", "EVT", "TRK", "VID", "ALL"}; static const char *log_level_str[] = {NULL, "EMG", "ALR", "CRT", "ERR", "WRN", "NTC", "INF", "DBG", "ALL"}; -static struct ctx_motapp *log_motapp; /*Used to access the parms mutex for updates*/ +static ctx_motapp *log_motapp; /*Used to access the parms mutex for updates*/ /** Returns index of log type or 0 if not valid type. */ static int log_get_type(const char *type) @@ -259,7 +259,7 @@ void motion_log(int level, int type, int errno_flag,int fncname, const char *fmt } -void log_init(struct ctx_motapp *motapp) +void log_init(ctx_motapp *motapp) { if ((motapp->log_level > ALL) || @@ -305,7 +305,7 @@ void log_init(struct ctx_motapp *motapp) } -void log_deinit(struct ctx_motapp *motapp) +void log_deinit(ctx_motapp *motapp) { if (logfile != NULL) { @@ -318,7 +318,7 @@ void log_deinit(struct ctx_motapp *motapp) } -void log_set_motapp(struct ctx_motapp *motapp) +void log_set_motapp(ctx_motapp *motapp) { /* Need better design to avoid the need to do this. Extern motapp to whole app? */ log_motapp = motapp; /* Set our static pointer used for locking parms mutex*/ diff --git a/src/logger.hpp b/src/logger.hpp index 8f0a0dcd..3aae42a5 100644 --- a/src/logger.hpp +++ b/src/logger.hpp @@ -19,8 +19,6 @@ #ifndef _INCLUDE_LOGGER_HPP_ #define _INCLUDE_LOGGER_HPP_ - struct ctx_cam; - /* Logging mode */ #define LOGMODE_NONE 0 /* No logging */ #define LOGMODE_FILE 1 /* Log messages to file */ @@ -58,10 +56,10 @@ #define MOTION_LOG(x, y, z, format, args...) motion_log(x, y, z, 1, format, __FUNCTION__, ##args) void motion_log(int loglevel, int logtype, int errno_flag,int fncname, const char *fmt, ...); - void log_init(struct ctx_motapp *motapp); - void log_deinit(struct ctx_motapp *motapp); + void log_init(ctx_motapp *motapp); + void log_deinit(ctx_motapp *motapp); void log_set_level(int new_level); void log_set_type(const char *new_logtype); - void log_set_motapp(struct ctx_motapp *motapp); + void log_set_motapp(ctx_motapp *motapp); #endif /* _INCLUDE_LOGGER_HPP_ */ diff --git a/src/mmalcam.cpp b/src/mmalcam.cpp index 0d658e84..4763e82d 100644 --- a/src/mmalcam.cpp +++ b/src/mmalcam.cpp @@ -286,12 +286,12 @@ static void destroy_camera_buffer_structures(ctx_mmalcam_ptr mmalcam) * -1 on any failure */ -int mmalcam_start(struct ctx_cam *cam) +int mmalcam_start(ctx_cam *cam) { #ifdef HAVE_MMAL ctx_mmalcam_ptr mmalcam; - cam->mmalcam = (ctx_mmalcam*) mymalloc(sizeof(struct ctx_mmalcam)); + cam->mmalcam = (ctx_mmalcam*) mymalloc(sizeof(ctx_mmalcam)); memset(cam->mmalcam, 0, sizeof(ctx_mmalcam)); mmalcam = cam->mmalcam; mmalcam->cam = cam; @@ -369,7 +369,7 @@ int mmalcam_start(struct ctx_cam *cam) * Returns: Nothing. * */ -void mmalcam_cleanup(struct ctx_mmalcam *mmalcam) +void mmalcam_cleanup(ctx_mmalcam *mmalcam) { #ifdef HAVE_MMAL MOTION_LOG(NTC, TYPE_VIDEO, NO_ERRNO, _("MMAL Camera cleanup")); @@ -402,7 +402,7 @@ void mmalcam_cleanup(struct ctx_mmalcam *mmalcam) * * Returns: Error code */ -int mmalcam_next(struct ctx_cam *cam, struct ctx_image_data *img_data) +int mmalcam_next(ctx_cam *cam, ctx_image_data *img_data) { #ifdef HAVE_MMAL ctx_mmalcam_ptr mmalcam; diff --git a/src/mmalcam.hpp b/src/mmalcam.hpp index 8727c57c..148288a8 100644 --- a/src/mmalcam.hpp +++ b/src/mmalcam.hpp @@ -24,7 +24,7 @@ typedef struct ctx_mmalcam *ctx_mmalcam_ptr; typedef struct ctx_mmalcam { - struct ctx_cam *cam; /* pointer to parent motion + ctx_cam *cam; /* pointer to parent motion context structure */ int width; int height; @@ -38,8 +38,8 @@ #endif } ctx_mmalcam; - int mmalcam_start (struct ctx_cam *cam); - int mmalcam_next (struct ctx_cam *cam, struct ctx_image_data *img_data); - void mmalcam_cleanup (struct ctx_mmalcam *mmalcam); + int mmalcam_start (ctx_cam *cam); + int mmalcam_next (ctx_cam *cam, ctx_image_data *img_data); + void mmalcam_cleanup (ctx_mmalcam *mmalcam); #endif /* _INCLUDE_MMALCAM_HPP_ */ diff --git a/src/motion_loop.cpp b/src/motion_loop.cpp index 10cf38cd..4bbe4480 100644 --- a/src/motion_loop.cpp +++ b/src/motion_loop.cpp @@ -42,10 +42,10 @@ #include "webu_stream.hpp" /* Resize the image ring */ -static void mlp_ring_resize(struct ctx_cam *cam, int new_size) +static void mlp_ring_resize(ctx_cam *cam, int new_size) { int smallest, i; - struct ctx_image_data *tmp; + ctx_image_data *tmp; if (cam->event_nr != cam->prev_event) { @@ -59,10 +59,10 @@ static void mlp_ring_resize(struct ctx_cam *cam, int new_size) MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO ,_("Resizing pre_capture buffer to %d items"), new_size); - tmp =(struct ctx_image_data*) mymalloc(new_size * sizeof(struct ctx_image_data)); + tmp =(ctx_image_data*) mymalloc(new_size * sizeof(ctx_image_data)); if (smallest > 0) { - memcpy(tmp, cam->imgs.image_ring, sizeof(struct ctx_image_data) * smallest); + memcpy(tmp, cam->imgs.image_ring, sizeof(ctx_image_data) * smallest); } for(i = smallest; i < new_size; i++) { @@ -88,7 +88,7 @@ static void mlp_ring_resize(struct ctx_cam *cam, int new_size) } /* Clean image ring */ -static void mlp_ring_destroy(struct ctx_cam *cam) +static void mlp_ring_destroy(ctx_cam *cam) { int i; @@ -112,7 +112,7 @@ static void mlp_ring_destroy(struct ctx_cam *cam) } /* Add debug messsage to image */ -static void mlp_ring_process_debug(struct ctx_cam *cam) +static void mlp_ring_process_debug(ctx_cam *cam) { char tmp[32]; const char *t; @@ -138,9 +138,9 @@ static void mlp_ring_process_debug(struct ctx_cam *cam) } /* Process the entire image ring */ -static void mlp_ring_process(struct ctx_cam *cam) +static void mlp_ring_process(ctx_cam *cam) { - struct ctx_image_data *saved_current_image = cam->current_image; + ctx_image_data *saved_current_image = cam->current_image; do { if ((cam->imgs.image_ring[cam->imgs.ring_out].flags & (IMAGE_SAVE | IMAGE_SAVED)) != IMAGE_SAVE) { @@ -184,7 +184,7 @@ static void mlp_ring_process(struct ctx_cam *cam) } /* Reset the image info variables*/ -static void mlp_info_reset(struct ctx_cam *cam) +static void mlp_info_reset(ctx_cam *cam) { cam->info_diff_cnt = 0; cam->info_diff_tot = 0; @@ -194,7 +194,7 @@ static void mlp_info_reset(struct ctx_cam *cam) } /* Process the motion detected items*/ -static void mlp_detected_trigger(struct ctx_cam *cam, struct ctx_image_data *img) +static void mlp_detected_trigger(ctx_cam *cam, ctx_image_data *img) { if (img->flags & IMAGE_TRIGGER) { if (cam->event_nr != cam->prev_event) { @@ -228,7 +228,7 @@ static void mlp_detected_trigger(struct ctx_cam *cam, struct ctx_image_data *img } /* call ptz camera center */ -static void mlp_track_center(struct ctx_cam *cam) +static void mlp_track_center(ctx_cam *cam) { if ((cam->conf->ptz_auto_track) && (cam->conf->ptz_move_track != "")) { cam->track_posx = 0; @@ -239,7 +239,7 @@ static void mlp_track_center(struct ctx_cam *cam) } /* call ptz camera move */ -static void mlp_track_move(struct ctx_cam *cam, struct ctx_coord *cent) +static void mlp_track_move(ctx_cam *cam, ctx_coord *cent) { if ((cam->conf->ptz_auto_track) && (cam->conf->ptz_move_track != "")) { cam->track_posx += cent->x; @@ -250,9 +250,9 @@ static void mlp_track_move(struct ctx_cam *cam, struct ctx_coord *cent) } /* motion detected */ -static void mlp_detected(struct ctx_cam *cam, struct ctx_image_data *img) +static void mlp_detected(ctx_cam *cam, ctx_image_data *img) { - struct ctx_config *conf = cam->conf; + ctx_config *conf = cam->conf; unsigned int distX, distY; draw_locate(cam, img); @@ -279,7 +279,7 @@ static void mlp_detected(struct ctx_cam *cam, struct ctx_image_data *img) } /* Apply the privacy mask to image*/ -static void mlp_mask_privacy(struct ctx_cam *cam) +static void mlp_mask_privacy(ctx_cam *cam) { if (cam->imgs.mask_privacy == NULL) { return; @@ -363,7 +363,7 @@ static void mlp_mask_privacy(struct ctx_cam *cam) } /* Close and clean up camera*/ -void mlp_cam_close(struct ctx_cam *cam) +void mlp_cam_close(ctx_cam *cam) { if (cam->mmalcam) { mmalcam_cleanup(cam->mmalcam); @@ -394,7 +394,7 @@ void mlp_cam_close(struct ctx_cam *cam) } /* Start camera */ -int mlp_cam_start(struct ctx_cam *cam) +int mlp_cam_start(ctx_cam *cam) { int retcd; @@ -445,7 +445,7 @@ int mlp_cam_start(struct ctx_cam *cam) } /* Get next image from camera */ -int mlp_cam_next(struct ctx_cam *cam, struct ctx_image_data *img_data) +int mlp_cam_next(ctx_cam *cam, ctx_image_data *img_data) { if (cam->camera_type == CAMERA_TYPE_MMAL) { if (cam->mmalcam == NULL) { @@ -476,7 +476,7 @@ int mlp_cam_next(struct ctx_cam *cam, struct ctx_image_data *img_data) } /* Assign the camera type */ -static int init_camera_type(struct ctx_cam *cam) +static int init_camera_type(ctx_cam *cam) { if (cam->conf->mmalcam_name != "") { cam->camera_type = CAMERA_TYPE_MMAL; @@ -506,7 +506,7 @@ static int init_camera_type(struct ctx_cam *cam) } /** Get first images from camera at startup */ -static void mlp_init_firstimage(struct ctx_cam *cam) +static void mlp_init_firstimage(ctx_cam *cam) { int indx; @@ -530,7 +530,7 @@ static void mlp_init_firstimage(struct ctx_cam *cam) } /** Check the image size to determine if modulo 8 and over 64 */ -static int mlp_check_szimg(struct ctx_cam *cam) +static int mlp_check_szimg(ctx_cam *cam) { if ((cam->imgs.width % 8) || (cam->imgs.height % 8)) { MOTION_LOG(CRT, TYPE_NETCAM, NO_ERRNO @@ -554,7 +554,7 @@ static int mlp_check_szimg(struct ctx_cam *cam) } /** Set the items required for the area detect */ -static void mlp_init_areadetect(struct ctx_cam *cam) +static void mlp_init_areadetect(ctx_cam *cam) { cam->area_minx[0] = cam->area_minx[3] = cam->area_minx[6] = 0; cam->area_miny[0] = cam->area_miny[1] = cam->area_miny[2] = 0; @@ -578,7 +578,7 @@ static void mlp_init_areadetect(struct ctx_cam *cam) } /** Allocate the required buffers */ -static void mlp_init_buffers(struct ctx_cam *cam) +static void mlp_init_buffers(ctx_cam *cam) { cam->imgs.ref =(unsigned char*) mymalloc(cam->imgs.size_norm); cam->imgs.image_motion.image_norm = (unsigned char*)mymalloc(cam->imgs.size_norm); @@ -605,7 +605,7 @@ static void mlp_init_buffers(struct ctx_cam *cam) } /* Initialize loop values */ -static void mlp_init_values(struct ctx_cam *cam) +static void mlp_init_values(ctx_cam *cam) { cam->event_nr = 1; cam->prev_event = 0; @@ -636,7 +636,7 @@ static void mlp_init_values(struct ctx_cam *cam) } /* start the camera */ -static int mlp_init_cam_start(struct ctx_cam *cam) +static int mlp_init_cam_start(ctx_cam *cam) { cam->video_dev = mlp_cam_start(cam); @@ -660,7 +660,7 @@ static int mlp_init_cam_start(struct ctx_cam *cam) } /* initialize reference images*/ -static void mlp_init_ref(struct ctx_cam *cam) +static void mlp_init_ref(ctx_cam *cam) { memcpy(cam->imgs.image_virgin, cam->current_image->image_norm, cam->imgs.size_norm); @@ -672,7 +672,7 @@ static void mlp_init_ref(struct ctx_cam *cam) } /* initialize everything for the loop */ -static int mlp_init(struct ctx_cam *cam) +static int mlp_init(ctx_cam *cam) { mythreadname_set("ml",cam->threadnr,cam->conf->camera_name.c_str()); @@ -730,7 +730,7 @@ static int mlp_init(struct ctx_cam *cam) } /** clean up all memory etc. from motion init */ -void mlp_cleanup(struct ctx_cam *cam) +void mlp_cleanup(ctx_cam *cam) { event(cam, EVENT_TLAPSE_END, NULL, NULL, NULL, NULL); if (cam->event_nr == cam->prev_event) { @@ -788,7 +788,7 @@ void mlp_cleanup(struct ctx_cam *cam) } /* check the area detect */ -static void mlp_areadetect(struct ctx_cam *cam) +static void mlp_areadetect(ctx_cam *cam) { int i, j, z = 0; @@ -815,7 +815,7 @@ static void mlp_areadetect(struct ctx_cam *cam) } /* Prepare for the next iteration of loop*/ -static void mlp_prepare(struct ctx_cam *cam) +static void mlp_prepare(ctx_cam *cam) { int frame_buffer_size; @@ -857,7 +857,7 @@ static void mlp_prepare(struct ctx_cam *cam) } /* reset the images */ -static void mlp_resetimages(struct ctx_cam *cam) +static void mlp_resetimages(ctx_cam *cam) { if (cam->conf->minimum_frame_time) { cam->minimum_frame_time_downcounter = cam->conf->minimum_frame_time; @@ -891,7 +891,7 @@ static void mlp_resetimages(struct ctx_cam *cam) } /* Try to reconnect to camera */ -static int mlp_retry(struct ctx_cam *cam) +static int mlp_retry(ctx_cam *cam) { int size_high; @@ -941,7 +941,7 @@ static int mlp_retry(struct ctx_cam *cam) } /* Get next image from camera */ -static int mlp_capture(struct ctx_cam *cam) +static int mlp_capture(ctx_cam *cam) { const char *tmpin; char tmpout[80]; @@ -1025,7 +1025,7 @@ static int mlp_capture(struct ctx_cam *cam) } /* call detection */ -static void mlp_detection(struct ctx_cam *cam) +static void mlp_detection(ctx_cam *cam) { if (cam->frame_skip) { cam->frame_skip--; @@ -1043,7 +1043,7 @@ static void mlp_detection(struct ctx_cam *cam) } /* tune the detection parameters*/ -static void mlp_tuning(struct ctx_cam *cam) +static void mlp_tuning(ctx_cam *cam) { if ((cam->conf->noise_tune && cam->shots == 0) && (!cam->detecting_motion && (cam->current_image->diffs <= cam->threshold))) { @@ -1076,7 +1076,7 @@ static void mlp_tuning(struct ctx_cam *cam) } /* apply image overlays */ -static void mlp_overlay(struct ctx_cam *cam) +static void mlp_overlay(ctx_cam *cam) { char tmp[PATH_MAX]; @@ -1146,7 +1146,7 @@ static void mlp_overlay(struct ctx_cam *cam) } /* emulate motion */ -static void mlp_actions_emulate(struct ctx_cam *cam) +static void mlp_actions_emulate(ctx_cam *cam) { int indx; @@ -1169,7 +1169,7 @@ static void mlp_actions_emulate(struct ctx_cam *cam) } /* call the actions */ -static void mlp_actions_motion(struct ctx_cam *cam) +static void mlp_actions_motion(ctx_cam *cam) { int indx, frame_count = 0; int pos = cam->imgs.ring_in; @@ -1211,7 +1211,7 @@ static void mlp_actions_motion(struct ctx_cam *cam) } /* call the event actions*/ -static void mlp_actions_event(struct ctx_cam *cam) +static void mlp_actions_event(ctx_cam *cam) { if ((cam->conf->event_gap > 0) && ((cam->frame_curr_ts.tv_sec - cam->lasttime ) >= cam->conf->event_gap)) { @@ -1262,7 +1262,7 @@ static void mlp_actions_event(struct ctx_cam *cam) } -static void mlp_actions(struct ctx_cam *cam) +static void mlp_actions(ctx_cam *cam) { if ((cam->current_image->diffs > cam->threshold) && (cam->current_image->diffs < cam->threshold_maximum)) { @@ -1319,7 +1319,7 @@ static void mlp_actions(struct ctx_cam *cam) } /* Process for setup mode */ -static void mlp_setupmode(struct ctx_cam *cam) +static void mlp_setupmode(ctx_cam *cam) { if (cam->motapp->setup_mode) { char msg[1024] = "\0"; @@ -1353,7 +1353,7 @@ static void mlp_setupmode(struct ctx_cam *cam) } /* Snapshot interval*/ -static void mlp_snapshot(struct ctx_cam *cam) +static void mlp_snapshot(ctx_cam *cam) { if ((cam->conf->snapshot_interval > 0 && cam->shots == 0 && cam->frame_curr_ts.tv_sec % cam->conf->snapshot_interval <= @@ -1365,7 +1365,7 @@ static void mlp_snapshot(struct ctx_cam *cam) } /* Create timelapse video*/ -static void mlp_timelapse(struct ctx_cam *cam) +static void mlp_timelapse(ctx_cam *cam) { struct tm timestamp_tm; @@ -1415,7 +1415,7 @@ static void mlp_timelapse(struct ctx_cam *cam) } /* send images to loopback device*/ -static void mlp_loopback(struct ctx_cam *cam) +static void mlp_loopback(ctx_cam *cam) { if (cam->motapp->setup_mode) { event(cam, EVENT_IMAGE, &cam->imgs.image_motion, NULL, &cam->pipe, &cam->current_image->imgts); @@ -1432,7 +1432,7 @@ static void mlp_loopback(struct ctx_cam *cam) } /* Update parameters from web interface*/ -static void mlp_parmsupdate(struct ctx_cam *cam) +static void mlp_parmsupdate(ctx_cam *cam) { /* Check for some config parameter changes but only every second */ if (cam->shots != 0) { @@ -1507,7 +1507,7 @@ static void mlp_parmsupdate(struct ctx_cam *cam) } /* sleep the loop to get framerate requested */ -static void mlp_frametiming(struct ctx_cam *cam) +static void mlp_frametiming(ctx_cam *cam) { int indx; struct timespec ts2; @@ -1551,7 +1551,7 @@ static void mlp_frametiming(struct ctx_cam *cam) /** main processing loop for each camera */ void *motion_loop(void *arg) { - struct ctx_cam *cam =(struct ctx_cam *) arg; + ctx_cam *cam =(ctx_cam *) arg; cam->running_cam = true; cam->finish_cam = false; diff --git a/src/motion_loop.hpp b/src/motion_loop.hpp index cebbfd4d..5ba6d93a 100644 --- a/src/motion_loop.hpp +++ b/src/motion_loop.hpp @@ -23,6 +23,6 @@ #define _INCLUDE_MOTION_LOOP_HPP_ void *motion_loop(void *arg); -void mlp_cleanup(struct ctx_cam *cam); +void mlp_cleanup(ctx_cam *cam); #endif /* _INCLUDE_MOTION_LOOP_HPP_ */ \ No newline at end of file diff --git a/src/motionplus.cpp b/src/motionplus.cpp index 20b6842b..99388417 100644 --- a/src/motionplus.cpp +++ b/src/motionplus.cpp @@ -33,7 +33,7 @@ pthread_key_t tls_key_threadnr; volatile enum MOTION_SIGNAL motsignal; /** Process signals sent */ -static void motion_signal_process(struct ctx_motapp *motapp) +static void motion_signal_process(ctx_motapp *motapp) { int indx; @@ -164,7 +164,7 @@ static void setup_signals(void) } /** Remove the process id file ( pid file ) before MotionPlus exit. */ -static void motion_remove_pid(struct ctx_motapp *motapp) +static void motion_remove_pid(ctx_motapp *motapp) { if ((motapp->daemon) && @@ -180,7 +180,7 @@ static void motion_remove_pid(struct ctx_motapp *motapp) } /** Turn MotionPlus into a daemon through forking. */ -static void motion_daemon(struct ctx_motapp *motapp) +static void motion_daemon(ctx_motapp *motapp) { int fd; FILE *pidf = NULL; @@ -267,7 +267,7 @@ static void motion_daemon(struct ctx_motapp *motapp) sigaction(SIGTSTP, &sig_ign_action, NULL); } -static void motion_shutdown(struct ctx_motapp *motapp) +static void motion_shutdown(ctx_motapp *motapp) { motion_remove_pid(motapp); @@ -281,7 +281,7 @@ static void motion_shutdown(struct ctx_motapp *motapp) } -static void motion_camera_ids(struct ctx_cam **cam_list) +static void motion_camera_ids(ctx_cam **cam_list) { /* Set the camera id's on the ctx_cam. They must be unique */ int indx, indx2; @@ -384,7 +384,7 @@ static void motion_ntc(void) } /** Initialize upon start up or restart */ -static void motion_startup(struct ctx_motapp *motapp, int daemonize, int argc, char *argv[]) +static void motion_startup(ctx_motapp *motapp, int daemonize, int argc, char *argv[]) { log_set_motapp(motapp); /* This is needed prior to any function possibly calling motion_log*/ @@ -425,7 +425,7 @@ static void motion_startup(struct ctx_motapp *motapp, int daemonize, int argc, c } /** Start a camera thread */ -static void motion_start_thread(struct ctx_motapp *motapp, int indx) +static void motion_start_thread(ctx_motapp *motapp, int indx) { int retcd; @@ -446,7 +446,7 @@ static void motion_start_thread(struct ctx_motapp *motapp, int indx) } -static void motion_restart(struct ctx_motapp *motapp, int argc, char **argv) +static void motion_restart(ctx_motapp *motapp, int argc, char **argv) { MOTION_LOG(WRN, TYPE_ALL, NO_ERRNO,_("Restarting MotionPlus.")); @@ -463,7 +463,7 @@ static void motion_restart(struct ctx_motapp *motapp, int argc, char **argv) } /* Check for whether any cams are locked */ -static void motion_watchdog(struct ctx_motapp *motapp, int camindx) +static void motion_watchdog(ctx_motapp *motapp, int camindx) { int indx; @@ -554,7 +554,7 @@ static void motion_watchdog(struct ctx_motapp *motapp, int camindx) } -static int motion_check_threadcount(struct ctx_motapp *motapp) +static int motion_check_threadcount(ctx_motapp *motapp) { int thrdcnt, indx; @@ -583,7 +583,7 @@ static int motion_check_threadcount(struct ctx_motapp *motapp) } -static void motion_init(struct ctx_motapp *motapp) +static void motion_init(ctx_motapp *motapp) { motapp->cam_list = NULL; @@ -624,7 +624,7 @@ static void motion_init(struct ctx_motapp *motapp) } /* Check for whether to add a new cam */ -static void motion_cam_add(struct ctx_motapp *motapp) +static void motion_cam_add(ctx_motapp *motapp) { int indx_cam, indx; @@ -656,10 +656,10 @@ static void motion_cam_add(struct ctx_motapp *motapp) } /* Check for whether to delete a new cam */ -static void motion_cam_delete(struct ctx_motapp *motapp) +static void motion_cam_delete(ctx_motapp *motapp) { int indx_cam, indx; - struct ctx_cam **tmp; + ctx_cam **tmp; if (motapp->cam_delete == 0) { return; @@ -682,7 +682,7 @@ static void motion_cam_delete(struct ctx_motapp *motapp) motapp->cam_list[motapp->cam_delete] = NULL; /* Set up a new cam_list */ - tmp = (struct ctx_cam **)mymalloc(sizeof(struct ctx_cam *) * indx_cam); + tmp = (ctx_cam **)mymalloc(sizeof(ctx_cam *) * indx_cam); tmp[indx_cam-1] = NULL; /* Copy all the other cam pointers */ @@ -712,7 +712,7 @@ static void motion_cam_delete(struct ctx_motapp *motapp) int main (int argc, char **argv) { int indx; - struct ctx_motapp *motapp; + ctx_motapp *motapp; motapp = new ctx_motapp; diff --git a/src/motionplus.hpp b/src/motionplus.hpp index e25fc4ed..7ff4a1a3 100644 --- a/src/motionplus.hpp +++ b/src/motionplus.hpp @@ -73,6 +73,7 @@ extern "C" { #endif /* Forward declarations, used in functional definitions of headers */ +struct ctx_motapp; struct ctx_rotate; struct ctx_images; struct ctx_image_data; @@ -83,6 +84,8 @@ struct ctx_netcam; struct ctx_algsec; struct ctx_config; struct ctx_v4l2cam; +struct ctx_webui; +struct ctx_netcam; class cls_libcam; @@ -184,7 +187,7 @@ struct ctx_params_item { }; struct ctx_params { - struct ctx_params_item *params_array; /*Array of the controls the user specified*/ + ctx_params_item *params_array; /*Array of the controls the user specified*/ int params_count; /*Count of the controls the user specified*/ bool update_params; /*Bool for whether to update the parameters on the device*/ }; @@ -216,14 +219,14 @@ struct ctx_image_data { int shot; /* Sub second timestamp count */ unsigned long cent_dist; /* Movement center to img center distance * Note: Dist is calculated distX*distX + distY*distY */ unsigned int flags; /* See IMAGE_* defines */ - struct ctx_coord location; /* coordinates for center and size of last motion detection*/ + ctx_coord location; /* coordinates for center and size of last motion detection*/ int total_labels; }; struct ctx_images { - struct ctx_image_data *image_ring; /* The base address of the image ring buffer */ - struct ctx_image_data image_motion; /* Picture buffer for motion images */ - struct ctx_image_data image_preview; /* Picture buffer for best image when enables */ + ctx_image_data *image_ring; /* The base address of the image ring buffer */ + ctx_image_data image_motion; /* Picture buffer for motion images */ + ctx_image_data image_preview; /* Picture buffer for best image when enables */ unsigned char *ref; /* The reference frame */ unsigned char *ref_next; /* The reference frame */ @@ -274,12 +277,12 @@ struct ctx_stream_data { }; struct ctx_stream { - pthread_mutex_t mutex; - struct ctx_stream_data norm; /* Copy of the image to use for web stream*/ - struct ctx_stream_data sub; /* Copy of the image to use for web stream*/ - struct ctx_stream_data motion; /* Copy of the image to use for web stream*/ - struct ctx_stream_data source; /* Copy of the image to use for web stream*/ - struct ctx_stream_data secondary; /* Copy of the image to use for web stream*/ + pthread_mutex_t mutex; + ctx_stream_data norm; /* Copy of the image to use for web stream*/ + ctx_stream_data sub; /* Copy of the image to use for web stream*/ + ctx_stream_data motion; /* Copy of the image to use for web stream*/ + ctx_stream_data source; /* Copy of the image to use for web stream*/ + ctx_stream_data secondary; /* Copy of the image to use for web stream*/ }; /* @@ -288,27 +291,27 @@ struct ctx_stream { */ struct ctx_cam { - struct ctx_motapp *motapp; - char conf_filename[PATH_MAX]; - bool from_conf_dir; - int threadnr; - pthread_t thread_id; + ctx_motapp *motapp; + char conf_filename[PATH_MAX]; + bool from_conf_dir; + int threadnr; + pthread_t thread_id; - struct ctx_config *conf; - struct ctx_images imgs; - struct ctx_mmalcam *mmalcam; - struct ctx_netcam *netcam; /* this structure contains the context for normal RTSP connection */ - struct ctx_netcam *netcam_high; /* this structure contains the context for high resolution RTSP connection */ - struct ctx_v4l2cam *v4l2cam; - struct ctx_image_data *current_image; /* Pointer to a structure where the image, diffs etc is stored */ - struct ctx_algsec *algsec; - struct ctx_rotate *rotate_data; /* rotation data is thread-specific */ - struct ctx_movie *movie_norm; - struct ctx_movie *movie_motion; - struct ctx_movie *movie_timelapse; - struct ctx_stream stream; + ctx_config *conf; + ctx_images imgs; + ctx_mmalcam *mmalcam; + ctx_netcam *netcam; /* this structure contains the context for normal RTSP connection */ + ctx_netcam *netcam_high; /* this structure contains the context for high resolution RTSP connection */ + ctx_v4l2cam *v4l2cam; + ctx_image_data *current_image; /* Pointer to a structure where the image, diffs etc is stored */ + ctx_algsec *algsec; + ctx_rotate *rotate_data; /* rotation data is thread-specific */ + ctx_movie *movie_norm; + ctx_movie *movie_motion; + ctx_movie *movie_timelapse; + ctx_stream stream; - class cls_libcam *libcam; + cls_libcam *libcam; FILE *extpipe; int extpipe_open; @@ -395,7 +398,7 @@ struct ctx_cam { /* ctx_cam for whole motion application including all the cameras */ struct ctx_motapp { - struct ctx_cam **cam_list; + ctx_cam **cam_list; pthread_mutex_t global_lock; volatile int threads_running; @@ -423,9 +426,9 @@ struct ctx_motapp { struct MHD_Daemon *webcontrol_daemon; char webcontrol_digest_rand[12]; std::list webcontrol_clients; /* C++ list of client ips */ - struct ctx_params *webcontrol_headers; /* parameters for header */ - struct ctx_params *webcontrol_actions; /* parameters for actions */ - struct ctx_dbse *dbse; /* user specified database */ + ctx_params *webcontrol_headers; /* parameters for header */ + ctx_params *webcontrol_actions; /* parameters for actions */ + ctx_dbse *dbse; /* user specified database */ bool parms_changed; /*bool indicating if the parms have changed */ pthread_mutex_t mutex_parms; /* mutex used to lock when changing parms */ diff --git a/src/movie.cpp b/src/movie.cpp index 13a66c1d..5ef89828 100644 --- a/src/movie.cpp +++ b/src/movie.cpp @@ -42,13 +42,13 @@ #include "movie.hpp" -static void movie_free_pkt(struct ctx_movie *movie) +static void movie_free_pkt(ctx_movie *movie) { mypacket_free(movie->pkt); movie->pkt = NULL; } -static void movie_free_nal(struct ctx_movie *movie) +static void movie_free_nal(ctx_movie *movie) { if (movie->nal_info) { free(movie->nal_info); @@ -57,7 +57,7 @@ static void movie_free_nal(struct ctx_movie *movie) } } -static void movie_encode_nal(struct ctx_movie *movie) +static void movie_encode_nal(ctx_movie *movie) { // h264_v4l2m2m has NAL units separated from the first frame, which makes // some players very unhappy. @@ -89,7 +89,7 @@ static int movie_timelapse_exists(const char *fname) } } -static int movie_timelapse_append(struct ctx_movie *movie, AVPacket *pkt) +static int movie_timelapse_append(ctx_movie *movie, AVPacket *pkt) { FILE *file; @@ -105,7 +105,7 @@ static int movie_timelapse_append(struct ctx_movie *movie, AVPacket *pkt) return 0; } -static void movie_free_context(struct ctx_movie *movie) +static void movie_free_context(ctx_movie *movie) { if (movie->picture != NULL) { @@ -125,7 +125,7 @@ static void movie_free_context(struct ctx_movie *movie) } -static int movie_get_oformat(struct ctx_movie *movie) +static int movie_get_oformat(ctx_movie *movie) { size_t container_name_len; @@ -224,7 +224,7 @@ static int movie_get_oformat(struct ctx_movie *movie) return 0; } -static int movie_encode_video(struct ctx_movie *movie) +static int movie_encode_video(ctx_movie *movie) { #if (MYFFVER >= 57041) @@ -330,7 +330,7 @@ static int movie_encode_video(struct ctx_movie *movie) } -static int movie_set_pts(struct ctx_movie *movie, const struct timespec *ts1) +static int movie_set_pts(ctx_movie *movie, const struct timespec *ts1) { int64_t pts_interval; @@ -370,7 +370,7 @@ static int movie_set_pts(struct ctx_movie *movie, const struct timespec *ts1) return 0; } -static int movie_set_quality(struct ctx_movie *movie) +static int movie_set_quality(ctx_movie *movie) { movie->opts = 0; @@ -471,7 +471,7 @@ static const char *movie_codec_is_blacklisted(const char *codec_name) return NULL; } -static int movie_set_codec_preferred(struct ctx_movie *movie) +static int movie_set_codec_preferred(ctx_movie *movie) { size_t container_name_len = strcspn(movie->container_name, ":"); @@ -514,7 +514,7 @@ static int movie_set_codec_preferred(struct ctx_movie *movie) } -static int movie_set_codec(struct ctx_movie *movie) +static int movie_set_codec(ctx_movie *movie) { int retcd; @@ -640,7 +640,7 @@ static int movie_set_codec(struct ctx_movie *movie) return 0; } -static int movie_set_stream(struct ctx_movie *movie) +static int movie_set_stream(ctx_movie *movie) { #if (MYFFVER >= 57041) @@ -731,7 +731,7 @@ static int movie_alloc_video_buffer(AVFrame *frame, int align) } -static int movie_set_picture(struct ctx_movie *movie) +static int movie_set_picture(ctx_movie *movie) { int retcd; @@ -773,7 +773,7 @@ static int movie_set_picture(struct ctx_movie *movie) static int movie_interrupt(void *ctx) { - struct ctx_movie *movie = (struct ctx_movie *)ctx; + ctx_movie *movie = (ctx_movie *)ctx; clock_gettime(CLOCK_MONOTONIC, &movie->cb_cr_ts); if ((movie->cb_cr_ts.tv_sec - movie->cb_st_ts.tv_sec ) > movie->cb_dur) { @@ -786,7 +786,7 @@ static int movie_interrupt(void *ctx) } -static int movie_set_outputfile(struct ctx_movie *movie) +static int movie_set_outputfile(ctx_movie *movie) { int retcd; char errstr[128]; @@ -854,7 +854,7 @@ static int movie_set_outputfile(struct ctx_movie *movie) } -static int movie_flush_codec(struct ctx_movie *movie) +static int movie_flush_codec(ctx_movie *movie) { #if (MYFFVER >= 57041) //ffmpeg version 3.1 and after @@ -912,7 +912,7 @@ static int movie_flush_codec(struct ctx_movie *movie) } -static int movie_put_frame(struct ctx_movie *movie, const struct timespec *ts1) +static int movie_put_frame(ctx_movie *movie, const struct timespec *ts1) { int retcd; @@ -950,7 +950,7 @@ static int movie_put_frame(struct ctx_movie *movie, const struct timespec *ts1) } /* Reset the written flag and movie start time at opening of each event */ -static void movie_passthru_reset(struct ctx_movie *movie) +static void movie_passthru_reset(ctx_movie *movie) { int indx; @@ -963,7 +963,7 @@ static void movie_passthru_reset(struct ctx_movie *movie) } -static int movie_passthru_pktpts(struct ctx_movie *movie) +static int movie_passthru_pktpts(ctx_movie *movie) { int64_t ts_interval, base_pdts; AVRational tmpbase; @@ -1015,7 +1015,7 @@ static int movie_passthru_pktpts(struct ctx_movie *movie) return 0; } -static void movie_passthru_write(struct ctx_movie *movie, int indx) +static void movie_passthru_write(ctx_movie *movie, int indx) { /* Write the packet in the buffer at indx to file */ char errstr[128]; @@ -1049,7 +1049,7 @@ static void movie_passthru_write(struct ctx_movie *movie, int indx) } -static void movie_passthru_minpts(struct ctx_movie *movie) +static void movie_passthru_minpts(ctx_movie *movie) { int indx, indx_audio, indx_video; @@ -1104,7 +1104,7 @@ static void movie_passthru_minpts(struct ctx_movie *movie) } -static int movie_passthru_put(struct ctx_movie *movie, struct ctx_image_data *img_data) +static int movie_passthru_put(ctx_movie *movie, ctx_image_data *img_data) { int idnbr_image, idnbr_lastwritten, idnbr_stop, idnbr_firstkey; int indx, indx_lastwritten, indx_firstkey, indx_video; @@ -1184,7 +1184,7 @@ static int movie_passthru_put(struct ctx_movie *movie, struct ctx_image_data *im return 0; } -static int movie_passthru_streams_video(struct ctx_movie *movie, AVStream *stream_in) +static int movie_passthru_streams_video(ctx_movie *movie, AVStream *stream_in) { int retcd; @@ -1214,7 +1214,7 @@ static int movie_passthru_streams_video(struct ctx_movie *movie, AVStream *strea return 0; } -static int movie_passthru_streams_audio(struct ctx_movie *movie, AVStream *stream_in) +static int movie_passthru_streams_audio(ctx_movie *movie, AVStream *stream_in) { int retcd; @@ -1245,7 +1245,7 @@ static int movie_passthru_streams_audio(struct ctx_movie *movie, AVStream *strea return 0; } -static int movie_passthru_streams(struct ctx_movie *movie) +static int movie_passthru_streams(ctx_movie *movie) { #if (MYFFVER >= 57041) int retcd, indx; @@ -1278,7 +1278,7 @@ static int movie_passthru_streams(struct ctx_movie *movie) #endif } -static int movie_passthru_check(struct ctx_movie *movie) +static int movie_passthru_check(ctx_movie *movie) { if ((movie->netcam_data->status == NETCAM_NOTCONNECTED ) || (movie->netcam_data->status == NETCAM_RECONNECTING )) { @@ -1297,7 +1297,7 @@ static int movie_passthru_check(struct ctx_movie *movie) return 0; } -static int movie_passthru_open(struct ctx_movie *movie) +static int movie_passthru_open(ctx_movie *movie) { int retcd; @@ -1389,7 +1389,7 @@ void movie_avcodec_log(void *ignoreme, int errno_flag, const char *fmt, va_list } -static void movie_put_pix_nv21(struct ctx_movie *movie, struct ctx_image_data *img_data) +static void movie_put_pix_nv21(ctx_movie *movie, ctx_image_data *img_data) { unsigned char *image,*imagecr, *imagecb; int cr_len, x, y; @@ -1416,7 +1416,7 @@ static void movie_put_pix_nv21(struct ctx_movie *movie, struct ctx_image_data *i } -static void movie_put_pix_yuv420(struct ctx_movie *movie, struct ctx_image_data *img_data) +static void movie_put_pix_yuv420(ctx_movie *movie, ctx_image_data *img_data) { unsigned char *image; @@ -1468,7 +1468,7 @@ void movie_global_deinit(void) } -int movie_open(struct ctx_movie *movie) +int movie_open(ctx_movie *movie) { int retcd; @@ -1528,7 +1528,7 @@ int movie_open(struct ctx_movie *movie) } -void movie_free(struct ctx_movie *movie) +void movie_free(ctx_movie *movie) { if (movie != NULL) { movie_free_context(movie); @@ -1545,7 +1545,7 @@ void movie_free(struct ctx_movie *movie) } } -void movie_close(struct ctx_movie *movie) +void movie_close(ctx_movie *movie) { if (movie != NULL) { @@ -1571,7 +1571,7 @@ void movie_close(struct ctx_movie *movie) } -int movie_put_image(struct ctx_movie *movie, struct ctx_image_data *img_data, const struct timespec *ts1) +int movie_put_image(ctx_movie *movie, ctx_image_data *img_data, const struct timespec *ts1) { int retcd = 0; int cnt = 0; @@ -1627,7 +1627,7 @@ int movie_put_image(struct ctx_movie *movie, struct ctx_image_data *img_data, co } -void movie_reset_start_time(struct ctx_movie *movie, const struct timespec *ts1) +void movie_reset_start_time(ctx_movie *movie, const struct timespec *ts1) { int64_t one_frame_interval = av_rescale_q(1,(AVRational){1, movie->fps}, movie->strm_video->time_base); if (one_frame_interval <= 0) { @@ -1640,7 +1640,7 @@ void movie_reset_start_time(struct ctx_movie *movie, const struct timespec *ts1) } -static const char* movie_init_container(struct ctx_cam *cam) +static const char* movie_init_container(ctx_cam *cam) { /* The following section allows for testing of all the various containers @@ -1684,13 +1684,13 @@ static const char* movie_init_container(struct ctx_cam *cam) } -int movie_init_norm(struct ctx_cam *cam, struct timespec *ts1) +int movie_init_norm(ctx_cam *cam, struct timespec *ts1) { char tmp[PATH_MAX]; const char *container; int retcd, len; - cam->movie_norm =(struct ctx_movie*) mymalloc(sizeof(struct ctx_movie)); + cam->movie_norm =(ctx_movie*) mymalloc(sizeof(ctx_movie)); mystrftime(cam, tmp, sizeof(tmp) , cam->conf->movie_filename.c_str(), ts1, NULL, 0); @@ -1758,13 +1758,13 @@ int movie_init_norm(struct ctx_cam *cam, struct timespec *ts1) } -int movie_init_motion(struct ctx_cam *cam, struct timespec *ts1) +int movie_init_motion(ctx_cam *cam, struct timespec *ts1) { char tmp[PATH_MAX]; const char *container; int retcd, len; - cam->movie_motion =(struct ctx_movie*)mymalloc(sizeof(struct ctx_movie)); + cam->movie_motion =(ctx_movie*)mymalloc(sizeof(ctx_movie)); mystrftime(cam, tmp, sizeof(tmp) , cam->conf->movie_filename.c_str(), ts1, NULL, 0); @@ -1825,14 +1825,14 @@ int movie_init_motion(struct ctx_cam *cam, struct timespec *ts1) } -int movie_init_timelapse(struct ctx_cam *cam, struct timespec *ts1) +int movie_init_timelapse(ctx_cam *cam, struct timespec *ts1) { char tmp[PATH_MAX]; const char *container_mpg = "mpg"; const char *container_mkv = "mkv"; int retcd, len; - cam->movie_timelapse =(struct ctx_movie*)mymalloc(sizeof(struct ctx_movie)); + cam->movie_timelapse =(ctx_movie*)mymalloc(sizeof(ctx_movie)); mystrftime(cam, tmp, sizeof(tmp) , cam->conf->timelapse_filename.c_str(), ts1, NULL, 0); diff --git a/src/movie.hpp b/src/movie.hpp index ec54f37a..0c927b4e 100644 --- a/src/movie.hpp +++ b/src/movie.hpp @@ -27,9 +27,6 @@ #include #include -struct ctx_image_data; /* forward declare for functions */ -struct ctx_netcam; - enum TIMELAPSE_TYPE { TIMELAPSE_NONE, /* No timelapse, regular processing */ TIMELAPSE_APPEND, /* Use append version of timelapse */ @@ -54,7 +51,7 @@ struct ctx_movie { AVPacket *pkt; AVFrame *picture; /* contains default image pointers */ AVDictionary *opts; - struct ctx_netcam *netcam_data; + ctx_netcam *netcam_data; int width; int height; enum TIMELAPSE_TYPE tlapse; @@ -89,13 +86,13 @@ void movie_global_init(void); void movie_global_deinit(void); void movie_avcodec_log(void *, int, const char *, va_list); -int movie_open(struct ctx_movie *movie); -int movie_put_image(struct ctx_movie *movie, struct ctx_image_data *img_data, const struct timespec *tv1); -void movie_close(struct ctx_movie *movie); -void movie_reset_start_time(struct ctx_movie *movie, const struct timespec *tv1); -int movie_init_timelapse(struct ctx_cam *cam, struct timespec *ts1); -int movie_init_norm(struct ctx_cam *cam, struct timespec *ts1); -int movie_init_motion(struct ctx_cam *cam, struct timespec *ts1); -void movie_free(struct ctx_movie *movie); +int movie_open(ctx_movie *movie); +int movie_put_image(ctx_movie *movie, ctx_image_data *img_data, const struct timespec *tv1); +void movie_close(ctx_movie *movie); +void movie_reset_start_time(ctx_movie *movie, const struct timespec *tv1); +int movie_init_timelapse(ctx_cam *cam, struct timespec *ts1); +int movie_init_norm(ctx_cam *cam, struct timespec *ts1); +int movie_init_motion(ctx_cam *cam, struct timespec *ts1); +void movie_free(ctx_movie *movie); #endif /* #define _INCLUDE_MOVIE_HPP_ */ diff --git a/src/netcam.cpp b/src/netcam.cpp index e6b0d569..76510239 100644 --- a/src/netcam.cpp +++ b/src/netcam.cpp @@ -257,13 +257,13 @@ static void netcam_url_free(struct url_t *parse_url) myfree(&parse_url->path); } -static void netcam_free_pkt(struct ctx_netcam *netcam) +static void netcam_free_pkt(ctx_netcam *netcam) { mypacket_free(netcam->packet_recv); netcam->packet_recv = NULL; } -static int netcam_check_pixfmt(struct ctx_netcam *netcam) +static int netcam_check_pixfmt(ctx_netcam *netcam) { /* Determine if the format is YUV420P */ int retcd; @@ -278,7 +278,7 @@ static int netcam_check_pixfmt(struct ctx_netcam *netcam) } -static void netcam_pktarray_free(struct ctx_netcam *netcam) +static void netcam_pktarray_free(ctx_netcam *netcam) { int indx; @@ -296,7 +296,7 @@ static void netcam_pktarray_free(struct ctx_netcam *netcam) } -static void netcam_null_context(struct ctx_netcam *netcam) +static void netcam_null_context(ctx_netcam *netcam) { netcam->swsctx = NULL; @@ -310,7 +310,7 @@ static void netcam_null_context(struct ctx_netcam *netcam) } -static void netcam_close_context(struct ctx_netcam *netcam) +static void netcam_close_context(ctx_netcam *netcam) { if (netcam->swsctx != NULL) sws_freeContext(netcam->swsctx); @@ -326,7 +326,7 @@ static void netcam_close_context(struct ctx_netcam *netcam) } -static void netcam_pktarray_resize(struct ctx_cam *cam, bool is_highres) +static void netcam_pktarray_resize(ctx_cam *cam, bool is_highres) { /* This is called from netcam_next and is on the motion loop thread * The netcam->mutex is locked around the call to this function. @@ -347,7 +347,7 @@ static void netcam_pktarray_resize(struct ctx_cam *cam, bool is_highres) int64_t idnbr_last, idnbr_first; int indx; - struct ctx_netcam *netcam; + ctx_netcam *netcam; struct packet_item *tmp; int newsize; @@ -397,7 +397,7 @@ static void netcam_pktarray_resize(struct ctx_cam *cam, bool is_highres) } -static void netcam_pktarray_add(struct ctx_netcam *netcam) +static void netcam_pktarray_add(ctx_netcam *netcam) { int indx_next; @@ -447,7 +447,7 @@ static void netcam_pktarray_add(struct ctx_netcam *netcam) } -static int netcam_decode_sw(struct ctx_netcam *netcam) +static int netcam_decode_sw(ctx_netcam *netcam) { #if (MYFFVER >= 57041) int retcd; @@ -481,7 +481,7 @@ static int netcam_decode_sw(struct ctx_netcam *netcam) #endif } -static int netcam_decode_vaapi(struct ctx_netcam *netcam) +static int netcam_decode_vaapi(ctx_netcam *netcam) { #if ( MYFFVER >= 57083) int retcd; @@ -536,7 +536,7 @@ static int netcam_decode_vaapi(struct ctx_netcam *netcam) * 1 valid data */ -static int netcam_decode_video(struct ctx_netcam *netcam) +static int netcam_decode_video(ctx_netcam *netcam) { #if (MYFFVER >= 57041) int retcd; @@ -615,7 +615,7 @@ static int netcam_decode_video(struct ctx_netcam *netcam) } -static int netcam_decode_packet(struct ctx_netcam *netcam) +static int netcam_decode_packet(ctx_netcam *netcam) { int frame_size; @@ -660,7 +660,7 @@ static int netcam_decode_packet(struct ctx_netcam *netcam) return frame_size; } -static void netcam_hwdecoders(struct ctx_netcam *netcam) +static void netcam_hwdecoders(ctx_netcam *netcam) { #if ( MYFFVER >= 57083) /* High Res pass through does not decode images into frames*/ @@ -714,7 +714,7 @@ static enum AVPixelFormat netcam_getfmt_vaapi(AVCodecContext *avctx, const enum #endif } -static void netcam_decoder_error(struct ctx_netcam *netcam, int retcd, const char* fnc_nm) +static void netcam_decoder_error(ctx_netcam *netcam, int retcd, const char* fnc_nm) { char errstr[128]; int indx; @@ -763,7 +763,7 @@ static void netcam_decoder_error(struct ctx_netcam *netcam, int retcd, const cha } -static int netcam_init_vaapi(struct ctx_netcam *netcam) +static int netcam_init_vaapi(ctx_netcam *netcam) { #if ( MYFFVER >= 57083) int retcd; @@ -814,7 +814,7 @@ static int netcam_init_vaapi(struct ctx_netcam *netcam) #endif } -static int netcam_init_swdecoder(struct ctx_netcam *netcam) +static int netcam_init_swdecoder(ctx_netcam *netcam) { #if ( MYFFVER >= 57041) int retcd; @@ -873,7 +873,7 @@ static int netcam_init_swdecoder(struct ctx_netcam *netcam) } -static int netcam_open_codec(struct ctx_netcam *netcam) +static int netcam_open_codec(ctx_netcam *netcam) { #if ( MYFFVER >= 57041) @@ -950,14 +950,14 @@ static int netcam_open_codec(struct ctx_netcam *netcam) } -static struct ctx_netcam *netcam_new_context(void) +static ctx_netcam *netcam_new_context(void) { - struct ctx_netcam *ret; + ctx_netcam *ret; /* Note that mymalloc will exit on any problem. */ - ret =(struct ctx_netcam*) mymalloc(sizeof(struct ctx_netcam)); + ret =(ctx_netcam*) mymalloc(sizeof(ctx_netcam)); - memset(ret, 0, sizeof(struct ctx_netcam)); + memset(ret, 0, sizeof(ctx_netcam)); return ret; } @@ -965,7 +965,7 @@ static struct ctx_netcam *netcam_new_context(void) static int netcam_interrupt(void *ctx) { /* Must return as an int since this is a callback to a C function */ - struct ctx_netcam *netcam = (struct ctx_netcam *)ctx; + ctx_netcam *netcam = (ctx_netcam *)ctx; if (netcam->finish) { netcam->interrupted = true; @@ -1007,7 +1007,7 @@ static int netcam_interrupt(void *ctx) return false; } -static int netcam_open_sws(struct ctx_netcam *netcam) +static int netcam_open_sws(ctx_netcam *netcam) { if (netcam->finish) { @@ -1086,7 +1086,7 @@ static int netcam_open_sws(struct ctx_netcam *netcam) } -static int netcam_resize(struct ctx_netcam *netcam) +static int netcam_resize(ctx_netcam *netcam) { int retcd; @@ -1183,7 +1183,7 @@ static int netcam_resize(struct ctx_netcam *netcam) } -static int netcam_read_image(struct ctx_netcam *netcam) +static int netcam_read_image(ctx_netcam *netcam) { int size_decoded, retcd, errcnt, nodata; @@ -1327,7 +1327,7 @@ static int netcam_read_image(struct ctx_netcam *netcam) return 0; } -static int netcam_ntc(struct ctx_netcam *netcam) +static int netcam_ntc(ctx_netcam *netcam) { if ((netcam->finish) || (!netcam->first_image)) { @@ -1357,7 +1357,7 @@ static int netcam_ntc(struct ctx_netcam *netcam) } -static void netcam_set_options(struct ctx_netcam *netcam) +static void netcam_set_options(ctx_netcam *netcam) { int indx; @@ -1435,7 +1435,7 @@ static void netcam_set_options(struct ctx_netcam *netcam) } -static void netcam_set_path (struct ctx_cam *cam, struct ctx_netcam *netcam ) +static void netcam_set_path (ctx_cam *cam, ctx_netcam *netcam ) { char userpass[PATH_MAX]; @@ -1494,7 +1494,7 @@ static void netcam_set_path (struct ctx_cam *cam, struct ctx_netcam *netcam ) } -static void netcam_set_parms (struct ctx_cam *cam, struct ctx_netcam *netcam ) +static void netcam_set_parms (ctx_cam *cam, ctx_netcam *netcam ) { /* Set the parameters to be used with our camera */ int indx, val_len; @@ -1506,14 +1506,14 @@ static void netcam_set_parms (struct ctx_cam *cam, struct ctx_netcam *netcam ) netcam->imgsize.width = 0; netcam->imgsize.height = 0; snprintf(netcam->cameratype, 29, "%s",_("High")); - netcam->params = (ctx_params*)mymalloc(sizeof(struct ctx_params)); + netcam->params = (ctx_params*)mymalloc(sizeof(ctx_params)); netcam->params->update_params = true; util_parms_parse(netcam->params, cam->conf->netcam_high_params); } else { netcam->imgsize.width = cam->conf->width; netcam->imgsize.height = cam->conf->height; snprintf(netcam->cameratype, 29, "%s",_("Norm")); - netcam->params = (ctx_params*)mymalloc(sizeof(struct ctx_params)); + netcam->params = (ctx_params*)mymalloc(sizeof(ctx_params)); netcam->params->update_params = true; util_parms_parse(netcam->params, cam->conf->netcam_params); } @@ -1582,7 +1582,7 @@ static void netcam_set_parms (struct ctx_cam *cam, struct ctx_netcam *netcam ) } -static int netcam_set_dimensions (struct ctx_cam *cam) +static int netcam_set_dimensions (ctx_cam *cam) { cam->imgs.width = 0; @@ -1620,7 +1620,7 @@ static int netcam_set_dimensions (struct ctx_cam *cam) return 0; } -static int netcam_copy_stream(struct ctx_netcam *netcam) +static int netcam_copy_stream(ctx_netcam *netcam) { /* Make a static copy of the stream information for use in passthrough processing */ #if (MYFFVER >= 57041) @@ -1663,7 +1663,7 @@ static int netcam_copy_stream(struct ctx_netcam *netcam) } -static int netcam_open_context(struct ctx_netcam *netcam) +static int netcam_open_context(ctx_netcam *netcam) { int retcd; @@ -1800,7 +1800,7 @@ static int netcam_open_context(struct ctx_netcam *netcam) } -static int netcam_connect(struct ctx_netcam *netcam) +static int netcam_connect(ctx_netcam *netcam) { if (netcam_open_context(netcam) < 0) { @@ -1868,7 +1868,7 @@ static int netcam_connect(struct ctx_netcam *netcam) return 0; } -static void netcam_shutdown(struct ctx_netcam *netcam) +static void netcam_shutdown(ctx_netcam *netcam) { if (netcam) { @@ -1897,7 +1897,7 @@ static void netcam_shutdown(struct ctx_netcam *netcam) } -static void netcam_handler_wait(struct ctx_netcam *netcam) +static void netcam_handler_wait(ctx_netcam *netcam) { int64_t usec_ltncy; AVRational tbase; @@ -1941,7 +1941,7 @@ static void netcam_handler_wait(struct ctx_netcam *netcam) } -static void netcam_handler_reconnect(struct ctx_netcam *netcam) +static void netcam_handler_reconnect(ctx_netcam *netcam) { int retcd, indx; @@ -2004,7 +2004,7 @@ static void netcam_handler_reconnect(struct ctx_netcam *netcam) static void *netcam_handler(void *arg) { - struct ctx_netcam *netcam =(struct ctx_netcam *) arg; + ctx_netcam *netcam =(ctx_netcam *) arg; netcam->handler_finished = false; @@ -2051,7 +2051,7 @@ static void *netcam_handler(void *arg) pthread_exit(NULL); } -static int netcam_start_handler(struct ctx_netcam *netcam) +static int netcam_start_handler(ctx_netcam *netcam) { int retcd, wait_counter; @@ -2102,12 +2102,12 @@ static int netcam_start_handler(struct ctx_netcam *netcam) } -int netcam_setup(struct ctx_cam *cam) +int netcam_setup(ctx_cam *cam) { int retcd; int indx_cam, indx_max; - struct ctx_netcam *netcam; + ctx_netcam *netcam; cam->netcam = NULL; cam->netcam_high = NULL; @@ -2185,7 +2185,7 @@ int netcam_setup(struct ctx_cam *cam) } /* netcam_next (Called from the motion loop thread) */ -int netcam_next(struct ctx_cam *cam, struct ctx_image_data *img_data) +int netcam_next(ctx_cam *cam, ctx_image_data *img_data) { if (cam == NULL) { return 1; @@ -2228,7 +2228,7 @@ int netcam_next(struct ctx_cam *cam, struct ctx_image_data *img_data) return 0; } -void netcam_cleanup(struct ctx_cam *cam, bool init_retry_flag) +void netcam_cleanup(ctx_cam *cam, bool init_retry_flag) { /* @@ -2239,7 +2239,7 @@ void netcam_cleanup(struct ctx_cam *cam, bool init_retry_flag) */ int wait_counter; int indx_cam, indx_max; - struct ctx_netcam *netcam; + ctx_netcam *netcam; indx_cam = 1; if (cam->netcam_high) { diff --git a/src/netcam.hpp b/src/netcam.hpp index 790a72e7..fdc4e2ff 100644 --- a/src/netcam.hpp +++ b/src/netcam.hpp @@ -147,9 +147,9 @@ struct ctx_netcam { struct timespec frame_prev_tm; /* The time set before calling the av functions */ struct timespec frame_curr_tm; /* Time during the interrupt to determine duration since start*/ - struct ctx_motapp *motapp; /* Pointer to parent application context */ - struct ctx_config *conf; /* Pointer to conf parms of parent cam*/ - struct ctx_params *params; /* parameters for the camera */ + ctx_motapp *motapp; /* Pointer to parent application context */ + ctx_config *conf; /* Pointer to conf parms of parent cam*/ + ctx_params *params; /* parameters for the camera */ char threadname[16]; /* The thread name*/ int threadnbr; /* The thread number */ @@ -160,8 +160,8 @@ struct ctx_netcam { }; -int netcam_setup(struct ctx_cam *cam); -int netcam_next(struct ctx_cam *cam, struct ctx_image_data *img_data); -void netcam_cleanup(struct ctx_cam *cam, bool init_retry_flag); +int netcam_setup(ctx_cam *cam); +int netcam_next(ctx_cam *cam, ctx_image_data *img_data); +void netcam_cleanup(ctx_cam *cam, bool init_retry_flag); #endif /* _INCLUDE_NETCAM_HPP_ */ diff --git a/src/picture.cpp b/src/picture.cpp index b4c49ea4..6d38f6ba 100644 --- a/src/picture.cpp +++ b/src/picture.cpp @@ -39,8 +39,8 @@ * It must be called after WebPEncode() and the result * can then be written out to webp a file */ -static void pic_webp_exif(WebPMux* webp_mux, const struct ctx_cam *cam, - const struct timespec *ts1, const struct ctx_coord *box) +static void pic_webp_exif(WebPMux* webp_mux, ctx_cam *cam, + const struct timespec *ts1, ctx_coord *box) { unsigned char *exif = NULL; unsigned exif_len = exif_prepare(&exif, cam, ts1, box); @@ -65,7 +65,7 @@ static void pic_webp_exif(WebPMux* webp_mux, const struct ctx_cam *cam, /** Save image as webp to file */ static void pic_save_webp(FILE *fp, unsigned char *image, int width, int height, - int quality, struct ctx_cam *cam, struct timespec *ts1, struct ctx_coord *box) + int quality, ctx_cam *cam, struct timespec *ts1, ctx_coord *box) { #ifdef HAVE_WEBP /* Create a config present and check for compatible library version */ @@ -155,7 +155,7 @@ static void pic_save_webp(FILE *fp, unsigned char *image, int width, int height, /** Save image as yuv420p jpeg to file */ static void pic_save_yuv420p(FILE *fp, unsigned char *image, int width, int height, - int quality, struct ctx_cam *cam, struct timespec *ts1, struct ctx_coord *box) + int quality, ctx_cam *cam, struct timespec *ts1, ctx_coord *box) { int sz, image_size; @@ -172,7 +172,7 @@ static void pic_save_yuv420p(FILE *fp, unsigned char *image, int width, int heig /** Save image as grey jpeg to file */ static void pic_save_grey(FILE *picture, unsigned char *image, int width, int height, - int quality, struct ctx_cam *cam, struct timespec *ts1, struct ctx_coord *box) + int quality, ctx_cam *cam, struct timespec *ts1, ctx_coord *box) { int sz, image_size; @@ -254,7 +254,7 @@ static void pic_save_ppm(FILE *picture, unsigned char *image, int width, int hei /** Put picture into memory as jpg */ -int pic_put_memory(struct ctx_cam *cam, unsigned char* dest_image, int image_size +int pic_put_memory(ctx_cam *cam, unsigned char* dest_image, int image_size , unsigned char *image, int quality, int width, int height) { struct timespec ts1; @@ -272,7 +272,7 @@ int pic_put_memory(struct ctx_cam *cam, unsigned char* dest_image, int image_siz } /* Write the picture to a file */ -static void pic_write(struct ctx_cam *cam, FILE *picture, unsigned char *image, int quality, int ftype) +static void pic_write(ctx_cam *cam, FILE *picture, unsigned char *image, int quality, int ftype) { int width, height; int passthrough; @@ -302,7 +302,7 @@ static void pic_write(struct ctx_cam *cam, FILE *picture, unsigned char *image, } /* Saves image to a file in format requested */ -void pic_save_norm(struct ctx_cam *cam, char *file, unsigned char *image, int ftype) +void pic_save_norm(ctx_cam *cam, char *file, unsigned char *image, int ftype) { FILE *picture; @@ -330,7 +330,7 @@ void pic_save_norm(struct ctx_cam *cam, char *file, unsigned char *image, int ft } /* Saves image to a file in format requested */ -void pic_save_roi(struct ctx_cam *cam, char *file, unsigned char *image) +void pic_save_roi(ctx_cam *cam, char *file, unsigned char *image) { FILE *picture; int image_size, sz, indxh; @@ -464,7 +464,7 @@ unsigned char *pic_load_pgm(FILE *picture, int width, int height) } /** Write out a base mask file if needed */ -static void pic_write_mask(struct ctx_cam *cam, const char *file) +static void pic_write_mask(ctx_cam *cam, const char *file) { FILE *picture; @@ -521,7 +521,7 @@ void pic_scale_img(int width_src, int height_src, unsigned char *img_src, unsign return; } -void pic_save_preview(struct ctx_cam *cam, struct ctx_image_data *img) +void pic_save_preview(ctx_cam *cam, ctx_image_data *img) { unsigned char *image_norm, *image_high; @@ -530,7 +530,7 @@ void pic_save_preview(struct ctx_cam *cam, struct ctx_image_data *img) image_high = cam->imgs.image_preview.image_high; /* Copy over the meta data from the img into preview */ - memcpy(&cam->imgs.image_preview, img, sizeof(struct ctx_image_data)); + memcpy(&cam->imgs.image_preview, img, sizeof(ctx_image_data)); /* Restore the pointers to the memory locations for images*/ cam->imgs.image_preview.image_norm = image_norm; @@ -554,7 +554,7 @@ void pic_save_preview(struct ctx_cam *cam, struct ctx_image_data *img) } -void pic_init_privacy(struct ctx_cam *cam) +void pic_init_privacy(ctx_cam *cam) { int indxrow, indxcol; @@ -664,7 +664,7 @@ void pic_init_privacy(struct ctx_cam *cam) } -void pic_init_mask(struct ctx_cam *cam) +void pic_init_mask(ctx_cam *cam) { FILE *picture; diff --git a/src/rotate.cpp b/src/rotate.cpp index 39d62eab..b5b9628e 100644 --- a/src/rotate.cpp +++ b/src/rotate.cpp @@ -177,11 +177,11 @@ static inline void rot90ccw(unsigned char *src, unsigned char *dst, int size, in * * Returns: nothing */ -void rotate_init(struct ctx_cam *cam) +void rotate_init(ctx_cam *cam) { int size_norm, size_high; - cam->rotate_data =(struct ctx_rotate*) mymalloc(sizeof(struct ctx_rotate)); + cam->rotate_data =(ctx_rotate*) mymalloc(sizeof(ctx_rotate)); /* Make sure buffer_norm isn't freed if it hasn't been allocated. */ cam->rotate_data->buffer_norm = NULL; @@ -272,7 +272,7 @@ void rotate_init(struct ctx_cam *cam) * * Returns: nothing */ -void rotate_deinit(struct ctx_cam *cam) +void rotate_deinit(ctx_cam *cam) { if (cam->rotate_data == NULL) { @@ -298,7 +298,7 @@ void rotate_deinit(struct ctx_cam *cam) * 0 - success * -1 - failure (shouldn't happen) */ -int rotate_map(struct ctx_cam *cam, struct ctx_image_data *img_data) +int rotate_map(ctx_cam *cam, ctx_image_data *img_data) { /* * The image format is YUV 4:2:0 planar, which has the pixel diff --git a/src/rotate.hpp b/src/rotate.hpp index c899aaec..1ebf7e68 100644 --- a/src/rotate.hpp +++ b/src/rotate.hpp @@ -19,8 +19,6 @@ #ifndef _INCLUDE_ROTATE_HPP_ #define _INCLUDE_ROTATE_HPP_ - struct ctx_cam; - struct ctx_rotate { unsigned char *buffer_norm; /* Temp low res buffer for 90 and 270 degrees rotation */ unsigned char *buffer_high; /* Temp high res buffer for 90 and 270 degrees rotation */ @@ -34,8 +32,8 @@ int capture_height_high; /* Capture height of high resolution image */ }; - void rotate_init(struct ctx_cam *cam); - void rotate_deinit(struct ctx_cam *cam); - int rotate_map(struct ctx_cam *cam, struct ctx_image_data *img_data); + void rotate_init(ctx_cam *cam); + void rotate_deinit(ctx_cam *cam); + int rotate_map(ctx_cam *cam, ctx_image_data *img_data); #endif /* _INCLUDE_ROTATE_HPP_ */ diff --git a/src/util.cpp b/src/util.cpp index b9f2cbf2..cd2d06fc 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -261,7 +261,7 @@ int myfclose(FILE* fh) * host Replaced with the name of the local machine (see gethostname(2)). * fps Equivalent to %fps. */ -static void mystrftime_long (const struct ctx_cam *cam, +static void mystrftime_long (const ctx_cam *cam, int width, const char *word, int l, char *out) { @@ -343,7 +343,7 @@ static void mystrftime_long (const struct ctx_cam *cam, * * Returns: number of bytes written to the string s */ -size_t mystrftime(const struct ctx_cam *cam, char *s, size_t max, const char *userformat, +size_t mystrftime(ctx_cam *cam, char *s, size_t max, const char *userformat, const struct timespec *ts1, const char *filename, int sqltype) { char formatstring[PATH_MAX] = ""; @@ -554,7 +554,7 @@ void mythreadname_get(char *threadname) #endif } -bool mycheck_passthrough(struct ctx_cam *cam) +bool mycheck_passthrough(ctx_cam *cam) { #if (MYFFVER >= 57041) if (cam->movie_passthrough) { @@ -780,7 +780,7 @@ AVPacket *mypacket_alloc(AVPacket *pkt) /*********************************************/ -void util_parms_free(struct ctx_params *params) +void util_parms_free(ctx_params *params) { int indx_parm; @@ -798,15 +798,15 @@ void util_parms_free(struct ctx_params *params) } -static void util_parms_add(struct ctx_params *params, const char *parm_nm, const char *parm_val) +static void util_parms_add(ctx_params *params, const char *parm_nm, const char *parm_val) { params->params_count++; if (params->params_count == 1) { - params->params_array =(struct ctx_params_item *) mymalloc(sizeof(struct ctx_params_item)); + params->params_array =(ctx_params_item *) mymalloc(sizeof(ctx_params_item)); } else { - params->params_array =(struct ctx_params_item *)realloc(params->params_array - , sizeof(struct ctx_params_item)*params->params_count); + params->params_array =(ctx_params_item *)realloc(params->params_array + , sizeof(ctx_params_item)*params->params_count); } if (parm_nm != NULL) { @@ -856,7 +856,7 @@ static void util_parms_strip_qte(std::string &parm) } -static void util_parms_extract(struct ctx_params *params, std::string &parmline +static void util_parms_extract(ctx_params *params, std::string &parmline ,size_t indxnm_st,size_t indxnm_en,size_t indxvl_st,size_t indxvl_en) { std::string parm_nm, parm_vl; @@ -905,7 +905,7 @@ static void util_parms_next(std::string &parmline, size_t indxnm_st, size_t indx } -void util_parms_parse_qte(struct ctx_params *params, std::string &parmline) +void util_parms_parse_qte(ctx_params *params, std::string &parmline) { size_t indxnm_st, indxnm_en; size_t indxvl_st, indxvl_en; @@ -994,7 +994,7 @@ void util_parms_parse_qte(struct ctx_params *params, std::string &parmline) } } -void util_parms_parse_comma(struct ctx_params *params, std::string &parmline) +void util_parms_parse_comma(ctx_params *params, std::string &parmline) { size_t indxnm_st, indxnm_en; size_t indxvl_st, indxvl_en; @@ -1046,7 +1046,7 @@ void util_parms_parse_comma(struct ctx_params *params, std::string &parmline) } /* Parse through the config line and put into the array */ -void util_parms_parse(struct ctx_params *params, std::string confline) +void util_parms_parse(ctx_params *params, std::string confline) { /* Parse through the configuration option to get values * The values are separated by commas but may also have @@ -1100,7 +1100,7 @@ void util_parms_add_default(ctx_params *params, std::string parm_nm, std::string } /* Update config line with the values from the params array */ -void util_parms_update(struct ctx_params *params, std::string &confline) +void util_parms_update(ctx_params *params, std::string &confline) { int indx; char *tst; @@ -1150,7 +1150,7 @@ void util_parms_update(struct ctx_params *params, std::string &confline) * that the fork inherited from the parent in order not to pass * the open handles on to the shell */ -void util_exec_command(struct ctx_cam *cam, const char *command, char *filename, int filetype) +void util_exec_command(ctx_cam *cam, const char *command, char *filename, int filetype) { char stamp[PATH_MAX]; mystrftime(cam, stamp, sizeof(stamp), command, &cam->current_image->imgts, filename, filetype); diff --git a/src/util.hpp b/src/util.hpp index 6737acc6..40926ba3 100644 --- a/src/util.hpp +++ b/src/util.hpp @@ -106,13 +106,13 @@ int mycreate_path(const char *path); FILE *myfopen(const char *path, const char *mode); int myfclose(FILE *fh); - size_t mystrftime(const struct ctx_cam *cam, char *s, size_t max, const char *userformat, + size_t mystrftime(ctx_cam *cam, char *s, size_t max, const char *userformat, const struct timespec *ts1, const char *filename, int sqltype); - void util_exec_command(struct ctx_cam *cam, const char *command, char *filename, int filetype); + void util_exec_command(ctx_cam *cam, const char *command, char *filename, int filetype); void mythreadname_set(const char *abbr, int threadnbr, const char *threadname); void mythreadname_get(char *threadname); - bool mycheck_passthrough(struct ctx_cam *cam); + bool mycheck_passthrough(ctx_cam *cam); char* mytranslate_text(const char *msgid, int setnls); void mytranslate_init(void); @@ -136,11 +136,11 @@ int mycopy_packet(AVPacket *dest_pkt, AVPacket *src_pkt); AVPacket *mypacket_alloc(AVPacket *pkt); - void util_parms_parse(struct ctx_params *params, std::string confline); + void util_parms_parse(ctx_params *params, std::string confline); void util_parms_add_default(ctx_params *params, std::string parm_nm, std::string parm_vl); - void util_parms_free(struct ctx_params *params); - void util_parms_update(struct ctx_params *params, std::string &confline); + void util_parms_free(ctx_params *params); + void util_parms_update(ctx_params *params, std::string &confline); #endif /* _INCLUDE_UTIL_HPP_ */ diff --git a/src/video_loopback.cpp b/src/video_loopback.cpp index bb380730..6a2c9107 100644 --- a/src/video_loopback.cpp +++ b/src/video_loopback.cpp @@ -241,7 +241,7 @@ int vlp_putpipe(int dev, unsigned char *image, int imgsize) #endif } -void vlp_init(struct ctx_cam *cam) +void vlp_init(ctx_cam *cam) { #if defined(HAVE_V4L2) && !defined(BSD) diff --git a/src/video_loopback.hpp b/src/video_loopback.hpp index 4f9ff8ac..7a15f83f 100644 --- a/src/video_loopback.hpp +++ b/src/video_loopback.hpp @@ -21,5 +21,5 @@ int vlp_startpipe(const char *dev_name, int width, int height); int vlp_putpipe(int dev, unsigned char *image, int imgsize); - void vlp_init(struct ctx_cam *cam); + void vlp_init(ctx_cam *cam); #endif /* _INCLUDE_VIDEO_LOOPBACK_HPP_ */ diff --git a/src/video_v4l2.cpp b/src/video_v4l2.cpp index 837bee1e..71cdc7ed 100644 --- a/src/video_v4l2.cpp +++ b/src/video_v4l2.cpp @@ -224,7 +224,7 @@ static void v4l2_ctrls_list(ctx_v4l2cam *v4l2cam) /* Set the control array items to the device */ static void v4l2_ctrls_set(ctx_v4l2cam *v4l2cam) { - struct ctx_v4l2cam_ctrl *devitem; + ctx_v4l2cam_ctrl *devitem; struct v4l2_control vid_ctrl; int indx_dev, retcd; @@ -257,8 +257,8 @@ static void v4l2_ctrls_set(ctx_v4l2cam *v4l2cam) static int v4l2_parms_set(ctx_v4l2cam *v4l2cam) { - struct ctx_v4l2cam_ctrl *devitem; - struct ctx_params_item *usritem; + ctx_v4l2cam_ctrl *devitem; + ctx_params_item *usritem; int indx_dev, indx_user; if (v4l2cam->devctrl_count == 0) { @@ -943,7 +943,7 @@ static int v4l2_device_init(ctx_cam *cam) { int indx; - cam->v4l2cam = (struct ctx_v4l2cam*)mymalloc(sizeof(struct ctx_v4l2cam)); + cam->v4l2cam = (ctx_v4l2cam*)mymalloc(sizeof(ctx_v4l2cam)); cam->v4l2cam->devctrl_array = NULL; cam->v4l2cam->devctrl_count = 0; cam->v4l2cam->buffer_count= 0; @@ -951,8 +951,8 @@ static int v4l2_device_init(ctx_cam *cam) cam->v4l2cam->finish = cam->finish_cam; cam->v4l2cam->buffers = NULL; - cam->v4l2cam->params =(struct ctx_params*) mymalloc(sizeof(struct ctx_params)); - memset(cam->v4l2cam->params, 0, sizeof(struct ctx_params)); + cam->v4l2cam->params =(ctx_params*) mymalloc(sizeof(ctx_params)); + memset(cam->v4l2cam->params, 0, sizeof(ctx_params)); cam->v4l2cam->params->params_array = NULL; cam->v4l2cam->params->params_count = 0; cam->v4l2cam->params->update_params = true; /*Set trigger to update the params */ diff --git a/src/video_v4l2.hpp b/src/video_v4l2.hpp index 32c7ee12..07c18aef 100644 --- a/src/video_v4l2.hpp +++ b/src/video_v4l2.hpp @@ -61,7 +61,7 @@ struct ctx_v4l2cam { int devctrl_count; /*Count of the controls in the device*/ int device_type; /*Camera, tuner, etc as provided by driver enum*/ int device_tuner; /*Tuner number if applicable from driver*/ - struct ctx_params *params; /*User parameters for the camera */ + ctx_params *params; /*User parameters for the camera */ video_buff *buffers; int pframe; volatile bool finish; /* End the thread */ @@ -73,8 +73,8 @@ struct ctx_v4l2cam { #endif }; - int v4l2_start(struct ctx_cam *cam); - int v4l2_next(struct ctx_cam *cam, struct ctx_image_data *img_data); - void v4l2_cleanup(struct ctx_cam *cam); + int v4l2_start(ctx_cam *cam); + int v4l2_next(ctx_cam *cam, ctx_image_data *img_data); + void v4l2_cleanup(ctx_cam *cam); #endif /* _INCLUDE_VIDEO_V4L2_HPP_ */ diff --git a/src/webu.cpp b/src/webu.cpp index d707462f..bcc13422 100644 --- a/src/webu.cpp +++ b/src/webu.cpp @@ -35,7 +35,7 @@ /* Context to pass the parms to functions to start mhd */ struct mhdstart_ctx { - struct ctx_motapp *motapp; + ctx_motapp *motapp; std::string tls_cert; std::string tls_key; struct MHD_OptionItem *mhd_ops; @@ -47,7 +47,7 @@ struct mhdstart_ctx { }; /* Set defaults for the webui context */ -static void webu_context_init(struct ctx_motapp *motapp, struct ctx_webui *webui) +static void webu_context_init(ctx_motapp *motapp, ctx_webui *webui) { int indx; char *tmplang; @@ -105,7 +105,7 @@ static void webu_context_init(struct ctx_motapp *motapp, struct ctx_webui *webui } /* Free the variables in the webui context */ -static void webu_context_free(struct ctx_webui *webui) +static void webu_context_free(ctx_webui *webui) { int indx; @@ -127,7 +127,7 @@ static void webu_context_free(struct ctx_webui *webui) } /* Edit the parameters specified in the url sent */ -static void webu_parms_edit(struct ctx_webui *webui) +static void webu_parms_edit(ctx_webui *webui) { int indx, is_nbr; @@ -173,7 +173,7 @@ static void webu_parms_edit(struct ctx_webui *webui) } /* Extract the camid and cmds from the url */ -static int webu_parseurl(struct ctx_webui *webui) +static int webu_parseurl(ctx_webui *webui) { char *tmpurl; size_t pos_slash1, pos_slash2, baselen; @@ -274,7 +274,7 @@ static int webu_parseurl(struct ctx_webui *webui) } /* Log the ip of the client connecting*/ -static void webu_clientip(struct ctx_webui *webui) +static void webu_clientip(ctx_webui *webui) { const union MHD_ConnectionInfo *con_info; char client[WEBUI_LEN_URLI]; @@ -313,7 +313,7 @@ static void webu_clientip(struct ctx_webui *webui) } /* Get the hostname */ -static void webu_hostname(struct ctx_webui *webui) +static void webu_hostname(ctx_webui *webui) { const char *hdr; @@ -333,10 +333,10 @@ static void webu_hostname(struct ctx_webui *webui) } /* Log the failed authentication check */ -static void webu_failauth_log(struct ctx_webui *webui) +static void webu_failauth_log(ctx_webui *webui) { timespec tm_cnct; - struct ctx_webu_clients clients; + ctx_webu_clients clients; std::list::iterator it; MOTION_LOG(ALR, TYPE_STREAM, NO_ERRNO @@ -366,10 +366,10 @@ static void webu_failauth_log(struct ctx_webui *webui) } -static void webu_client_connect(struct ctx_webui *webui) +static void webu_client_connect(ctx_webui *webui) { timespec tm_cnct; - struct ctx_webu_clients clients; + ctx_webu_clients clients; std::list::iterator it; clock_gettime(CLOCK_MONOTONIC, &tm_cnct); @@ -416,7 +416,7 @@ static void webu_client_connect(struct ctx_webui *webui) } /* Check for ips with excessive failed authentication attempts */ -static mhdrslt webu_failauth_check(struct ctx_webui *webui) +static mhdrslt webu_failauth_check(ctx_webui *webui) { timespec tm_cnct; std::list::iterator it; @@ -450,7 +450,7 @@ static mhdrslt webu_failauth_check(struct ctx_webui *webui) } /* Create a authorization denied response to user*/ -static mhdrslt webu_mhd_digest_fail(struct ctx_webui *webui,int signal_stale) +static mhdrslt webu_mhd_digest_fail(ctx_webui *webui,int signal_stale) { struct MHD_Response *response; mhdrslt retcd; @@ -477,7 +477,7 @@ static mhdrslt webu_mhd_digest_fail(struct ctx_webui *webui,int signal_stale) } /* Perform digest authentication */ -static mhdrslt webu_mhd_digest(struct ctx_webui *webui) +static mhdrslt webu_mhd_digest(ctx_webui *webui) { /* This function gets called a couple of * times by MHD during the authentication process. @@ -517,7 +517,7 @@ static mhdrslt webu_mhd_digest(struct ctx_webui *webui) } /* Create a authorization denied response to user*/ -static mhdrslt webu_mhd_basic_fail(struct ctx_webui *webui) +static mhdrslt webu_mhd_basic_fail(ctx_webui *webui) { struct MHD_Response *response; int retcd; @@ -547,7 +547,7 @@ static mhdrslt webu_mhd_basic_fail(struct ctx_webui *webui) } /* Perform Basic Authentication. */ -static mhdrslt webu_mhd_basic(struct ctx_webui *webui) +static mhdrslt webu_mhd_basic(ctx_webui *webui) { char *user, *pass; @@ -578,7 +578,7 @@ static mhdrslt webu_mhd_basic(struct ctx_webui *webui) } /* Parse apart the user:pass provided*/ -static void webu_mhd_auth_parse(struct ctx_webui *webui) +static void webu_mhd_auth_parse(ctx_webui *webui) { int auth_len; char *col_pos; @@ -605,7 +605,7 @@ static void webu_mhd_auth_parse(struct ctx_webui *webui) } /* Initialize for authorization */ -static mhdrslt webu_mhd_auth(struct ctx_webui *webui) +static mhdrslt webu_mhd_auth(ctx_webui *webui) { unsigned int rand1,rand2; @@ -641,7 +641,7 @@ static mhdrslt webu_mhd_auth(struct ctx_webui *webui) } /* Send the response that we created back to the user. */ -static mhdrslt webu_mhd_send(struct ctx_webui *webui) +static mhdrslt webu_mhd_send(ctx_webui *webui) { mhdrslt retcd; struct MHD_Response *response; @@ -680,7 +680,7 @@ static mhdrslt webu_mhd_send(struct ctx_webui *webui) /* Process the post data command */ -static mhdrslt webu_answer_post(struct ctx_webui *webui) +static mhdrslt webu_answer_post(ctx_webui *webui) { mhdrslt retcd; @@ -706,7 +706,7 @@ static mhdrslt webu_answer_post(struct ctx_webui *webui) } /*Append more data on to an existing entry in the post info structure */ -static void webu_iterate_post_append(struct ctx_webui *webui, int indx +static void webu_iterate_post_append(ctx_webui *webui, int indx , const char *data, size_t datasz) { @@ -727,17 +727,17 @@ static void webu_iterate_post_append(struct ctx_webui *webui, int indx } /*Create new entry in the post info structure */ -static void webu_iterate_post_new(struct ctx_webui *webui, const char *key +static void webu_iterate_post_new(ctx_webui *webui, const char *key , const char *data, size_t datasz) { int retcd; webui->post_sz++; if (webui->post_sz == 1) { - webui->post_info = (ctx_key *)malloc(sizeof(struct ctx_key)); + webui->post_info = (ctx_key *)malloc(sizeof(ctx_key)); } else { webui->post_info = (ctx_key *)realloc(webui->post_info - , webui->post_sz * sizeof(struct ctx_key)); + , webui->post_sz * sizeof(ctx_key)); } webui->post_info[webui->post_sz-1].key_nm = (char*)malloc(strlen(key)+1); @@ -767,7 +767,7 @@ static mhdrslt webu_iterate_post (void *ptr, enum MHD_ValueKind kind (void) transfer_encoding; (void) off; - struct ctx_webui *webui = (ctx_webui *)ptr; + ctx_webui *webui = (ctx_webui *)ptr; int indx; for (indx=0; indx < webui->post_sz; indx++) { @@ -785,7 +785,7 @@ static mhdrslt webu_iterate_post (void *ptr, enum MHD_ValueKind kind } /* Answer the get request from the user */ -static mhdrslt webu_answer_get(struct ctx_webui *webui) +static mhdrslt webu_answer_get(ctx_webui *webui) { mhdrslt retcd; @@ -863,7 +863,7 @@ static mhdrslt webu_answer(void *cls, struct MHD_Connection *connection, const c (void)upload_data_size; mhdrslt retcd; - ctx_webui *webui =(struct ctx_webui *) *ptr; + ctx_webui *webui =(ctx_webui *) *ptr; webui->cnct_type = WEBUI_CNCT_CONTROL; webui->connection = connection; @@ -933,8 +933,8 @@ static mhdrslt webu_answer(void *cls, struct MHD_Connection *connection, const c /* Initialize the MHD answer */ static void *webu_mhd_init(void *cls, const char *uri, struct MHD_Connection *connection) { - struct ctx_motapp *motapp = (struct ctx_motapp *)cls; - struct ctx_webui *webui; + ctx_motapp *motapp = (ctx_motapp *)cls; + ctx_webui *webui; int retcd; (void)connection; @@ -967,7 +967,7 @@ static void *webu_mhd_init(void *cls, const char *uri, struct MHD_Connection *co static void webu_mhd_deinit(void *cls, struct MHD_Connection *connection , void **con_cls, enum MHD_RequestTerminationCode toe) { - struct ctx_webui *webui =(struct ctx_webui *) *con_cls; + ctx_webui *webui =(ctx_webui *) *con_cls; (void)connection; (void)cls; @@ -1310,11 +1310,11 @@ static void webu_mhd_flags(struct mhdstart_ctx *mhdst) } /* Set the values for the action commands */ -static void webu_init_actions(struct ctx_motapp *motapp) +static void webu_init_actions(ctx_motapp *motapp) { std::string parm_vl; - motapp->webcontrol_actions = (ctx_params*)mymalloc(sizeof(struct ctx_params)); + motapp->webcontrol_actions = (ctx_params*)mymalloc(sizeof(ctx_params)); motapp->webcontrol_actions->update_params = true; util_parms_parse(motapp->webcontrol_actions, motapp->cam_list[0]->conf->webcontrol_actions); @@ -1339,7 +1339,7 @@ static void webu_init_actions(struct ctx_motapp *motapp) } /* Start the webcontrol */ -static void webu_init_webcontrol(struct ctx_motapp *motapp) +static void webu_init_webcontrol(ctx_motapp *motapp) { struct mhdstart_ctx mhdst; unsigned int randnbr; @@ -1348,7 +1348,7 @@ static void webu_init_webcontrol(struct ctx_motapp *motapp) , _("Starting webcontrol on port %d") , motapp->cam_list[0]->conf->webcontrol_port); - motapp->webcontrol_headers = (ctx_params*)mymalloc(sizeof(struct ctx_params)); + motapp->webcontrol_headers = (ctx_params*)mymalloc(sizeof(ctx_params)); motapp->webcontrol_headers->update_params = true; util_parms_parse(motapp->webcontrol_headers, motapp->cam_list[0]->conf->webcontrol_headers); @@ -1391,7 +1391,7 @@ static void webu_init_webcontrol(struct ctx_motapp *motapp) } /* Shut down the webcontrol */ -void webu_deinit(struct ctx_motapp *motapp) +void webu_deinit(ctx_motapp *motapp) { if (motapp->webcontrol_daemon != NULL) { @@ -1408,7 +1408,7 @@ void webu_deinit(struct ctx_motapp *motapp) } /* Start the webcontrol and streams */ -void webu_init(struct ctx_motapp *motapp) +void webu_init(ctx_motapp *motapp) { struct sigaction act; diff --git a/src/webu.hpp b/src/webu.hpp index 68c070df..fef2114e 100644 --- a/src/webu.hpp +++ b/src/webu.hpp @@ -86,7 +86,7 @@ int post_sz; /* The number of entries in the post info */ std::string post_cmd; /* The command sent with the post */ - struct ctx_key *post_info; /* Structure of the entries provided from the post data */ + ctx_key *post_info; /* Structure of the entries provided from the post data */ struct MHD_PostProcessor *post_processor; /* Processor for handling Post method connections */ FILE *req_file; /* requested file*/ @@ -98,12 +98,12 @@ struct timespec time_last; /* Keep track of processing time for stream thread*/ int mhd_first; /* Boolean for whether it is the first connection*/ struct MHD_Connection *connection; /* The MHD connection value from the client */ - struct ctx_motapp *motapp; /* The motionplus context pointer */ - struct ctx_cam *cam; /* The ctx_cam information for the camera requested */ + ctx_motapp *motapp; /* The motionplus context pointer */ + ctx_cam *cam; /* The ctx_cam information for the camera requested */ }; - void webu_init(struct ctx_motapp *motapp); - void webu_deinit(struct ctx_motapp *motapp); + void webu_init(ctx_motapp *motapp); + void webu_deinit(ctx_motapp *motapp); #endif /* _INCLUDE_WEBU_HPP_ */ diff --git a/src/webu_file.cpp b/src/webu_file.cpp index d492019a..42fe6799 100644 --- a/src/webu_file.cpp +++ b/src/webu_file.cpp @@ -30,7 +30,7 @@ /* Callback for the file reader response*/ static ssize_t webu_file_reader (void *cls, uint64_t pos, char *buf, size_t max) { - struct ctx_webui *webui =(struct ctx_webui *)cls; + ctx_webui *webui =(ctx_webui *)cls; (void)fseek (webui->req_file, pos, SEEK_SET); return fread (buf, 1, max, webui->req_file); @@ -39,19 +39,19 @@ static ssize_t webu_file_reader (void *cls, uint64_t pos, char *buf, size_t max) /* Close the requested file */ static void webu_file_free (void *cls) { - struct ctx_webui *webui =(struct ctx_webui *)cls; + ctx_webui *webui =(ctx_webui *)cls; myfclose(webui->req_file); } /* Entry point for answering file request*/ -mhdrslt webu_file_main(struct ctx_webui *webui) +mhdrslt webu_file_main(ctx_webui *webui) { mhdrslt retcd; struct stat statbuf; struct MHD_Response *response; std::string full_nm; int indx; - struct ctx_params *wact; + ctx_params *wact; /*If we have not fully started yet, simply return*/ if (webui->cam->motapp->dbse == NULL) { diff --git a/src/webu_file.hpp b/src/webu_file.hpp index bc47ea10..875fbf97 100644 --- a/src/webu_file.hpp +++ b/src/webu_file.hpp @@ -20,8 +20,6 @@ #ifndef _INCLUDE_WEBU_FILE_HPP_ #define _INCLUDE_WEBU_FILE_HPP_ - struct ctx_webui; - - mhdrslt webu_file_main(struct ctx_webui *webui); + mhdrslt webu_file_main(ctx_webui *webui); #endif /* _INCLUDE_WEBU_FILE_HPP_ */ diff --git a/src/webu_html.cpp b/src/webu_html.cpp index b034fa8c..523805f5 100644 --- a/src/webu_html.cpp +++ b/src/webu_html.cpp @@ -26,7 +26,7 @@ /* Create the CSS styles used in the navigation bar/side of the page */ -static void webu_html_style_navbar(struct ctx_webui *webui) +static void webu_html_style_navbar(ctx_webui *webui) { webui->resp_page += " .sidenav {\n" @@ -109,7 +109,7 @@ static void webu_html_style_navbar(struct ctx_webui *webui) } /* Create the css styles used in the config sections */ -static void webu_html_style_config(struct ctx_webui *webui) +static void webu_html_style_config(ctx_webui *webui) { webui->resp_page += " .cls_config {\n" @@ -222,7 +222,7 @@ static void webu_html_style_config(struct ctx_webui *webui) } /* Write out the starting style section of the web page */ -static void webu_html_style_base(struct ctx_webui *webui) +static void webu_html_style_base(ctx_webui *webui) { webui->resp_page += @@ -278,7 +278,7 @@ static void webu_html_style_base(struct ctx_webui *webui) } /* Write out the style section of the web page */ -static void webu_html_style(struct ctx_webui *webui) +static void webu_html_style(ctx_webui *webui) { webui->resp_page += "