Merge branch 'master' of github.com:ZoneMinder/ZoneMinder
This commit is contained in:
commit
0f1b186eb1
|
@ -41,6 +41,7 @@ env:
|
||||||
- SMPFLAGS=-j4 OS=ubuntu DIST=disco DOCKER_REPO=iconzm/packpack USE_SFTP=yes
|
- SMPFLAGS=-j4 OS=ubuntu DIST=disco DOCKER_REPO=iconzm/packpack USE_SFTP=yes
|
||||||
- SMPFLAGS=-j4 OS=debian DIST=buster DOCKER_REPO=iconzm/packpack USE_SFTP=yes
|
- SMPFLAGS=-j4 OS=debian DIST=buster DOCKER_REPO=iconzm/packpack USE_SFTP=yes
|
||||||
- SMPFLAGS=-j4 OS=debian DIST=stretch DOCKER_REPO=iconzm/packpack USE_SFTP=yes
|
- SMPFLAGS=-j4 OS=debian DIST=stretch DOCKER_REPO=iconzm/packpack USE_SFTP=yes
|
||||||
|
- SMPFLAGS=-j4 OS=debian DIST=jessie DOCKER_REPO=iconzm/packpack USE_SFTP=yes
|
||||||
- SMPFLAGS=-j4 OS=ubuntu DIST=trusty ARCH=i386
|
- SMPFLAGS=-j4 OS=ubuntu DIST=trusty ARCH=i386
|
||||||
- SMPFLAGS=-j4 OS=ubuntu DIST=xenial ARCH=i386
|
- SMPFLAGS=-j4 OS=ubuntu DIST=xenial ARCH=i386
|
||||||
- SMPFLAGS=-j4 OS=ubuntu DIST=bionic ARCH=i386
|
- SMPFLAGS=-j4 OS=ubuntu DIST=bionic ARCH=i386
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
Source: zoneminder
|
Source: zoneminder
|
||||||
Section: net
|
Section: net
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Maintainer: Dmitry Smirnov <onlyjob@debian.org>
|
Maintainer: Isaac Connor <isaac@zoneminder.com>
|
||||||
Uploaders: Vagrant Cascadian <vagrant@debian.org>
|
Uploaders: Isaac Connor <isaac@zoneminder.com>
|
||||||
Build-Depends: debhelper (>= 9), python-sphinx | python3-sphinx, apache2-dev, dh-linktree
|
Build-Depends: debhelper (>= 9), python-sphinx | python3-sphinx, apache2-dev, dh-linktree
|
||||||
,cmake
|
,cmake
|
||||||
,libx264-dev, libmp4v2-dev
|
,libx264-dev, libmp4v2-dev
|
||||||
|
@ -57,6 +57,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}
|
||||||
,libsys-mmap-perl [!hurd-any]
|
,libsys-mmap-perl [!hurd-any]
|
||||||
,liburi-encode-perl
|
,liburi-encode-perl
|
||||||
,libwww-perl
|
,libwww-perl
|
||||||
|
,libdatetime-perl
|
||||||
,libdata-uuid-perl
|
,libdata-uuid-perl
|
||||||
,libnumber-bytes-human-perl
|
,libnumber-bytes-human-perl
|
||||||
,libfile-slurp-perl
|
,libfile-slurp-perl
|
||||||
|
|
|
@ -63,6 +63,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}
|
||||||
,liburi-encode-perl
|
,liburi-encode-perl
|
||||||
,libwww-perl
|
,libwww-perl
|
||||||
,libdata-dump-perl
|
,libdata-dump-perl
|
||||||
|
,libdatetime-perl
|
||||||
,libclass-std-fast-perl
|
,libclass-std-fast-perl
|
||||||
,libsoap-wsdl-perl
|
,libsoap-wsdl-perl
|
||||||
,libio-socket-multicast-perl
|
,libio-socket-multicast-perl
|
||||||
|
|
|
@ -450,11 +450,13 @@ sub delete_files {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Error($@) if $@;
|
Error($@) if $@;
|
||||||
}
|
} # end if s3fs
|
||||||
if ( !$deleted ) {
|
if ( !$deleted ) {
|
||||||
my $command = "/bin/rm -rf $storage_path/$event_path";
|
my $command = "/bin/rm -rf $storage_path/$event_path";
|
||||||
ZoneMinder::General::executeShellCommand($command);
|
ZoneMinder::General::executeShellCommand($command);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Error('No event path in delete files. ' . $event->to_string());
|
||||||
} # end if event_path
|
} # end if event_path
|
||||||
|
|
||||||
if ( $event->Scheme() eq 'Deep' ) {
|
if ( $event->Scheme() eq 'Deep' ) {
|
||||||
|
@ -465,6 +467,34 @@ sub delete_files {
|
||||||
unlink($storage_path.'/'.$link_path) or Error("Unable to unlink '$storage_path/$link_path': $!");
|
unlink($storage_path.'/'.$link_path) or Error("Unable to unlink '$storage_path/$link_path': $!");
|
||||||
}
|
}
|
||||||
} # end if Scheme eq Deep
|
} # end if Scheme eq Deep
|
||||||
|
|
||||||
|
# Now check for empty directories and delete them.
|
||||||
|
my @path_parts = split('/', $event_path);
|
||||||
|
pop @path_parts;
|
||||||
|
# Guaranteed the first part is the monitor id
|
||||||
|
Debug("Initial path_parts: @path_parts");
|
||||||
|
while ( @path_parts > 1 ) {
|
||||||
|
my $path = join('/', $storage_path, @path_parts);
|
||||||
|
my $dh;
|
||||||
|
if ( !opendir($dh, $path) ) {
|
||||||
|
Warning("Fail to open $path");
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
my @dir = readdir($dh);
|
||||||
|
closedir($dh);
|
||||||
|
if ( scalar(grep { $_ ne '.' and $_ ne '..' } @dir) == 0 ) {
|
||||||
|
Debug("Removing empty dir at $path");
|
||||||
|
if ( !rmdir $path ) {
|
||||||
|
Warning("Fail to rmdir $path: $!");
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Debug("Dir $path is not empty @dir");
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
pop @path_parts;
|
||||||
|
} # end while path_parts
|
||||||
|
|
||||||
} # end foreach Storage
|
} # end foreach Storage
|
||||||
} # end sub delete_files
|
} # end sub delete_files
|
||||||
|
|
||||||
|
|
|
@ -236,6 +236,11 @@ sub Sql {
|
||||||
|| $term->{attr} eq 'Cause'
|
|| $term->{attr} eq 'Cause'
|
||||||
|| $term->{attr} eq 'Notes'
|
|| $term->{attr} eq 'Notes'
|
||||||
) {
|
) {
|
||||||
|
if ( $term->{op} eq 'LIKE'
|
||||||
|
|| $term->{op} eq 'NOT LIKE'
|
||||||
|
) {
|
||||||
|
$temp_value = '%'.$temp_value.'%' if $temp_value !~ /%/;
|
||||||
|
}
|
||||||
$value = "'$temp_value'";
|
$value = "'$temp_value'";
|
||||||
} elsif ( $term->{attr} eq 'DateTime' or $term->{attr} eq 'StartDateTime' or $term->{attr} eq 'EndDateTime' ) {
|
} elsif ( $term->{attr} eq 'DateTime' or $term->{attr} eq 'StartDateTime' or $term->{attr} eq 'EndDateTime' ) {
|
||||||
if ( $temp_value eq 'NULL' ) {
|
if ( $temp_value eq 'NULL' ) {
|
||||||
|
@ -295,6 +300,10 @@ sub Sql {
|
||||||
$self->{Sql} .= ' IN ('.join(',', @value_list).')';
|
$self->{Sql} .= ' IN ('.join(',', @value_list).')';
|
||||||
} elsif ( $term->{op} eq '!~' ) {
|
} elsif ( $term->{op} eq '!~' ) {
|
||||||
$self->{Sql} .= ' NOT IN ('.join(',', @value_list).')';
|
$self->{Sql} .= ' NOT IN ('.join(',', @value_list).')';
|
||||||
|
} elsif ( $term->{op} eq 'LIKE' ) {
|
||||||
|
$self->{Sql} .= " LIKE $value";
|
||||||
|
} elsif ( $term->{op} eq 'NOT LIKE' ) {
|
||||||
|
$self->{Sql} .= " NOT LIKE $value";
|
||||||
} else {
|
} else {
|
||||||
$self->{Sql} .= ' '.$term->{op}.' '.$value;
|
$self->{Sql} .= ' '.$term->{op}.' '.$value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,6 +79,7 @@ while( 1 ) {
|
||||||
Debug("Last Check time (now($now) - lastCheck($lastCheck)) = $since_last_check > interval($interval) or force($force)");
|
Debug("Last Check time (now($now) - lastCheck($lastCheck)) = $since_last_check > interval($interval) or force($force)");
|
||||||
if ( $since_last_check < 0 ) {
|
if ( $since_last_check < 0 ) {
|
||||||
Warning('Seconds since last check is negative! Which means that lastCheck is in the future!');
|
Warning('Seconds since last check is negative! Which means that lastCheck is in the future!');
|
||||||
|
sleep($interval);
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
if ( ( ($since_last_check) > $interval ) or $force ) {
|
if ( ( ($since_last_check) > $interval ) or $force ) {
|
||||||
|
@ -88,7 +89,7 @@ while( 1 ) {
|
||||||
# We should keep *BSD systems in mind when calling system commands
|
# We should keep *BSD systems in mind when calling system commands
|
||||||
my %telemetry;
|
my %telemetry;
|
||||||
$telemetry{uuid} = getUUID($dbh);
|
$telemetry{uuid} = getUUID($dbh);
|
||||||
($telemetry{city}, $telemetry{region}, $telemetry{country}, $telemetry{latitude}, $telemetry{longitude}) = getGeo();
|
@telemetry{qw(city region country latitude longitude)} = getGeo();
|
||||||
$telemetry{timestamp} = strftime('%Y-%m-%dT%H:%M:%S%z', localtime());
|
$telemetry{timestamp} = strftime('%Y-%m-%dT%H:%M:%S%z', localtime());
|
||||||
$telemetry{monitor_count} = countQuery($dbh,'Monitors');
|
$telemetry{monitor_count} = countQuery($dbh,'Monitors');
|
||||||
$telemetry{event_count} = countQuery($dbh,'Events');
|
$telemetry{event_count} = countQuery($dbh,'Events');
|
||||||
|
@ -138,6 +139,7 @@ sub runSysCmd {
|
||||||
chomp($path);
|
chomp($path);
|
||||||
$arguments[0] = $path;
|
$arguments[0] = $path;
|
||||||
my $cmd = join(' ',@arguments);
|
my $cmd = join(' ',@arguments);
|
||||||
|
($cmd) = $cmd =~ /(.*)/; # detaint
|
||||||
$result = qx( $cmd );
|
$result = qx( $cmd );
|
||||||
chomp($result);
|
chomp($result);
|
||||||
}
|
}
|
||||||
|
@ -221,7 +223,7 @@ sub getGeo {
|
||||||
} else {
|
} else {
|
||||||
Warning("Geoip data retrieval returned HTTP POST error code: $resp_code");
|
Warning("Geoip data retrieval returned HTTP POST error code: $resp_code");
|
||||||
Debug("Geoip data retrieval failure response message: $resp_msg");
|
Debug("Geoip data retrieval failure response message: $resp_msg");
|
||||||
return ($unknown, $unknown, $unknown, $unknown);
|
return ($unknown, $unknown, $unknown, $unknown, $unknown);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,9 @@ void log_libav_callback( void *ptr, int level, const char *fmt, va_list vargs )
|
||||||
if ( log ) {
|
if ( log ) {
|
||||||
char logString[8192];
|
char logString[8192];
|
||||||
vsnprintf(logString, sizeof(logString)-1, fmt, vargs);
|
vsnprintf(logString, sizeof(logString)-1, fmt, vargs);
|
||||||
|
int length = strlen(logString);
|
||||||
|
// ffmpeg logs have a carriage return, so replace it with terminator
|
||||||
|
logString[length-1] = 0;
|
||||||
log->logPrint(false, __FILE__, __LINE__, log_level, logString);
|
log->logPrint(false, __FILE__, __LINE__, log_level, logString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,8 +84,7 @@ void FFMPEGInit() {
|
||||||
Info("Not enabling ffmpeg logs, as LOG_FFMPEG and/or LOG_DEBUG is disabled in options, or this monitor not part of your debug targets");
|
Info("Not enabling ffmpeg logs, as LOG_FFMPEG and/or LOG_DEBUG is disabled in options, or this monitor not part of your debug targets");
|
||||||
av_log_set_level(AV_LOG_QUIET);
|
av_log_set_level(AV_LOG_QUIET);
|
||||||
}
|
}
|
||||||
#if LIBAVFORMAT_VERSION_CHECK(58, 9, 0, 64, 0)
|
#if !LIBAVFORMAT_VERSION_CHECK(58, 9, 0, 64, 0)
|
||||||
#else
|
|
||||||
av_register_all();
|
av_register_all();
|
||||||
#endif
|
#endif
|
||||||
avformat_network_init();
|
avformat_network_init();
|
||||||
|
@ -550,7 +552,6 @@ int zm_send_packet_receive_frame(
|
||||||
if ( AVERROR(EAGAIN) == ret ) {
|
if ( AVERROR(EAGAIN) == ret ) {
|
||||||
// The codec may need more samples than it has, perfectly valid
|
// The codec may need more samples than it has, perfectly valid
|
||||||
Debug(2, "Codec not ready to give us a frame");
|
Debug(2, "Codec not ready to give us a frame");
|
||||||
return 0;
|
|
||||||
} else {
|
} else {
|
||||||
Error("Could not recieve frame (error %d = '%s')", ret,
|
Error("Could not recieve frame (error %d = '%s')", ret,
|
||||||
av_make_error_string(ret).c_str());
|
av_make_error_string(ret).c_str());
|
||||||
|
@ -571,7 +572,7 @@ int zm_send_packet_receive_frame(
|
||||||
}
|
}
|
||||||
} // end while !frameComplete
|
} // end while !frameComplete
|
||||||
#endif
|
#endif
|
||||||
return 1;
|
return 0;
|
||||||
} // end int zm_send_packet_receive_frame(AVCodecContext *context, AVFrame *frame, AVPacket &packet)
|
} // end int zm_send_packet_receive_frame(AVCodecContext *context, AVFrame *frame, AVPacket &packet)
|
||||||
|
|
||||||
/* Returns < 0 on error, 0 if codec not ready, 1 on success
|
/* Returns < 0 on error, 0 if codec not ready, 1 on success
|
||||||
|
@ -689,10 +690,14 @@ int zm_resample_audio(
|
||||||
AVFrame *out_frame
|
AVFrame *out_frame
|
||||||
) {
|
) {
|
||||||
#if defined(HAVE_LIBSWRESAMPLE)
|
#if defined(HAVE_LIBSWRESAMPLE)
|
||||||
|
if ( in_frame ) {
|
||||||
// Resample the in_frame into the audioSampleBuffer until we process the whole
|
// Resample the in_frame into the audioSampleBuffer until we process the whole
|
||||||
// decoded data. Note: pts does not survive resampling or converting
|
// decoded data. Note: pts does not survive resampling or converting
|
||||||
Debug(2, "Converting %d to %d samples using swresample",
|
Debug(2, "Converting %d to %d samples using swresample",
|
||||||
in_frame->nb_samples, out_frame->nb_samples);
|
in_frame->nb_samples, out_frame->nb_samples);
|
||||||
|
} else {
|
||||||
|
Debug(2, "Sending NULL frame to flush resampler");
|
||||||
|
}
|
||||||
int ret = swr_convert_frame(resample_ctx, out_frame, in_frame);
|
int ret = swr_convert_frame(resample_ctx, out_frame, in_frame);
|
||||||
if ( ret < 0 ) {
|
if ( ret < 0 ) {
|
||||||
Error("Could not resample frame (error '%s')",
|
Error("Could not resample frame (error '%s')",
|
||||||
|
@ -703,6 +708,10 @@ int zm_resample_audio(
|
||||||
swr_get_delay(resample_ctx, out_frame->sample_rate));
|
swr_get_delay(resample_ctx, out_frame->sample_rate));
|
||||||
#else
|
#else
|
||||||
#if defined(HAVE_LIBAVRESAMPLE)
|
#if defined(HAVE_LIBAVRESAMPLE)
|
||||||
|
if ( ! in_frame ) {
|
||||||
|
Error("Flushing resampler not supported by AVRESAMPLE");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
int ret = avresample_convert(resample_ctx, NULL, 0, 0, in_frame->data,
|
int ret = avresample_convert(resample_ctx, NULL, 0, 0, in_frame->data,
|
||||||
0, in_frame->nb_samples);
|
0, in_frame->nb_samples);
|
||||||
if ( ret < 0 ) {
|
if ( ret < 0 ) {
|
||||||
|
|
|
@ -277,8 +277,8 @@ VideoStore::VideoStore(
|
||||||
#endif
|
#endif
|
||||||
video_first_pts = 0;
|
video_first_pts = 0;
|
||||||
video_first_dts = 0;
|
video_first_dts = 0;
|
||||||
video_last_pts = 0;
|
video_next_pts = 0;
|
||||||
video_last_dts = 0;
|
video_next_dts = 0;
|
||||||
|
|
||||||
audio_first_pts = 0;
|
audio_first_pts = 0;
|
||||||
audio_first_dts = 0;
|
audio_first_dts = 0;
|
||||||
|
@ -898,6 +898,8 @@ int VideoStore::writeVideoFramePacket(AVPacket *ipkt) {
|
||||||
video_first_dts = ipkt->dts;
|
video_first_dts = ipkt->dts;
|
||||||
}
|
}
|
||||||
opkt.dts = ipkt->dts - video_first_dts;
|
opkt.dts = ipkt->dts - video_first_dts;
|
||||||
|
} else {
|
||||||
|
opkt.dts = av_rescale_q(video_next_dts, video_out_stream->time_base, video_in_stream->time_base);;
|
||||||
}
|
}
|
||||||
if ( ipkt->pts != AV_NOPTS_VALUE ) {
|
if ( ipkt->pts != AV_NOPTS_VALUE ) {
|
||||||
opkt.pts = ipkt->pts - video_first_dts;
|
opkt.pts = ipkt->pts - video_first_dts;
|
||||||
|
@ -906,6 +908,7 @@ int VideoStore::writeVideoFramePacket(AVPacket *ipkt) {
|
||||||
|
|
||||||
dumpPacket(video_out_stream, &opkt, "after pts adjustment");
|
dumpPacket(video_out_stream, &opkt, "after pts adjustment");
|
||||||
write_packet(&opkt, video_out_stream);
|
write_packet(&opkt, video_out_stream);
|
||||||
|
video_next_dts = opkt.dts + opkt.duration;
|
||||||
zm_av_packet_unref(&opkt);
|
zm_av_packet_unref(&opkt);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -934,8 +937,8 @@ int VideoStore::writeAudioFramePacket(AVPacket *ipkt) {
|
||||||
if ( audio_out_codec ) {
|
if ( audio_out_codec ) {
|
||||||
// I wonder if we can get multiple frames per packet? Probably
|
// I wonder if we can get multiple frames per packet? Probably
|
||||||
ret = zm_send_packet_receive_frame(audio_in_ctx, in_frame, *ipkt);
|
ret = zm_send_packet_receive_frame(audio_in_ctx, in_frame, *ipkt);
|
||||||
if ( ret <= 0 ) {
|
if ( ret < 0 ) {
|
||||||
Debug(3, "Not ready to receive frame");
|
Debug(3, "failed to receive frame code: %d", ret);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
zm_dump_frame(in_frame, "In frame from decode");
|
zm_dump_frame(in_frame, "In frame from decode");
|
||||||
|
|
|
@ -26,7 +26,7 @@ if [ "${TRAVIS_EVENT_TYPE}" == "cron" ] || [ "${OS}" == "debian" ] || [ "${OS}"
|
||||||
echo "Target subfolder set to $targetfolder"
|
echo "Target subfolder set to $targetfolder"
|
||||||
echo
|
echo
|
||||||
if [ "${USE_SFTP}" == "yes" ]; then
|
if [ "${USE_SFTP}" == "yes" ]; then
|
||||||
results="$(rsync build/* "zmrepo@zmrepo.zoneminder.com:${targetfolder}/" 2>&1)"
|
results="$(rsync build/* zmrepo@zmrepo.zoneminder.com:${targetfolder}/ 2>&1)"
|
||||||
if [ -z "$results" ]; then
|
if [ -z "$results" ]; then
|
||||||
echo
|
echo
|
||||||
echo "Files copied successfully."
|
echo "Files copied successfully."
|
||||||
|
|
|
@ -23,7 +23,7 @@ protected $defaults = array(
|
||||||
'Channel' => 0,
|
'Channel' => 0,
|
||||||
'Format' => '0',
|
'Format' => '0',
|
||||||
'V4LMultiBuffer' => null,
|
'V4LMultiBuffer' => null,
|
||||||
'V4LCapturesPerFrame' => null,
|
'V4LCapturesPerFrame' => 1,
|
||||||
'Protocol' => null,
|
'Protocol' => null,
|
||||||
'Method' => '',
|
'Method' => '',
|
||||||
'Host' => null,
|
'Host' => null,
|
||||||
|
|
|
@ -116,7 +116,16 @@ class Storage extends ZM_Object {
|
||||||
|
|
||||||
public function Server() {
|
public function Server() {
|
||||||
if ( ! array_key_exists('Server',$this) ) {
|
if ( ! array_key_exists('Server',$this) ) {
|
||||||
$this->{'Server'}= new Server($this->{'ServerId'});
|
if ( array_key_exists('ServerId', $this) ) {
|
||||||
|
$this->{'Server'} = Server::find_one(array('Id'=>$this->{'ServerId'}));
|
||||||
|
if ( ! $this->{'Server'} ) {
|
||||||
|
Error('No Server record found for server id ' . $this->{'ServerId'});
|
||||||
|
$this->{'Server'} = new Server();
|
||||||
|
}
|
||||||
|
$this->{'Server'} = new Server();
|
||||||
|
} else {
|
||||||
|
$this->{'Server'} = new Server();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $this->{'Server'};
|
return $this->{'Server'};
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ if ( $action == 'monitor' ) {
|
||||||
$restart = false;
|
$restart = false;
|
||||||
|
|
||||||
if ( count($changes) ) {
|
if ( count($changes) ) {
|
||||||
if ( $mid ) {
|
if ( $monitor->Id() ) {
|
||||||
|
|
||||||
# If we change anything that changes the shared mem size, zma can complain. So let's stop first.
|
# If we change anything that changes the shared mem size, zma can complain. So let's stop first.
|
||||||
if ( $monitor->Type() != 'WebSite' ) {
|
if ( $monitor->Type() != 'WebSite' ) {
|
||||||
|
@ -203,6 +203,8 @@ if ( $action == 'monitor' ) {
|
||||||
dbQuery("INSERT INTO Zones SET MonitorId = ?, Name = 'All', Type = 'Active', Units = 'Percent', NumCoords = 4, Coords = ?, Area=?, AlarmRGB = 0xff0000, CheckMethod = 'Blobs', MinPixelThreshold = 25, MinAlarmPixels=?, MaxAlarmPixels=?, FilterX = 3, FilterY = 3, MinFilterPixels=?, MaxFilterPixels=?, MinBlobPixels=?, MinBlobs = 1", array( $mid, sprintf( "%d,%d %d,%d %d,%d %d,%d", 0, 0, $_REQUEST['newMonitor']['Width']-1, 0, $_REQUEST['newMonitor']['Width']-1, $_REQUEST['newMonitor']['Height']-1, 0, $_REQUEST['newMonitor']['Height']-1 ), $zoneArea, intval(($zoneArea*3)/100), intval(($zoneArea*75)/100), intval(($zoneArea*3)/100), intval(($zoneArea*75)/100), intval(($zoneArea*2)/100) ) );
|
dbQuery("INSERT INTO Zones SET MonitorId = ?, Name = 'All', Type = 'Active', Units = 'Percent', NumCoords = 4, Coords = ?, Area=?, AlarmRGB = 0xff0000, CheckMethod = 'Blobs', MinPixelThreshold = 25, MinAlarmPixels=?, MaxAlarmPixels=?, FilterX = 3, FilterY = 3, MinFilterPixels=?, MaxFilterPixels=?, MinBlobPixels=?, MinBlobs = 1", array( $mid, sprintf( "%d,%d %d,%d %d,%d %d,%d", 0, 0, $_REQUEST['newMonitor']['Width']-1, 0, $_REQUEST['newMonitor']['Width']-1, $_REQUEST['newMonitor']['Height']-1, 0, $_REQUEST['newMonitor']['Height']-1 ), $zoneArea, intval(($zoneArea*3)/100), intval(($zoneArea*75)/100), intval(($zoneArea*3)/100), intval(($zoneArea*75)/100), intval(($zoneArea*2)/100) ) );
|
||||||
//$view = 'none';
|
//$view = 'none';
|
||||||
$Storage = $monitor->Storage();
|
$Storage = $monitor->Storage();
|
||||||
|
|
||||||
|
error_reporting(0);
|
||||||
mkdir($Storage->Path().'/'.$mid, 0755);
|
mkdir($Storage->Path().'/'.$mid, 0755);
|
||||||
$saferName = basename($_REQUEST['newMonitor']['Name']);
|
$saferName = basename($_REQUEST['newMonitor']['Name']);
|
||||||
symlink($mid, $Storage->Path().'/'.$saferName);
|
symlink($mid, $Storage->Path().'/'.$saferName);
|
||||||
|
|
|
@ -1223,6 +1223,9 @@ function parseFilter(&$filter, $saveToSession=false, $querySep='&') {
|
||||||
case 'Name':
|
case 'Name':
|
||||||
case 'Cause':
|
case 'Cause':
|
||||||
case 'Notes':
|
case 'Notes':
|
||||||
|
if($term['op'] == 'LIKE' || $term['op'] == 'NOT LIKE') {
|
||||||
|
$value = '%'.$value.'%';
|
||||||
|
}
|
||||||
$value = dbEscape($value);
|
$value = dbEscape($value);
|
||||||
break;
|
break;
|
||||||
case 'MonitorServerId':
|
case 'MonitorServerId':
|
||||||
|
@ -1275,6 +1278,8 @@ function parseFilter(&$filter, $saveToSession=false, $querySep='&') {
|
||||||
case '>' :
|
case '>' :
|
||||||
case '<' :
|
case '<' :
|
||||||
case '<=' :
|
case '<=' :
|
||||||
|
case 'LIKE' :
|
||||||
|
case 'NOT LIKE':
|
||||||
$filter['sql'] .= ' '.$term['op'].' '. $value;
|
$filter['sql'] .= ' '.$term['op'].' '. $value;
|
||||||
break;
|
break;
|
||||||
case '=~' :
|
case '=~' :
|
||||||
|
|
|
@ -579,6 +579,8 @@ $SLANG = array(
|
||||||
'OpNotMatches' => 'does not match',
|
'OpNotMatches' => 'does not match',
|
||||||
'OpIs' => 'is',
|
'OpIs' => 'is',
|
||||||
'OpIsNot' => 'is not',
|
'OpIsNot' => 'is not',
|
||||||
|
'OpLike' => 'contains',
|
||||||
|
'OpNotLike' => 'does not contain',
|
||||||
'OptionalEncoderParam' => 'Optional Encoder Parameters',
|
'OptionalEncoderParam' => 'Optional Encoder Parameters',
|
||||||
'OptionHelp' => 'Option Help',
|
'OptionHelp' => 'Option Help',
|
||||||
'OptionRestartWarning' => 'These changes may not come into effect fully\nwhile the system is running. When you have\nfinished making your changes please ensure that\nyou restart ZoneMinder.',
|
'OptionRestartWarning' => 'These changes may not come into effect fully\nwhile the system is running. When you have\nfinished making your changes please ensure that\nyou restart ZoneMinder.',
|
||||||
|
|
|
@ -172,13 +172,22 @@ if ( canEdit('Events') ) {
|
||||||
} // end if Event->DefaultVideo
|
} // end if Event->DefaultVideo
|
||||||
?>
|
?>
|
||||||
<div id="exportEvent"><button type="button" data-on-click="exportEvent"><?php echo translate('Export') ?></button></div>
|
<div id="exportEvent"><button type="button" data-on-click="exportEvent"><?php echo translate('Export') ?></button></div>
|
||||||
<div id="replayControl"><label for="replayMode"><?php echo translate('Replay') ?></label><?php echo buildSelect('replayMode', $replayModes, 'changeReplayMode();'); ?></div>
|
<div id="replayControl">
|
||||||
<div id="scaleControl"><label for="scale"><?php echo translate('Scale') ?></label><?php echo buildSelect('scale', $scales, 'changeScale();'); ?></div>
|
<label for="replayMode"><?php echo translate('Replay') ?></label>
|
||||||
<div id="codecControl"><label for="codec"><?php echo translate('Codec') ?></label><?php echo htmlSelect('codec', $codecs, $codec, array('onchange'=>'changeCodec(this);')); ?></div>
|
<?php echo htmlSelect('replayMode', $replayModes, $replayMode, array('data-on-change'=>'changeReplayMode')); ?>
|
||||||
|
</div>
|
||||||
|
<div id="scaleControl">
|
||||||
|
<label for="scale"><?php echo translate('Scale') ?></label>
|
||||||
|
<?php echo htmlSelect('scale', $scales, $scale, array('data-on-change'=>'changeScale')); ?>
|
||||||
|
</div>
|
||||||
|
<div id="codecControl">
|
||||||
|
<label for="codec"><?php echo translate('Codec') ?></label>
|
||||||
|
<?php echo htmlSelect('codec', $codecs, $codec, array('data-on-change-this'=>'changeCodec')); ?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<div id="eventVideo" class="">
|
<div id="eventVideo">
|
||||||
<?php
|
<?php
|
||||||
if ( ($codec == 'MP4' || $codec == 'auto' ) && $Event->DefaultVideo() ) {
|
if ( ($codec == 'MP4' || $codec == 'auto' ) && $Event->DefaultVideo() ) {
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -115,6 +115,8 @@ $opTypes = array(
|
||||||
'![]' => translate('OpNotIn'),
|
'![]' => translate('OpNotIn'),
|
||||||
'IS' => translate('OpIs'),
|
'IS' => translate('OpIs'),
|
||||||
'IS NOT' => translate('OpIsNot'),
|
'IS NOT' => translate('OpIsNot'),
|
||||||
|
'LIKE' => translate('OpLike'),
|
||||||
|
'NOT LIKE' => translate('OpNotLike'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$archiveTypes = array(
|
$archiveTypes = array(
|
||||||
|
|
|
@ -26,10 +26,10 @@ function createEventHtml(zm_event, frame) {
|
||||||
new Element('p').inject(eventHtml).set('text', zm_event.Name+(frame?('('+frame.FrameId+')'):''));
|
new Element('p').inject(eventHtml).set('text', zm_event.Name+(frame?('('+frame.FrameId+')'):''));
|
||||||
new Element('p').inject(eventHtml).set('text', zm_event.StartTime+' - '+zm_event.Length+'s');
|
new Element('p').inject(eventHtml).set('text', zm_event.StartTime+' - '+zm_event.Length+'s');
|
||||||
new Element('p').inject(eventHtml).set('text', zm_event.Cause);
|
new Element('p').inject(eventHtml).set('text', zm_event.Cause);
|
||||||
if ( event.Notes ) {
|
if ( zm_event.Notes ) {
|
||||||
new Element('p').inject(eventHtml).set('text', event.Notes);
|
new Element('p').inject(eventHtml).set('text', zm_event.Notes);
|
||||||
}
|
}
|
||||||
if ( event.Archived > 0 ) {
|
if ( zm_event.Archived > 0 ) {
|
||||||
new Element('p').inject(eventHtml).set( 'text', archivedString);
|
new Element('p').inject(eventHtml).set( 'text', archivedString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue