From b78deb192b28d5b008c38858aed8e8f021fd7b71 Mon Sep 17 00:00:00 2001 From: SteveGilvarry Date: Sat, 19 Dec 2015 20:51:19 +1100 Subject: [PATCH 01/17] Add some documentation on Multi-Server --- docs/userguide/definemonitor.rst | 3 +++ .../options/images/Options_Servers.png | Bin 0 -> 11202 bytes docs/userguide/options/options_servers.rst | 10 ++++++++++ 3 files changed, 13 insertions(+) create mode 100644 docs/userguide/options/images/Options_Servers.png create mode 100644 docs/userguide/options/options_servers.rst diff --git a/docs/userguide/definemonitor.rst b/docs/userguide/definemonitor.rst index c2006eed9..d69b44425 100644 --- a/docs/userguide/definemonitor.rst +++ b/docs/userguide/definemonitor.rst @@ -21,6 +21,9 @@ Monitor Tab Name The name for your monitor. This should be made up of alphanumeric characters (a-z,A-Z,0-9) and hyphen (-) and underscore(_) only. Whitespace is not allowed. +Server + Multi-Server implementation allows the ability to define multiple ZoneMinder servers sharing a single database. When servers are configured this setting allows you nominate the server for each monitor. + Source Type This determines whether the camera is a local one attached to a physical video or USB port on your machine, a remote network camera or an image source that is represented by a file (for instance periodically downloaded from a alternate location). Choosing one or the other affects which set of options are shown in the Source tab. diff --git a/docs/userguide/options/images/Options_Servers.png b/docs/userguide/options/images/Options_Servers.png new file mode 100644 index 0000000000000000000000000000000000000000..2ca47edba78531a2567a2e9ac2b932d30c0f8c93 GIT binary patch literal 11202 zcmc(FWmH?iw=We6Erpii4#A3-;@%>~p%C0DP#lT|3sjKcR@@3jiWm1#+zBp$;8HYL z5}XIUAKqH`uK%aI-g;lo*=L{GGP7p(?AgBweXk~u|Ag`h78Vx1qJpd@7S@CLTRIc> z{_Rs;DdG3+>w%lJq82VL?%cBa((NaOyPTdo(D|b~$lTQm%i77=(TdB>!qv*k$<4;u z9r>VD5(|qSOHuZ%mRI^70%S(DekFAPa|4NTJ@f9Ji`sLjtgE88eCC<_c}SQaz$PAK~4(a$w&{Ece(BCvSh^!8cRC zQeo8aW&XRRFI_K(;C-ucr84NB&Zz+SwY>`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C>znoDBdRZGX(Re%v4~W`8S`SjG>?uZuY5O z-);7%z)T-x$1_qZ)9T}&L)xziStk>_7Eey4OneT7jzIRV>8?Zh)1=|8rl)BjLq=+F#z{lA2JBq+CXh=T(MF|J&`o*!8aJ+bJk5lT~z*6xb@Yik*?lQ1b$7v8&m ztU#m+vqx?phSUiSHzq-PwX2a{3$;o6B7cayw-LO|sKye`)fEd8tFrV?5x&wnwP_Rg z-~0l_A#LJI73x*~zLwLqrD@R1gJ9`H)jk-^|d>5TAM4yFk{3+qtFkE^mRY=?R83Irt+bMNcKI zpWuMYU%AC@+h_lE;4tn1UUnRwMv`ypB6uA}OZv5q_+cxceW*hdr<`uhM`%5fZ%%+KH8u$sx9V!3l2 zOG{qX-dC!`M!(z^oII1lO#)*rG&m2P{DM^^%}rFu8Qn59d<{@OGeS`Gc9xdrJ}7y-%*M;kt&q0Qphl4W9frdkGf zsaDe|5i@N@<}v0!7a%D6cMfzX0WF_ed~~gtwMDwdeHlfw7i4K37Zz?W_#4TQ;50;X=}_|PA7*V)`gFOW zouQI>55ah#W5Jh*^F_HP5xKaU$1)#HBqutn4ir~ir#P?Nd05>Je_B%rA3Z1J1*;=_ zM1V@}>*vf=*2caS7+~9n;5JONA2JOl^%|6|x*Q=`Wy|XnE*Te>%{r!McDWwJK)Evf_GEm`S06Q-}q){-*|V{ zditZa={}~AyUhRgn$?h3YR4YOT^p?baYSeDz>&DiH$)Lturh72hXNj1+n_9k=B00$ p|0VFBCI9 Date: Sun, 20 Dec 2015 11:22:12 -0500 Subject: [PATCH 02/17] update paths to /usr/share/zoneminder/www and /usr/lib/zoneminder/cgi-bin --- distros/debian_cmake/rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distros/debian_cmake/rules b/distros/debian_cmake/rules index aa0501ab1..4bdc7cb0c 100755 --- a/distros/debian_cmake/rules +++ b/distros/debian_cmake/rules @@ -17,9 +17,9 @@ override_dh_auto_configure: -DZM_SOCKDIR=/var/run/zm \ -DZM_TMPDIR=/var/tmp/zm \ -DZM_LOGDIR=/var/log/zm \ - -DZM_WEBDIR=/usr/share/zoneminder \ + -DZM_WEBDIR=/usr/share/zoneminder/www \ -DZM_CONTENTDIR=/var/cache/zoneminder \ - -DZM_CGIDIR=/usr/lib/cgi-bin \ + -DZM_CGIDIR=/usr/lib/zoneminder/cgi-bin \ -DZM_WEB_USER=www-data \ -DZM_WEB_GROUP=www-data \ -DCMAKE_INSTALL_SYSCONFDIR=etc/zm From 4ef35c8c7081f58b87d163528dbef2e25949a298 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sun, 20 Dec 2015 11:23:01 -0500 Subject: [PATCH 03/17] No need for a cgi-bin link --- distros/debian_cmake/links | 1 - 1 file changed, 1 deletion(-) diff --git a/distros/debian_cmake/links b/distros/debian_cmake/links index 9715ee428..5560a100a 100644 --- a/distros/debian_cmake/links +++ b/distros/debian_cmake/links @@ -1,4 +1,3 @@ var/cache/zoneminder/events usr/share/zoneminder/events var/cache/zoneminder/images usr/share/zoneminder/images var/cache/zoneminder/temp usr/share/zoneminder/temp -usr/lib/cgi-bin usr/share/zoneminder/cgi-bin From 9743bad13f6d8b9af510ca1c808de042b412e759 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sun, 20 Dec 2015 12:21:18 -0500 Subject: [PATCH 04/17] Add a valid config if a person is using mod_fcgid instead of mod_php --- distros/ubuntu1204/apache.conf | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/distros/ubuntu1204/apache.conf b/distros/ubuntu1204/apache.conf index 965c67f86..262db423f 100644 --- a/distros/ubuntu1204/apache.conf +++ b/distros/ubuntu1204/apache.conf @@ -1,9 +1,21 @@ Alias /zm /usr/share/zoneminder/www - - php_flag register_globals off - Options Indexes FollowSymLinks - - DirectoryIndex index.php - - + + + Options +ExecCGI + AllowOverride All + AddHandler fcgid-script .php + FCGIWrapper /usr/bin/php5-cgi + Order allow,deny + Allow from all + + + + + php_flag register_globals off + Options Indexes FollowSymLinks + + DirectoryIndex index.php + + + From f4debc203d4f21838650c584a99b4a3c31c29ea2 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sun, 20 Dec 2015 12:23:40 -0500 Subject: [PATCH 05/17] Only run zmupdate.pl if the mysql db is located here --- distros/ubuntu1504_cmake/zoneminder.postinst | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/distros/ubuntu1504_cmake/zoneminder.postinst b/distros/ubuntu1504_cmake/zoneminder.postinst index 4d2da7331..82b256e6b 100644 --- a/distros/ubuntu1504_cmake/zoneminder.postinst +++ b/distros/ubuntu1504_cmake/zoneminder.postinst @@ -2,6 +2,8 @@ set -e +. /etc/zm/zm.conf + if [ "$1" = "configure" ]; then chown www-data:root /var/log/zm chown www-data:www-data /var/lib/zm @@ -15,9 +17,13 @@ if [ "$1" = "configure" ]; then # Ensure zoneminder is stopped deb-systemd-invoke stop zoneminder.service || exit $? - echo 'grant lock tables, create, index, alter on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql - # Run the ZoneMinder update tool - zmupdate.pl --nointeractive + if [ "$ZM_DB_HOST" = "localhost" ]; then + echo 'grant lock tables, create, index, alter on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql + # Run the ZoneMinder update tool + zmupdate.pl --nointeractive + else + echo "Not doing database upgrade due to remote db server ($ZM_DB_HOST)" + fi; fi From af9fc1de905e7a4c77bf319fa101671a55ea4af0 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 21 Dec 2015 12:57:05 -0500 Subject: [PATCH 06/17] revert white space changes. --- src/zm_monitor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index c1018f179..0346e740e 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -396,11 +396,11 @@ Monitor::Monitor( + 64; /* Padding used to permit aligning the images buffer to 16 byte boundary */ Debug( 1, "mem.size=%d", mem_size ); - mem_ptr = NULL; + mem_ptr = NULL; if ( purpose == CAPTURE ) { - this->connect(); - if ( ! mem_ptr ) exit(-1); + this->connect(); + if ( ! mem_ptr ) exit(-1); memset( mem_ptr, 0, mem_size ); shared_data->size = sizeof(SharedData); shared_data->active = enabled; From b33c0764fe4eefb72121efbc8a399d7736195f40 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 21 Dec 2015 12:59:52 -0500 Subject: [PATCH 07/17] update to new cgi-bin path --- distros/debian_cmake/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distros/debian_cmake/install b/distros/debian_cmake/install index 9e8953409..1bd76421f 100644 --- a/distros/debian_cmake/install +++ b/distros/debian_cmake/install @@ -1,5 +1,5 @@ usr/bin -usr/lib/cgi-bin +usr/lib/zoneminder/cgi-bin usr/share/man usr/share/perl5/ZoneMinder usr/share/perl5/ZoneMinder.pm From 70cac99e1791f55273eba2535c26f07c639afa29 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 21 Dec 2015 13:03:52 -0500 Subject: [PATCH 08/17] fix claim that live view must be done on host server --- docs/userguide/options/options_servers.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/userguide/options/options_servers.rst b/docs/userguide/options/options_servers.rst index 9ca5f40ee..5a1264e47 100644 --- a/docs/userguide/options/options_servers.rst +++ b/docs/userguide/options/options_servers.rst @@ -3,8 +3,8 @@ Options - Servers .. image:: images/Options_Servers.png -Servers options is used for setting up multiple ZoneMinder servers sharing the same database and using a shared file share for all event data. To add a new server use the Add Server button. All that is required is a Name for the Server and Hostname. +Servers tab is used for setting up multiple ZoneMinder servers sharing the same database and using a shared file share for all event data. To add a new server use the Add Server button. All that is required is a Name for the Server and Hostname. To delete a server mark that server and click the Delete button. -Currently Live view is only available on the monitors host server, but events can be viewed from any server due to the shared file share. +Please note that all servers must have a functional web UI as the live view must come from the monitor's host server. From bcb18b927b2c092d2ba8427bae9351f47e24becf Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 21 Dec 2015 13:05:56 -0500 Subject: [PATCH 09/17] mention that you must set ZM_SERVER_NAME in /etc/zm/zm.conf --- docs/userguide/options/options_servers.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/userguide/options/options_servers.rst b/docs/userguide/options/options_servers.rst index 5a1264e47..4736c305a 100644 --- a/docs/userguide/options/options_servers.rst +++ b/docs/userguide/options/options_servers.rst @@ -8,3 +8,5 @@ Servers tab is used for setting up multiple ZoneMinder servers sharing the same To delete a server mark that server and click the Delete button. Please note that all servers must have a functional web UI as the live view must come from the monitor's host server. + +On each server, you will have to edit /etc/zm/zm.conf and set either ZM_SERVER_NAME= From fdf1912ec10a5de0e48245ae2991e05fb3bff056 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 21 Dec 2015 13:11:18 -0500 Subject: [PATCH 10/17] revert whitespace changes --- src/zm_monitor.cpp | 148 ++++++++++++++++++++++----------------------- 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 0346e740e..c62dd9fbb 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -427,8 +427,8 @@ Monitor::Monitor( trigger_data->trigger_showtext[0] = 0; shared_data->valid = true; } else if ( purpose == ANALYSIS ) { - this->connect(); - if ( ! mem_ptr ) exit(-1); + this->connect(); + if ( ! mem_ptr ) exit(-1); shared_data->state = IDLE; shared_data->last_read_time = 0; shared_data->alarm_x = -1; @@ -444,9 +444,9 @@ Monitor::Monitor( } } - // Will this not happen every time a monitor is instantiated? Seems like all the calls to the Monitor constructor pass a zero for n_zones, then load zones after.. + // Will this not happen every time a monitor is instantiated? Seems like all the calls to the Monitor constructor pass a zero for n_zones, then load zones after.. if ( !n_zones ) { - Debug( 1, "Monitor %s has no zones, adding one.", name ); + Debug( 1, "Monitor %s has no zones, adding one.", name ); n_zones = 1; zones = new Zone *[1]; Coord coords[4] = { Coord( 0, 0 ), Coord( width-1, 0 ), Coord( width-1, height-1 ), Coord( 0, height-1 ) }; @@ -528,28 +528,28 @@ bool Monitor::connect() { // Allocate the size if ( ftruncate( map_fd, mem_size ) < 0 ) { Fatal( "Can't extend memory map file %s to %d bytes: %s", mem_file, mem_size, strerror(errno) ); - } + } } else if ( map_stat.st_size == 0 ) { Error( "Got empty memory map file size %ld, is the zmc process for this monitor running?", map_stat.st_size, mem_size ); - return false; + return false; } else if ( map_stat.st_size != mem_size ) { Error( "Got unexpected memory map file size %ld, expected %d", map_stat.st_size, mem_size ); - return false; - } else { + return false; + } else { #ifdef MAP_LOCKED - mem_ptr = (unsigned char *)mmap( NULL, mem_size, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_LOCKED, map_fd, 0 ); - if ( mem_ptr == MAP_FAILED ) { - if ( errno == EAGAIN ) { - Debug( 1, "Unable to map file %s (%d bytes) to locked memory, trying unlocked", mem_file, mem_size ); + mem_ptr = (unsigned char *)mmap( NULL, mem_size, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_LOCKED, map_fd, 0 ); + if ( mem_ptr == MAP_FAILED ) { + if ( errno == EAGAIN ) { + Debug( 1, "Unable to map file %s (%d bytes) to locked memory, trying unlocked", mem_file, mem_size ); #endif - mem_ptr = (unsigned char *)mmap( NULL, mem_size, PROT_READ|PROT_WRITE, MAP_SHARED, map_fd, 0 ); - Debug( 1, "Mapped file %s (%d bytes) to locked memory, unlocked", mem_file, mem_size ); + mem_ptr = (unsigned char *)mmap( NULL, mem_size, PROT_READ|PROT_WRITE, MAP_SHARED, map_fd, 0 ); + Debug( 1, "Mapped file %s (%d bytes) to locked memory, unlocked", mem_file, mem_size ); #ifdef MAP_LOCKED - } - } + } + } #endif - if ( mem_ptr == MAP_FAILED ) - Fatal( "Can't map file %s (%d bytes) to memory: %s(%d)", mem_file, mem_size, strerror(errno), errno ); + if ( mem_ptr == MAP_FAILED ) + Fatal( "Can't map file %s (%d bytes) to memory: %s(%d)", mem_file, mem_size, strerror(errno), errno ); } #else // ZM_MEM_MAPPED shm_id = shmget( (config.shm_key&0xffff0000)|id, mem_size, IPC_CREAT|0700 ); @@ -570,9 +570,9 @@ bool Monitor::connect() { unsigned char *shared_images = (unsigned char *)((char *)shared_timestamps + (image_buffer_count*sizeof(struct timeval))); if(((unsigned long)shared_images % 16) != 0) { - /* Align images buffer to nearest 16 byte boundary */ - Debug(3,"Aligning shared memory images to the next 16 byte boundary"); - shared_images = (uint8_t*)((unsigned long)shared_images + (16 - ((unsigned long)shared_images % 16))); + /* Align images buffer to nearest 16 byte boundary */ + Debug(3,"Aligning shared memory images to the next 16 byte boundary"); + shared_images = (uint8_t*)((unsigned long)shared_images + (16 - ((unsigned long)shared_images % 16))); } image_buffer = new Snapshot[image_buffer_count]; for ( int i = 0; i < image_buffer_count; i++ ) @@ -603,7 +603,7 @@ bool Monitor::connect() { } } - return true; + return true; } Monitor::~Monitor() @@ -620,22 +620,22 @@ Monitor::~Monitor() delete[] privacy_bitmask; privacy_bitmask = NULL; } - if ( mem_ptr ) { - if ( event ) - Info( "%s: %03d - Closing event %d, shutting down", name, image_count, event->Id() ); - closeEvent(); + if ( mem_ptr ) { + if ( event ) + Info( "%s: %03d - Closing event %d, shutting down", name, image_count, event->Id() ); + closeEvent(); - if ( (deinterlacing & 0xff) == 4) - { - delete next_buffer.image; - delete next_buffer.timestamp; - } - for ( int i = 0; i < image_buffer_count; i++ ) - { - delete image_buffer[i].image; - } - delete[] image_buffer; - } // end if mem_ptr + if ( (deinterlacing & 0xff) == 4) + { + delete next_buffer.image; + delete next_buffer.timestamp; + } + for ( int i = 0; i < image_buffer_count; i++ ) + { + delete image_buffer[i].image; + } + delete[] image_buffer; + } // end if mem_ptr for ( int i = 0; i < n_zones; i++ ) { @@ -645,47 +645,47 @@ Monitor::~Monitor() delete camera; - if ( mem_ptr ) { - if ( purpose == ANALYSIS ) - { - shared_data->state = state = IDLE; - shared_data->last_read_index = image_buffer_count; - shared_data->last_read_time = 0; + if ( mem_ptr ) { + if ( purpose == ANALYSIS ) + { + shared_data->state = state = IDLE; + shared_data->last_read_index = image_buffer_count; + shared_data->last_read_time = 0; - if ( analysis_fps ) - { - for ( int i = 0; i < pre_event_buffer_count; i++ ) - { - delete pre_event_buffer[i].image; - delete pre_event_buffer[i].timestamp; - } - delete[] pre_event_buffer; - } - } - else if ( purpose == CAPTURE ) - { - shared_data->valid = false; - memset( mem_ptr, 0, mem_size ); - } + if ( analysis_fps ) + { + for ( int i = 0; i < pre_event_buffer_count; i++ ) + { + delete pre_event_buffer[i].image; + delete pre_event_buffer[i].timestamp; + } + delete[] pre_event_buffer; + } + } + else if ( purpose == CAPTURE ) + { + shared_data->valid = false; + memset( mem_ptr, 0, mem_size ); + } #if ZM_MEM_MAPPED - if ( msync( mem_ptr, mem_size, MS_SYNC ) < 0 ) - Error( "Can't msync: %s", strerror(errno) ); - if ( munmap( mem_ptr, mem_size ) < 0 ) - Fatal( "Can't munmap: %s", strerror(errno) ); - close( map_fd ); + if ( msync( mem_ptr, mem_size, MS_SYNC ) < 0 ) + Error( "Can't msync: %s", strerror(errno) ); + if ( munmap( mem_ptr, mem_size ) < 0 ) + Fatal( "Can't munmap: %s", strerror(errno) ); + close( map_fd ); #else // ZM_MEM_MAPPED - struct shmid_ds shm_data; - if ( shmctl( shm_id, IPC_STAT, &shm_data ) < 0 ) { - Error( "Can't shmctl: %s", strerror(errno) ); - exit( -1 ); - } - if ( shm_data.shm_nattch <= 1 ) { - if ( shmctl( shm_id, IPC_RMID, 0 ) < 0 ) { - Error( "Can't shmctl: %s", strerror(errno) ); - exit( -1 ); - } - } + struct shmid_ds shm_data; + if ( shmctl( shm_id, IPC_STAT, &shm_data ) < 0 ) { + Error( "Can't shmctl: %s", strerror(errno) ); + exit( -1 ); + } + if ( shm_data.shm_nattch <= 1 ) { + if ( shmctl( shm_id, IPC_RMID, 0 ) < 0 ) { + Error( "Can't shmctl: %s", strerror(errno) ); + exit( -1 ); + } + } #endif // ZM_MEM_MAPPED } // end if mem_ptr } From c0a79567e6dabe37c13bd4df10bf31b306f4a65c Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 21 Dec 2015 13:26:24 -0500 Subject: [PATCH 11/17] revert whitespace changes --- src/zm_monitor.cpp | 104 ++++++++++++++++++++++----------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index c62dd9fbb..f77e5ae76 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -608,14 +608,14 @@ bool Monitor::connect() { Monitor::~Monitor() { - if ( timestamps ) { - delete[] timestamps; - timestamps = 0; - } - if ( images ) { - delete[] images; - images = 0; - } + if ( timestamps ) { + delete[] timestamps; + timestamps = 0; + } + if ( images ) { + delete[] images; + images = 0; + } if ( privacy_bitmask ) { delete[] privacy_bitmask; privacy_bitmask = NULL; @@ -738,7 +738,7 @@ int Monitor::GetImage( int index, int scale ) if ( index != image_buffer_count ) { Image *image; - // If we are going to be modifying the snapshot before writing, then we need to copy it + // If we are going to be modifying the snapshot before writing, then we need to copy it if ( ( scale != ZM_SCALE_BASE ) || ( !config.timestamp_on_capture ) ) { Snapshot *snap = &image_buffer[index]; Image *snap_image = snap->image; @@ -1238,32 +1238,32 @@ bool Monitor::CheckSignal( const Image *image ) break; } - if(colours == ZM_COLOUR_GRAY8) { - if ( *(buffer+index) != grayscale_val ) - return true; - - } else if(colours == ZM_COLOUR_RGB24) { - const uint8_t *ptr = buffer+(index*colours); - - if ( usedsubpixorder == ZM_SUBPIX_ORDER_BGR) { - if ( (RED_PTR_BGRA(ptr) != red_val) || (GREEN_PTR_BGRA(ptr) != green_val) || (BLUE_PTR_BGRA(ptr) != blue_val) ) - return true; - } else { - /* Assume RGB */ - if ( (RED_PTR_RGBA(ptr) != red_val) || (GREEN_PTR_RGBA(ptr) != green_val) || (BLUE_PTR_RGBA(ptr) != blue_val) ) - return true; - } - - } else if(colours == ZM_COLOUR_RGB32) { - if ( usedsubpixorder == ZM_SUBPIX_ORDER_ARGB || usedsubpixorder == ZM_SUBPIX_ORDER_ABGR) { - if ( ARGB_ABGR_ZEROALPHA(*(((const Rgb*)buffer)+index)) != ARGB_ABGR_ZEROALPHA(colour_val) ) - return true; - } else { - /* Assume RGBA or BGRA */ - if ( RGBA_BGRA_ZEROALPHA(*(((const Rgb*)buffer)+index)) != RGBA_BGRA_ZEROALPHA(colour_val) ) - return true; - } - } + if(colours == ZM_COLOUR_GRAY8) { + if ( *(buffer+index) != grayscale_val ) + return true; + + } else if(colours == ZM_COLOUR_RGB24) { + const uint8_t *ptr = buffer+(index*colours); + + if ( usedsubpixorder == ZM_SUBPIX_ORDER_BGR) { + if ( (RED_PTR_BGRA(ptr) != red_val) || (GREEN_PTR_BGRA(ptr) != green_val) || (BLUE_PTR_BGRA(ptr) != blue_val) ) + return true; + } else { + /* Assume RGB */ + if ( (RED_PTR_RGBA(ptr) != red_val) || (GREEN_PTR_RGBA(ptr) != green_val) || (BLUE_PTR_RGBA(ptr) != blue_val) ) + return true; + } + + } else if(colours == ZM_COLOUR_RGB32) { + if ( usedsubpixorder == ZM_SUBPIX_ORDER_ARGB || usedsubpixorder == ZM_SUBPIX_ORDER_ABGR) { + if ( ARGB_ABGR_ZEROALPHA(*(((const Rgb*)buffer)+index)) != ARGB_ABGR_ZEROALPHA(colour_val) ) + return true; + } else { + /* Assume RGBA or BGRA */ + if ( RGBA_BGRA_ZEROALPHA(*(((const Rgb*)buffer)+index)) != RGBA_BGRA_ZEROALPHA(colour_val) ) + return true; + } + } } return( false ); @@ -1734,7 +1734,7 @@ bool Monitor::Analyse() if ( config.create_analysis_images ) { bool got_anal_image = false; - alarm_image.Assign( *snap_image ); + alarm_image.Assign( *snap_image ); for( int i = 0; i < n_zones; i++ ) { if ( zones[i]->Alarmed() ) @@ -2083,22 +2083,22 @@ Debug( 1, "Server ID %d", staticConfig.SERVER_ID ); const char *device = dbrow[col]; col++; int channel = atoi(dbrow[col]); col++; int format = atoi(dbrow[col]); col++; - bool v4l_multi_buffer = config.v4l_multi_buffer; - if ( dbrow[col] ) { - if (*dbrow[col] == '0' ) { - v4l_multi_buffer = false; - } else if ( *dbrow[col] == '1' ) { - v4l_multi_buffer = true; - } - } - col++; - - int v4l_captures_per_frame = 0; - if ( dbrow[col] ) { - v4l_captures_per_frame = atoi(dbrow[col]); - } else { - v4l_captures_per_frame = config.captures_per_frame; - } + bool v4l_multi_buffer = config.v4l_multi_buffer; + if ( dbrow[col] ) { + if (*dbrow[col] == '0' ) { + v4l_multi_buffer = false; + } else if ( *dbrow[col] == '1' ) { + v4l_multi_buffer = true; + } + } + col++; + + int v4l_captures_per_frame = 0; + if ( dbrow[col] ) { + v4l_captures_per_frame = atoi(dbrow[col]); + } else { + v4l_captures_per_frame = config.captures_per_frame; + } Debug( 1, "Got %d for v4l_captures_per_frame", v4l_captures_per_frame ); col++; const char *method = dbrow[col]; col++; From 1fee421500a7f6069d17ddc506c9ca98f22b3fd1 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 21 Dec 2015 13:29:41 -0500 Subject: [PATCH 12/17] revert whitespace changes --- src/zm_monitor.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index f77e5ae76..6c75b1819 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -687,7 +687,7 @@ Monitor::~Monitor() } } #endif // ZM_MEM_MAPPED - } // end if mem_ptr + } // end if mem_ptr } void Monitor::AddZones( int p_n_zones, Zone *p_zones[] ) @@ -1238,27 +1238,27 @@ bool Monitor::CheckSignal( const Image *image ) break; } - if(colours == ZM_COLOUR_GRAY8) { - if ( *(buffer+index) != grayscale_val ) + if(colours == ZM_COLOUR_GRAY8) { + if ( *(buffer+index) != grayscale_val ) return true; - } else if(colours == ZM_COLOUR_RGB24) { - const uint8_t *ptr = buffer+(index*colours); + } else if(colours == ZM_COLOUR_RGB24) { + const uint8_t *ptr = buffer+(index*colours); - if ( usedsubpixorder == ZM_SUBPIX_ORDER_BGR) { - if ( (RED_PTR_BGRA(ptr) != red_val) || (GREEN_PTR_BGRA(ptr) != green_val) || (BLUE_PTR_BGRA(ptr) != blue_val) ) - return true; - } else { - /* Assume RGB */ - if ( (RED_PTR_RGBA(ptr) != red_val) || (GREEN_PTR_RGBA(ptr) != green_val) || (BLUE_PTR_RGBA(ptr) != blue_val) ) - return true; - } + if ( usedsubpixorder == ZM_SUBPIX_ORDER_BGR) { + if ( (RED_PTR_BGRA(ptr) != red_val) || (GREEN_PTR_BGRA(ptr) != green_val) || (BLUE_PTR_BGRA(ptr) != blue_val) ) + return true; + } else { + /* Assume RGB */ + if ( (RED_PTR_RGBA(ptr) != red_val) || (GREEN_PTR_RGBA(ptr) != green_val) || (BLUE_PTR_RGBA(ptr) != blue_val) ) + return true; + } - } else if(colours == ZM_COLOUR_RGB32) { - if ( usedsubpixorder == ZM_SUBPIX_ORDER_ARGB || usedsubpixorder == ZM_SUBPIX_ORDER_ABGR) { - if ( ARGB_ABGR_ZEROALPHA(*(((const Rgb*)buffer)+index)) != ARGB_ABGR_ZEROALPHA(colour_val) ) - return true; - } else { + } else if(colours == ZM_COLOUR_RGB32) { + if ( usedsubpixorder == ZM_SUBPIX_ORDER_ARGB || usedsubpixorder == ZM_SUBPIX_ORDER_ABGR) { + if ( ARGB_ABGR_ZEROALPHA(*(((const Rgb*)buffer)+index)) != ARGB_ABGR_ZEROALPHA(colour_val) ) + return true; + } else { /* Assume RGBA or BGRA */ if ( RGBA_BGRA_ZEROALPHA(*(((const Rgb*)buffer)+index)) != RGBA_BGRA_ZEROALPHA(colour_val) ) return true; From 609ab79f81f7117af352e97bda0b3582e0882a08 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 21 Dec 2015 13:32:57 -0500 Subject: [PATCH 13/17] revert whitespace changes --- src/zm_monitor.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 6c75b1819..1a219c3b1 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -1240,11 +1240,11 @@ bool Monitor::CheckSignal( const Image *image ) if(colours == ZM_COLOUR_GRAY8) { if ( *(buffer+index) != grayscale_val ) - return true; - + return true; + } else if(colours == ZM_COLOUR_RGB24) { const uint8_t *ptr = buffer+(index*colours); - + if ( usedsubpixorder == ZM_SUBPIX_ORDER_BGR) { if ( (RED_PTR_BGRA(ptr) != red_val) || (GREEN_PTR_BGRA(ptr) != green_val) || (BLUE_PTR_BGRA(ptr) != blue_val) ) return true; @@ -1253,17 +1253,17 @@ bool Monitor::CheckSignal( const Image *image ) if ( (RED_PTR_RGBA(ptr) != red_val) || (GREEN_PTR_RGBA(ptr) != green_val) || (BLUE_PTR_RGBA(ptr) != blue_val) ) return true; } - + } else if(colours == ZM_COLOUR_RGB32) { if ( usedsubpixorder == ZM_SUBPIX_ORDER_ARGB || usedsubpixorder == ZM_SUBPIX_ORDER_ABGR) { if ( ARGB_ABGR_ZEROALPHA(*(((const Rgb*)buffer)+index)) != ARGB_ABGR_ZEROALPHA(colour_val) ) return true; } else { - /* Assume RGBA or BGRA */ - if ( RGBA_BGRA_ZEROALPHA(*(((const Rgb*)buffer)+index)) != RGBA_BGRA_ZEROALPHA(colour_val) ) - return true; - } + /* Assume RGBA or BGRA */ + if ( RGBA_BGRA_ZEROALPHA(*(((const Rgb*)buffer)+index)) != RGBA_BGRA_ZEROALPHA(colour_val) ) + return true; } + } } return( false ); From 36f83aa41259bc23deb2f528113b85fabdb40136 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 21 Dec 2015 13:35:17 -0500 Subject: [PATCH 14/17] revert whitespace changes --- src/zm_monitor.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 1a219c3b1..468a5c910 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -2092,15 +2092,15 @@ Debug( 1, "Server ID %d", staticConfig.SERVER_ID ); } } col++; - + int v4l_captures_per_frame = 0; if ( dbrow[col] ) { - v4l_captures_per_frame = atoi(dbrow[col]); + v4l_captures_per_frame = atoi(dbrow[col]); } else { v4l_captures_per_frame = config.captures_per_frame; } Debug( 1, "Got %d for v4l_captures_per_frame", v4l_captures_per_frame ); - col++; + col++; const char *method = dbrow[col]; col++; int width = atoi(dbrow[col]); col++; @@ -2157,8 +2157,8 @@ Debug( 1, "Got %d for v4l_captures_per_frame", v4l_captures_per_frame ); device, channel, format, - v4l_multi_buffer, - v4l_captures_per_frame, + v4l_multi_buffer, + v4l_captures_per_frame, method, cam_width, cam_height, From e76cc59bad181665028853587fd18be447794d9a Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 21 Dec 2015 13:42:44 -0500 Subject: [PATCH 15/17] revert whitespace changes --- src/zm_monitor.cpp | 72 +++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 468a5c910..f07713cd8 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -3004,30 +3004,30 @@ Debug( 1, "Got %d for v4l_captures_per_frame", v4l_captures_per_frame ); int Monitor::Capture() { - static int FirstCapture = 1; - int captureResult; - - int index = image_count%image_buffer_count; - Image* capture_image = image_buffer[index].image; - - if ( (deinterlacing & 0xff) == 4) { - if ( FirstCapture != 1 ) { - /* Copy the next image into the shared memory */ - capture_image->CopyBuffer(*(next_buffer.image)); - } - - /* Capture a new next image */ - captureResult = camera->Capture(*(next_buffer.image)); - - if ( FirstCapture ) { - FirstCapture = 0; - return 0; - } - - } else { - /* Capture directly into image buffer, avoiding the need to memcpy() */ - captureResult = camera->Capture(*capture_image); - } + static int FirstCapture = 1; + int captureResult; + + int index = image_count%image_buffer_count; + Image* capture_image = image_buffer[index].image; + + if ( (deinterlacing & 0xff) == 4) { + if ( FirstCapture != 1 ) { + /* Copy the next image into the shared memory */ + capture_image->CopyBuffer(*(next_buffer.image)); + } + + /* Capture a new next image */ + captureResult = camera->Capture(*(next_buffer.image)); + + if ( FirstCapture ) { + FirstCapture = 0; + return 0; + } + + } else { + /* Capture directly into image buffer, avoiding the need to memcpy() */ + captureResult = camera->Capture(*capture_image); + } if ( captureResult != 0 ) { @@ -3044,18 +3044,18 @@ int Monitor::Capture() if ( captureResult == 1 ) { - /* Deinterlacing */ - if ( (deinterlacing & 0xff) == 1 ) { - capture_image->Deinterlace_Discard(); - } else if ( (deinterlacing & 0xff) == 2 ) { - capture_image->Deinterlace_Linear(); - } else if ( (deinterlacing & 0xff) == 3 ) { - capture_image->Deinterlace_Blend(); - } else if ( (deinterlacing & 0xff) == 4 ) { - capture_image->Deinterlace_4Field( next_buffer.image, (deinterlacing>>8)&0xff ); - } else if ( (deinterlacing & 0xff) == 5 ) { - capture_image->Deinterlace_Blend_CustomRatio( (deinterlacing>>8)&0xff ); - } + /* Deinterlacing */ + if ( (deinterlacing & 0xff) == 1 ) { + capture_image->Deinterlace_Discard(); + } else if ( (deinterlacing & 0xff) == 2 ) { + capture_image->Deinterlace_Linear(); + } else if ( (deinterlacing & 0xff) == 3 ) { + capture_image->Deinterlace_Blend(); + } else if ( (deinterlacing & 0xff) == 4 ) { + capture_image->Deinterlace_4Field( next_buffer.image, (deinterlacing>>8)&0xff ); + } else if ( (deinterlacing & 0xff) == 5 ) { + capture_image->Deinterlace_Blend_CustomRatio( (deinterlacing>>8)&0xff ); + } if ( orientation != ROTATE_0 ) From 658e130d339c5dd80bd9a63e6bb44e809e8d1c25 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 22 Dec 2015 09:44:46 -0500 Subject: [PATCH 16/17] sync up to c39 version --- web/api/app/Plugin/Crud | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/api/app/Plugin/Crud b/web/api/app/Plugin/Crud index e22c1563a..c3976f147 160000 --- a/web/api/app/Plugin/Crud +++ b/web/api/app/Plugin/Crud @@ -1 +1 @@ -Subproject commit e22c1563a51d86aac0d5054beee28b4afb60c802 +Subproject commit c3976f1478c681b0bbc132ec3a3e82c3984eeed5 From 6df14258973931ae86ea3fe6dddf8dcbd8b37115 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 22 Dec 2015 09:52:33 -0500 Subject: [PATCH 17/17] Slight update to allow the instantiation with no row or Id --- web/includes/Monitor.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/web/includes/Monitor.php b/web/includes/Monitor.php index 29f73d117..8aa7f4dc9 100644 --- a/web/includes/Monitor.php +++ b/web/includes/Monitor.php @@ -5,16 +5,19 @@ require_once( 'Server.php' ); class Monitor { public function __construct( $IdOrRow ) { $row = NULL; - if ( is_int( $IdOrRow ) ) { - $row = dbFetchOne( 'SELECT * FROM Monitors WHERE Id=?', NULL, array( $IdOrRow ) ); - } else if ( is_numeric( $IdOrRow ) ) { - $row = dbFetchOne( 'SELECT * FROM Monitors WHERE Id=?', NULL, array( $IdOrRow ) ); - } else if ( is_array($IdOrRow) ) { - $row = $IdOrRow; - } else { - Error("Unknown argument passed to Monitor Constructor ($IdOrRow)"); - return; - } + if ( $IdOrRow ) { + if ( is_integer( $IdOrRow ) or is_numeric( $IdOrRow ) ) { + $row = dbFetchOne( 'SELECT * FROM Monitors WHERE Id=?', NULL, array( $IdOrRow ) ); + if ( ! $row ) { + Error("Unable to load Server record for Id=" . $IdOrRow ); + } + } elseif ( is_array( $IdOrRow ) ) { + $row = $IdOrRow; + } else { + Error("Unknown argument passed to Monitor Constructor ($IdOrRow)"); + return; + } + } # end if isset($IdOrRow) if ( $row ) { foreach ($row as $k => $v) {