Merge branch 'iconnor_video' of github.com:ZoneMinder/ZoneMinder into iconnor_video

This commit is contained in:
Isaac Connor 2016-04-05 12:31:07 -04:00
commit bd5ca575ed
110 changed files with 489 additions and 5780 deletions

1
.gitignore vendored
View File

@ -63,7 +63,6 @@ src/zma
src/zmc src/zmc
src/zmf src/zmf
src/zms src/zms
src/zmstreamer
src/zmu src/zmu
web/includes/config.php web/includes/config.php
zm.conf zm.conf

View File

@ -1,4 +1,6 @@
language: cpp language: cpp
sudo: required
dist: trusty
notifications: notifications:
irc: "chat.freenode.net#zoneminder-dev" irc: "chat.freenode.net#zoneminder-dev"
branches: branches:
@ -17,14 +19,14 @@ env:
- CXXFLAGS="$CFLAGS" - CXXFLAGS="$CFLAGS"
matrix: matrix:
- ZM_BUILDMETHOD=cmake - ZM_BUILDMETHOD=cmake
- ZM_BUILDMETHOD=autotools
compiler: compiler:
- gcc - gcc
- clang
before_install: before_install:
- sudo apt-get update -qq - 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 libvlccore5 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 2>&1 > /dev/null
install: install:
- git clone -b n2.8.1 --depth=1 git://source.ffmpeg.org/ffmpeg.git - git clone -b n3.0 --depth=1 git://source.ffmpeg.org/ffmpeg.git
- cd ffmpeg - cd ffmpeg
- ./configure --enable-shared --enable-swscale --enable-gpl --enable-libx264 --enable-libvpx --enable-libvorbis --enable-libtheora - ./configure --enable-shared --enable-swscale --enable-gpl --enable-libx264 --enable-libvpx --enable-libvorbis --enable-libtheora
- make -j `grep processor /proc/cpuinfo|wc -l` - make -j `grep processor /proc/cpuinfo|wc -l`
@ -32,16 +34,10 @@ install:
- sudo make install-libs - sudo make install-libs
before_script: before_script:
- cd $TRAVIS_BUILD_DIR - cd $TRAVIS_BUILD_DIR
- if [ "$ZM_BUILDMETHOD" = "autotools" ]; then libtoolize -v --force; fi
- if [ "$ZM_BUILDMETHOD" = "autotools" ]; then aclocal -I m4; 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 "CREATE DATABASE IF NOT EXISTS zm"
- mysql -uroot -e "GRANT ALL ON zm.* TO 'zmuser'@'localhost' IDENTIFIED BY 'zmpass'"; - mysql -uroot -e "GRANT ALL ON zm.* TO 'zmuser'@'localhost' IDENTIFIED BY 'zmpass'";
- mysql -uroot -e "FLUSH PRIVILEGES" - mysql -uroot -e "FLUSH PRIVILEGES"
script: 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 - if [ "$ZM_BUILDMETHOD" = "cmake" ]; then cmake -DCMAKE_INSTALL_PREFIX="/usr"; fi
- make - make
- sudo make install - sudo make install

View File

@ -1,40 +0,0 @@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
# And these to the user and group of your webserver
webuser = @WEB_USER@
webgroup = @WEB_GROUP@
zmconfigdir = @ZM_CONFIG_DIR@
zmconfig_DATA = \
zm.conf
if COND_ONVIF
MAYBE_ONVIF = onvif
endif
SUBDIRS = \
src \
web \
scripts \
db \
misc \
$(MAYBE_ONVIF)
EXTRA_DIST = \
zm.conf.in \
zmconfgen.pl.in
# Yes, you are correct. This is a HACK!
install-data-hook:
( cd $(DESTDIR)$(zmconfigdir); chown $(webuser):$(webgroup) $(zmconfig_DATA); chmod 600 $(zmconfig_DATA) )
( if ! test -e $(DESTDIR)$(ZM_RUNDIR); then mkdir -p $(DESTDIR)$(ZM_RUNDIR); fi; if test "$(DESTDIR)$(ZM_RUNDIR)" != "/var/run"; then chown $(webuser):$(webgroup) $(DESTDIR)$(ZM_RUNDIR); chmod u+w $(DESTDIR)$(ZM_RUNDIR); fi )
( if ! test -e $(DESTDIR)$(ZM_SOCKDIR); then mkdir -p $(DESTDIR)$(ZM_SOCKDIR); fi; if test "$(DESTDIR)$(ZM_SOCKDIR)" != "/var/run"; then chown $(webuser):$(webgroup) $(DESTDIR)$(ZM_SOCKDIR); chmod u+w $(DESTDIR)$(ZM_SOCKDIR); fi )
( if ! test -e $(DESTDIR)$(ZM_TMPDIR); then mkdir -m 700 -p $(DESTDIR)$(ZM_TMPDIR); fi; if test "$(DESTDIR)$(ZM_TMPDIR)" != "/tmp" && test "$(DESTDIR)$(ZM_TMPDIR)" != "/var/tmp"; then chown $(webuser):$(webgroup) $(DESTDIR)$(ZM_TMPDIR); chmod u+w $(DESTDIR)$(ZM_TMPDIR); fi )
uninstall-hook:
@-( cd $(DESTDIR)$(webdir); rm -rf events graphics images sounds temp )
@-( if test "$(DESTDIR)$(ZM_RUNDIR)" != "/var/run"; then rm -rf $(DESTDIR)$(ZM_RUNDIR); fi )
@-( if test "$(DESTDIR)$(ZM_SOCKDIR)" != "/var/run"; then rm -rf $(DESTDIR)$(ZM_SOCKDIR); fi )
@-( if test "$(DESTDIR)$(ZM_TMPDIR)" != "/tmp" && test "$(DESTDIR)$(ZM_TMPDIR)" != "/var/tmp"; then rm -rf $(DESTDIR)$(ZM_TMPDIR); fi )
@-( if test "$(DESTDIR)$(ZM_LOGDIR)" != "/var/log"; then rm -rf $(DESTDIR)$(ZM_LOGDIR); fi )

View File

