diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index f4a41d93a..91089ff2d 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -431,9 +431,9 @@ CREATE TABLE `Monitors` ( `WebColour` varchar(32) NOT NULL default 'red', `Exif` tinyint(1) unsigned NOT NULL default '0', `Sequence` smallint(5) unsigned default NULL, -`Status` enum('Unknown','NotRunning','Running','NoSignal','Signal') NOT NULL default 'Unknown', -`zmcFPS` DECIMAL(5,2) NOT NULL default 0, -`zmaFPS` DECIMAL(5,2) NOT NULL default 0, + `Status` enum('Unknown','NotRunning','Running','NoSignal','Signal') NOT NULL default 'Unknown', + `CaptureFPS` DECIMAL(10,2) NOT NULL default 0, + `AnalysisFPS` DECIMAL(5,2) NOT NULL default 0, PRIMARY KEY (`Id`) ) ENGINE=@ZM_MYSQL_ENGINE@; diff --git a/src/zm_box.h b/src/zm_box.h index 3432bacc5..fa377e593 100644 --- a/src/zm_box.h +++ b/src/zm_box.h @@ -43,7 +43,7 @@ public: inline Box() { } - inline Box( int p_size ) : lo( 0, 0 ), hi ( p_size-1, p_size-1 ), size( Coord::Range( hi, lo ) ) { } + explicit inline Box( int p_size ) : lo( 0, 0 ), hi ( p_size-1, p_size-1 ), size( Coord::Range( hi, lo ) ) { } inline Box( int p_x_size, int p_y_size ) : lo( 0, 0 ), hi ( p_x_size-1, p_y_size-1 ), size( Coord::Range( hi, lo ) ) { } inline Box( int lo_x, int lo_y, int hi_x, int hi_y ) : lo( lo_x, lo_y ), hi( hi_x, hi_y ), size( Coord::Range( hi, lo ) ) { } inline Box( const Coord &p_lo, const Coord &p_hi ) : lo( p_lo ), hi( p_hi ), size( Coord::Range( hi, lo ) ) { } diff --git a/src/zm_buffer.h b/src/zm_buffer.h index 31898eb95..8f47c7cbc 100644 --- a/src/zm_buffer.h +++ b/src/zm_buffer.h @@ -36,7 +36,7 @@ protected: public: Buffer() : mStorage( 0 ), mAllocation( 0 ), mSize( 0 ), mHead( 0 ), mTail( 0 ) { } - Buffer( unsigned int pSize ) : mAllocation( pSize ), mSize( 0 ) { + explicit Buffer( unsigned int pSize ) : mAllocation( pSize ), mSize( 0 ) { mHead = mStorage = new unsigned char[mAllocation]; mTail = mHead; } diff --git a/src/zm_config.cpp b/src/zm_config.cpp index 4025b4f43..65a3f6591 100644 --- a/src/zm_config.cpp +++ b/src/zm_config.cpp @@ -215,6 +215,7 @@ ConfigItem::ConfigItem( const char *p_name, const char *p_value, const char *con accessed = false; } + ConfigItem::ConfigItem( const ConfigItem &item ) { name = new char[strlen(item.name)+1]; strcpy( name, item.name ); @@ -227,6 +228,17 @@ ConfigItem::ConfigItem( const ConfigItem &item ) { accessed = false; } +void ConfigItem::Copy( const ConfigItem &item ) { + name = new char[strlen(item.name)+1]; + strcpy( name, item.name ); + value = new char[strlen(item.value)+1]; + strcpy( value, item.value ); + type = new char[strlen(item.type)+1]; + strcpy( type, item.type ); + + //Info( "Created new config item %s = %s (%s)\n", name, value, type ); + accessed = false; +} ConfigItem::~ConfigItem() { delete[] name; diff --git a/src/zm_coord.h b/src/zm_coord.h index 5858cef23..9bf31144c 100644 --- a/src/zm_coord.h +++ b/src/zm_coord.h @@ -31,14 +31,13 @@ private: int x, y; public: - inline Coord() : x(0), y(0) - { - } - inline Coord( int p_x, int p_y ) : x(p_x), y(p_y) - { - } - inline Coord( const Coord &p_coord ) : x(p_coord.x), y(p_coord.y) - { + inline Coord() : x(0), y(0) { } + inline Coord( int p_x, int p_y ) : x(p_x), y(p_y) { } + inline Coord( const Coord &p_coord ) : x(p_coord.x), y(p_coord.y) { } + inline Coord &operator =( const Coord &coord ) { + x = coord.x; + y = coord.y; + return *this; } inline int &X() { return( x ); } inline const int &X() const { return( x ); } diff --git a/src/zm_monitorstream.cpp b/src/zm_monitorstream.cpp index 3edfc6154..87325339e 100644 --- a/src/zm_monitorstream.cpp +++ b/src/zm_monitorstream.cpp @@ -721,6 +721,7 @@ Debug(2, "Have checking command Queue for connkey: %d", connkey ); break; } } // end while + if ( buffered_playback ) { Debug( 1, "Cleaning swap files from %s", swap_path ); struct stat stat_buf; diff --git a/src/zm_stream.cpp b/src/zm_stream.cpp index 282db0f40..dbb10bf52 100644 --- a/src/zm_stream.cpp +++ b/src/zm_stream.cpp @@ -88,6 +88,7 @@ bool StreamBase::checkCommandQueue() { //Error( "Partial message received, expected %d bytes, got %d", sizeof(msg), nbytes ); //} else { +Debug(2, "Message length is (%d)", nbytes ); processCommand( &msg ); return( true ); } diff --git a/src/zm_stream.h b/src/zm_stream.h index dbe4c1db6..5623f8a0d 100644 --- a/src/zm_stream.h +++ b/src/zm_stream.h @@ -141,6 +141,8 @@ public: #if HAVE_LIBAVCODEC vid_stream = 0; #endif // HAVE_LIBAVCODEC + last_frame_sent = 0.0; + msg = { 0, { 0 } }; } virtual ~StreamBase(); diff --git a/web/skins/classic/css/classic/skin.css b/web/skins/classic/css/classic/skin.css index 743386622..1d5af9a16 100644 --- a/web/skins/classic/css/classic/skin.css +++ b/web/skins/classic/css/classic/skin.css @@ -63,10 +63,6 @@ p { font-weight: normal; } -th { - font-weight: bold; - color: #016A9d; -} a:link, a:visited { @@ -79,6 +75,11 @@ a:hover { text-decoration: underline; } +th, th a { + font-weight: bold; + color: #016A9d; +} + input,textarea,select,button { border: 1px #7f7fb2 solid; font-family: inherit; diff --git a/web/skins/classic/views/events.php b/web/skins/classic/views/events.php index 9fda0536a..54cf1542b 100644 --- a/web/skins/classic/views/events.php +++ b/web/skins/classic/views/events.php @@ -84,28 +84,10 @@ if ( !empty($page) ) { $eventsSql .= ' limit 0, '.$limit; } -if ( 0 ) { $maxWidth = 0; $maxHeight = 0; $archived = false; $unarchived = false; -$events = array(); -foreach ( dbFetchAll( $eventsSql ) as $event_row ) { - $events[] = $event = new Event( $event_row ); - -# Doesn this code do anything? - $scale = max( reScale( SCALE_BASE, $event->DefaultScale(), ZM_WEB_DEFAULT_SCALE ), SCALE_BASE ); - $eventWidth = reScale( $event_row['Width'], $scale ); - $eventHeight = reScale( $event_row['Height'], $scale ); - if ( $maxWidth < $eventWidth ) $maxWidth = $eventWidth; - if ( $maxHeight < $eventHeight ) $maxHeight = $eventHeight; - if ( $event_row['Archived'] ) - $archived = true; - else - $unarchived = true; -} -} - $maxShortcuts = 5; $pagination = getPagination( $pages, $page, $maxShortcuts, $filterQuery.$sortQuery.'&limit='.$limit ); @@ -165,9 +147,16 @@ $disk_space_total = 0; $results = dbQuery( $eventsSql ); while ( $event_row = dbFetchNext( $results ) ) { $event = new Event( $event_row ); -#foreach ( dbFetchAll( $eventsSql ) as $event_row ) { - #$events[] = $event = new Event( $event_row ); -#foreach ( $events as $event ) { + $scale = max( reScale( SCALE_BASE, $event->DefaultScale(), ZM_WEB_DEFAULT_SCALE ), SCALE_BASE ); + $eventWidth = reScale( $event_row['Width'], $scale ); + $eventHeight = reScale( $event_row['Height'], $scale ); + if ( $maxWidth < $eventWidth ) $maxWidth = $eventWidth; + if ( $maxHeight < $eventHeight ) $maxHeight = $eventHeight; + if ( $event_row['Archived'] ) + $archived = true; + else + $unarchived = true; + if ( ($count++%ZM_WEB_EVENTS_PER_PAGE) == 0 ) { ?>