From 1ff907ae8040e34e2697a5933448ff20f813f216 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Fri, 27 Jun 2014 07:19:58 -0400 Subject: [PATCH 01/29] Reorganize the travis file. --- .travis.yml | 27 ++++----------------------- utils/travis/bootstrap-zm.sh | 29 +++++++++++++++++++++++++++++ utils/travis/build-zm.sh | 33 +++++++++++++++++++++++++++++++++ utils/travis/install-deps.sh | 20 ++++++++++++++++++++ utils/travis/install-ffmpeg.sh | 11 +++++++++++ 5 files changed, 97 insertions(+), 23 deletions(-) create mode 100644 utils/travis/bootstrap-zm.sh create mode 100644 utils/travis/build-zm.sh create mode 100644 utils/travis/install-deps.sh create mode 100644 utils/travis/install-ffmpeg.sh diff --git a/.travis.yml b/.travis.yml index 2fbe33bed..fc6b442ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,32 +17,13 @@ env: compiler: - gcc before_install: - - sudo apt-get update -qq - - sudo apt-get install -y -qq zlib1g-dev apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf cmake libjpeg-turbo8-dev apache2-mpm-prefork libapache2-mod-php5 php5-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev 2>&1 > /dev/null install: - - git clone --depth=10 --branch=master git://source.ffmpeg.org/ffmpeg.git - - cd ffmpeg - - ./configure --enable-shared --enable-swscale --enable-gpl --enable-libx264 --enable-libvpx --enable-libvorbis --enable-libtheora - - make -j `grep processor /proc/cpuinfo|wc -l` - - sudo make install - - sudo make install-libs + - travis_retry bash $TRAVIS_BUILD_DIR/utils/travis/install-deps.sh + - travis_wait bash $TRAVIS_BUILD_DIR/utils/travis/install-ffmpeg.sh before_script: - - cd $TRAVIS_BUILD_DIR - - if [ "$ZM_BUILDMETHOD" = "autotools" ]; then libtoolize --force; fi - - if [ "$ZM_BUILDMETHOD" = "autotools" ]; then aclocal; fi - - if [ "$ZM_BUILDMETHOD" = "autotools" ]; then autoheader; fi - - if [ "$ZM_BUILDMETHOD" = "autotools" ]; then automake --force-missing --add-missing; fi - - if [ "$ZM_BUILDMETHOD" = "autotools" ]; then autoconf; fi - - mysql -uroot -e "CREATE DATABASE IF NOT EXISTS zm" - - mysql -uroot -e "GRANT ALL ON zm.* TO 'zmuser'@'localhost' IDENTIFIED BY 'zmpass'"; - - mysql -uroot -e "FLUSH PRIVILEGES" + - bash $TRAVIS_BUILD_DIR/utils/travis/bootstrap-zm.sh script: - - if [ "$ZM_BUILDMETHOD" = "autotools" ]; then ./configure --prefix=/usr --with-libarch=lib/$DEB_HOST_GNU_TYPE --host=$DEB_HOST_GNU_TYPE --build=$DEB_BUILD_GNU_TYPE --with-mysql=/usr --with-ffmpeg=/usr --with-webdir=/usr/share/zoneminder/www --with-cgidir=/usr/libexec/zoneminder/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-crashtrace=yes --disable-debug --enable-mmap=yes ZM_SSL_LIB=openssl; fi - - if [ "$ZM_BUILDMETHOD" = "cmake" ]; then cmake -DCMAKE_INSTALL_PREFIX="/usr"; fi - - make - - sudo make install - - if [ "$ZM_BUILDMETHOD" = "cmake" ]; then sudo ./zmlinkcontent.sh; fi - - mysql -uzmuser -pzmpass < db/zm_create.sql + - bash $TRAVIS_BUILD_DIR/utils/travis/build-zm.sh - mysql -uzmuser -pzmpass zm < db/test.monitor.sql - sudo zmpkg.pl start - sudo zmfilter.pl -f purgewhenfull diff --git a/utils/travis/bootstrap-zm.sh b/utils/travis/bootstrap-zm.sh new file mode 100644 index 000000000..4bc487d20 --- /dev/null +++ b/utils/travis/bootstrap-zm.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +set -e +set -o pipefail + +with_timestamps() { + while read -r line; do + echo -e "$(date +%T)\t$line"; + done +} + +cd $TRAVIS_BUILD_DIR + +bootstrap_zm() { + + if [ "$ZM_BUILDMETHOD" = "autotools" ]; then libtoolize --force; fi + if [ "$ZM_BUILDMETHOD" = "autotools" ]; then aclocal; fi + if [ "$ZM_BUILDMETHOD" = "autotools" ]; then autoheader; fi + if [ "$ZM_BUILDMETHOD" = "autotools" ]; then automake --force-missing --add-missing; fi + if [ "$ZM_BUILDMETHOD" = "autotools" ]; then autoconf; fi + + mysql -uroot -e "CREATE DATABASE IF NOT EXISTS zm" + mysql -uroot -e "GRANT ALL ON zm.* TO 'zmuser'@'localhost' IDENTIFIED BY 'zmpass'"; + mysql -uroot -e "FLUSH PRIVILEGES" + mysql -uzmuser -pzmpass < db/zm_create.sql + +} + +bootstrap_zm | with_timestamps diff --git a/utils/travis/build-zm.sh b/utils/travis/build-zm.sh new file mode 100644 index 000000000..2d758f61b --- /dev/null +++ b/utils/travis/build-zm.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +set -e +set -o pipefail + +with_timestamps() { + while read -r line; do + echo -e "$(date +%T)\t$line"; + done +} + +cd $TRAVIS_BUILD_DIR + +build_zm() { + + if [ "$ZM_BUILDMETHOD" = "autotools" ]; then + ./configure --prefix=/usr --with-libarch=lib/$DEB_HOST_GNU_TYPE --host=$DEB_HOST_GNU_TYPE --build=$DEB_BUILD_GNU_TYPE --with-mysql=/usr --with-ffmpeg=/usr --with-webdir=/usr/share/zoneminder/www --with-cgidir=/usr/libexec/zoneminder/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-crashtrace=yes --disable-debug --enable-mmap=yes ZM_SSL_LIB=openssl + fi + + if [ "$ZM_BUILDMETHOD" = "cmake" ]; then + cmake -DCMAKE_INSTALL_PREFIX="/usr" + fi + + make + sudo make install + + if [ "$ZM_BUILDMETHOD" = "cmake" ]; then + sudo ./zmlinkcontent.sh + fi + +} + +build_zm | with_timestamps diff --git a/utils/travis/install-deps.sh b/utils/travis/install-deps.sh new file mode 100644 index 000000000..d7981cb5a --- /dev/null +++ b/utils/travis/install-deps.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -e +set -o pipefail + +with_timestamps() { + while read -r line; do + echo -e "$(date +%T)\t$line"; + done +} + + +install_deps() { + + sudo apt-get update -qq + sudo apt-get install -y -qq zlib1g-dev apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf cmake libjpeg-turbo8-dev apache2-mpm-prefork libapache2-mod-php5 php5-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev 2>&1 > /dev/null + +} + +install_deps | with_timestamps diff --git a/utils/travis/install-ffmpeg.sh b/utils/travis/install-ffmpeg.sh new file mode 100644 index 000000000..c2a2e9733 --- /dev/null +++ b/utils/travis/install-ffmpeg.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + + +git clone --depth=10 --branch=master git://source.ffmpeg.org/ffmpeg.git +cd ffmpeg +./configure --enable-shared --enable-swscale --enable-gpl --enable-libx264 --enable-libvpx --enable-libvorbis --enable-libtheora +make -j `grep processor /proc/cpuinfo|wc -l` +sudo make install +sudo make install-libs From 5d81f59e3a263123daf223c57f3c7cee72fa6b13 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Fri, 27 Jun 2014 08:00:49 -0400 Subject: [PATCH 02/29] Moved travis tests to their own script --- .travis.yml | 4 +--- utils/travis/run-tests.sh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 utils/travis/run-tests.sh diff --git a/.travis.yml b/.travis.yml index fc6b442ed..2e49a5871 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,4 @@ before_script: - bash $TRAVIS_BUILD_DIR/utils/travis/bootstrap-zm.sh script: - bash $TRAVIS_BUILD_DIR/utils/travis/build-zm.sh - - mysql -uzmuser -pzmpass zm < db/test.monitor.sql - - sudo zmpkg.pl start - - sudo zmfilter.pl -f purgewhenfull + - bash $TRAVIS_BUILD_DIR/utils/travis/run-tests.sh diff --git a/utils/travis/run-tests.sh b/utils/travis/run-tests.sh new file mode 100644 index 000000000..4dcc46e04 --- /dev/null +++ b/utils/travis/run-tests.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e +set -o pipefail + +with_timestamps() { + while read -r line; do + echo -e "$(date +%T)\t$line"; + done +} + +run_tests() { + mysql -uzmuser -pzmpass zm < db/test.monitor.sql + sudo zmpkg.pl start + sudo zmfilter.pl -f purgewhenfull +} + +run_tests | with_timestamps From 2e12a5fee7b65c38b5dc4477e5477ba073931387 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Fri, 27 Jun 2014 08:06:04 -0400 Subject: [PATCH 03/29] Fix path to test.monitor.sql in run_tests --- utils/travis/run-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/travis/run-tests.sh b/utils/travis/run-tests.sh index 4dcc46e04..0b4ca9e71 100644 --- a/utils/travis/run-tests.sh +++ b/utils/travis/run-tests.sh @@ -10,7 +10,7 @@ with_timestamps() { } run_tests() { - mysql -uzmuser -pzmpass zm < db/test.monitor.sql + mysql -uzmuser -pzmpass zm < ../../db/test.monitor.sql sudo zmpkg.pl start sudo zmfilter.pl -f purgewhenfull } From 158432a8cf8a13fd37585da6a03777cb0db1eb42 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Fri, 27 Jun 2014 08:23:53 -0400 Subject: [PATCH 04/29] First shot at testing an individual monitor --- utils/travis/run-tests.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/travis/run-tests.sh b/utils/travis/run-tests.sh index 0b4ca9e71..c3bb392d9 100644 --- a/utils/travis/run-tests.sh +++ b/utils/travis/run-tests.sh @@ -11,6 +11,11 @@ with_timestamps() { run_tests() { mysql -uzmuser -pzmpass zm < ../../db/test.monitor.sql + sudo zmu -l + sudo zmc -m1 & + sudo zma -m1 & + sudo zmu -l + sudo grep ERR /var/log/syslog sudo zmpkg.pl start sudo zmfilter.pl -f purgewhenfull } From 13f5bccb7c88ec28da70f0e2da24f9d1d2d18064 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Fri, 27 Jun 2014 08:34:15 -0400 Subject: [PATCH 05/29] Try to cd back to the build root --- utils/travis/bootstrap-zm.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/travis/bootstrap-zm.sh b/utils/travis/bootstrap-zm.sh index 4bc487d20..e3649ee0c 100644 --- a/utils/travis/bootstrap-zm.sh +++ b/utils/travis/bootstrap-zm.sh @@ -9,10 +9,11 @@ with_timestamps() { done } -cd $TRAVIS_BUILD_DIR bootstrap_zm() { + cd $TRAVIS_BUILD_DIR + if [ "$ZM_BUILDMETHOD" = "autotools" ]; then libtoolize --force; fi if [ "$ZM_BUILDMETHOD" = "autotools" ]; then aclocal; fi if [ "$ZM_BUILDMETHOD" = "autotools" ]; then autoheader; fi From 78c9ed2a7f3a4e174a1d661744653157b1d279f9 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Fri, 27 Jun 2014 14:08:57 -0400 Subject: [PATCH 06/29] Print out debug info in bootstrap-zm.sh --- utils/travis/bootstrap-zm.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/travis/bootstrap-zm.sh b/utils/travis/bootstrap-zm.sh index e3649ee0c..b01d1dfba 100644 --- a/utils/travis/bootstrap-zm.sh +++ b/utils/travis/bootstrap-zm.sh @@ -1,7 +1,8 @@ -#!/bin/bash +#!/bin/bash -x set -e set -o pipefail +set -x with_timestamps() { while read -r line; do From 4cb0d7b1cdbb1d9910417381403b6f099e493fdd Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Fri, 27 Jun 2014 14:13:29 -0400 Subject: [PATCH 07/29] Use full path to zm_create.sql in bootstrap-zm.sh --- utils/travis/bootstrap-zm.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/utils/travis/bootstrap-zm.sh b/utils/travis/bootstrap-zm.sh index b01d1dfba..397a8f90e 100644 --- a/utils/travis/bootstrap-zm.sh +++ b/utils/travis/bootstrap-zm.sh @@ -13,8 +13,6 @@ with_timestamps() { bootstrap_zm() { - cd $TRAVIS_BUILD_DIR - if [ "$ZM_BUILDMETHOD" = "autotools" ]; then libtoolize --force; fi if [ "$ZM_BUILDMETHOD" = "autotools" ]; then aclocal; fi if [ "$ZM_BUILDMETHOD" = "autotools" ]; then autoheader; fi @@ -24,7 +22,7 @@ bootstrap_zm() { mysql -uroot -e "CREATE DATABASE IF NOT EXISTS zm" mysql -uroot -e "GRANT ALL ON zm.* TO 'zmuser'@'localhost' IDENTIFIED BY 'zmpass'"; mysql -uroot -e "FLUSH PRIVILEGES" - mysql -uzmuser -pzmpass < db/zm_create.sql + mysql -uzmuser -pzmpass < ${TRAVIS_BUILD_DIR}/db/zm_create.sql } From 61ebb56424491e1e3b6f3ca0139a50637c2770b1 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 17 Oct 2014 09:26:59 -0400 Subject: [PATCH 08/29] add 1.28.0 release --- distros/ubuntu1204/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/distros/ubuntu1204/changelog b/distros/ubuntu1204/changelog index d74cb45a7..2884e449c 100644 --- a/distros/ubuntu1204/changelog +++ b/distros/ubuntu1204/changelog @@ -1,3 +1,9 @@ +zoneminder (1.28.0-trusty) trusty; urgency=medium + + * Release + + -- Isaac Connor Fri, 17 Oct 2014 09:25:55 -0400 + zoneminder (1.27.99+1-trusty-SNAPSHOT2014101401) trusty; urgency=medium * Several PR merges in big push for 1.28.0 From 4fd2230b1d9e0e5da4397a1406a09c072cb3545d Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 17 Oct 2014 09:27:54 -0400 Subject: [PATCH 09/29] add release 1.28.0 --- distros/debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/distros/debian/changelog b/distros/debian/changelog index dabe15106..9cfb96c74 100644 --- a/distros/debian/changelog +++ b/distros/debian/changelog @@ -1,3 +1,9 @@ +zoneminder (1.28.0-testing) testing; urgency=medium + + * Release + + -- Isaac Connor Fri, 17 Oct 2014 09:27:22 -0400 + zoneminder (1.27.99+1-testing-SNAPSHOT2014072901) testing; urgency=medium * improve error messages From 71b56a163da049b6a0c6d8c70f421ac60e8acadd Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sat, 18 Oct 2014 15:23:13 -0500 Subject: [PATCH 10/29] Zoneminder 1.28.0 Release --- CMakeLists.txt | 2 +- configure.ac | 2 +- db/zm_update-1.28.0.sql | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 db/zm_update-1.28.0.sql diff --git a/CMakeLists.txt b/CMakeLists.txt index 84733432e..d5608469f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ # cmake_minimum_required (VERSION 2.6) project (zoneminder) -set(zoneminder_VERSION "1.27.99.0") +set(zoneminder_VERSION "1.28.0") # CMake does not allow out-of-source build if CMakeCache.exists in the source folder. Abort and notify the user to save him from headache why it doesn't work. if((NOT (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)) AND (EXISTS "${CMAKE_SOURCE_DIR}/CMakeCache.txt")) diff --git a/configure.ac b/configure.ac index a45253ba5..efe61286d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.59) -AC_INIT(zm,1.27.99.0,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html) +AC_INIT(zm,1.28.0,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR(src/zm.h) AC_CONFIG_HEADERS(config.h) diff --git a/db/zm_update-1.28.0.sql b/db/zm_update-1.28.0.sql new file mode 100644 index 000000000..00255fab2 --- /dev/null +++ b/db/zm_update-1.28.0.sql @@ -0,0 +1,6 @@ +-- +-- This updates a 1.27.99 database to 1.28.0 +-- +-- No changes required +-- + From fcf39fc9fa85ee2fa8f216aa43e4c44ff9c14ee8 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sat, 18 Oct 2014 17:36:12 -0500 Subject: [PATCH 11/29] Update zoneminder.cmake.f20.spec Fix path to README file --- distros/fedora/zoneminder.cmake.f20.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distros/fedora/zoneminder.cmake.f20.spec b/distros/fedora/zoneminder.cmake.f20.spec index f25b9907a..5eea7150c 100644 --- a/distros/fedora/zoneminder.cmake.f20.spec +++ b/distros/fedora/zoneminder.cmake.f20.spec @@ -93,7 +93,7 @@ fi /usr/bin/gpasswd -a %{zmuid_final} dialout # Display the README for post installation instructions -/usr/bin/less %{_docdir}/%{name}-%{version}/README.Fedora +/usr/bin/less %{_docdir}/%{name}/README.Fedora %preun if [ $1 -eq 0 ] ; then From 7bb8422b00f9c12d3523f44c3a22674c3e792ef8 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sun, 19 Oct 2014 09:49:49 -0500 Subject: [PATCH 12/29] Add libvlc to Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 95b7e8f83..07a52a619 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ compiler: - gcc before_install: - sudo apt-get update -qq - - sudo apt-get install -y -qq libpolkit-gobject-1-dev zlib1g-dev apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf cmake libjpeg-turbo8-dev apache2-mpm-prefork libapache2-mod-php5 php5-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev 2>&1 > /dev/null + - sudo apt-get install -y -qq libpolkit-gobject-1-dev zlib1g-dev apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf cmake libjpeg-turbo8-dev apache2-mpm-prefork libapache2-mod-php5 php5-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev libvlccore-dev libvlc-dev libvlccore8 libvlc5 2>&1 > /dev/null install: - git clone -b n2.4.1 --depth=1 git://source.ffmpeg.org/ffmpeg.git - cd ffmpeg From bdef494ac3cc621daff41571760a06f49cc33b35 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sun, 19 Oct 2014 10:07:34 -0500 Subject: [PATCH 13/29] Use libvlccore7 instead of 8 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 07a52a619..ef9eeb262 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ compiler: - gcc before_install: - sudo apt-get update -qq - - sudo apt-get install -y -qq libpolkit-gobject-1-dev zlib1g-dev apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf cmake libjpeg-turbo8-dev apache2-mpm-prefork libapache2-mod-php5 php5-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev libvlccore-dev libvlc-dev libvlccore8 libvlc5 2>&1 > /dev/null + - sudo apt-get install -y -qq libpolkit-gobject-1-dev zlib1g-dev apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf cmake libjpeg-turbo8-dev apache2-mpm-prefork libapache2-mod-php5 php5-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev libvlccore-dev libvlc-dev libvlccore7 libvlc5 2>&1 > /dev/null install: - git clone -b n2.4.1 --depth=1 git://source.ffmpeg.org/ffmpeg.git - cd ffmpeg From 6a1db0f895d257ce9a2cb52d88d576b6127d25fe Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sun, 19 Oct 2014 10:11:17 -0500 Subject: [PATCH 14/29] Use libvlccore5 instead of 7 or 8 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ef9eeb262..913aaa44b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ compiler: - gcc before_install: - sudo apt-get update -qq - - sudo apt-get install -y -qq libpolkit-gobject-1-dev zlib1g-dev apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf cmake libjpeg-turbo8-dev apache2-mpm-prefork libapache2-mod-php5 php5-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev libvlccore-dev libvlc-dev libvlccore7 libvlc5 2>&1 > /dev/null + - sudo apt-get install -y -qq libpolkit-gobject-1-dev zlib1g-dev apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf cmake libjpeg-turbo8-dev apache2-mpm-prefork libapache2-mod-php5 php5-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev libvlccore-dev libvlc-dev libvlccore5 libvlc5 2>&1 > /dev/null install: - git clone -b n2.4.1 --depth=1 git://source.ffmpeg.org/ffmpeg.git - cd ffmpeg From 8d225566b1f9ca1921d9828159f412c0b663e3fd Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 20 Oct 2014 15:32:30 -0400 Subject: [PATCH 15/29] Move this line down to mitigate the problem where the console doesn't refresh. --- web/skins/classic/js/skin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/skins/classic/js/skin.js b/web/skins/classic/js/skin.js index f35cb7bb9..b09a646da 100644 --- a/web/skins/classic/js/skin.js +++ b/web/skins/classic/js/skin.js @@ -86,8 +86,6 @@ function checkSize() { } } -window.addEvent( 'domready', checkSize); - // Deprecated function newWindow( url, name, width, height ) { @@ -308,3 +306,5 @@ if ( focusWindow ) { windowToFront(); } +window.addEvent( 'domready', checkSize); + From c4394c3c927f1d6d64bbfb72d494386a816c3f39 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 20 Oct 2014 16:45:15 -0400 Subject: [PATCH 16/29] add liburi-encode-perl to dependencies, we use it in M8640, will likely use it elsewhere --- distros/ubuntu1204/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distros/ubuntu1204/control b/distros/ubuntu1204/control index b317cbb9e..7ad729070 100644 --- a/distros/ubuntu1204/control +++ b/distros/ubuntu1204/control @@ -7,7 +7,7 @@ Standards-Version: 3.9.2 Package: zoneminder Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53, libjpeg8, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0 +Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53, libjpeg8, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl Recommends: mysql-server|mariadb-server Description: A video camera security and surveillance solution ZoneMinder is intended for use in single or multi-camera video security From 9ce7da4147bf5d22f054c3f1c3754941b67e324f Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 20 Oct 2014 16:47:03 -0400 Subject: [PATCH 17/29] Don't 'use Data::Dumper'; it was only there for debug --- scripts/zmcontrol.pl.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/zmcontrol.pl.in b/scripts/zmcontrol.pl.in index e8c78ae84..dcfef5c87 100644 --- a/scripts/zmcontrol.pl.in +++ b/scripts/zmcontrol.pl.in @@ -32,7 +32,7 @@ use ZoneMinder; use Getopt::Long; use POSIX qw/strftime EPIPE/; use Socket; -use Data::Dumper; +#use Data::Dumper; use Module::Load; use constant MAX_CONNECT_DELAY => 10; From 5dedbc21352f56dac5d468427306337fda1bf099 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 20 Oct 2014 16:55:24 -0400 Subject: [PATCH 18/29] detect when the control address has a http in front, and do the right thing --- .../ZoneMinder/lib/ZoneMinder/Control/M8640.pm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm index 993ed7188..584e04dd1 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm @@ -38,8 +38,6 @@ require ZoneMinder::Control; our @ISA = qw(ZoneMinder::Control); -our $VERSION = $ZoneMinder::Base::VERSION; - # ========================================================================== # # Axis V2 Control Protocol @@ -52,8 +50,7 @@ use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); use URI::Encode qw(); -sub new -{ +sub new { my $class = shift; my $id = shift; my $self = ZoneMinder::Control->new( $id ); @@ -64,8 +61,7 @@ sub new our $AUTOLOAD; -sub AUTOLOAD -{ +sub AUTOLOAD { my $self = shift; my $class = ref($self) || croak( "$self not object" ); my $name = $AUTOLOAD; @@ -111,8 +107,14 @@ sub sendCmd { printMsg( $cmd, "Tx" ); #print( "http://$address/$cmd\n" ); #my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/$cmd" ); - my $url = 'http://'.$self->{Monitor}->{ControlAddress}.'/cgi-bin/setGPIO.cgi?preventCache='.time; - Debug("Url: $url $cmd"); + + my $url; + if ( $self->{Monitor}->{ControlAddress} =~ /^http/ ) { + $url = $self->{Monitor}->{ControlAddress}.'/cgi-bin/setGPIO.cgi?preventCache='.time; + } else { + $url = 'http://'.$self->{Monitor}->{ControlAddress}.'/cgi-bin/setGPIO.cgi?preventCache='.time; + } # en dif + Error("Url: $url $cmd"); my $uri = URI::Encode->new( { encode_reserved => 0 } ); my $encoded = $uri->encode( $cmd ); my $res = $self->{ua}->post( $url, Content=>"data=$encoded" ); From 607ce08613fbc7d0932fca31c1b2043bc98b555a Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Tue, 21 Oct 2014 07:20:53 -0500 Subject: [PATCH 19/29] Update version What is this file used for? --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index c61e20fa7..cfc730712 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.27.99.0 +1.28.0 From cbfe7a3e9e4508386d8e7e4004ac55ec55528335 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Tue, 21 Oct 2014 07:21:13 -0500 Subject: [PATCH 20/29] Update version What is this file used for? --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index c61e20fa7..cfc730712 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.27.99.0 +1.28.0 From ce5396f4eac523f6c047bc47a1109aa869c26f34 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 21 Oct 2014 09:47:31 -0400 Subject: [PATCH 21/29] replace uri_encode with uri_escape --- distros/ubuntu1204/control | 2 +- scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/distros/ubuntu1204/control b/distros/ubuntu1204/control index 7ad729070..8feb9bbb8 100644 --- a/distros/ubuntu1204/control +++ b/distros/ubuntu1204/control @@ -7,7 +7,7 @@ Standards-Version: 3.9.2 Package: zoneminder Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53, libjpeg8, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl +Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53, libjpeg8, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-escape-perl Recommends: mysql-server|mariadb-server Description: A video camera security and surveillance solution ZoneMinder is intended for use in single or multi-camera video security diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm index 584e04dd1..1c5f61f48 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm @@ -48,7 +48,7 @@ use ZoneMinder::Logger qw(:all); use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -use URI::Encode qw(); +use URI::Escape qw(uri_escape); sub new { my $class = shift; @@ -115,8 +115,7 @@ sub sendCmd { $url = 'http://'.$self->{Monitor}->{ControlAddress}.'/cgi-bin/setGPIO.cgi?preventCache='.time; } # en dif Error("Url: $url $cmd"); - my $uri = URI::Encode->new( { encode_reserved => 0 } ); - my $encoded = $uri->encode( $cmd ); + my $encoded = uri_escape( $cmd ); my $res = $self->{ua}->post( $url, Content=>"data=$encoded" ); if ( $res->is_success ) { From e23c756ca4d4da66a89f8edb737f3050e914da64 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 21 Oct 2014 15:17:34 -0400 Subject: [PATCH 22/29] Revert "replace uri_encode with uri_escape" This reverts commit ce5396f4eac523f6c047bc47a1109aa869c26f34. --- distros/ubuntu1204/control | 2 +- scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/distros/ubuntu1204/control b/distros/ubuntu1204/control index 8feb9bbb8..7ad729070 100644 --- a/distros/ubuntu1204/control +++ b/distros/ubuntu1204/control @@ -7,7 +7,7 @@ Standards-Version: 3.9.2 Package: zoneminder Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53, libjpeg8, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-escape-perl +Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53, libjpeg8, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl Recommends: mysql-server|mariadb-server Description: A video camera security and surveillance solution ZoneMinder is intended for use in single or multi-camera video security diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm index 1c5f61f48..584e04dd1 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/M8640.pm @@ -48,7 +48,7 @@ use ZoneMinder::Logger qw(:all); use ZoneMinder::Config qw(:all); use Time::HiRes qw( usleep ); -use URI::Escape qw(uri_escape); +use URI::Encode qw(); sub new { my $class = shift; @@ -115,7 +115,8 @@ sub sendCmd { $url = 'http://'.$self->{Monitor}->{ControlAddress}.'/cgi-bin/setGPIO.cgi?preventCache='.time; } # en dif Error("Url: $url $cmd"); - my $encoded = uri_escape( $cmd ); + my $uri = URI::Encode->new( { encode_reserved => 0 } ); + my $encoded = $uri->encode( $cmd ); my $res = $self->{ua}->post( $url, Content=>"data=$encoded" ); if ( $res->is_success ) { From 23ebbf3887d5555e16f070a9374e5911ed6d6ff3 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Tue, 21 Oct 2014 17:22:33 -0500 Subject: [PATCH 23/29] Update skin.js Move this line down to mitigate the problem where the console doesn't refresh. --- web/skins/flat/js/skin.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/skins/flat/js/skin.js b/web/skins/flat/js/skin.js index 3c141e106..d16cf8b86 100644 --- a/web/skins/flat/js/skin.js +++ b/web/skins/flat/js/skin.js @@ -86,8 +86,6 @@ function checkSize() { } } -window.addEvent( 'domready', checkSize); - // Deprecated function newWindow( url, name, width, height ) { @@ -308,3 +306,4 @@ if ( focusWindow ) { windowToFront(); } +window.addEvent( 'domready', checkSize); From 85529efffcf79181c15bcd8a25954edd4955328c Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 22 Oct 2014 10:31:23 -0400 Subject: [PATCH 24/29] check for existence of the columns beefore trying to add them --- db/zm_update-1.26.0.sql | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/db/zm_update-1.26.0.sql b/db/zm_update-1.26.0.sql index 28f8685ef..9986c029b 100644 --- a/db/zm_update-1.26.0.sql +++ b/db/zm_update-1.26.0.sql @@ -1,3 +1,27 @@ -ALTER TABLE `Monitors` ADD `Colours` TINYINT UNSIGNED NOT NULL DEFAULT '1' AFTER `Height`; -ALTER TABLE `Monitors` ADD `Deinterlacing` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `Orientation`; +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Monitors' + AND table_schema = DATABASE() + AND column_name = 'Colours' + ) > 0, +"SELECT 'Column Colours exists in Monitors'", +"ALTER TABLE `Monitors` ADD `Colours` TINYINT UNSIGNED NOT NULL DEFAULT '1' AFTER `Height`" +)); +PREPARE stmt FROM @s; +EXECUTE stmt; + +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Monitors' + AND table_schema = DATABASE() + AND column_name = 'Deinterlacing' + ) > 0, +"SELECT 'Column Deinterlacing exists in Monitors'", +"ALTER TABLE `Monitors` ADD `Deinterlacing` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `Orientation`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; From c5a1d9ffa95dfa581c39fcdf71385108a060d1c9 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 22 Oct 2014 10:58:06 -0400 Subject: [PATCH 25/29] fix console refresh in this skin too --- web/skins/flat/js/skin.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/skins/flat/js/skin.js b/web/skins/flat/js/skin.js index 3c141e106..46a98c3c2 100644 --- a/web/skins/flat/js/skin.js +++ b/web/skins/flat/js/skin.js @@ -86,7 +86,6 @@ function checkSize() { } } -window.addEvent( 'domready', checkSize); // Deprecated function newWindow( url, name, width, height ) @@ -308,3 +307,5 @@ if ( focusWindow ) { windowToFront(); } + +window.addEvent( 'domready', checkSize); From c9c6c176994d746553da65f515342f84cd2c86a2 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 22 Oct 2014 15:08:58 -0400 Subject: [PATCH 26/29] add script for TVIP862IC. Should also work with IP672 and others. --- .../lib/ZoneMinder/Control/TVIP862.pm | 504 ++++++++++++++++++ 1 file changed, 504 insertions(+) create mode 100644 scripts/ZoneMinder/lib/ZoneMinder/Control/TVIP862.pm diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/TVIP862.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/TVIP862.pm new file mode 100644 index 000000000..204652c17 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/TVIP862.pm @@ -0,0 +1,504 @@ +# ========================================================================= +# +# ZoneMinder Trendnet TV-IP862IC IP Control Protocol Module, $Date: $, $Revision: $ +# Copyright (C) 2014 Vincent Giovannone +# +# +# ========================================================================== +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# ========================================================================== +# +# This module contains the implementation of the Trendnet TV-IP672PI IP camera control +# protocol. Also works or TV-IP862IC +# +# +# +# For Zoneminder 1.26+ +# +# Under control capability: +# +# * Main: name it (suggest TVIP672PI), type is FFMPEG (or remote if you're using MJPEG), protocol is TVIP672PI +# * Main (more): Can wake, can sleep, can reset +# * Move: Can move, can move diagonally, can move mapped, can move relative +# * Pan: Can pan +# * Tilt: Can tilt +# * Presets: Has presets, num presets 20, has home preset (don't set presets via camera's web server, only set via ZM.) +# +# Under control tab in the monitor itself: +# +# * Controllable +# * Control type is the name you gave it in control capability above +# * Control device is the password you use to authenticate to the camera (see further below if you need to change the username from "admin") +# * Control address is the camera's ip address AND web port. example: 192.168.1.1:80 +# +# +# If using with anything but a TV-IP672PI (ex: TV-IP672WI), YOU MUST MATCH THE REALM TO MATCH YOUR CAMERA FURTHER DOWN! +# +# +# Due to how the TVIP672 represents presets internally, you MUST define the presets in order... i.e. 1,2,3,4... not 1,10,3,4. +# (see much further down for why, if you care...) +# + + +package ZoneMinder::Control::TVIP862; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +# +# ******** YOU MUST CHANGE THE FOLLOWING LINES TO MATCH YOUR CAMERA! ********** +# +# I assume that "TV-IP672WI" would work for the TV-IP672WI, but can't test since I don't own one. +# +# TV-IP672PI works for the PI version, of course. +# +# Finally, the username is the username you'd like to authenticate as. +# +our $REALM = "TV-IP862IC"; +our $USERNAME = "admin"; + + +# ========================================================================== +# +# Trendnet TV-IP672PI Control Protocol +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Config qw(:all); + +use Time::HiRes qw( usleep ); + +sub new +{ + my $class = shift; + my $id = shift; + my $self = ZoneMinder::Control->new( $id ); + bless( $self, $class ); + srand( time() ); + return $self; +} + +our $AUTOLOAD; + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + Fatal( "Can't access $name member of object of class $class" ); +} + +sub open +{ + my $self = shift; + + $self->loadMonitor(); + + use LWP::UserAgent; + $self->{ua} = LWP::UserAgent->new; + $self->{ua}->agent( "ZoneMinder Control Agent/".$ZoneMinder::Base::ZM_VERSION ); + $self->{state} = 'open'; +} + +sub close +{ + my $self = shift; + $self->{state} = 'closed'; +} + +sub printMsg +{ + my $self = shift; + my $msg = shift; + my $msg_len = length($msg); + + Debug( $msg."[".$msg_len."]" ); +} + +sub sendCmd +{ + +# This routine is used for all moving, which are all GET commands... + + my $self = shift; + my $cmd = shift; + + my $result = undef; + + Debug ( $cmd, "Tx" ); + + my $ua = LWP::UserAgent->new(); + + my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/cgi/ptdc.cgi?command=".$cmd ); + +# credentials: ("ip:port" (no prefix!), realm (string), username (string), password (string) + $self->{ua}->credentials($self->{Monitor}->{ControlAddress},$REALM,$USERNAME,$self->{Monitor}->{ControlDevice}); + + Debug ( "sendCmd credentials control address:'".$self->{Monitor}->{ControlAddress}."' realm:'" . $REALM . "' username:'" . $USERNAME . "' password:'".$self->{Monitor}->{ControlDevice}."'"); + + Debug ("sendCmd command: " . $cmd); + + my $res = $self->{ua}->request($req); + + if ( $res->is_success ) { + $result = !undef; + } else { + if ( $res->status_line() eq '401 Unauthorized' ) { + Error( "Error check failed, trying again: USERNAME: $USERNAME realm: $REALM password: " . $self->{Monitor}->{ControlDevice} ); + my $res = $self->{ua}->request($req); + if ( $res->is_success ) { + $result = !undef; + } + } + if ( ! $result ) { + Error( "Error check failed: '".$res->status_line()."' cmd:'".$cmd."'" ); + } + } + + return( $result ); +} + + + +sub sendCmdPost +{ + +# +# This routine is used for setting/clearing presets and IR commands, which are POST commands... +# + + my $self = shift; + my $url = shift; + my $cmd = shift; + + my $result = undef; + + + if ($url eq undef) + { + Error ("url passed to sendCmdPost is undefined."); + return(-1); + } + + Debug ("sendCmdPost url: " . $url . " cmd: " . $cmd); + + my $ua = LWP::UserAgent->new(); + + my $req = HTTP::Request->new(POST => "http://".$self->{Monitor}->{ControlAddress}.$url); + $req->content_type('application/x-www-form-urlencoded'); + $req->content($cmd); + + $self->{ua}->credentials($self->{Monitor}->{ControlAddress},$REALM,$USERNAME,$self->{Monitor}->{ControlDevice}); + + Debug ( "sendCmdPost credentials control address:'".$self->{Monitor}->{ControlAddress}."' realm:'" . $REALM . "' username:'" . $USERNAME . "' +password:'".$self->{Monitor}->{ControlDevice}."'"); + + my $res = $self->{ua}->request($req); + + if ( $res->is_success ) + { + $result = !undef; + } + else + { + Error( "Error check failed: USERNAME: $USERNAME realm: $REALM password: " . $self->{Monitor}->{ControlDevice} ); + Error( "Error check failed: '".$res->status_line()."' cmd:'".$cmd."'" ); + if ( $res->status_line() eq '401 Unauthorized' ) { + Error( "Error check failed: USERNAME: $USERNAME realm: $REALM password: " . $self->{Monitor}->{ControlDevice} ); + } else { + Error( "Error check failed: USERNAME: $USERNAME realm: $REALM password: " . $self->{Monitor}->{ControlDevice} ); + } # endif + } + + return( $result ); +} + + + +sub move +{ + my $self = shift; + my $panSteps = shift; + my $tiltSteps = shift; + + my $cmd = "set_relative_pos&posX=$panSteps&posY=$tiltSteps"; + $self->sendCmd( $cmd ); +} + +sub moveRelUpLeft +{ + my $self = shift; + Debug( "Move Up Left" ); + $self->move(-3, 3); +} + +sub moveRelUp +{ + my $self = shift; + Debug( "Move Up" ); + $self->move(0, 3); +} + +sub moveRelUpRight +{ + my $self = shift; + Debug( "Move Up Right" ); + $self->move(3, 3); +} + +sub moveRelLeft +{ + my $self = shift; + Debug( "Move Left" ); + $self->move(-3, 0); +} + +sub moveRelRight +{ + my $self = shift; + Debug( "Move Right" ); + $self->move(3, 0); +} + +sub moveRelDownLeft +{ + my $self = shift; + Debug( "Move Down Left" ); + $self->move(-3, -3); +} + +sub moveRelDown +{ + my $self = shift; + Debug( "Move Down" ); + $self->move(0, -3); +} + +sub moveRelDownRight +{ + my $self = shift; + Debug( "Move Down Right" ); + $self->move(3, -3); +} + + +# moves the camera to center on the point that the user clicked on in the video image. +# This isn't mega accurate but good enough for most purposes + +sub moveMap +{ + + # If the camera moves too much, increase hscale and vscale. (...if it doesn't move enough, try decreasing!) + # They scale the movement and are here to compensate for manufacturing variation. + # It's never going to be perfect, so just get somewhere in the ballpark and call it a day. + # (Don't forget to kill the zmcontrol process while tweaking!) + + # 1280x800 + my $hscale = 31; + my $vscale = 25; + + # 1280x800 with fisheye + #my $hscale = 15; + #my $vscale = 15; + + # 640x400 + #my $hscale = 14; + #my $vscale = 12; + + + my $self = shift; + my $params = shift; + my $xcoord = $self->getParam( $params, 'xcoord' ); + my $ycoord = $self->getParam( $params, 'ycoord' ); + + my $hor = ($xcoord - ($self->{Monitor}->{Width} / 2))/$hscale; + my $ver = ($ycoord - ($self->{Monitor}->{Height} / 2))/$vscale; + + $hor = int($hor); + $ver = -1 * int($ver); + + Debug( "Move Map to $xcoord,$ycoord, hor=$hor, ver=$ver" ); + $self->move( $hor, $ver ); +} + + +# **** PRESETS **** +# +# OK, presets work a little funky but they DO work, provided you define them in order and don't skip any. +# +# The problem is that when you load the web page for this camera, it gives a list of preset names tied to index numbers. +# So let's say you have four presets... A, B, C, and D, and defined them in that order. +# So A is index 0, B is index 1, C is index 2, D is index 3. When you tell the camera to go to a preset, you actually tell it by number, not by name. +# (So "Go to D" is really "go to index 3".) +# +# Now let's say somebody deletes C via the camera's web GUI. The camera re-numbers the existing presets A=0, B=1, D=2. +# There's really no easy way for ZM to discover this re-numbering, so zoneminder would still send "go to preset 3" thinking +# it's telling the camera to go to point D. In actuality it's telling the camera to go to a preset that no longer exists. +# +# As long as you define your presets in order (i.e. define preset 1, then preset 2, then preset 3, etc.) everything will work just +# fine in ZoneMinder. +# +# (Home preset needs to be set via the camera's web gui, and is unaffected by any of this.) +# +# So that's the limitation: DEFINE YOUR PRESETS IN ORDER THROUGH (and only through!) ZM AND DON'T SKIP ANY. +# + + +sub presetClear +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + my $cmd = "presetName=$preset&command=del"; + my $url = "/eng/admin/cam_control.cgi"; + Debug ("presetClear: " . $preset . " cmd: " . $cmd); + $self->sendCmdPost($url,$cmd); +} + + +sub presetSet +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + my $cmd = "presetName=$preset&command=add"; + my $url = "/eng/admin/cam_control.cgi"; + Debug ("presetSet " . $preset . " cmd: " . $cmd); + $self->sendCmdPost ($url,$cmd); +} + +sub presetGoto +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + $preset = $preset - 1; + Debug( "Goto Preset $preset" ); + my $cmd = "goto_preset_position&index=$preset"; + $self->sendCmd( $cmd ); +} + +sub presetHome +{ + my $self = shift; + Debug( "Home Preset" ); + my $cmd = "go_home"; + $self->sendCmd( $cmd ); +} + + +# +# **** IR CONTROLS **** +# +# +# Wake: Force IR on, always. (always night mode) +# +# Sleep: Force IR off, always. (always day mode) +# +# Reset: Automatic IR mode. (day/night mode determined by camera) +# + + +sub wake +{ + # force IR on ("always night mode") + + my $self = shift; + my $url = "/eng/admin/adv_audiovideo.cgi"; + my $cmd = "irMode=3"; + + Debug("Wake -- IR on"); + + $self->sendCmdPost ($url,$cmd); +} + +sub sleep +{ + # force IR off ("always day mode") + + my $self=shift; + my $url = "/eng/admin/adv_audiovideo.cgi"; + my $cmd = "irMode=2"; + + Debug("Sleep -- IR off"); + + $self->sendCmdPost ($url,$cmd); +} + +sub reset +{ + # IR auto + + my $self=shift; + my $url = "/eng/admin/adv_audiovideo.cgi"; + my $cmd = "irMode=0"; + + Debug("Reset -- IR auto"); + + $self->sendCmdPost ($url,$cmd); +} + + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for Trendnet TVIP672 + +=head1 SYNOPSIS + + use ZoneMinder::Database; + stuff this in /usr/share/perl5/ZoneMinder/Control , then eat a sandwich + +=head1 DESCRIPTION + +Stub documentation for Trendnet TVIP672, created by Vince. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Read the comments at the beginning of this file to see the usage for zoneminder 1.25.0 + + +=head1 AUTHOR + +Vincent Giovannone, I'd rather you not email me. + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2014 by Vincent Giovannone + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut From 838eb64537784a7ff0272ecb8344ea1e41838aef Mon Sep 17 00:00:00 2001 From: SteveGilvarry Date: Thu, 23 Oct 2014 20:22:09 +1100 Subject: [PATCH 27/29] Update Travis to ffmpeg 2.4.2 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 95b7e8f83..434989ed0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ before_install: - sudo apt-get update -qq - sudo apt-get install -y -qq libpolkit-gobject-1-dev zlib1g-dev apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf cmake libjpeg-turbo8-dev apache2-mpm-prefork libapache2-mod-php5 php5-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev 2>&1 > /dev/null install: - - git clone -b n2.4.1 --depth=1 git://source.ffmpeg.org/ffmpeg.git + - git clone -b n2.4.2 --depth=1 git://source.ffmpeg.org/ffmpeg.git - cd ffmpeg - ./configure --enable-shared --enable-swscale --enable-gpl --enable-libx264 --enable-libvpx --enable-libvorbis --enable-libtheora - make -j `grep processor /proc/cpuinfo|wc -l` From 57e5b4fee83d13e715a30016ec0228b182a8bf19 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 23 Oct 2014 09:00:53 -0400 Subject: [PATCH 28/29] Fix segfault on zmu -l due to not connectig to the shared mem --- src/zmu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zmu.cpp b/src/zmu.cpp index cbde682fc..bc032639f 100644 --- a/src/zmu.cpp +++ b/src/zmu.cpp @@ -715,7 +715,7 @@ int main( int argc, char *argv[] ) if ( function > 1 ) { Monitor *monitor = Monitor::Load( mon_id, false, Monitor::QUERY ); - if ( monitor ) + if ( monitor && monitor->connect() ) { struct timeval tv = monitor->GetTimestamp(); printf( "%4d%5d%6d%9d%11ld.%02ld%6d%6d%8d%8.2f\n", From 39ac8c8b3490833512853461c9473772a79a81f6 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Fri, 31 Oct 2014 12:31:40 -0400 Subject: [PATCH 29/29] git ignore files created during bootstrap, configure and make. --- .gitignore | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/.gitignore b/.gitignore index 070bbc3d8..ec021d210 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,52 @@ scripts/ZoneMinder/blib Makefile.in Makefile docs/_build + +config.guess +config.h +config.log +config.status +config.sub +db/zm_create.sql +misc/apache.conf +misc/com.zoneminder.systemctl.policy +misc/com.zoneminder.systemctl.rules +misc/logrotate.conf +misc/syslog.conf +scripts/ZoneMinder/MYMETA.yml +scripts/ZoneMinder/lib/ZoneMinder/Base.pm +scripts/ZoneMinder/lib/ZoneMinder/Config.pm +scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm +scripts/ZoneMinder/lib/ZoneMinder/Memory.pm +scripts/ZoneMinder/pm_to_blib +scripts/zm +scripts/zmaudit.pl +scripts/zmcamtool.pl +scripts/zmcontrol.pl +scripts/zmdbbackup +scripts/zmdbrestore +scripts/zmdc.pl +scripts/zmeventdump +scripts/zmfilter.pl +scripts/zmlogrotate.conf +scripts/zmpkg.pl +scripts/zmsystemctl.pl +scripts/zmtrack.pl +scripts/zmtrigger.pl +scripts/zmupdate.pl +scripts/zmvideo.pl +scripts/zmwatch.pl +scripts/zmx10.pl +src/.deps/ +src/*.o +src/zm_config.h +src/zm_config_defines.h +src/zma +src/zmc +src/zmf +src/zms +src/zmstreamer +src/zmu +web/includes/config.php +zm.conf +zmconfgen.pl