Merge branch 'storageareas' into zma_to_thread

Conflicts:
	src/zm_ffmpeg_camera.cpp
	src/zm_packetqueue.cpp
This commit is contained in:
Isaac Connor 2018-01-17 13:59:34 -05:00
commit 22df150cb2
7 changed files with 52 additions and 13 deletions

View File

@ -657,9 +657,9 @@ CREATE TABLE `Servers` (
`FreeMem` bigint unsigned default null,
`TotalSwap` bigint unsigned default null,
`FreeSwap` bigint unsigned default null,
`zmstats.pl` BOOLEAN NOT NULL DEFAULT FALSE,
`zmaudit.pl` BOOLEAN NOT NULL DEFAULT FALSE,
`zmtrigger.pl` BOOLEAN NOT NULL DEFAULT FALSE,
`zmstats` BOOLEAN NOT NULL DEFAULT FALSE,
`zmaudit` BOOLEAN NOT NULL DEFAULT FALSE,
`zmtrigger` BOOLEAN NOT NULL DEFAULT FALSE,
PRIMARY KEY (`Id`)
) ENGINE=@ZM_MYSQL_ENGINE@;

35
db/zm_update-1.31.23.sql Normal file
View File

@ -0,0 +1,35 @@
SET @s = (SELECT IF(
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
AND table_name = 'Servers'
AND column_name = 'zmstats.pl'
) > 0,
"ALTER TABLE Servers CHANGE COLUMN `zmstats.pl` `zmstats` BOOLEAN NOT NULL DEFAULT FALSE",
"SELECT 'zmstats.pl has already been changed to zmstats'"
));
PREPARE stmt FROM @s;
EXECUTE stmt;
SET @s = (SELECT IF(
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
AND table_name = 'Servers'
AND column_name = 'zmaudit.pl'
) > 0,
"ALTER TABLE Servers CHANGE COLUMN `zmaudit.pl` `zmaudit` BOOLEAN NOT NULL DEFAULT FALSE",
"SELECT 'zmaudit.pl has already been changed to zmaudit'"
));
PREPARE stmt FROM @s;
EXECUTE stmt;
SET @s = (SELECT IF(
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
AND table_name = 'Servers'
AND column_name = 'zmtrigger.pl'
) > 0,
"ALTER TABLE Servers CHANGE COLUMN `zmtrigger.pl` `zmtrigger` BOOLEAN NOT NULL DEFAULT FALSE",
"SELECT 'zmtrigger.pl has already been changed to zmtrigger'"
));
PREPARE stmt FROM @s;
EXECUTE stmt;

View File

@ -319,11 +319,7 @@ sub run {
my ( $command, $daemon, @args ) = split( /;/, $message );
if ( $command eq 'start' ) {
if ( $Server and exists $$Server{$daemon} and ! $$Server{$daemon} ) {
Debug("Not running $daemon because it is turned off for this server.");
} else {
start( $daemon, @args );
}
start( $daemon, @args );
} elsif ( $command eq 'stop' ) {
stop( $daemon, @args );
} elsif ( $command eq 'restart' ) {

View File

@ -230,14 +230,14 @@ if ( $command =~ /^(?:start|restart)$/ ) {
# This is now started unconditionally
runCommand('zmdc.pl start zmfilter.pl');
if ( $Config{ZM_RUN_AUDIT} ) {
if ( $Server and exists $$Server{'zmaudit.pl'} and ! $$Server{'zmaudit.pl'} ) {
if ( $Server and exists $$Server{'zmaudit'} and ! $$Server{'zmaudit'} ) {
Debug("Not running zmaudit.pl because it is turned off for this server.");
} else {
runCommand('zmdc.pl start zmaudit.pl -c');
}
}
if ( $Config{ZM_OPT_TRIGGERS} ) {
if ( $Server and exists $$Server{'zmtrigger.pl'} and ! $$Server{'zmtrigger.pl'} ) {
if ( $Server and exists $$Server{'zmtrigger'} and ! $$Server{'zmtrigger'} ) {
Debug("Not running zmtrigger.pl because it is turned off for this server.");
} else {
runCommand('zmdc.pl start zmtrigger.pl');
@ -253,7 +253,7 @@ if ( $command =~ /^(?:start|restart)$/ ) {
if ( $Config{ZM_TELEMETRY_DATA} ) {
runCommand('zmdc.pl start zmtelemetry.pl');
}
if ( $Server and exists $$Server{'zmstats.pl'} and ! $$Server{'zmstats.pl'} ) {
if ( $Server and exists $$Server{'zmstats'} and ! $$Server{'zmstats'} ) {
Debug("Not running zmstats.pl because it is turned off for this server.");
} else {
runCommand('zmdc.pl start zmstats.pl');

View File

@ -414,9 +414,9 @@ int FfmpegCamera::OpenFfmpeg() {
#endif
Fatal( "Unable to open codec for video stream from %s", mPath.c_str() );
}
Debug ( 1, "Opened audio codec" );
} // end if have audio stream
Debug ( 1, "Opened audio codec" );
if ( (unsigned int)mVideoCodecContext->width != width || (unsigned int)mVideoCodecContext->height != height ) {
Warning( "Monitor dimensions are %dx%d but camera is sending %dx%d", width, height, mVideoCodecContext->width, mVideoCodecContext->height );

View File

@ -149,9 +149,17 @@ unsigned int zm_packetqueue::clearQueue( unsigned int frames_to_keep, int stream
// Want frames_to_keep video keyframes. Otherwise, we may not have enough
if ( ( av_packet->stream_index == stream_id) && ( av_packet->flags & AV_PKT_FLAG_KEY ) ) {
Debug(4, "Found keyframe at packet with stream index (%d) with keyframe (%d), frames_to_keep is (%d)", av_packet->stream_index, ( av_packet->flags & AV_PKT_FLAG_KEY ), frames_to_keep );
break;
}
}
if ( frames_to_keep ) {
Debug(3, "Hit end of queue, still need (%d) video frames", frames_to_keep );
}
if ( it != pktQueue.rend() ) {
// We want to keep this packet, so advance to the next
it ++;
}
unsigned int delete_count = 0;
Debug(4, "Deleting packets from the front, count is (%d)", delete_count );
while ( it != pktQueue.rend() ) {

View File

@ -1 +1 @@
1.31.22
1.31.23