Merge branch 'storageareas' into zma_to_thread

This commit is contained in:
Isaac Connor
2017-11-16 18:27:44 -05:00
10 changed files with 50 additions and 38 deletions

View File

@@ -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@;

View File

@@ -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 ) ) { }

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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 ); }

View File

@@ -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;

View File

@@ -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 );
}

View File

@@ -141,6 +141,8 @@ public:
#if HAVE_LIBAVCODEC
vid_stream = 0;
#endif // HAVE_LIBAVCODEC
last_frame_sent = 0.0;
msg = { 0, { 0 } };
}
virtual ~StreamBase();

View File

@@ -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;

View File

@@ -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.'&amp;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 ) {
?>
<tr>
@@ -300,5 +289,12 @@ if ( true || canEdit( 'Events' ) ) {
</form>
</div>
</div>
<script type="text/javascript">
// These are defined in the .js.php but need to be updated down here.
archivedEvents = <?php echo !empty($archived)?'true':'false' ?>;
unarchivedEvents = <?php echo !empty($unarchived)?'true':'false' ?>;
maxWidth = <?php echo $maxWidth?$maxWidth:0 ?>;
maxHeight = <?php echo $maxHeight?$maxHeight:0 ?>;
</script>
</body>
</html>