diff --git a/src/Makefile.am b/src/Makefile.am index 9f111bfe3..e4a069dba 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,6 +21,7 @@ bin_PROGRAMS = \ zmfix zm_SOURCES = \ + zm_storage.cpp \ zm_box.cpp \ zm_buffer.cpp \ zm_camera.cpp \ @@ -70,6 +71,7 @@ zmfix_SOURCES = zmfix.cpp zm_config.cpp zm_regexp.cpp zm_logger.cpp zm_utils.cpp noinst_HEADERS = \ jinclude.h \ + zm_storage.h \ zm_box.h \ zm_buffer.h \ zm_camera.h \ diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 463cf2b07..c90b370ad 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -293,7 +293,8 @@ Monitor::Monitor( Rgb p_signal_check_colour, Purpose p_purpose, int p_n_zones, - Zone *p_zones[] + Zone *p_zones[], + unsigned int p_storage_id ) : id( p_id ), function( (Function)p_function ), enabled( p_enabled ), @@ -321,7 +322,8 @@ Monitor::Monitor( purpose( p_purpose ), camera( p_camera ), n_zones( p_n_zones ), - zones( p_zones ) + zones( p_zones ), + storage_id( p_storage_id ) { strncpy( name, p_name, sizeof(name) ); @@ -511,6 +513,8 @@ Monitor::Monitor( Debug( 1, "Monitor %s LBF = '%s', LBX = %d, LBY = %d", name, label_format, label_coord.X(), label_coord.Y() ); Debug( 1, "Monitor %s IBC = %d, WUC = %d, pEC = %d, PEC = %d, EAF = %d, FRI = %d, RBP = %d, FM = %d", name, image_buffer_count, warmup_count, pre_event_count, post_event_count, alarm_frame_count, fps_report_interval, ref_blend_perc, track_motion ); + storage = new Storage( storage_id ); + if ( purpose == ANALYSIS ) { static char path[PATH_MAX]; @@ -586,6 +590,7 @@ Monitor::~Monitor() delete[] zones; delete camera; + delete storage; if ( purpose == ANALYSIS ) { diff --git a/src/zm_monitor.h b/src/zm_monitor.h index 2cd0a9191..99217118d 100644 --- a/src/zm_monitor.h +++ b/src/zm_monitor.h @@ -30,6 +30,7 @@ #include "zm_zone.h" #include "zm_event.h" #include "zm_camera.h" +#include "zm_storage.h" #include "zm_image_analyser.h" @@ -267,6 +268,7 @@ protected: #endif // ZM_MEM_MAPPED unsigned long mem_size; unsigned char *mem_ptr; + Storage *storage; SharedData *shared_data; TriggerData *trigger_data;