Add label size to monitor options (database and backend part)

This commit bumps version to 1.28.101 because of database schema change
This commit is contained in:
Robin Daermann 2015-08-10 11:11:54 +02:00
parent 5a0d0ca5a3
commit 7f3a07f21b
8 changed files with 83 additions and 47 deletions

View File

@ -4,7 +4,7 @@
#
cmake_minimum_required (VERSION 2.6)
project (zoneminder)
set(zoneminder_VERSION "1.28.100")
set(zoneminder_VERSION "1.28.101")
# make API version a minor of ZM version
set(zoneminder_API_VERSION "${zoneminder_VERSION}.1")

View File

@ -3,7 +3,7 @@
# For instructions on building with cmake, please see INSTALL
#
AC_PREREQ(2.59)
AC_INIT(zm,1.28.100,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html)
AC_INIT(zm,1.28.101,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR(src/zm.h)
AC_CONFIG_HEADERS(config.h)

22
db/zm_update-1.28.101.sql Normal file
View File

@ -0,0 +1,22 @@
--
-- This updates a 1.28.100 database to 1.28.101
--
--
-- Add LabelSize column to Monitors
--
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'Monitors'
AND table_schema = DATABASE()
AND column_name = 'LabelSize'
) > 0,
"SELECT 'Column LabelSize exists in Monitors'",
"ALTER TABLE Monitors ADD `LabelSize` smallint(5) unsigned NOT NULL DEFAULT '1' AFTER `LabelY`"
));
PREPARE stmt FROM @s;
EXECUTE stmt;

View File

