Merge branch 'schrorg-large-timestamp'
commit
33674d8a9b
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
cmake_minimum_required (VERSION 2.6)
|
||||
project (zoneminder)
|
||||
set(zoneminder_VERSION "1.28.102")
|
||||
set(zoneminder_VERSION "1.28.103")
|
||||
# make API version a minor of ZM version
|
||||
set(zoneminder_API_VERSION "${zoneminder_VERSION}.1")
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# For instructions on building with cmake, please see INSTALL
|
||||
#
|
||||
AC_PREREQ(2.59)
|
||||
AC_INIT(zm,1.28.102,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html)
|
||||
AC_INIT(zm,1.28.103,[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)
|
||||
|
|
|
@ -349,6 +349,7 @@ CREATE TABLE `Monitors` (
|
|||
`LabelFormat` varchar(64) NOT NULL default '%N - %y/%m/%d %H:%M:%S',
|
||||
`LabelX` smallint(5) unsigned NOT NULL default '0',
|
||||
`LabelY` smallint(5) unsigned NOT NULL default '0',
|
||||
`LabelSize` smallint(5) unsigned NOT NULL DEFAULT '1',
|
||||
`ImageBufferCount` smallint(5) unsigned NOT NULL default '100',
|
||||
`WarmupCount` smallint(5) unsigned NOT NULL default '25',
|
||||
`PreEventCount` smallint(5) unsigned NOT NULL default '10',
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
--
|
||||
-- This updates a 1.28.102 database to 1.28.103
|
||||
--
|
||||
|
||||
--
|
||||
-- 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;
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -18,6 +18,7 @@
|
|||
//
|
||||
#include "zm.h"
|
||||
#include "zm_font.h"
|
||||
#include "zm_bigfont.h"
|
||||
#include "zm_image.h"
|
||||
#include "zm_utils.h"
|
||||
#include "zm_rgb.h"
|
||||
|
@ -1735,7 +1736,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, const int size, const Rgb fg_colour, const Rgb bg_colour )
|
||||
{
|
||||
strncpy( text, p_text, sizeof(text) );
|
||||
|
||||
|
@ -1759,18 +1760,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_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;
|
||||
|
@ -1782,7 +1787,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 )
|
||||
|
@ -1793,15 +1798,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 = fontdata[(line[c] * CHAR_HEIGHT) + r];
|
||||
for ( unsigned int i = 0; i < CHAR_WIDTH && x < hi_line_x; i++, x++, temp_ptr++ )
|
||||
int f;
|
||||
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 * size) && x < hi_line_x; i++, x++, temp_ptr++ )
|
||||
{
|
||||
if ( f & (0x80 >> i) )
|
||||
if ( f & (zm_text_bitmask >> i) )
|
||||
{
|
||||
if ( !fg_trans )
|
||||
*temp_ptr = fg_bw_col;
|
||||
|
@ -1819,15 +1828,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 = fontdata[(line[c] * CHAR_HEIGHT) + r];
|
||||
for ( unsigned int i = 0; i < CHAR_WIDTH && x < hi_line_x; i++, x++, temp_ptr += colours )
|
||||
int f;
|
||||
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 * size) && x < hi_line_x; i++, x++, temp_ptr += colours )
|
||||
{
|
||||
if ( f & (0x80 >> i) )
|
||||
if ( f & (zm_text_bitmask >> i) )
|
||||
{
|
||||
if ( !fg_trans )
|
||||
{
|
||||
|
@ -1851,15 +1864,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 = fontdata[(line[c] * CHAR_HEIGHT) + r];
|
||||
for ( unsigned int i = 0; i < CHAR_WIDTH && x < hi_line_x; i++, x++, temp_ptr++ )
|
||||
int f;
|
||||
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 * size) && x < hi_line_x; i++, x++, temp_ptr++ )
|
||||
{
|
||||
if ( f & (0x80 >> i) )
|
||||
if ( f & (zm_text_bitmask >> i) )
|
||||
{
|
||||
if ( !fg_trans )
|
||||
{
|
||||
|
@ -1875,7 +1892,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;
|
||||
}
|
||||
|
||||
|
@ -1889,7 +1906,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 ) );
|
||||
|
@ -1897,11 +1914,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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -231,10 +231,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, const 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();
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
@ -300,6 +301,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 ),
|
||||
|
@ -442,7 +444,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 )
|
||||
|
@ -1669,7 +1671,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 ) )
|
||||
{
|
||||
|
@ -1699,6 +1701,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++]);
|
||||
|
@ -1861,11 +1864,19 @@ int Monitor::LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose
|
|||
static char sql[ZM_SQL_MED_BUFSIZ];
|
||||
if ( !device[0] )
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
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, Exif 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, Exif from Monitors where Function != 'None' and Type = 'Local' and Device = '%s' order by Channel", device );
|
||||
=======
|
||||
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, 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 );
|
||||
>>>>>>> 55eee8d6a49f0fac29913599777afbe05132f261
|
||||
}
|
||||
if ( mysql_query( &dbconn, sql ) )
|
||||
{
|
||||
|
@ -1934,6 +1945,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++;
|
||||
|
@ -1996,6 +2008,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,
|
||||
|
@ -2039,11 +2052,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, Exif 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, Exif 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, Exif 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, Exif 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 ) )
|
||||
{
|
||||
|
@ -2093,6 +2106,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++;
|
||||
|
@ -2170,6 +2184,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,
|
||||
|
@ -2213,11 +2228,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, Exif 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, Exif 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, Exif 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, Exif from Monitors where Function != 'None' and Type = 'File' and Path = '%s'", file );
|
||||
}
|
||||
if ( mysql_query( &dbconn, sql ) )
|
||||
{
|
||||
|
@ -2263,6 +2278,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++;
|
||||
|
@ -2309,6 +2325,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,
|
||||
|
@ -2352,11 +2369,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, Exif 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, Exif 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, Exif 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, Exif from Monitors where Function != 'None' and Type = 'Ffmpeg' and Path = '%s'", file );
|
||||
}
|
||||
if ( mysql_query( &dbconn, sql ) )
|
||||
{
|
||||
|
@ -2404,6 +2421,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++;
|
||||
|
@ -2452,6 +2470,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,
|
||||
|
@ -2493,7 +2512,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, Exif 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, Exif from Monitors where Id = %d", id );
|
||||
if ( mysql_query( &dbconn, sql ) )
|
||||
{
|
||||
Error( "Can't run query: %s", mysql_error( &dbconn ) );
|
||||
|
@ -2570,6 +2589,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++;
|
||||
|
@ -2768,6 +2788,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,
|
||||
|
@ -2997,7 +3018,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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3431,6 +3452,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 );
|
||||
|
|
|
@ -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
|
||||
|
@ -299,7 +300,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, bool p_embed_exif, 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, bool p_embed_exif, Purpose p_purpose, int p_n_zones=0, Zone *p_zones[]=0 );
|
||||
~Monitor();
|
||||
|
||||
void AddZones( int p_n_zones, Zone *p_zones[] );
|
||||
|
|
|
@ -44,6 +44,7 @@ $statusData = array(
|
|||
"LabelFormat" => true,
|
||||
"LabelX" => true,
|
||||
"LabelY" => true,
|
||||
"LabelSize" => true,
|
||||
"ImageBufferCount" => true,
|
||||
"WarmupCount" => true,
|
||||
"PreEventCount" => true,
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit e22c1563a51d86aac0d5054beee28b4afb60c802
|
||||
Subproject commit c3976f1478c681b0bbc132ec3a3e82c3984eeed5
|
|
@ -674,6 +674,7 @@ $SLANG = array(
|
|||
'TimestampLabelFormat' => 'Format des Zeitstempels',
|
||||
'TimestampLabelX' => 'Zeitstempel-X',
|
||||
'TimestampLabelY' => 'Zeitstempel-Y',
|
||||
'TimestampLabelSize' => 'Schriftgröße',
|
||||
'Today' => 'Heute',
|
||||
'Tools' => 'Werkzeuge',
|
||||
'Total' => 'Total', // Added - 2011-06-16
|
||||
|
|
|
@ -671,6 +671,7 @@ $SLANG = array(
|
|||
'TimestampLabelFormat' => 'Timestamp Label Format',
|
||||
'TimestampLabelX' => 'Timestamp Label X',
|
||||
'TimestampLabelY' => 'Timestamp Label Y',
|
||||
'TimestampLabelSize' => 'Font Size',
|
||||
'Timestamp' => 'Timestamp',
|
||||
'TimeStamp' => 'Time Stamp',
|
||||
'Time' => 'Time',
|
||||
|
|
|
@ -672,6 +672,7 @@ $SLANG = array(
|
|||
'TimestampLabelFormat' => 'Formato de hora multinacional',
|
||||
'TimestampLabelX' => 'Etiqueta de tiempo X',
|
||||
'TimestampLabelY' => 'Etiqueta de tiempo Y',
|
||||
'TimestampLabelSize' => 'Tamaño de fuente',
|
||||
'Today' => 'Hoy',
|
||||
'Tools' => 'Herramientas',
|
||||
'Total' => 'Total',
|
||||
|
|
|
@ -678,6 +678,7 @@ $SLANG = array(
|
|||
'TimestampLabelFormat' => 'Format',
|
||||
'TimestampLabelX' => 'Coordonnée X',
|
||||
'TimestampLabelY' => 'Coordonnée Y',
|
||||
'TimestampLabelSize' => 'Taille de police',
|
||||
'Today' => 'Aujourd\'hui',
|
||||
'Tools' => 'Outils',
|
||||
'Total' => 'Total', // Added - 2011-06-16
|
||||
|
|
|
@ -81,6 +81,7 @@ if ( ! empty($_REQUEST['mid']) ) {
|
|||
'LabelFormat' => '%N - %d/%m/%y %H:%M:%S',
|
||||
'LabelX' => 0,
|
||||
'LabelY' => 0,
|
||||
'LabelSize' => 1,
|
||||
'ImageBufferCount' => 50,
|
||||
'WarmupCount' => 25,
|
||||
'PreEventCount' => 25,
|
||||
|
@ -425,6 +426,11 @@ $fastblendopts_alarm = array(
|
|||
"50% (Alarm lasts a moment)" => 50
|
||||
);
|
||||
|
||||
$label_size = array(
|
||||
"Default" => 1,
|
||||
"Large" => 2
|
||||
);
|
||||
|
||||
xhtmlHeaders(__FILE__, translate('Monitor')." - ".validHtmlStr($monitor['Name']) );
|
||||
?>
|
||||
<body>
|
||||
|
@ -558,6 +564,7 @@ if ( $tab != 'timestamp' )
|
|||
<input type="hidden" name="newMonitor[LabelFormat]" value="<?php echo validHtmlStr($newMonitor['LabelFormat']) ?>"/>
|
||||
<input type="hidden" name="newMonitor[LabelX]" value="<?php echo validHtmlStr($newMonitor['LabelX']) ?>"/>
|
||||
<input type="hidden" name="newMonitor[LabelY]" value="<?php echo validHtmlStr($newMonitor['LabelY']) ?>"/>
|
||||
<input type="hidden" name="newMonitor[LabelSize]" value="<?php echo validHtmlStr($newMonitor['LabelSize']) ?>"/>
|
||||
<?php
|
||||
}
|
||||
if ( $tab != 'buffers' )
|
||||
|
@ -818,6 +825,7 @@ switch ( $tab )
|
|||
<tr><td><?php echo translate('TimestampLabelFormat') ?></td><td><input type="text" name="newMonitor[LabelFormat]" value="<?php echo validHtmlStr($newMonitor['LabelFormat']) ?>" size="32"/></td></tr>
|
||||
<tr><td><?php echo translate('TimestampLabelX') ?></td><td><input type="text" name="newMonitor[LabelX]" value="<?php echo validHtmlStr($newMonitor['LabelX']) ?>" size="4"/></td></tr>
|
||||
<tr><td><?php echo translate('TimestampLabelY') ?></td><td><input type="text" name="newMonitor[LabelY]" value="<?php echo validHtmlStr($newMonitor['LabelY']) ?>" size="4"/></td></tr>
|
||||
<tr><td><?php echo translate('TimestampLabelSize') ?></td><td><select name="newMonitor[LabelSize]"><?php foreach ( $label_size as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['LabelSize'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue