diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c5b79cce..8b60dc38c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ # cmake_minimum_required (VERSION 2.6) project (zoneminder) -set(zoneminder_VERSION "1.29.0") +set(zoneminder_VERSION "1.30.1") # make API version a minor of ZM version set(zoneminder_API_VERSION "${zoneminder_VERSION}.1") diff --git a/configure.ac b/configure.ac index b10dd44d5..d77cc81c0 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ # For instructions on building with cmake, please see INSTALL # AC_PREREQ(2.59) -AC_INIT(zm,1.29.0,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html) +AC_INIT(zm,1.30.1,[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_create.sql.in b/db/zm_create.sql.in index cfeadec77..e10490429 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -592,6 +592,7 @@ INSERT INTO `Controls` VALUES (NULL,'Foscam FI8918W','Ffmpeg','FI8918W',0,0,1,0, INSERT INTO `Controls` VALUES (NULL,'SunEyes SP-P1802SWPTZ','Libvlc','SPP1802SWPTZ',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,0,1,1,0,0,0,0,1,1,0,0,0,0,1,0,64,0,0,1,0,0,0,0,1,0,64,0,0,0,0); INSERT INTO `Controls` VALUES (NULL,'Wanscam HW0025','Libvlc','WanscamHW0025', 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 16, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 350, 0, 0, 1, 0, 10, 0, 0, 1, 0, 0, 0, 0, 1, 0, 10, 0, 0, 0, 0); INSERT INTO `Controls` VALUES (NULL,'IPCC 7210W','Libvlc','IPCC7210W', 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 16, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 350, 0, 0, 1, 0, 10, 0, 0, 1, 0, 0, 0, 0, 1, 0, 10, 0, 0, 0, 0); +INSERT INTO `Controls` VALUES (NULL,'Vivotek ePTZ','Remote','Vivotek_ePTZ',0,0,1,1,0,0,0,1,0,0,0,0,1,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,1,0,5,0,0,1,0,0,0,0,1,0,5,0,0,0,0); diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/Vivotek_ePTZ.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/Vivotek_ePTZ.pm new file mode 100644 index 000000000..3649b35bc --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/Vivotek_ePTZ.pm @@ -0,0 +1,227 @@ +# ========================================================================== +# +# ZoneMinder Vivotek ePTZ Control Protocol Module +# Copyright (C) 2015 Robin Daermann +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# 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 Vivotek ePTZ camera control +# protocol +# +package ZoneMinder::Control::Vivotek_ePTZ; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +# ========================================================================== +# +# Vivotek ePTZ 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 ); + Debug( "Camera New" ); + 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; + Debug( "Camera 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(); + Debug( "Camera open" ); + 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 $msg = shift; + my $msg_len = length($msg); + + Debug( $msg."[".$msg_len."]" ); +} + +sub sendCmd +{ + my ($self, $cmd, $speedcmd) = @_; + + my $result = undef; + + printMsg( $speedcmd, "Tx" ); + printMsg( $cmd, "Tx" ); + + my $req = HTTP::Request->new( GET => "http://" . $self->{Monitor}->{ControlAddress} . "/cgi-bin/camctrl/eCamCtrl.cgi?stream=0&$speedcmd&$cmd" ); + my $res = $self->{ua}->request($req); + + if ( $res->is_success ) + { + $result = !undef; + } + else + { + Error( "Request failed: '" . $res->status_line() . "' (URI: '" . $req->as_string() . "')" ); + } + + return( $result ); +} + +sub moveConUp +{ + my ($self, $params) = @_; + my $speed = 'speedtilt=' . ($params->{tiltspeed} - 6); + Debug( "Move Up" ); + $self->sendCmd( 'move=up', $speed ); +} + +sub moveConDown +{ + my ($self, $params) = @_; + my $speed = 'speedtilt=' . ($params->{tiltspeed} - 6); + Debug( "Move Down" ); + $self->sendCmd( 'move=down', $speed ); +} + +sub moveConLeft +{ + my ($self, $params) = @_; + my $speed = 'speedpan=-' . $params->{panspeed}; + Debug( "Move Left" ); + $self->sendCmd( 'move=left', $speed ); +} + +sub moveConRight +{ + my ($self, $params) = @_; + my $speed = 'speedpan=' . ($params->{panspeed} - 6); + Debug( "Move Right" ); + $self->sendCmd( 'move=right', $speed ); +} + +sub moveStop +{ + my $self = shift; + Debug( "Move Stop" ); + # not implemented +} + +sub zoomConTele +{ + my ($self, $params) = @_; + my $speed = 'speedzoom=' . ($params->{speed} - 6); + Debug( "Zoom In" ); + $self->sendCmd( 'zoom=tele', $speed ); +} + +sub zoomConWide +{ + my ($self, $params) = @_; + my $speed = 'speedzoom=' . ($params->{speed} - 6); + Debug( "Zoom Out" ); + $self->sendCmd( 'zoom=wide', $speed ); +} + +sub reset +{ + my $self = shift; + Debug( "Camera Reset" ); + $self->sendCmd( 'move=home' ); +} + +1; +__END__ + +=head1 NAME + +ZoneMinder::Control::Vivotek_ePTZ - ZoneMinder Perl extension for Vivotek ePTZ +camera control protocol + +=head1 SYNOPSIS + + use ZoneMinder::Control::Vivotek_ePTZ; + +=head1 DESCRIPTION + +This module implements the ePTZ protocol used in various Vivotek IP cameras, +developed with a Vivotek IB8369 model. + +Currently, only simple pan, tilt and zoom function is implemented. Presets will +follow later. + +=head2 EXPORT + +None. + +=head1 SEE ALSO + +I would say, see ZoneMinder::Control documentation. But it is a stub. + +=head1 AUTHOR + +Robin Daermann Er.daermann@ids-services.deE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2015 by Robin Daermann + +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 diff --git a/version b/version index 5e57fb895..7f3c3affd 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.29.0 +1.30.1