@ -1697,7 +1697,7 @@ const Coord Image::centreCoord( const char *text ) const
}
/* RGB32 compatible: complete */
void Image::Annotate( const char *p_text, const Coord &coord, const Rgb fg_colour, const Rgb bg_colour )
void Image::Annotate( const char *p_text, const Coord &coord, int size, const Rgb fg_colour, const Rgb bg_colour )
{
strncpy( text, p_text, sizeof(text) );
@ -1721,22 +1721,22 @@ void Image::Annotate( const char *p_text, const Coord &coord, const Rgb fg_colou
const Rgb bg_rgb_col = rgb_convert(bg_colour,subpixelorder);
const bool bg_trans = (bg_colour == RGB_TRANSPARENT);
int zm_text_size = 0x80;
if (ZM_TEXT_SIZE == 2)
zm_text_size = 0x8000;
int zm_text_bitmask = 0x80;
if (size == 2)
zm_text_bitmask = 0x8000;
while ( (index < text_len) && (line_len = strcspn( line, "\n" )) )
{
unsigned int line_width = line_len * CHAR_WIDTH;
unsigned int line_width = line_len * CHAR_WIDTH * size;
unsigned int lo_line_x = coord.X();
unsigned int lo_line_y = coord.Y() + (line_no * LINE_HEIGHT);
unsigned int lo_line_y = coord.Y() + (line_no * LINE_HEIGHT * size);
unsigned int min_line_x = 0;
unsigned int max_line_x = width - line_width;
unsigned int min_line_y = 0;
unsigned int max_line_y = height - LINE_HEIGHT;
unsigned int max_line_y = height - (LINE_HEIGHT * size);
if ( lo_line_x > max_line_x )
lo_line_x = max_line_x;
@ -1748,7 +1748,7 @@ void Image::Annotate( const char *p_text, const Coord &coord, const Rgb fg_colou
lo_line_y = min_line_y;
unsigned int hi_line_x = lo_line_x + line_width;
unsigned int hi_line_y = lo_line_y + LINE_HEIGHT;
unsigned int hi_line_y = lo_line_y + (LINE_HEIGHT * size);
// Clip anything that runs off the right of the screen
if ( hi_line_x > width )
@ -1759,19 +1759,19 @@ void Image::Annotate( const char *p_text, const Coord &coord, const Rgb fg_colou
if ( colours == ZM_COLOUR_GRAY8 )
{
unsigned char *ptr = &buffer[(lo_line_y*width)+lo_line_x];
for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < CHAR_HEIGHT; y++, r++, ptr += width )
for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < (CHAR_HEIGHT * size); y++, r++, ptr += width )
{
unsigned char *temp_ptr = ptr;
for ( unsigned int x = lo_line_x, c = 0; x < hi_line_x && c < line_len; c++ )
{
int f;
if (ZM_TEXT_SIZE == 2)
f = bigfontdata[(line[c] * CHAR_HEIGHT) + r];
if (size == 2)
f = bigfontdata[(line[c] * CHAR_HEIGHT * size) + r];
else
f = fontdata[(line[c] * CHAR_HEIGHT) + r];
for ( unsigned int i = 0; i < CHAR_WIDTH && x < hi_line_x; i++, x++, temp_ptr++ )
for ( unsigned int i = 0; i < (CHAR_WIDTH * size) && x < hi_line_x; i++, x++, temp_ptr++ )
{
if ( f & (zm_text_size >> i) )
if ( f & (zm_text_bitmask >> i) )
{
if ( !fg_trans )
*temp_ptr = fg_bw_col;
@ -1789,19 +1789,19 @@ void Image::Annotate( const char *p_text, const Coord &coord, const Rgb fg_colou
unsigned int wc = width * colours;
unsigned char *ptr = &buffer[((lo_line_y*width)+lo_line_x)*colours];
for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < CHAR_HEIGHT; y++, r++, ptr += wc )
for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < (CHAR_HEIGHT * size); y++, r++, ptr += wc )
{
unsigned char *temp_ptr = ptr;
for ( unsigned int x = lo_line_x, c = 0; x < hi_line_x && c < line_len; c++ )
{
int f;
if (ZM_TEXT_SIZE == 2)
f = bigfontdata[(line[c] * CHAR_HEIGHT) + r];
if (size == 2)
f = bigfontdata[(line[c] * CHAR_HEIGHT * size) + r];
else
f = fontdata[(line[c] * CHAR_HEIGHT) + r];
for ( unsigned int i = 0; i < CHAR_WIDTH && x < hi_line_x; i++, x++, temp_ptr += colours )
for ( unsigned int i = 0; i < (CHAR_WIDTH * size) && x < hi_line_x; i++, x++, temp_ptr += colours )
{
if ( f & (zm_text_size >> i) )
if ( f & (zm_text_bitmask >> i) )
{
if ( !fg_trans )
{
@ -1825,19 +1825,19 @@ void Image::Annotate( const char *p_text, const Coord &coord, const Rgb fg_colou
unsigned int wc = width * colours;
uint8_t *ptr = &buffer[((lo_line_y*width)+lo_line_x)<<2];
for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < CHAR_HEIGHT; y++, r++, ptr += wc )
for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < (CHAR_HEIGHT * size); y++, r++, ptr += wc )
{
Rgb* temp_ptr = (Rgb*)ptr;
for ( unsigned int x = lo_line_x, c = 0; x < hi_line_x && c < line_len; c++ )
{
int f;
if (ZM_TEXT_SIZE == 2)
f = bigfontdata[(line[c] * CHAR_HEIGHT) + r];
if (size == 2)
f = bigfontdata[(line[c] * CHAR_HEIGHT * size) + r];
else
f = fontdata[(line[c] * CHAR_HEIGHT) + r];
for ( unsigned int i = 0; i < CHAR_WIDTH && x < hi_line_x; i++, x++, temp_ptr++ )
for ( unsigned int i = 0; i < (CHAR_WIDTH * size) && x < hi_line_x; i++, x++, temp_ptr++ )
{
if ( f & (zm_text_size >> i) )
if ( f & (zm_text_bitmask >> i) )
{
if ( !fg_trans )
{
@ -1853,7 +1853,7 @@ void Image::Annotate( const char *p_text, const Coord &coord, const Rgb fg_colou
}
} else {
Panic("Annontate called with unexpected colours: %d",colours);
Panic("Annotate called with unexpected colours: %d",colours);
return;
}
@ -1867,7 +1867,7 @@ void Image::Annotate( const char *p_text, const Coord &coord, const Rgb fg_colou
}
}
void Image::Timestamp( const char *label, const time_t when, const Coord &coord )
void Image::Timestamp( const char *label, const time_t when, const Coord &coord, const int size )
{
char time_text[64];
strftime( time_text, sizeof(time_text), "%y/%m/%d %H:%M:%S", localtime( &when ) );
@ -1875,11 +1875,11 @@ void Image::Timestamp( const char *label, const time_t when, const Coord &coord
if ( label )
{
snprintf( text, sizeof(text), "%s - %s", label, time_text );
Annotate( text, coord );
Annotate( text, coord, size );
}
else
{
Annotate( time_text, coord );
Annotate( time_text, coord, size );
}
}

View File

@ -43,7 +43,6 @@ extern "C"
#define ZM_BUFTYPE_NEW 2
#define ZM_BUFTYPE_AVMALLOC 3
#define ZM_BUFTYPE_ZM 4
#define ZM_TEXT_SIZE 2
typedef void (*blend_fptr_t)(const uint8_t*, const uint8_t*, uint8_t*, unsigned long, double);
typedef void (*delta_fptr_t)(const uint8_t*, const uint8_t*, uint8_t*, unsigned long);
@ -123,7 +122,7 @@ protected:
}
public:
enum { CHAR_HEIGHT=11*ZM_TEXT_SIZE, CHAR_WIDTH=6*ZM_TEXT_SIZE };
enum { CHAR_HEIGHT=11, CHAR_WIDTH=6 };
enum { LINE_HEIGHT=CHAR_HEIGHT+0 };
protected:
@ -227,10 +226,10 @@ public:
void Delta( const Image &image, Image* targetimage) const;
const Coord centreCoord( const char *text ) const;
void Annotate( const char *p_text, const Coord &coord, const Rgb fg_colour=RGB_WHITE, const Rgb bg_colour=RGB_BLACK );
void Annotate( const char *p_text, const Coord &coord, int size=1, const Rgb fg_colour=RGB_WHITE, const Rgb bg_colour=RGB_BLACK );
Image *HighlightEdges( Rgb colour, unsigned int p_colours, unsigned int p_subpixelorder, const Box *limits=0 );
//Image *HighlightEdges( Rgb colour, const Polygon &polygon );
void Timestamp( const char *label, const time_t when, const Coord &coord );
void Timestamp( const char *label, const time_t when, const Coord &coord, const int size );
void Colourise(const unsigned int p_reqcolours, const unsigned int p_reqsubpixelorder);
void DeColourise();

View File

@ -272,6 +272,7 @@ Monitor::Monitor(
const char *p_event_prefix,
const char *p_label_format,
const Coord &p_label_coord,
int p_label_size,
int p_image_buffer_count,
int p_warmup_count,
int p_pre_event_count,
@ -299,6 +300,7 @@ Monitor::Monitor(
orientation( (Orientation)p_orientation ),
deinterlacing( p_deinterlacing ),
label_coord( p_label_coord ),
label_size( p_label_size ),
image_buffer_count( p_image_buffer_count ),
warmup_count( p_warmup_count ),
pre_event_count( p_pre_event_count ),
@ -440,7 +442,7 @@ Monitor::Monitor(
event = 0;
Debug( 1, "Monitor %s has function %d", name, function );
Debug( 1, "Monitor %s LBF = '%s', LBX = %d, LBY = %d", name, label_format, label_coord.X(), label_coord.Y() );
Debug( 1, "Monitor %s LBF = '%s', LBX = %d, LBY = %d, LBS = %d", name, label_format, label_coord.X(), label_coord.Y(), label_size );
Debug( 1, "Monitor %s IBC = %d, WUC = %d, pEC = %d, PEC = %d, EAF = %d, FRI = %d, RBP = %d, ARBP = %d, FM = %d", name, image_buffer_count, warmup_count, pre_event_count, post_event_count, alarm_frame_count, fps_report_interval, ref_blend_perc, alarm_ref_blend_perc, track_motion );
if ( purpose == ANALYSIS )
@ -1667,7 +1669,7 @@ void Monitor::Reload()
closeEvent();
static char sql[ZM_SQL_MED_BUFSIZ];
snprintf( sql, sizeof(sql), "select Function+0, Enabled, LinkedMonitors, EventPrefix, LabelFormat, LabelX, LabelY, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Id = '%d'", id );
snprintf( sql, sizeof(sql), "select Function+0, Enabled, LinkedMonitors, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Id = '%d'", id );
if ( mysql_query( &dbconn, sql ) )
{
@ -1697,6 +1699,7 @@ void Monitor::Reload()
strncpy( event_prefix, dbrow[index++], sizeof(event_prefix) );
strncpy( label_format, dbrow[index++], sizeof(label_format) );
label_coord = Coord( atoi(dbrow[index]), atoi(dbrow[index+1]) ); index += 2;
label_size = atoi(dbrow[index++]);
warmup_count = atoi(dbrow[index++]);
pre_event_count = atoi(dbrow[index++]);
post_event_count = atoi(dbrow[index++]);
@ -1859,11 +1862,11 @@ int Monitor::LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose
static char sql[ZM_SQL_MED_BUFSIZ];
if ( !device[0] )
{
strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Function != 'None' and Type = 'Local' order by Device, Channel", sizeof(sql) );
strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Function != 'None' and Type = 'Local' order by Device, Channel", sizeof(sql) );
}
else
{
snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Function != 'None' and Type = 'Local' and Device = '%s' order by Channel", device );
snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Function != 'None' and Type = 'Local' and Device = '%s' order by Channel", device );
}
if ( mysql_query( &dbconn, sql ) )
{
@ -1932,6 +1935,7 @@ Debug( 1, "Got %d for v4l_captures_per_frame", v4l_captures_per_frame );
int label_x = atoi(dbrow[col]); col++;
int label_y = atoi(dbrow[col]); col++;
int label_size = atoi(dbrow[col]); col++;
int image_buffer_count = atoi(dbrow[col]); col++;
int warmup_count = atoi(dbrow[col]); col++;
@ -1993,6 +1997,7 @@ Debug( 1, "Got %d for v4l_captures_per_frame", v4l_captures_per_frame );
event_prefix,
label_format,
Coord( label_x, label_y ),
label_size,
image_buffer_count,
warmup_count,
pre_event_count,
@ -2035,11 +2040,11 @@ int Monitor::LoadRemoteMonitors( const char *protocol, const char *host, const c
static char sql[ZM_SQL_MED_BUFSIZ];
if ( !protocol )
{
strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Protocol, Method, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion from Monitors where Function != 'None' and Type = 'Remote'", sizeof(sql) );
strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Protocol, Method, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion from Monitors where Function != 'None' and Type = 'Remote'", sizeof(sql) );
}
else
{
snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Protocol, Method, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion from Monitors where Function != 'None' and Type = 'Remote' and Protocol = '%s' and Host = '%s' and Port = '%s' and Path = '%s'", protocol, host, port, path );
snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Protocol, Method, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion from Monitors where Function != 'None' and Type = 'Remote' and Protocol = '%s' and Host = '%s' and Port = '%s' and Path = '%s'", protocol, host, port, path );
}
if ( mysql_query( &dbconn, sql ) )
{
@ -2089,6 +2094,7 @@ int Monitor::LoadRemoteMonitors( const char *protocol, const char *host, const c
int label_x = atoi(dbrow[col]); col++;
int label_y = atoi(dbrow[col]); col++;
int label_size = atoi(dbrow[col]); col++;
int image_buffer_count = atoi(dbrow[col]); col++;
int warmup_count = atoi(dbrow[col]); col++;
@ -2166,6 +2172,7 @@ int Monitor::LoadRemoteMonitors( const char *protocol, const char *host, const c
event_prefix.c_str(),
label_format.c_str(),
Coord( label_x, label_y ),
label_size,
image_buffer_count,
warmup_count,
pre_event_count,
@ -2208,11 +2215,11 @@ int Monitor::LoadFileMonitors( const char *file, Monitor **&monitors, Purpose pu
static char sql[ZM_SQL_MED_BUFSIZ];
if ( !file[0] )
{
strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion from Monitors where Function != 'None' and Type = 'File'", sizeof(sql) );
strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion from Monitors where Function != 'None' and Type = 'File'", sizeof(sql) );
}
else
{
snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion from Monitors where Function != 'None' and Type = 'File' and Path = '%s'", file );
snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion from Monitors where Function != 'None' and Type = 'File' and Path = '%s'", file );
}
if ( mysql_query( &dbconn, sql ) )
{
@ -2258,6 +2265,7 @@ int Monitor::LoadFileMonitors( const char *file, Monitor **&monitors, Purpose pu
int label_x = atoi(dbrow[col]); col++;
int label_y = atoi(dbrow[col]); col++;
int label_size = atoi(dbrow[col]); col++;
int image_buffer_count = atoi(dbrow[col]); col++;
int warmup_count = atoi(dbrow[col]); col++;
@ -2303,6 +2311,7 @@ int Monitor::LoadFileMonitors( const char *file, Monitor **&monitors, Purpose pu
event_prefix,
label_format,
Coord( label_x, label_y ),
label_size,
image_buffer_count,
warmup_count,
pre_event_count,
@ -2345,11 +2354,11 @@ int Monitor::LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose
static char sql[ZM_SQL_MED_BUFSIZ];
if ( !file[0] )
{
strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Method, Options, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion from Monitors where Function != 'None' and Type = 'Ffmpeg'", sizeof(sql) );
strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Method, Options, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion from Monitors where Function != 'None' and Type = 'Ffmpeg'", sizeof(sql) );
}
else
{
snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Method, Options, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion from Monitors where Function != 'None' and Type = 'Ffmpeg' and Path = '%s'", file );
snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Method, Options, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion from Monitors where Function != 'None' and Type = 'Ffmpeg' and Path = '%s'", file );
}
if ( mysql_query( &dbconn, sql ) )
{
@ -2397,6 +2406,7 @@ int Monitor::LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose
int label_x = atoi(dbrow[col]); col++;
int label_y = atoi(dbrow[col]); col++;
int label_size = atoi(dbrow[col]); col++;
int image_buffer_count = atoi(dbrow[col]); col++;
int warmup_count = atoi(dbrow[col]); col++;
@ -2444,6 +2454,7 @@ int Monitor::LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose
event_prefix,
label_format,
Coord( label_x, label_y ),
label_size,
image_buffer_count,
warmup_count,
pre_event_count,
@ -2484,7 +2495,7 @@ int Monitor::LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose
Monitor *Monitor::Load( int id, bool load_zones, Purpose purpose )
{
static char sql[ZM_SQL_MED_BUFSIZ];
snprintf( sql, sizeof(sql), "select Id, Name, Type, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Protocol, Method, Host, Port, Path, Options, User, Pass, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Id = %d", id );
snprintf( sql, sizeof(sql), "select Id, Name, Type, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Protocol, Method, Host, Port, Path, Options, User, Pass, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Id = %d", id );
if ( mysql_query( &dbconn, sql ) )
{
Error( "Can't run query: %s", mysql_error( &dbconn ) );
@ -2561,6 +2572,7 @@ Debug( 1, "Got %d for v4l_captures_per_frame", v4l_captures_per_frame );
int label_x = atoi(dbrow[col]); col++;
int label_y = atoi(dbrow[col]); col++;
int label_size = atoi(dbrow[col]); col++;
int image_buffer_count = atoi(dbrow[col]); col++;
int warmup_count = atoi(dbrow[col]); col++;
@ -2757,6 +2769,7 @@ Debug( 1, "Got %d for v4l_captures_per_frame", v4l_captures_per_frame );
event_prefix.c_str(),
label_format.c_str(),
Coord( label_x, label_y ),
label_size,
image_buffer_count,
warmup_count,
pre_event_count,
@ -2985,7 +2998,7 @@ void Monitor::TimestampImage( Image *ts_image, const struct timeval *ts_time ) c
*d_ptr++ = *s_ptr++;
}
*d_ptr = '\0';
ts_image->Annotate( label_text, label_coord );
ts_image->Annotate( label_text, label_coord, label_size );
}
}
@ -3419,6 +3432,7 @@ bool Monitor::DumpSettings( char *output, bool verbose )
sprintf( output+strlen(output), "Event Prefix : %s\n", event_prefix );
sprintf( output+strlen(output), "Label Format : %s\n", label_format );
sprintf( output+strlen(output), "Label Coord : %d,%d\n", label_coord.X(), label_coord.Y() );
sprintf( output+strlen(output), "Label Size : %d\n", label_size );
sprintf( output+strlen(output), "Image Buffer Count : %d\n", image_buffer_count );
sprintf( output+strlen(output), "Warmup Count : %d\n", warmup_count );
sprintf( output+strlen(output), "Pre Event Count : %d\n", pre_event_count );

View File

@ -226,6 +226,7 @@ protected:
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
int label_size; // Size of the timestamp on the images
int image_buffer_count; // Size of circular image buffer, at least twice the size of the pre_event_count
int warmup_count; // How many images to process before looking for events
int pre_event_count; // How many images to hold and prepend to an alarm event
@ -298,7 +299,7 @@ protected:
public:
// OurCheckAlarms seems to be unused. Check it on zm_monitor.cpp for more info.
//bool OurCheckAlarms( Zone *zone, const Image *pImage );
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, unsigned int p_deinterlacing, 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_motion_frame_skip, int p_capture_delay, int p_alarm_capture_delay, int p_fps_report_interval, int p_ref_blend_perc, int p_alarm_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( int p_id, const char *p_name, int p_function, bool p_enabled, const char *p_linked_monitors, Camera *p_camera, int p_orientation, unsigned int p_deinterlacing, const char *p_event_prefix, const char *p_label_format, const Coord &p_label_coord, int label_size, 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_motion_frame_skip, int p_capture_delay, int p_alarm_capture_delay, int p_fps_report_interval, int p_ref_blend_perc, int p_alarm_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();
void AddZones( int p_n_zones, Zone *p_zones[] );

View File

@ -1 +1 @@
1.28.100
1.28.101