Bug 431 - Removed default args for monitor constructors and now can stream events without active monitor.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2274 e3e1d417-86f3-4887-817a-d78f3d33393fpull/27/merge
parent
93c2ec048c
commit
9d291c0ba1
|
@ -317,8 +317,15 @@ Monitor::Monitor(
|
||||||
|
|
||||||
if ( !shared_data->valid )
|
if ( !shared_data->valid )
|
||||||
{
|
{
|
||||||
Error(( "Shared memory not initialised by capture daemon" ));
|
if ( purpose != QUERY )
|
||||||
exit( -1 );
|
{
|
||||||
|
Error(( "Shared memory not initialised by capture daemon" ));
|
||||||
|
exit( -1 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Warning(( "Shared memory not initialised by capture daemon, some query functions may not be available or produce invalid results" ));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
image_buffer = new Snapshot[image_buffer_count];
|
image_buffer = new Snapshot[image_buffer_count];
|
||||||
|
@ -1792,6 +1799,7 @@ int Monitor::LoadRemoteMonitors( const char *host, const char*port, const char *
|
||||||
fps_report_interval,
|
fps_report_interval,
|
||||||
ref_blend_perc,
|
ref_blend_perc,
|
||||||
track_motion,
|
track_motion,
|
||||||
|
RGB_WHITE,
|
||||||
purpose
|
purpose
|
||||||
);
|
);
|
||||||
Zone **zones = 0;
|
Zone **zones = 0;
|
||||||
|
@ -1917,6 +1925,7 @@ int Monitor::LoadFileMonitors( const char *file, Monitor **&monitors, Purpose pu
|
||||||
fps_report_interval,
|
fps_report_interval,
|
||||||
ref_blend_perc,
|
ref_blend_perc,
|
||||||
track_motion,
|
track_motion,
|
||||||
|
RGB_WHITE,
|
||||||
purpose
|
purpose
|
||||||
);
|
);
|
||||||
Zone **zones = 0;
|
Zone **zones = 0;
|
||||||
|
|
|
@ -232,7 +232,7 @@ protected:
|
||||||
MonitorLink **linked_monitors;
|
MonitorLink **linked_monitors;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Monitor( int p_id, const char *p_name, int p_function, bool p_enabled, const char *p_linked_monitors, Camera *p_camera, int p_orientation, const char *p_event_prefix, const char *p_label_format, const Coord &p_label_coord, int p_image_buffer_count, int p_warmup_count, int p_pre_event_count, int p_post_event_count, int p_stream_replay_buffer, int p_alarm_frame_count, int p_section_length, int p_frame_skip, int p_capture_delay, int p_alarm_capture_delay, int p_fps_report_interval, int p_ref_blend_perc, bool p_track_motion, Rgb p_signal_check_colour, Purpose p_purpose=QUERY, int p_n_zones=0, Zone *p_zones[]=0 );
|
Monitor( int p_id, const char *p_name, int p_function, bool p_enabled, const char *p_linked_monitors, Camera *p_camera, int p_orientation, const char *p_event_prefix, const char *p_label_format, const Coord &p_label_coord, int p_image_buffer_count, int p_warmup_count, int p_pre_event_count, int p_post_event_count, int p_stream_replay_buffer, int p_alarm_frame_count, int p_section_length, int p_frame_skip, int p_capture_delay, int p_alarm_capture_delay, int p_fps_report_interval, int p_ref_blend_perc, bool p_track_motion, Rgb p_signal_check_colour, Purpose p_purpose, int p_n_zones=0, Zone *p_zones[]=0 );
|
||||||
~Monitor();
|
~Monitor();
|
||||||
|
|
||||||
void AddZones( int p_n_zones, Zone *p_zones[] );
|
void AddZones( int p_n_zones, Zone *p_zones[] );
|
||||||
|
@ -330,10 +330,10 @@ public:
|
||||||
bool DumpSettings( char *output, bool verbose );
|
bool DumpSettings( char *output, bool verbose );
|
||||||
void DumpZoneImage( const char *zone_string=0 );
|
void DumpZoneImage( const char *zone_string=0 );
|
||||||
|
|
||||||
static int LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose purpose=QUERY );
|
static int LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose purpose );
|
||||||
static int LoadRemoteMonitors( const char *host, const char*port, const char*path, Monitor **&monitors, Purpose purpose=QUERY );
|
static int LoadRemoteMonitors( const char *host, const char*port, const char*path, Monitor **&monitors, Purpose purpose );
|
||||||
static int LoadFileMonitors( const char *file, Monitor **&monitors, Purpose purpose=QUERY );
|
static int LoadFileMonitors( const char *file, Monitor **&monitors, Purpose purpose );
|
||||||
static Monitor *Load( int id, bool load_zones=false, Purpose purpose=QUERY );
|
static Monitor *Load( int id, bool load_zones, Purpose purpose );
|
||||||
//void writeStreamImage( Image *image, struct timeval *timestamp, int scale, int mag, int x, int y );
|
//void writeStreamImage( Image *image, struct timeval *timestamp, int scale, int mag, int x, int y );
|
||||||
//void StreamImages( int scale=100, int maxfps=10, time_t ttl=0, int msq_id=0 );
|
//void StreamImages( int scale=100, int maxfps=10, time_t ttl=0, int msq_id=0 );
|
||||||
//void StreamImagesRaw( int scale=100, int maxfps=10, time_t ttl=0 );
|
//void StreamImagesRaw( int scale=100, int maxfps=10, time_t ttl=0 );
|
||||||
|
|
|
@ -32,7 +32,7 @@ StreamBase::~StreamBase()
|
||||||
|
|
||||||
bool StreamBase::loadMonitor( int monitor_id )
|
bool StreamBase::loadMonitor( int monitor_id )
|
||||||
{
|
{
|
||||||
if ( !(monitor = Monitor::Load( monitor_id )) )
|
if ( !(monitor = Monitor::Load( monitor_id, false, Monitor::QUERY )) )
|
||||||
{
|
{
|
||||||
Fatal(( "Unable to load monitor id %d for streaming", monitor_id ));
|
Fatal(( "Unable to load monitor id %d for streaming", monitor_id ));
|
||||||
return( false );
|
return( false );
|
||||||
|
|
|
@ -160,7 +160,7 @@ int main( int argc, char *argv[] )
|
||||||
|
|
||||||
zmLoadConfig();
|
zmLoadConfig();
|
||||||
|
|
||||||
Monitor *monitor = Monitor::Load( id, false );
|
Monitor *monitor = Monitor::Load( id, false, Monitor::QUERY );
|
||||||
|
|
||||||
if ( !monitor )
|
if ( !monitor )
|
||||||
{
|
{
|
||||||
|
|
|
@ -413,7 +413,7 @@ int main( int argc, char *argv[] )
|
||||||
}
|
}
|
||||||
else if ( mon_id > 0 )
|
else if ( mon_id > 0 )
|
||||||
{
|
{
|
||||||
Monitor *monitor = Monitor::Load( mon_id, function&(ZMU_QUERY|ZMU_ZONES) );
|
Monitor *monitor = Monitor::Load( mon_id, function&(ZMU_QUERY|ZMU_ZONES), Monitor::QUERY );
|
||||||
if ( monitor )
|
if ( monitor )
|
||||||
{
|
{
|
||||||
if ( verbose )
|
if ( verbose )
|
||||||
|
@ -700,7 +700,7 @@ int main( int argc, char *argv[] )
|
||||||
{
|
{
|
||||||
if ( function > 1 )
|
if ( function > 1 )
|
||||||
{
|
{
|
||||||
Monitor *monitor = Monitor::Load( mon_id );
|
Monitor *monitor = Monitor::Load( mon_id, false, Monitor::QUERY );
|
||||||
if ( monitor )
|
if ( monitor )
|
||||||
{
|
{
|
||||||
struct timeval tv = monitor->GetTimestamp();
|
struct timeval tv = monitor->GetTimestamp();
|
||||||
|
|
Loading…
Reference in New Issue