mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-03-16 04:51:42 -04:00
starting to rough in adding a frame to zmpacket
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
#include "zm_analysis_thread.h"
|
||||
|
||||
|
||||
AnalysisThread::AnalysisThread( Monitor *p_monitor ) {
|
||||
AnalysisThread::AnalysisThread(Monitor *p_monitor) {
|
||||
monitor = p_monitor;
|
||||
terminate = false;
|
||||
sigemptyset( &block_set );
|
||||
sigemptyset(&block_set);
|
||||
}
|
||||
|
||||
AnalysisThread::~AnalysisThread() {
|
||||
@@ -16,11 +15,11 @@ int AnalysisThread::run() {
|
||||
unsigned int analysis_update_delay = monitor->GetAnalysisUpdateDelay();
|
||||
time_t last_analysis_update_time, cur_time;
|
||||
monitor->UpdateAdaptiveSkip();
|
||||
last_analysis_update_time = time( 0 );
|
||||
last_analysis_update_time = time(0);
|
||||
|
||||
while( !terminate ) {
|
||||
// Process the next image
|
||||
sigprocmask( SIG_BLOCK, &block_set, 0 );
|
||||
sigprocmask(SIG_BLOCK, &block_set, 0);
|
||||
|
||||
// Some periodic updates are required for variable capturing framerate
|
||||
if ( analysis_update_delay ) {
|
||||
@@ -33,12 +32,12 @@ int AnalysisThread::run() {
|
||||
}
|
||||
|
||||
if ( !monitor->Analyse() ) {
|
||||
usleep( monitor->Active()?ZM_SAMPLE_RATE:ZM_SUSPENDED_RATE );
|
||||
usleep(monitor->Active()?ZM_SAMPLE_RATE:ZM_SUSPENDED_RATE);
|
||||
} else if ( analysis_rate ) {
|
||||
usleep( analysis_rate );
|
||||
usleep(analysis_rate);
|
||||
}
|
||||
|
||||
sigprocmask( SIG_UNBLOCK, &block_set, 0 );
|
||||
sigprocmask(SIG_UNBLOCK, &block_set, 0);
|
||||
}
|
||||
return 0;
|
||||
} // end in AnalysisThread::run()
|
||||
|
||||
Reference in New Issue
Block a user