From a99f9091fc1368ed7f61b503c127f5cddef37e81 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 25 Sep 2021 14:27:10 -0400 Subject: [PATCH 1/7] remove useless commit. --- scripts/zmfilter.pl.in | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/zmfilter.pl.in b/scripts/zmfilter.pl.in index 64a20b4d5..1e62cb229 100644 --- a/scripts/zmfilter.pl.in +++ b/scripts/zmfilter.pl.in @@ -399,7 +399,6 @@ sub checkFilter { ) { $Event->save(); } - $ZoneMinder::Database::dbh->commit() if !$$filter{LockRows}; } # end if UpdateDiskSpace } # end foreach event ZoneMinder::Database::end_transaction($dbh, $in_transaction) if $$filter{LockRows}; From 888d79706ab29422001e12d9c1cd942caf2c4ac9 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 25 Sep 2021 16:08:58 -0400 Subject: [PATCH 2/7] Add zm_rtsp_server to ignores --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e617d937c..3d61b4f54 100644 --- a/.gitignore +++ b/.gitignore @@ -124,6 +124,7 @@ src/zmc src/zmf src/zms src/zmu +src/zm_rtsp_server src/zoneminder-zmc.8 src/zoneminder-zmc.8.gz src/zoneminder-zmf.8 From 03892796ebb672dd208afe962bc752af21a6ef71 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 25 Sep 2021 16:10:50 -0400 Subject: [PATCH 3/7] whitespace --- web/skins/classic/views/monitor.php | 32 +++++++++++++++++------------ 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index ac9d28b50..e00277e83 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -21,44 +21,50 @@ require_once('includes/Server.php'); require_once('includes/Storage.php'); -if ( !canEdit('Monitors', empty($_REQUEST['mid'])?0:$_REQUEST['mid']) ) { +if (!canEdit('Monitors', empty($_REQUEST['mid'])?0:$_REQUEST['mid'])) { $view = 'error'; return; } $Server = null; -if ( defined('ZM_SERVER_ID') ) { +if (defined('ZM_SERVER_ID')) { $Server = dbFetchOne('SELECT * FROM Servers WHERE Id=?', NULL, array(ZM_SERVER_ID)); } -if ( !$Server ) { +if (!$Server) { $Server = array('Id' => ''); } $mid = null; $monitor = null; -if ( !empty($_REQUEST['mid']) ) { +if (!empty($_REQUEST['mid'])) { $mid = validInt($_REQUEST['mid']); $monitor = new ZM\Monitor($mid); - if ( $monitor and ZM_OPT_X10 ) - $x10Monitor = dbFetchOne('SELECT * FROM TriggersX10 WHERE MonitorId = ?', NULL, array($mid)); + if ($monitor->Id()) { + if (ZM_OPT_X10) { + $x10Monitor = dbFetchOne('SELECT * FROM TriggersX10 WHERE MonitorId = ?', NULL, array($mid)); + } + } else { + $monitor->Name(translate('Monitor').'-'.$mid); + $monitor->WebColour(random_colour()); + } } -if ( !$monitor ) { +if (!$monitor) { $monitor = new ZM\Monitor(); $monitor->Name(translate('Monitor').'-'.getTableAutoInc('Monitors')); $monitor->WebColour(random_colour()); } # end if $_REQUEST['mid'] -if ( isset($_REQUEST['dupId']) ) { +if (isset($_REQUEST['dupId'])) { $monitor = new ZM\Monitor($_REQUEST['dupId']); $monitor->GroupIds(); // have to load before we change the Id - if ( ZM_OPT_X10 ) + if (ZM_OPT_X10) $x10Monitor = dbFetchOne('SELECT * FROM TriggersX10 WHERE MonitorId = ?', NULL, array($_REQUEST['dupId'])); $clonedName = $monitor->Name(); $monitor->Name('Clone of '.$monitor->Name()); $monitor->Id($mid); } -if ( ZM_OPT_X10 && empty($x10Monitor) ) { +if (ZM_OPT_X10 && empty($x10Monitor)) { $x10Monitor = array( 'Activation' => '', 'AlarmInput' => '', @@ -69,14 +75,14 @@ if ( ZM_OPT_X10 && empty($x10Monitor) ) { function fourcc($a, $b, $c, $d) { return ord($a) | (ord($b) << 8) | (ord($c) << 16) | (ord($d) << 24); } -if ( isset($_REQUEST['newMonitor']) ) { +if (isset($_REQUEST['newMonitor'])) { # Update the monitor object with whatever has been set so far. $monitor->set($_REQUEST['newMonitor']); - if ( ZM_OPT_X10 ) + if (ZM_OPT_X10) $newX10Monitor = $_REQUEST['newX10Monitor']; } else { - if ( ZM_OPT_X10 ) + if (ZM_OPT_X10) $newX10Monitor = $x10Monitor; } From 94c1b3445d5b6a8244a7c1b41a3abf4b15d8bc5d Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 25 Sep 2021 20:54:35 -0400 Subject: [PATCH 4/7] Add an input for an Id to assign to the new monitor. List 10 available Ids. --- web/skins/classic/views/monitor.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index e00277e83..68ce50397 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -355,6 +355,7 @@ $codecs = array( 'MJPEG' => translate('MJPEG'), ); +$monitors = dbFetchAll('SELECT Id, Name FROM Monitors ORDER BY Name,Sequence ASC'); $controls = ZM\Control::find(null, array('order'=>'lower(Name)')); xhtmlHeaders(__FILE__, translate('Monitor').' - '.validHtmlStr($monitor->Name())); @@ -452,6 +453,21 @@ foreach ( $tabs as $name=>$value ) { switch ( $name ) { case 'general' : { + if (!$monitor->Id()) { + $monitor_ids = array(); + foreach ($monitors as $m) { $monitor_ids[] = $m['Id']; } + $available_monitor_ids = array_diff(range(min($monitor_ids),max($monitor_ids)), $monitor_ids); +?> + + +
+10 Available Ids: + + + +Id() ?> @@ -524,7 +540,6 @@ switch ( $name ) { Id() || ($monitor->Id()!= $linked_monitor['Id'])) && visibleMonitor($linked_monitor['Id']) ) { From dcd2c1677419d2a0ade5a00e22c6638b54fa8827 Mon Sep 17 00:00:00 2001 From: Steve Gilvarry Date: Mon, 27 Sep 2021 00:58:34 +1000 Subject: [PATCH 5/7] Define Date formats Set Locale for time to en_GB.utf8, changed STRF_FMT_DATETIME_SHORTER to %x which is locale aware short date, but does include year. Makes event table wider, not sure if that is a problem for others --- web/lang/en_gb.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/lang/en_gb.php b/web/lang/en_gb.php index 8427d5bc6..8b412cd39 100644 --- a/web/lang/en_gb.php +++ b/web/lang/en_gb.php @@ -69,6 +69,11 @@ // setlocale( LC_CTYPE, 'en_GB' ); Character class settings 4.3.0 and after // setlocale( LC_TIME, 'en_GB' ); Date and time formatting 4.3.0 and after +setlocale( LC_TIME, 'en_GB.utf8' ); +define("DATE_FMT_CONSOLE_LONG", "%a %d %b, %Hh%M"); +define( "STRF_FMT_DATETIME_SHORT", "%d/%m/%y %H:%M:%S" ); +define( "STRF_FMT_DATETIME_SHORTER", "%x %H:%M:%S" ); + // Simple String Replacements $SLANG = array( 'SystemLog' => 'System Log', From 202d95fc5a67a23a76a47c714c44743ec548374f Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 27 Sep 2021 10:58:16 -0400 Subject: [PATCH 6/7] handle AV_HWDEVICE_TYPE_MMAL not being defined --- src/zm_ffmpeg_camera.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index 6415b2134..d0900ad78 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -66,8 +66,10 @@ static enum AVPixelFormat find_fmt_by_hw_type(const enum AVHWDeviceType type) { return AV_PIX_FMT_VDPAU; case AV_HWDEVICE_TYPE_CUDA: return AV_PIX_FMT_CUDA; +#ifdef AV_HWDEVICE_TYPE_MMAL case AV_HWDEVICE_TYPE_MMAL: return AV_PIX_FMT_MMAL; +#endif case AV_HWDEVICE_TYPE_VIDEOTOOLBOX: return AV_PIX_FMT_VIDEOTOOLBOX; default: From ac375bc6230d025ea9112c9cf2b4dab554563afb Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 27 Sep 2021 11:01:41 -0400 Subject: [PATCH 7/7] fix errant = --- src/zm_ffmpeg_camera.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index d0900ad78..b122e0f2b 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -61,7 +61,7 @@ static enum AVPixelFormat find_fmt_by_hw_type(const enum AVHWDeviceType type) { case AV_HWDEVICE_TYPE_DXVA2: return AV_PIX_FMT_DXVA2_VLD; case AV_HWDEVICE_TYPE_D3D11VA: - return = AV_PIX_FMT_D3D11; + return AV_PIX_FMT_D3D11; case AV_HWDEVICE_TYPE_VDPAU: return AV_PIX_FMT_VDPAU; case AV_HWDEVICE_TYPE_CUDA: