Added option to switch off throttling during alarms.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@443 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
0345aae910
commit
9da5287549
|
@ -42,3 +42,5 @@
|
|||
#define ZM_STRICT_VIDEO_CONFIG <from zmconfig> // Whether to allow errors in setting video config to be fatal
|
||||
#define ZM_LOCAL_BGR_INVERT <from zmconfig> // Invert BGR colours to RGB
|
||||
#define ZM_BLEND_ALARMED_IMAGES <from zmconfig> // Whether alarmed images are blended to update the reference image
|
||||
#define ZM_NO_MAX_FPS_ON_ALARM <from zmconfig> // Should any Maximum FPS be ignored if an alarm occurs
|
||||
|
||||
|
|
45
src/zmc.cpp
45
src/zmc.cpp
|
@ -186,30 +186,37 @@ int main( int argc, char *argv[] )
|
|||
for ( int i = 0; i < n_monitors; i++ )
|
||||
{
|
||||
long min_delay = MAXINT;
|
||||
gettimeofday( &now, &dummy_tz );
|
||||
for ( int j = 0; j < n_monitors; j++ )
|
||||
if ( ZM_NO_MAX_FPS_ON_ALARM && monitors[i]->GetState() == Monitor::ALARM )
|
||||
{
|
||||
if ( last_capture_times[j].tv_sec )
|
||||
next_delays[i] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
gettimeofday( &now, &dummy_tz );
|
||||
for ( int j = 0; j < n_monitors; j++ )
|
||||
{
|
||||
static struct DeltaTimeval delta_time;
|
||||
//Info(( "Now %d.%d", now.tv_sec, now.tv_usec ));
|
||||
//Info(( "Capture %d.%d", last_capture_times[j].tv_sec, last_capture_times[j].tv_usec ));
|
||||
DELTA_TIMEVAL( delta_time, now, last_capture_times[j] );
|
||||
//Info(( "Delta %d-%d.%d", delta_time.positive, delta_time.tv_sec, delta_time.tv_usec ));
|
||||
next_delays[j] = capture_delays[j]-((delta_time.tv_sec*1000000)+delta_time.tv_usec);
|
||||
if ( next_delays[j] < 0 )
|
||||
if ( last_capture_times[j].tv_sec )
|
||||
{
|
||||
static struct DeltaTimeval delta_time;
|
||||
//Info(( "Now %d.%d", now.tv_sec, now.tv_usec ));
|
||||
//Info(( "Capture %d.%d", last_capture_times[j].tv_sec, last_capture_times[j].tv_usec ));
|
||||
DELTA_TIMEVAL( delta_time, now, last_capture_times[j] );
|
||||
//Info(( "Delta %d-%d.%d", delta_time.positive, delta_time.tv_sec, delta_time.tv_usec ));
|
||||
next_delays[j] = capture_delays[j]-((delta_time.tv_sec*1000000)+delta_time.tv_usec);
|
||||
if ( next_delays[j] < 0 )
|
||||
{
|
||||
next_delays[j] = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
next_delays[j] = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
next_delays[j] = 0;
|
||||
}
|
||||
//Info(( "%d: %d", j, next_delays[j] ));
|
||||
if ( next_delays[j] <= min_delay )
|
||||
{
|
||||
min_delay = next_delays[j];
|
||||
//Info(( "%d: %d", j, next_delays[j] ));
|
||||
if ( next_delays[j] <= min_delay )
|
||||
{
|
||||
min_delay = next_delays[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( next_delays[i] <= min_delay || next_delays[i] <= 0 )
|
||||
|
|
|
@ -222,10 +222,17 @@ my @options =
|
|||
{
|
||||
name => "ZM_BLEND_ALARMED_IMAGES",
|
||||
default => "yes",
|
||||
description => "Whether alarmed images are blended to update the reference image ",
|
||||
description => "Whether alarmed images are blended to update the reference image",
|
||||
help => "To detect alarms ZoneMinder compares an image with a reference image which is formed from a composite of the previous images. This option determines whether images that cause events are included in this process. Doing so may increase the precision of the alarmed region but can cause problems if wholescale lighting changes cause alarms as this would not get fed back into the image.",
|
||||
type => $types{boolean},
|
||||
},
|
||||
{
|
||||
name => "ZM_NO_MAX_FPS_ON_ALARM",
|
||||
default => "yes",
|
||||
description => "Should any Maximum FPS be ignored if an alarm occurs",
|
||||
help => "When configuring monitors you can optionally specify a maximum setting for the capture rate rate in frames per second. This can used to limit your video or network bandwidth or reduce CPU load. This setting tells ZoneMinder to ignore these constraints if an alarm is detected an attempt to capture as fast as possible.",
|
||||
type => $types{boolean},
|
||||
},
|
||||
{
|
||||
name => "ZM_OPT_REMOTE_CAMERAS",
|
||||
default => "no",
|
||||
|
|
Loading…
Reference in New Issue