From aff2ef843004a4e342c3a43c401baaf83cad4ba1 Mon Sep 17 00:00:00 2001 From: stan Date: Sat, 25 Sep 2004 16:37:41 +0000 Subject: [PATCH] Added persistent brightness etc feature. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1114 e3e1d417-86f3-4887-817a-d78f3d33393f --- db/zmalter-1.19.4.sql | 4 + db/zmschema.sql.z | 4 + src/zm_camera.cpp | 2 +- src/zm_camera.h | 6 +- src/zm_local_camera.cpp | 7 +- src/zm_local_camera.h | 2 +- src/zm_monitor.cpp | 150 +++++++++++++++++++++------------- src/zm_monitor.h | 8 +- src/zm_remote_camera.cpp | 2 +- src/zm_remote_camera.h | 2 +- web/zm_actions.php | 4 + web/zm_html_view_settings.php | 12 +-- 12 files changed, 128 insertions(+), 75 deletions(-) diff --git a/db/zmalter-1.19.4.sql b/db/zmalter-1.19.4.sql index b13a22dcd..1085e82f3 100644 --- a/db/zmalter-1.19.4.sql +++ b/db/zmalter-1.19.4.sql @@ -5,6 +5,10 @@ -- alter table Monitors add column EventPrefix varchar(32) not null default 'Event-' after Orientation; alter table Monitors add column AlarmFrameCount smallint(5) unsigned not null default '1' after PostEventCount; +alter table Monitors add column Brightness mediumint(7) NOT NULL default '-1' after Orientation; +alter table Monitors add column Contrast mediumint(7) NOT NULL default '-1' after Brightness; +alter table Monitors add column Hue mediumint(7) NOT NULL default '-1' after Contrast; +alter table Monitors add column Colour mediumint(7) NOT NULL default '-1' after Hue; -- -- These are optional, but we might as well do it now -- diff --git a/db/zmschema.sql.z b/db/zmschema.sql.z index 6be49e6cc..e29f6d6bb 100644 --- a/db/zmschema.sql.z +++ b/db/zmschema.sql.z @@ -111,6 +111,10 @@ CREATE TABLE Monitors ( Height smallint(5) unsigned NOT NULL default '0', Palette tinyint(3) unsigned NOT NULL default '1', Orientation enum('0','90','180','270') NOT NULL default '0', + Brightness mediumint(7) unsigned NOT NULL default '-1', + Contrast mediumint(7) unsigned NOT NULL default '-1', + Hue mediumint(7) unsigned NOT NULL default '-1', + Colour mediumint(7) unsigned NOT NULL default '-1', EventPrefix varchar(32) NOT NULL default 'Event-', LabelFormat varchar(32) NOT NULL default '%%s - %y/%m/%d %H:%M:%S', LabelX smallint(5) unsigned default NULL, diff --git a/src/zm_camera.cpp b/src/zm_camera.cpp index bd4a6aa4c..19dd85996 100644 --- a/src/zm_camera.cpp +++ b/src/zm_camera.cpp @@ -20,7 +20,7 @@ #include "zm.h" #include "zm_camera.h" -Camera::Camera( SourceType p_type, int p_width, int p_height, int p_palette, bool p_capture ) : type( p_type ), width( p_width), height( p_height ), palette( p_palette ), capture( p_capture ) +Camera::Camera( SourceType p_type, int p_width, int p_height, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ) : type( p_type ), width( p_width), height( p_height ), palette( p_palette ), brightness( p_brightness ), contrast( p_contrast ), hue( p_hue ), colour( p_colour ), capture( p_capture ) { colours = (palette==VIDEO_PALETTE_GREY?1:3); } diff --git a/src/zm_camera.h b/src/zm_camera.h index 0a32ebccc..199b17d55 100644 --- a/src/zm_camera.h +++ b/src/zm_camera.h @@ -40,10 +40,14 @@ protected: unsigned int height; unsigned int palette; unsigned int colours; + unsigned int brightness; + unsigned int hue; + unsigned int colour; + unsigned int contrast; bool capture; public: - Camera( SourceType p_type, int p_width, int p_height, int p_palette, bool p_capture=true ); + Camera( SourceType p_type, int p_width, int p_height, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture=true ); virtual ~Camera(); SourceType Type() const { return( type ); } diff --git a/src/zm_local_camera.cpp b/src/zm_local_camera.cpp index 3fb4c0a3d..606b6dec2 100644 --- a/src/zm_local_camera.cpp +++ b/src/zm_local_camera.cpp @@ -42,7 +42,7 @@ short *LocalCamera::g_v_table; short *LocalCamera::g_u_table; short *LocalCamera::b_u_table; -LocalCamera::LocalCamera( int p_device, int p_channel, int p_format, int p_width, int p_height, int p_palette, bool p_capture ) : Camera( LOCAL, p_width, p_height, p_palette, p_capture ), device( p_device ), channel( p_channel ), format( p_format ) +LocalCamera::LocalCamera( int p_device, int p_channel, int p_format, int p_width, int p_height, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ) : Camera( LOCAL, p_width, p_height, p_palette, p_brightness, p_contrast, p_hue, p_colour, p_capture ), device( p_device ), channel( p_channel ), format( p_format ) { if ( !camera_count++ && capture ) { @@ -104,6 +104,11 @@ void LocalCamera::Initialise() } } + if ( brightness >= 0 ) vid_pic.brightness = brightness; + if ( hue >= 0 ) vid_pic.hue = hue; + if ( colour >= 0 ) vid_pic.colour = colour; + if ( contrast >= 0 ) vid_pic.contrast = contrast; + if ( ioctl( m_videohandle, VIDIOCSPICT, &vid_pic ) < 0 ) { Error(( "Failed to set picture attributes: %s", strerror(errno) )); diff --git a/src/zm_local_camera.h b/src/zm_local_camera.h index 6de875b1b..26334f980 100644 --- a/src/zm_local_camera.h +++ b/src/zm_local_camera.h @@ -53,7 +53,7 @@ protected: static short *b_u_table; public: - LocalCamera( int p_device, int p_channel, int p_format, int p_width, int p_height, int p_palette, bool p_capture=true ); + LocalCamera( int p_device, int p_channel, int p_format, int p_width, int p_height, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture=true ); ~LocalCamera(); void Initialise(); diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 1e69b831e..5033e77c4 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -47,6 +47,10 @@ Monitor::Monitor( int p_height, int p_palette, int p_orientation, + int p_brightness, + int p_contrast, + int p_hue, + int p_colour, char *p_event_prefix, char *p_label_format, const Coord &p_label_coord, @@ -68,6 +72,10 @@ Monitor::Monitor( width( p_width ), height( p_height ), orientation( (Orientation)p_orientation ), + brightness( p_brightness ), + contrast( p_contrast ), + hue( p_hue ), + colour( p_colour ), label_coord( p_label_coord ), image_buffer_count( p_image_buffer_count ), warmup_count( p_warmup_count ), @@ -91,7 +99,7 @@ Monitor::Monitor( strncpy( event_prefix, p_event_prefix, sizeof(event_prefix) ); strncpy( label_format, p_label_format, sizeof(label_format) ); - camera = new LocalCamera( p_device, p_channel, p_format, (p_orientation%2)?width:height, (orientation%2)?height:width, p_palette, purpose==CAPTURE ); + camera = new LocalCamera( p_device, p_channel, p_format, (p_orientation%2)?width:height, (orientation%2)?height:width, p_palette, p_brightness, p_contrast, p_hue, p_colour, purpose==CAPTURE ); Setup(); } @@ -107,6 +115,10 @@ Monitor::Monitor( int p_height, int p_palette, int p_orientation, + int p_brightness, + int p_contrast, + int p_hue, + int p_colour, char *p_event_prefix, char *p_label_format, const Coord &p_label_coord, @@ -128,6 +140,10 @@ Monitor::Monitor( width( p_width ), height( p_height ), orientation( (Orientation)p_orientation ), + brightness( p_brightness ), + contrast( p_contrast ), + hue( p_hue ), + colour( p_colour ), label_coord( p_label_coord ), image_buffer_count( p_image_buffer_count ), warmup_count( p_warmup_count ), @@ -151,7 +167,7 @@ Monitor::Monitor( strncpy( event_prefix, p_event_prefix, sizeof(event_prefix) ); strncpy( label_format, p_label_format, sizeof(label_format) ); - camera = new RemoteCamera( p_host, p_port, p_path, (p_orientation%2)?width:height, (orientation%2)?height:width, p_palette, purpose==CAPTURE ); + camera = new RemoteCamera( p_host, p_port, p_path, (p_orientation%2)?width:height, (orientation%2)?height:width, p_palette, p_brightness, p_contrast, p_hue, p_colour, purpose==CAPTURE ); Setup(); } @@ -925,11 +941,11 @@ int Monitor::Load( int device, Monitor **&monitors, Purpose purpose ) static char sql[BUFSIZ]; if ( device == -1 ) { - strncpy( sql, "select Id, Name, Function+0, Device, Channel, Format, Width, Height, Palette, Orientation+0, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Function != 'None' and Type = 'Local'", sizeof(sql) ); + strncpy( sql, "select Id, Name, Function+0, Device, Channel, Format, Width, Height, Palette, Orientation+0, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Function != 'None' and Type = 'Local'", sizeof(sql) ); } else { - snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Device, Channel, Format, Width, Height, Palette, Orientation+0, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Function != 'None' and Type = 'Local' and Device = %d", device ); + snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Device, Channel, Format, Width, Height, Palette, Orientation+0, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Function != 'None' and Type = 'Local' and Device = %d", device ); } if ( mysql_query( &dbconn, sql ) ) { @@ -960,19 +976,23 @@ int Monitor::Load( int device, Monitor **&monitors, Purpose purpose ) atoi(dbrow[7]), // Height atoi(dbrow[8]), // Palette atoi(dbrow[9]), // Orientation - dbrow[10], // EventPrefix - dbrow[11], // LabelFormat - Coord( atoi(dbrow[12]), atoi(dbrow[13]) ), // LabelX, LabelY - atoi(dbrow[14]), // ImageBufferCount - atoi(dbrow[15]), // WarmupCount - atoi(dbrow[16]), // PreEventCount - atoi(dbrow[17]), // PostEventCount - atoi(dbrow[18]), // AlarmFrameCount - atoi(dbrow[19]), // SectionLength - atoi(dbrow[20]), // FrameSkip - atof(dbrow[21])>0.0?int(DT_PREC_3/atof(dbrow[21])):0, // MaxFPS - atoi(dbrow[22]), // FPSReportInterval - atoi(dbrow[23]), // RefBlendPerc + atoi(dbrow[10]), // Brightness + atoi(dbrow[11]), // Contrast + atoi(dbrow[12]), // Hue + atoi(dbrow[13]), // Colour + dbrow[14], // EventPrefix + dbrow[15], // LabelFormat + Coord( atoi(dbrow[16]), atoi(dbrow[17]) ), // LabelX, LabelY + atoi(dbrow[18]), // ImageBufferCount + atoi(dbrow[19]), // WarmupCount + atoi(dbrow[20]), // PreEventCount + atoi(dbrow[21]), // PostEventCount + atoi(dbrow[22]), // AlarmFrameCount + atoi(dbrow[23]), // SectionLength + atoi(dbrow[24]), // FrameSkip + atof(dbrow[25])>0.0?int(DT_PREC_3/atof(dbrow[25])):0, // MaxFPS + atoi(dbrow[26]), // FPSReportInterval + atoi(dbrow[27]), // RefBlendPerc purpose ); Zone **zones = 0; @@ -996,11 +1016,11 @@ int Monitor::Load( const char *host, const char*port, const char *path, Monitor static char sql[BUFSIZ]; if ( !host ) { - strncpy( sql, "select Id, Name, Function+0, Host, Port, Path, Width, Height, Palette, Orientation+0, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Function != 'None' and Type = 'Remote'", sizeof(sql) ); + strncpy( sql, "select Id, Name, Function+0, Host, Port, Path, Width, Height, Palette, Orientation+0, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Function != 'None' and Type = 'Remote'", sizeof(sql) ); } else { - snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Host, Port, Path, Width, Height, Palette, Orientation+0, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Function != 'None' and Type = 'Remote' and Host = '%s' and Port = '%s' and Path = '%s'", host, port, path ); + snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Host, Port, Path, Width, Height, Palette, Orientation+0, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Function != 'None' and Type = 'Remote' and Host = '%s' and Port = '%s' and Path = '%s'", host, port, path ); } if ( mysql_query( &dbconn, sql ) ) { @@ -1031,19 +1051,23 @@ int Monitor::Load( const char *host, const char*port, const char *path, Monitor atoi(dbrow[7]), // Height atoi(dbrow[8]), // Palette atoi(dbrow[9]), // Orientation - dbrow[10], // EventPrefix - dbrow[11], // LabelFormat - Coord( atoi(dbrow[12]), atoi(dbrow[13]) ), // LabelX, LabelY - atoi(dbrow[14]), // ImageBufferCount - atoi(dbrow[15]), // WarmupCount - atoi(dbrow[16]), // PreEventCount - atoi(dbrow[17]), // PostEventCount - atoi(dbrow[18]), // AlarmFrameCount - atoi(dbrow[19]), // SectionLength - atoi(dbrow[20]), // FrameSkip - atof(dbrow[21])>0.0?int(DT_PREC_3/atof(dbrow[21])):0, // MaxFPS - atoi(dbrow[22]), // FPSReportInterval - atoi(dbrow[23]), // RefBlendPerc + atoi(dbrow[10]), // Brightness + atoi(dbrow[11]), // Contrast + atoi(dbrow[12]), // Hue + atoi(dbrow[13]), // Colour + dbrow[14], // EventPrefix + dbrow[15], // LabelFormat + Coord( atoi(dbrow[16]), atoi(dbrow[17]) ), // LabelX, LabelY + atoi(dbrow[18]), // ImageBufferCount + atoi(dbrow[19]), // WarmupCount + atoi(dbrow[20]), // PreEventCount + atoi(dbrow[21]), // PostEventCount + atoi(dbrow[22]), // AlarmFrameCount + atoi(dbrow[23]), // SectionLength + atoi(dbrow[24]), // FrameSkip + atof(dbrow[25])>0.0?int(DT_PREC_3/atof(dbrow[25])):0, // MaxFPS + atoi(dbrow[26]), // FPSReportInterval + atoi(dbrow[27]), // RefBlendPerc purpose ); Zone **zones = 0; @@ -1065,7 +1089,7 @@ int Monitor::Load( const char *host, const char*port, const char *path, Monitor Monitor *Monitor::Load( int id, bool load_zones, Purpose purpose ) { static char sql[BUFSIZ]; - snprintf( sql, sizeof(sql), "select Id, Name, Type, Function+0, Device, Channel, Format, Host, Port, Path, Width, Height, Palette, Orientation+0, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Id = %d", id ); + snprintf( sql, sizeof(sql), "select Id, Name, Type, Function+0, Device, Channel, Format, Host, Port, Path, Width, Height, Palette, Orientation+0, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, FPSReportInterval, RefBlendPerc from Monitors where Id = %d", id ); if ( mysql_query( &dbconn, sql ) ) { Error(( "Can't run query: %s", mysql_error( &dbconn ) )); @@ -1096,19 +1120,23 @@ Monitor *Monitor::Load( int id, bool load_zones, Purpose purpose ) atoi(dbrow[11]), // Height atoi(dbrow[12]), // Palette atoi(dbrow[13]), // Orientation - dbrow[14], // EventPrefix - dbrow[15], // LabelFormat - Coord( atoi(dbrow[16]), atoi(dbrow[17]) ), // LabelX, LabelY - atoi(dbrow[18]), // ImageBufferCount - atoi(dbrow[19]), // WarmupCount - atoi(dbrow[20]), // PreEventCount - atoi(dbrow[21]), // PostEventCount - atoi(dbrow[22]), // AlarmFrameCount - atoi(dbrow[23]), // SectionLength - atoi(dbrow[24]), // FrameSkip - atof(dbrow[25])>0.0?int(DT_PREC_3/atof(dbrow[25])):0, // MaxFPS - atoi(dbrow[26]), // FPSReportInterval - atoi(dbrow[27]), // RefBlendPerc + atoi(dbrow[14]), // Brightness + atoi(dbrow[15]), // Contrast + atoi(dbrow[16]), // Hue + atoi(dbrow[17]), // Colour + dbrow[18], // EventPrefix + dbrow[19], // LabelFormat + Coord( atoi(dbrow[20]), atoi(dbrow[21]) ), // LabelX, LabelY + atoi(dbrow[22]), // ImageBufferCount + atoi(dbrow[23]), // WarmupCount + atoi(dbrow[24]), // PreEventCount + atoi(dbrow[25]), // PostEventCount + atoi(dbrow[26]), // AlarmFrameCount + atoi(dbrow[27]), // SectionLength + atoi(dbrow[28]), // FrameSkip + atof(dbrow[29])>0.0?int(DT_PREC_3/atof(dbrow[29])):0, // MaxFPS + atoi(dbrow[30]), // FPSReportInterval + atoi(dbrow[31]), // RefBlendPerc purpose ); } @@ -1125,19 +1153,23 @@ Monitor *Monitor::Load( int id, bool load_zones, Purpose purpose ) atoi(dbrow[11]), // Height atoi(dbrow[12]), // Palette atoi(dbrow[13]), // Orientation - dbrow[14], // EventPrefix - dbrow[15], // LabelFormat - Coord( atoi(dbrow[16]), atoi(dbrow[17]) ), // LabelX, LabelY - atoi(dbrow[18]), // ImageBufferCount - atoi(dbrow[19]), // WarmupCount - atoi(dbrow[20]), // PreEventCount - atoi(dbrow[21]), // PostEventCount - atoi(dbrow[22]), // AlarmFrameCount - atoi(dbrow[23]), // SectionLength - atoi(dbrow[24]), // FrameSkip - atof(dbrow[25])>0.0?int(DT_PREC_3/atof(dbrow[25])):0, // MaxFPS - atoi(dbrow[26]), // FPSReportInterval - atoi(dbrow[27]), // RefBlendPerc + atoi(dbrow[14]), // Brightness + atoi(dbrow[15]), // Contrast + atoi(dbrow[16]), // Hue + atoi(dbrow[17]), // Colour + dbrow[18], // EventPrefix + dbrow[19], // LabelFormat + Coord( atoi(dbrow[20]), atoi(dbrow[21]) ), // LabelX, LabelY + atoi(dbrow[22]), // ImageBufferCount + atoi(dbrow[23]), // WarmupCount + atoi(dbrow[24]), // PreEventCount + atoi(dbrow[25]), // PostEventCount + atoi(dbrow[26]), // AlarmFrameCount + atoi(dbrow[27]), // SectionLength + atoi(dbrow[28]), // FrameSkip + atof(dbrow[29])>0.0?int(DT_PREC_3/atof(dbrow[29])):0, // MaxFPS + atoi(dbrow[30]), // FPSReportInterval + atoi(dbrow[31]), // RefBlendPerc purpose ); } diff --git a/src/zm_monitor.h b/src/zm_monitor.h index 00ecbd571..205879078 100644 --- a/src/zm_monitor.h +++ b/src/zm_monitor.h @@ -81,6 +81,10 @@ protected: unsigned int height; // Normally the same as the camera, but not if partly rotated RunMode run_mode; // Whether the monitor is running continuously or is triggered Orientation orientation; // Whether the image has to be rotated at all + unsigned int brightness; // The statically saved brightness of the camera + unsigned int contrast; // The statically saved contrast of the camera + unsigned int hue; // The statically saved hue of the camera + unsigned int colour; // The statically saved colour of the camera char event_prefix[64]; // The prefix applied to event names as they are created char label_format[64]; // The format of the timestamp on the images Coord label_coord; // The coordinates of the timestamp on the images @@ -160,8 +164,8 @@ protected: } public: - Monitor( int p_id, char *p_name, int p_function, int p_device, int p_channel, int p_format, int p_width, int p_height, int p_palette, int p_orientation, char *p_event_prefix, 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_alarm_frame_count, int p_section_length, int p_frame_skip, int p_capture_delay, int p_fps_report_interval, int p_ref_blend_perc, Purpose p_purpose=QUERY, int p_n_zones=0, Zone *p_zones[]=0 ); - Monitor( int p_id, char *p_name, int p_function, const char *p_host, const char *p_port, const char *p_path, int p_width, int p_height, int p_palette, int p_orientation, char *p_event_prefix, 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_alarm_frame_count, int p_section_length, int p_frame_skip, int p_capture_delay, int p_fps_report_interval, int p_ref_blend_perc, Purpose p_purpose=QUERY, int p_n_zones=0, Zone *p_zones[]=0 ); + Monitor( int p_id, char *p_name, int p_function, int p_device, int p_channel, int p_format, int p_width, int p_height, int p_palette, int p_orientation, int p_brightness, int p_contrast, int p_hue, int p_colour, char *p_event_prefix, 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_alarm_frame_count, int p_section_length, int p_frame_skip, int p_capture_delay, int p_fps_report_interval, int p_ref_blend_perc, Purpose p_purpose=QUERY, int p_n_zones=0, Zone *p_zones[]=0 ); + Monitor( int p_id, char *p_name, int p_function, const char *p_host, const char *p_port, const char *p_path, int p_width, int p_height, int p_palette, int p_orientation, int p_brightness, int p_contrast, int p_hue, int p_colour, char *p_event_prefix, 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_alarm_frame_count, int p_section_length, int p_frame_skip, int p_capture_delay, int p_fps_report_interval, int p_ref_blend_perc, Purpose p_purpose=QUERY, int p_n_zones=0, Zone *p_zones[]=0 ); ~Monitor(); void Setup(); diff --git a/src/zm_remote_camera.cpp b/src/zm_remote_camera.cpp index b8910099f..e5b0ffa46 100644 --- a/src/zm_remote_camera.cpp +++ b/src/zm_remote_camera.cpp @@ -38,7 +38,7 @@ #include "zm.h" #include "zm_remote_camera.h" -RemoteCamera::RemoteCamera( const char *p_host, const char *p_port, const char *p_path, int p_width, int p_height, int p_palette, bool p_capture ) : Camera( REMOTE, p_width, p_height, p_palette, p_capture ), host( p_host ), port( p_port ), path( p_path ) +RemoteCamera::RemoteCamera( const char *p_host, const char *p_port, const char *p_path, int p_width, int p_height, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ) : Camera( REMOTE, p_width, p_height, p_palette, p_brightness, p_contrast, p_hue, p_colour, p_capture ), host( p_host ), port( p_port ), path( p_path ) { auth = 0; auth64[0] = '\0'; diff --git a/src/zm_remote_camera.h b/src/zm_remote_camera.h index 9427ed9f1..1c2f7c994 100644 --- a/src/zm_remote_camera.h +++ b/src/zm_remote_camera.h @@ -68,7 +68,7 @@ protected: static void Base64Encode( const char *in_string, char *out_string ); public: - RemoteCamera( const char *p_host, const char *p_port, const char *p_path, int p_width, int p_height, int p_palette, bool p_capture=true ); + RemoteCamera( const char *p_host, const char *p_port, const char *p_path, int p_width, int p_height, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture=true ); ~RemoteCamera(); const char *Host() const { return( host ); } diff --git a/web/zm_actions.php b/web/zm_actions.php index db1d608d3..653c7dffa 100644 --- a/web/zm_actions.php +++ b/web/zm_actions.php @@ -310,6 +310,10 @@ if ( isset($action) ) $zmu_command = ZMU_COMMAND." -m $mid -B$new_brightness -C$new_contrast -H$new_hue -O$new_colour"; $zmu_output = exec( escapeshellcmd( $zmu_command ) ); list( $brightness, $contrast, $hue, $colour ) = split( ' ', $zmu_output ); + $sql = "update Monitors set Brightness = $brightness, Contrast = $contrast, Hue = $hue, Colour = $colour where Id = '$mid'"; + $result = mysql_query( $sql ); + if ( !$result ) + die( mysql_error() ); } elseif ( $action == "delete" ) { diff --git a/web/zm_html_view_settings.php b/web/zm_html_view_settings.php index 33f607247..3dd8f5683 100644 --- a/web/zm_html_view_settings.php +++ b/web/zm_html_view_settings.php @@ -28,10 +28,6 @@ if ( !$result ) die( mysql_error() ); $monitor = mysql_fetch_assoc( $result ); -$zmu_command = ZMU_COMMAND." -m $mid -B -C -H -O"; -$zmu_output = exec( escapeshellcmd( $zmu_command ) ); -list( $brightness, $contrast, $hue, $colour ) = split( ' ', $zmu_output ); - ?> @@ -70,10 +66,10 @@ function closeWindow() - disabled> - disabled> - disabled> - disabled> + disabled> + disabled> + disabled> + disabled> disabled>