@ -1,74 +0,0 @@
AC_DEFUN([AC_DEFINE_DIR], [
prefix_NONE=
exec_prefix_NONE=
test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
dnl refers to ${prefix}. Thus we have to use `eval' twice.
eval ac_define_dir="\"[$]$2\""
eval ac_define_dir="\"$ac_define_dir\""
AC_SUBST($1, "$ac_define_dir")
AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3])
test "$prefix_NONE" && prefix=NONE
test "$exec_prefix_NONE" && exec_prefix=NONE
])
AC_DEFUN([AC_PROG_PERL_VERSION],[dnl
# Make sure we have perl
if test -z "$PERL"; then
AC_CHECK_PROG(PERL,perl,perl)
fi
# Check if version of Perl is sufficient
ac_perl_version="$1"
if test "x$PERL" != "x"; then
AC_MSG_CHECKING(for perl version greater than or equal to $ac_perl_version)
# NB: It would be nice to log the error if there is one, but we cannot rely
# on autoconf internals
$PERL -e "use $ac_perl_version;" > /dev/null 2>&1
if test $? -ne 0; then
AC_MSG_RESULT(no);
$3
else
AC_MSG_RESULT(ok);
$2
fi
else
AC_MSG_WARN(could not find perl)
fi
])dnl
AC_DEFUN([AC_PROG_PERL_MODULES],[dnl
ac_perl_modules="$1"
# Make sure we have perl
if test -z "$PERL"; then
AC_CHECK_PROG(PERL,perl,perl)
fi
if test "x$PERL" != x; then
ac_perl_modules_failed=0
for ac_perl_module in $ac_perl_modules; do
AC_MSG_CHECKING(for perl module $ac_perl_module)
# Would be nice to log result here, but can't rely on autoconf internals
$PERL "-M$ac_perl_module" -e exit > /dev/null 2>&1
if test $? -ne 0; then
AC_MSG_RESULT(no);
ac_perl_modules_failed=1
else
AC_MSG_RESULT(ok);
fi
done
# Run optional shell commands
if test "$ac_perl_modules_failed" = 0; then
:
$2
else
:
$3
fi
else
AC_MSG_WARN(could not find perl)
fi])dnl

View File

@ -1,5 +0,0 @@
#!/bin/bash
aclocal -I m4
autoheader
automake --add-missing
autoconf

View File

@ -1,512 +0,0 @@
#
# Building ZoneMinder via Autotools will be depreciated soon
# For instructions on building with cmake, please see INSTALL
#
AC_PREREQ(2.59)
AC_INIT(zm,1.30.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)
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST([AM_CXXFLAGS], [-D__STDC_CONSTANT_MACROS])
AC_SUBST(VERSION)
#
# Platform specific setup
#
#############################
AC_CANONICAL_HOST
# Check for which host we are on and setup a few things
# specifically based on the host
case $host_os in
darwin* )
# Do something specific for mac
HOST_OS='darwin'
;;
linux*)
# Do something specific for linux
HOST_OS='linux'
;;
*BSD*)
# Do something specific for BSD
HOST_OS='BSD'
AC_DEFINE(BSD,1,"This is a BSD system")
;;
*bsd*)
# Do something specific for BSD
HOST_OS='BSD'
AC_DEFINE(BSD,1,"This is a BSD system")
;;
*solaris*)
# Do something specific for Solaris
HOST_OS='solaris'
AC_DEFINE(SOLARIS,1,"We are running a Solaroid OS [tested on OmniOS]")
;;
*)
#Default Case
AC_MSG_ERROR([Your platform is not currently supported])
;;
esac
AC_SUBST(HOST_OS)
AC_ARG_VAR(ZM_DB_TYPE,[Type of the ZoneMinder database, default mysql])
AC_ARG_VAR(ZM_DB_HOST,[Hostname where ZoneMinder database located, default localhost])
AC_ARG_VAR(ZM_DB_NAME,[Name of ZoneMinder database, default zm])
AC_ARG_VAR(ZM_DB_USER,[Name of ZoneMinder database user, default zmuser])
AC_ARG_VAR(ZM_DB_PASS,[Password of ZoneMinder database user, default zmpass])
AC_ARG_VAR(ZM_SSL_LIB,[Library to use for ssl functions, default gnutls])
AC_ARG_VAR(ZM_MYSQL_ENGINE,[MySQL engine to use with database, default InnoDB])
AC_ARG_VAR(ZM_RUNDIR,[Location of transient process files, default /var/run/zm])
AC_ARG_VAR(ZM_SOCKDIR,[Location of Unix domain socket files, default /var/run/zm])
AC_ARG_VAR(ZM_TMPDIR,[Location of temporary files, default /var/tmp/zm])
AC_ARG_VAR(ZM_LOGDIR,[Location of generated log files, default /var/log/zm])
AC_ARG_VAR(ZM_CONFIG_DIR,[Location of ZoneMinder configuration, default system config directory])
if test "$ZM_DB_TYPE" == ""; then
AC_SUBST(ZM_DB_TYPE,[mysql])
fi
if test "$ZM_DB_HOST" == ""; then
AC_SUBST(ZM_DB_HOST,[localhost])
fi
if test "$ZM_DB_NAME" == ""; then
AC_SUBST(ZM_DB_NAME,[zm])
fi
if test "$ZM_DB_USER" == ""; then
AC_SUBST(ZM_DB_USER,[zmuser])
fi
if test "$ZM_DB_PASS" == ""; then
AC_SUBST(ZM_DB_PASS,[zmpass])
fi
if test "$ZM_SSL_LIB" == ""; then
AC_SUBST(ZM_SSL_LIB,gnutls)
fi
if test "$ZM_MYSQL_ENGINE" == ""; then
AC_SUBST(ZM_MYSQL_ENGINE,InnoDB)
fi
if test "$ZM_RUNDIR" == ""; then
AC_SUBST(ZM_RUNDIR,[/var/run/zm])
fi
if test "$ZM_SOCKDIR" == ""; then
AC_SUBST(ZM_SOCKDIR,[/var/run/zm])
fi
if test "$ZM_TMPDIR" == ""; then
AC_SUBST(ZM_TMPDIR,[/tmp/zm])
fi
if test "$ZM_LOGDIR" == ""; then
AC_SUBST(ZM_LOGDIR,[/var/log/zm])
fi
AC_DEFINE_DIR([SYSCONFDIR],[sysconfdir],[Expanded configuration directory])
if test "$ZM_CONFIG_DIR" == ""; then
AC_SUBST(ZM_CONFIG_DIR,[$SYSCONFDIR])
fi
LIB_ARCH=lib
AC_ARG_WITH(libarch,
[ --with-libarch=<lib> architecture library path to use, default lib],
[LIB_ARCH=$with_libarch],
AC_MSG_WARN([You can call configure with the --with-libarch option.
This tells configure where to find architecture specific libraries.
The default of 'lib' is usually ok but 64 bit machines may require lib64.
e.g. --with-libarch=lib or --with-libarch=lib64])
)
AC_SUBST(LIB_ARCH)
LDFLAGS="-L/usr/lib/${build_alias} ${LDFLAGS}"
MYSQL_PREFIX=/usr
AC_ARG_WITH(mysql,
[ --with-mysql=<path> prefix of MySQL installation, default /usr],
[MYSQL_PREFIX=$with_mysql],
AC_MSG_WARN([You can call configure with the --with-mysql option.
This tells configure where to find the MySql C library and headers if configure cannot
locate them automatically.
e.g. --with-mysql=/usr/local or --with-mysql=/usr])
)
AC_SUBST(MYSQL_PREFIX)
MYSQL_LIBS="-L${MYSQL_PREFIX}/${LIB_ARCH}/mysql"
MYSQL_CFLAGS="-I${MYSQL_PREFIX}/include"
AC_SUBST(MYSQL_LIBS)
AC_SUBST(MYSQL_CFLAGS)
LDFLAGS="$LDFLAGS ${MYSQL_LIBS}"
MARIADB_PREFIX=/usr
AC_ARG_WITH(mariadb,
[ --with-mariadb=<path> prefix of MariaDB installation, default /usr],
[MYSQL_PREFIX=$with_mariadb],
AC_MSG_WARN([You can call configure with the --with-mariadb option.
This tells configure where to find the mariaDB C library and headers if configure cannot
locate them automatically.
e.g. --with-mariadb=/usr/local or --with-mariadb=/usr])
)
AC_SUBST(MARIADB_PREFIX)
MARIADB_LIBS="-L${MARIADB_PREFIX}/${LIB_ARCH}/mariadb"
MARIADB_CFLAGS="-I${MARIADB_PREFIX}/include"
AC_SUBST(MARIADB_LIBS)
AC_SUBST(MARIADB_CFLAGS)
LDFLAGS="$LDFLAGS ${MARIADB_LIBS}"
POLKIT_PREFIX=/usr
AC_ARG_WITH(polkit,
[ --with-polkit=<path> prefix of polkit root directory, default /usr],
[POLKIT_PREFIX=$with_polkit],
AC_MSG_WARN([You can call configure with the --with-polkit option.
This tells configure where to place the polkit policy files.])
)
AC_SUBST(POLKIT_PREFIX)
PKG_CHECK_MODULES(POLKIT, polkit-gobject-1)
FFMPEG_PREFIX=/usr
AC_ARG_WITH(ffmpeg,
[ --with-ffmpeg=<path> prefix of ffmpeg root directory for libavcodec etc, default /usr],
[FFMPEG_PREFIX=$with_ffmpeg],
AC_MSG_WARN([You can call configure with the --with-ffmpeg option.
This tells configure where to find the ffmpeg root directory within which are the libavcodec
and libavformat files that can be used to build true MPEG streaming into ZoneMinder. Ensure that
your copy of ffmpeg has installed libraries as well as binaries (use 'make installlib'). If you
are using a local install of ffmpeg you may have to remove or rename a previous real installation
as the headers and libraries from that will probably be picked up before your local copy.
e.g. --with-ffmpeg=/usr/local])
)
AC_SUBST(FFMPEG_PREFIX)
FFMPEG_LIBS="-L${FFMPEG_PREFIX}/${LIB_ARCH}"
FFMPEG_CFLAGS="-I${FFMPEG_PREFIX}/include -D__STDC_CONSTANT_MACROS"
AC_SUBST(FFMPEG_LIBS)
AC_SUBST(FFMPEG_CFLAGS)
LDFLAGS="${FFMPEG_LIBS} $LDFLAGS"
CFLAGS="${FFMPEG_CFLAGS} $CFLAGS"
CPPFLAGS="${FFMPEG_CFLAGS} $CPPFLAGS"
EXTRA_LIBS=
AC_ARG_WITH(extralibs,
[ --with-extralibs="<libs>" string containing extra libraries to pass to link, default empty],
[EXTRA_LIBS=$with_extralibs],
AC_MSG_WARN([You can call configure with the --with-extralibs option.
Ordinarily you will need to use this option only when your copy of ffmpeg has been built
with support for additional formats and you would use this option to detail which additional
libraries ffmpeg was built with so that it is able to link successfully with ZoneMinder.
You will need to wrap this option in quotes if it contains any spaces.
e.g. --with-extralibs="-lmp3lame"])
)
AC_SUBST(EXTRA_LIBS)
LDFLAGS="$LDFLAGS ${EXTRA_LIBS}"
AC_ARG_WITH(webdir,
[ --with-webdir=<path> prefix of web directory],
[WEB_PREFIX=$with_webdir],
AC_MSG_ERROR([You must call configure with the --with-webdir option.
This tells configure where to install PHP and web files and scripts.
e.g. --with-webdir=/var/www/html or --with-webdir=/www/vhtdocs/<site>])
)
AC_SUBST(WEB_PREFIX)
AC_ARG_WITH(cgidir,
[ --with-cgidir=<path> prefix of cgi directory],
[CGI_PREFIX=$with_cgidir],
AC_MSG_ERROR([You must call configure with the --with-cgidir option.
This tells configure where to install cgi files and scripts.
e.g. --with-cgidir=/var/www/cgi-bin or --with-webdir=/www/vhtdocs/<site>/cgi-bin])
)
AC_SUBST(CGI_PREFIX)
WEB_USER=apache
AC_ARG_WITH(webuser,
[ --with-webuser=<user> name of web user, default apache],
[WEB_USER=$with_webuser],
AC_MSG_WARN([You can call configure with the --with-webuser option.
This tells configure what the user name of the web user is if it is not the default of 'apache'.
e.g. --with-webuser=apache or --with-webuser=web])
)
AC_SUBST(WEB_USER)
WEB_GROUP=apache
AC_ARG_WITH(webgroup,
[ --with-webgroup=<group> name of web group, default apache],
[WEB_GROUP=$with_webgroup],
AC_MSG_WARN([You can call configure with the --with-webgroup option.
This tells configure what the group name of the web group is if it is not the default of 'apache'.
e.g. --with-webgroup=apache or --with-webgroup=web])
)
AC_SUBST(WEB_GROUP)
WEB_HOST=zm.local
AC_ARG_WITH(webhost,
[ --with-webhost=<hostname> name of web hostname, default zm.local],
[WEB_HOST=$with_webhost],
AC_MSG_WARN([You can call configure with the --with-webhost option.
This tells configure what the host name is for name based virtual hosting. This is only used to populate the sample web/zmHttpd.conf file.
e.g. --with-webhost=zm.localdomain])
)
AC_SUBST(WEB_HOST)
ENABLE_DEBUG=yes
AC_ARG_ENABLE(debug,
[ --enable-debug=<yes|no> enable or disable debug, default enabled],
[ENABLE_DEBUG=$enable_debug],
AC_MSG_WARN([You can call configure with the --enable-debug=<yes|no> or --disable-debug option.
This tells configure whether to compile ZoneMinder with debug included. Although debug is included
by default it is not output unless explicitly switched on elsewhere. These checks may induce a
small penalty on performance and if you are after squeezing the maximum possible performance out
of ZoneMinder you may use this switch to prevent debug from being compiled in.
e.g. --enable-debug=yes or --disable-debug])
)
if test "$ENABLE_DEBUG" != "yes"; then
AC_DEFINE(ZM_DBG_OFF,1,"Whether debug is switched off and compiled out")
fi
ENABLE_MMAP=yes
AC_ARG_ENABLE(mmap,
[ --enable-mmap=<yes|no> enable or disabled mapped memory versus shared memory, default mapped],
[ENABLE_MMAP=$enable_mmap],
AC_MSG_WARN([You can call configure with the --enable-mmap=<yes|no> or --disable-mmap option.
This tells configure whether to compile ZoneMinder with mmap support rather than IPC shared
memory. This is a feature that uses memory mapped into files which all processes can share.
Memory mapping requires less configuration and is more flexible than shared memory but may
slow down your system unless the mapped files are configured to reside on a fast or RAM based
filesystem which will normally be the case by default.
e.g. --enable-mmap=yes or --disable-mmap])
)
if test "$ENABLE_MMAP" == "yes"; then
AC_DEFINE(ZM_MEM_MAPPED,1,"Whether to use mapped rather than shared memory")
else
AC_DEFINE(ZM_MEM_MAPPED,0,"Whether to use mapped rather than shared memory")
fi
AC_SUBST(ENABLE_MMAP)
ENABLE_ONVIF=no
AC_ARG_ENABLE(onvif,
[ --enable-onvif=<yes|no> enable or disable basic onvif support, default disabled],
[ENABLE_ONVIF=$enable_onvif],
AC_MSG_WARN([You can call configure with the --enable-onvif=<yes|no> or --enable-onvif option.
This tells configure whether to compile ZoneMinder with basic ONVIF support. This feature will
probe for ONVIF compliant cameras on your network and allow you the option to auto-configure them as
monitors in zoneminder. This option is EXPERIMENTAL and may not work with all cameras that claim to
be ONVIF compliant.
e.g. --enable-onvif=yes or --disable-onvif])
)
AM_CONDITIONAL([COND_ONVIF], [test "$enable_onvif" = yes])
# Compiler
AC_LANG_CPLUSPLUS
if test "$ENABLE_ONVIF" == "yes"; then
AC_SUBST(ZM_HAS_ONVIF,1)
else
AC_SUBST(ZM_HAS_ONVIF,0)
fi
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_RANLIB
AC_PROG_MAKE_SET
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_UID_T
AC_C_INLINE
AC_TYPE_MODE_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_TYPE_SIGNAL
AC_CHECK_TYPES(siginfo_t,,,[#include <signal.h>])
AC_CHECK_TYPES(ucontext_t,,,[#include <signal.h>])
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_FUNC_STRTOD
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([gethostbyname gethostname gettimeofday memmove memset mkdir munmap posix_memalign putenv select sendfile socket sqrt strcasecmp strchr strcspn strerror strncasecmp strrchr strspn strstr strtol strtoull])
AC_CHECK_FUNCS([syscall sleep usleep ioctl ioctlsocket sigaction])
# this is required for freebsd to compile. Look for it in m4/ac_check_sendfile.m4
AC_CHECK_SENDFILE
# Other programs
AC_CHECK_PROG(OPT_FFMPEG,ffmpeg,yes,no)
AC_PATH_PROG(PATH_FFMPEG,ffmpeg)
# Checks for libraries.
AC_CHECK_LIB(rt,clock_gettime,,AC_MSG_ERROR(zm requires librt))
AC_SEARCH_LIBS(mysql_init,[mysqlclient mariadbclient],,AC_MSG_ERROR(zm requires libmysqlclient.a or libmariadbclient.a))
AC_CHECK_LIB(jpeg,jpeg_start_compress,,AC_MSG_ERROR(zm requires libjpeg.a))
AC_CHECK_LIB(pthread,pthread_create,,AC_MSG_ERROR(zm requires libpthread.a))
if test "$BSD" == "0"; then
AC_CHECK_LIB(dl,dlsym,,AC_MSG_ERROR(zm requires libdl.a))
fi
if test "$ZM_SSL_LIB" == "openssl"; then
AC_CHECK_HEADERS(openssl/md5.h,,AC_MSG_WARN(zm requires openssl/md5.h header to be installed for openssl),)
AC_CHECK_LIB(crypto,MD5,,AC_MSG_WARN([libcrypto.a is required for authenticated streaming - use ZM_SSL_LIB option to select gnutls instead]))
else
AC_CHECK_HEADERS(gnutls/openssl.h,AC_SUBST(ZM_HAS_GNUTLS_OPENSSL,1),AC_SUBST(ZM_HAS_GNUTLS_OPENSSL,0),)
AC_CHECK_HEADERS(gnutls/gnutls.h,AC_SUBST(ZM_HAS_GNUTLS,1),AC_SUBST(ZM_HAS_GNUTLS,0),)
if test "$ZM_HAS_GNUTLS_OPENSSL" == "0" && test "$ZM_HAS_GNUTLS" == "0"; then
AC_MSG_WARN(gnutls is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead)
fi
AC_CHECK_HEADERS(gcrypt.h,,AC_MSG_WARN(zm requires libgcrypt headers to be installed for gnutls),)
AC_CHECK_LIB(gcrypt,gcry_check_version,,AC_MSG_WARN([libgcrypt.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead]))
AC_CHECK_LIB(gnutls,gnutls_fingerprint,,AC_MSG_WARN([libgnutls.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead]))
if test "$ZM_HAS_GNUTLS_OPENSSL" == "1"; then
AC_CHECK_LIB(gnutls-openssl,MD5,,AC_MSG_WARN([libgnutls.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead]))
fi
fi
AC_CHECK_LIB(pcre,pcre_compile,,AC_MSG_WARN(libpcre.a may be required for remote/network camera support))
AC_CHECK_LIB(z,zlibVersion)
AC_CHECK_LIB(x264,x264_predict_16x16_init)
AC_CHECK_LIB(mp4v2,MP4AddH264VideoTrack)
AC_CHECK_LIB(avutil,av_malloc,,AC_MSG_WARN(libavutil.a may be required for MPEG streaming))
# Don't bother to warn about this one
AC_CHECK_LIB(avcore,av_image_copy,,)
AC_CHECK_LIB(avcodec,avcodec_version,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming))
AC_CHECK_LIB(avformat,avformat_version,,AC_MSG_WARN(libavformat.a is required for MPEG streaming))
#AC_CHECK_LIB(avcodec,avcodec_open,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming))
#AC_CHECK_LIB(avformat,av_new_stream,,AC_MSG_WARN(libavformat.a is required for MPEG streaming))
AC_CHECK_LIB(avdevice,avdevice_register_all,,AC_MSG_WARN(libavdevice.a may be required for MPEG streaming))
AC_CHECK_LIB(swscale,sws_scale,,,-lswscale)
AC_CHECK_LIB(vlc,libvlc_new,,AC_MSG_WARN(libvlc.a may be required for streaming))
AC_CHECK_LIB(bz2,BZ2_bzCompress,,AC_MSG_WARN(zm requires libbz2.a for recent versions of ffmpeg))
AC_CHECK_LIB(z,compress,,)
AC_CHECK_LIB(curl,curl_global_init,,)
# Checks for header files.
AC_FUNC_ALLOCA
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h limits.h memory.h stddef.h stdlib.h string.h strings.h sys/param.h sys/time.h syslog.h unistd.h values.h])
AC_CHECK_HEADERS([netdb.h netinet/in.h arpa/inet.h sys/ioctl.h sys/socket.h sys/un.h glob.h sys/sendfile.h])
AC_CHECK_HEADERS(execinfo.h,,,)
AC_CHECK_HEADERS(ucontext.h,,,)
AC_CHECK_HEADERS(sys/syscall.h,,,)
AC_CHECK_HEADERS(pthread.h,,,)
# Check for Video for Linux 1 Header Files
ZM_HAS_V4L1=0
AC_CHECK_HEADERS([libv4l1-videodev.h linux/videodev.h],[ZM_HAS_V4L1=1; break;],,)
AC_SUBST(ZM_HAS_V4L1)
# Check for Video for Linux 2 Header Files
ZM_HAS_V4L2=0
AC_CHECK_HEADERS(linux/videodev2.h,ZM_HAS_V4L2=1,,)
AC_SUBST(ZM_HAS_V4L2)
# Set global Video for Linux flag
ZM_HAS_V4L=0
if test "$ZM_HAS_V4L1" == "1" || test "$ZM_HAS_V4L2" == "1"; then
ZM_HAS_V4L=1
else
AC_MSG_WARN(zm requires Video4Linux or Video4Linux2 to be installed for analog or USB camera support)
fi
AC_SUBST(ZM_HAS_V4L)
AC_CHECK_HEADERS(jpeglib.h,,AC_MSG_ERROR(zm requires libjpeg headers to be installed),)
AC_CHECK_HEADERS(mysql/mysql.h,,AC_MSG_ERROR(zm requires MySQL headers - check that MySQL development packages are installed),)
AC_LANG_PUSH([C])
AC_CHECK_HEADERS(libavutil/avutil.h,,,)
AC_CHECK_HEADERS(libavcodec/avcodec.h,,,)
AC_CHECK_HEADERS(libavformat/avformat.h,,,)
AC_CHECK_HEADERS(libswscale/swscale.h,,,)
AC_LANG_POP([C])
AC_CHECK_HEADERS(pcre/pcre.h,AC_SUBST(ZM_PCRE,"1"),,)
AC_CHECK_HEADERS(pcre.h,AC_SUBST(ZM_PCRE,"1"),,)
if test "$ENABLE_MMAP" == "yes"; then
AC_CHECK_HEADERS(sys/mman.h,,,)
AC_CHECK_HEADERS(fcntl.h,,,)
else
AC_CHECK_HEADERS(sys/ipc.h,,,)
AC_CHECK_HEADERS(sys/shm.h,,,)
fi
AC_CHECK_HEADERS(zlib.h,,,)
AC_CHECK_HEADERS(x264.h,,,)
AC_CHECK_HEADERS([mp4v2/mp4v2.h mp4v2.h mp4.h],,,)
AC_CHECK_HEADERS(vlc/vlc.h,,,)
AC_CHECK_HEADERS(curl/curl.h,,,)
if test "$ZM_SSL_LIB" == "openssl"; then
AC_CHECK_DECLS(MD5,,AC_MSG_ERROR([zm requires openssl/md5.h - use ZM_SSL_LIB option to select gnutls instead]),[#include <stdlib.h>
#include <openssl/md5.h>])
else
if test "$ZM_HAS_GNUTLS_OPENSSL" == "1"; then
AC_CHECK_DECLS(MD5,,AC_MSG_ERROR([zm requires gnutls/openssl.h - use ZM_SSL_LIB option to select openssl instead]),[#include <stdlib.h>
#include <gnutls/openssl.h>])
else
AC_CHECK_DECLS(gnutls_fingerprint,,AC_MSG_ERROR([zm requires gnutls/gnutls.h - use ZM_SSL_LIB option to select openssl instead]),[#include <stdlib.h>
#include <gnutls/gnutls.h>])
fi
fi
AC_CHECK_DECLS(backtrace,,,[#include <execinfo.h>])
AC_CHECK_DECLS(backtrace_symbols,,,[#include <execinfo.h>])
AC_CHECK_LIB(execinfo,backtrace)
AC_SUBST(LDFLAGS)
AC_PROG_PERL_VERSION(5.6.0)
# Compulsory perl modules
AC_PROG_PERL_MODULES(Sys::Syslog,,AC_MSG_ERROR(zm requires SYS:Syslog))
AC_PROG_PERL_MODULES(DBI,,AC_MSG_ERROR(zm requires DBI))
AC_PROG_PERL_MODULES(DBD::mysql,,AC_MSG_ERROR(zm requires DBD::mysql))
AC_PROG_PERL_MODULES(Getopt::Long,,AC_MSG_ERROR(zm requires Getopt::Long))
AC_PROG_PERL_MODULES(Time::HiRes,,AC_MSG_ERROR(zm requires Time::HiRes))
AC_PROG_PERL_MODULES(Date::Manip,,AC_MSG_ERROR(zm requires Date::Manip))
AC_PROG_PERL_MODULES(LWP::UserAgent,,AC_MSG_ERROR(zm requires LWP::UserAgent))
AC_PROG_PERL_MODULES(ExtUtils::MakeMaker,,AC_MSG_ERROR(zm requires ExtUtils::MakeMaker))
if test "$ENABLE_MMAP" == "yes"; then
AC_PROG_PERL_MODULES(Sys::Mmap,,AC_MSG_ERROR(zm requires Sys::Mmap for mapped memory - set --enable-mmap=no to use IPC shared memory instead))
fi
# Optional perl modules
AC_PROG_PERL_MODULES(Module::Load,,AC_MSG_WARN(Module::Load is required for PTZ camera control))
AC_PROG_PERL_MODULES(Device::SerialPort,,AC_MSG_WARN(Device::SerialPort is required for RS232/RS485 PTZ camera control))
AC_PROG_PERL_MODULES(Net::FTP,,AC_MSG_WARN(Net::FTP is required for automatic event uploading using ftp))
AC_PROG_PERL_MODULES(Net::SFTP::Foreign,,AC_MSG_WARN(Net::SFTP::Foreign is required for automatic event uploading using sftp))
AC_PROG_PERL_MODULES(Expect,,AC_MSG_WARN(Expect is required for automatic event uploading using sftp))
AC_PROG_PERL_MODULES(Archive::Tar,,AC_MSG_WARN(Archive::Tar may be required for automatic event uploading))
AC_PROG_PERL_MODULES(Archive::Zip,,AC_MSG_WARN(Archive::Zip may be required for automatic event uploading))
AC_PROG_PERL_MODULES(Net::SMTP,,AC_MSG_WARN(Net::SMTP may be required for automatic event email notification))
AC_PROG_PERL_MODULES(MIME::Lite,,AC_MSG_WARN(MIME::Lite may be required for automatic event email notification))
AC_PROG_PERL_MODULES(MIME::Entity,,AC_MSG_WARN(MIME::Entity may be required for automatic event email notification))
AC_PROG_PERL_MODULES(X10::ActiveHome,,AC_MSG_WARN(X10::ActiveHome is required for X.10 support))
AC_DEFINE_DIR([BINDIR],[bindir],[Expanded binary directory])
AC_DEFINE_DIR([LIBDIR],[libdir],[Expanded library directory])
AC_DEFINE_DIR([DATADIR],[datadir],[Expanded data directory])
AC_SUBST(PKGDATADIR,"$DATADIR/$PACKAGE")
AC_SUBST(ZM_PID,"$ZM_RUNDIR/zm.pid")
#AC_DEFINE_DIR([SYSCONFDIR],[sysconfdir],[Expanded configuration directory])
#AC_SUBST(ZM_CONFIG,"$SYSCONFDIR/zm.conf")
AC_SUBST(ZM_CONFIG,"$ZM_CONFIG_DIR/zm.conf")
# Slight hack for non-standard perl install paths
if test "$prefix" != "NONE"; then
PERL_SITE_PREFIX=`perl -V:siteprefix | sed -e "s/.*='\(.*\)';/\1/"`
PERL_SITE_LIB=`perl -V:installsitelib | sed -e "s/.*='\(.*\)';/\1/"`
PERL_LIB_PATH=`echo $PERL_SITE_LIB | sed -e "s|^$PERL_SITE_PREFIX||"`
EXTRA_PERL_LIB="use lib '$prefix$PERL_LIB_PATH'; # Include custom perl install path"
PERL_MM_PARMS="\"PREFIX=$prefix INSTALLDIRS=vendor\""
else
EXTRA_PERL_LIB="# Include from system perl paths only"
PERL_MM_PARMS="\"INSTALLDIRS=vendor\""
fi
AC_SUBST(PERL_MM_PARMS)
AC_SUBST(EXTRA_PERL_LIB)
AC_CONFIG_FILES([Makefile zm.conf zmconfgen.pl db/Makefile db/zm_create.sql misc/Makefile misc/apache.conf misc/logrotate.conf misc/syslog.conf misc/com.zoneminder.systemctl.policy misc/com.zoneminder.systemctl.rules onvif/Makefile onvif/scripts/Makefile scripts/Makefile scripts/zm scripts/zmaudit.pl scripts/zmcontrol.pl scripts/zmdc.pl scripts/zmfilter.pl scripts/zmpkg.pl scripts/zmtelemetry.pl scripts/zmtrack.pl scripts/zmcamtool.pl scripts/zmsystemctl.pl scripts/zmtrigger.pl scripts/zmupdate.pl scripts/zmvideo.pl scripts/zmwatch.pl scripts/zmx10.pl scripts/zmdbbackup scripts/zmdbrestore scripts/zmeventdump scripts/zmlogrotate.conf scripts/ZoneMinder/lib/ZoneMinder/Base.pm scripts/ZoneMinder/lib/ZoneMinder/Config.pm scripts/ZoneMinder/lib/ZoneMinder/Memory.pm scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm src/Makefile src/zm_config.h web/Makefile web/ajax/Makefile web/css/Makefile web/graphics/Makefile web/includes/Makefile web/includes/config.php web/js/Makefile web/lang/Makefile web/skins/Makefile web/skins/classic/Makefile web/skins/classic/ajax/Makefile web/skins/classic/css/Makefile web/skins/classic/css/classic/Makefile web/skins/classic/css/classic/views/Makefile web/skins/classic/css/dark/Makefile web/skins/classic/css/dark/views/Makefile web/skins/classic/css/flat/Makefile web/skins/classic/css/flat/views/Makefile web/skins/classic/graphics/Makefile web/skins/classic/includes/Makefile web/skins/classic/js/Makefile web/skins/classic/lang/Makefile web/skins/classic/views/Makefile web/skins/classic/views/js/Makefile web/skins/mobile/Makefile web/skins/mobile/ajax/Makefile web/skins/mobile/css/Makefile web/skins/mobile/graphics/Makefile web/skins/mobile/includes/Makefile web/skins/mobile/lang/Makefile web/skins/mobile/views/Makefile web/skins/mobile/views/css/Makefile web/tools/Makefile web/tools/mootools/Makefile web/views/Makefile web/skins/xml/Makefile web/skins/xml/views/Makefile web/skins/xml/includes/Makefile])
# Create the definitions for compilation and defaults for the database
AC_CONFIG_COMMANDS([src/zm_config_defines.h],[perl ./zmconfgen.pl])
# Manually generate the perl Makefile maker
AC_CONFIG_COMMANDS([scripts/ZoneMinder/Makefile],[(cd scripts/ZoneMinder; echo "perl Makefile.PL $PERL_MM_PARMS"; perl Makefile.PL $PERL_MM_PARMS)],[PERL_MM_PARMS=$PERL_MM_PARMS])
AC_CONFIG_COMMANDS([onvif/modules/Makefile],[(cd onvif/modules; echo "perl Makefile.PL $PERL_MM_PARMS"; perl Makefile.PL $PERL_MM_PARMS)],[PERL_MM_PARMS=$PERL_MM_PARMS])
AC_CONFIG_COMMANDS([onvif/proxy/Makefile],[(cd onvif/proxy; echo "perl Makefile.PL $PERL_MM_PARMS"; perl Makefile.PL $PERL_MM_PARMS)],[PERL_MM_PARMS=$PERL_MM_PARMS])
AC_OUTPUT

View File

@ -1,14 +0,0 @@
AUTOMAKE_OPTIONS = foreign
zmdbdatadir = $(pkgdatadir)/db
EXTRA_DIST = \
zm_create.sql.in \
$(dbupgrade_scripts)
dist_zmdbdata_DATA = \
zm_create.sql \
$(dbupgrade_scripts)
dbupgrade_scripts = $(wildcard zm_update-*.sql)

View File

@ -271,7 +271,7 @@ CREATE TABLE `Logs` (
`TimeKey` decimal(16,6) NOT NULL, `TimeKey` decimal(16,6) NOT NULL,
`Component` varchar(32) NOT NULL, `Component` varchar(32) NOT NULL,
`ServerId` int(10) unsigned, `ServerId` int(10) unsigned,
`Pid` smallint(6) DEFAULT NULL, `Pid` int(10) DEFAULT NULL,
`Level` tinyint(3) NOT NULL, `Level` tinyint(3) NOT NULL,
`Code` char(3) NOT NULL, `Code` char(3) NOT NULL,
`Message` text NOT NULL, `Message` text NOT NULL,

7
db/zm_update-1.29.1.sql Normal file
View File

@ -0,0 +1,7 @@
--
-- This updates a 1.29.0 database to 1.29.1
--
--
-- Increase the size of the Pid field for FreeBSD
ALTER TABLE Logs MODIFY Pid int(10);

View File

@ -3,41 +3,41 @@ Section: net
Priority: optional Priority: optional
Maintainer: Isaac Connor <iconnor@connortechnology.com> Maintainer: Isaac Connor <iconnor@connortechnology.com>
Build-Depends: debhelper (>= 9), autoconf, automake, quilt , libtool, dh-autoreconf Build-Depends: debhelper (>= 9), autoconf, automake, quilt , libtool, dh-autoreconf
,libgnutls-dev|libgnutls28-dev ,libgnutls-dev|libgnutls28-dev
,libmysqlclient-dev | libmariadbclient-dev, libdbd-mysql-perl ,libmysqlclient-dev | libmariadbclient-dev, libdbd-mysql-perl
,libjpeg8-dev|libjpeg9-dev|libjpeg62-turbo-dev ,libjpeg8-dev|libjpeg9-dev|libjpeg62-turbo-dev
,libpcre3-dev ,libpcre3-dev
,libavcodec-dev, libavformat-dev (>= 3:0.svn20090204), libswscale-dev (>= 3:0.svn20090204), libavutil-dev, libavdevice-dev ,libavcodec-dev, libavformat-dev (>= 3:0.svn20090204), libswscale-dev (>= 3:0.svn20090204), libavutil-dev, libavdevice-dev
,libv4l-dev (>= 0.8.3), libvlccore-dev, libvlc-dev ,libv4l-dev (>= 0.8.3), libvlccore-dev, libvlc-dev
,libbz2-dev ,libbz2-dev
,libsys-mmap-perl ,libsys-mmap-perl
,libnetpbm10-dev ,libnetpbm10-dev
,libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev ,libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev
,libgcrypt11-dev|libgcrypt20-dev, libpolkit-gobject-1-dev ,libgcrypt11-dev|libgcrypt20-dev, libpolkit-gobject-1-dev
Standards-Version: 3.9.4 Standards-Version: 3.9.4
Package: zoneminder Package: zoneminder
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends} Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}
, apache2, libapache2-mod-php5 | libapache2-mod-fcgid , apache2, libapache2-mod-php5 | libapache2-mod-fcgid
, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl , php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl
, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl , libdate-manip-perl, libmime-lite-perl, libmime-tools-perl
, mariadb-client|mysql-client , mariadb-client|mysql-client
, libwww-perl, libarchive-tar-perl, libarchive-zip-perl , libwww-perl, libarchive-tar-perl, libarchive-zip-perl
, libdevice-serialport-perl, libpcre3 , libdevice-serialport-perl, libpcre3
, ffmpeg | libav-tools , ffmpeg | libav-tools
, rsyslog | system-log-daemon , rsyslog | system-log-daemon
, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl , libmodule-load-perl, libsys-mmap-perl, libjson-any-perl
, netpbm , netpbm
, libavdevice53 | libavdevice55 , libavdevice53 | libavdevice55
, libjpeg8|libjpeg9|libjpeg62-turbo , libjpeg8|libjpeg9|libjpeg62-turbo
, zip , zip
, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl , libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl
, libvlccore5 | libvlccore7 | libvlccore8, libvlc5 , libvlccore5 | libvlccore7 | libvlccore8, libvlc5
, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev , libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev
, libpolkit-gobject-1-0, liburi-encode-perl, php5-gd , libpolkit-gobject-1-0, liburi-encode-perl, php5-gd
, libdata-dump-perl, libclass-std-fast-perl, libsoap-wsdl-perl, libio-socket-multicast-perl, libdigest-sha-perl , libdata-dump-perl, libclass-std-fast-perl, libsoap-wsdl-perl, libio-socket-multicast-perl, libdigest-sha-perl
, libsys-cpu-perl, libsys-meminfo-perl , libsys-cpu-perl, libsys-meminfo-perl
Recommends: mysql-server|mariadb-server Recommends: mysql-server|mariadb-server
Description: Video camera security and surveillance solution Description: Video camera security and surveillance solution
ZoneMinder is intended for use in single or multi-camera video security ZoneMinder is intended for use in single or multi-camera video security

View File

@ -13,9 +13,7 @@ Depends: ${misc:Depends},
zoneminder-database (>= ${source:Version}), zoneminder-database (>= ${source:Version}),
zoneminder-core (>= ${binary:Version}), zoneminder-core (>= ${binary:Version}),
zoneminder-ui-base (>= ${source:Version}), zoneminder-ui-base (>= ${source:Version}),
zoneminder-ui-classic (>= ${source:Version}), zoneminder-ui-classic (>= ${source:Version})
zoneminder-ui-mobile (>= ${source:Version}),
zoneminder-ui-xml (>= ${source:Version})
Description: Video camera security and surveillance solution (metapackage) Description: Video camera security and surveillance solution (metapackage)
ZoneMinder is intended for use in single or multi-camera video security ZoneMinder is intended for use in single or multi-camera video security
applications, including commercial or home CCTV, theft prevention and child applications, including commercial or home CCTV, theft prevention and child
@ -103,22 +101,3 @@ Description: Classic web user interface for ZoneMinder
ZoneMinder is a video camera security and surveillance solution. ZoneMinder is a video camera security and surveillance solution.
. .
This package provides the classic web user interface. This package provides the classic web user interface.
Package: zoneminder-ui-mobile
Section: web
Architecture: all
Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends}
Description: Mobile web user interface for ZoneMinder
ZoneMinder is a video camera security and surveillance solution.
.
This package provides the web user interface for mobile devices.
Package: zoneminder-ui-xml
Section: web
Architecture: all
Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends}
Description: XML interface for ZoneMinder
ZoneMinder is a video camera security and surveillance solution.
.
This package provides a XML interface mainly intended for use with the eyeZm
iPhone Application, but can be used with any other custom programs as well.

View File

@ -1 +0,0 @@
usr/share/zoneminder/skins/mobile

View File

@ -1 +0,0 @@
usr/share/zoneminder/skins/xml

View File

@ -140,7 +140,6 @@ fi
# zmfix removed from zoneminder 1.26.6 # zmfix removed from zoneminder 1.26.6
#%attr(4755,root,root) %{_bindir}/zmfix #%attr(4755,root,root) %{_bindir}/zmfix
%{_bindir}/zmpkg.pl %{_bindir}/zmpkg.pl
%{_bindir}/zmstreamer
%{_bindir}/zmtrack.pl %{_bindir}/zmtrack.pl
%{_bindir}/zmtrigger.pl %{_bindir}/zmtrigger.pl
%{_bindir}/zmu %{_bindir}/zmu

View File

@ -232,7 +232,6 @@ fi
# zmfix removed from zoneminder 1.26.6 # zmfix removed from zoneminder 1.26.6
#%attr(4755,root,root) %{_bindir}/zmfix #%attr(4755,root,root) %{_bindir}/zmfix
%{_bindir}/zmpkg.pl %{_bindir}/zmpkg.pl
%{_bindir}/zmstreamer
%{_bindir}/zmtrack.pl %{_bindir}/zmtrack.pl
%{_bindir}/zmtrigger.pl %{_bindir}/zmtrigger.pl
%{_bindir}/zmu %{_bindir}/zmu

View File

@ -142,7 +142,6 @@ fi
%{_bindir}/zmf %{_bindir}/zmf
%{_bindir}/zmfilter.pl %{_bindir}/zmfilter.pl
%{_bindir}/zmpkg.pl %{_bindir}/zmpkg.pl
%{_bindir}/zmstreamer
%{_bindir}/zmtrack.pl %{_bindir}/zmtrack.pl
%{_bindir}/zmtrigger.pl %{_bindir}/zmtrigger.pl
%{_bindir}/zmu %{_bindir}/zmu

View File

@ -142,7 +142,6 @@ fi
%{_bindir}/zmf %{_bindir}/zmf
%{_bindir}/zmfilter.pl %{_bindir}/zmfilter.pl
%{_bindir}/zmpkg.pl %{_bindir}/zmpkg.pl
%{_bindir}/zmstreamer
%{_bindir}/zmtrack.pl %{_bindir}/zmtrack.pl
%{_bindir}/zmtrigger.pl %{_bindir}/zmtrigger.pl
%{_bindir}/zmu %{_bindir}/zmu

View File

@ -0,0 +1,408 @@
%define zmuid $(id -un)
%define zmgid $(id -gn)
%define zmuid_final apache
%define zmgid_final apache
%global _hardened_build 1
### Delete the lines below to build with ffmpeg and/or x10
%define _without_ffmpeg 1
%define _without_x10 1
Name: zoneminder
Version: 1.29.0
Release: 1%{?dist}
Summary: A camera monitoring and analysis tool
Group: System Environment/Daemons
# jscalendar is LGPL (any version): http://www.dynarch.com/projects/calendar/
# Mootools is inder the MIT license: http://mootools.net/
License: GPLv2+ and LGPLv2+ and MIT
URL: http://www.zoneminder.com/
#Source: https://github.com/ZoneMinder/ZoneMinder/archive/v%{version}.tar.gz
Source: ZoneMinder-%{version}.tar.gz
BuildRequires: cmake gnutls-devel systemd-units bzip2-devel
BuildRequires: mariadb-devel pcre-devel libjpeg-turbo-devel
BuildRequires: perl(Archive::Tar) perl(Archive::Zip) perl-podlators
BuildRequires: perl(Date::Manip) perl(DBD::mysql)
BuildRequires: perl(ExtUtils::MakeMaker) perl(LWP::UserAgent)
BuildRequires: perl(MIME::Entity) perl(MIME::Lite)
BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap)
BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign)
BuildRequires: perl(Expect) perl(Sys::Syslog)
BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel libv4l-devel
%{!?_without_ffmpeg:BuildRequires: ffmpeg-devel}
%{!?_without_x10:BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)}
# cmake needs the following installed at build time due to the way it auto-detects certain parameters
BuildRequires: httpd polkit-devel
%{!?_without_ffmpeg:BuildRequires: ffmpeg}
Requires: httpd php php-gd php-mysql cambozola polkit net-tools psmisc
Requires: libjpeg-turbo vlc-core libcurl
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: perl(DBD::mysql) perl(Archive::Tar) perl(Archive::Zip)
Requires: perl(MIME::Entity) perl(MIME::Lite) perl(Net::SMTP) perl(Net::FTP)
Requires: perl(LWP::Protocol::https)
%{!?_without_ffmpeg:Requires: ffmpeg}
Requires(post): systemd-units systemd-sysv
Requires(post): /usr/bin/gpasswd
Requires(post): /usr/bin/less
Requires(preun): systemd-units
Requires(postun): systemd-units
%description
ZoneMinder is a set of applications which is intended to provide a complete
solution allowing you to capture, analyse, record and monitor any cameras you
have attached to a Linux based machine. It is designed to run on kernels which
support the Video For Linux (V4L) interface and has been tested with cameras
attached to BTTV cards, various USB cameras and IP network cameras. It is
designed to support as many cameras as you can attach to your computer without
too much degradation of performance.
%prep
%setup -q -n ZoneMinder-%{version}
# Change the following default values
./utils/zmeditconfigdata.sh ZM_PATH_ZMS /cgi-bin-zm/nph-zms
./utils/zmeditconfigdata.sh ZM_OPT_CAMBOZOLA yes
./utils/zmeditconfigdata.sh ZM_PATH_SWAP /dev/shm
./utils/zmeditconfigdata.sh ZM_UPLOAD_FTP_LOC_DIR /var/spool/zoneminder-upload
./utils/zmeditconfigdata.sh ZM_OPT_CONTROL yes
./utils/zmeditconfigdata.sh ZM_CHECK_FOR_UPDATES no
./utils/zmeditconfigdata.sh ZM_DYN_SHOW_DONATE_REMINDER no
%build
%cmake \
-DZM_TARGET_DISTRO="f22" \
%{?_without_ffmpeg:-DZM_NO_FFMPEG=ON} \
%{?_without_x10:-DZM_NO_X10=ON} \
.
make %{?_smp_mflags}
%install
export DESTDIR=%{buildroot}
make install
%post
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
# Allow zoneminder access to local video sources, serial ports, and x10
/usr/bin/gpasswd -a %{zmuid_final} video
/usr/bin/gpasswd -a %{zmuid_final} dialout
# Upgrade from a previous version of zoneminder
if [ $1 -eq 2 ] ; then
# Freshen the database
/usr/bin/zmupdate.pl -f
# We can't run this automatically when new sql account permissions need to
# be manually added first
# Run zmupdate non-interactively
#/usr/bin/zmupdate.pl --nointeractive
fi
# Warn the end user to read the README file
echo -e "\nVERY IMPORTANT: Before starting ZoneMinder, read README.Fedora to finish the\ninstallation or upgrade!\n"
echo -e "\nThe README file is located here: %{_docdir}/%{name}\n"
%preun
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable zoneminder.service > /dev/null 2>&1 || :
/bin/systemctl stop zoneminder.service > /dev/null 2>&1 || :
fi
%postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart zoneminder.service >/dev/null 2>&1 || :
fi
%triggerun -- zoneminder < 1.25.0-4
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply zoneminder
# to migrate them to systemd targets
/usr/bin/systemd-sysv-convert --save zoneminder >/dev/null 2>&1 ||:
# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del zoneminder >/dev/null 2>&1 || :
/bin/systemctl try-restart zoneminder.service >/dev/null 2>&1 || :
%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING README.md distros/fedora/README.Fedora distros/fedora/README.https distros/fedora/jscalendar-doc
%config %attr(640,root,%{zmgid_final}) /etc/zm/zm.conf
%config(noreplace) %attr(644,root,root) /etc/httpd/conf.d/zoneminder.conf
%config(noreplace) /etc/tmpfiles.d/zoneminder.conf
%config(noreplace) /etc/logrotate.d/zoneminder
%{_unitdir}/zoneminder.service
%{_bindir}/zma
%{_bindir}/zmaudit.pl
%{_bindir}/zmc
%{_bindir}/zmcontrol.pl
%{_bindir}/zmdc.pl
%{_bindir}/zmf
%{_bindir}/zmfilter.pl
%{_bindir}/zmpkg.pl
%{_bindir}/zmtrack.pl
%{_bindir}/zmtrigger.pl
%{_bindir}/zmu
%{_bindir}/zmupdate.pl
%{_bindir}/zmvideo.pl
%{_bindir}/zmwatch.pl
%{_bindir}/zmcamtool.pl
%{_bindir}/zmsystemctl.pl
%{!?_without_x10:%{_bindir}/zmx10.pl}
%{perl_vendorlib}/ZoneMinder*
%{_mandir}/man*/*
%dir %{_libexecdir}/zoneminder
%{_libexecdir}/zoneminder/cgi-bin
%dir %{_datadir}/zoneminder
%{_datadir}/zoneminder/db
%{_datadir}/zoneminder/www
%{_datadir}/polkit-1/actions/com.zoneminder.systemctl.policy
%{_datadir}/polkit-1/rules.d/com.zoneminder.systemctl.rules
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/events
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/images
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/sock
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/swap
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/temp
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/log/zoneminder
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/spool/zoneminder-upload
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /run/zoneminder
%changelog
* Sat Feb 14 2015 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.28.1
- Bump version for 1.28.1 release on Fedora 21.
* Sun Oct 5 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.28.0
- Bump version for 1.28.0 release.
* Fri Mar 14 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.27
- Tweak build requirements for cmake
* Sat Feb 01 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.27
- Add zmcamtool.pl. Bump version for 1.27 release.
* Mon Dec 16 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.5
- This is a bug fixe release
- RTSP fixes, cmake enhancements, couple other misc fixes
* Mon Oct 07 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.4
- Initial cmake build.
* Sat Oct 05 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.4
- Fedora specific path changes have been moved to zoneminder-1.26.0-defaults.patch
- All files are now part of the zoneminder source tree. Update specfile accordingly.
* Sat Sep 21 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.3
- Initial rebuild for ZoneMinder 1.26.3 release.
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Mon Jan 21 2013 Adam Tkac <atkac redhat com> - 1.25.0-12
- rebuild due to "jpeg8-ABI" feature drop
* Mon Jan 7 2013 Remi Collet <rcollet@redhat.com> - 1.25.0-11
- fix configuration file for httpd 2.4, #871502
* Fri Dec 21 2012 Adam Tkac <atkac redhat com> - 1.25.0-10
- rebuild against new libjpeg
* Thu Aug 09 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-9
- Add patch to work around v4l2 api breakage in 3.5 kernel.
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Sat Jun 23 2012 Petr Pisar <ppisar@redhat.com> - 1.25.0-7
- Perl 5.16 rebuild
* Wed Mar 21 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-6
- Fix stupid thinko in sql modifications.
* Sat Feb 25 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-5
- Clean up macro usage.
* Sat Feb 25 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-4
- Convert to systemd.
- Add tmpfiles.d configuration since the initscript isn't around to create
/run/zoneminder.
- Remove some pointless executable permissions.
- Add logrotate file.
* Wed Feb 22 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-3
- Update README.Fedora to reference systemctl and mention timezone info in
php.ini.
- Add proper default for EYEZM_LOG_TO_FILE.
* Thu Feb 09 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-2
- Rebuild for new pcre.
* Thu Jan 19 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-1
- Update to 1.25.0
- Fix gcc4.7 build problems.
- Drop gcc4.4 build fixes; for whatever reason they now break the build.
- Clean up old patches.
- Force setting of ZM_TMPDIR and ZM_RUNDIR.
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Thu Sep 15 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-3
- Re-add the dist-tag that somehow got lost.
* Thu Sep 15 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-2
- Add patch for bug 711780 - fix syntax issue in Mapped.pm.
- Undo that patch, and undo another which was the cause of the whole mess.
- Fix up other patches so ZM_PATH_BUILD is both defined and useful.
- Make sure database creation mods actually take.
- Update Fedora-specific docs with some additional info.
- Use bundled mootools (javascript, so no guideline violation).
- Update download location.
- Update the gcrypt patch to actually work.
- Upstream changed the tarball without changing the version to patch a
vulnerability, so redownload.
* Sun Aug 14 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-1
- Initial attempt to upgrade to 1.24.4.
- Add patch from BZ 460310 to build against libgcrypt instead of requiring the
gnutls openssl libs.
* Thu Jul 21 2011 Petr Sabata <contyk@redhat.com> - 1.24.3-7.20110324svn3310
- Perl mass rebuild
* Wed Jul 20 2011 Petr Sabata <contyk@redhat.com> - 1.24.3-6.20110324svn3310
- Perl mass rebuild
* Mon May 09 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-5.20110324svn3310
- Bump for gnutls update.
* Thu Mar 24 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-4.20110324svn3310
- Update to latest 1.24.3 subversion. Turns out that what upstream was calling
1.24.3 is really just an occasionally updated devel snapshot.
- Rebase various patches.
* Wed Mar 23 2011 Dan Horák <dan@danny.cz> - 1.24.3-3
- rebuilt for mysql 5.5.10 (soname bump in libmysqlclient)
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Tue Jan 25 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-1
- Update to latest upstream version.
- Rebase patches.
- Initial incomplete attempt to disable v4l1 support.
* Fri Jan 21 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-6
- Unbundle cambozola; instead link to the separately pacakged copy.
- Remove BuildRoot:, %%clean and buildroot cleaning in %%install.
- Git rid of mixed space/tab usage by removing all tabs.
- Remove unnecessary Conflicts: line.
- Attempt to force short_open_tag on for the code directories.
- Move default location of sockets, swaps, logfiles and some temporary files to
make more sense and allow things to work better with a future selinux policy.
- Fix errors in README.Fedora.
* Wed Jun 02 2010 Marcela Maslanova <mmaslano@redhat.com> - 1.24.2-5
- Mass rebuild with perl-5.12.0
* Fri Dec 4 2009 Stepan Kasal <skasal@redhat.com> - 1.24.2-4
- rebuild against perl 5.10.1
- use Perl vendorarch and archlib variables correctly
* Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Wed Jul 22 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-2
- Bump release since 1.24.2-1 was mistakenly tagged a few months ago.
* Wed Jul 22 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-1
- Initial update to 1.24.2.
- Rebase patches.
- Update mootools download location.
- Update to mootools 1.2.3.
- Add additional dependencies for some optional features.
* Sat Apr 11 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-3
- Remove unused Sys::Mmap perl dependency RPM is finding
* Sat Apr 11 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-2
- Update gcc44 patch to disable -frepo, seems to be broken with gcc44
- Added noffmpeg patch to make building outside mock easier
* Sat Mar 21 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-1
- Patch for gcc 4.4 compilation errors
- Upgrade to 1.24.1
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Sat Jan 24 2009 Caolán McNamara <caolanm@redhat.com> - 1.23.3-3
- rebuild for dependencies
* Mon Dec 15 2008 Martin Ebourne <martin@zepler.org> - 1.23.3-2
- Fix permissions on zm.conf
* Fri Jul 11 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.23.3-1
- Initial attempt at packaging 1.23.
* Tue Jul 1 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-15
- Add perl module compat dependency, bz #453590
* Tue May 6 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-14
- Remove default runlevel, bz #441315
* Mon Apr 28 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.22.3-13
- Backport patch for CVE-2008-1381 from 1.23.3 to 1.22.3.
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.22.3-12
- Autorebuild for GCC 4.3
* Thu Jan 3 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-11
- Fix compilation on gcc 4.3
* Thu Dec 6 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-10
- Rebuild for new openssl
* Thu Aug 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-8
- Fix licence tag
* Thu Jul 12 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-7
- Fixes from testing by Jitz including missing dependencies and database creation
* Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-6
- Disable crashtrace on ppc
* Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-5
- Fix uid for directories in /var/lib/zoneminder
* Tue Jun 26 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-4
- Added perl Archive::Tar dependency
- Disabled web interface due to lack of access control on the event images
* Sun Jun 10 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-3
- Changes recommended in review by Jason Tibbitts
* Mon Apr 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-2
- Standardised on package name of zoneminder
* Thu Dec 28 2006 Martin Ebourne <martin@zepler.org> - 1.22.3-1
- First version. Uses some parts from zm-1.20.1 by Corey DeLasaux and Serg Oskin

View File

@ -163,7 +163,6 @@ fi
%{_bindir}/zmf %{_bindir}/zmf
%{_bindir}/zmfilter.pl %{_bindir}/zmfilter.pl
%{_bindir}/zmpkg.pl %{_bindir}/zmpkg.pl
%{_bindir}/zmstreamer
%{_bindir}/zmtrack.pl %{_bindir}/zmtrack.pl
%{_bindir}/zmtrigger.pl %{_bindir}/zmtrigger.pl
%{_bindir}/zmu %{_bindir}/zmu

View File

@ -237,7 +237,6 @@ fi
# zmfix removed from zoneminder 1.26.6 # zmfix removed from zoneminder 1.26.6
#%attr(4755,root,root) %{_bindir}/zmfix #%attr(4755,root,root) %{_bindir}/zmfix
%{_bindir}/zmpkg.pl %{_bindir}/zmpkg.pl
%{_bindir}/zmstreamer
%{_bindir}/zmtrack.pl %{_bindir}/zmtrack.pl
%{_bindir}/zmtrigger.pl %{_bindir}/zmtrigger.pl
%{_bindir}/zmu %{_bindir}/zmu

View File

@ -150,7 +150,6 @@ rm -rf %{_docdir}/%{name}-%{version}
%{_bindir}/zmf %{_bindir}/zmf
%{_bindir}/zmfilter.pl %{_bindir}/zmfilter.pl
%{_bindir}/zmpkg.pl %{_bindir}/zmpkg.pl
%{_bindir}/zmstreamer
%{_bindir}/zmtrack.pl %{_bindir}/zmtrack.pl
%{_bindir}/zmtrigger.pl %{_bindir}/zmtrigger.pl
%{_bindir}/zmu %{_bindir}/zmu

View File

@ -159,7 +159,6 @@ fi
%{_bindir}/zmf %{_bindir}/zmf
%{_bindir}/zmfilter.pl %{_bindir}/zmfilter.pl
%{_bindir}/zmpkg.pl %{_bindir}/zmpkg.pl
%{_bindir}/zmstreamer
%{_bindir}/zmtrack.pl %{_bindir}/zmtrack.pl
%{_bindir}/zmtrigger.pl %{_bindir}/zmtrigger.pl
%{_bindir}/zmu %{_bindir}/zmu

View File

@ -28,9 +28,7 @@ Depends: ${misc:Depends},
zoneminder-database (>= ${source:Version}), zoneminder-database (>= ${source:Version}),
zoneminder-core (>= ${binary:Version}), zoneminder-core (>= ${binary:Version}),
zoneminder-ui-base (>= ${source:Version}), zoneminder-ui-base (>= ${source:Version}),
zoneminder-ui-classic (>= ${source:Version}), zoneminder-ui-classic (>= ${source:Version})
zoneminder-ui-mobile (>= ${source:Version}),
zoneminder-ui-xml (>= ${source:Version})
Description: Video camera security and surveillance solution (metapackage) Description: Video camera security and surveillance solution (metapackage)
ZoneMinder is intended for use in single or multi-camera video security ZoneMinder is intended for use in single or multi-camera video security
applications, including commercial or home CCTV, theft prevention and child applications, including commercial or home CCTV, theft prevention and child
@ -119,25 +117,6 @@ Description: Classic web user interface for ZoneMinder
. .
This package provides the classic web user interface. This package provides the classic web user interface.
Package: zoneminder-ui-mobile
Section: web
Architecture: all
Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends}
Description: Mobile web user interface for ZoneMinder
ZoneMinder is a video camera security and surveillance solution.
.
This package provides the web user interface for mobile devices.
Package: zoneminder-ui-xml
Section: web
Architecture: all
Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends}
Description: XML interface for ZoneMinder
ZoneMinder is a video camera security and surveillance solution.
.
This package provides a XML interface mainly intended for use with the eyeZm
iPhone Application, but can be used with any other custom programs as well.
Package: zoneminder-ui-api Package: zoneminder-ui-api
Section: web Section: web
Architecture: all Architecture: all

View File

@ -1 +0,0 @@
usr/share/zoneminder/skins/mobile

View File

@ -1 +0,0 @@
usr/share/zoneminder/skins/xml

View File

@ -26,16 +26,13 @@ Binaries
PHP PHP
--- ---
As well as this there are the web PHP files in the web directory. Currently these consist of 4 possible skins. As well as this there are the web PHP files in the web directory. Currently these consist of a single skin with Classic and Flat styles.
**Classic** **Classic**
Original ZoneMinder skin Original ZoneMinder skin
**Flat** **Flat**
An updated version of classic skin, retaining the same layout with a more modern style An updated version of Classic skin, retaining the same layout with a more modern style. Originally a skin this is now just a CSS style.
**XML**
Displays certain views as XML. Used by eyeZM as an interfacing skin (Note that eyeZM no longer seems to work with later versions of Zoneminder). New developers of 3rd party clients should use the API instead (:doc:`../api`)
**Mobile**
A skin that displays views in a more condensed and single page format, likely suitable for smaller mobile devices, should one choose to access the ZoneMinder console using such devices. Note that there are also third party mobile clients one could use (:doc:`mobile`)
Perl Perl
---- ----

View File

@ -19,6 +19,4 @@ If you have changed the value of an option you should then save it. A numb
options/options_upload options/options_upload
options/options_x10 options/options_x10
options/options_bw options/options_bw
options/options_phonebw
options/options_eyezm
options/options_users options/options_users

View File

@ -1,26 +0,0 @@
Options - eyeZM
---------------
.. NOTE::
eyeZM does not seem to be actively maintained by the developers and does not work with later versions of ZoneMinder.
.. image:: images/Options_eyezm.png
EYEZM_DEBUG - Enable or Disable extra debugging from the eyeZm Plugin. Extra debugging information will be displayed in it's own file (EYEZM_LOG_TO_FILE is set), or your Apache error log
EYEZM_LOG_TO_FILE - When EYEZM_DEBUG is on and EYEZM_LOG_TO_FILE is on, output generated from the eyeZm Plugin will go to it's own file. Otherwise it will go to the apache error log.
EYEZM_LOG_FILE - Default filename to use when logging eyeZm Output and EYEZM_LOG_TO_FILE is enabled. This file will contain it's own output from the eyeZm Plugin when EYEZM_LOG_TO_FILE and EYEZM_DEBUG are both enabled.
EYEZM_EVENT_VCODEC - The eyeZm Plugin calls FFMPEG externally to encode the captured images. If your FFMPEG is not built with support for H264, change this to MPEG-4. If using H264, please check http://www.eyezm.com for H264 requirements and that your eyeZm version supports H264 (v1.2+).
EYEZM_FEED_VCODEC - Determines whether the live stream is generated using native MJPEG streaming with ZoneMinder, or H264 using FFMPEG and HTML-5 streaming. If using H264, please check http://www.eyezm.com for H264 requirements and that your eyeZm version supports H264 (v1.2+). This is just a default parameter, and can be overridden with eyeZm.
EYEZM_H264_DEFAULT_BR - Default bit-rate to use with FFMPEG for H264 streaming. When using the eyeZm Plugin to stream H264 data, FFMPEG requires a bitrate to control the quality and bandwidth of the video. This should be specified in a format acceptable to FFMPEG. The default value is sufficient for most installations. This is just a default parameter, and can be overridden with eyeZm.
EYEZM_H264_DEFAULT_EVBR - Default bit-rate to use with FFMPEG for H264 event viewing. When using the eyeZm Plugin to view events in H264, FFMPEG requires a bitrate to control the quality and bandwidth of the video. This should be specified in a format acceptable to FFMPEG. The default value is sufficient for most installations. This is just a default parameter, and can be overridden with eyeZm.
EYEZM_H264_TIMEOUT - Timeout (sec) to wait for H264 stream to start before terminating. The eyeZm Plugin will attempt to spawn an H264 stream when requested, and require that it complete within the timeout specified. If you have a slow system or find through the logs that the H264 stream is not starting because the timeout is expiring, even though FFMPEG is running, try increasing this value. If you have a fast system, decreasing this value can improve the responsiveness when there are issues starting H264 streams.
EYEZM_SEG_DURATION - Segment duration used for streaming using HTTP-5 Streaming protocol. The HTTP-5 Live Streaming Protocol segments the input video stream into small chunks of a duration specified by this parameter. Increasing the segment duration will help with choppy connections on the other end, but will increase the latency in starting a stream.

View File

@ -1,20 +0,0 @@
Options - Phone Bandwidth
-------------------------
.. image:: images/Options_BW_Phone.png
WEB_P_CAN_STREAM - Override the automatic detection of browser streaming capability. If you know that your browser can handle image streams of the type 'multipart/x-mixed-replace' but ZoneMinder does not detect this correctly you can set this option to ensure that the stream is delivered with or without the use of the Cambozola plugin. Selecting 'yes' will tell ZoneMinder that your browser can handle the streams natively, 'no' means that it can't and so the plugin will be used while 'auto' lets ZoneMinder decide.
WEB_P_STREAM_METHOD - ZoneMinder can be configured to use either mpeg encoded video or a series or still jpeg images when sending video streams. This option defines which is used. If you choose mpeg you should ensure that you have the appropriate plugins available on your browser whereas choosing jpeg will work natively on Mozilla and related browsers and with a Java applet on Internet Explorer"
WEB_P_DEFAULT_SCALE - Normally ZoneMinder will display 'live' or 'event' streams in their native size. However if you have monitors with large dimensions or a slow link you may prefer to reduce this size, alternatively for small monitors you can enlarge it. This options lets you specify what the default scaling factor will be. It is expressed as a percentage so 100 is normal size, 200 is double size etc.
WEB_P_DEFAULT_RATE - Normally ZoneMinder will display 'event' streams at their native rate, i.e. as close to real-time as possible. However if you have long events it is often convenient to replay them at a faster rate for review. This option lets you specify what the default replay rate will be. It is expressed as a percentage so 100 is normal rate, 200 is double speed etc.
WEB_P_VIDEO_BITRATE - When encoding real video via the ffmpeg library a bit rate can be specified which roughly corresponds to the available bandwidth used for the stream. This setting effectively corresponds to a 'quality' setting for the video. A low value will result in a blocky image whereas a high value will produce a clearer view. Note that this setting does not control the frame rate of the video however the quality of the video produced is affected both by this setting and the frame rate that the video is produced at. A higher frame rate at a particular bit rate result in individual frames being at a lower quality.
WEB_P_VIDEO_MAXFPS - When using streamed video the main control is the bitrate which determines how much data can be transmitted. However a lower bitrate at high frame rates results in a lower quality image. This option allows you to limit the maximum frame rate to ensure that video quality is maintained. An additional advantage is that encoding video at high frame rates is a processor intensive task when for the most part a very high frame rate offers little perceptible improvement over one that has a more manageable resource requirement. Note, this option is implemented as a cap beyond which binary reduction takes place. So if you have a device capturing at 15fps and set this option to 10fps then the video is not produced at 10fps, but rather at 7.5fps (15 divided by 2) as the final frame rate must be the original divided by a power of 2.
WEB_P_SCALE_THUMBS - If unset, this option sends the whole image to the browser which resizes it in the window. If set the image is scaled down on the server before sending a reduced size image to the browser to conserve bandwidth at the cost of cpu on the server. Note that ZM can only perform the resizing if the appropriate PHP graphics functionality is installed. This is usually available in the php-gd package.
WEB_P_AJAX_TIMEOUT - The newer versions of the live feed and event views use Ajax to request information from the server and populate the views dynamically. This option allows you to specify a timeout if required after which requests are abandoned. A timeout may be necessary if requests would overwise hang such as on a slow connection. This would tend to consume a lot of browser memory and make the interface unresponsive. Ordinarily no requests should timeout so this setting should be set to a value greater than the slowest expected response. This value is in milliseconds but if set to zero then no timeout will be used.

View File

@ -1,63 +0,0 @@
AC_DEFUN([AC_CHECK_SENDFILE],[
AC_MSG_CHECKING([whether sendfile() is supported and what prototype it has])
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
ac_sendfile_supported=no
AC_TRY_LINK([#include <sys/sendfile.h>
#include <stdio.h>],
[sendfile(1, 1, NULL, 0);],
[
AC_DEFINE(HAVE_SENDFILE4_SUPPORT, 1,
[Define this if Linux/Solaris sendfile() is supported])
AC_MSG_RESULT([Linux sendfile()])
ac_sendfile_supported=yes
], [])
if test x$ac_sendfile_supported = xno; then
dnl Checking wether we need libsendfile
dnl Presumably on Solaris
AC_CHECK_LIB(sendfile, sendfile,
[
AC_DEFINE(HAVE_SENDFILE4_SUPPORT, 1,
[Define this if Linux/Solaris sendfile() is supported])
SENDFILE_LIBS="-lsendfile"
AC_SUBST(SENDFILE_LIBS)
AC_MSG_RESULT([Solaris sendfile()])
ac_sendfile_supported=yes
], [])
fi
if test x$ac_sendfile_supported = xno; then
dnl Checking wether we have FreeBSD-like sendfile() support.
AC_TRY_LINK([#include <sys/socket.h>
#include <stdio.h>],
[sendfile(1, 1, 0, 0, NULL, NULL, 0);],
[
AC_DEFINE(HAVE_SENDFILE7_SUPPORT, 1,
[Define this if FreeBSD sendfile() is supported])
AC_MSG_RESULT([FreeBSD sendfile()])
ac_sendfile_supported=yes
], [])
fi
if test x$ac_sendfile_supported = xno; then
dnl Checking wether we have MacOS-like sendfile() support.
AC_TRY_LINK([#include <sys/socket.h>
#include <stdio.h>
#include <sys/uio.h>],
[sendfile(1, 1, 0, NULL, NULL, 0);],
[
AC_DEFINE(HAVE_SENDFILE6_SUPPORT, 1,
[Define this if MacOS sendfile() is supported])
AC_MSG_RESULT([MacOS sendfile()])
ac_sendfile_supported=yes
], [])
fi
CFLAGS="$saved_CFLAGS"
if test x$ac_sendfile_supported = xno; then
AC_MSG_RESULT([no sendfile() support, using read/send])
fi
])

View File

@ -1,17 +0,0 @@
AUTOMAKE_OPTIONS = gnu
EXTRA_DIST = \
apache.conf.in \
logrotate.conf.in \
syslog.conf.in \
zoneminder-tmpfiles.conf.in \
zoneminder.service.in \
com.zoneminder.systemctl.policy.in \
com.zoneminder.systemctl.rules.in
polkit_actiondir = @POLKIT_PREFIX@/share/polkit-1/actions
dist_polkit_action_DATA = com.zoneminder.systemctl.policy
polkit_rulesdir = @POLKIT_PREFIX@/share/polkit-1/rules.d
dist_polkit_rules_DATA = com.zoneminder.systemctl.rules

View File

@ -1,26 +0,0 @@
AUTOMAKE_OPTIONS = gnu
# Ack! Nasty hack to get modules Makefile regenerated if wiped with make clean
all-local: proxy/Makefile modules/Makefile
proxy/Makefile: proxy/Makefile.PL
( cd proxy; perl Makefile.PL )
modules/Makefile: modules/Makefile.PL
( cd modules; perl Makefile.PL )
SUBDIRS = \
. \
proxy \
modules \
scripts
EXTRA_DIST = \
proxy/Makefile.PL \
proxy/lib \
modules/Makefile.PL \
modules/lib \
wsdl \
doc \
patches

View File

@ -1,5 +0,0 @@
AUTOMAKE_OPTIONS = gnu
bin_SCRIPTS = \
zmonvif-probe.pl

View File

@ -1,77 +0,0 @@
AUTOMAKE_OPTIONS = gnu
# Ack! Nasty hack to get modules Makefile regenerated if wiped with make clean
all-local: ZoneMinder/Makefile
ZoneMinder/Makefile: ZoneMinder/Makefile.PL
( cd ZoneMinder; perl Makefile.PL )
bin_SCRIPTS = \
zmdc.pl \
zmaudit.pl \
zmfilter.pl \
zmtelemetry.pl \
zmtrigger.pl \
zmx10.pl \
zmwatch.pl \
zmpkg.pl \
zmupdate.pl \
zmvideo.pl \
zmcontrol.pl \
zmtrack.pl \
zmcamtool.pl \
zmsystemctl.pl
SUBDIRS = \
. \
ZoneMinder
EXTRA_DIST = \
zmdc.pl.in \
zmaudit.pl.in \
zmfilter.pl.in \
zmtelemetry.pl.in \
zmtrigger.pl.in \
zmx10.pl.in \
zmwatch.pl.in \
zmpkg.pl.in \
zmupdate.pl.in \
zmvideo.pl.in \
zmcontrol.pl.in \
zmtrack.pl.in \
zmcamtool.pl.in \
zmsystemctl.pl.in \
ZoneMinder/Makefile.PL \
ZoneMinder/README \
ZoneMinder/Changes \
ZoneMinder/META.yml \
ZoneMinder/MANIFEST \
ZoneMinder/t/ZoneMinder.t \
ZoneMinder/lib/ZoneMinder.pm \
ZoneMinder/lib/ZoneMinder/Base.pm.in \
ZoneMinder/lib/ZoneMinder/Config.pm.in \
ZoneMinder/lib/ZoneMinder/Logger.pm \
ZoneMinder/lib/ZoneMinder/General.pm \
ZoneMinder/lib/ZoneMinder/Database.pm \
ZoneMinder/lib/ZoneMinder/Memory.pm.in \
ZoneMinder/lib/ZoneMinder/Memory/Shared.pm \
ZoneMinder/lib/ZoneMinder/Memory/Mapped.pm \
ZoneMinder/lib/ZoneMinder/ConfigAdmin.pm \
ZoneMinder/lib/ZoneMinder/ConfigData.pm.in \
ZoneMinder/lib/ZoneMinder/Control.pm \
ZoneMinder/lib/ZoneMinder/Control \
ZoneMinder/lib/ZoneMinder/Trigger/Channel.pm \
ZoneMinder/lib/ZoneMinder/Trigger/Channel/Handle.pm \
ZoneMinder/lib/ZoneMinder/Trigger/Channel/Spawning.pm \
ZoneMinder/lib/ZoneMinder/Trigger/Channel/Inet.pm \
ZoneMinder/lib/ZoneMinder/Trigger/Channel/Unix.pm \
ZoneMinder/lib/ZoneMinder/Trigger/Channel/File.pm \
ZoneMinder/lib/ZoneMinder/Trigger/Channel/Serial.pm \
ZoneMinder/lib/ZoneMinder/Trigger/Connection.pm \
ZoneMinder/lib/ZoneMinder/Trigger/Connection/Example.pm \
zm.in \
zmdbbackup.in \
zmdbrestore.in \
zmeventdump.in \
zmlogrotate.conf.in

View File

@ -66,12 +66,6 @@ use Carp;
BEGIN BEGIN
{ {
my $config_file = ZM_CONFIG; my $config_file = ZM_CONFIG;
( my $local_config_file = $config_file ) =~ s|^.*/|./|;
if ( -s $local_config_file and -r $local_config_file )
{
print( STDERR "Warning, overriding installed $local_config_file file with local copy\n" );
$config_file = $local_config_file;
}
open( my $CONFIG, "<", $config_file ) open( my $CONFIG, "<", $config_file )
or croak( "Can't open config file '$config_file': $!" ); or croak( "Can't open config file '$config_file': $!" );
foreach my $str ( <$CONFIG> ) foreach my $str ( <$CONFIG> )

View File

@ -3759,161 +3759,6 @@ body = "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% s
type => $types{integer}, type => $types{integer},
category => "lowband", category => "lowband",
}, },
{
name => "ZM_WEB_P_CAN_STREAM",
default => "auto",
description => "Override the automatic detection of browser streaming capability",
help => qqq("
If you know that your browser can handle image streams of the
type 'multipart/x-mixed-replace' but ZoneMinder does not detect
this correctly you can set this option to ensure that the
stream is delivered with or without the use of the Cambozola
plugin. Selecting 'yes' will tell ZoneMinder that your browser
can handle the streams natively, 'no' means that it can't and
so the plugin will be used while 'auto' lets ZoneMinder decide.
"),
type => $types{tristate},
category => "phoneband",
},
{
name => "ZM_WEB_P_STREAM_METHOD",
default => "jpeg",
description => "Which method should be used to send video streams to your browser.",
help => qqq("
ZoneMinder can be configured to use either mpeg encoded video
or a series or still jpeg images when sending video streams.
This option defines which is used. If you choose mpeg you
should ensure that you have the appropriate plugins available
on your browser whereas choosing jpeg will work natively on
Mozilla and related browsers and with a Java applet on Internet
Explorer
"),
type => {
db_type =>"string",
hint =>"mpeg|jpeg",
pattern =>qr|^([mj])|i,
format =>q( $1 =~ /^m/ ? "mpeg" : "jpeg" )
},
category => "phoneband",
},
{
name => "ZM_WEB_P_DEFAULT_SCALE",
default => "100",
description => "What the default scaling factor applied to 'live' or 'event' views is (%)",
help => qqq("
Normally ZoneMinder will display 'live' or 'event' streams in
their native size. However if you have monitors with large
dimensions or a slow link you may prefer to reduce this size,
alternatively for small monitors you can enlarge it. This
options lets you specify what the default scaling factor will
be. It is expressed as a percentage so 100 is normal size, 200
is double size etc.
"),
type => {
db_type =>"integer",
hint =>"25|33|50|75|100|150|200|300|400",
pattern =>qr|^(\d+)$|, format=>q( $1 )
},
category => "phoneband",
},
{
name => "ZM_WEB_P_DEFAULT_RATE",
default => "100",
description => "What the default replay rate factor applied to 'event' views is (%)",
help => qqq("
Normally ZoneMinder will display 'event' streams at their
native rate, i.e. as close to real-time as possible. However if
you have long events it is often convenient to replay them at a
faster rate for review. This option lets you specify what the
default replay rate will be. It is expressed as a percentage so
100 is normal rate, 200 is double speed etc.
"),
type => {
db_type =>"integer",
hint =>"25|50|100|150|200|400|1000|2500|5000|10000",
pattern =>qr|^(\d+)$|,
format =>q( $1 )
},
category => "phoneband",
},
{
name => "ZM_WEB_P_VIDEO_BITRATE",
default => "8000",
description => "What the bitrate of the video encoded stream should be set to",
help => qqq("
When encoding real video via the ffmpeg library a bit rate can
be specified which roughly corresponds to the available
bandwidth used for the stream. This setting effectively
corresponds to a 'quality' setting for the video. A low value
will result in a blocky image whereas a high value will produce
a clearer view. Note that this setting does not control the
frame rate of the video however the quality of the video
produced is affected both by this setting and the frame rate
that the video is produced at. A higher frame rate at a
particular bit rate result in individual frames being at a
lower quality.
"),
type => $types{integer},
category => "phoneband",
},
{
name => "ZM_WEB_P_VIDEO_MAXFPS",
default => "5",
description => "What the maximum frame rate for streamed video should be",
help => qqq("
When using streamed video the main control is the bitrate which
determines how much data can be transmitted. However a lower
bitrate at high frame rates results in a lower quality image.
This option allows you to limit the maximum frame rate to
ensure that video quality is maintained. An additional
advantage is that encoding video at high frame rates is a
processor intensive task when for the most part a very high
frame rate offers little perceptible improvement over one that
has a more manageable resource requirement. Note, this option
is implemented as a cap beyond which binary reduction takes
place. So if you have a device capturing at 15fps and set this
option to 10fps then the video is not produced at 10fps, but
rather at 7.5fps (15 divided by 2) as the final frame rate must
be the original divided by a power of 2.
"),
type => $types{integer},
category => "phoneband",
},
{
name => "ZM_WEB_P_SCALE_THUMBS",
default => "yes",
description => "Scale thumbnails in events, bandwidth versus cpu in rescaling",
help => qqq("
If unset, this option sends the whole image to the browser
which resizes it in the window. If set the image is scaled down
on the server before sending a reduced size image to the
browser to conserve bandwidth at the cost of cpu on the server.
Note that ZM can only perform the resizing if the appropriate
PHP graphics functionality is installed. This is usually
available in the php-gd package.
"),
type => $types{boolean},
category => "phoneband",
},
{
name => "ZM_WEB_P_AJAX_TIMEOUT",
default => "10000",
description => "How long to wait for Ajax request responses (ms)",
help => qqq("
The newer versions of the live feed and event views use Ajax to
request information from the server and populate the views
dynamically. This option allows you to specify a timeout if
required after which requests are abandoned. A timeout may be
necessary if requests would overwise hang such as on a slow
connection. This would tend to consume a lot of browser memory
and make the interface unresponsive. Ordinarily no requests
should timeout so this setting should be set to a value greater
than the slowest expected response. This value is in
milliseconds but if set to zero then no timeout will be used.
"),
type => $types{integer},
category => "phoneband",
},
{ {
name => "ZM_DYN_LAST_VERSION", name => "ZM_DYN_LAST_VERSION",
default => "", default => "",
@ -3980,141 +3825,6 @@ body = "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% s
readonly => 1, readonly => 1,
category => "dynamic", category => "dynamic",
}, },
{
name => "ZM_EYEZM_DEBUG",
default => "no",
description => "Switch additional debugging on for eyeZm Plugin",
help => qqq("
Enable or Disable extra debugging from the eyeZm Plugin. Extra
debugging information will be displayed in it's own file
(EYEZM_LOG_TO_FILE is set), or your Apache error log
"),
type => $types{boolean},
category => "eyeZm",
},
{
name => "ZM_EYEZM_LOG_TO_FILE",
default => "yes",
description => "When eyeZm Debugging is enabled, enabling this logs output to it's own file",
help => qqq("
When EYEZM_DEBUG is on and EYEZM_LOG_TO_FILE is on, output
generated from the eyeZm Plugin will go to it's own file.
Otherwise it will go to the apache error log.
"),
type => $types{boolean},
category => "eyeZm",
},
{
name => "ZM_EYEZM_LOG_FILE",
default => "@ZM_LOGDIR@/zm_xml.log",
description => "Default filename to use when logging eyeZm Output and EYEZM_LOG_TO_FILE is enabled",
help => qqq("
This file will contain it's own output from the eyeZm Plugin
when EYEZM_LOG_TO_FILE and EYEZM_DEBUG are both enabled
"),
type => $types{string},
category => "eyeZm",
},
{
name => "ZM_EYEZM_EVENT_VCODEC",
default => "mpeg4",
description => "Default video-codec to use for encoding events",
help => qqq("
The eyeZm Plugin calls FFMPEG externally to encode the captured
images. If your FFMPEG is not built with support for H264,
change this to MPEG-4. If using H264, please check
http://www.eyezm.com for H264 requirements and that your eyeZm
version supports H264 (v1.2+).
"),
type => {
db_type =>"string",
hint =>"mpeg4|h264",
pattern =>qr|^([mh])|i,
format =>q( $1 =~ /^m/ ? "mpeg4" : "h264" )
},
category => "eyeZm",
},
{
name => "ZM_EYEZM_FEED_VCODEC",
default => "mjpeg",
description => "Default video-codec to use for streaming the live feed",
help => qqq("
Determines whether the live stream is generated using native
MJPEG streaming with ZoneMinder, or H264 using FFMPEG and
HTML-5 streaming. If using H264, please check
http://www.eyezm.com for H264 requirements and that your eyeZm
version supports H264 (v1.2+). This is just a default
parameter, and can be overridden with eyeZm.
"),
type => {
db_type =>"string",
hint =>"mjpeg|h264",
pattern =>qr|^([mh])|i,
format =>q( $1 =~ /^m/ ? "mjpeg" : "h264" )
},
category => "eyeZm",
},
{
name => "ZM_EYEZM_H264_DEFAULT_BR",
default => "96k",
description => "Default bit-rate to use with FFMPEG for H264 streaming",
help => qqq("
When using the eyeZm Plugin to stream H264 data, FFMPEG
requires a bitrate to control the quality and bandwidth of the
video. This should be specified in a format acceptable to
FFMPEG. The default value is sufficient for most installations.
This is just a default parameter, and can be overridden with
eyeZm.
"),
type => $types{string},
category => "eyeZm",
},
{
name => "ZM_EYEZM_H264_DEFAULT_EVBR",
default => "128k",
description => "Default bit-rate to use with FFMPEG for H264 event viewing",
help => qqq("
When using the eyeZm Plugin to view events in H264, FFMPEG
requires a bitrate to control the quality and bandwidth of the
video. This should be specified in a format acceptable to
FFMPEG. The default value is sufficient for most installations.
This is just a default parameter, and can be overridden with
eyeZm.
"),
type => $types{string},
category => "eyeZm",
},
{
name => "ZM_EYEZM_H264_TIMEOUT",
default => "20",
description => "Timeout (sec) to wait for H264 stream to start before terminating",
help => qqq("
The eyeZm Plugin will attempt to spawn an H264 stream when
requested, and require that it complete within the timeout
specified. If you have a slow system or find through the logs
that the H264 stream is not starting because the timeout is
expiring, even though FFMPEG is running, try increasing this
value. If you have a fast system, decreasing this value can
improve the responsiveness when there are issues starting H264
streams
"),
type => $types{string},
category => "eyeZm",
},
{
name => "ZM_EYEZM_SEG_DURATION",
default => "3",
description => "Segment duration used for streaming using HTTP-5 Streaming protocol",
help => qqq("
The HTTP-5 Live Streaming Protocol segments the input video
stream into small chunks of a duration specified by this
parameter. Increasing the segment duration will help with
choppy connections on the other end, but will increase the
latency in starting a stream.
"),
type => $types{string},
category => "eyeZm",
},
); );
our %options_hash = map { ( $_->{name}, $_ ) } @options; our %options_hash = map { ( $_->{name}, $_ ) } @options;

View File

@ -14,21 +14,19 @@ add_executable(zma zma.cpp)
add_executable(zmu zmu.cpp) add_executable(zmu zmu.cpp)
add_executable(zmf zmf.cpp) add_executable(zmf zmf.cpp)
add_executable(zms zms.cpp) add_executable(zms zms.cpp)
add_executable(zmstreamer zmstreamer.cpp)
target_link_libraries(zmc zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) target_link_libraries(zmc zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS})
target_link_libraries(zma zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) target_link_libraries(zma zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS})
target_link_libraries(zmu zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) target_link_libraries(zmu zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS})
target_link_libraries(zmf zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) target_link_libraries(zmf zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS})
target_link_libraries(zms zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) target_link_libraries(zms zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS})
target_link_libraries(zmstreamer zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS})
# Generate man files for the binaries destined for the bin folder # Generate man files for the binaries destined for the bin folder
FOREACH(CBINARY zma zmc zmf zmu zmstreamer) FOREACH(CBINARY zma zmc zmf zmu)
POD2MAN(${CMAKE_CURRENT_SOURCE_DIR}/${CBINARY}.cpp zoneminder-${CBINARY} 8) POD2MAN(${CMAKE_CURRENT_SOURCE_DIR}/${CBINARY}.cpp zoneminder-${CBINARY} 8)
ENDFOREACH(CBINARY zma zmc zmf zmu zmstreamer) ENDFOREACH(CBINARY zma zmc zmf zmu)
install(TARGETS zmc zma zmu zmf zmstreamer RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) install(TARGETS zmc zma zmu zmf RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(TARGETS zms RUNTIME DESTINATION "${ZM_CGIDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) install(TARGETS zms RUNTIME DESTINATION "${ZM_CGIDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(CODE "execute_process(COMMAND ln -sf zms nph-zms WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})" ) install(CODE "execute_process(COMMAND ln -sf zms nph-zms WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})" )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/nph-zms DESTINATION "${ZM_CGIDIR}") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/nph-zms DESTINATION "${ZM_CGIDIR}")

View File

@ -1,139 +0,0 @@
AUTOMAKE_OPTIONS = gnu
AM_CPPFLAGS = @MYSQL_CFLAGS@ @MARIADB_CFLAGS@ @FFMPEG_CFLAGS@ -Wall -finline-functions -fomit-frame-pointer
#AM_CXXFLAGS = -frepo
CLEANFILES = *.rpo
# This should be set to your CGI directory
cgidir = @CGI_PREFIX@
# And these to the user and group of your webserver
webuser = @WEB_USER@
webgroup = @WEB_GROUP@
bin_PROGRAMS = \
zmc \
zma \
zmu \
zms \
zmf \
zmstreamer
zm_SOURCES = \
zm_box.cpp \
zm_buffer.cpp \
zm_camera.cpp \
zm_comms.cpp \
zm_config.cpp \
zm_coord.cpp \
zm_curl_camera.cpp \
zm.cpp \
zm_db.cpp \
zm_logger.cpp \
zm_event.cpp \
zm_exception.cpp \
zm_file_camera.cpp \
zm_ffmpeg_camera.cpp \
zm_image.cpp \
zm_jpeg.cpp \
zm_libvlc_camera.cpp \
zm_local_camera.cpp \
zm_monitor.cpp \
zm_ffmpeg.cpp \
zm_mpeg.cpp \
zm_poly.cpp \
zm_regexp.cpp \
zm_remote_camera.cpp \
zm_remote_camera_http.cpp \
zm_remote_camera_rtsp.cpp \
zm_rtp.cpp \
zm_rtp_ctrl.cpp \
zm_rtp_data.cpp \
zm_rtp_source.cpp \
zm_rtsp.cpp \
zm_rtsp_auth.cpp \
zm_sdp.cpp \
zm_signal.cpp \
zm_stream.cpp \
zm_thread.cpp \
zm_time.cpp \
zm_timer.cpp \
zm_user.cpp \
zm_utils.cpp \
zm_video.cpp \
zm_videostore.cpp \
zm_zone.cpp
zmc_SOURCES = zmc.cpp $(zm_SOURCES)
zma_SOURCES = zma.cpp $(zm_SOURCES)
zms_SOURCES = zms.cpp $(zm_SOURCES)
zmu_SOURCES = zmu.cpp $(zm_SOURCES)
zmf_SOURCES = zmf.cpp $(zm_SOURCES)
zmstreamer_SOURCES = zmstreamer.cpp $(zm_SOURCES)
noinst_HEADERS = \
jinclude.h \
zm_box.h \
zm_buffer.h \
zm_camera.h \
zm_comms.h \
zm_config_defines.h \
zm_config.h \
zm_coord.h \
zm_curl_camera.h \
zm_db.h \
zm_logger.h \
zm_event.h \
zm_exception.h \
zmf.h \
zm_file_camera.h \
zm_ffmpeg_camera.h \
zm_font.h \
zm_font.h \
zm.h \
zm_image.h \
zm_jpeg.h \
zm_libvlc_camera.h \
zm_local_camera.h \
zm_mem_utils.h \
zm_monitor.h \
zm_ffmpeg.h \
zm_mpeg.h \
zm_poly.h \
zm_regexp.h \
zm_remote_camera.h \
zm_remote_camera_http.h \
zm_remote_camera_rtsp.h \
zm_rgb.h \
zm_rtp_ctrl.h \
zm_rtp_data.h \
zm_rtp.h \
zm_rtp_source.h \
zm_rtsp.h \
zm_sdp.h \
zm_signal.h \
zm_stream.h \
zm_thread.h \
zm_time.h \
zm_timer.h \
zm_user.h \
zm_utils.h \
zm_video.h \
zm_videostore.h \
zm_zone.h
EXTRA_DIST = \
zm_config.h.in \
zm_threaddata.cpp
dist-hook:
@( rm $(distdir)/zm_config.h )
# Yes, you are correct. This is a HACK!
install-exec-hook:
( cd $(DESTDIR)@bindir@; mkdir -p $(DESTDIR)$(cgidir); mv zms $(DESTDIR)$(cgidir) )
( cd $(DESTDIR)$(cgidir); chown $(webuser):$(webgroup) zms; ln -f zms nph-zms )
uninstall-hook:
( cd $(DESTDIR)$(cgidir); rm -f zms nph-zms )

View File

@ -262,6 +262,11 @@ bool RtpSource::handlePacket( const unsigned char *packet, size_t packetLen )
int rtpHeaderSize = 12 + rtpHeader->cc * 4; int rtpHeaderSize = 12 + rtpHeader->cc * 4;
// No need to check for nal type as non fragmented packets already have 001 start sequence appended // No need to check for nal type as non fragmented packets already have 001 start sequence appended
bool h264FragmentEnd = (mCodecId == AV_CODEC_ID_H264) && (packet[rtpHeaderSize+1] & 0x40); bool h264FragmentEnd = (mCodecId == AV_CODEC_ID_H264) && (packet[rtpHeaderSize+1] & 0x40);
// M stands for Market, it is the 8th bit
// The interpretation of the marker is defined by a profile. It is intended
// to allow significant events such as frame boundaries to be marked in the
// packet stream. A profile may define additional marker bits or specify
// that there is no marker bit by changing the number of bits in the payload type field.
bool thisM = rtpHeader->m || h264FragmentEnd; bool thisM = rtpHeader->m || h264FragmentEnd;
if ( updateSeq( ntohs(rtpHeader->seqN) ) ) if ( updateSeq( ntohs(rtpHeader->seqN) ) )
@ -275,15 +280,18 @@ bool RtpSource::handlePacket( const unsigned char *packet, size_t packetLen )
if( mCodecId == AV_CODEC_ID_H264 ) if( mCodecId == AV_CODEC_ID_H264 )
{ {
int nalType = (packet[rtpHeaderSize] & 0x1f); int nalType = (packet[rtpHeaderSize] & 0x1f);
Debug( 3, "Have H264 frame: nal type is %d", nalType );
switch (nalType) switch (nalType)
{ {
case 24: case 24: // STAP-A
{ {
extraHeader = 2; extraHeader = 2;
break; break;
} }
case 25: case 26: case 27: case 25: // STAP-B
case 26: // MTAP-16
case 27: // MTAP-24
{ {
extraHeader = 3; extraHeader = 3;
break; break;
@ -304,6 +312,9 @@ bool RtpSource::handlePacket( const unsigned char *packet, size_t packetLen )
extraHeader = 2; extraHeader = 2;
break; break;
} }
default: {
Debug(3, "Unhandled nalType %d", nalType );
}
} }
// Append NAL frame start code // Append NAL frame start code
@ -311,6 +322,8 @@ bool RtpSource::handlePacket( const unsigned char *packet, size_t packetLen )
mFrame.append( "\x0\x0\x1", 3 ); mFrame.append( "\x0\x0\x1", 3 );
} }
mFrame.append( packet+rtpHeaderSize+extraHeader, packetLen-rtpHeaderSize-extraHeader ); mFrame.append( packet+rtpHeaderSize+extraHeader, packetLen-rtpHeaderSize-extraHeader );
} else {
Debug( 3, "NOT H264 frame: type is %d", mCodecId );
} }
Hexdump( 4, mFrame.head(), 16 ); Hexdump( 4, mFrame.head(), 16 );

View File

@ -1,252 +0,0 @@
//
// ZoneMinder Streamer, $Date: 2010-10-14 23:21:00 +0200 (Thu, 14 Oct 2010) $
// Copyright (C) 2001-2010 Philip Coombes, Chris Kistner
//
// This program is based on revision 3143 of
// http://svn.zoneminder.com/svn/zm/trunk/src/zms.cpp
//
// 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.
/*
=head1 NAME
zmstreamer - eyeZM video streamer
=head1 SYNOPSIS
zmstreamer -e <mode>
zmstreamer -o <format>
zmstreamer -u <buffer size>
zmstreamer -f <maximum fps>
zmstreamer -s <scale>
zmstreamer -b <bitrate in bps>
zmstreamer -m <monitor id>
zmstreamer -d <debug mode>
zmstreamer -i
zmstreamer -?
zmstreamer -h
zmstreamer -v
=head1 DESCRIPTION
*DEPRECIATED* The xml skin and all files associated with the xml skin are now
depreciated. Please use the ZoneMinder API instead.
This binary works in conjunction with the XML skin to stream video to iPhones
running the eyeZm app.
=head1 OPTIONS
-e <mode> - Specify output mode: mpeg/jpg/zip/single/raw.
-o <format> - Specify output format.
-u <buffer size> - Specify buffer size in ms.
-f <maximum fps> - Specify maximum framerate.
-s <scale> - Specify scale.
-b <bitrate in bps> - Specify bitrate.
-m <monitor id> - Specify monitor id.
-d <debug mode> - 0 = off, 1 = no streaming, 2 = with streaming.
-i, -?, -h - Display usage information
-v - Print the installed version of ZoneMinder
=cut
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include "zm.h"
#include "zm_db.h"
#include "zm_user.h"
#include "zm_signal.h"
#include "zm_monitor.h"
#include "zm_stream.h"
// Possible command-line options
#define OPTIONS "e:o:u:f:s:b:m:d:i:?:h:v"
// Default ZMS values
#define ZMS_DEFAULT_DEBUG 0
#define ZMS_DEFAULT_ID 1
#define ZMS_DEFAULT_BITRATE 100000
#define ZMS_DEFAULT_SCALE 100
#define ZMS_DEFAULT_MODE "mpeg"
#define ZMS_DEFAULT_FORMAT "asf"
#define ZMS_DEFAULT_FPS 25.0
#define ZMS_DEFAULT_BUFFER 1000
int main(int argc, char** argv) {
self = argv[0];
// Set initial values to the default values
int debug = ZMS_DEFAULT_DEBUG;
int id = ZMS_DEFAULT_ID;
int bitrate = ZMS_DEFAULT_BITRATE;
int scale = ZMS_DEFAULT_SCALE;
char mode[32];
sprintf(mode, "%s", ZMS_DEFAULT_MODE);
char format[32];
sprintf(format, "%s", ZMS_DEFAULT_FORMAT);
double maxfps = ZMS_DEFAULT_FPS;
int buffer = ZMS_DEFAULT_BUFFER;
// Parse command-line options
int arg;
while ((arg = getopt(argc, argv, OPTIONS)) != -1) {
switch (arg) {
case 'e':
sprintf(mode, "%s", optarg);
break;
case 'o':
sprintf(format, "%s", optarg);
break;
case 'u':
buffer = atoi(optarg);
break;
case 'f':
maxfps = atof(optarg);
break;
case 's':
scale = atoi(optarg);
break;
case 'b':
bitrate = atoi(optarg);
break;
case 'm':
id = atoi(optarg);
break;
case 'd':
debug = atoi(optarg);
break;
case 'h':
case 'i':
case '?':
printf("-e <mode> : Specify output mode: mpeg/jpg/zip/single/raw. Default = %s\n", ZMS_DEFAULT_MODE);
printf("-o <format> : Specify output format. Default = %s\n", ZMS_DEFAULT_FORMAT);
printf("-u <buffer size> : Specify buffer size in ms. Default = %d\n", ZMS_DEFAULT_BUFFER);
printf("-f <maximum fps> : Specify maximum framerate. Default = %lf\n", ZMS_DEFAULT_FPS);
printf("-s <scale> : Specify scale. Default = %d\n", ZMS_DEFAULT_SCALE);
printf("-b <bitrate in bps> : Specify bitrate. Default = %d\n", ZMS_DEFAULT_BITRATE);
printf("-m <monitor id> : Specify monitor id. Default = %d\n", ZMS_DEFAULT_ID);
printf("-d <debug mode> : 0 = off, 1 = no streaming, 2 = with streaming. Default = 0\n");
printf("-i or -? or -h: This information\n");
printf("-v : This installed version of ZoneMinder\n");
return EXIT_SUCCESS;
case 'v':
std::cout << ZM_VERSION << "\n";
exit(0);
}
}
// Set stream type
StreamBase::StreamType streamtype;
if (!strcasecmp("raw", mode))
streamtype = MonitorStream::STREAM_RAW;
else if (!strcasecmp("mpeg", mode))
streamtype = MonitorStream::STREAM_MPEG;
else if (!strcasecmp("jpg", mode))
streamtype = MonitorStream::STREAM_JPEG;
else if (!strcasecmp("single", mode))
streamtype = MonitorStream::STREAM_SINGLE;
else if (!strcasecmp("zip", mode))
streamtype = MonitorStream::STREAM_ZIP;
else
streamtype = MonitorStream::STREAM_MPEG;
if (debug) {
// Show stream parameters
printf("Stream parameters:\n");
switch (streamtype) {
case MonitorStream::STREAM_MPEG:
printf("Output mode (-e) = %s\n", "mpeg");
printf("Output format (-o) = %s\n", format);
break;
default:
printf("Output mode (-e) = %s\n", mode);
}
printf("Buffer size (-u) = %d ms\n", buffer);
printf("Maximum FPS (-f) = %lf FPS\n", maxfps);
printf("Scale (-s) = %d%%\n", scale);
printf("Bitrate (-b) = %d bps\n", bitrate);
printf("Monitor Id (-m) = %d\n", id);
}
if (debug) {
// Set ZM debugger to print to stdout
printf("Setting up ZoneMinder debugger to print to stdout...");
setenv("ZM_DBG_PRINT", "1", 1);
printf("Done.\n");
}
// Loading ZM configurations
printf("Loading ZoneMinder configurations...");
zmLoadConfig();
printf("Done.\n");
logInit("zmstreamer");
ssedetect();
// Setting stream parameters
MonitorStream stream;
stream.setStreamScale(scale); // default = 100 (scale)
stream.setStreamReplayRate(100); // default = 100 (rate)
stream.setStreamMaxFPS(maxfps); // default = 10 (maxfps)
if (debug) stream.setStreamTTL(1);
else stream.setStreamTTL(0); // default = 0 (ttl)
stream.setStreamQueue(0); // default = 0 (connkey)
stream.setStreamBuffer(buffer); // default = 0 (buffer)
stream.setStreamStart(id); // default = 0 (monitor_id)
stream.setStreamType(streamtype);
if (streamtype == MonitorStream::STREAM_MPEG) {
#if HAVE_LIBAVCODEC
if (debug) printf("HAVE_LIBAVCODEC is set\n");
stream.setStreamFormat(format); // default = "" (format)
stream.setStreamBitrate(bitrate); // default = 100000 (bitrate)
#else
fprintf(stderr, "MPEG streaming is disabled.\nYou should configure with the --with-ffmpeg option and rebuild to use this functionality.\n");
logTerm();
zmDbClose();
return EXIT_FAILURE;
#endif
}
if (debug != 1) {
if (debug) printf("Running stream...");
// Output headers
fprintf(stdout, "Server: ZoneMinder Video Server/%s\r\n", ZM_VERSION);
time_t now = time(0);
char date_string[64];
strftime(date_string, sizeof (date_string) - 1, "%a, %d %b %Y %H:%M:%S GMT", gmtime(&now));
fprintf(stdout, "Expires: Mon, 26 Jul 1997 05:00:00 GMT\r\n");
fprintf(stdout, "Last-Modified: %s\r\n", date_string);
fprintf(stdout, "Cache-Control: no-store, no-cache, must-revalidate\r\n");
fprintf(stdout, "Cache-Control: post-check=0, pre-check=0\r\n");
fprintf(stdout, "Pragma: no-cache\r\n");
// Run stream
stream.runStream();
}
if (debug) printf("Done.\n");
logTerm();
zmDbClose();
return (EXIT_SUCCESS);
}

View File

@ -1,35 +0,0 @@
AUTOMAKE_OPTIONS = gnu
# This should be set to your web directory
webdir = @WEB_PREFIX@
# And these to the user and group of your webserver
webuser = @WEB_USER@
webgroup = @WEB_GROUP@
SUBDIRS = \
ajax \
css \
graphics \
includes \
js \
lang \
skins \
tools \
views
dist_web_DATA = \
index.php
# Yes, you are correct. This is a HACK!
install-data-hook:
( cd $(DESTDIR)$(webdir); chown $(webuser):$(webgroup) $(dist_web_DATA) )
( cd $(DESTDIR)$(webdir); chown -R $(webuser):$(webgroup) $(SUBDIRS) )
@-( cd $(DESTDIR)$(webdir); if ! test -e events; then mkdir events; fi; chown $(webuser):$(webgroup) events; chmod u+w events )
@-( cd $(DESTDIR)$(webdir); if ! test -e images; then mkdir images; fi; chown $(webuser):$(webgroup) images; chmod u+w images )
@-( cd $(DESTDIR)$(webdir); if ! test -e sounds; then mkdir sounds; fi; chown $(webuser):$(webgroup) sounds; chmod u+w sounds )
@-( cd $(DESTDIR)$(webdir); if ! test -e tools; then mkdir tools; fi; chown $(webuser):$(webgroup) tools; chmod u+w tools )
@-( cd $(DESTDIR)$(webdir); if ! test -e temp; then mkdir temp; fi; chown $(webuser):$(webgroup) temp; chmod u+w temp )
uninstall-hook:
@-( cd $(DESTDIR)$(webdir); rm -rf $(SUBDIRS) )
@-( cd $(DESTDIR)$(webdir); rm -rf events images sounds tools temp )

View File

@ -1,12 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/ajax
dist_web_DATA = \
alarm.php \
control.php \
event.php \
log.php \
status.php \
stream.php \
zone.php

View File

@ -1,8 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/css
dist_web_DATA = \
reset.css \
spinner.css \
overlay.css

View File

@ -1,8 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/graphics
dist_web_DATA = \
favicon.ico \
spinner.gif \
transparent.gif

View File

@ -1,19 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/includes
web_DATA = \
config.php
dist_web_DATA = \
Monitor.php \
Server.php \
actions.php \
database.php \
functions.php \
control_functions.php \
lang.php \
logger.php
EXTRA_DIST = \
config.php.in

View File

@ -921,7 +921,6 @@ if ( !empty($action) )
case "highband" : case "highband" :
case "medband" : case "medband" :
case "lowband" : case "lowband" :
case "phoneband" :
break; break;
} }
} }

View File

@ -985,7 +985,7 @@ function daemonControl( $command, $daemon=false, $args=false )
function zmcControl( $monitor, $mode=false ) function zmcControl( $monitor, $mode=false )
{ {
if ( (!ZM_SERVER) or ( ZM_SERVER==$monitor[ServerId}) ) { if ( (!defined('ZM_SERVER_ID')) or ( ZM_SERVER_ID==$monitor['ServerId'] ) ) {
$row = NULL; $row = NULL;
if ( $monitor['Type'] == "Local" ) if ( $monitor['Type'] == "Local" )
{ {
@ -1016,7 +1016,7 @@ function zmcControl( $monitor, $mode=false )
function zmaControl( $monitor, $mode=false ) function zmaControl( $monitor, $mode=false )
{ {
if ( (!ZM_SERVER) or ( ZM_SERVER==$monitor[ServerId}) ) { if ( (!defined('ZM_SERVER_ID')) or ( ZM_SERVER_ID==$monitor['ServerId'] ) ) {
if ( !is_array( $monitor ) ) if ( !is_array( $monitor ) )
{ {
$monitor = dbFetchOne( "select C.*, M.* from Monitors as M left join Controls as C on (M.ControlId = C.Id ) where M.Id=?", NULL, array($monitor) ); $monitor = dbFetchOne( "select C.*, M.* from Monitors as M left join Controls as C on (M.ControlId = C.Id ) where M.Id=?", NULL, array($monitor) );

View File

@ -1,9 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/js
dist_web_DATA = \
logger.js \
overlay.js \
mootools.ext.js \
videojs.zoomrotate.js

View File

@ -1,25 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/lang
dist_web_DATA = \
big5_big5.php \
cn_zh.php \
cs_cz.php \
de_de.php \
dk_dk.php \
et_ee.php \
en_gb.php \
en_us.php \
es_ar.php \
fr_fr.php \
he_il.php \
hu_hu.php \
it_it.php \
ja_jp.php \
nl_nl.php \
pl_pl.php \
pt_br.php \
ro_ro.php \
ru_ru.php \
se_se.php

View File

@ -1,6 +0,0 @@
AUTOMAKE_OPTIONS = gnu
SUBDIRS = \
classic \
mobile \
xml

View File

@ -1,15 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/classic
SUBDIRS = \
ajax \
css \
graphics \
includes \
js \
lang \
views
dist_web_DATA = \
skin.php

View File

@ -1,5 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/classic/ajax
dist_web_DATA = # No files here

View File

@ -1,7 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/classic/css
SUBDIRS = dark \
flat \
classic

View File

@ -1,10 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/classic/css/classic
SUBDIRS = views
dist_web_DATA = \
skin.css \
control.css \
export.css

View File

@ -1,31 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/classic/css/classic/views
dist_web_DATA = \
console.css \
controlcaps.css \
control.css \
devices.css \
event.css \
events.css \
export.css \
filter.css \
frame.css \
frames.css \
groups.css \
log.css \
monitor.css \
montage_2wide.css \
montage_3wide50enlarge.css \
montage_3wide.css \
montage_4wide.css \
montage.css \
montage_freeform.css \
options.css \
stats.css \
timeline.css \
timeline.css.php \
video.css \
watch.css \
zone.css

View File

@ -1,10 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/classic/css/dark
SUBDIRS = views
dist_web_DATA = \
skin.css \
control.css \
export.css

View File

@ -1,31 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/classic/css/dark/views
dist_web_DATA = \
console.css \
controlcaps.css \
control.css \
devices.css \
event.css \
events.css \
export.css \
filter.css \
frame.css \
frames.css \
groups.css \
log.css \
monitor.css \
montage_2wide.css \
montage_3wide50enlarge.css \
montage_3wide.css \
montage_4wide.css \
montage.css \
montage_freeform.css \
options.css \
stats.css \
timeline.css \
timeline.css.php \
video.css \
watch.css \
zone.css

View File

@ -1,10 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/classic/css/flat
SUBDIRS = views
dist_web_DATA = \
skin.css \
control.css \
export.css

View File

@ -1,31 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/classic/css/flat/views
dist_web_DATA = \
console.css \
controlcaps.css \
control.css \
devices.css \
event.css \
events.css \
export.css \
filter.css \
frame.css \
frames.css \
groups.css \
log.css \
monitor.css \
montage_2wide.css \
montage_3wide50enlarge.css \
montage_3wide.css \
montage_4wide.css \
montage.css \
montage_freeform.css \
options.css \
stats.css \
timeline.css \
timeline.css.php \
video.css \
watch.css \
zone.css

View File

@ -1,23 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/classic/graphics
dist_web_DATA = \
arrow-d.gif \
arrow-dl.gif \
arrow-dr.gif \
arrow-l-d.gif \
arrow-l.gif \
arrow-l-u.gif \
arrow-r.gif \
arrow-s-d.gif \
arrow-s-u.gif \
arrow-u.gif \
arrow-ul.gif \
arrow-ur.gif \
center.gif \
point-g.gif \
point-o.gif \
point-r.gif \
seq-d.gif \
seq-u.gif

View File

@ -1,11 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/classic/includes
dist_web_DATA = \
init.php \
config.php \
functions.php \
control_functions.php \
export_functions.php \
timeline_functions.php

View File

@ -1,10 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/classic/js
dist_web_DATA = \
skin.js \
classic.js \
dark.js \
flat.js \
skin.js.php

View File

@ -1,5 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/classic/lang
dist_web_DATA = # No files here

View File

@ -1,57 +0,0 @@
AUTOMAKE_OPTIONS = gnu
SUBDIRS = \
js
webdir = @WEB_PREFIX@/skins/classic/views
dist_web_DATA = \
bandwidth.php \
blank.php \
console.php \
controlcap.php \
controlcaps.php \
control.php \
controlpreset.php \
cycle.php \
device.php \
devices.php \
donate.php \
error.php \
eventdetail.php \
event.php \
events.php \
export.php \
filter.php \
filtersave.php \
frame.php \
frames.php \
function.php \
group.php \
groups.php \
log.php \
login.php \
logout.php \
Makefile.am \
monitor.php \
monitorpreset.php \
monitorprobe.php \
montage.php \
montagereview.php \
none.php \
onvifprobe.php \
optionhelp.php \
options.php \
postlogin.php \
server.php \
settings.php \
state.php \
stats.php \
status.php \
timeline.php \
user.php \
version.php \
video.php \
watch.php \
zone.php \
zones.php

View File

@ -1,50 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/classic/views/js
dist_web_DATA = \
console.js \
console.js.php \
control.js \
controlpreset.js \
controlpreset.js.php \
cycle.js \
cycle.js.php \
devices.js \
donate.js \
donate.js.php \
event.js \
event.js.php \
events.js \
events.js.php \
export.js \
export.js.php \
filter.js \
filter.js.php \
group.js \
groups.js \
log.js \
login.js \
Makefile.am \
monitor.js \
monitor.js.php \
monitorpreset.js \
monitorprobe.js \
montage.js \
montage.js.php \
onvifprobe.js \
options.js.php \
postlogin.js.php \
state.js \
state.js.php \
timeline.js \
timeline.js.php \
user.js \
version.js \
version.js.php \
video.js \
video.js.php \
watch.js \
watch.js.php \
zone.js \
zone.js.php

View File

@ -37,9 +37,14 @@ function changeScale()
/*Stream could be an applet so can't use moo tools*/ /*Stream could be an applet so can't use moo tools*/
var streamImg = document.getElementById('liveStream'); var streamImg = document.getElementById('liveStream');
streamImg.style.width = newWidth + "px"; if ( streamImg ) {
streamImg.style.height = newHeight + "px"; streamImg.style.width = newWidth + "px";
streamImg.style.height = newHeight + "px";
streamImg.src = streamImg.src.replace(/scale=\d+/i,'scale='+scale);
} else {
console.error("No element found for liveStream.");
}
} }
var alarmState = STATE_IDLE; var alarmState = STATE_IDLE;
@ -205,8 +210,13 @@ function getStreamCmdResponse( respObj, respText )
$('enableDisableAlarms').removeClass( 'hidden' ); $('enableDisableAlarms').removeClass( 'hidden' );
} }
} }
else else {
checkStreamForErrors("getStreamCmdResponse",respObj);//log them checkStreamForErrors("getStreamCmdResponse",respObj);//log them
// Try to reload the image stream.
var streamImg = document.getElementById('liveStream');
if ( streamImg )
streamImg.src = streamImg.src.replace(/rand=\d+/i,'rand='+Math.floor((Math.random() * 1000000) ));
}
var streamCmdTimeout = statusRefreshTimeout; var streamCmdTimeout = statusRefreshTimeout;
if ( alarmState == STATE_ALARM || alarmState == STATE_ALERT ) if ( alarmState == STATE_ALARM || alarmState == STATE_ALERT )

View File

@ -42,8 +42,6 @@ $tabs['x10'] = translate('X10');
$tabs['highband'] = translate('HighBW'); $tabs['highband'] = translate('HighBW');
$tabs['medband'] = translate('MediumBW'); $tabs['medband'] = translate('MediumBW');
$tabs['lowband'] = translate('LowBW'); $tabs['lowband'] = translate('LowBW');
$tabs['phoneband'] = translate('PhoneBW');
$tabs['eyeZm'] = "eyeZm";
$tabs['users'] = translate('Users'); $tabs['users'] = translate('Users');
if ( isset($_REQUEST['tab']) ) if ( isset($_REQUEST['tab']) )

View File

@ -1,14 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/mobile
SUBDIRS = \
ajax \
css \
graphics \
includes \
lang \
views
dist_web_DATA = \
skin.php

View File

@ -1,5 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/mobile/ajax
dist_web_DATA = # No files here

View File

@ -1,6 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/mobile/css
dist_web_DATA = \
skin.css

View File

@ -1,311 +0,0 @@
/*
* Primary look and feel styles
*/
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 100%;
color: #333333;
font-weight: normal;
text-align: center;
}
h1 {
font-family: inherit;
font-size: 120%;
color: #000066;
font-weight: bold;
}
h2 {
font-family: inherit;
font-size: 110%;
color: #000066;
font-weight: bold;
}
h3 {
font-family: inherit;
font-size: 100%;
color: #016A9D;
font-weight: bold;
}
p {
font-family: inherit;
font-size: 100%;
color: #333333;
font-weight: normal;
}
th {
font-weight: bold;
color: #016A9D;
}
a:link {
color: #7F7FB2;
text-decoration: none;
}
a:visited {
color: #7F7FB2;
text-decoration: none;
}
a:hover {
color: #666699;
text-decoration: underline;
}
label {
margin-right: 4px;
}
input,textarea,select {
border: 1px #7F7FB2 solid;
font-family: inherit;
font-size: 100%;
color: #333333;
}
input[type=text], input[type=password], textarea {
padding: 1px;
}
input.noborder {
border: 0;
}
input[disabled] {
color: #888888;
}
img.normal {
border: white solid 1px;
}
img.alarm {
border: red solid 1px;
}
hr {
height: 1px;
width: 100%;
border: 0;
color: #7f7fb2;
background-color: #7f7fb2;
}
/*
* Major league table for multiple inputs or presentation
*/
#content table.major {
margin: 4px auto;
width: 100%;
border-collapse: collapse;
}
#content table.major tr.highlight {
background-color: #eeeeee;
}
#content table.major thead tr th {
padding-top: 6px;
padding-bottom: 6px;
vertical-align: middle;
}
#content table.major tfoot td {
padding-top: 6px;
padding-bottom: 6px;
vertical-align: middle;
}
#content table.major th, #content table.major td {
border: 1px solid #7f7fb2;
padding: 3px;
text-align: left;
}
#content table.major th {
vertical-align: bottom;
}
#content table.major td {
vertical-align: middle;
}
#content table.major th[scope=row] {
padding: 4px 3px 3px;
vertical-align: top;
text-align: right;
}
#content table.major .colMark, #content table.major .colSelect {
text-align: center;
}
/*
* Lesser table for very simple forms
*/
#content table.minor {
width: 200px;
margin: 0 auto;
}
#content table.minor td {
padding: 4px;
}
#content table.minor .colLeft {
width: 50%;
text-align: right;
}
#content table.minor .colRight {
width: 50%;
text-align: left;
}
#content table.minor input[type=submit]
{
margin-top: 4px;
padding: 0 2px;
font-size: 120%;
}
/*
* Behavior classes
*/
.error {
/*font-family: Verdana, Arial, Helvetica, sans-serif;*/
font-size: 100%;
color: #DC143C;
font-weight: bold;
}
.warn {
/*font-family: Verdana, Arial, Helvetica, sans-serif;*/
font-size: 100%;
color: #FF8C00;
font-weight: bold;
}
.info {
/*font-family: Verdana, Arial, Helvetica, sans-serif;*/
font-size: 100%;
color: #688E23;
font-weight: bold;
}
.errorText {
color: #DC143C;
}
.warnText {
color: #FF8C00;
}
.infoText {
color: #688E23;
}
.disabledText {
font-style: italic;
}
/*
* Generic useful classes, especially with mootools
*/
.hidden {
display: none;
}
.invisible {
visibility: hidden;
}
.nowrap {
white-space: nowrap;
}
div.clear {
clear: both;
}
/*
* Primary layout styles
*/
#page {
width: 100%;
}
#header {
width: 98%;
line-height: 24px;
margin: 4px auto 0;
clear: both;
}
#header h2 {
left: 0;
}
#headerControl {
}
#headerButtons {
float: right;
}
#headerButtons a {
margin-left: 8px;
}
#content {
width: 98%;
margin: 4px auto;
line-height: 130%;
text-align: center;
clear: both;
}
#contentTable {
width: 100%;
}
#content p {
margin-top: 4px;
}
#content p.textblock {
text-align: justify;
padding: 4px;
}
#content > input[type=submit], #content > input[type=button] {
margin-top: 4px;
}
#content table input[type=submit], #content table input[type=button] {
margin-top: 0;
}
#contentButtons {
margin: 4px auto 0;
}
#contentButtons input, #contentButtons a {
margin: 0 4px;
}
#footer {
width: 98%;
margin: 4px auto 0;
clear: both;
}

View File

@ -1,5 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/mobile/graphics
dist_web_DATA = # No files here

View File

@ -1,9 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/mobile/includes
dist_web_DATA = \
init.php \
config.php \
functions.php \
control_functions.php

View File

@ -1,63 +0,0 @@
<?php
//
// ZoneMinder xHTML configuration file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// 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.
//
define( 'DEVICE_WIDTH', 240 ); // Default device width for phones and handhelds
define( 'DEVICE_HEIGHT', 320 ); // Default device height for phones and handhelds
define( 'DEVICE_LINES', 10 ); // Default device lines for phones and handhelds
$rates = array(
"5000" => "50x",
"2000" => "20x",
"500" => "5x",
"200" => "2x",
"100" => translate('Real'),
"50" => "1/2x",
);
$scales = array(
"400" => "4x",
"300" => "3x",
"200" => "2x",
"150" => "1.5x",
"100" => translate('Actual'),
"75" => "3/4x",
"50" => "1/2x",
"33" => "1/3x",
"25" => "1/4x",
);
switch ( $_COOKIE['zmBandwidth'] )
{
case "phone" : // Very incomplete at present
{
define( "ZM_WEB_CAN_STREAM", ZM_WEB_P_CAN_STREAM ); // Override the automatic detection of browser streaming capability
define( "ZM_WEB_STREAM_METHOD", ZM_WEB_P_STREAM_METHOD ); // Which method should be used to send video streams to your brow
define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_P_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%)
define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_P_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%)
define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_P_VIDEO_BITRATE ); // What the bitrate of any streamed video should be
define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_P_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be
define( "ZM_WEB_SCALE_THUMBS", ZM_WEB_P_SCALE_THUMBS ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling
define( "ZM_WEB_AJAX_TIMEOUT", ZM_WEB_P_AJAX_TIMEOUT ); // Timeout to use for Ajax requests, no timeout used if unset
break;
}
}
?>

View File

@ -1,184 +0,0 @@
<?php
//
// ZoneMinder web control function library, $Date: 2008-07-25 10:48:16 +0100 (Fri, 25 Jul 2008) $, $Revision: 2612 $
// Copyright (C) 2001-2008 Philip Coombes
//
// 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.
//
function getControlCommands( $monitor )
{
$cmds = array();
$cmds['Wake'] = "wake";
$cmds['Sleep'] = "sleep";
$cmds['Reset'] = "reset";
$cmds['PresetSet'] = "presetSet";
$cmds['PresetGoto'] = "presetGoto";
$cmds['PresetHome'] = "presetHome";
if ( !empty($monitor['CanZoom']) )
{
if ( $monitor['CanZoomCon'] )
$cmds['ZoomRoot'] = "zoomCon";
elseif ( $monitor['CanZoomRel'] )
$cmds['ZoomRoot'] = "zoomRel";
elseif ( $monitor['CanZoomAbs'] )
$cmds['ZoomRoot'] = "zoomAbs";
$cmds['ZoomTele'] = $cmds['ZoomRoot']."Tele";
$cmds['ZoomWide'] = $cmds['ZoomRoot']."Wide";
$cmds['ZoomStop'] = "zoomStop";
$cmds['ZoomAuto'] = "zoomAuto";
$cmds['ZoomMan'] = "zoomMan";
}
if ( !empty($monitor['CanFocus']) )
{
if ( $monitor['CanFocusCon'] )
$cmds['FocusRoot'] = "focusCon";
elseif ( $monitor['CanFocusRel'] )
$cmds['FocusRoot'] = "focusRel";
elseif ( $monitor['CanFocusAbs'] )
$cmds['FocusRoot'] = "focusAbs";
$cmds['FocusFar'] = $cmds['FocusRoot']."Far";
$cmds['FocusNear'] = $cmds['FocusRoot']."Near";
$cmds['FocusStop'] = "focusStop";
$cmds['FocusAuto'] = "focusAuto";
$cmds['FocusMan'] = "focusMan";
}
if ( !empty($monitor['CanIris']) )
{
if ( $monitor['CanIrisCon'] )
$cmds['IrisRoot'] = "irisCon";
elseif ( $monitor['CanIrisRel'] )
$cmds['IrisRoot'] = "irisRel";
elseif ( $monitor['CanIrisAbs'] )
$cmds['IrisRoot'] = "irisAbs";
$cmds['IrisOpen'] = $cmds['IrisRoot']."Open";
$cmds['IrisClose'] = $cmds['IrisRoot']."Close";
$cmds['IrisStop'] = "irisStop";
$cmds['IrisAuto'] = "irisAuto";
$cmds['IrisMan'] = "irisMan";
}
if ( !empty($monitor['CanWhite']) )
{
if ( $monitor['CanWhiteCon'] )
$cmds['WhiteRoot'] = "whiteCon";
elseif ( $monitor['CanWhiteRel'] )
$cmds['WhiteRoot'] = "whiteRel";
elseif ( $monitor['CanWhiteAbs'] )
$cmds['WhiteRoot'] = "whiteAbs";
$cmds['WhiteIn'] = $cmds['WhiteRoot']."In";
$cmds['WhiteOut'] = $cmds['WhiteRoot']."Out";
$cmds['WhiteAuto'] = "whiteAuto";
$cmds['WhiteMan'] = "whiteMan";
}
if ( !empty($monitor['CanGain']) )
{
if ( $monitor['CanGainCon'] )
$cmds['GainRoot'] = "gainCon";
elseif ( $monitor['CanGainRel'] )
$cmds['GainRoot'] = "gainRel";
elseif ( $monitor['CanGainAbs'] )
$cmds['GainRoot'] = "gainAbs";
$cmds['GainUp'] = $cmds['GainRoot']."Up";
$cmds['GainDown'] = $cmds['GainRoot']."Down";
$cmds['GainAuto'] = "gainAuto";
$cmds['GainMan'] = "gainMan";
}
if ( !empty($monitor['CanMove']) )
{
if ( $monitor['CanMoveCon'] )
{
$cmds['MoveRoot'] = "moveCon";
$cmds['Center'] = "moveStop";
}
elseif ( $monitor['CanMoveRel'] )
{
$cmds['MoveRoot'] = "moveRel";
$cmds['Center'] = $cmds['PresetHome'];
}
elseif ( $monitor['CanMoveAbs'] )
{
$cmds['MoveRoot'] = "moveAbs";
$cmds['Center'] = $cmds['PresetHome'];
}
$cmds['MoveUp'] = $cmds['MoveRoot']."Up";
$cmds['MoveDown'] = $cmds['MoveRoot']."Down";
$cmds['MoveLeft'] = $cmds['MoveRoot']."Left";
$cmds['MoveRight'] = $cmds['MoveRoot']."Right";
$cmds['MoveUpLeft'] = $cmds['MoveRoot']."UpLeft";
$cmds['MoveUpRight'] = $cmds['MoveRoot']."UpRight";
$cmds['MoveDownLeft'] = $cmds['MoveRoot']."DownLeft";
$cmds['MoveDownRight'] = $cmds['MoveRoot']."DownRight";
}
return( $cmds );
}
function controlPresets( $monitor, $cmds )
{
define( "MAX_PRESETS", "10" );
$sql = "select * from ControlPresets where MonitorId = '".$monitor['Id']."'";
$labels = array();
foreach( dbFetchAll( $sql ) as $row )
{
$labels[$row['Preset']] = $row['Label'];
}
ob_start();
?>
<div class="presetControls">
<div>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<div class="hidden">
<fieldset>
<input type="hidden" name="view" value="<?php echo $_REQUEST['view'] ?>"/>
<input type="hidden" name="action" value="control"/>
<input type="hidden" name="mid" value="<?php echo $monitor['Id'] ?>"/>
<input type="hidden" name="control" value="<?php echo $cmds['PresetGoto'] ?>"/>
</fieldset>
</div>
<div>
<?php
for ( $i = 1; $i <= min($monitor['NumPresets'],MAX_PRESETS); $i++ )
{
?>
<input type="submit" class="ptzNumBtn" title="<?php echo isset($labels[$i])?$labels[$i]:"" ?>" name="preset" value="<?php echo $i ?>"/>
<?php
}
?>
</div>
</form>
</div>
</div>
<?php
return( ob_get_clean() );
}
function ptzControls( $monitor )
{
$cmds = getControlCommands( $monitor );
if ( $monitor['HasPresets'] )
echo controlPresets( $monitor, $cmds );
return( ob_get_clean() );
}
?>

View File

@ -1,66 +0,0 @@
<?php
function getDeviceScale( $width, $height, $divisor=1 )
{
global $device;
$deviceWidth = (isset($device)&&!empty($device['width']))?$device['width']:DEVICE_WIDTH;
$deviceHeight = (isset($device)&&!empty($device['height']))?$device['height']:DEVICE_HEIGHT;
// Allow for margins etc
//$deviceWidth -= 4;
//$deviceHeight -= 4;
$widthScale = ($deviceWidth*SCALE_BASE)/$width;
$heightScale = ($deviceHeight*SCALE_BASE)/$height;
$scale = ($widthScale<$heightScale)?$widthScale:$heightScale;
if ( $divisor != 1.0 )
$scale = $scale/$divisor;
return( intval($scale) );
}
function xhtmlHeaders( $file, $title )
{
$skinCssFile = getSkinFile( 'css/skin.css' );
$skinCssPhpFile = getSkinFile( 'css/skin.css.php' );
$basename = basename( $file, '.php' );
$viewCssFile = getSkinFile( 'views/css/'.$basename.'.css' );
$viewCssPhpFile = getSkinFile( 'views/css/'.$basename.'.css.php' );
extract( $GLOBALS, EXTR_OVERWRITE );
noCacheHeaders();
header("Content-type: application/xhtml+xml" );
echo( '<?xml version="1.0" encoding="iso-8859-1"?>'."\n" );
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo ZM_WEB_TITLE_PREFIX ?> - <?php echo $title ?></title>
<link rel="icon" type="image/ico" href="graphics/favicon.ico"/>
<link rel="shortcut icon" href="graphics/favicon.ico"/>
<link rel="stylesheet" href="css/reset.css" type="text/css" media="screen"/>
<link rel="stylesheet" href="<?php echo $skinCssFile ?>" type="text/css" media="screen"/>
<?php
if ( $viewCssFile )
{
?>
<link rel="stylesheet" href="<?php echo $viewCssFile ?>" type="text/css" media="screen"/>
<?php
}
if ( $viewCssPhpFile )
{
?>
<style type="text/css">
<?php
require_once( $viewCssPhpFile );
?>
</style>
<?php
}
?>
</head>
<?php
}
?>

View File

@ -1,29 +0,0 @@
<?php
ini_set( "arg_separator.output", "&amp;" );
ini_set( "url_rewriter.tags", "a=href,area=href,frame=src,input=src,fieldset=" );
$cookies = false;
if ( count($_COOKIE) || !empty($_REQUEST['cookies']) )
$cookies = true;
if ( $cookies )
{
ini_set( "session.use_cookies", "1" );
ini_set( "session.use_trans_sid", "0" );
ini_set( "url_rewriter.tags", "" );
}
else
{
//ini_set( "session.auto_start", "1" );
ini_set( "session.use_cookies", "0" );
ini_set( "session.use_trans_sid", "1" );
}
if ( !isset($_SESSION['cookies']) )
{
$_SESSION['cookies'] = $cookies;
if ( $cookies )
setcookie( "cookies", $cookies );
}
?>

View File

@ -1,5 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/mobile/lang
dist_web_DATA = # No files here

View File

@ -1,97 +0,0 @@
<?php
//
// ZoneMinder HTML interface file, $Date: 2008-07-08 16:06:45 +0100 (Tue, 08 Jul 2008) $, $Revision: 2484 $
// Copyright (C) 2001-2008 Philip Coombes
//
// 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.
//
$_COOKIE['zmBandwidth'] = "phone";
//ini_set( "magic_quotes_gpc", "Off" );
// Uncomment if there are language overrides
//if ( $skinLangFile = loadLanguage( ZM_SKIN_PATH ) )
//require_once( $skinLangFile );
if ( isset($_GET['devWidth']) )
{
$device['width'] = $_GET['devWidth'];
}
if ( isset($_GET['devHeight']) )
{
$device['height'] = $_GET['devHeight'];
}
if ( isset($device) )
$_SESSION['device'] = $device;
$wurflFile = "wurfl/wurfl_class.php";
if ( file_exists( $wurflFile ) )
{
require_once( $wurflFile );
$wurfl = new wurfl_class( $wurfl, $wurfl_agents );
// Set the user agent
$wurfl->GetDeviceCapabilitiesFromAgent($_SERVER['HTTP_USER_AGENT']);
//print_r( $wurfl->wurfl_agent );
if ( $wurfl->wurfl_agent )
{
if ( $wurfl->getDeviceCapability( 'html_wi_oma_xhtmlmp_1_0' ) )
{
$device['width'] = $wurfl->getDeviceCapability( 'resolution_width' );
$device['height'] = $wurfl->getDeviceCapability( 'resolution_height' );
}
}
}
else
{
// This is an example of using fixed device strings to just match your phone etc
$devices = array(
array( 'name'=>"Motorola V600", 'ua_match'=>"MOT-V600", 'skin'=>"mobile", 'cookies'=>false, 'width'=>176, 'height'=>220 ),
);
foreach ( $devices as $tempDevice )
{
if ( preg_match( '/'.$tempDevice['ua_match'].'/', $_SERVER['HTTP_USER_AGENT'] ) )
{
$skin = $tempDevice['skin'];
$cookies = $tempDevice['cookies'];
break;
}
}
}
foreach ( getSkinIncludes( 'includes/config.php' ) as $includeFile )
require_once $includeFile;
foreach ( getSkinIncludes( 'includes/functions.php' ) as $includeFile )
require_once $includeFile;
if ( empty($view) )
$view = isset($user)?'console':'login';
if ( !isset($user) && ZM_OPT_USE_AUTH && ZM_AUTH_TYPE == "remote" && !empty( $_SERVER['REMOTE_USER']) )
{
$view = "postlogin";
$action = "login";
$_REQUEST['username'] = $_SERVER['REMOTE_USER'];
}
// If there are additional actions
foreach ( getSkinIncludes( 'includes/actions.php' ) as $includeFile )
require_once $includeFile;
?>

View File

@ -1,22 +0,0 @@
AUTOMAKE_OPTIONS = gnu
SUBDIRS = \
css
webdir = @WEB_PREFIX@/skins/mobile/views
dist_web_DATA = \
console.php \
devices.php \
error.php \
eventdetails.php \
event.php \
events.php \
filter.php \
frame.php \
function.php \
login.php \
montage.php \
state.php \
video.php \
watch.php

View File

@ -1,178 +0,0 @@
<?php
//
// ZoneMinder web console file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// 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.
//
$eventCounts = array(
// Last Hour
array(
"filter" => array(
"terms" => array(
array( "attr" => "Archived", "op" => "=", "val" => "0" ),
array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-1 hour" ),
)
),
),
// Today
array(
"filter" => array(
"terms" => array(
array( "attr" => "Archived", "op" => "=", "val" => "0" ),
array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "today" ),
)
),
),
);
$running = daemonCheck();
$status = $running?translate('Running'):translate('Stopped');
if ( $group = dbFetchOne( "select * from Groups where Name = 'Mobile'" ) )
$groupIds = array_flip(explode( ',', $group['MonitorIds'] ));
$maxWidth = 0;
$maxHeight = 0;
$cycleCount = 0;
$monitors = dbFetchAll( "select * from Monitors order by Sequence asc" );
for ( $i = 0; $i < count($monitors); $i++ )
{
if ( !visibleMonitor( $monitors[$i]['Id'] ) )
{
continue;
}
if ( $group && !empty($groupIds) && !array_key_exists( $monitors[$i]['Id'], $groupIds ) )
{
continue;
}
$monitors[$i]['Show'] = true;
$monitors[$i]['zmc'] = zmcStatus( $monitors[$i] );
$monitors[$i]['zma'] = zmaStatus( $monitors[$i] );
$counts = array();
for ( $j = 0; $j < count($eventCounts); $j++ )
{
$filter = addFilterTerm( $eventCounts[$j]['filter'], count($eventCounts[$j]['filter']['terms']), array( "cnj" => "and", "attr" => "MonitorId", "op" => "=", "val" => $monitors[$i]['Id'] ) );
parseFilter( $filter, false, '&amp;' );
$counts[] = "count(if(1".$filter['sql'].",1,NULL)) as EventCount$j";
$monitors[$i]['eventCounts'][$j]['filter'] = $filter;
}
$sql = "select ".join($counts,", ")." from Events as E where MonitorId = '".$monitors[$i]['Id']."'";
$counts = dbFetchOne( $sql );
if ( $monitors[$i]['Function'] != 'None' )
{
$cycleCount++;
if ( $maxWidth < $monitors[$i]['Width'] ) $maxWidth = $monitors[$i]['Width'];
if ( $maxHeight < $monitors[$i]['Height'] ) $maxHeight = $monitors[$i]['Height'];
}
$monitors[$i] = array_merge( $monitors[$i], $counts );
}
xhtmlHeaders( __FILE__, translate('Console') );
?>
<body>
<div id="page">
<div id="header">
<div id="systemTime"><a href="?view=<?php echo $view ?>"><?php echo preg_match( '/%/', DATE_FMT_CONSOLE_SHORT )?strftime( DATE_FMT_CONSOLE_SHORT ):date( DATE_FMT_CONSOLE_SHORT ) ?></a></div>
<div id="systemStats"><?php echo getLoad() ?>/<?php echo getDiskPercent() ?>%</div>
<div id="systemState"><?php echo makeLink( "?view=state", $status, canEdit( 'System' ) ) ?></div>
</div>
<div id="content">
<table id="contentTable">
<?php
for ( $i = 0; $i < count($eventCounts); $i++ )
{
$eventCounts[$i]['total'] = 0;
}
$zoneCount = 0;
foreach( $monitors as $monitor )
{
if ( empty($monitor['Show']) )
continue;
for ( $i = 0; $i < count($eventCounts); $i++ )
{
$eventCounts[$i]['total'] += $monitor['EventCount'.$i];
}
//$zoneCount += $monitor['ZoneCount'];
?>
<tr>
<?php
if ( !$monitor['zmc'] )
$dclass = "errorText";
else
{
if ( !$monitor['zma'] )
$dclass = "warnText";
else
$dclass = "infoText";
}
if ( $monitor['Function'] == 'None' )
$fclass = "errorText";
elseif ( $monitor['Function'] == 'Monitor' )
$fclass = "warnText";
else
$fclass = "infoText";
if ( !$monitor['Enabled'] )
$fclass .= " disabledText";
?>
<td class="colName"><?php echo makeLink( "?view=watch&amp;mid=".$monitor['Id'], substr( $monitor['Name'], 0, 8 ), $running && ($monitor['Function'] != 'None') && canView( 'Stream' ) ) ?></td>
<td class="colFunction"><?php echo makeLink( "?view=function&amp;mid=".$monitor['Id'], "<span class=\"$fclass\">".substr( $monitor['Function'], 0, 4 )."</span>", canEdit( 'Monitors' ) ) ?></td>
<?php
for ( $i = 0; $i < count($eventCounts); $i++ )
{
?>
<td class="colEvents"><?php echo makeLink( "?view=events&amp;page=1".$monitor['eventCounts'][$i]['filter']['query'], $monitor['EventCount'.$i], canView( 'Events' ) ) ?></td>
<?php
}
?>
</tr>
<?php
}
?>
<tr>
<?php
if ( ZM_OPT_X10 ) {
?>
<td><?php echo makeLink( "?view=devices", translate('Devices'), canView('Devices' ) ) ?></td>
<?php
} else {
?>
<td>&nbsp;</td>
<?php
}
if ( $cycleCount > 1 ) {
?>
<td><?php echo makeLink( "?view=montage", translate('Montage'), $running && canView( 'Stream' ) ) ?></td>
<?php
} else {
?>
<td>&nbsp;</td>
<?php
}
for ( $i = 0; $i < count($eventCounts); $i++ )
{
parseFilter( $eventCounts[$i]['filter'], false, '&amp;' );
?>
<td class="colEvents"><?php echo makeLink( "?view=events&amp;page=1".$eventCounts[$i]['filter']['query'], $eventCounts[$i]['total'], canView( 'Events' ) ) ?></td>
<?php
}
?>
</tr>
</table>
</div>
</div>
</body>
</html>

View File

@ -1,6 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/mobile/views/css
dist_web_DATA = \
console.css

View File

@ -1,16 +0,0 @@
#systemTime {
float: left;
}
#systemState {
margin: 0 auto;
text-align: center;
}
#systemStats {
float: right;
}
td.colEvents {
text-align: right;
}

View File

@ -1,73 +0,0 @@
<?php
//
// ZoneMinder web devices file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// 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.
//
if ( !canView( 'Devices' ) )
{
$_REQUEST['view'] = "error";
return;
}
$sql = "select * from Devices where Type = 'X10' order by Name";
$devices = array();
foreach ( dbFetchAll( $sql ) as $row )
{
$row['Status'] = getDeviceStatusX10( $row['KeyString'] );
$devices[] = $row;
}
xhtmlHeaders( __FILE__, translate('Devices') );
?>
<body>
<div id="page">
<div id="header">
<h2><?php echo translate('Devices') ?></h2>
</div>
<div id="content">
<table id="contentTable" class="major">
<?php
foreach( $devices as $device )
{
if ( $device['Status'] == 'ON' )
{
$fclass = "infoText";
}
elseif ( $device['Status'] == 'OFF' )
{
$fclass = "warnText";
}
else
{
$fclass = "errorText";
}
?>
<tr>
<th scope="row" class="<?php echo $fclass ?>"><span class="<?php echo $fclass ?>"><?php echo substr( $device['Name'], 0, 16 ) ?></span></th>
<td><?php echo makeLink( "?view=".$_REQUEST['view']."&amp;action=device&amp;key=".$device['KeyString']."&amp;command=on", translate('On'), canEdit('Devices') ) ?></td>
<td><?php echo makeLink( "?view=".$_REQUEST['view']."&amp;action=device&amp;key=".$device['KeyString']."&amp;command=off", translate('Off'), canEdit('Devices') ) ?></td>
</tr>
<?php
}
?>
</table>
<p><a href="?view=console"><?php echo translate('Console') ?></a></p>
</div>
</div>
</body>
</html>

View File

@ -1,34 +0,0 @@
<?php
//
// ZoneMinder web error view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// 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.
//
xhtmlHeaders( __FILE__, translate('Error') );
?>
<body>
<div id="page">
<div id="header">
<h1>ZoneMinder <?php echo translate('Error') ?></h1>
</div>
<div id="content">
<p><strong><?php echo translate('YouNoPerms') ?></p>
<p><?php echo translate('ContactAdmin') ?></p>
</div>
</div>
</body>
</html>

View File

@ -1,147 +0,0 @@
<?php
//
// ZoneMinder web event view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// 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.
//
if ( !canView( 'Events' ) )
{
$_REQUEST['view'] = "error";
return;
}
$midSql = '';
if ( $user['MonitorIds'] )
{
$midSql = " and MonitorId in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")";
}
$sql = 'select E.*,M.Name as MonitorName from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = ?'.$midSql;
$event = dbFetchOne( $sql, NULL, array($_REQUEST['eid']) );
if ( !empty($_REQUEST['fid']) )
{
$frame = dbFetchOne( 'SELECT * FROM Frames WHERE EventID = ? AND FrameId = ?', NULL, array($_REQUEST['eid'],$_REQUEST['fid']) );
}
elseif ( isset($_REQUEST['fid']) )
{
$frame = dbFetchOne( 'SELECT * FROM Frames WHERE EventID = ? AND Score = ?', NULL, array($_REQUEST['eid'],$event['MaxScore']) );
$_REQUEST['fid'] = $frame['FrameId'];
}
parseSort( true, '&amp;' );
parseFilter( $_REQUEST['filter'], true, '&amp;' );
$filterQuery = $_REQUEST['filter']['query'];
if ( $sortOrder=='asc' ) {
$sql = "select E.* from Events as E inner join Monitors as M on E.MonitorId = M.Id where $sortColumn <= ?".$_REQUEST['filter']['sql'].$midSql." order by $sortColumn desc";
} else {
$sql = "select E.* from Events as E inner join Monitors as M on E.MonitorId = M.Id where $sortColumn >= ?".$_REQUEST['filter']['sql'].$midSql." order by $sortColumn asc";
}
$result = dbQuery( $sql, array( $event[$_REQUEST['sort_field']] ) );
while ( $row = dbFetchNext( $result ) )
{
if ( $row['Id'] == $_REQUEST['eid'] )
{
$prevEvent = dbFetchNext( $result );
break;
}
}
$sql = "select E.* from Events as E inner join Monitors as M on E.MonitorId = M.Id where $sortColumn ".($sortOrder=='asc'?'>=':'<=').' ?'.$_REQUEST['filter']['sql'].$midSql." order by $sortColumn $sortOrder";
$result = dbQuery( $sql, array($event[$_REQUEST['sort_field']]) );
while ( $row = dbFetchNext( $result ) )
{
if ( $row['Id'] == $_REQUEST['eid'] )
{
$nextEvent = dbFetchNext( $result );
break;
}
}
$framesPerPage = 15;
$framesPerLine = 3;
$maxShortcuts = 3;
$paged = $event['Frames'] > $framesPerPage;
if ( $paged && !empty($_REQUEST['page']) )
{
$loFrameId = (($_REQUEST['page']-1)*$framesPerPage)+1;
$hiFrameId = min( $_REQUEST['page']*$framesPerPage, $event['Frames'] );
}
else
{
$loFrameId = 1;
$hiFrameId = $event['Frames'];
}
$sql = 'SELECT * FROM Frames WHERE EventID = ?';
if ( $paged && !empty($_REQUEST['page']) )
$sql .= " and FrameId between $loFrameId and $hiFrameId";
$sql .= " order by FrameId";
$frames = dbFetchAll( $sql, NULL, array( $_REQUEST['eid'] ) );
$scale = getDeviceScale( $event['Width'], $event['Height'], $framesPerLine+0.3 );
$pages = (int)ceil($event['Frames']/$framesPerPage);
if ( !empty($_REQUEST['fid']) )
$_REQUEST['page'] = ($_REQUEST['fid']/$framesPerPage)+1;
$pagination = getPagination( $pages, $_REQUEST['page'], $maxShortcuts, '&amp;eid='.$_REQUEST['eid'].$filterQuery.$sortQuery, '&amp;' );
xhtmlHeaders( __FILE__, translate('Event').' - '.$event['Name'] );
?>
<body>
<div id="page">
<div id="header">
<?php
if ( canEdit( 'Events' ) )
{
?>
<div id="headerButtons">
<a href="?view=events&amp;action=delete&amp;mark_eid=<?php echo $_REQUEST['eid'] ?><?php echo $filterQuery ?><?php echo $sortQuery ?>&amp;limit=<?php echo $_REQUEST['limit'] ?>&amp;page=<?php echo $_REQUEST['page'] ?>"><?php echo translate('Delete') ?></a>
</div>
<?php
}
?>
<h2><?php echo makeLink( '?view=eventdetails&amp;eid='.$_REQUEST['eid'], $event['Name'].($event['Archived']?'*':''), canEdit( 'Events' ) ) ?></h2>
</div>
<div id="content">
<?php
if ( $pagination )
{
?>
<h3 class="pagination"><?php echo $pagination ?></h3>
<?php
}
?>
<div id="eventFrames">
<?php
foreach ( $frames as $frame )
{
$imageData = getImageSrc( $event, $frame, $scale );
?>
<a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $frame['FrameId'] ?>"><img src="<?php echo viewImagePath( $imageData['thumbPath'] ) ?>" class="<?php echo $imageData['imageClass'] ?>" alt="<?php echo $frame['Type'] ?>/<?php echo $frame['Type']=='Alarm'?$frame['Score']:0 ?>"/></a>
<?php
}
?>
</div>
</div>
</div>
</body>
</html>

View File

@ -1,86 +0,0 @@
<?php
//
// ZoneMinder web event details view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// 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.
//
if ( !canView( 'Events' ) )
{
$_REQUEST['view'] = "error";
return;
}
$event = dbFetchOne( 'select E.*,M.Name as MonitorName from Events as E, Monitors as M where E.Id = ? and E.MonitorId = M.Id', NULL, array($_REQUEST['eid']) );
$frame = dbFetchOne( 'select * from Frames where EventID = ? and Score = ?', NULL, array($_REQUEST['eid'],$event['MaxScore']) );
$scale = getDeviceScale( $event['Width'], $event['Height'], 2.2 );
$image1 = getImageSrc( $event, 1, $scale );
if ( $frame['Type'] == 'Alarm' )
$image2 = getImageSrc( $event, $frame['FrameId'], $scale );
else
$image2 = getImageSrc( $event, intval($event['Frames']/2), $scale );
xhtmlHeaders( __FILE__, translate('Event').' - '.$_REQUEST['eid'] );
?>
<body>
<div id="page">
<div id="content">
<table id="contentTable" class="major">
<tr>
<th scope="row"><?php echo translate('Name') ?></th>
<td><?php echo htmlentities($event['Name']) ?><?php echo $event['Archived']?("(".translate('Archived').")"):"" ?></td>
</tr>
<tr>
<th scope="row"><?php echo translate('Time') ?></th>
<td><?php echo htmlentities(strftime("%b %d, %H:%M",strtotime($event['StartTime']))) ?></td>
</tr>
<tr>
<th scope="row"><?php echo translate('Duration') ?></th>
<td><?php echo htmlentities($event['Length']) ?>s</td>
</tr>
<tr>
<th scope="row"><?php echo translate('Cause') ?></th>
<td><?php echo htmlentities($event['Cause']) ?></td>
</tr>
<?php if ( !empty($event['Notes']) ) { ?>
<tr>
<th scope="row"><?php echo translate('Notes') ?></th>
<td><?php echo htmlentities($event['Notes']) ?></td>
</tr>
<?php } ?>
<tr>
<th scope="row"><?php echo translate('Frames') ?></th>
<td><?php echo $event['Frames'] ?> (<?php echo $event['AlarmFrames'] ?>)</td>
</tr>
<tr>
<th scope="row"><?php echo translate('Score') ?></th>
<td><?php echo $event['TotScore'] ?>/<?php echo $event['AvgScore'] ?>/<?php echo $event['MaxScore'] ?></td>
</tr>
</table>
<div id="eventImages">
<a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=1"><img src="<?php echo viewImagePath( $image1['thumbPath'] ) ?>" alt="1"/></a>
<a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $frame['FrameId'] ?>"><img src="<?php echo viewImagePath( $image2['thumbPath'] ) ?>" alt="<?php echo $frame['FrameId'] ?>"/></a>
</div>
<div id="contenButtons">
<a href="?view=event&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;page=1"><?php echo translate('Frames') ?></a>
<a href="?view=video&amp;eid=<?php echo $_REQUEST['eid'] ?>"><?php echo translate('Video') ?></a>
</div>
</div>
</div>
</body>
</html>

View File

@ -1,157 +0,0 @@
<?php
//
// ZoneMinder web events view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// 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.
//
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
$sql = "select * from Monitors";
foreach ( dbFetchAll( $sql ) as $row )
{
$monitors[$row['Id']] = $row;
}
if ( isset($_REQUEST['filterName']) )
{
$dbFilter = dbFetchOne( 'SELECT * FROM Filters WHERE Name = ?', NULL, array($_REQUEST['filterName']) );
$_REQUEST['filter'] = jsonDecode( $dbFilter['Query'] );
$_REQUEST['sort_field'] = isset($_REQUEST['filter']['sort_field'])?$_REQUEST['filter']['sort_field']:"DateTime";
$_REQUEST['sort_asc'] = isset($_REQUEST['filter']['sort_asc'])?$_REQUEST['filter']['sort_asc']:"1";
$_REQUEST['limit'] = isset($_REQUEST['filter']['limit'])?$_REQUEST['filter']['limit']:"";
unset( $_REQUEST['filter']['sort_field'] );
unset( $_REQUEST['filter']['sort_asc'] );
unset( $_REQUEST['filter']['limit'] );
}
if ( empty($_REQUEST['sort_field']) )
$_REQUEST['sort_field'] = "DateTime";
if ( empty($_REQUEST['sort_asc']) )
$_REQUEST['sort_asc'] = "1";
$countSql = "select count(E.Id) as EventCount from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where";
$eventsSql = "select E.Id,E.MonitorId,M.Name As MonitorName,E.Name,E.StartTime,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where";
if ( $user['MonitorIds'] )
{
$countSql .= " M.Id in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")";
$eventsSql .= " M.Id in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")";
}
else
{
$countSql .= " 1";
$eventsSql .= " 1";
}
parseSort( true, '&amp;' );
parseFilter( $_REQUEST['filter'], true, '&amp;' );
$filterQuery = $_REQUEST['filter']['query'];
if ( $_REQUEST['filter']['sql'] )
{
$countSql .= $_REQUEST['filter']['sql'];
$eventsSql .= $_REQUEST['filter']['sql'];
}
$eventsSql .= " order by $sortColumn $sortOrder";
$deviceLines = (isset($device)&&!empty($device['lines']))?$device['lines']:DEVICE_LINES;
// Allow for headers etc
$deviceLines -= 2;
if ( !empty($_REQUEST['page']) )
{
$limitStart = (($_REQUEST['page']-1)*$deviceLines);
if ( empty($_REQUEST['limit']) )
{
$limitAmount = $deviceLines;
}
else
{
$limitLeft = $_REQUEST['limit'] - $limitStart;
$limitAmount = ($limitLeft>$deviceLines)?$deviceLines:$limitLeft;
}
$eventsSql .= " limit $limitStart, $limitAmount";
}
elseif ( !empty( $_REQUEST['limit'] ) )
{
$eventsSql .= " limit 0, ".$_REQUEST['limit'];
}
$nEvents = dbFetchOne( $countSql, 'EventCount' );
if ( !empty($limit) && $nEvents > $_REQUEST['limit'] )
{
$nEvents = $_REQUEST['limit'];
}
$pages = (int)ceil($nEvents/$deviceLines);
$maxShortcuts = 3;
$pagination = getPagination( $pages, $_REQUEST['page'], $maxShortcuts, $filterQuery.$sortQuery.'&amp;limit='.$_REQUEST['limit'], '&amp;' );
xhtmlHeaders( __FILE__, translate('Events') );
?>
<body>
<div id="page">
<div id="header">
<div id="headerButtons"><?php echo makeLink( "?view=filter", empty($_REQUEST['filterName'])?translate('ChooseFilter'):$_REQUEST['filterName'], canView( 'Events' ) ) ?></div>
<h2><?php echo sprintf( $CLANG['EventCount'], $nEvents, zmVlang( $VLANG['Event'], $nEvents ) ) ?></h2>
</div>
<div id="content">
<?php
if ( $pagination )
{
?>
<h3 class="pagination"><?php echo $pagination ?></h3>
<?php
}
?>
<table id="contentTable" class="major">
<?php
$count = 0;
foreach ( dbFetchAll( $eventsSql ) as $event )
{
if ( ($count++%$deviceLines) == 0 )
{
?>
<tr>
<th class="colId"><a href="<?php echo sortHeader( 'Id', '&amp;' ) ?>"><?php echo substr( translate('Id'), 0, 3 ) ?><?php echo sortTag( 'Id' ) ?></a></th>
<th class="colTime"><a href="<?php echo sortHeader( 'StartTime', '&amp;' ) ?>"><?php echo substr( translate('Time'), 0, 3 ) ?><?php echo sortTag( 'StartTime' ) ?></a></th>
<th class="colDuration"><a href="<?php echo sortHeader( 'Length', '&amp;' ) ?>"><?php echo substr( translate('Duration'), 0, 3 ) ?><?php echo sortTag( 'Length' ) ?></a></th>
<th class="colFrames"><a href="<?php echo sortHeader( 'Frames', '&amp;' ) ?>"><?php echo substr( translate('Frames'), 0, 3 ) ?><?php echo sortTag( 'Frames' ) ?></a></th>
<th class="colScore"><a href="<?php echo sortHeader( 'TotScore', '&amp;' ) ?>"><?php echo substr( translate('Score'), 0, 3 ) ?><?php echo sortTag( 'TotScore' ) ?></a></th>
</tr>
<?php
}
?>
<tr>
<td class="colId"><a href="?view=eventdetails&amp;eid=<?php echo $event['Id'] ?>&amp;page=1"><?php echo $event['Id'] ?><?php if ( $event['Archived'] ) echo "*" ?></a></td>
<td class="colTime"><?php echo strftime( "%d/%H:%M", strtotime($event['StartTime']) ) ?></td>
<td class="colDuration"><?php echo sprintf( "%d", $event['Length'] ) ?></td>
<td class="colFrames"><a href="?view=event&amp;eid=<?php echo $event['Id'] ?>&amp;page=1"><?php echo $event['AlarmFrames'] ?></a></td>
<td class="colScore"><a href="?view=frame&amp;eid=<?php echo $event['Id'] ?>&amp;fid=0"><?php echo $event['MaxScore'] ?></a></td>
</tr>
<?php
}
?>
</table>
<p><a href="?view=console"><?php echo translate('Console') ?></a></p>
</div>
</div>
</body>
</html>

View File

@ -1,71 +0,0 @@
<?php
//
// ZoneMinder web filter view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// 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.
//
if ( !canView( 'Events' ) )
{
$_REQUEST['view'] = "error";
return;
}
$filterNames = array();
$sql = "select * from Filters order by Name";
foreach( dbFetchAll( $sql ) as $row )
{
$filterNames[$row['Name']] = $row['Name'];
}
xhtmlHeaders( __FILE__, translate('EventFilter') );
?>
<body>
<div id="page">
<div id="header">
</div>
<div id="content">
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<div class="hidden">
<fieldset>
<input type="hidden" name="view" value="events"/>
<input type="hidden" name="page" value="1"/>
</fieldset>
</div>
<?php
if ( count($filterNames) > 0 )
{
?>
<div>
<label for="filterName"><?php echo translate('UseFilter') ?></label><?php echo buildSelect( "filterName", $filterNames ); ?>
</div>
<div id="contentButtons">
<input type="submit" value="<?php echo translate('Submit') ?>"/>
</div>
<?php
}
else
{
?>
<p><?php echo translate('NoSavedFilters') ?></p>
<?php
}
?>
</form>
</div>
</div>
</body>
</html>

View File

@ -1,73 +0,0 @@
<?php
//
// ZoneMinder web frame view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// 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.
//
if ( !canView( 'Events' ) )
{
$_REQUEST['view'] = "error";
return;
}
$sql = 'SELECT E.*,M.Name AS MonitorName,M.DefaultScale FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE E.Id = ?';
$event = dbFetchOne( $sql, NULL, array( $_REQUEST['eid'] ) );
if ( !empty($_REQUEST['fid']) )
{
$frame = dbFetchOne( 'SELECT * FROM Frames WHERE EventID = ? AND FrameId = ?', NULL, array( $_REQUEST['eid'], $_REQUEST['fid'] ) );
}
else
{
$frame = dbFetchOne( 'SELECT * FROM Frames WHERE EventID = ? AND Score = ?', NULL, array( $_REQUEST['eid'], $event['MaxScore'] ) );
}
$maxFid = $event['Frames'];
$firstFid = 1;
$prevFid = $frame['FrameId']-1;
$nextFid = $frame['FrameId']+1;
$lastFid = $maxFid;
$scale = getDeviceScale( $event['Width'], $event['Height'], 1.1 );
$imageData = getImageSrc( $event, $frame, $scale, (isset($_REQUEST['show'])&&$_REQUEST['show']=="capt") );
xhtmlHeaders( __FILE__, translate('Frame').' - '.$_REQUEST['eid'].'-'.$frame['FrameId'] );
?>
<body>
<div id="page">
<div id="header">
<h2><?php echo translate('Frame') ?> <?php echo $_REQUEST['eid']."-".$frame['FrameId']." (".$frame['Score'].")" ?></h2>
</div>
<div id="content">
<?php if ( $imageData['hasAnalImage'] ) { ?><a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $frame['FrameId'] ?>&amp;show=<?php echo $imageData['isAnalImage']?"capt":"anal" ?>"><?php } ?><img src="<?php echo viewImagePath( $imageData['thumbPath'] ) ?>" class="<?php echo $imageData['imageClass'] ?>"/><?php if ( $imageData['hasAnalImage'] ) { ?></a><?php } ?>
<div id="contentButtons">
<?php if ( $frame['FrameId'] > 1 ) { ?>
<a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $firstFid ?>">&lt;&lt;</a>
<?php } if ( $frame['FrameId'] > 1 ) { ?>
<a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $prevFid ?>">&lt;</a>
<?php } if ( $frame['FrameId'] < $maxFid ) { ?>
<a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $nextFid ?>">&gt;</a>
<?php } if ( $frame['FrameId'] < $maxFid ) { ?>
<a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $lastFid ?>">&gt;&gt;</a>
<?php } ?>
</div>
</div>
</div>
</body>
</html>

View File

@ -1,66 +0,0 @@
<?php
//
// ZoneMinder web function view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// 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.
//
if ( !canEdit( 'Monitors' ) )
{
$_REQUEST['view'] = "error";
return;
}
$monitor = dbFetchMonitor( $_REQUEST['mid'] );
xhtmlHeaders( __FILE__, translate('Function').' - '.$monitor['Name'] );
?>
<body>
<div id="page">
<div id="header">
<h2><?php echo sprintf( $CLANG['MonitorFunction'], $monitor['Name'] ) ?></h2>
</div>
<div id="content">
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<div class="hidden">
<fieldset>
<input type="hidden" name="view" value="console"/>
<input type="hidden" name="action" value="function"/>
<input type="hidden" name="mid" value="<?php echo $_REQUEST['mid'] ?>"/>
</fieldset>
</div>
<div>
<select name="newFunction">
<?php
foreach ( getEnumValues( 'Monitors', 'Function' ) as $optFunction )
{
?>
<option value="<?php echo $optFunction ?>"<?php if ( $optFunction == $monitor['Function'] ) { ?> selected="selected"<?php } ?>><?php echo $optFunction ?></option>
<?php
}
?>
</select>
</div>
<div>
<label for="newEnabled"><?php echo translate('Enabled') ?></label><input type="checkbox" name="newEnabled" id="newEnabled" value="1"<?php if ( !empty($monitor['Enabled']) ) { ?> checked="checked"<?php } ?>/>
</div>
<div id="contentButtons">
<input type="submit" value="<?php echo translate('Save') ?>"/>
</div>
</form>
</div>
</div>
</body>
</html>

View File

@ -1,54 +0,0 @@
<?php
//
// ZoneMinder web login view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// 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.
//
xhtmlHeaders( __FILE__, translate('Login') );
?>
<body>
<div id="page">
<div id="header">
<h1>ZoneMinder <?php echo translate('Login') ?></h1>
</div>
<div id="content">
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<div class="hidden">
<fieldset>
<input type="hidden" name="action" value="login"/>
<input type="hidden" name="view" value="console"/>
</fieldset>
</div>
<table id="contentTable" class="minor">
<tr>
<th scope="row" class="colLeft"><?php echo translate('Username') ?></th>
<td class="colRight"><input type="text" name="username" value="<?php echo isset($username)?$username:"" ?>" size="12"/></td>
</tr>
<tr>
<th scope="row" class="colLeft"><?php echo translate('Password') ?></th>
<td class="colRight"><input type="password" name="password" value="" size="12"/></td>
</tr>
</table>
<div id="contentButtons">
<input type="submit" value="<?php echo translate('Login') ?>"/>
</div>
</form>
</div>
</div>
</body>
</html>

View File

@ -1,75 +0,0 @@
<?php
//
// ZoneMinder web montage view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// 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.
//
if ( !canView( 'Stream' ) )
{
$_REQUEST['view'] = "error";
return;
}
$imagesPerLine = 2;
$sql = "select * from Groups where Name = 'Mobile'";
$group = dbFetchOne( $sql );
$sql = "select * from Monitors where Function != 'None' order by Sequence";
$monitors = array();
$maxWidth = 0;
$maxHeight = 0;
foreach( dbFetchAll( $sql ) as $row )
{
if ( !visibleMonitor( $row['Id'] ) )
continue;
if ( $group && $group['MonitorIds'] && !in_array( $row['Id'], explode( ',', $group['MonitorIds'] ) ) )
continue;
if ( $maxWidth < $row['Width'] ) $maxWidth = $row['Width'];
if ( $maxHeight < $row['Height'] ) $maxHeight = $row['Height'];
$monitors[] = $row;
}
xhtmlHeaders( __FILE__, translate('Montage') );
?>
<body>
<div id="page">
<div id="header">
<div id="headerButtons">
<a href="?view=<?php echo $_REQUEST['view'] ?>"><?php echo translate('Refresh') ?></a>
</div>
</div>
<div id="content">
<div id="monitorImages">
<?php
foreach( $monitors as $monitor )
{
$scale = getDeviceScale( $monitor['Width'], $monitor['Height'], $imagesPerLine*1.1 );
$imagePath = getStreamSrc( array( "mode=single", "monitor=".$monitor['Id'], "scale=".$scale ), '&amp;' );
?>
<a href="?view=watch&amp;mid=<?php echo $monitor['Id'] ?>"><img src="<?php echo $imagePath ?>" alt="<?php echo $monitor['Name'] ?>"/></a>
<?php
}
?>
</div>
<div id="contentButtons"><a href="?view=console"><?php echo translate('Console') ?></a></div>
</div>
</div>
</body>
</html>

View File

@ -1,77 +0,0 @@
<?php
//
// ZoneMinder web run state view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// 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.
//
if ( !canEdit( 'System' ) )
{
$view = "error";
return;
}
$running = daemonCheck();
$states = dbFetchAll( "select * from States" );
xhtmlHeaders( __FILE__, translate('State') );
?>
<body>
<div id="page">
<div id="header">
<h2><?php echo translate('RunState') ?></h2>
</div>
<div id="content">
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<div class="hidden">
<fieldset>
<input type="hidden" name="view" value="console"/>
<input type="hidden" name="action" value="state"/>
</fieldset>
</div>
<select name="runState">
<?php
if ( $running )
{
?>
<option value="stop" selected="selected"><?php echo translate('Stop') ?></option>
<option value="restart"><?php echo translate('Restart') ?></option>
<?php
}
else
{
?>
<option value="start" selected="selected"><?php echo translate('Start') ?></option>
<?php
}
?>
<?php
foreach ( $states as $state )
{
?>
<option value="<?php echo $state['Name'] ?>"><?php echo $state['Name'] ?></option>
<?php
}
?>
</select>
<div id="contentButtons">
<input type="submit" value="<?php echo translate('Apply') ?>"/>
</div>
</form>
</div>
</div>
</body>
</html>

View File

@ -1,226 +0,0 @@
<?php
//
// ZoneMinder web video view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// 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.
//
if ( !canView( 'Events' ) )
{
$_REQUEST['view'] = "error";
return;
}
if ( $user['MonitorIds'] )
$midSql = " and MonitorId in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")";
else
$midSql = '';
$sql = 'SELECT E.*,M.Name AS MonitorName,M.DefaultRate FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE E.Id = ?'.$midSql;
$event = dbFetchOne( $sql, NULL, array($_REQUEST['eid']) );
$deviceWidth = (isset($device)&&!empty($device['width']))?$device['width']:DEVICE_WIDTH;
$deviceHeight = (isset($device)&&!empty($device['height']))?$device['height']:DEVICE_HEIGHT;
if ( $deviceWidth >= 352 && $deviceHeight >= 288 )
$videoSize = "352x288";
elseif ( $deviceWidth >= 176 && $deviceHeight >= 144 )
$videoSize = "176x144";
else
$videoSize = "128x96";
$eventWidth = $event['Width'];
$eventHeight = $event['Height'];
if ( !isset( $rate ) )
$_REQUEST['rate'] = reScale( RATE_BASE, $event['DefaultRate'], ZM_WEB_DEFAULT_RATE );
$eventPath = ZM_DIR_EVENTS.'/'.getEventPath( $event );
$videoFormats = array();
$ffmpegFormats = preg_split( '/\s+/', ZM_FFMPEG_FORMATS );
foreach ( $ffmpegFormats as $ffmpegFormat )
{
preg_match( '/^([^*]+)(\**)$/', $ffmpegFormat, $matches );
$videoFormats[$matches[1]] = $matches[1];
if ( $matches[2] == '*' )
$defaultVideoFormat = $matches[1];
elseif ( $matches[2] == '**' )
$defaultPhoneFormat = $matches[1];
}
if ( !isset($_REQUEST['videoFormat']) )
{
if ( isset($defaultPhoneFormat) )
$_REQUEST['videoFormat'] = $defaultPhoneFormat;
elseif ( isset($defaultVideoFormat) )
$_REQUEST['videoFormat'] = $defaultVideoFormat;
else
$videoFormat = $ffmpegFormats[0];
}
if ( !empty($_REQUEST['generate']) )
{
$videoFile = createVideo( $event, $_REQUEST['videoFormat'], $_REQUEST['rate'], $videoSize, !empty($_REQUEST['overwrite']) );
}
$videoFiles = array();
if ( $dir = opendir( $eventPath ) )
{
while ( ($file = readdir( $dir )) !== false )
{
$file = $eventPath.'/'.$file;
if ( is_file( $file ) )
{
if ( preg_match( '/-S([\da-z]+)\.(?:'.join( '|', $videoFormats ).')$/', $file, $matches ) )
{
if ( $matches[1] == $videoSize )
{
$videoFiles[] = $file;
}
}
}
}
closedir( $dir );
}
if ( isset($_REQUEST['download']) )
{
header( "Content-type: ".getMimeType($videoFiles[$_REQUEST['download']]));
header( "Content-length: ".filesize($videoFiles[$_REQUEST['download']]));
header( "Content-disposition: attachment; filename=".preg_replace( "/^.*\//", "", $videoFiles[$_REQUEST['download']] )."; size=".filesize($videoFiles[$_REQUEST['download']]) );
readfile( $videoFiles[$_REQUEST['download']] );
exit;
}
xhtmlHeaders( __FILE__, translate('Video').' - '.$event['Name'] );
?>
<body>
<div id="page">
<div id="content">
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<div class="hidden">
<fieldset>
<input type="hidden" name="view" value="<?php echo $_REQUEST['view'] ?>"/>
<input type="hidden" name="eid" value="<?php echo $_REQUEST['eid'] ?>"/>
<input type="hidden" name="generate" value="1"/>
</fieldset>
</div>
<table id="contentTable" class="minor">
<tr>
<th scope="row"><?php echo translate('VideoFormat') ?></th>
<td><?php echo buildSelect( "videoFormat", $videoFormats ) ?></td>
</tr>
<tr>
<th scope="row"><?php echo translate('FrameRate') ?></th>
<td><?php echo buildSelect( "rate", $rates ) ?></td>
</tr>
<tr>
<th scope="row"><?php echo translate('OverwriteExisting') ?></th>
<td><input type="checkbox" name="overwrite" value="1"<?php if ( isset($overwrite) ) { ?> checked="checked"<?php } ?>/></td>
</tr>
</table>
<div id="contentButtons"><input type="submit" value="<?php echo translate('GenerateVideo') ?>"/></div>
</form>
<?php
if ( isset($videoFile) )
{
if ( $videoFile )
{
?>
<p class="infoText"><?php echo translate('VideoGenSucceeded') ?></p>
<?php
}
else
{
?>
<p class="errorText"><?php echo translate('VideoGenFailed') ?></p>
<?php
}
}
?>
<?php
if ( count($videoFiles) )
{
if ( isset($_REQUEST['delete']) )
{
unlink( $videoFiles[$_REQUEST['delete']] );
unset( $videoFiles[$_REQUEST['delete']] );
}
}
if ( count($videoFiles) )
{
?>
<h3><?php echo translate('VideoGenFiles') ?></h3>
<table class="major">
<tr>
<th><?php echo translate('Format') ?></th>
<th><?php echo translate('Size') ?></th>
<th><?php echo translate('Rate') ?></th>
<th><?php echo translate('Scale') ?></th>
<th><?php echo translate('Action') ?></th>
</tr>
<?php
if ( count($videoFiles) > 0 )
{
$index = 0;
foreach ( $videoFiles as $file )
{
preg_match( '/^(.+)-((?:r[_\d]+)|(?:F[_\d]+))-((?:s[_\d]+)|(?:S[0-9a-z]+))\.([^.]+)$/', $file, $matches );
if ( preg_match( '/^r(.+)$/', $matches[2], $temp_matches ) )
{
$rate = (int)(100 * preg_replace( '/_/', '.', $temp_matches[1] ) );
$rateText = isset($rates[$rate])?$rates[$rate]:($rate."x");
}
elseif ( preg_match( '/^F(.+)$/', $matches[2], $temp_matches ) )
{
$rateText = $temp_matches[1]."fps";
}
if ( preg_match( '/^s(.+)$/', $matches[3], $temp_matches ) )
{
$scale = (int)(100 * preg_replace( '/_/', '.', $temp_matches[1] ) );
$scaleText = isset($scales[$scale])?$scales[$scale]:($scale."x");
}
elseif ( preg_match( '/^S(.+)$/', $matches[3], $temp_matches ) )
{
$scaleText = $temp_matches[1];
}
?>
<tr>
<td><?php echo $matches[4] ?></td>
<td><?php echo filesize( $file ) ?></td>
<td><?php echo $rateText ?></td>
<td><?php echo $scaleText ?></td>
<td><a href="?view=<?php echo $_REQUEST['view'] ?>&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;download=<?php echo $index ?>"><?php echo translate('View') ?></a>&nbsp;/&nbsp;<a href="?view=<?php echo $_REQUEST['view'] ?>&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;delete=<?php echo $index ?>"><?php echo translate('Delete') ?></a></td>
</tr>
<?php
$index++;
}
}
?>
</table>
<?php
}
else
{
?>
<p class="warnText"><?php echo translate('VideoGenNoFiles') ?></p>
<?php
}
?>
</div>
</div>
</body>
</html>

View File

@ -1,154 +0,0 @@
<?php
//
// ZoneMinder web watch view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// 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.
//
if ( !canView( 'Stream' ) )
{
$_REQUEST['view'] = "error";
return;
}
$sql = 'select C.*, M.* from Monitors as M left join Controls as C on (M.ControlId = C.Id ) where M.Id = ?';
$monitor = dbFetchOne( $sql, NULL, array($_REQUEST['mid']) );
$showPtzControls = ( ZM_OPT_CONTROL && $monitor['Controllable'] && canView( 'Control' ) );
$zmuCommand = getZmuCommand( " -m ".$_REQUEST['mid']." -s -f" );
$zmuOutput = exec( escapeshellcmd( $zmuCommand ) );
list( $status, $fps ) = explode( ' ', $zmuOutput );
$statusString = translate('Unknown');
$fpsString = "--.--";
$class = "infoText";
if ( $status <= STATE_PREALARM )
{
$statusString = translate('Idle');
}
elseif ( $status == STATE_ALARM )
{
$statusString = translate('Alarm');
$class = "errorText";
}
elseif ( $status == STATE_ALERT )
{
$statusString = translate('Alert');
$class = "warnText";
}
elseif ( $status == STATE_TAPE )
{
$statusString = translate('Record');
}
$fpsString = sprintf( "%.2f", $fps );
$sql = "select * from Monitors where Function != 'None' order by Sequence";
$monitors = array();
$monIdx = 0;
$maxWidth = 0;
$maxHeight = 0;
foreach( dbFetchAll( $sql ) as $row )
{
if ( !visibleMonitor( $row['Id'] ) )
{
continue;
}
if ( isset($monitor['Id']) && $row['Id'] == $monitor['Id'] )
$monIdx = count($monitors);
if ( $maxWidth < $row['Width'] ) $maxWidth = $row['Width'];
if ( $maxHeight < $row['Height'] ) $maxHeight = $row['Height'];
$monitors[] = $row;
}
//$monitor = $monitors[$monIdx];
$nextMid = $monIdx==(count($monitors)-1)?$monitors[0]['Id']:$monitors[$monIdx+1]['Id'];
$prevMid = $monIdx==0?$monitors[(count($monitors)-1)]['Id']:$monitors[$monIdx-1]['Id'];
if ( isset( $_REQUEST['scale'] ) )
$scale = validInt($_REQUEST['scale']);
else
$scale = getDeviceScale( $monitor['Width'], $monitor['Height'] );
$imageSrc = getStreamSrc( array( "mode=single", "monitor=".$monitor['Id'], "scale=".$scale ), '&amp;' );
if ( ZM_WEB_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT )
{
$streamMode = "mpeg";
$streamSrc = getStreamSrc( array( "mode=".$streamMode, "monitor=".$monitor['Id'], "scale=".$scale, "bitrate=".ZM_WEB_VIDEO_BITRATE, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "format=".ZM_MPEG_LIVE_FORMAT ) );
}
elseif ( canStream() )
{
$streamMode = "jpeg";
$streamSrc = getStreamSrc( array( "mode=".$streamMode, "monitor=".$monitor['Id'], "scale=".$scale, "maxfps=".ZM_WEB_VIDEO_MAXFPS ) );
}
else
{
$streamMode = "single";
$streamSrc = getStreamSrc( array( "mode=".$streamMode, "monitor=".$monitor['Id'], "scale=".$scale ) );
}
xhtmlHeaders( __FILE__, $monitor['Name'].' - '.translate('Watch') );
?>
<body>
<div id="page">
<div id="content">
<p class="<?php echo $class ?>"><?php echo makeLink( "?view=events&amp;page=1&amp;view=events&amp;page=1&amp;filter%5Bterms%5D%5B0%5D%5Battr%5D%3DMonitorId&amp;filter%5Bterms%5D%5B0%5D%5Bop%5D%3D%3D&amp;filter%5Bterms%5D%5B0%5D%5Bval%5D%3D".$monitor['Id']."&amp;sort_field=Id&amp;sort_desc=1", $monitor['Name'], canView( 'Events' ) ) ?>:&nbsp;<?php echo $statusString ?>&nbsp;-&nbsp;<?php echo $fpsString ?>&nbsp;fps</p>
<p>
<?php
if ( $streamMode == "mpeg" )
{
outputVideoStream( "liveStream", $streamSrc, reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ), ZM_MPEG_LIVE_FORMAT, $monitor['Name'] );
}
elseif ( $streamMode == "jpeg" )
{
if ( canStreamNative() )
outputImageStream( "liveStream", $streamSrc, reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ), $monitor['Name'] );
elseif ( canStreamApplet() )
outputHelperStream( "liveStream", $streamSrc, reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ), $monitor['Name'] );
}
else
{
?>
<a href="?view=<?php echo $_REQUEST['view'] ?>&amp;mid=<?php echo $monitor['Id'] ?>"><?php echo outputImageStill( "liveStream", $streamSrc, reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ), $monitor['Name'] ); ?></a>
<?php
}
?>
</p>
<?php
if ( $showPtzControls )
{
foreach ( getSkinIncludes( 'includes/control_functions.php' ) as $includeFile )
require_once $includeFile;
?>
<div id="ptzControls">
<?php echo ptzControls( $monitor ) ?>
</div>
<?php
}
if ( $nextMid != $monitor['Id'] || $prevMid != $monitor['Id'] )
{
?>
<div id="contentButtons">
<a href="?view=<?php echo $_REQUEST['view'] ?>&amp;mid=<?php echo $prevMid ?>"><?php echo translate('Prev') ?></a>
<a href="?view=console"><?php echo translate('Console') ?></a>
<a href="?view=<?php echo $_REQUEST['view'] ?>&amp;mid=<?php echo $nextMid ?>"><?php echo translate('Next') ?></a>
</div>
<?php
}
?>
</div>
</div>
</body>
</html>

View File

@ -1,10 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/xml
SUBDIRS = \
includes \
views
dist_web_DATA = \
skin.php

View File

@ -1,8 +0,0 @@
AUTOMAKE_OPTIONS = gnu
webdir = @WEB_PREFIX@/skins/xml/includes
dist_web_DATA = \
init.php \
config.php \
functions.php

View File

@ -1,155 +0,0 @@
<?php
/*
* config.php is created by Jai Dhar, FPS-Tech, for use with eyeZm
* iPhone application. This is not intended for use with any other applications,
* although source-code is provided under GPL.
*
* For questions, please email jdhar@eyezm.com (http://www.eyezm.com)
*
*/
/* Static defines, these shouldn't change */
define ( "ZM_EYEZM_PROTOCOL_VERSION", "2");
define ( "ZM_EYEZM_FEATURE_SET", "3");
/* Dynamic defines, check if they are already defined.
* To change a particular parameter default value, without using the
* Options Console, change the 2nd parameter of the define() block. */
/* Parm: ZM_EYEZM_EVENT_FPS: Sets the default FPS of the output videos for events */
if (!defined("ZM_EYEZM_EVENT_FPS")) define ( "ZM_EYEZM_EVENT_FPS", "10");
/* Parm: ZM_EYEZM_EVENT_VCODEC: Default video codec for generating event video. Can be mpeg4 or h264 */
if (!defined("ZM_EYEZM_EVENT_VCODEC")) define ( "ZM_EYEZM_EVENT_VCODEC", "mpeg4");
/* Parm: ZM_EYEZM_FEED_VCODEC: Default video codec of live feeds. Can be mjpeg or h264 */
if (!defined("ZM_EYEZM_FEED_VCODEC")) define ( "ZM_EYEZM_FEED_VCODEC", "mjpeg");
/* Parm: ZM_EYEZM_SEG_DURATION: H264 Live-streaming segment duration in seconds.
* Increase to improve feed smooth-ness, but will increase feed latency */
if (!defined("ZM_EYEZM_SEG_DURATION")) define ( "ZM_EYEZM_SEG_DURATION", "3");
/* Parm: ZM_EYEZM_DEBUG: Set to 1 to enable XML Debugging */
if (!defined("ZM_EYEZM_DEBUG")) define ( "ZM_EYEZM_DEBUG", "0" );
/* Parm: ZM_EYEZM_H264_MAX_DURATION: Maximum duration in seconds allowed for viewing H264 Streams.
* This is useful for systems that crash or stall when viewing H264 streams. After the timeout
* expires, the H264 stream will be killed if it has not by the user already */
if (!defined("ZM_EYEZM_H264_MAX_DURATION")) define ( "ZM_EYEZM_H264_MAX_DURATION", "120" );
/* Parm: ZM_EYEZM_DEFAULT_BR: Default bitrate of H264 live-feed (when selected).
* This parameter can be changed to anything FFMPEG supports. 64k is a good lower bound, and 392k
* a good upper */
if (!defined("ZM_EYEZM_H264_DEFAULT_BR")) define ( "ZM_EYEZM_H264_DEFAULT_BR", "96k" );
/* Parm: ZM_EYEZM_H264_TIMEOUT: How long to wait for H264 stream to be created. Increase
* this value for streams that take a while to create, or for slow systems that time-out frequently */
if (!defined("ZM_EYEZM_H264_TIMEOUT")) define ( "ZM_EYEZM_H264_TIMEOUT", "20" );
/* Parm: ZM_EYEZM_H264_DEFAULT_EVBR: Default bit-rate when creasing H264 Event videos */
if (!defined("ZM_EYEZM_H264_DEFAULT_EVBR")) define ( "ZM_EYEZM_H264_DEFAULT_EVBR", "128k" );
/* Logging defines */
/* Parm: ZM_EYEZM_LOG_TO_FILE: Set to 1 to log XML Debug output to a separate file, when
* ZM_EYEZM_DEBUG is set to 1. If set to 0, XML Logging will be directed to Apache error log */
if (!defined("ZM_EYEZM_LOG_TO_FILE")) define ( "ZM_EYEZM_LOG_TO_FILE", "1" );
/* Parm: ZM_EYEZM_LOG_FILE: Path to filename when LOG_TO_FILE is enabled */
if (!defined("ZM_EYEZM_LOG_FILE")) define ( "ZM_EYEZM_LOG_FILE", "/tmp/zm_xml.log" );
/* Parm: How many lines to display when viewing log from eyeZm */
if (!defined("ZM_EYEZM_LOG_LINES")) define ( "ZM_EYEZM_LOG_LINES", "50" );
$rates = array(
"10000" => "100x",
"5000" => "50x",
"2500" => "25x",
"1000" => "10x",
"400" => "4x",
"200" => "2x",
"100" => translate('Real'),
"50" => "1/2x",
"25" => "1/4x",
);
$scales = array(
"400" => "4x",
"300" => "3x",
"200" => "2x",
"150" => "1.5x",
"100" => translate('Actual'),
"75" => "3/4x",
"50" => "1/2x",
"33" => "1/3x",
"25" => "1/4x",
);
$bwArray = array(
"high" => translate('High'),
"medium" => translate('Medium'),
"low" => translate('Low')
);
/* Check if ZM_WEB_L_CAN_STREAM and ZM_WEB_L_STREAM_METHOD are defined */
if (!defined("ZM_WEB_L_CAN_STREAM")) {
define ("ZM_WEB_L_CAN_STREAM", 1);
define ("ZM_WEB_M_CAN_STREAM", 1);
define ("ZM_WEB_H_CAN_STREAM", 1);
}
if (!defined("ZM_WEB_L_STREAM_METHOD")) {
define ("ZM_WEB_L_STREAM_METHOD", "jpeg");
define ("ZM_WEB_M_STREAM_METHOD", "jpeg");
define ("ZM_WEB_H_STREAM_METHOD", "jpeg");
}
switch ( $_COOKIE['zmBandwidth'] )
{
case "high" :
{
define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_H_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes
define( "ZM_WEB_REFRESH_CYCLE", ZM_WEB_H_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor
define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_H_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming)
define( "ZM_WEB_REFRESH_STATUS", ZM_WEB_H_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window
define( "ZM_WEB_REFRESH_EVENTS", ZM_WEB_H_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events
define( "ZM_WEB_CAN_STREAM", ZM_WEB_H_CAN_STREAM ); // Override the automatic detection of browser streaming capability
define( "ZM_WEB_STREAM_METHOD", ZM_WEB_H_STREAM_METHOD ); // Which method should be used to send video streams to your browser
define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_H_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%)
define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_H_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%)
define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_H_VIDEO_BITRATE ); // What the bitrate of any streamed video should be
define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_H_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be
define( "ZM_WEB_SCALE_THUMBS", ZM_WEB_H_SCALE_THUMBS ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling
define( "ZM_WEB_EVENTS_VIEW", ZM_WEB_H_EVENTS_VIEW ); // What the default view of multiple events should be.
define( "ZM_WEB_SHOW_PROGRESS", ZM_WEB_H_SHOW_PROGRESS ); // Whether to show the progress of replay in event view.
define( "ZM_WEB_AJAX_TIMEOUT", ZM_WEB_H_AJAX_TIMEOUT ); // Timeout to use for Ajax requests, no timeout used if unset
break;
}
case "medium" :
{
define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_M_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes
define( "ZM_WEB_REFRESH_CYCLE", ZM_WEB_M_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor
define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_M_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming)
define( "ZM_WEB_REFRESH_STATUS", ZM_WEB_M_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window
define( "ZM_WEB_REFRESH_EVENTS", ZM_WEB_M_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events
define( "ZM_WEB_CAN_STREAM", ZM_WEB_M_CAN_STREAM ); // Override the automatic detection of browser streaming capability
define( "ZM_WEB_STREAM_METHOD", ZM_WEB_M_STREAM_METHOD ); // Which method should be used to send video streams to your browser
define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_M_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%)
define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_M_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%)
define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_M_VIDEO_BITRATE ); // What the bitrate of any streamed video should be
define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_M_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be
define( "ZM_WEB_SCALE_THUMBS", ZM_WEB_M_SCALE_THUMBS ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling
define( "ZM_WEB_EVENTS_VIEW", ZM_WEB_M_EVENTS_VIEW ); // What the default view of multiple events should be.
define( "ZM_WEB_SHOW_PROGRESS", ZM_WEB_M_SHOW_PROGRESS ); // Whether to show the progress of replay in event view.
define( "ZM_WEB_AJAX_TIMEOUT", ZM_WEB_M_AJAX_TIMEOUT ); // Timeout to use for Ajax requests, no timeout used if unset
break;
}
case "low" :
{
define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_L_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes
define( "ZM_WEB_REFRESH_CYCLE", ZM_WEB_L_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor
define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_L_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming)
define( "ZM_WEB_REFRESH_STATUS", ZM_WEB_L_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window
define( "ZM_WEB_REFRESH_EVENTS", ZM_WEB_L_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events
define( "ZM_WEB_CAN_STREAM", ZM_WEB_L_CAN_STREAM ); // Override the automatic detection of browser streaming capability
define( "ZM_WEB_STREAM_METHOD", ZM_WEB_L_STREAM_METHOD ); // Which method should be used to send video streams to your browser
define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_L_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%)
define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_L_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%)
define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_L_VIDEO_BITRATE ); // What the bitrate of any streamed video should be
define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_L_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be
define( "ZM_WEB_SCALE_THUMBS", ZM_WEB_L_SCALE_THUMBS ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling
define( "ZM_WEB_EVENTS_VIEW", ZM_WEB_L_EVENTS_VIEW ); // What the default view of multiple events should be.
define( "ZM_WEB_SHOW_PROGRESS", ZM_WEB_L_SHOW_PROGRESS ); // Whether to show the progress of replay in event view.
define( "ZM_WEB_AJAX_TIMEOUT", ZM_WEB_L_AJAX_TIMEOUT ); // Timeout to use for Ajax requests, no timeout used if unset
break;
}
}
?>

View File

@ -1,447 +0,0 @@
<?php
/*
* functions.php is created by Jai Dhar, FPS-Tech, for use with eyeZm
* iPhone application. This is not intended for use with any other applications,
* although source-code is provided under GPL.
*
* For questions, please email support@eyezm.com (http://www.eyezm.com)
*
*/
/* These functions are taken from functions.php */
function validInteger( $input )
{
return( preg_replace( '/\D/', '', $input ) );
}
function validString( $input )
{
return( strip_tags( $input ) );
}
/* There appears to be some discrepancy btw. 1.24.1/2 and .3 for EventPaths, to escape them here */
function getEventPathSafe($event)
{
if (ZM_USE_DEEP_STORAGE) {
$ret = ZM_DIR_EVENTS."/".$event['MonitorId'].'/'.strftime( "%y/%m/%d/%H/%M/%S", strtotime($event['StartTime']) );
} else {
$ret = ZM_DIR_EVENTS."/".$event['MonitorId']."/".$event['Id'];
}
return $ret;
}
function updateClientVer()
{
$str = $_SERVER['HTTP_USER_AGENT'];
/* Check if it starts with eyeZm */
if (!strcmp(substr($str, 0, 5),"eyeZm")) {
/* Found eyeZm */
$ver = substr($str, 6);
$verarray = explode(".", $ver);
$_SESSION['vermaj']=$verarray[0];
$_SESSION['vermin']=$verarray[1];
$_SESSION['verbuild']=$verarray[2];
}
logXml("(".$_SERVER['REMOTE_ADDR'].") GET: ".$_SERVER['REQUEST_URI']." - eyeZm ".getClientVerMaj().".".getClientVerMin());
}
function getClientVerMaj()
{
if (isset($_SESSION['vermaj'])) return $_SESSION['vermaj'];
return "0";
}
function getClientVerMin()
{
if (isset($_SESSION['vermin'])) return $_SESSION['vermin'];
return "0";
}
function requireVer($maj, $min)
{
if (getClientVerMaj() > $maj) return 1;
if ((getClientVerMaj() == $maj) && (getClientVerMin() >= $min)) return 1;
return 0;
}
function logXmlErr($str)
{
logXml($str, 1);
}
function logXml($str, $err = 0)
{
if (!defined("ZM_EYEZM_DEBUG")) {
/* Check session variable */
if (isset($_SESSION['xml_debug'])) define("ZM_EYEZM_DEBUG", $_SESSION['xml_debug']);
else define ("ZM_EYEZM_DEBUG", "0");
}
if (!defined("ZM_EYEZM_LOG_TO_FILE")) {
/* Check session variable */
if (isset($_SESSION['xml_log_to_file'])) define("ZM_EYEZM_LOG_TO_FILE", $_SESSION['xml_log_to_file']);
else define ("ZM_EYEZM_LOG_TO_FILE", "1");
}
if (!defined("ZM_EYEZM_LOG_FILE")) {
/* Check session variable */
if (isset($_SESSION['xml_log_file'])) define("ZM_EYEZM_LOG_FILE", $_SESSION['xml_log_file']);
else define ("ZM_EYEZM_LOG_FILE", "/tmp/zm_xml.log");
}
/* Only log if debug is enabled */
if (ZM_EYEZM_DEBUG == 0) return;
/* Logging is enabled, set log string */
$logstr = "XML_LOG (".($err?"ERROR":"NOTICE")."): ".$str.(ZM_EYEZM_LOG_TO_FILE?"\n":"");
if (ZM_EYEZM_LOG_TO_FILE) {
error_log("[".date("r")."] ".$logstr, 3, ZM_EYEZM_LOG_FILE);
} else {
error_log($logstr);
}
}
/* Returns defval if varname is not set, otherwise return varname */
function getset($varname, $defval)
{
if (isset($_GET[$varname])) return $_GET[$varname];
return $defval;
}
function xml_header()
{
header ("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
}
function xml_tag_val($tag, $val)
{
echo "<".$tag.">".$val."</".$tag.">";
}
function xml_tag_sec($tag, $open)
{
if ($open) $tok = "<";
else $tok = "</";
echo $tok.$tag.">";
}
function xhtmlHeaders( $file, $title )
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
body {
border: 0px solid;
margin: 0px;
padding: 0px;
}
</style>
<script type="text/javascript">
</script>
</head>
<?php
}
/** Returns whether necessary components for H264 streaming
* are present */
function canStream264($sup = 0) {
if (!ffmpegSupportsCodec("libx264")) {
if (!$sup) logXmlErr("FFMPEG not installed, accessible in path/ZM_PATH_FFMPEG, or doesn't support libx264");
return FALSE;
}
/* Make sure segmenter exists */
if (!exeExists(shell_exec("which segmenter"))) {
if (!$sup) logXmlErr("HTTP segmenter not installed or not accessible in path");
return FALSE;
}
/* Check for zmstreamer */
if (!exeExists(shell_exec("which zmstreamer"))) {
if (!$sup) logXmlErr("ZMSTREAMER not installed or not accessible in path");
return FALSE;
}
return TRUE;
}
/* Returns the path of ffmpeg by using define */
function getFfmpegPath()
{
if (defined("ZM_PATH_FFMPEG")) {
return ZM_PATH_FFMPEG;
} else {
/* Not defined, get it from using 'which' */
return shell_exec("which ffmpeg");
}
}
/* Returns whether ffmpeg supports a given codec. Takes into account
* whether FFMPEG exists or not */
function ffmpegSupportsCodec($codec)
{
if (!ffmpegExists()) return FALSE;
/* FFMPEG exists */
if (preg_match("/\b".$codec."\b/", shell_exec(getFfmpegPath()." -codecs 2> /dev/null")) > 0) {
/* More than one match */
return TRUE;
} else {
/* Check -formats tag also if we fail -codecs */
if (preg_match("/\b".$codec."\b/", shell_exec(getFfmpegPath()." -formats 2> /dev/null")) > 0) return TRUE;
return FALSE;
}
}
function exeExists($exepath)
{
$path = trim($exepath);
return (file_exists($path) && is_readable($path) && ($path != ""));
}
/* Returns whether ffmpeg exists or not */
function ffmpegExists()
{
return exeExists(getFfmpegPath());
}
/* Returns with PHP-GD exists */
function gdExists()
{
if (extension_loaded('gd') && function_exists('gd_info')) {
return TRUE;
}
return FALSE;
}
function getFfmpeg264FoutParms($br, $fout)
{
$ffparms = "-analyzeduration 0 -acodec copy";
$ffparms .= " -vcodec libx264 -b ".$br;
$ffparms .= " -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8";
$ffparms .= " -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25";
$ffparms .= " -sc_threshold 40 -i_qfactor 0.71 -bt 16k";
$ffparms .= " -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6";
$ffparms .= " -qmin 10 -qmax 51 -qdiff 4 -level 30";
$ffparms .= " -g 30 -analyzeduration 0 -async 2 ".$fout." 2> /dev/null";
return $ffparms;
}
/** Return FFMPEG parameters for H264 streaming */
function getFfmpeg264Str($width, $height, $br, $fin, $fout)
{
$ffparms = getFfmpeg264FoutParms($br, $fout);
$ffstr = getFfmpegPath()." -t ".ZM_EYEZM_H264_MAX_DURATION." -analyzeduration 0 -i ";
$ffstr .= $fin." -f mpegts ".$ffparms;
return $ffstr;
}
/** Returns true when monitor exists */
function isMonitor($monitor)
{
$query = "select Id from Monitors where Id = ?";
$res = dbFetchOne($query, NULL, array($monitor));
if ($res) return TRUE;
logXml("Monitor ID ".$monitor." does not exist");
return FALSE;
}
/** Returns the width and height of a monitor */
function getMonitorDims($monitor)
{
$query = "select Width,Height from Monitors where Id = ?";
$res = dbFetchOne($query, NULL, array( $monitor ) );
return $res;
}
/** Returns the temp directory for H264 encoding */
function getTempDir()
{
/* Assume that the directory structure is <base>/skins/xml/views */
return dirname(__FILE__)."/../../../temp";
}
/** Returns the name of the m3u8 playlist based on monitor */
function m3u8fname($monitor) {
return "stream_".$monitor.".m3u8";
}
/** Erases the M3u8 and TS file names for a given monitor */
function eraseH264Files($monitor) {
/** NOTE: This command executes an 'rm' command, so $monitor parameter
* should be properly validated before executing */
/* Remove wdir/.m3u8 and wdir/sample_<mon>*.ts */
shell_exec("rm -f ".getTempDir()."/".m3u8fname($monitor)." ".getTempDir()."/sample_".$monitor."*.ts");
}
function kill264proc($monitor) {
/** NOTE: This command executes an 'kill' command, so $monitor parameter
* should be properly validated before executing */
$pid = trim(shell_exec("pgrep -f -x \"zmstreamer -m ".$monitor."\""));
if ($pid == "") {
logXml("No PID found for ZMStreamer to kill");
} else {
shell_exec("kill -9 ".$pid);
logXml("Killed process ".$pid." for Monitor ".$monitor);
}
}
/** Return the command-line shell function to setup H264 stream */
function stream264fn ($mid, $width, $height, $br) {
$cdir = "./temp";
$zmstrm = "zmstreamer -m ".$mid." 2> /dev/null";
$ffstr = getFfmpeg264Str($width, $height, $br, "-", "-");
$seg = "segmenter - ".ZM_EYEZM_SEG_DURATION." ".$cdir."/sample_".$mid." ".$cdir."/".m3u8fname($mid)." ../ 2> /dev/null";
$url = $zmstrm . " | ".$ffstr." | " . $seg;
return "nohup ".$url." & echo $!";
}
/** Generate the web-page presented to the viewer when using H264 */
function h264vidHtml($width, $height, $monitor, $br, $thumbsrc) {
function printTermLink() {
$str = "H264 Streaming Launching...<br>Tap to re-load if stream fails";
$str2 = "document.getElementById(\"loaddiv\").innerHTML = \"".$str."\";";
echo $str2;
}
$ajaxUrl = "?view=actions&action=spawn264&&monitor=".$monitor."&br=".$br;
/* Call these two directly to bypass server blocking issues */
$ajax2Url = "./skins/xml/views/actions.php?action=chk264&monitor=".$monitor;
$ajax2Url .= "&timeout=".ZM_EYEZM_H264_TIMEOUT;
$ajax3Url = "./skins/xml/views/actions.php?action=kill264&monitor=".$monitor;
?>
<html>
<head>
<script type="text/javascript">
/* Called when paused or done is pressed */
function vidAbort() {
document.getElementById('viddiv').style.display = 'none';
var pElement = document.getElementsByTagName('video')[0];
var ajaxKill = new AjaxConnection("<?php echo $ajax3Url;?>");
ajaxKill.connect("cbKilled");
pElement.stop();
pElement.src="";
}
function reloadStreamImage() {
var obj = document.getElementById('liveStream');
var src = obj.src;
var date = new Date();
obj.src = src + '&vrand=' + date.getTime();
return false;
}
/* Callback when spawn264 process is ended */
function cbVidLoad()
{
reloadStreamImage();
<?php
printTermLink();
?>
}
function vidLoaded() {
window.setTimeout("startVid()", 500);
}
function bindListeners()
{
var pElement = document.getElementsByTagName('video')[0];
/* Bind abort */
pElement.addEventListener('abort', vidAbort, false);
pElement.addEventListener('done', vidAbort, false);
pElement.addEventListener('ended', vidAbort, false);
pElement.addEventListener('pause', vidAbort, false);
pElement.addEventListener('loadstart', vidLoaded, false);
}
/* Callback when kill264 process is ended */
function cbKilled()
{
<?php printTermLink(); ?>
}
/* Called after an interval from cbFileExists() */
function loadVid()
{
var pElement = document.getElementById("vidcontainer");
<?php
echo "pElement.src=\"./temp/".m3u8fname($monitor)."\"\n";
?>
pElement.load();
}
function startVid()
{
document.getElementById('viddiv').style.display = 'block';
var pElement = document.getElementById("vidcontainer");
pElement.play();
}
/* Callback when stream is active and ready to be played */
function cbFileExists()
{
window.setTimeout("loadVid()", 500);
}
/* On-load triggers two requests immediately: spawn264 and chk264 */
window.onload = function() {
bindListeners();
var ajax1 = new AjaxConnection("<?php echo "$ajaxUrl";?>");
var ajax2 = new AjaxConnection("<?php echo "$ajax2Url";?>");
ajax1.connect("cbVidLoad");
/* Don't initiate file-exists since eyeZm will */
/*ajax2.connect("cbFileExists");*/
}
function AjaxConnection(url) {
this.connect = connect;
this.url = url;
}
function connect(return_func) {
this.x = new XMLHttpRequest();
this.x.open("GET", this.url, true);
var self = this;
this.x.onreadystatechange = function() {
if (self.x.readyState != 4)
return;
eval(return_func + '()');
delete self.x;
}
this.x.send(null);
}
</script>
<style type="text/css">
body {
border: 0px solid;
margin: 0px;
padding: 0px;
background-color: black;
width: <?php echo $width ?>px;
height: <?php echo $height ?>px;
}
.textcl {
text-align: center;
font-family: Arial;
font-size: larger;
width: 100%;
<?php echo "padding-top: ".(($height/2)-100)."px;"; ?>
<?php echo "padding-bottom: ".(($height/2)-100)."px;"; ?>
z-index: 2;
position: absolute;
top: 0px;
left: 0px;
height: 100%;
}
.textcl2 {
width: auto;
height: auto;
background-color: black;
padding: 5px 5px;
margin-left: 10px;
margin-right: 10px;
opacity: 0.7;
}
.textcl3 {
width: auto;
height: auto;
padding: 2px 2px;
margin: auto;
color: white;
}
.imgdiv {
position: absolute;
padding: 0px;
background-color: black;
top: 0px;
left: 0px;
margin: 0px;
width: <?php echo $width ?>px;
height: <?php echo $height ?>px;
z-index: 1;
opacity: 0.7;
}
</style>
</head>
<body>
<div id="viddiv" style="display: none;">
<?php
echo "<video id=\"vidcontainer\" width='".$width."' height='".$height."' />\n";
?>
</div>
<div id="loaddiv2" class="textcl"><div id="loaddiv3" class="textcl2">
<div id="loaddiv" class="textcl3">
Initializing H264 Stream (<?php echo($br); ?>)...<br>
<span style="font-size: small;"><i>This may take a few seconds</i></span>
</div>
</div></div>
<div class="imgdiv" id="imagediv">
<?php outputImageStream("liveStream", $thumbsrc, $width, $height, "stream"); ?>
</div>
</body>
</html>
<?php
}
?>

Some files were not shown because too many files have changed in this diff Show More