Add parameter for network camera interrupt seconds

This commit is contained in:
Mr-Dave
2024-08-29 17:27:44 -06:00
parent 712729c881
commit eba5a1800b
3 changed files with 15 additions and 5 deletions

View File

@@ -1297,6 +1297,14 @@
</div>
<p></p>
<div>
<i><h4>interrupt</h4></i>
The duration in seconds permitted for reading an image from the netcam source. For the initial connection
to the camera, the maximum duration is set equal to three times the interrupt specified. The default
number of seconds is 20.
</div>
<p></p>
<div>
<i><h4> params_file </h4></i>
<ul>

View File

@@ -1340,7 +1340,7 @@ int cls_netcam::read_image()
interrupted=false;
clock_gettime(CLOCK_MONOTONIC, &ist_tm);
idur = 10;
idur = cfg_idur;
status = NETCAM_READINGIMAGE;
img_recv->used = 0;
@@ -1543,8 +1543,6 @@ void cls_netcam::set_options()
std::to_string(cfg_height);
util_parms_add_default(params,"video_size", tmp);
idur = 55;
} else if (service == "file") {
MOTPLS_LOG(INF, TYPE_NETCAM, NO_ERRNO
,_("%s:Setting up movie file")
@@ -1689,6 +1687,7 @@ void cls_netcam::set_parms ()
filenbr = 0;
filelist.clear();
filedir = "";
cfg_idur = 20;
for (it = params->params_array.begin();
it != params->params_array.end(); it++) {
@@ -1702,6 +1701,9 @@ void cls_netcam::set_parms ()
capture_rate = mtoi(it->param_value);
}
}
if (it->param_name == "interrupt") {
cfg_idur = mtoi(it->param_value);
}
}
/* If this is the norm and we have a highres, then disable passthru on the norm */
@@ -1720,7 +1722,6 @@ void cls_netcam::set_parms ()
clock_gettime(CLOCK_MONOTONIC, &ist_tm);
clock_gettime(CLOCK_MONOTONIC, &icur_tm);
idur = 5;
interrupted = false;
set_path();
@@ -1784,7 +1785,7 @@ int cls_netcam::open_context()
clock_gettime(CLOCK_MONOTONIC, &ist_tm);
idur = 20;
idur = cfg_idur * 3; /*3 is arbritrary multiplier to give connect more time than other steps*/
set_options();

View File

@@ -154,6 +154,7 @@ class cls_netcam {
int cfg_width;
int cfg_height;
int cfg_framerate;
int cfg_idur;
std::string cfg_params;
std::vector<ctx_filelist_item> filelist;