commit 33cbd892127400d4a816b012f2bb98a7b9576e28 Author: nextime Date: Sun Mar 17 00:45:21 2013 +0100 Migrate svn to git diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 000000000..a93b5355b --- /dev/null +++ b/AUTHORS @@ -0,0 +1,10 @@ +ZoneMinder - A Linux based camera monitoring and analysis tool. + +This project was imagined and created by Philip Coombes in +September 2002, shortly after being burglarised of his power tools. + +mailto:philip.coombes@zoneminder.com + +Plugin architecture and sample plugin modified for this version of ZoneMinder +with support of Stagecoach Wireless (mailto:beat.naef@stagecoach-wireless.com) +and the contributions of the CVisionLab team diff --git a/BUGS b/BUGS new file mode 100644 index 000000000..3160e2dce --- /dev/null +++ b/BUGS @@ -0,0 +1 @@ +Please see README file. diff --git a/COPYING b/COPYING new file mode 100644 index 000000000..d60c31a97 --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 000000000..3160e2dce --- /dev/null +++ b/ChangeLog @@ -0,0 +1 @@ +Please see README file. diff --git a/INSTALL b/INSTALL new file mode 100644 index 000000000..1de0ac2ad --- /dev/null +++ b/INSTALL @@ -0,0 +1,185 @@ +Basic Installation +================== + + These are generic installation instructions. + + Please see http://www.zoneminder.com/wiki/index.php/Documentation + for full details. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 000000000..4f29b67ea --- /dev/null +++ b/Makefile.am @@ -0,0 +1,32 @@ +AUTOMAKE_OPTIONS = gnu + +# And these to the user and group of your webserver +webuser = @WEB_USER@ +webgroup = @WEB_GROUP@ + +sysconf_DATA = \ + zm.conf + +SUBDIRS = \ + src \ + web \ + scripts \ + db \ + misc + +EXTRA_DIST = \ + zm.conf.in \ + zmconfgen.pl.in + +# Yes, you are correct. This is a HACK! +install-data-hook: + ( cd $(DESTDIR)$(sysconfdir); chown $(webuser):$(webgroup) $(sysconf_DATA); chmod 600 $(sysconf_DATA) ) + ( if ! test -e $(ZM_RUNDIR); then mkdir -p $(ZM_RUNDIR); fi; if test "$(ZM_RUNDIR)" != "/var/run"; then chown $(webuser):$(webgroup) $(ZM_RUNDIR); chmod u+w $(ZM_RUNDIR); fi ) + ( if ! test -e $(ZM_TMPDIR); then mkdir -m 700 -p $(ZM_TMPDIR); fi; if test "$(ZM_TMPDIR)" != "/tmp"; then chown $(webuser):$(webgroup) $(ZM_TMPDIR); chmod u+w $(ZM_TMPDIR); fi ) + ( if ! test -e $(ZM_LOGDIR); then mkdir -p $(ZM_LOGDIR); fi; if test "$(ZM_LOGDIR)" != "/var/log"; then chown $(webuser):$(webgroup) $(ZM_LOGDIR); chmod u+w $(ZM_LOGDIR); fi ) + +uninstall-hook: + @-( cd $(DESTDIR)$(webdir); rm -rf events graphics images sounds temp ) + @-( if test "$(ZM_RUNDIR)" != "/var/run"; then rm -rf $(ZM_RUNDIR); fi ) + @-( if test "$(ZM_TMPDIR)" != "/tmp"; then rm -rf $(ZM_TMPDIR); fi ) + @-( if test "$(ZM_LOGDIR)" != "/var/log"; then rm -rf $(ZM_LOGDIR); fi ) diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 000000000..91a2c41d3 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,880 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/zm.conf.in $(srcdir)/zmconfgen.pl.in \ + $(top_srcdir)/configure \ + $(top_srcdir)/scripts/ZoneMinder/lib/ZoneMinder/Base.pm.in \ + $(top_srcdir)/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in \ + $(top_srcdir)/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in \ + $(top_srcdir)/scripts/ZoneMinder/lib/ZoneMinder/Memory.pm.in \ + AUTHORS COPYING ChangeLog INSTALL NEWS TODO depcomp install-sh \ + missing mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = zm.conf zmconfgen.pl \ + scripts/ZoneMinder/lib/ZoneMinder/Base.pm \ + scripts/ZoneMinder/lib/ZoneMinder/Config.pm \ + scripts/ZoneMinder/lib/ZoneMinder/Memory.pm \ + scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(sysconfdir)" +DATA = $(sysconf_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu + +# And these to the user and group of your webserver +webuser = @WEB_USER@ +webgroup = @WEB_GROUP@ +sysconf_DATA = \ + zm.conf + +SUBDIRS = \ + src \ + web \ + scripts \ + db \ + misc + +EXTRA_DIST = \ + zm.conf.in \ + zmconfgen.pl.in + +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +zm.conf: $(top_builddir)/config.status $(srcdir)/zm.conf.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +zmconfgen.pl: $(top_builddir)/config.status $(srcdir)/zmconfgen.pl.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +scripts/ZoneMinder/lib/ZoneMinder/Base.pm: $(top_builddir)/config.status $(top_srcdir)/scripts/ZoneMinder/lib/ZoneMinder/Base.pm.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +scripts/ZoneMinder/lib/ZoneMinder/Config.pm: $(top_builddir)/config.status $(top_srcdir)/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +scripts/ZoneMinder/lib/ZoneMinder/Memory.pm: $(top_builddir)/config.status $(top_srcdir)/scripts/ZoneMinder/lib/ZoneMinder/Memory.pm.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm: $(top_builddir)/config.status $(top_srcdir)/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +install-sysconfDATA: $(sysconf_DATA) + @$(NORMAL_INSTALL) + @list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(sysconfdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(sysconfdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(sysconfdir)" || exit $$?; \ + done + +uninstall-sysconfDATA: + @$(NORMAL_UNINSTALL) + @list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(sysconfdir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod u+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(sysconfdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-sysconfDATA + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-sysconfDATA + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ + ctags-recursive install-am install-data-am install-strip \ + tags-recursive uninstall-am + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ + dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-data-hook install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip install-sysconfDATA installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-hook uninstall-sysconfDATA + + +# Yes, you are correct. This is a HACK! +install-data-hook: + ( cd $(DESTDIR)$(sysconfdir); chown $(webuser):$(webgroup) $(sysconf_DATA); chmod 600 $(sysconf_DATA) ) + ( if ! test -e $(ZM_RUNDIR); then mkdir -p $(ZM_RUNDIR); fi; if test "$(ZM_RUNDIR)" != "/var/run"; then chown $(webuser):$(webgroup) $(ZM_RUNDIR); chmod u+w $(ZM_RUNDIR); fi ) + ( if ! test -e $(ZM_TMPDIR); then mkdir -m 700 -p $(ZM_TMPDIR); fi; if test "$(ZM_TMPDIR)" != "/tmp"; then chown $(webuser):$(webgroup) $(ZM_TMPDIR); chmod u+w $(ZM_TMPDIR); fi ) + ( if ! test -e $(ZM_LOGDIR); then mkdir -p $(ZM_LOGDIR); fi; if test "$(ZM_LOGDIR)" != "/var/log"; then chown $(webuser):$(webgroup) $(ZM_LOGDIR); chmod u+w $(ZM_LOGDIR); fi ) + +uninstall-hook: + @-( cd $(DESTDIR)$(webdir); rm -rf events graphics images sounds temp ) + @-( if test "$(ZM_RUNDIR)" != "/var/run"; then rm -rf $(ZM_RUNDIR); fi ) + @-( if test "$(ZM_TMPDIR)" != "/tmp"; then rm -rf $(ZM_TMPDIR); fi ) + @-( if test "$(ZM_LOGDIR)" != "/var/log"; then rm -rf $(ZM_LOGDIR); fi ) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/NEWS b/NEWS new file mode 100644 index 000000000..3160e2dce --- /dev/null +++ b/NEWS @@ -0,0 +1 @@ +Please see README file. diff --git a/README b/README new file mode 100644 index 000000000..e3dfa62e1 --- /dev/null +++ b/README @@ -0,0 +1,5 @@ + +All documentation for ZoneMinder is now online at + +http://www.zoneminder.com/wiki/index.php/Documentation + diff --git a/TODO b/TODO new file mode 100644 index 000000000..69af9c87e --- /dev/null +++ b/TODO @@ -0,0 +1,2 @@ +Please see README file. + diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 000000000..605842149 --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,74 @@ +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 diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 000000000..8ba41b05f --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,984 @@ +# generated automatically by aclocal 1.11.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.6], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11.6])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 16 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([acinclude.m4]) diff --git a/config.h.in b/config.h.in new file mode 100644 index 000000000..1f5a69b23 --- /dev/null +++ b/config.h.in @@ -0,0 +1,450 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Expanded binary directory */ +#undef BINDIR + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#undef CRAY_STACKSEG_END + +/* Define to 1 if using `alloca.c'. */ +#undef C_ALLOCA + +/* Define to 1 if you have `alloca', as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +#undef HAVE_ALLOCA_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if you have the declaration of `backtrace', and to 0 if you + don't. */ +#undef HAVE_DECL_BACKTRACE + +/* Define to 1 if you have the declaration of `gnutls_fingerprint', and to 0 + if you don't. */ +#undef HAVE_DECL_GNUTLS_FINGERPRINT + +/* Define to 1 if you have the declaration of `MD5', and to 0 if you don't. */ +#undef HAVE_DECL_MD5 + +/* Define to 1 if you have the declaration of `round', and to 0 if you don't. + */ +#undef HAVE_DECL_ROUND + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +#undef HAVE_DOPRNT + +/* Define to 1 if you have the header file. */ +#undef HAVE_EXECINFO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_GCRYPT_H + +/* Define to 1 if you have the `gethostbyname' function. */ +#undef HAVE_GETHOSTBYNAME + +/* Define to 1 if you have the `gethostname' function. */ +#undef HAVE_GETHOSTNAME + +/* Define to 1 if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the header file. */ +#undef HAVE_GLOB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_GNUTLS_GNUTLS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_GNUTLS_OPENSSL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `ioctl' function. */ +#undef HAVE_IOCTL + +/* Define to 1 if you have the `ioctlsocket' function. */ +#undef HAVE_IOCTLSOCKET + +/* Define to 1 if you have the header file. */ +#undef HAVE_JPEGLIB_H + +/* Define to 1 if you have the `avcodec' library (-lavcodec). */ +#undef HAVE_LIBAVCODEC + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBAVCODEC_AVCODEC_H + +/* Define to 1 if you have the `avcore' library (-lavcore). */ +#undef HAVE_LIBAVCORE + +/* Define to 1 if you have the `avdevice' library (-lavdevice). */ +#undef HAVE_LIBAVDEVICE + +/* Define to 1 if you have the `avformat' library (-lavformat). */ +#undef HAVE_LIBAVFORMAT + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBAVFORMAT_AVFORMAT_H + +/* Define to 1 if you have the `avutil' library (-lavutil). */ +#undef HAVE_LIBAVUTIL + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBAVUTIL_AVUTIL_H + +/* Define to 1 if you have the `bz2' library (-lbz2). */ +#undef HAVE_LIBBZ2 + +/* Define to 1 if you have the `crypto' library (-lcrypto). */ +#undef HAVE_LIBCRYPTO + +/* Define to 1 if you have the `dl' library (-ldl). */ +#undef HAVE_LIBDL + +/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */ +#undef HAVE_LIBGCRYPT + +/* Define to 1 if you have the `gnutls' library (-lgnutls). */ +#undef HAVE_LIBGNUTLS + +/* Define to 1 if you have the `jpeg' library (-ljpeg). */ +#undef HAVE_LIBJPEG + +/* Define to 1 if you have the `mysqlclient' library (-lmysqlclient). */ +#undef HAVE_LIBMYSQLCLIENT + +/* Define to 1 if you have the `pcre' library (-lpcre). */ +#undef HAVE_LIBPCRE + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#undef HAVE_LIBPTHREAD + +/* Define to 1 if you have the `swscale' library (-lswscale). */ +#undef HAVE_LIBSWSCALE + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBSWSCALE_SWSCALE_H + +/* Define to 1 if you have the `x264' library (-lx264). */ +#undef HAVE_LIBX264 + +/* Define to 1 if you have the `z' library (-lz). */ +#undef HAVE_LIBZ + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_VIDEODEV2_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_VIDEODEV_H + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the `memmove' function. */ +#undef HAVE_MEMMOVE + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have the `mkdir' function. */ +#undef HAVE_MKDIR + +/* Define to 1 if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define to 1 if you have the `munmap' function. */ +#undef HAVE_MUNMAP + +/* Define to 1 if you have the header file. */ +#undef HAVE_MYSQL_MYSQL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETDB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_OPENSSL_MD5_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_PCRE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_PCRE_PCRE_H + +/* Define to 1 if you have the `posix_memalign' function. */ +#undef HAVE_POSIX_MEMALIGN + +/* Define to 1 if you have the header file. */ +#undef HAVE_PTHREAD_H + +/* Define to 1 if you have the `putenv' function. */ +#undef HAVE_PUTENV + +/* Define to 1 if you have the `select' function. */ +#undef HAVE_SELECT + +/* Define to 1 if you have the `sendfile' function. */ +#undef HAVE_SENDFILE + +/* Define to 1 if you have the `sigaction' function. */ +#undef HAVE_SIGACTION + +/* Define to 1 if the system has the type `siginfo_t'. */ +#undef HAVE_SIGINFO_T + +/* Define to 1 if you have the `sleep' function. */ +#undef HAVE_SLEEP + +/* Define to 1 if you have the `socket' function. */ +#undef HAVE_SOCKET + +/* Define to 1 if you have the `sqrt' function. */ +#undef HAVE_SQRT + +/* Define to 1 if `stat' has the bug that it succeeds when given the + zero-length file name argument. */ +#undef HAVE_STAT_EMPTY_STRING_BUG + +/* Define to 1 if stdbool.h conforms to C99. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDDEF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the `strcspn' function. */ +#undef HAVE_STRCSPN + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the `strftime' function. */ +#undef HAVE_STRFTIME + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strncasecmp' function. */ +#undef HAVE_STRNCASECMP + +/* Define to 1 if you have the `strrchr' function. */ +#undef HAVE_STRRCHR + +/* Define to 1 if you have the `strsignal' function. */ +#undef HAVE_STRSIGNAL + +/* Define to 1 if you have the `strspn' function. */ +#undef HAVE_STRSPN + +/* Define to 1 if you have the `strstr' function. */ +#undef HAVE_STRSTR + +/* Define to 1 if you have the `strtol' function. */ +#undef HAVE_STRTOL + +/* Define to 1 if you have the `strtoull' function. */ +#undef HAVE_STRTOULL + +/* Define to 1 if the system has the type `struct sigcontext'. */ +#undef HAVE_STRUCT_SIGCONTEXT + +/* Define to 1 if `eip' is a member of `struct sigcontext'. */ +#undef HAVE_STRUCT_SIGCONTEXT_EIP + +/* Define to 1 if you have the `syscall' function. */ +#undef HAVE_SYSCALL + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYSCALL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYSLOG_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IPC_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MMAN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SENDFILE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SHM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_UN_H + +/* Define to 1 if the system has the type `ucontext_t'. */ +#undef HAVE_UCONTEXT_T + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `usleep' function. */ +#undef HAVE_USLEEP + +/* Define to 1 if you have the header file. */ +#undef HAVE_VALUES_H + +/* Define to 1 if you have the `vprintf' function. */ +#undef HAVE_VPRINTF + +/* Define to 1 if you have the header file. */ +#undef HAVE_ZLIB_H + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Expanded library directory */ +#undef LIBDIR + +/* Define to 1 if `lstat' dereferences a symlink specified with a trailing + slash. */ +#undef LSTAT_FOLLOWS_SLASHED_SYMLINK + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define as the return type of signal handlers (`int' or `void'). */ +#undef RETSIGTYPE + +/* Define to the type of arg 1 for `select'. */ +#undef SELECT_TYPE_ARG1 + +/* Define to the type of args 2, 3 and 4 for `select'. */ +#undef SELECT_TYPE_ARG234 + +/* Define to the type of arg 5 for `select'. */ +#undef SELECT_TYPE_ARG5 + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Expanded configuration directory */ +#undef SYSCONFDIR + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* Version number of package */ +#undef VERSION + +/* "Whether debug is switched off and compiled out" */ +#undef ZM_DBG_OFF + +/* "Whether to use mapped rather than shared memory" */ +#undef ZM_MEM_MAPPED + +/* "Whether crash tracing is switched off and compiled out" */ +#undef ZM_NO_CRASHTRACE + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `int' if doesn't define. */ +#undef gid_t + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define to `int' if does not define. */ +#undef mode_t + +/* Define to `unsigned int' if does not define. */ +#undef size_t + +/* Define to `int' if doesn't define. */ +#undef uid_t diff --git a/configure b/configure new file mode 100755 index 000000000..98677df99 --- /dev/null +++ b/configure @@ -0,0 +1,11153 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for zm 1.25.0. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: http://www.zoneminder.com/forums/ - Please check FAQ +$0: first about your system, including any error possibly +$0: output before this message. Then install a modern +$0: shell, or manually run the script under such a shell if +$0: you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='zm' +PACKAGE_TARNAME='ZoneMinder' +PACKAGE_VERSION='1.25.0' +PACKAGE_STRING='zm 1.25.0' +PACKAGE_BUGREPORT='http://www.zoneminder.com/forums/ - Please check FAQ first' +PACKAGE_URL='http://www.zoneminder.com/downloads.html' + +ac_unique_file="src/zm.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_list= +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +EXTRA_PERL_LIB +PERL_MM_PARMS +ZM_CONFIG +SYSCONFDIR +ZM_PID +LIBDIR +BINDIR +PERL +ZM_PCRE +ZM_HAS_V4L +ZM_HAS_V4L2 +ZM_HAS_V4L1 +ALLOCA +ZM_HAS_GNUTLS +ZM_HAS_GNUTLS_OPENSSL +PATH_NETPBM +OPT_NETPBM +PATH_FFMPEG +OPT_FFMPEG +POW_LIB +LIBOBJS +EGREP +GREP +CXXCPP +RANLIB +LN_S +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +ac_ct_CC +CFLAGS +CC +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CXX +CPPFLAGS +LDFLAGS +CXXFLAGS +CXX +ENABLE_MMAP +WEB_HOST +WEB_GROUP +WEB_USER +CGI_PREFIX +WEB_PREFIX +EXTRA_LIBS +FFMPEG_CFLAGS +FFMPEG_LIBS +FFMPEG_PREFIX +MYSQL_CFLAGS +MYSQL_LIBS +MYSQL_PREFIX +LIB_ARCH +ZM_LOGDIR +ZM_TMPDIR +ZM_RUNDIR +ZM_MYSQL_ENGINE +ZM_SSL_LIB +ZM_DB_PASS +ZM_DB_USER +ZM_DB_NAME +ZM_DB_HOST +TIME_BUILD +PATH_BUILD +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +with_libarch +with_mysql +with_ffmpeg +with_extralibs +with_webdir +with_cgidir +with_webuser +with_webgroup +with_webhost +enable_debug +enable_crashtrace +enable_mmap +enable_dependency_tracking +' + ac_precious_vars='build_alias +host_alias +target_alias +ZM_DB_HOST +ZM_DB_NAME +ZM_DB_USER +ZM_DB_PASS +ZM_SSL_LIB +ZM_MYSQL_ENGINE +ZM_RUNDIR +ZM_TMPDIR +ZM_LOGDIR +CXX +CXXFLAGS +LDFLAGS +LIBS +CPPFLAGS +CCC +CC +CFLAGS +CXXCPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures zm 1.25.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/ZoneMinder] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of zm 1.25.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-debug= enable or disable debug, default enabled + --enable-crashtrace= enable or disabled crash tracing, default enabled + --enable-mmap= enable or disabled mapped memory versus shared memory, default mapped + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-libarch= architecture library path to use, default lib + --with-mysql= prefix of MySQL installation, default /usr + --with-ffmpeg= prefix of ffmpeg root directory for libavcodec etc, default /usr + --with-extralibs="" string containing extra libraries to pass to link, default empty + --with-webdir= prefix of web directory + --with-cgidir= prefix of cgi directory + --with-webuser= name of web user, default apache + --with-webgroup= name of web group, default apache + --with-webhost= name of web hostname, default zm.local + +Some influential environment variables: + ZM_DB_HOST Hostname where ZoneMinder database located, default localhost + ZM_DB_NAME Name of ZoneMinder database, default zm + ZM_DB_USER Name of ZoneMinder database user, default zmuser + ZM_DB_PASS Password of ZoneMinder database user, default zmpass + ZM_SSL_LIB Library to use for ssl functions, default gnutls + ZM_MYSQL_ENGINE + MySQL engine to use with database, default MyISAM + ZM_RUNDIR Location of transient process files, default /var/run/zm + ZM_TMPDIR Location of temporary files, default /tmp/zm + ZM_LOGDIR Location of generated log files, default /var/log/zm + CXX C++ compiler command + CXXFLAGS C++ compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CC C compiler command + CFLAGS C compiler flags + CXXCPP C++ preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +zm home page: . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +zm configure 1.25.0 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES +# --------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_cxx_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_type + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_try_run LINENO +# ------------------------ +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_cxx_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_run + +# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES +# --------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_cxx_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_header_compile + +# ac_fn_cxx_check_member LINENO AGGR MEMBER VAR INCLUDES +# ------------------------------------------------------ +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_cxx_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$4=yes" +else + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_member + +# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES +# --------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_cxx_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ------------------------------------------------------------------------- ## +## Report this to http://www.zoneminder.com/forums/ - Please check FAQ first ## +## ------------------------------------------------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_header_mongrel + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + +# ac_fn_cxx_check_func LINENO FUNC VAR +# ------------------------------------ +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_cxx_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_func + +# ac_fn_cxx_check_decl LINENO SYMBOL VAR INCLUDES +# ----------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_cxx_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_decl +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by zm $as_me 1.25.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +as_fn_append ac_header_list " stdlib.h" +as_fn_append ac_header_list " unistd.h" +as_fn_append ac_header_list " sys/param.h" +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +am__api_version='1.11' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='ZoneMinder' + VERSION='1.25.0' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +ac_config_headers="$ac_config_headers config.h" + + +PATH_BUILD=`pwd` + +TIME_BUILD=`date +'%s'` + + + + + + + + + + + + +if test "$ZM_DB_HOST" == ""; then + ZM_DB_HOST=localhost + +fi +if test "$ZM_DB_NAME" == ""; then + ZM_DB_NAME=zm + +fi +if test "$ZM_DB_USER" == ""; then + ZM_DB_USER=zmuser + +fi +if test "$ZM_DB_PASS" == ""; then + ZM_DB_PASS=zmpass + +fi +if test "$ZM_SSL_LIB" == ""; then + ZM_SSL_LIB=gnutls + +fi +if test "$ZM_MYSQL_ENGINE" == ""; then + ZM_MYSQL_ENGINE=MyISAM + +fi +if test "$ZM_RUNDIR" == ""; then + ZM_RUNDIR=/var/run/zm + +fi +if test "$ZM_TMPDIR" == ""; then + ZM_TMPDIR=/tmp/zm + +fi +if test "$ZM_LOGDIR" == ""; then + ZM_LOGDIR=/var/log/zm + +fi + +LIB_ARCH=lib + +# Check whether --with-libarch was given. +if test "${with_libarch+set}" = set; then : + withval=$with_libarch; LIB_ARCH=$with_libarch +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 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" >&5 +$as_echo "$as_me: WARNING: 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" >&2;} + +fi + + + +MYSQL_PREFIX=/usr + +# Check whether --with-mysql was given. +if test "${with_mysql+set}" = set; then : + withval=$with_mysql; MYSQL_PREFIX=$with_mysql +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 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" >&5 +$as_echo "$as_me: WARNING: 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" >&2;} + +fi + + +MYSQL_LIBS="-L${MYSQL_PREFIX}/${LIB_ARCH}/mysql" +MYSQL_CFLAGS="-I${MYSQL_PREFIX}/include" + + + +LDFLAGS="${MYSQL_LIBS} $LDFLAGS" + +FFMPEG_PREFIX=/usr + +# Check whether --with-ffmpeg was given. +if test "${with_ffmpeg+set}" = set; then : + withval=$with_ffmpeg; FFMPEG_PREFIX=$with_ffmpeg +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 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" >&5 +$as_echo "$as_me: WARNING: 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" >&2;} + +fi + + +FFMPEG_LIBS="-L${FFMPEG_PREFIX}/${LIB_ARCH}" +FFMPEG_CFLAGS="-I${FFMPEG_PREFIX}/include -D__STDC_CONSTANT_MACROS" + + + +LDFLAGS="${FFMPEG_LIBS} $LDFLAGS" +CFLAGS="${FFMPEG_CFLAGS} $CFLAGS" +CPPFLAGS="${FFMPEG_CFLAGS} $CPPFLAGS" + +EXTRA_LIBS= + +# Check whether --with-extralibs was given. +if test "${with_extralibs+set}" = set; then : + withval=$with_extralibs; EXTRA_LIBS=$with_extralibs +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 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\"" >&5 +$as_echo "$as_me: WARNING: 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\"" >&2;} + +fi + + + +LDFLAGS="$LDFLAGS ${EXTRA_LIBS}" + + +# Check whether --with-webdir was given. +if test "${with_webdir+set}" = set; then : + withval=$with_webdir; WEB_PREFIX=$with_webdir +else + as_fn_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/" "$LINENO" 5 + +fi + + + + +# Check whether --with-cgidir was given. +if test "${with_cgidir+set}" = set; then : + withval=$with_cgidir; CGI_PREFIX=$with_cgidir +else + as_fn_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//cgi-bin" "$LINENO" 5 + +fi + + + +WEB_USER=apache + +# Check whether --with-webuser was given. +if test "${with_webuser+set}" = set; then : + withval=$with_webuser; WEB_USER=$with_webuser +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 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" >&5 +$as_echo "$as_me: WARNING: 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" >&2;} + +fi + + + +WEB_GROUP=apache + +# Check whether --with-webgroup was given. +if test "${with_webgroup+set}" = set; then : + withval=$with_webgroup; WEB_GROUP=$with_webgroup +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 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" >&5 +$as_echo "$as_me: WARNING: 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" >&2;} + +fi + + + +WEB_HOST=zm.local + +# Check whether --with-webhost was given. +if test "${with_webhost+set}" = set; then : + withval=$with_webhost; WEB_HOST=$with_webhost +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 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" >&5 +$as_echo "$as_me: WARNING: 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" >&2;} + +fi + + + +ENABLE_DEBUG=yes +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; ENABLE_DEBUG=$enable_debug +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You can call configure with the --enable-debug= 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" >&5 +$as_echo "$as_me: WARNING: You can call configure with the --enable-debug= 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" >&2;} + +fi + +if test "$ENABLE_DEBUG" != "yes"; then + +$as_echo "#define ZM_DBG_OFF 1" >>confdefs.h + +fi + +ENABLE_CRASHTRACE=yes +# Check whether --enable-crashtrace was given. +if test "${enable_crashtrace+set}" = set; then : + enableval=$enable_crashtrace; ENABLE_CRASHTRACE=$enable_crashtrace +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You can call configure with the --enable-crashtrace= or --disable-crashtrace option. + This tells configure whether to compile ZoneMinder with crash tracing included. This allows a + dump of the stack trace when a ZoneMinder binary crashes or is killed by an unexpected signal. + Although this should work on most systems it does rely on un(or loosely) documented features and + so should be regarded as experimental. If you experience problems compiling zm_signal.cpp or + ZoneMinder binaries fail to shut down correctly then you should probably disable this feature. + e.g. --enable-crashtrace=yes or --disable-crashtrace" >&5 +$as_echo "$as_me: WARNING: You can call configure with the --enable-crashtrace= or --disable-crashtrace option. + This tells configure whether to compile ZoneMinder with crash tracing included. This allows a + dump of the stack trace when a ZoneMinder binary crashes or is killed by an unexpected signal. + Although this should work on most systems it does rely on un(or loosely) documented features and + so should be regarded as experimental. If you experience problems compiling zm_signal.cpp or + ZoneMinder binaries fail to shut down correctly then you should probably disable this feature. + e.g. --enable-crashtrace=yes or --disable-crashtrace" >&2;} + +fi + +if test "$ENABLE_CRASHTRACE" != "yes"; then + +$as_echo "#define ZM_NO_CRASHTRACE 1" >>confdefs.h + +fi + +ENABLE_MMAP=yes +# Check whether --enable-mmap was given. +if test "${enable_mmap+set}" = set; then : + enableval=$enable_mmap; ENABLE_MMAP=$enable_mmap +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You can call configure with the --enable-mmap= 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" >&5 +$as_echo "$as_me: WARNING: You can call configure with the --enable-mmap= 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" >&2;} + +fi + +if test "$ENABLE_MMAP" == "yes"; then + +$as_echo "#define ZM_MEM_MAPPED 1" >>confdefs.h + +else + +$as_echo "#define ZM_MEM_MAPPED 0" >>confdefs.h + +fi + + +# Compiler +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +# Checks for programs. +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 +$as_echo_n "checking whether the C++ compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C++ compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 +$as_echo_n "checking for C++ compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C++ compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + +# Checks for typedefs, structures, and compiler characteristics. + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } +if ${ac_cv_header_stdbool_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + +int +main () +{ + + bool e = &s; + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_header_stdbool_h=yes +else + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +$as_echo "$ac_cv_header_stdbool_h" >&6; } + ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 +_ACEOF + + +fi + + +if test $ac_cv_header_stdbool_h = yes; then + +$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } +if ${ac_cv_type_uid_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1; then : + ac_cv_type_uid_t=yes +else + ac_cv_type_uid_t=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then + +$as_echo "#define uid_t int" >>confdefs.h + + +$as_echo "#define gid_t int" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +ac_fn_cxx_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define mode_t int +_ACEOF + +fi + +ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if ${ac_cv_header_time+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_header_time=yes +else + ac_cv_header_time=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if ${ac_cv_struct_tm+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_struct_tm=time.h +else + ac_cv_struct_tm=sys/time.h +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } +if ${ac_cv_type_signal+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +return *(signal (0, 0)) (0) == 1; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_type_signal=int +else + ac_cv_type_signal=void +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + + +ac_fn_cxx_check_type "$LINENO" "siginfo_t" "ac_cv_type_siginfo_t" "#include +" +if test "x$ac_cv_type_siginfo_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIGINFO_T 1 +_ACEOF + + +fi + +ac_fn_cxx_check_type "$LINENO" "struct sigcontext" "ac_cv_type_struct_sigcontext" "#include +" +if test "x$ac_cv_type_struct_sigcontext" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SIGCONTEXT 1 +_ACEOF + + +fi + +ac_fn_cxx_check_member "$LINENO" "struct sigcontext" "eip" "ac_cv_member_struct_sigcontext_eip" "#include +" +if test "x$ac_cv_member_struct_sigcontext_eip" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SIGCONTEXT_EIP 1 +_ACEOF + + +fi + +ac_fn_cxx_check_type "$LINENO" "ucontext_t" "ac_cv_type_ucontext_t" "#include +" +if test "x$ac_cv_type_ucontext_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_UCONTEXT_T 1 +_ACEOF + + +fi + + +# Checks for library functions. +if test $ac_cv_c_compiler_gnu = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 +$as_echo_n "checking whether $CC needs -traditional... " >&6; } +if ${ac_cv_prog_gcc_traditional+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_pattern="Autoconf.*'x'" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 +$as_echo "$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + +for ac_header in stdlib.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +$as_echo_n "checking for GNU libc compatible malloc... " >&6; } +if ${ac_cv_func_malloc_0_nonnull+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_malloc_0_nonnull=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *malloc (); +#endif + +int +main () +{ +return ! malloc (0); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + ac_cv_func_malloc_0_nonnull=yes +else + ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then : + +$as_echo "#define HAVE_MALLOC 1" >>confdefs.h + +else + $as_echo "#define HAVE_MALLOC 0" >>confdefs.h + + case " $LIBOBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; +esac + + +$as_echo "#define malloc rpl_malloc" >>confdefs.h + +fi + + + + + + for ac_header in $ac_header_list +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + +for ac_func in getpagesize +do : + ac_fn_cxx_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETPAGESIZE 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 +$as_echo_n "checking for working mmap... " >&6; } +if ${ac_cv_func_mmap_fixed_mapped+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_mmap_fixed_mapped=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +/* malloc might have been renamed as rpl_malloc. */ +#undef malloc + +/* Thanks to Mike Haertel and Jim Avera for this test. + Here is a matrix of mmap possibilities: + mmap private not fixed + mmap private fixed at somewhere currently unmapped + mmap private fixed at somewhere already mapped + mmap shared not fixed + mmap shared fixed at somewhere currently unmapped + mmap shared fixed at somewhere already mapped + For private mappings, we should verify that changes cannot be read() + back from the file, nor mmap's back from the file at a different + address. (There have been systems where private was not correctly + implemented like the infamous i386 svr4.0, and systems where the + VM page cache was not coherent with the file system buffer cache + like early versions of FreeBSD and possibly contemporary NetBSD.) + For shared mappings, we should conversely verify that changes get + propagated back to all the places they're supposed to be. + + Grep wants private fixed already mapped. + The main things grep needs to know about mmap are: + * does it exist and is it safe to write into the mmap'd area + * how to use it (BSD variants) */ + +#include +#include + +#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H +char *malloc (); +#endif + +/* This mess was copied from the GNU getpagesize.h. */ +#ifndef HAVE_GETPAGESIZE +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# ifdef HAVE_SYS_PARAM_H +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else /* no EXEC_PAGESIZE */ +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* no CLSIZE */ +# else /* no NBPG */ +# ifdef NBPC +# define getpagesize() NBPC +# else /* no NBPC */ +# ifdef PAGESIZE +# define getpagesize() PAGESIZE +# endif /* PAGESIZE */ +# endif /* no NBPC */ +# endif /* no NBPG */ +# endif /* no EXEC_PAGESIZE */ +# else /* no HAVE_SYS_PARAM_H */ +# define getpagesize() 8192 /* punt totally */ +# endif /* no HAVE_SYS_PARAM_H */ +# endif /* no _SC_PAGESIZE */ + +#endif /* no HAVE_GETPAGESIZE */ + +int +main () +{ + char *data, *data2, *data3; + const char *cdata2; + int i, pagesize; + int fd, fd2; + + pagesize = getpagesize (); + + /* First, make a file with some known garbage in it. */ + data = (char *) malloc (pagesize); + if (!data) + return 1; + for (i = 0; i < pagesize; ++i) + *(data + i) = rand (); + umask (0); + fd = creat ("conftest.mmap", 0600); + if (fd < 0) + return 2; + if (write (fd, data, pagesize) != pagesize) + return 3; + close (fd); + + /* Next, check that the tail of a page is zero-filled. File must have + non-zero length, otherwise we risk SIGBUS for entire page. */ + fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); + if (fd2 < 0) + return 4; + cdata2 = ""; + if (write (fd2, cdata2, 1) != 1) + return 5; + data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); + if (data2 == MAP_FAILED) + return 6; + for (i = 0; i < pagesize; ++i) + if (*(data2 + i)) + return 7; + close (fd2); + if (munmap (data2, pagesize)) + return 8; + + /* Next, try to mmap the file at a fixed address which already has + something else allocated at it. If we can, also make sure that + we see the same garbage. */ + fd = open ("conftest.mmap", O_RDWR); + if (fd < 0) + return 9; + if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + return 10; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + return 11; + + /* Finally, make sure that changes to the mapped area do not + percolate back to the file as seen by read(). (This is a bug on + some variants of i386 svr4.0.) */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = (char *) malloc (pagesize); + if (!data3) + return 12; + if (read (fd, data3, pagesize) != pagesize) + return 13; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + return 14; + close (fd); + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + ac_cv_func_mmap_fixed_mapped=yes +else + ac_cv_func_mmap_fixed_mapped=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 +$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } +if test $ac_cv_func_mmap_fixed_mapped = yes; then + +$as_echo "#define HAVE_MMAP 1" >>confdefs.h + +fi +rm -f conftest.mmap conftest.txt + +for ac_header in sys/select.h sys/socket.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5 +$as_echo_n "checking types of arguments for select... " >&6; } +if ${ac_cv_func_select_args+:} false; then : + $as_echo_n "(cached) " >&6 +else + for ac_arg234 in 'fd_set *' 'int *' 'void *'; do + for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do + for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +#ifdef HAVE_SYS_SELECT_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif + +int +main () +{ +extern int select ($ac_arg1, + $ac_arg234, $ac_arg234, $ac_arg234, + $ac_arg5); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done + done +done +# Provide a safe default value. +: "${ac_cv_func_select_args=int,int *,struct timeval *}" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5 +$as_echo "$ac_cv_func_select_args" >&6; } +ac_save_IFS=$IFS; IFS=',' +set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` +IFS=$ac_save_IFS +shift + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG1 $1 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG234 ($2) +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG5 ($3) +_ACEOF + +rm -f conftest* + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 +$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } +if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f conftest.sym conftest.file +echo >conftest.file +if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then + if test "$cross_compiling" = yes; then : + ac_cv_func_lstat_dereferences_slashed_symlink=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + /* Linux will dereference the symlink and fail, as required by POSIX. + That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + ac_cv_func_lstat_dereferences_slashed_symlink=yes +else + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +else + # If the `ln -s' command failed, then we probably don't even + # have an lstat function. + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f conftest.sym conftest.file + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } + +test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && + +cat >>confdefs.h <<_ACEOF +#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 +_ACEOF + + +if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then + case " $LIBOBJS " in + *" lstat.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS lstat.$ac_objext" + ;; +esac + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 +$as_echo_n "checking whether stat accepts an empty string... " >&6; } +if ${ac_cv_func_stat_empty_string_bug+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_stat_empty_string_bug=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + return stat ("", &sbuf) == 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + ac_cv_func_stat_empty_string_bug=no +else + ac_cv_func_stat_empty_string_bug=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5 +$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; } +if test $ac_cv_func_stat_empty_string_bug = yes; then + case " $LIBOBJS " in + *" stat.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS stat.$ac_objext" + ;; +esac + + +cat >>confdefs.h <<_ACEOF +#define HAVE_STAT_EMPTY_STRING_BUG 1 +_ACEOF + +fi + +for ac_func in strftime +do : + ac_fn_cxx_check_func "$LINENO" "strftime" "ac_cv_func_strftime" +if test "x$ac_cv_func_strftime" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRFTIME 1 +_ACEOF + +else + # strftime is in -lintl on SCO UNIX. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 +$as_echo_n "checking for strftime in -lintl... " >&6; } +if ${ac_cv_lib_intl_strftime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char strftime (); +int +main () +{ +return strftime (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_intl_strftime=yes +else + ac_cv_lib_intl_strftime=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 +$as_echo "$ac_cv_lib_intl_strftime" >&6; } +if test "x$ac_cv_lib_intl_strftime" = xyes; then : + $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h + +LIBS="-lintl $LIBS" +fi + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 +$as_echo_n "checking for working strtod... " >&6; } +if ${ac_cv_func_strtod+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_strtod=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +$ac_includes_default +#ifndef strtod +double strtod (); +#endif +int +main() +{ + { + /* Some versions of Linux strtod mis-parse strings with leading '+'. */ + char *string = " +69"; + char *term; + double value; + value = strtod (string, &term); + if (value != 69 || term != (string + 4)) + return 1; + } + + { + /* Under Solaris 2.4, strtod returns the wrong value for the + terminating character under some conditions. */ + char *string = "NaN"; + char *term; + strtod (string, &term); + if (term != string && *(term - 1) == 0) + return 1; + } + return 0; +} + +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + ac_cv_func_strtod=yes +else + ac_cv_func_strtod=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 +$as_echo "$ac_cv_func_strtod" >&6; } +if test $ac_cv_func_strtod = no; then + case " $LIBOBJS " in + *" strtod.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtod.$ac_objext" + ;; +esac + +ac_fn_cxx_check_func "$LINENO" "pow" "ac_cv_func_pow" +if test "x$ac_cv_func_pow" = xyes; then : + +fi + +if test $ac_cv_func_pow = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 +$as_echo_n "checking for pow in -lm... " >&6; } +if ${ac_cv_lib_m_pow+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pow (); +int +main () +{ +return pow (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_m_pow=yes +else + ac_cv_lib_m_pow=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 +$as_echo "$ac_cv_lib_m_pow" >&6; } +if test "x$ac_cv_lib_m_pow" = xyes; then : + POW_LIB=-lm +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 +$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} +fi + +fi + +fi + +for ac_func in vprintf +do : + ac_fn_cxx_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" +if test "x$ac_cv_func_vprintf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VPRINTF 1 +_ACEOF + +ac_fn_cxx_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" +if test "x$ac_cv_func__doprnt" = xyes; then : + +$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h + +fi + +fi +done + + +for ac_func in gethostbyname gethostname gettimeofday memmove memset mkdir munmap posix_memalign putenv select sendfile socket sqrt strcasecmp strchr strcspn strerror strncasecmp strrchr strsignal strspn strstr strtol strtoull +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in syscall sleep usleep ioctl ioctlsocket sigaction +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# Other programs +# Extract the first word of "ffmpeg", so it can be a program name with args. +set dummy ffmpeg; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OPT_FFMPEG+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OPT_FFMPEG"; then + ac_cv_prog_OPT_FFMPEG="$OPT_FFMPEG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OPT_FFMPEG="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_OPT_FFMPEG" && ac_cv_prog_OPT_FFMPEG="no" +fi +fi +OPT_FFMPEG=$ac_cv_prog_OPT_FFMPEG +if test -n "$OPT_FFMPEG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPT_FFMPEG" >&5 +$as_echo "$OPT_FFMPEG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "ffmpeg", so it can be a program name with args. +set dummy ffmpeg; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PATH_FFMPEG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PATH_FFMPEG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PATH_FFMPEG="$PATH_FFMPEG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PATH_FFMPEG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PATH_FFMPEG=$ac_cv_path_PATH_FFMPEG +if test -n "$PATH_FFMPEG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_FFMPEG" >&5 +$as_echo "$PATH_FFMPEG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "pnmscale", so it can be a program name with args. +set dummy pnmscale; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OPT_NETPBM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OPT_NETPBM"; then + ac_cv_prog_OPT_NETPBM="$OPT_NETPBM" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OPT_NETPBM="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_OPT_NETPBM" && ac_cv_prog_OPT_NETPBM="no" +fi +fi +OPT_NETPBM=$ac_cv_prog_OPT_NETPBM +if test -n "$OPT_NETPBM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPT_NETPBM" >&5 +$as_echo "$OPT_NETPBM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "pnmscale", so it can be a program name with args. +set dummy pnmscale; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PATH_NETPBM+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PATH_NETPBM in + [\\/]* | ?:[\\/]*) + ac_cv_path_PATH_NETPBM="$PATH_NETPBM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PATH_NETPBM="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PATH_NETPBM=$ac_cv_path_PATH_NETPBM +if test -n "$PATH_NETPBM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_NETPBM" >&5 +$as_echo "$PATH_NETPBM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test "$OPT_NETPBM" == "yes"; then +PATH_NETPBM=`dirname $PATH_NETPBM` +fi + +# Checks for libraries. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_init in -lmysqlclient" >&5 +$as_echo_n "checking for mysql_init in -lmysqlclient... " >&6; } +if ${ac_cv_lib_mysqlclient_mysql_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmysqlclient $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char mysql_init (); +int +main () +{ +return mysql_init (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_mysqlclient_mysql_init=yes +else + ac_cv_lib_mysqlclient_mysql_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_init" >&5 +$as_echo "$ac_cv_lib_mysqlclient_mysql_init" >&6; } +if test "x$ac_cv_lib_mysqlclient_mysql_init" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBMYSQLCLIENT 1 +_ACEOF + + LIBS="-lmysqlclient $LIBS" + +else + as_fn_error $? "zm requires libmysqlclient.a" "$LINENO" 5 +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_start_compress in -ljpeg" >&5 +$as_echo_n "checking for jpeg_start_compress in -ljpeg... " >&6; } +if ${ac_cv_lib_jpeg_jpeg_start_compress+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ljpeg $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char jpeg_start_compress (); +int +main () +{ +return jpeg_start_compress (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_jpeg_jpeg_start_compress=yes +else + ac_cv_lib_jpeg_jpeg_start_compress=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_start_compress" >&5 +$as_echo "$ac_cv_lib_jpeg_jpeg_start_compress" >&6; } +if test "x$ac_cv_lib_jpeg_jpeg_start_compress" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBJPEG 1 +_ACEOF + + LIBS="-ljpeg $LIBS" + +else + as_fn_error $? "zm requires libjpeg.a" "$LINENO" 5 +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 +$as_echo_n "checking for pthread_create in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_create+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_create (); +int +main () +{ +return pthread_create (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_pthread_pthread_create=yes +else + ac_cv_lib_pthread_pthread_create=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } +if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPTHREAD 1 +_ACEOF + + LIBS="-lpthread $LIBS" + +else + as_fn_error $? "zm requires libpthread.a" "$LINENO" 5 +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlsym in -ldl" >&5 +$as_echo_n "checking for dlsym in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlsym+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlsym (); +int +main () +{ +return dlsym (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_dl_dlsym=yes +else + ac_cv_lib_dl_dlsym=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlsym" >&5 +$as_echo "$ac_cv_lib_dl_dlsym" >&6; } +if test "x$ac_cv_lib_dl_dlsym" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDL 1 +_ACEOF + + LIBS="-ldl $LIBS" + +else + as_fn_error $? "zm requires libdl.a" "$LINENO" 5 +fi + +if test "$ZM_SSL_LIB" == "openssl"; then +for ac_header in openssl/md5.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "openssl/md5.h" "ac_cv_header_openssl_md5_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_md5_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_OPENSSL_MD5_H 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: zm requires openssl/md5.h header to be installed for openssl" >&5 +$as_echo "$as_me: WARNING: zm requires openssl/md5.h header to be installed for openssl" >&2;} +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5 in -lcrypto" >&5 +$as_echo_n "checking for MD5 in -lcrypto... " >&6; } +if ${ac_cv_lib_crypto_MD5+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char MD5 (); +int +main () +{ +return MD5 (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_crypto_MD5=yes +else + ac_cv_lib_crypto_MD5=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5" >&5 +$as_echo "$ac_cv_lib_crypto_MD5" >&6; } +if test "x$ac_cv_lib_crypto_MD5" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCRYPTO 1 +_ACEOF + + LIBS="-lcrypto $LIBS" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcrypto.a is required for authenticated streaming - use ZM_SSL_LIB option to select gnutls instead" >&5 +$as_echo "$as_me: WARNING: libcrypto.a is required for authenticated streaming - use ZM_SSL_LIB option to select gnutls instead" >&2;} +fi + +else +for ac_header in gnutls/openssl.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "gnutls/openssl.h" "ac_cv_header_gnutls_openssl_h" "$ac_includes_default" +if test "x$ac_cv_header_gnutls_openssl_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GNUTLS_OPENSSL_H 1 +_ACEOF + ZM_HAS_GNUTLS_OPENSSL=1 + +else + ZM_HAS_GNUTLS_OPENSSL=0 + +fi + +done + +for ac_header in gnutls/gnutls.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "gnutls/gnutls.h" "ac_cv_header_gnutls_gnutls_h" "$ac_includes_default" +if test "x$ac_cv_header_gnutls_gnutls_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GNUTLS_GNUTLS_H 1 +_ACEOF + ZM_HAS_GNUTLS=1 + +else + ZM_HAS_GNUTLS=0 + +fi + +done + +if test "$ZM_HAS_GNUTLS_OPENSSL" == "0" && test "$ZM_HAS_GNUTLS" == "0"; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: gnutls is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead" >&5 +$as_echo "$as_me: WARNING: gnutls is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead" >&2;} +fi +for ac_header in gcrypt.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "gcrypt.h" "ac_cv_header_gcrypt_h" "$ac_includes_default" +if test "x$ac_cv_header_gcrypt_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GCRYPT_H 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: zm requires libgcrypt header to be installed for gnutls" >&5 +$as_echo "$as_me: WARNING: zm requires libgcrypt header to be installed for gnutls" >&2;} +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_check_version in -lgcrypt" >&5 +$as_echo_n "checking for gcry_check_version in -lgcrypt... " >&6; } +if ${ac_cv_lib_gcrypt_gcry_check_version+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgcrypt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gcry_check_version (); +int +main () +{ +return gcry_check_version (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_gcrypt_gcry_check_version=yes +else + ac_cv_lib_gcrypt_gcry_check_version=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcrypt_gcry_check_version" >&5 +$as_echo "$ac_cv_lib_gcrypt_gcry_check_version" >&6; } +if test "x$ac_cv_lib_gcrypt_gcry_check_version" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBGCRYPT 1 +_ACEOF + + LIBS="-lgcrypt $LIBS" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libgcrypt.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead" >&5 +$as_echo "$as_me: WARNING: libgcrypt.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead" >&2;} +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls_fingerprint in -lgnutls" >&5 +$as_echo_n "checking for gnutls_fingerprint in -lgnutls... " >&6; } +if ${ac_cv_lib_gnutls_gnutls_fingerprint+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgnutls $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gnutls_fingerprint (); +int +main () +{ +return gnutls_fingerprint (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_gnutls_gnutls_fingerprint=yes +else + ac_cv_lib_gnutls_gnutls_fingerprint=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_gnutls_fingerprint" >&5 +$as_echo "$ac_cv_lib_gnutls_gnutls_fingerprint" >&6; } +if test "x$ac_cv_lib_gnutls_gnutls_fingerprint" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBGNUTLS 1 +_ACEOF + + LIBS="-lgnutls $LIBS" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libgnutls.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead" >&5 +$as_echo "$as_me: WARNING: libgnutls.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead" >&2;} +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 +$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } +if ${ac_cv_lib_pcre_pcre_compile+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpcre $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pcre_compile (); +int +main () +{ +return pcre_compile (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_pcre_pcre_compile=yes +else + ac_cv_lib_pcre_pcre_compile=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 +$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } +if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPCRE 1 +_ACEOF + + LIBS="-lpcre $LIBS" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libpcre.a may be required for remote/network camera support" >&5 +$as_echo "$as_me: WARNING: libpcre.a may be required for remote/network camera support" >&2;} +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5 +$as_echo_n "checking for zlibVersion in -lz... " >&6; } +if ${ac_cv_lib_z_zlibVersion+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char zlibVersion (); +int +main () +{ +return zlibVersion (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_z_zlibVersion=yes +else + ac_cv_lib_z_zlibVersion=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_zlibVersion" >&5 +$as_echo "$ac_cv_lib_z_zlibVersion" >&6; } +if test "x$ac_cv_lib_z_zlibVersion" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZ 1 +_ACEOF + + LIBS="-lz $LIBS" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x264_predict_16x16_init in -lx264" >&5 +$as_echo_n "checking for x264_predict_16x16_init in -lx264... " >&6; } +if ${ac_cv_lib_x264_x264_predict_16x16_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lx264 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char x264_predict_16x16_init (); +int +main () +{ +return x264_predict_16x16_init (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_x264_x264_predict_16x16_init=yes +else + ac_cv_lib_x264_x264_predict_16x16_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_x264_x264_predict_16x16_init" >&5 +$as_echo "$ac_cv_lib_x264_x264_predict_16x16_init" >&6; } +if test "x$ac_cv_lib_x264_x264_predict_16x16_init" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBX264 1 +_ACEOF + + LIBS="-lx264 $LIBS" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for av_malloc in -lavutil" >&5 +$as_echo_n "checking for av_malloc in -lavutil... " >&6; } +if ${ac_cv_lib_avutil_av_malloc+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lavutil $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char av_malloc (); +int +main () +{ +return av_malloc (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_avutil_av_malloc=yes +else + ac_cv_lib_avutil_av_malloc=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avutil_av_malloc" >&5 +$as_echo "$ac_cv_lib_avutil_av_malloc" >&6; } +if test "x$ac_cv_lib_avutil_av_malloc" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBAVUTIL 1 +_ACEOF + + LIBS="-lavutil $LIBS" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libavutil.a may be required for MPEG streaming" >&5 +$as_echo "$as_me: WARNING: libavutil.a may be required for MPEG streaming" >&2;} +fi + +# Don't bother to warn about this one +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for av_image_copy in -lavcore" >&5 +$as_echo_n "checking for av_image_copy in -lavcore... " >&6; } +if ${ac_cv_lib_avcore_av_image_copy+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lavcore $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char av_image_copy (); +int +main () +{ +return av_image_copy (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_avcore_av_image_copy=yes +else + ac_cv_lib_avcore_av_image_copy=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcore_av_image_copy" >&5 +$as_echo "$ac_cv_lib_avcore_av_image_copy" >&6; } +if test "x$ac_cv_lib_avcore_av_image_copy" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBAVCORE 1 +_ACEOF + + LIBS="-lavcore $LIBS" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for avcodec_open in -lavcodec" >&5 +$as_echo_n "checking for avcodec_open in -lavcodec... " >&6; } +if ${ac_cv_lib_avcodec_avcodec_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lavcodec $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char avcodec_open (); +int +main () +{ +return avcodec_open (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_avcodec_avcodec_open=yes +else + ac_cv_lib_avcodec_avcodec_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_avcodec_open" >&5 +$as_echo "$ac_cv_lib_avcodec_avcodec_open" >&6; } +if test "x$ac_cv_lib_avcodec_avcodec_open" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBAVCODEC 1 +_ACEOF + + LIBS="-lavcodec $LIBS" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libavcodec.a is required for MPEG streaming" >&5 +$as_echo "$as_me: WARNING: libavcodec.a is required for MPEG streaming" >&2;} +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for av_new_stream in -lavformat" >&5 +$as_echo_n "checking for av_new_stream in -lavformat... " >&6; } +if ${ac_cv_lib_avformat_av_new_stream+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lavformat $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char av_new_stream (); +int +main () +{ +return av_new_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_avformat_av_new_stream=yes +else + ac_cv_lib_avformat_av_new_stream=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avformat_av_new_stream" >&5 +$as_echo "$ac_cv_lib_avformat_av_new_stream" >&6; } +if test "x$ac_cv_lib_avformat_av_new_stream" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBAVFORMAT 1 +_ACEOF + + LIBS="-lavformat $LIBS" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libavformat.a is required for MPEG streaming" >&5 +$as_echo "$as_me: WARNING: libavformat.a is required for MPEG streaming" >&2;} +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for avdevice_register_all in -lavdevice" >&5 +$as_echo_n "checking for avdevice_register_all in -lavdevice... " >&6; } +if ${ac_cv_lib_avdevice_avdevice_register_all+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lavdevice $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char avdevice_register_all (); +int +main () +{ +return avdevice_register_all (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_avdevice_avdevice_register_all=yes +else + ac_cv_lib_avdevice_avdevice_register_all=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avdevice_avdevice_register_all" >&5 +$as_echo "$ac_cv_lib_avdevice_avdevice_register_all" >&6; } +if test "x$ac_cv_lib_avdevice_avdevice_register_all" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBAVDEVICE 1 +_ACEOF + + LIBS="-lavdevice $LIBS" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libavdevice.a may be required for MPEG streaming" >&5 +$as_echo "$as_me: WARNING: libavdevice.a may be required for MPEG streaming" >&2;} +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sws_scale in -lswscale" >&5 +$as_echo_n "checking for sws_scale in -lswscale... " >&6; } +if ${ac_cv_lib_swscale_sws_scale+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lswscale -lswscale $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sws_scale (); +int +main () +{ +return sws_scale (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_swscale_sws_scale=yes +else + ac_cv_lib_swscale_sws_scale=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_swscale_sws_scale" >&5 +$as_echo "$ac_cv_lib_swscale_sws_scale" >&6; } +if test "x$ac_cv_lib_swscale_sws_scale" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSWSCALE 1 +_ACEOF + + LIBS="-lswscale $LIBS" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzCompress in -lbz2" >&5 +$as_echo_n "checking for BZ2_bzCompress in -lbz2... " >&6; } +if ${ac_cv_lib_bz2_BZ2_bzCompress+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbz2 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char BZ2_bzCompress (); +int +main () +{ +return BZ2_bzCompress (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_bz2_BZ2_bzCompress=yes +else + ac_cv_lib_bz2_BZ2_bzCompress=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzCompress" >&5 +$as_echo "$ac_cv_lib_bz2_BZ2_bzCompress" >&6; } +if test "x$ac_cv_lib_bz2_BZ2_bzCompress" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBBZ2 1 +_ACEOF + + LIBS="-lbz2 $LIBS" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: zm requires libbz2.a for recent versions of ffmpeg" >&5 +$as_echo "$as_me: WARNING: zm requires libbz2.a for recent versions of ffmpeg" >&2;} +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress in -lz" >&5 +$as_echo_n "checking for compress in -lz... " >&6; } +if ${ac_cv_lib_z_compress+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char compress (); +int +main () +{ +return compress (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_z_compress=yes +else + ac_cv_lib_z_compress=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_compress" >&5 +$as_echo "$ac_cv_lib_z_compress" >&6; } +if test "x$ac_cv_lib_z_compress" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZ 1 +_ACEOF + + LIBS="-lz $LIBS" + +fi + + +# Checks for header files. +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +$as_echo_n "checking for working alloca.h... " >&6; } +if ${ac_cv_working_alloca_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_working_alloca_h=yes +else + ac_cv_working_alloca_h=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +$as_echo "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then + +$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +$as_echo_n "checking for alloca... " >&6; } +if ${ac_cv_func_alloca_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# ifdef HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +void *alloca (size_t); +# endif +# endif +# endif +# endif +#endif + +int +main () +{ +char *p = (char *) alloca (1); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_func_alloca_works=yes +else + ac_cv_func_alloca_works=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +$as_echo "$ac_cv_func_alloca_works" >&6; } + +if test $ac_cv_func_alloca_works = yes; then + +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h + +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext + +$as_echo "#define C_ALLOCA 1" >>confdefs.h + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 +$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } +if ${ac_cv_os_cray+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined CRAY && ! defined CRAY2 +webecray +#else +wenotbecray +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "webecray" >/dev/null 2>&1; then : + ac_cv_os_cray=yes +else + ac_cv_os_cray=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 +$as_echo "$ac_cv_os_cray" >&6; } +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func +_ACEOF + + break +fi + + done +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +$as_echo_n "checking stack direction for C alloca... " >&6; } +if ${ac_cv_c_stack_direction+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_c_stack_direction=0 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction (int *addr, int depth) +{ + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; +} + +int +main (int argc, char **argv) +{ + return find_stack_direction (0, argc + !argv + 20) < 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + ac_cv_c_stack_direction=1 +else + ac_cv_c_stack_direction=-1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +$as_echo "$ac_cv_c_stack_direction" >&6; } +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +_ACEOF + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +for ac_header in 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 +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +for ac_header in netdb.h netinet/in.h arpa/inet.h sys/ioctl.h sys/socket.h sys/un.h glob.h sys/sendfile.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +for ac_header in execinfo.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default" +if test "x$ac_cv_header_execinfo_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_EXECINFO_H 1 +_ACEOF + +fi + +done + +for ac_header in syscall.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "syscall.h" "ac_cv_header_syscall_h" "$ac_includes_default" +if test "x$ac_cv_header_syscall_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYSCALL_H 1 +_ACEOF + +fi + +done + +for ac_header in pthread.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PTHREAD_H 1 +_ACEOF + +fi + +done + +for ac_header in linux/videodev.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "linux/videodev.h" "ac_cv_header_linux_videodev_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_videodev_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LINUX_VIDEODEV_H 1 +_ACEOF + ZM_HAS_V4L1=1 + +else + ZM_HAS_V4L1=0 + +fi + +done + +for ac_header in linux/videodev2.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "linux/videodev2.h" "ac_cv_header_linux_videodev2_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_videodev2_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LINUX_VIDEODEV2_H 1 +_ACEOF + ZM_HAS_V4L2=1 + +else + ZM_HAS_V4L2=0 + +fi + +done + +if test "$ZM_HAS_V4L1" == "1" || test "$ZM_HAS_V4L2" == "1"; then +ZM_HAS_V4L=1 + +else +ZM_HAS_V4L=0 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: zm requires Video4Linux or Video4Linux2 to be installed for analog or USB camera support" >&5 +$as_echo "$as_me: WARNING: zm requires Video4Linux or Video4Linux2 to be installed for analog or USB camera support" >&2;} +fi +for ac_header in jpeglib.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" +if test "x$ac_cv_header_jpeglib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_JPEGLIB_H 1 +_ACEOF + +else + as_fn_error $? "zm requires libjpeg headers to be installed" "$LINENO" 5 +fi + +done + +for ac_header in mysql/mysql.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "mysql/mysql.h" "ac_cv_header_mysql_mysql_h" "$ac_includes_default" +if test "x$ac_cv_header_mysql_mysql_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MYSQL_MYSQL_H 1 +_ACEOF + +else + as_fn_error $? "zm requires MySQL headers - check that MySQL development packages are installed" "$LINENO" 5 +fi + +done + +for ac_header in libavutil/avutil.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "libavutil/avutil.h" "ac_cv_header_libavutil_avutil_h" "$ac_includes_default" +if test "x$ac_cv_header_libavutil_avutil_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBAVUTIL_AVUTIL_H 1 +_ACEOF + +fi + +done + +for ac_header in libavcodec/avcodec.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "libavcodec/avcodec.h" "ac_cv_header_libavcodec_avcodec_h" "$ac_includes_default" +if test "x$ac_cv_header_libavcodec_avcodec_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBAVCODEC_AVCODEC_H 1 +_ACEOF + +fi + +done + +for ac_header in libavformat/avformat.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "libavformat/avformat.h" "ac_cv_header_libavformat_avformat_h" "$ac_includes_default" +if test "x$ac_cv_header_libavformat_avformat_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBAVFORMAT_AVFORMAT_H 1 +_ACEOF + +fi + +done + +for ac_header in libswscale/swscale.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "libswscale/swscale.h" "ac_cv_header_libswscale_swscale_h" "$ac_includes_default" +if test "x$ac_cv_header_libswscale_swscale_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSWSCALE_SWSCALE_H 1 +_ACEOF + +fi + +done + +for ac_header in pcre/pcre.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "pcre/pcre.h" "ac_cv_header_pcre_pcre_h" "$ac_includes_default" +if test "x$ac_cv_header_pcre_pcre_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PCRE_PCRE_H 1 +_ACEOF + ZM_PCRE="1" + +fi + +done + +for ac_header in pcre.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "pcre.h" "ac_cv_header_pcre_h" "$ac_includes_default" +if test "x$ac_cv_header_pcre_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PCRE_H 1 +_ACEOF + ZM_PCRE="1" + +fi + +done + +if test "$ENABLE_MMAP" == "yes"; then +for ac_header in sys/mman.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mman_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_MMAN_H 1 +_ACEOF + +fi + +done + +for ac_header in fcntl.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" +if test "x$ac_cv_header_fcntl_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FCNTL_H 1 +_ACEOF + +fi + +done + +else +for ac_header in sys/ipc.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/ipc.h" "ac_cv_header_sys_ipc_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ipc_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_IPC_H 1 +_ACEOF + +fi + +done + +for ac_header in sys/shm.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_shm_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_SHM_H 1 +_ACEOF + +fi + +done + +fi +for ac_header in zlib.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" +if test "x$ac_cv_header_zlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ZLIB_H 1 +_ACEOF + +fi + +done + + +ac_fn_cxx_check_decl "$LINENO" "round" "ac_cv_have_decl_round" "#include +" +if test "x$ac_cv_have_decl_round" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ROUND $ac_have_decl +_ACEOF + +if test "$ZM_SSL_LIB" == "openssl"; then +ac_fn_cxx_check_decl "$LINENO" "MD5" "ac_cv_have_decl_MD5" "#include +#include +" +if test "x$ac_cv_have_decl_MD5" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MD5 $ac_have_decl +_ACEOF +if test $ac_have_decl = 1; then : + +else + as_fn_error $? "zm requires openssl/md5.h - use ZM_SSL_LIB option to select gnutls instead" "$LINENO" 5 +fi + +else +if test "$ZM_HAS_GNUTLS_OPENSSL" == "1"; then +ac_fn_cxx_check_decl "$LINENO" "MD5" "ac_cv_have_decl_MD5" "#include +#include +" +if test "x$ac_cv_have_decl_MD5" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MD5 $ac_have_decl +_ACEOF +if test $ac_have_decl = 1; then : + +else + as_fn_error $? "zm requires gnutls/openssl.h - use ZM_SSL_LIB option to select openssl instead" "$LINENO" 5 +fi + +else +ac_fn_cxx_check_decl "$LINENO" "gnutls_fingerprint" "ac_cv_have_decl_gnutls_fingerprint" "#include +#include +" +if test "x$ac_cv_have_decl_gnutls_fingerprint" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GNUTLS_FINGERPRINT $ac_have_decl +_ACEOF +if test $ac_have_decl = 1; then : + +else + as_fn_error $? "zm requires gnutls/gnutls.h - use ZM_SSL_LIB option to select openssl instead" "$LINENO" 5 +fi + +fi +fi +ac_fn_cxx_check_decl "$LINENO" "backtrace" "ac_cv_have_decl_backtrace" "#include +" +if test "x$ac_cv_have_decl_backtrace" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_BACKTRACE $ac_have_decl +_ACEOF + + + + +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +# Check if version of Perl is sufficient +ac_perl_version="5.6.0" + +if test "x$PERL" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl version greater than or equal to $ac_perl_version" >&5 +$as_echo_n "checking for perl version greater than or equal to $ac_perl_version... " >&6; } + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi + + +# Compulsory perl modules +ac_perl_modules="Sys::Syslog" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + as_fn_error $? "zm requires SYS:Syslog" "$LINENO" 5 + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +ac_perl_modules="DBI" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + as_fn_error $? "zm requires DBI" "$LINENO" 5 + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +ac_perl_modules="DBD::mysql" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + as_fn_error $? "zm requires DBD::mysql" "$LINENO" 5 + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +ac_perl_modules="Getopt::Long" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + as_fn_error $? "zm requires Getopt::Long" "$LINENO" 5 + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +ac_perl_modules="Time::HiRes" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + as_fn_error $? "zm requires Time::HiRes" "$LINENO" 5 + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +ac_perl_modules="Date::Manip" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + as_fn_error $? "zm requires Date::Manip" "$LINENO" 5 + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +ac_perl_modules="LWP::UserAgent" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + as_fn_error $? "zm requires LWP::UserAgent" "$LINENO" 5 + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +ac_perl_modules="ExtUtils::MakeMaker" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + as_fn_error $? "zm requires ExtUtils::MakeMaker" "$LINENO" 5 + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +if test "$ENABLE_MMAP" == "yes"; then +ac_perl_modules="Sys::Mmap" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + as_fn_error $? "zm requires Sys::Mmap for mapped memory - set --enable-mmap=no to use IPC shared memory instead" "$LINENO" 5 + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +fi + +# Optional perl modules +ac_perl_modules="Module::Load" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Module::Load is required for PTZ camera control" >&5 +$as_echo "$as_me: WARNING: Module::Load is required for PTZ camera control" >&2;} + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +ac_perl_modules="Device::SerialPort" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Device::SerialPort is required for RS232/RS485 PTZ camera control" >&5 +$as_echo "$as_me: WARNING: Device::SerialPort is required for RS232/RS485 PTZ camera control" >&2;} + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +ac_perl_modules="Net::FTP" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Net::FTP is required for automatic event uploading using ftp" >&5 +$as_echo "$as_me: WARNING: Net::FTP is required for automatic event uploading using ftp" >&2;} + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +ac_perl_modules="Net::SFTP::Foreign" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Net::SFTP::Foreign is required for automatic event uploading using sftp" >&5 +$as_echo "$as_me: WARNING: Net::SFTP::Foreign is required for automatic event uploading using sftp" >&2;} + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +ac_perl_modules="Expect" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Expect is required for automatic event uploading using sftp" >&5 +$as_echo "$as_me: WARNING: Expect is required for automatic event uploading using sftp" >&2;} + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +ac_perl_modules="Archive::Tar" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Archive::Tar may be required for automatic event uploading" >&5 +$as_echo "$as_me: WARNING: Archive::Tar may be required for automatic event uploading" >&2;} + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +ac_perl_modules="Archive::Zip" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Archive::Zip may be required for automatic event uploading" >&5 +$as_echo "$as_me: WARNING: Archive::Zip may be required for automatic event uploading" >&2;} + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +ac_perl_modules="Net::SMTP" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Net::SMTP may be required for automatic event email notification" >&5 +$as_echo "$as_me: WARNING: Net::SMTP may be required for automatic event email notification" >&2;} + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +ac_perl_modules="MIME::Lite" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: MIME::Lite may be required for automatic event email notification" >&5 +$as_echo "$as_me: WARNING: MIME::Lite may be required for automatic event email notification" >&2;} + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +ac_perl_modules="MIME::Entity" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: MIME::Entity may be required for automatic event email notification" >&5 +$as_echo "$as_me: WARNING: MIME::Entity may be required for automatic event email notification" >&2;} + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi +ac_perl_modules="X10::ActiveHome" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ac_perl_modules_failed=0 + for ac_perl_module in $ac_perl_modules; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ac_perl_module" >&5 +$as_echo_n "checking for perl module $ac_perl_module... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + ac_perl_modules_failed=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ac_perl_modules_failed" = 0; then + : + + else + : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: X10::ActiveHome is required for X.10 support" >&5 +$as_echo "$as_me: WARNING: X10::ActiveHome is required for X.10 support" >&2;} + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} +fi + + + 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 + eval ac_define_dir="\"$bindir\"" + eval ac_define_dir="\"$ac_define_dir\"" + BINDIR="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define BINDIR "$ac_define_dir" +_ACEOF + + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + + 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 + eval ac_define_dir="\"$libdir\"" + eval ac_define_dir="\"$ac_define_dir\"" + LIBDIR="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define LIBDIR "$ac_define_dir" +_ACEOF + + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + +ZM_PID="$ZM_RUNDIR/zm.pid" + + + 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 + eval ac_define_dir="\"$sysconfdir\"" + eval ac_define_dir="\"$ac_define_dir\"" + SYSCONFDIR="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define SYSCONFDIR "$ac_define_dir" +_ACEOF + + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + +ZM_CONFIG="$SYSCONFDIR/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" +else + EXTRA_PERL_LIB="# Include from system perl paths only" + PERL_MM_PARMS= +fi + + + +ac_config_files="$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 scripts/Makefile scripts/zm scripts/zmaudit.pl scripts/zmcontrol.pl scripts/zmdc.pl scripts/zmfilter.pl scripts/zmpkg.pl scripts/zmtrack.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/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/css/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="$ac_config_commands src/zm_config_defines.h" + +# Manually generate the perl Makefile maker +ac_config_commands="$ac_config_commands scripts/ZoneMinder/Makefile" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by zm $as_me 1.25.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to . +zm home page: ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +zm config.status 1.25.0 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +PERL_MM_PARMS=$PERL_MM_PARMS + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "zm.conf") CONFIG_FILES="$CONFIG_FILES zm.conf" ;; + "zmconfgen.pl") CONFIG_FILES="$CONFIG_FILES zmconfgen.pl" ;; + "db/Makefile") CONFIG_FILES="$CONFIG_FILES db/Makefile" ;; + "db/zm_create.sql") CONFIG_FILES="$CONFIG_FILES db/zm_create.sql" ;; + "misc/Makefile") CONFIG_FILES="$CONFIG_FILES misc/Makefile" ;; + "misc/apache.conf") CONFIG_FILES="$CONFIG_FILES misc/apache.conf" ;; + "misc/logrotate.conf") CONFIG_FILES="$CONFIG_FILES misc/logrotate.conf" ;; + "misc/syslog.conf") CONFIG_FILES="$CONFIG_FILES misc/syslog.conf" ;; + "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; + "scripts/zm") CONFIG_FILES="$CONFIG_FILES scripts/zm" ;; + "scripts/zmaudit.pl") CONFIG_FILES="$CONFIG_FILES scripts/zmaudit.pl" ;; + "scripts/zmcontrol.pl") CONFIG_FILES="$CONFIG_FILES scripts/zmcontrol.pl" ;; + "scripts/zmdc.pl") CONFIG_FILES="$CONFIG_FILES scripts/zmdc.pl" ;; + "scripts/zmfilter.pl") CONFIG_FILES="$CONFIG_FILES scripts/zmfilter.pl" ;; + "scripts/zmpkg.pl") CONFIG_FILES="$CONFIG_FILES scripts/zmpkg.pl" ;; + "scripts/zmtrack.pl") CONFIG_FILES="$CONFIG_FILES scripts/zmtrack.pl" ;; + "scripts/zmtrigger.pl") CONFIG_FILES="$CONFIG_FILES scripts/zmtrigger.pl" ;; + "scripts/zmupdate.pl") CONFIG_FILES="$CONFIG_FILES scripts/zmupdate.pl" ;; + "scripts/zmvideo.pl") CONFIG_FILES="$CONFIG_FILES scripts/zmvideo.pl" ;; + "scripts/zmwatch.pl") CONFIG_FILES="$CONFIG_FILES scripts/zmwatch.pl" ;; + "scripts/zmx10.pl") CONFIG_FILES="$CONFIG_FILES scripts/zmx10.pl" ;; + "scripts/zmdbbackup") CONFIG_FILES="$CONFIG_FILES scripts/zmdbbackup" ;; + "scripts/zmdbrestore") CONFIG_FILES="$CONFIG_FILES scripts/zmdbrestore" ;; + "scripts/zmeventdump") CONFIG_FILES="$CONFIG_FILES scripts/zmeventdump" ;; + "scripts/zmlogrotate.conf") CONFIG_FILES="$CONFIG_FILES scripts/zmlogrotate.conf" ;; + "scripts/ZoneMinder/lib/ZoneMinder/Base.pm") CONFIG_FILES="$CONFIG_FILES scripts/ZoneMinder/lib/ZoneMinder/Base.pm" ;; + "scripts/ZoneMinder/lib/ZoneMinder/Config.pm") CONFIG_FILES="$CONFIG_FILES scripts/ZoneMinder/lib/ZoneMinder/Config.pm" ;; + "scripts/ZoneMinder/lib/ZoneMinder/Memory.pm") CONFIG_FILES="$CONFIG_FILES scripts/ZoneMinder/lib/ZoneMinder/Memory.pm" ;; + "scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm") CONFIG_FILES="$CONFIG_FILES scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "src/zm_config.h") CONFIG_FILES="$CONFIG_FILES src/zm_config.h" ;; + "web/Makefile") CONFIG_FILES="$CONFIG_FILES web/Makefile" ;; + "web/ajax/Makefile") CONFIG_FILES="$CONFIG_FILES web/ajax/Makefile" ;; + "web/css/Makefile") CONFIG_FILES="$CONFIG_FILES web/css/Makefile" ;; + "web/graphics/Makefile") CONFIG_FILES="$CONFIG_FILES web/graphics/Makefile" ;; + "web/includes/Makefile") CONFIG_FILES="$CONFIG_FILES web/includes/Makefile" ;; + "web/includes/config.php") CONFIG_FILES="$CONFIG_FILES web/includes/config.php" ;; + "web/js/Makefile") CONFIG_FILES="$CONFIG_FILES web/js/Makefile" ;; + "web/lang/Makefile") CONFIG_FILES="$CONFIG_FILES web/lang/Makefile" ;; + "web/skins/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/Makefile" ;; + "web/skins/classic/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/classic/Makefile" ;; + "web/skins/classic/ajax/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/classic/ajax/Makefile" ;; + "web/skins/classic/css/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/classic/css/Makefile" ;; + "web/skins/classic/graphics/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/classic/graphics/Makefile" ;; + "web/skins/classic/includes/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/classic/includes/Makefile" ;; + "web/skins/classic/js/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/classic/js/Makefile" ;; + "web/skins/classic/lang/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/classic/lang/Makefile" ;; + "web/skins/classic/views/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/classic/views/Makefile" ;; + "web/skins/classic/views/css/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/classic/views/css/Makefile" ;; + "web/skins/classic/views/js/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/classic/views/js/Makefile" ;; + "web/skins/mobile/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/mobile/Makefile" ;; + "web/skins/mobile/ajax/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/mobile/ajax/Makefile" ;; + "web/skins/mobile/css/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/mobile/css/Makefile" ;; + "web/skins/mobile/graphics/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/mobile/graphics/Makefile" ;; + "web/skins/mobile/includes/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/mobile/includes/Makefile" ;; + "web/skins/mobile/lang/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/mobile/lang/Makefile" ;; + "web/skins/mobile/views/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/mobile/views/Makefile" ;; + "web/skins/mobile/views/css/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/mobile/views/css/Makefile" ;; + "web/tools/Makefile") CONFIG_FILES="$CONFIG_FILES web/tools/Makefile" ;; + "web/tools/mootools/Makefile") CONFIG_FILES="$CONFIG_FILES web/tools/mootools/Makefile" ;; + "web/views/Makefile") CONFIG_FILES="$CONFIG_FILES web/views/Makefile" ;; + "web/skins/xml/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/xml/Makefile" ;; + "web/skins/xml/views/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/xml/views/Makefile" ;; + "web/skins/xml/includes/Makefile") CONFIG_FILES="$CONFIG_FILES web/skins/xml/includes/Makefile" ;; + "src/zm_config_defines.h") CONFIG_COMMANDS="$CONFIG_COMMANDS src/zm_config_defines.h" ;; + "scripts/ZoneMinder/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS scripts/ZoneMinder/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "src/zm_config_defines.h":C) perl ./zmconfgen.pl ;; + "scripts/ZoneMinder/Makefile":C) (cd scripts/ZoneMinder; echo "perl Makefile.PL $PERL_MM_PARMS"; perl Makefile.PL $PERL_MM_PARMS) ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/configure.ac b/configure.ac new file mode 100644 index 000000000..6eeb952d7 --- /dev/null +++ b/configure.ac @@ -0,0 +1,399 @@ +AC_PREREQ(2.59) +AC_INIT(zm,1.25.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) +AM_CONFIG_HEADER(config.h) + +PATH_BUILD=`pwd` +AC_SUBST(PATH_BUILD) +TIME_BUILD=`date +'%s'` +AC_SUBST(TIME_BUILD) + +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 MyISAM]) +AC_ARG_VAR(ZM_RUNDIR,[Location of transient process files, default /var/run/zm]) +AC_ARG_VAR(ZM_TMPDIR,[Location of temporary files, default /tmp/zm]) +AC_ARG_VAR(ZM_LOGDIR,[Location of generated log files, default /var/log/zm]) + +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,MyISAM) +fi +if test "$ZM_RUNDIR" == ""; then + AC_SUBST(ZM_RUNDIR,[/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 + +LIB_ARCH=lib +AC_ARG_WITH(libarch, + [ --with-libarch= 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) + +MYSQL_PREFIX=/usr +AC_ARG_WITH(mysql, + [ --with-mysql= 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="${MYSQL_LIBS} $LDFLAGS" + +FFMPEG_PREFIX=/usr +AC_ARG_WITH(ffmpeg, + [ --with-ffmpeg= 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="" 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= 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/]) +) +AC_SUBST(WEB_PREFIX) + +AC_ARG_WITH(cgidir, + [ --with-cgidir= 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//cgi-bin]) +) +AC_SUBST(CGI_PREFIX) + +WEB_USER=apache +AC_ARG_WITH(webuser, + [ --with-webuser= 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= 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= 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= enable or disable debug, default enabled], + [ENABLE_DEBUG=$enable_debug], + AC_MSG_WARN([You can call configure with the --enable-debug= 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_CRASHTRACE=yes +AC_ARG_ENABLE(crashtrace, + [ --enable-crashtrace= enable or disabled crash tracing, default enabled], + [ENABLE_CRASHTRACE=$enable_crashtrace], + AC_MSG_WARN([You can call configure with the --enable-crashtrace= or --disable-crashtrace option. + This tells configure whether to compile ZoneMinder with crash tracing included. This allows a + dump of the stack trace when a ZoneMinder binary crashes or is killed by an unexpected signal. + Although this should work on most systems it does rely on un(or loosely) documented features and + so should be regarded as experimental. If you experience problems compiling zm_signal.cpp or + ZoneMinder binaries fail to shut down correctly then you should probably disable this feature. + e.g. --enable-crashtrace=yes or --disable-crashtrace]) +) +if test "$ENABLE_CRASHTRACE" != "yes"; then + AC_DEFINE(ZM_NO_CRASHTRACE,1,"Whether crash tracing is switched off and compiled out") +fi + +ENABLE_MMAP=yes +AC_ARG_ENABLE(mmap, + [ --enable-mmap= 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= 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) + +# Compiler +AC_LANG_CPLUSPLUS + +# 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 ]) +AC_CHECK_TYPES(struct sigcontext,,,[#include ]) +AC_CHECK_MEMBERS([struct sigcontext.eip],,,[#include ]) +AC_CHECK_TYPES(ucontext_t,,,[#include ]) + +# 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 strsignal strspn strstr strtol strtoull]) +AC_CHECK_FUNCS([syscall sleep usleep ioctl ioctlsocket sigaction]) + +# Other programs +AC_CHECK_PROG(OPT_FFMPEG,ffmpeg,yes,no) +AC_PATH_PROG(PATH_FFMPEG,ffmpeg) +AC_CHECK_PROG(OPT_NETPBM,pnmscale,yes,no) +AC_PATH_PROG(PATH_NETPBM,pnmscale) +if test "$OPT_NETPBM" == "yes"; then +PATH_NETPBM=`dirname $PATH_NETPBM` +fi + +# Checks for libraries. +AC_CHECK_LIB(mysqlclient,mysql_init,,AC_MSG_ERROR(zm requires libmysqlclient.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)) +AC_CHECK_LIB(dl,dlsym,,AC_MSG_ERROR(zm requires libdl.a)) +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 header 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])) +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(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(bz2,BZ2_bzCompress,,AC_MSG_WARN(zm requires libbz2.a for recent versions of ffmpeg)) +AC_CHECK_LIB(z,compress,,) + +# 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(syscall.h,,,) +AC_CHECK_HEADERS(pthread.h,,,) +AC_CHECK_HEADERS(linux/videodev.h,AC_SUBST(ZM_HAS_V4L1,1),AC_SUBST(ZM_HAS_V4L1,0),) +AC_CHECK_HEADERS(linux/videodev2.h,AC_SUBST(ZM_HAS_V4L2,1),AC_SUBST(ZM_HAS_V4L2,0),) +if test "$ZM_HAS_V4L1" == "1" || test "$ZM_HAS_V4L2" == "1"; then +AC_SUBST(ZM_HAS_V4L,1) +else +AC_SUBST(ZM_HAS_V4L,0) +AC_MSG_WARN(zm requires Video4Linux or Video4Linux2 to be installed for analog or USB camera support) +fi +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_CHECK_HEADERS(libavutil/avutil.h,,,) +AC_CHECK_HEADERS(libavcodec/avcodec.h,,,) +AC_CHECK_HEADERS(libavformat/avformat.h,,,) +AC_CHECK_HEADERS(libswscale/swscale.h,,,) +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_DECLS(round,,,[#include ]) +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 +#include ]) +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 +#include ]) +else +AC_CHECK_DECLS(gnutls_fingerprint,,AC_MSG_ERROR([zm requires gnutls/gnutls.h - use ZM_SSL_LIB option to select openssl instead]),[#include +#include ]) +fi +fi +AC_CHECK_DECLS(backtrace,,,[#include ]) + +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_SUBST(ZM_PID,"$ZM_RUNDIR/zm.pid") +AC_DEFINE_DIR([SYSCONFDIR],[sysconfdir],[Expanded configuration directory]) +AC_SUBST(ZM_CONFIG,"$SYSCONFDIR/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" +else + EXTRA_PERL_LIB="# Include from system perl paths only" + PERL_MM_PARMS= +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 scripts/Makefile scripts/zm scripts/zmaudit.pl scripts/zmcontrol.pl scripts/zmdc.pl scripts/zmfilter.pl scripts/zmpkg.pl scripts/zmtrack.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/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/css/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_OUTPUT diff --git a/db/Makefile.am b/db/Makefile.am new file mode 100644 index 000000000..384fe7e47 --- /dev/null +++ b/db/Makefile.am @@ -0,0 +1,44 @@ +AUTOMAKE_OPTIONS = gnu + +EXTRA_DIST = \ + zm_create.sql.in \ + zm_update-0.0.1.sql \ + zm_update-0.9.7.sql \ + zm_update-0.9.8.sql \ + zm_update-0.9.9.sql \ + zm_update-0.9.10.sql \ + zm_update-0.9.11.sql \ + zm_update-0.9.12.sql \ + zm_update-0.9.13.sql \ + zm_update-0.9.15.sql \ + zm_update-0.9.16.sql \ + zm_update-1.17.1.sql \ + zm_update-1.17.2.sql \ + zm_update-1.18.0.sql \ + zm_update-1.18.1.sql \ + zm_update-1.19.0.sql \ + zm_update-1.19.1.sql \ + zm_update-1.19.2.sql \ + zm_update-1.19.3.sql \ + zm_update-1.19.4.sql \ + zm_update-1.19.5.sql \ + zm_update-1.20.0.sql \ + zm_update-1.20.1.sql \ + zm_update-1.21.0.sql \ + zm_update-1.21.1.sql \ + zm_update-1.21.2.sql \ + zm_update-1.21.3.sql \ + zm_update-1.21.4.sql \ + zm_update-1.22.0.sql \ + zm_update-1.22.1.sql \ + zm_update-1.22.2.sql \ + zm_update-1.22.3.sql \ + zm_update-1.23.0.sql \ + zm_update-1.23.1.sql \ + zm_update-1.23.2.sql \ + zm_update-1.23.3.sql \ + zm_update-1.24.0.sql \ + zm_update-1.24.1.sql \ + zm_update-1.24.2.sql \ + zm_update-1.24.3.sql \ + zm_update-1.24.4.sql diff --git a/db/Makefile.in b/db/Makefile.in new file mode 100644 index 000000000..c58725cd2 --- /dev/null +++ b/db/Makefile.in @@ -0,0 +1,439 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = db +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/zm_create.sql.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = zm_create.sql +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +EXTRA_DIST = \ + zm_create.sql.in \ + zm_update-0.0.1.sql \ + zm_update-0.9.7.sql \ + zm_update-0.9.8.sql \ + zm_update-0.9.9.sql \ + zm_update-0.9.10.sql \ + zm_update-0.9.11.sql \ + zm_update-0.9.12.sql \ + zm_update-0.9.13.sql \ + zm_update-0.9.15.sql \ + zm_update-0.9.16.sql \ + zm_update-1.17.1.sql \ + zm_update-1.17.2.sql \ + zm_update-1.18.0.sql \ + zm_update-1.18.1.sql \ + zm_update-1.19.0.sql \ + zm_update-1.19.1.sql \ + zm_update-1.19.2.sql \ + zm_update-1.19.3.sql \ + zm_update-1.19.4.sql \ + zm_update-1.19.5.sql \ + zm_update-1.20.0.sql \ + zm_update-1.20.1.sql \ + zm_update-1.21.0.sql \ + zm_update-1.21.1.sql \ + zm_update-1.21.2.sql \ + zm_update-1.21.3.sql \ + zm_update-1.21.4.sql \ + zm_update-1.22.0.sql \ + zm_update-1.22.1.sql \ + zm_update-1.22.2.sql \ + zm_update-1.22.3.sql \ + zm_update-1.23.0.sql \ + zm_update-1.23.1.sql \ + zm_update-1.23.2.sql \ + zm_update-1.23.3.sql \ + zm_update-1.24.0.sql \ + zm_update-1.24.1.sql \ + zm_update-1.24.2.sql \ + zm_update-1.24.3.sql \ + zm_update-1.24.4.sql + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu db/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu db/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +zm_create.sql: $(top_builddir)/config.status $(srcdir)/zm_create.sql.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/db/zm_create.sql b/db/zm_create.sql new file mode 100644 index 000000000..fa91d3e35 --- /dev/null +++ b/db/zm_create.sql @@ -0,0 +1,934 @@ +-- MySQL dump 10.9 +-- +-- Host: localhost Database: zm +-- ------------------------------------------------------ +-- Server version 4.1.16-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Current Database: `zm` +-- + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `zm`; + +USE `zm`; + +-- +-- Table structure for table `Config` +-- + +DROP TABLE IF EXISTS `Config`; +CREATE TABLE `Config` ( + `Id` smallint(5) unsigned NOT NULL default '0', + `Name` varchar(32) NOT NULL default '', + `Value` text NOT NULL, + `Type` tinytext NOT NULL, + `DefaultValue` tinytext, + `Hint` tinytext, + `Pattern` tinytext, + `Format` tinytext, + `Prompt` tinytext, + `Help` text, + `Category` varchar(32) NOT NULL default '', + `Readonly` tinyint(3) unsigned NOT NULL default '0', + `Requires` text, + PRIMARY KEY (`Name`) +) ENGINE=MyISAM; + +-- +-- Table structure for table `ControlPresets` +-- + +DROP TABLE IF EXISTS `ControlPresets`; +CREATE TABLE `ControlPresets` ( + `MonitorId` int(10) unsigned NOT NULL default '0', + `Preset` int(10) unsigned NOT NULL default '0', + `Label` varchar(64) NOT NULL default '', + PRIMARY KEY (`MonitorId`,`Preset`) +) ENGINE=MyISAM; + +-- +-- Table structure for table `Controls` +-- + +DROP TABLE IF EXISTS `Controls`; +CREATE TABLE `Controls` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `Type` enum('Local','Remote') NOT NULL default 'Local', + `Protocol` varchar(64) default NULL, + `CanWake` tinyint(3) unsigned NOT NULL default '0', + `CanSleep` tinyint(3) unsigned NOT NULL default '0', + `CanReset` tinyint(3) unsigned NOT NULL default '0', + `CanZoom` tinyint(3) unsigned NOT NULL default '0', + `CanAutoZoom` tinyint(3) unsigned NOT NULL default '0', + `CanZoomAbs` tinyint(3) unsigned NOT NULL default '0', + `CanZoomRel` tinyint(3) unsigned NOT NULL default '0', + `CanZoomCon` tinyint(3) unsigned NOT NULL default '0', + `MinZoomRange` int(10) unsigned default NULL, + `MaxZoomRange` int(10) unsigned default NULL, + `MinZoomStep` int(10) unsigned default NULL, + `MaxZoomStep` int(10) unsigned default NULL, + `HasZoomSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinZoomSpeed` int(10) unsigned default NULL, + `MaxZoomSpeed` int(10) unsigned default NULL, + `CanFocus` tinyint(3) unsigned NOT NULL default '0', + `CanAutoFocus` tinyint(3) unsigned NOT NULL default '0', + `CanFocusAbs` tinyint(3) unsigned NOT NULL default '0', + `CanFocusRel` tinyint(3) unsigned NOT NULL default '0', + `CanFocusCon` tinyint(3) unsigned NOT NULL default '0', + `MinFocusRange` int(10) unsigned default NULL, + `MaxFocusRange` int(10) unsigned default NULL, + `MinFocusStep` int(10) unsigned default NULL, + `MaxFocusStep` int(10) unsigned default NULL, + `HasFocusSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinFocusSpeed` int(10) unsigned default NULL, + `MaxFocusSpeed` int(10) unsigned default NULL, + `CanIris` tinyint(3) unsigned NOT NULL default '0', + `CanAutoIris` tinyint(3) unsigned NOT NULL default '0', + `CanIrisAbs` tinyint(3) unsigned NOT NULL default '0', + `CanIrisRel` tinyint(3) unsigned NOT NULL default '0', + `CanIrisCon` tinyint(3) unsigned NOT NULL default '0', + `MinIrisRange` int(10) unsigned default NULL, + `MaxIrisRange` int(10) unsigned default NULL, + `MinIrisStep` int(10) unsigned default NULL, + `MaxIrisStep` int(10) unsigned default NULL, + `HasIrisSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinIrisSpeed` int(10) unsigned default NULL, + `MaxIrisSpeed` int(10) unsigned default NULL, + `CanGain` tinyint(3) unsigned NOT NULL default '0', + `CanAutoGain` tinyint(3) unsigned NOT NULL default '0', + `CanGainAbs` tinyint(3) unsigned NOT NULL default '0', + `CanGainRel` tinyint(3) unsigned NOT NULL default '0', + `CanGainCon` tinyint(3) unsigned NOT NULL default '0', + `MinGainRange` int(10) unsigned default NULL, + `MaxGainRange` int(10) unsigned default NULL, + `MinGainStep` int(10) unsigned default NULL, + `MaxGainStep` int(10) unsigned default NULL, + `HasGainSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinGainSpeed` int(10) unsigned default NULL, + `MaxGainSpeed` int(10) unsigned default NULL, + `CanWhite` tinyint(3) unsigned NOT NULL default '0', + `CanAutoWhite` tinyint(3) unsigned NOT NULL default '0', + `CanWhiteAbs` tinyint(3) unsigned NOT NULL default '0', + `CanWhiteRel` tinyint(3) unsigned NOT NULL default '0', + `CanWhiteCon` tinyint(3) unsigned NOT NULL default '0', + `MinWhiteRange` int(10) unsigned default NULL, + `MaxWhiteRange` int(10) unsigned default NULL, + `MinWhiteStep` int(10) unsigned default NULL, + `MaxWhiteStep` int(10) unsigned default NULL, + `HasWhiteSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinWhiteSpeed` int(10) unsigned default NULL, + `MaxWhiteSpeed` int(10) unsigned default NULL, + `HasPresets` tinyint(3) unsigned NOT NULL default '0', + `NumPresets` tinyint(3) unsigned NOT NULL default '0', + `HasHomePreset` tinyint(3) unsigned NOT NULL default '0', + `CanSetPresets` tinyint(3) unsigned NOT NULL default '0', + `CanMove` tinyint(3) unsigned NOT NULL default '0', + `CanMoveDiag` tinyint(3) unsigned NOT NULL default '0', + `CanMoveMap` tinyint(3) unsigned NOT NULL default '0', + `CanMoveAbs` tinyint(3) unsigned NOT NULL default '0', + `CanMoveRel` tinyint(3) unsigned NOT NULL default '0', + `CanMoveCon` tinyint(3) unsigned NOT NULL default '0', + `CanPan` tinyint(3) unsigned NOT NULL default '0', + `MinPanRange` int(10) default NULL, + `MaxPanRange` int(10) default NULL, + `MinPanStep` int(10) default NULL, + `MaxPanStep` int(10) default NULL, + `HasPanSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinPanSpeed` int(10) default NULL, + `MaxPanSpeed` int(10) default NULL, + `HasTurboPan` tinyint(3) unsigned NOT NULL default '0', + `TurboPanSpeed` int(10) default NULL, + `CanTilt` tinyint(3) unsigned NOT NULL default '0', + `MinTiltRange` int(10) default NULL, + `MaxTiltRange` int(10) default NULL, + `MinTiltStep` int(10) default NULL, + `MaxTiltStep` int(10) default NULL, + `HasTiltSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinTiltSpeed` int(10) default NULL, + `MaxTiltSpeed` int(10) default NULL, + `HasTurboTilt` tinyint(3) unsigned NOT NULL default '0', + `TurboTiltSpeed` int(10) default NULL, + `CanAutoScan` tinyint(3) unsigned NOT NULL default '0', + `NumScanPaths` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`Id`) +) ENGINE=MyISAM; + +-- +-- Table structure for table `Devices` +-- + +DROP TABLE IF EXISTS `Devices`; +CREATE TABLE `Devices` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` tinytext NOT NULL, + `Type` enum('X10') NOT NULL default 'X10', + `KeyString` varchar(32) NOT NULL default '', + PRIMARY KEY (`Id`) +) ENGINE=MyISAM; + +-- +-- Table structure for table `Events` +-- + +DROP TABLE IF EXISTS `Events`; +CREATE TABLE `Events` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `MonitorId` int(10) unsigned NOT NULL default '0', + `Name` varchar(64) NOT NULL default '', + `Cause` varchar(32) NOT NULL default '', + `StartTime` datetime default NULL, + `EndTime` datetime default NULL, + `Width` smallint(5) unsigned NOT NULL default '0', + `Height` smallint(5) unsigned NOT NULL default '0', + `Length` decimal(10,2) NOT NULL default '0.00', + `Frames` int(10) unsigned default NULL, + `AlarmFrames` int(10) unsigned default NULL, + `TotScore` int(10) unsigned NOT NULL default '0', + `AvgScore` smallint(5) unsigned default '0', + `MaxScore` smallint(5) unsigned default '0', + `Archived` tinyint(3) unsigned NOT NULL default '0', + `Videoed` tinyint(3) unsigned NOT NULL default '0', + `Uploaded` tinyint(3) unsigned NOT NULL default '0', + `Emailed` tinyint(3) unsigned NOT NULL default '0', + `Messaged` tinyint(3) unsigned NOT NULL default '0', + `Executed` tinyint(3) unsigned NOT NULL default '0', + `Notes` text, + PRIMARY KEY (`Id`,`MonitorId`), + KEY `MonitorId` (`MonitorId`), + KEY `StartTime` (`StartTime`), + KEY `Frames` (`Frames`), + KEY `Archived` (`Archived`) +) ENGINE=MyISAM; + +-- +-- Table structure for table `Filters` +-- + +DROP TABLE IF EXISTS `Filters`; +CREATE TABLE `Filters` ( + `Name` varchar(64) NOT NULL default '', + `Query` text NOT NULL, + `AutoArchive` tinyint(3) unsigned NOT NULL default '0', + `AutoVideo` tinyint(3) unsigned NOT NULL default '0', + `AutoUpload` tinyint(3) unsigned NOT NULL default '0', + `AutoEmail` tinyint(3) unsigned NOT NULL default '0', + `AutoMessage` tinyint(3) unsigned NOT NULL default '0', + `AutoExecute` tinyint(3) unsigned NOT NULL default '0', + `AutoExecuteCmd` tinytext, + `AutoDelete` tinyint(3) unsigned NOT NULL default '0', + `Background` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`Name`) +) ENGINE=MyISAM; + +-- +-- Table structure for table `Frames` +-- + +DROP TABLE IF EXISTS `Frames`; +CREATE TABLE `Frames` ( + `EventId` int(10) unsigned NOT NULL default '0', + `FrameId` int(10) unsigned NOT NULL default '0', + `Type` enum('Normal','Bulk','Alarm') NOT NULL default 'Normal', + `TimeStamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `Delta` decimal(8,2) NOT NULL default '0.00', + `Score` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`EventId`,`FrameId`), + KEY `Type` (`Type`), + KEY `TimeStamp` (`TimeStamp`) +) ENGINE=MyISAM; + +-- +-- Table structure for table `Groups` +-- + +DROP TABLE IF EXISTS `Groups`; +CREATE TABLE `Groups` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `MonitorIds` tinytext NOT NULL, + PRIMARY KEY (`Id`) +) ENGINE=MyISAM; + +-- +-- Table structure for table `Logs` +-- +CREATE TABLE `Logs` ( + `TimeKey` decimal(16,6) NOT NULL, + `Component` varchar(32) NOT NULL, + `Pid` smallint(6) DEFAULT NULL, + `Level` tinyint(3) NOT NULL, + `Code` char(3) NOT NULL, + `Message` varchar(255) NOT NULL, + `File` varchar(255) DEFAULT NULL, + `Line` smallint(5) unsigned DEFAULT NULL, + KEY `TimeKey` (`TimeKey`) +) ENGINE=MyISAM; + +-- +-- Table structure for table `MonitorPresets` +-- + +DROP TABLE IF EXISTS `MonitorPresets`; +CREATE TABLE `MonitorPresets` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `Type` enum('Local','Remote','File','Ffmpeg') NOT NULL default 'Local', + `Device` tinytext, + `Channel` tinyint(3) unsigned default NULL, + `Format` int(10) unsigned default NULL, + `Protocol` varchar(16) default NULL, + `Method` varchar(16) default NULL, + `Host` varchar(64) default NULL, + `Port` varchar(8) default NULL, + `Path` varchar(255) default NULL, + `SubPath` varchar(64) default NULL, + `Width` smallint(5) unsigned default NULL, + `Height` smallint(5) unsigned default NULL, + `Palette` int(10) unsigned default NULL, + `MaxFPS` decimal(5,2) default NULL, + `Controllable` tinyint(3) unsigned NOT NULL default '0', + `ControlId` varchar(16) default NULL, + `ControlDevice` varchar(255) default NULL, + `ControlAddress` varchar(255) default NULL, + `DefaultRate` smallint(5) unsigned NOT NULL default '100', + `DefaultScale` smallint(5) unsigned NOT NULL default '100', + PRIMARY KEY (`Id`) +) ENGINE=MyISAM; + +-- +-- Table structure for table `Monitors` +-- + +DROP TABLE IF EXISTS `Monitors`; +CREATE TABLE `Monitors` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `Type` enum('Local','Remote','File','Ffmpeg') NOT NULL default 'Local', + `Function` enum('None','Monitor','Modect','Record','Mocord','Nodect') NOT NULL default 'Monitor', + `Enabled` tinyint(3) unsigned NOT NULL default '1', + `LinkedMonitors` varchar(255) NOT NULL default '', + `Triggers` set('X10') NOT NULL default '', + `Device` varchar(64) NOT NULL default '', + `Channel` tinyint(3) unsigned NOT NULL default '0', + `Format` int(10) unsigned NOT NULL default '0', + `Protocol` varchar(16) NOT NULL default '', + `Method` varchar(16) NOT NULL default '', + `Host` varchar(64) NOT NULL default '', + `Port` varchar(8) NOT NULL default '', + `SubPath` varchar(64) NOT NULL default '', + `Path` varchar(255) NOT NULL default '', + `Width` smallint(5) unsigned NOT NULL default '0', + `Height` smallint(5) unsigned NOT NULL default '0', + `Colours` tinyint(3) unsigned NOT NULL default '1', + `Palette` int(10) unsigned NOT NULL default '0', + `Orientation` enum('0','90','180','270','hori','vert') NOT NULL default '0', + `Deinterlacing` int(10) unsigned NOT NULL default '0', + `Brightness` mediumint(7) NOT NULL default '-1', + `Contrast` mediumint(7) NOT NULL default '-1', + `Hue` mediumint(7) NOT NULL default '-1', + `Colour` mediumint(7) NOT NULL default '-1', + `EventPrefix` varchar(32) NOT NULL default 'Event-', + `LabelFormat` varchar(64) NOT NULL default '%N - %y/%m/%d %H:%M:%S', + `LabelX` smallint(5) unsigned NOT NULL default '0', + `LabelY` smallint(5) unsigned NOT NULL default '0', + `ImageBufferCount` smallint(5) unsigned NOT NULL default '100', + `WarmupCount` smallint(5) unsigned NOT NULL default '25', + `PreEventCount` smallint(5) unsigned NOT NULL default '10', + `PostEventCount` smallint(5) unsigned NOT NULL default '10', + `StreamReplayBuffer` int(10) unsigned NOT NULL default '1000', + `AlarmFrameCount` smallint(5) unsigned NOT NULL default '1', + `SectionLength` int(10) unsigned NOT NULL default '600', + `FrameSkip` smallint(5) unsigned NOT NULL default '0', + `MaxFPS` decimal(5,2) default NULL, + `AlarmMaxFPS` decimal(5,2) default NULL, + `FPSReportInterval` smallint(5) unsigned NOT NULL default '250', + `RefBlendPerc` tinyint(3) unsigned NOT NULL default '10', + `Controllable` tinyint(3) unsigned NOT NULL default '0', + `ControlId` int(10) unsigned NOT NULL default '0', + `ControlDevice` varchar(255) default NULL, + `ControlAddress` varchar(255) default NULL, + `AutoStopTimeout` decimal(5,2) default NULL, + `TrackMotion` tinyint(3) unsigned NOT NULL default '0', + `TrackDelay` smallint(5) unsigned NOT NULL default '0', + `ReturnLocation` tinyint(3) NOT NULL default '-1', + `ReturnDelay` smallint(5) unsigned NOT NULL default '0', + `DefaultView` enum('Events','Control') NOT NULL default 'Events', + `DefaultRate` smallint(5) unsigned NOT NULL default '100', + `DefaultScale` smallint(5) unsigned NOT NULL default '100', + `SignalCheckColour` varchar(32) NOT NULL default '#0000BE', + `WebColour` varchar(32) NOT NULL default 'red', + `Sequence` smallint(5) unsigned default NULL, + `UsedPl` varchar(88) NOT NULL default '', + `DoNativeMotDet` tinyint(3) unsigned NOT NULL default '1', + PRIMARY KEY (`Id`) +) ENGINE=MyISAM; + +-- +-- Table structure for table `PluginsConfig` +-- + +DROP TABLE IF EXISTS `PluginsConfig`; +CREATE TABLE `PluginsConfig` ( + `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `Name` varchar(32) NOT NULL DEFAULT '', + `Value` text NOT NULL, + `Type` tinytext NOT NULL, + `Choices` text NOT NULL, + `MonitorId` int(10) unsigned NOT NULL, + `ZoneId` int(10) unsigned NOT NULL, + `pluginName` tinytext NOT NULL, + PRIMARY KEY (`Id`), + KEY `ZoneId` (`ZoneId`), + KEY `MonitorId` (`MonitorId`), + KEY `Name` (`Name`), + FULLTEXT KEY `pluginName` (`pluginName`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; + + +-- +-- Table structure for table `States` +-- + +DROP TABLE IF EXISTS `States`; +CREATE TABLE `States` ( + `Name` varchar(64) NOT NULL default '', + `Definition` text NOT NULL, + PRIMARY KEY (`Name`) +) ENGINE=MyISAM; + +-- +-- Table structure for table `Stats` +-- + +DROP TABLE IF EXISTS `Stats`; +CREATE TABLE `Stats` ( + `MonitorId` int(10) unsigned NOT NULL default '0', + `ZoneId` int(10) unsigned NOT NULL default '0', + `EventId` int(10) unsigned NOT NULL default '0', + `FrameId` int(10) unsigned NOT NULL default '0', + `PixelDiff` tinyint(3) unsigned NOT NULL default '0', + `AlarmPixels` int(10) unsigned NOT NULL default '0', + `FilterPixels` int(10) unsigned NOT NULL default '0', + `BlobPixels` int(10) unsigned NOT NULL default '0', + `Blobs` smallint(5) unsigned NOT NULL default '0', + `MinBlobSize` int(10) unsigned NOT NULL default '0', + `MaxBlobSize` int(10) unsigned NOT NULL default '0', + `MinX` smallint(5) unsigned NOT NULL default '0', + `MaxX` smallint(5) unsigned NOT NULL default '0', + `MinY` smallint(5) unsigned NOT NULL default '0', + `MaxY` smallint(5) unsigned NOT NULL default '0', + `Score` smallint(5) unsigned NOT NULL default '0', + KEY `EventId` (`EventId`), + KEY `MonitorId` (`MonitorId`), + KEY `ZoneId` (`ZoneId`) +) ENGINE=MyISAM; + +-- +-- Table structure for table `TriggersX10` +-- + +DROP TABLE IF EXISTS `TriggersX10`; +CREATE TABLE `TriggersX10` ( + `MonitorId` int(10) unsigned NOT NULL default '0', + `Activation` varchar(32) default NULL, + `AlarmInput` varchar(32) default NULL, + `AlarmOutput` varchar(32) default NULL, + PRIMARY KEY (`MonitorId`) +) ENGINE=MyISAM; + +-- +-- Table structure for table `Users` +-- + +DROP TABLE IF EXISTS `Users`; +CREATE TABLE `Users` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Username` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `Password` varchar(64) NOT NULL default '', + `Language` varchar(8) NOT NULL default '', + `Enabled` tinyint(3) unsigned NOT NULL default '1', + `Stream` enum('None','View') NOT NULL default 'None', + `Events` enum('None','View','Edit') NOT NULL default 'None', + `Control` enum('None','View','Edit') NOT NULL default 'None', + `Monitors` enum('None','View','Edit') NOT NULL default 'None', + `Devices` enum('None','View','Edit') NOT NULL default 'None', + `System` enum('None','View','Edit') NOT NULL default 'None', + `MaxBandwidth` varchar(16) NOT NULL default '', + `MonitorIds` tinytext NOT NULL, + PRIMARY KEY (`Id`), + UNIQUE KEY `UC_Username` (`Username`) +) ENGINE=MyISAM; + +-- +-- Table structure for table `ZonePresets` +-- + +DROP TABLE IF EXISTS `ZonePresets`; +CREATE TABLE `ZonePresets` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `Type` enum('Active','Inclusive','Exclusive','Preclusive','Inactive') NOT NULL default 'Active', + `Units` enum('Pixels','Percent') NOT NULL default 'Pixels', + `CheckMethod` enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs', + `MinPixelThreshold` smallint(5) unsigned default NULL, + `MaxPixelThreshold` smallint(5) unsigned default NULL, + `MinAlarmPixels` int(10) unsigned default NULL, + `MaxAlarmPixels` int(10) unsigned default NULL, + `FilterX` tinyint(3) unsigned default NULL, + `FilterY` tinyint(3) unsigned default NULL, + `MinFilterPixels` int(10) unsigned default NULL, + `MaxFilterPixels` int(10) unsigned default NULL, + `MinBlobPixels` int(10) unsigned default NULL, + `MaxBlobPixels` int(10) unsigned default NULL, + `MinBlobs` smallint(5) unsigned default NULL, + `MaxBlobs` smallint(5) unsigned default NULL, + `OverloadFrames` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`Id`) +) ENGINE=MyISAM; + +-- +-- Table structure for table `Zones` +-- + +DROP TABLE IF EXISTS `Zones`; +CREATE TABLE `Zones` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `MonitorId` int(10) unsigned NOT NULL default '0', + `Name` varchar(64) NOT NULL default '', + `Type` enum('Active','Inclusive','Exclusive','Preclusive','Inactive') NOT NULL default 'Active', + `Units` enum('Pixels','Percent') NOT NULL default 'Pixels', + `NumCoords` tinyint(3) unsigned NOT NULL default '0', + `Coords` tinytext NOT NULL, + `Area` int(10) unsigned NOT NULL default '0', + `AlarmRGB` int(10) unsigned default '0', + `CheckMethod` enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs', + `MinPixelThreshold` smallint(5) unsigned default NULL, + `MaxPixelThreshold` smallint(5) unsigned default NULL, + `MinAlarmPixels` int(10) unsigned default NULL, + `MaxAlarmPixels` int(10) unsigned default NULL, + `FilterX` tinyint(3) unsigned default NULL, + `FilterY` tinyint(3) unsigned default NULL, + `MinFilterPixels` int(10) unsigned default NULL, + `MaxFilterPixels` int(10) unsigned default NULL, + `MinBlobPixels` int(10) unsigned default NULL, + `MaxBlobPixels` int(10) unsigned default NULL, + `MinBlobs` smallint(5) unsigned default NULL, + `MaxBlobs` smallint(5) unsigned default NULL, + `OverloadFrames` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`Id`), + KEY `MonitorId` (`MonitorId`) +) ENGINE=MyISAM; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- +-- Initial data to be loaded into ZoneMinder database +-- + +-- +-- Create a default admin user. +-- +insert into Users values ('','admin',password('admin'),'',1,'View','Edit','Edit','Edit','Edit','Edit','',''); + +-- +-- Add a sample filter to purge the oldest 5 events when the disk is 95% full, delete is disabled though +-- +insert into Filters values ('PurgeWhenFull','{"sort_field":"Id","terms":[{"val":0,"attr":"Archived","op":"="},{"cnj":"and","val":95,"attr":"DiskPercent","op":">="}],"limit":5,"sort_asc":1}',0,0,0,0,0,0,'',1,0); + +-- +-- Add in some sample control protocol definitions +-- +insert into Controls values (1,'Pelco-D','Local','PelcoD',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0); +insert into Controls values (2,'Pelco-P','Local','PelcoP',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0); +insert into Controls values (3,'Sony VISCA','Local','Visca',1,1,0,1,0,0,0,1,0,16384,10,4000,1,1,6,1,1,1,0,1,0,1536,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,3,1,1,1,1,0,1,1,0,1,-15578,15578,100,10000,1,1,50,1,254,1,-7789,7789,100,5000,1,1,50,1,254,0,0); +INSERT INTO Controls VALUES (4,'Axis API v2','Remote','AxisV2',0,0,0,1,0,0,1,0,0,9999,10,2500,0,NULL,NULL,1,1,0,1,0,0,9999,10,2500,0,NULL,NULL,1,1,0,1,0,0,9999,10,2500,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,12,1,1,1,1,1,0,1,0,1,-360,360,1,90,0,NULL,NULL,0,NULL,1,-360,360,1,90,0,NULL,NULL,0,NULL,0,0); +insert into Controls values (5,'Panasonic IP','Remote','PanasonicIP',0,0,0,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,8,1,1,1,0,1,0,0,1,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0); +insert into Controls values (6,'Neu-Fusion NCS370','Remote','Ncs370',0,0,0,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,24,1,0,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0); + +-- +-- Add some monitor preset values +-- +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, mpjpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&req_fps=5',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, mpjpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=5',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, mpjpeg, B&W','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&color=0',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, mpjpeg, B&W','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&color=0',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 320x240, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240',NULL,320,240,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 320x240, mpjpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&req_fps=5',NULL,320,240,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 320x240, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 320x240, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,5.0,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 640x480, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480',NULL,640,480,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 640x480, mpjpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=5',NULL,640,480,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 640x480, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 640x480, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,5.0,1,4,NULL,':',100,100); +INSERT into MonitorPresets VALUES ('','Axis IP, mpeg4, unicast','Remote',NULL,NULL,NULL,'rtsp','rtpUni','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT into MonitorPresets VALUES ('','Axis IP, mpeg4, multicast','Remote',NULL,NULL,NULL,'rtsp','rtpMulti','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT into MonitorPresets VALUES ('','Axis IP, mpeg4, RTP/RTSP','Remote',NULL,NULL,NULL,'rtsp','rtpRtsp','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT into MonitorPresets VALUES ('','Axis IP, mpeg4, RTP/RTSP/HTTP','Remote',NULL,NULL,NULL,'rtsp','rtpRtspHttp','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 320x240, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/nphMotionJpeg?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 320x240, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 320x240, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 640x480, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/nphMotionJpeg?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 640x480, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 640x480, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 320x240, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/nphMotionJpeg?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 320x240, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 320x240, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,5.0,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 640x480, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/nphMotionJpeg?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 640x480, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 640x480, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,5.0,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Gadspot IP, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Gadspot IP, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Gadspot IP, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/GetData.cgi',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Gadspot IP, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','VEO Observer, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Blue Net Video Server, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/cgi-bin/image.cgi?control=0&id=admin&passwd=admin',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT into MonitorPresets VALUES ('','ACTi IP, mpeg4, unicast','Remote',NULL,NULL,NULL,'rtsp','rtpUni','',7070,'','/track',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis FFMPEG H.264','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp:///axis-media/media.amp?videocodec=h264',NULL,NULL,NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Vivotek FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp://:554/live.sdp',NULL,NULL,NULL,352,240,NULL,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp:///axis-media/media.amp',NULL,NULL,NULL,640,480,NULL,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','ACTi TCM FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp://admin:123456@:7070',NULL,NULL,NULL,320,240,NULL,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), PAL, 320x240','Local','/dev/video','',255,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), PAL, 320x240, max 5 FPS','Local','/dev/video','',255,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), PAL, 640x480','Local','/dev/video','',255,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), PAL, 640x480, max 5 FPS','Local','/dev/video','',255,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), NTSC, 320x240','Local','/dev/video','',45056,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), NTSC, 320x240, max 5 FPS','Local','/dev/video','',45056,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), NTSC, 640x480','Local','/dev/video','',45056,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), NTSC, 640x480, max 5 FPS','Local','/dev/video','',45056,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), PAL, 320x240','Local','/dev/video','',0,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), PAL, 320x240, max 5 FPS','Local','/dev/video','',0,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), PAL, 640x480','Local','/dev/video','',0,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), PAL, 640x480, max 5 FPS','Local','/dev/video','',0,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), NTSC, 320x240','Local','/dev/video','',1,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), NTSC, 320x240, max 5 FPS','Local','/dev/video','',1,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), NTSC, 640x480','Local','/dev/video','',1,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), NTSC, 640x480, max 5 FPS','Local','/dev/video','',1,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Remote ZoneMinder','Remote',NULL,NULL,NULL,'http','simple','',80,'/cgi-bin/nph-zms?mode=jpeg&monitor=&scale=100&maxfps=5&buffer=0',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); + +-- +-- Add some zone preset values +-- +INSERT INTO ZonePresets VALUES (1,'Fast, low sensitivity','Active','Percent','AlarmedPixels',60,NULL,20,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0); +INSERT INTO ZonePresets VALUES (2,'Fast, medium sensitivity','Active','Percent','AlarmedPixels',40,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0); +INSERT INTO ZonePresets VALUES (3,'Fast, high sensitivity','Active','Percent','AlarmedPixels',20,NULL,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0); +INSERT INTO ZonePresets VALUES (4,'Best, low sensitivity','Active','Percent','Blobs',60,NULL,36,NULL,7,7,24,NULL,20,NULL,1,NULL,0); +INSERT INTO ZonePresets VALUES (5,'Best, medium sensitivity','Active','Percent','Blobs',40,NULL,16,NULL,5,5,12,NULL,10,NULL,1,NULL,0); +INSERT INTO ZonePresets VALUES (6,'Best, high sensitivity','Active','Percent','Blobs',20,NULL,8,NULL,3,3,6,NULL,5,NULL,1,NULL,0); + +-- +-- Apply the initial configuration +-- +-- This section is autogenerated by zmconfgen.pl +-- Do not edit this file as any changes will be overwritten +-- + +delete from Config; + +insert into Config set Id = 0, Name = 'ZM_LANG_DEFAULT', Value = 'en_gb', Type = 'string', DefaultValue = 'en_gb', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Default language used by web interface', Help = 'ZoneMinder allows the web interface to use languages other than English if the appropriate language file has been created and is present. This option allows you to change the default language that is used from the shipped language, British English, to another language', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 1, Name = 'ZM_OPT_USE_AUTH', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Authenticate user logins to ZoneMinder', Help = 'ZoneMinder can run in two modes. The simplest is an entirely unauthenticated mode where anyone can access ZoneMinder and perform all tasks. This is most suitable for installations where the web server access is limited in other ways. The other mode enables user accounts with varying sets of permissions. Users must login or authenticate to access ZoneMinder and are limited by their defined permissions.', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 2, Name = 'ZM_AUTH_TYPE', Value = 'builtin', Type = 'string', DefaultValue = 'builtin', Hint = 'builtin|remote', Pattern = '(?^i:^([br]))', Format = ' $1 =~ /^b/ ? \"builtin\" : \"remote\" ', Prompt = 'What is used to authenticate ZoneMinder users', Help = 'ZoneMinder can use two methods to authenticate users when running in authenticated mode. The first is a builtin method where ZoneMinder provides facilities for users to log in and maintains track of their identity. The second method allows interworking with other methods such as http basic authentication which passes an independently authentication \'remote\' user via http. In this case ZoneMinder would use the supplied user without additional authentication provided such a user is configured ion ZoneMinder.', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1'; +insert into Config set Id = 3, Name = 'ZM_AUTH_RELAY', Value = 'hashed', Type = 'string', DefaultValue = 'hashed', Hint = 'hashed|plain|none', Pattern = '(?^i:^([hpn]))', Format = ' ($1 =~ /^h/) ? \"hashed\" : ($1 =~ /^p/ ? \"plain\" : \"none\" ) ', Prompt = 'Method used to relay authentication information', Help = 'When ZoneMinder is running in authenticated mode it can pass user details between the web pages and the back end processes. There are two methods for doing this. This first is to use a time limited hashed string which contains no direct username or password details, the second method is to pass the username and passwords around in plaintext. This method is not recommend except where you do not have the md5 libraries available on your system or you have a completely isolated system with no external access. You can also switch off authentication relaying if your system is isolated in other ways.', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1'; +insert into Config set Id = 4, Name = 'ZM_AUTH_HASH_SECRET', Value = '...Change me to something unique...', Type = 'string', DefaultValue = '...Change me to something unique...', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Secret for encoding hashed authentication information', Help = 'When ZoneMinder is running in hashed authenticated mode it is necessary to generate hashed strings containing encrypted sensitive information such as usernames and password. Although these string are reasonably secure the addition of a random secret increases security substantially.', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1;ZM_AUTH_RELAY=hashed'; +insert into Config set Id = 5, Name = 'ZM_AUTH_HASH_IPS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Include IP addresses in the authentication hash', Help = 'When ZoneMinder is running in hashed authenticated mode it can optionally include the requesting IP address in the resultant hash. This adds an extra level of security as only requests from that address may use that authentication key. However in some circumstances, such as access over mobile networks, the requesting address can change for each request which will cause most requests to fail. This option allows you to control whether IP addresses are included in the authentication hash on your system. If you experience intermitent problems with authentication, switching this option off may help.', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1;ZM_AUTH_RELAY=hashed'; +insert into Config set Id = 6, Name = 'ZM_AUTH_HASH_LOGINS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Allow login by authentication hash', Help = 'The normal process for logging into ZoneMinder is via the login screen with username and password. In some circumstances it may be desirable to allow access directly to one or more pages, for instance from a third party application. If this option is enabled then adding an \'auth\' parameter to any request will include a shortcut login bypassing the login screen, if not already logged in. As authentication hashes are time and, optionally, IP limited this can allow short-term access to ZoneMinder screens from other web pages etc. In order to use this the calling application will hae to generate the authentication hash itself and ensure it is valid. If you use this option you should ensure that you have modified the ZM_AUTH_HASH_SECRET to somethign unique to your system.', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1;ZM_AUTH_RELAY=hashed'; +insert into Config set Id = 7, Name = 'ZM_DIR_EVENTS', Value = 'events', Type = 'string', DefaultValue = 'events', Hint = 'directory', Pattern = '(?^:^([a-zA-Z0-9-_.]+)$)', Format = ' $1 ', Prompt = 'Directory where events are stored', Help = 'This is the path to the events directory where all the event images and other miscellaneous files are stored. It is normally given as a subdirectory of the web directory you have specified earlier however if disk space is tight it can reside on another partition in which case you should create a link from that area to the path you give here.', Category = 'paths', Readonly = '0', Requires = ''; +insert into Config set Id = 8, Name = 'ZM_USE_DEEP_STORAGE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Use a deep filesystem hierarchy for events', Help = 'Traditionally ZoneMinder stores all events for a monitor in one directory for that monitor. This is simple and efficient except when you have very large amounts of events. Some filesystems are unable to store more than 32k files in one directory and even without this limitation, large numbers of files in a directory can slow creation and deletion of files. This option allows you to select an alternate method of storing events by year/month/day/hour/min/second which has the effect of separating events out into more directories, resulting in less per directory, and also making it easier to manually navigate to any events that may have happened at a particular time or date.', Category = 'paths', Readonly = '0', Requires = ''; +insert into Config set Id = 9, Name = 'ZM_DIR_IMAGES', Value = 'images', Type = 'string', DefaultValue = 'images', Hint = 'directory', Pattern = '(?^:^([a-zA-Z0-9-_.]+)$)', Format = ' $1 ', Prompt = 'Directory where the images that the ZoneMinder client generates are stored', Help = 'ZoneMinder generates a myriad of images, mosty of which are associated with events. For those that aren\'t this is where they go.', Category = 'paths', Readonly = '0', Requires = ''; +insert into Config set Id = 10, Name = 'ZM_DIR_SOUNDS', Value = 'sounds', Type = 'string', DefaultValue = 'sounds', Hint = 'directory', Pattern = '(?^:^([a-zA-Z0-9-_.]+)$)', Format = ' $1 ', Prompt = 'Directory to the sounds that the ZoneMinder client can use', Help = 'ZoneMinder can optionally play a sound file when an alarm is detected. This indicates where (relative to the web root) to look for this file.', Category = 'paths', Readonly = '0', Requires = ''; +insert into Config set Id = 11, Name = 'ZM_PATH_ZMS', Value = '/cgi-bin/nph-zms', Type = 'string', DefaultValue = '/cgi-bin/nph-zms', Hint = 'relative/path/to/somewhere', Pattern = '(?^:^((?:[^/].*)?)/?$)', Format = ' $1 ', Prompt = 'Web path to zms streaming server', Help = 'The ZoneMinder streaming server is required to send streamed images to your browser. It will be installed into the cgi-bin path given at configuration time. This option determines what the web path to the server is rather than the local path on your machine. Ordinarily the streaming server runs in parser-header mode however if you experience problems with streaming you can change this to non-parsed-header (nph) mode by changing \'zms\' to \'nph-zms\'.', Category = 'paths', Readonly = '0', Requires = ''; +insert into Config set Id = 12, Name = 'ZM_COLOUR_JPEG_FILES', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Colourise greyscale JPEG files', Help = 'Cameras that capture in greyscale can write their captured images to jpeg files with a corresponding greyscale colour space. This saves a small amount of disk space over colour ones. However some tools such as ffmpeg either fail to work with this colour space or have to convert it beforehand. Setting this option to yes uses up a little more space but makes creation of MPEG files much faster.', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 13, Name = 'ZM_ADD_JPEG_COMMENTS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Add jpeg timestamp annotations as file header comments', Help = 'JPEG files may have a number of extra fields added to the file header. The comment field may have any kind of text added. This options allows you to have the same text that is used to annotate the image additionally included as a file header comment. If you archive event images to other locations this may help you locate images for particular events or times if you use software that can read comment headers.', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 14, Name = 'ZM_JPEG_FILE_QUALITY', Value = '70', Type = 'integer', DefaultValue = '70', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Set the JPEG quality setting for the saved event files (1-100)', Help = 'When ZoneMinder detects an event it will save the images associated with that event to files. These files are in the JPEG format and can be viewed or streamed later. This option specifies what image quality should be used to save these files. A higher number means better quality but less compression so will take up more disk space and take longer to view over a slow connection. By contrast a low number means smaller, quicker to view, files but at the price of lower quality images. This setting applies to all images written except if the capture image has caused an alarm and the alarm file quality option is set at a higher value when that is used instead.', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 15, Name = 'ZM_JPEG_ALARM_FILE_QUALITY', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Set the JPEG quality setting for the saved event files during an alarm (1-100)', Help = 'This value is equivalent to the regular jpeg file quality setting above except that it only applies to images saved while in an alarm state and then only if this value is set to a higher quality setting than the ordinary file setting. If set to a lower value then it is ignored. Thus leaving it at the default of 0 effectively means to use the regular file quality setting for all saved images. This is to prevent acccidentally saving important images at a worse quality setting.', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 16, Name = 'ZM_JPEG_IMAGE_QUALITY', Value = '70', Type = 'integer', DefaultValue = '70', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Set the JPEG quality setting for the streamed \'live\' images (1-100)', Help = 'When viewing a \'live\' stream for a monitor ZoneMinder will grab an image from the buffer and encode it into JPEG format before sending it. This option specifies what image quality should be used to encode these images. A higher number means better quality but less compression so will take longer to view over a slow connection. By contrast a low number means quicker to view images but at the price of lower quality images. This option does not apply when viewing events or still images as these are usually just read from disk and so will be encoded at the quality specified by the previous options.', Category = 'hidden', Readonly = '0', Requires = ''; +insert into Config set Id = 17, Name = 'ZM_JPEG_STREAM_QUALITY', Value = '70', Type = 'integer', DefaultValue = '70', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Set the JPEG quality setting for the streamed \'live\' images (1-100)', Help = 'When viewing a \'live\' stream for a monitor ZoneMinder will grab an image from the buffer and encode it into JPEG format before sending it. This option specifies what image quality should be used to encode these images. A higher number means better quality but less compression so will take longer to view over a slow connection. By contrast a low number means quicker to view images but at the price of lower quality images. This option does not apply when viewing events or still images as these are usually just read from disk and so will be encoded at the quality specified by the previous options.', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 18, Name = 'ZM_MPEG_TIMED_FRAMES', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Tag video frames with a timestamp for more realistic streaming', Help = 'When using streamed MPEG based video, either for live monitor streams or events, ZoneMinder can send the streams in two ways. If this option is selected then the timestamp for each frame, taken from it\'s capture time, is included in the stream. This means that where the frame rate varies, for instance around an alarm, the stream will still maintain it\'s \'real\' timing. If this option is not selected then an approximate frame rate is calculated and that is used to schedule frames instead. This option should be selected unless you encounter problems with your preferred streaming method.', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 19, Name = 'ZM_MPEG_LIVE_FORMAT', Value = 'swf', Type = 'string', DefaultValue = 'swf', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'What format \'live\' video streams are played in', Help = 'When using MPEG mode ZoneMinder can output live video. However what formats are handled by the browser varies greatly between machines. This option allows you to specify a video format using a file extension format, so you would just enter the extension of the file type you would like and the rest is determined from that. The default of \'asf\' works well under Windows with Windows Media Player but I\'m currently not sure what, if anything, works on a Linux platform. If you find out please let me know! If this option is left blank then live streams will revert to being in motion jpeg format', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 20, Name = 'ZM_MPEG_REPLAY_FORMAT', Value = 'swf', Type = 'string', DefaultValue = 'swf', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'What format \'replay\' video streams are played in', Help = 'When using MPEG mode ZoneMinder can replay events in encoded video format. However what formats are handled by the browser varies greatly between machines. This option allows you to specify a video format using a file extension format, so you would just enter the extension of the file type you would like and the rest is determined from that. The default of \'asf\' works well under Windows with Windows Media Player and \'mpg\', or \'avi\' etc should work under Linux. If you know any more then please let me know! If this option is left blank then live streams will revert to being in motion jpeg format', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 21, Name = 'ZM_RAND_STREAM', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Add a random string to prevent caching of streams', Help = 'Some browsers can cache the streams used by ZoneMinder. In order to prevent his a harmless random string can be appended to the url to make each invocation of the stream appear unique.', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 22, Name = 'ZM_OPT_CAMBOZOLA', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Is the (optional) cambozola java streaming client installed', Help = 'Cambozola is a handy low fat cheese flavoured Java applet that ZoneMinder uses to view image streams on browsers such as Internet Explorer that don\'t natively support this format. If you use this browser it is highly recommended to install this from http://www.charliemouse.com/code/cambozola/ however if it is not installed still images at a lower refresh rate can still be viewed.', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 23, Name = 'ZM_PATH_CAMBOZOLA', Value = 'cambozola.jar', Type = 'string', DefaultValue = 'cambozola.jar', Hint = 'relative/path/to/somewhere', Pattern = '(?^:^((?:[^/].*)?)/?$)', Format = ' $1 ', Prompt = 'Web path to (optional) cambozola java streaming client', Help = 'Cambozola is a handy low fat cheese flavoured Java applet that ZoneMinder uses to view image streams on browsers such as Internet Explorer that don\'t natively support this format. If you use this browser it is highly recommended to install this from http://www.charliemouse.com/code/cambozola/ however if it is not installed still images at a lower refresh rate can still be viewed. Leave this as \'cambozola.jar\' if cambozola is installed in the same directory as the ZoneMinder web client files.', Category = 'images', Readonly = '0', Requires = 'ZM_OPT_CAMBOZOLA=1'; +insert into Config set Id = 24, Name = 'ZM_RELOAD_CAMBOZOLA', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'After how many seconds should Cambozola be reloaded in live view', Help = 'Cambozola allows for the viewing of streaming MJPEG however it caches the entire stream into cache space on the computer, setting this to a number > 0 will cause it to automatically reload after that many seconds to avoid filling up a hard drive.', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 25, Name = 'ZM_TIMESTAMP_ON_CAPTURE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Timestamp images as soon as they are captured', Help = 'ZoneMinder can add a timestamp to images in two ways. The default method, when this option is set, is that each image is timestamped immediately when captured and so the image held in memory is marked right away. The second method does not timestamp the images until they are either saved as part of an event or accessed over the web. The timestamp used in both methods will contain the same time as this is preserved along with the image. The first method ensures that an image is timestamped regardless of any other circumstances but will result in all images being timestamped even those never saved or viewed. The second method necessitates that saved images are copied before being saved otherwise two timestamps perhaps at different scales may be applied. This has the (perhaps) desirable side effect that the timestamp is always applied at the same resolution so an image that has scaling applied will still have a legible and correctly scaled timestamp.', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 26, Name = 'ZM_CPU_EXTENSIONS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Use advanced CPU extensions to increase performance', Help = 'When advanced processor extensions such as SSE2 or SSSE3 are available, ZoneMinder can use them, which should increase performance and reduce system load. Enabling this option on processors that do not support the advanced processors extensions used by ZoneMinder is harmless and will have no effect.', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 27, Name = 'ZM_FAST_IMAGE_BLENDS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Use a fast algorithm to blend the reference image', Help = 'To detect alarms ZoneMinder needs to blend the captured image with the stored reference image to update it for comparison with the next image. The reference blend percentage specified for the monitor controls how much the new image affects the reference image. There are two methods that are available for this. If this option is set then fast calculation which does not use any multiplication or division is used. This calculation is extremely fast, however it limits the possible blend percentages to 50%, 25%, 12.5%, 6.25%, 3.25% and 1.5%. Any other blend percentage will be rounded to the nearest possible one. The alternative is to switch this option off and use standard blending instead, which is slower.', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 28, Name = 'ZM_OPT_ADAPTIVE_SKIP', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should frame analysis try and be efficient in skipping frames', Help = 'In previous versions of ZoneMinder the analysis daemon would attempt to keep up with the capture daemon by processing the last captured frame on each pass. This would sometimes have the undesirable side-effect of missing a chunk of the initial activity that caused the alarm because the pre-alarm frames would all have to be written to disk and the database before processing the next frame, leading to some delay between the first and second event frames. Setting this option enables a newer adaptive algorithm where the analysis daemon attempts to process as many captured frames as possible, only skipping frames when in danger of the capture daemon overwriting yet to be processed frames. This skip is variable depending on the size of the ring buffer and the amount of space left in it. Enabling this option will give you much better coverage of the beginning of alarms whilst biasing out any skipped frames towards the middle or end of the event. However you should be aware that this will have the effect of making the analysis daemon run somewhat behind the capture daemon during events and for particularly fast rates of capture it is possible for the adaptive algorithm to be overwhelmed and not have time to react to a rapid build up of pending frames and thus for a buffer overrun condition to occur.', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 29, Name = 'ZM_BLEND_ALARMED_IMAGES', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Blend alarmed images to update the reference image', Help = 'To detect alarms ZoneMinder compares an image with a reference image which is formed from a composite of the previous images. This option determines whether images that cause events are included in this process. Doing so may increase the precision of the alarmed region but can cause problems if wholescale lighting changes cause alarms as this would not get fed back into the image and an alarm may persist indefinately. A better way to achive the same effect in most cases is to lower substantially the reference blend percentage in specific monitors.', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 30, Name = 'ZM_MAX_SUSPEND_TIME', Value = '30', Type = 'integer', DefaultValue = '30', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Maximum time that a monitor may have motion detection suspended', Help = 'ZoneMinder allows monitors to have motion detection to be suspended, for instance while panning a camera. Ordinarily this relies on the operator resuming motion detection afterwards as failure to do so can leave a monitor in a permanently suspended state. This setting allows you to set a maximum time which a camera may be suspended for before it automatically resumes motion detection. This time can be extended by subsequent suspend indications after the first so continuous camera movement will also occur while the monitor is suspended.', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 31, Name = 'ZM_OPT_REMOTE_CAMERAS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Are you going to use remote/networked cameras', Help = 'ZoneMinder can work with both local cameras, ie. those attached physically to your computer and remote or network cameras. If you will be using networked cameras select this option.', Category = 'hidden', Readonly = '0', Requires = ''; +insert into Config set Id = 32, Name = 'ZM_NETCAM_REGEXPS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Use regular expression matching with network cameras', Help = 'Traditionally ZoneMinder has used complex regular regular expressions to handle the multitude of formats that network cameras produce. In versions from 1.21.1 the default is to use a simpler and faster built in pattern matching methodology. This works well with most networks cameras but if you have problems you can try the older, but more flexible, regular expression based method by selecting this option. Note, to use this method you must have libpcre installed on your system.', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_REMOTE_CAMERAS=1'; +insert into Config set Id = 33, Name = 'ZM_HTTP_VERSION', Value = '1.1', Type = 'string', DefaultValue = '1.1', Hint = '1.1|1.0', Pattern = '(?^:^(1\.[01])$)', Format = ' $1?$1:\"\" ', Prompt = 'The version of HTTP that ZoneMinder will use to connect', Help = 'ZoneMinder can communicate with network cameras using either of the HTTP/1.1 or HTTP/1.0 standard. A server will normally fall back to the version it supports iwht no problem so this should usually by left at the default. However it can be changed to HTTP/1.0 if necessary to resolve particular issues.', Category = 'network', Readonly = '0', Requires = ''; +insert into Config set Id = 34, Name = 'ZM_HTTP_UA', Value = 'ZoneMinder', Type = 'string', DefaultValue = 'ZoneMinder', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The user agent that ZoneMinder uses to identify itself', Help = 'When ZoneMinder communicates with remote cameras it will identify itself using this string and it\'s version number. This is normally sufficient, however if a particular cameras expects only to communicate with certain browsers then this can be changed to a different string identifying ZoneMinder as Internet Explorer or Netscape etc.', Category = 'network', Readonly = '0', Requires = ''; +insert into Config set Id = 35, Name = 'ZM_HTTP_TIMEOUT', Value = '2500', Type = 'integer', DefaultValue = '2500', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long ZoneMinder waits before giving up on images (milliseconds)', Help = 'When retrieving remote images ZoneMinder will wait for this length of time before deciding that an image is not going to arrive and taking steps to retry. This timeout is in milliseconds (1000 per second) and will apply to each part of an image if it is not sent in one whole chunk.', Category = 'network', Readonly = '0', Requires = ''; +insert into Config set Id = 36, Name = 'ZM_MIN_RTP_PORT', Value = '40200', Type = 'integer', DefaultValue = '40200', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Minimum port that ZoneMinder will listen for RTP traffic on', Help = 'When ZoneMinder communicates with MPEG4 capable cameras using RTP with the unicast method it must open ports for the camera to connect back to for control and streaming purposes. This setting specifies the minimum port number that ZoneMinder will use. Ordinarily two adjacent ports are used for each camera, one for control packets and one for data packets. This port should be set to an even number, you may also need to open up a hole in your firewall to allow cameras to connect back if you wish to use unicasting.', Category = 'network', Readonly = '0', Requires = ''; +insert into Config set Id = 37, Name = 'ZM_MAX_RTP_PORT', Value = '40499', Type = 'integer', DefaultValue = '40499', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Maximum port that ZoneMinder will listen for RTP traffic on', Help = 'When ZoneMinder communicates with MPEG4 capable cameras using RTP with the unicast method it must open ports for the camera to connect back to for control and streaming purposes. This setting specifies the maximum port number that ZoneMinder will use. Ordinarily two adjacent ports are used for each camera, one for control packets and one for data packets. This port should be set to an even number, you may also need to open up a hole in your firewall to allow cameras to connect back if you wish to use unicasting. You should also ensure that you have opened up at least two ports for each monitor that will be connecting to unicasting network cameras.', Category = 'network', Readonly = '0', Requires = ''; +insert into Config set Id = 38, Name = 'ZM_OPT_FFMPEG', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Is the ffmpeg video encoder/decoder installed', Help = 'ZoneMinder can optionally encode a series of video images into an MPEG encoded movie file for viewing, downloading or storage. This option allows you to specify whether you have the ffmpeg tools installed. Note that creating MPEG files can be fairly CPU and disk intensive and is not a required option as events can still be reviewed as video streams without it.', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 39, Name = 'ZM_PATH_FFMPEG', Value = '/usr/bin/ffmpeg', Type = 'string', DefaultValue = '/usr/bin/ffmpeg', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'Path to (optional) ffmpeg mpeg encoder', Help = 'This path should point to where ffmpeg has been installed.', Category = 'images', Readonly = '0', Requires = 'ZM_OPT_FFMPEG=1'; +insert into Config set Id = 40, Name = 'ZM_FFMPEG_INPUT_OPTIONS', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Additional input options to ffmpeg', Help = 'Ffmpeg can take many options on the command line to control the quality of video produced. This option allows you to specify your own set that apply to the input to ffmpeg (options that are given before the -i option). Check the ffmpeg documentation for a full list of options which may be used here.', Category = 'images', Readonly = '0', Requires = 'ZM_OPT_FFMPEG=1'; +insert into Config set Id = 41, Name = 'ZM_FFMPEG_OUTPUT_OPTIONS', Value = '-r 25', Type = 'string', DefaultValue = '-r 25', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Additional output options to ffmpeg', Help = 'Ffmpeg can take many options on the command line to control the quality of video produced. This option allows you to specify your own set that apply to the output from ffmpeg (options that are given after the -i option). Check the ffmpeg documentation for a full list of options which may be used here. The most common one will often be to force an output frame rate supported by the video encoder.', Category = 'images', Readonly = '0', Requires = 'ZM_OPT_FFMPEG=1'; +insert into Config set Id = 42, Name = 'ZM_FFMPEG_FORMATS', Value = 'mpg mpeg wmv asf avi* mov swf 3gp**', Type = 'string', DefaultValue = 'mpg mpeg wmv asf avi* mov swf 3gp**', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Formats to allow for ffmpeg video generation', Help = 'Ffmpeg can generate video in many different formats. This option allows you to list the ones you want to be able to select. As new formats are supported by ffmpeg you can add them here and be able to use them immediately. Adding a \'*\' after a format indicates that this will be the default format used for web video, adding \'**\' defines the default format for phone video.', Category = 'images', Readonly = '0', Requires = 'ZM_OPT_FFMPEG=1'; +insert into Config set Id = 43, Name = 'ZM_LOG_LEVEL_SYSLOG', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Save logging output to the system log', Help = 'ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output that goes to the system log. ZoneMinder binaries have always logged to the system log but now scripts and web logging is also included. To preserve the previous behaviour you should ensure this value is set to Info or Warning. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance. If you want debug you will also need to set a level and component below', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 44, Name = 'ZM_LOG_LEVEL_FILE', Value = '-5', Type = 'integer', DefaultValue = '-5', Hint = 'None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Save logging output to component files', Help = 'ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output that goes to individual log files written by specific components. This is how logging worked previously and although useful for tracking down issues in specific components it also resulted in many disparate log files. To preserve this behaviour you should ensure this value is set to Info or Warning. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance though file output has less impact than the other options. If you want debug you will also need to set a level and component below', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 45, Name = 'ZM_LOG_LEVEL_WEBLOG', Value = '-5', Type = 'integer', DefaultValue = '-5', Hint = 'None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Save logging output to the weblog', Help = 'ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output from the web interface that goes to the httpd error log. Note that only web logging from PHP and JavaScript files is included and so this option is really only useful for investigating specific issues with those components. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance. If you want debug you will also need to set a level and component below', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 46, Name = 'ZM_LOG_LEVEL_DATABASE', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Save logging output to the database', Help = 'ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output that is written to the database. This is a new option which can make viewing logging output easier and more intuitive and also makes it easier to get an overall impression of how the system is performing. If you have a large or very busy system then it is possible that use of this option may slow your system down if the table becomes very large. Ensure you use the LOG_DATABASE_LIMIT option to keep the table to a manageable size. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance. If you want debug you will also need to set a level and component below', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 47, Name = 'ZM_LOG_DATABASE_LIMIT', Value = '7 day', Type = 'string', DefaultValue = '7 day', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Maximum number of log entries to retain', Help = 'If you are using database logging then it is possible to quickly build up a large number of entries in the Logs table. This option allows you to specify how many of these entries are kept. If you set this option to a number greater than zero then that number is used to determine the maximum number of rows, less than or equal to zero indicates no limit and is not recommended. You can also set this value to time values such as \' day\' which will limit the log entries to those newer than that time. You can specify \'hour\', \'day\', \'week\', \'month\' and \'year\', note that the values should be singular (no \'s\' at the end). The Logs table is pruned periodically so it is possible for more than the expected number of rows to be present briefly in the meantime.', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 48, Name = 'ZM_LOG_DEBUG', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Switch debugging on', Help = 'ZoneMinder components usually support debug logging available to help with diagnosing problems. Binary components have several levels of debug whereas more other components have only one. Normally this is disabled to minimise performance penalties and avoid filling logs too quickly. This option lets you switch on other options that allow you to configure additional debug information to be output. Components will pick up this instruction when they are restarted.', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 49, Name = 'ZM_LOG_DEBUG_TARGET', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'What components should have extra debug enabled', Help = 'There are three scopes of debug available. Leaving this option blank means that all components will use extra debug (not recommended). Setting this option to \'_\', e.g. _zmc, will limit extra debug to that component only. Setting this option to \'__\', e.g. \'_zmc_m1\' will limit extra debug to that instance of the component only. This is ordinarily what you probably want to do. To debug scripts use their names without the .pl extension, e.g. \'_zmvideo\' and to debug issues with the web interface use \'_web\'. You can specify multiple targets by separating them with \'|\' characters.', Category = 'logging', Readonly = '0', Requires = 'ZM_LOG_DEBUG=1'; +insert into Config set Id = 50, Name = 'ZM_LOG_DEBUG_LEVEL', Value = '1', Type = 'integer', DefaultValue = '1', Hint = '1|2|3|4|5|6|7|8|9', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What level of extra debug should be enabled', Help = 'There are 9 levels of debug available, with higher numbers being more debug and level 0 being no debug. However not all levels are used by all components. Also if there is debug at a high level it is usually likely to be output at such a volume that it may obstruct normal operation. For this reason you should set the level carefully and cautiously until the degree of debug you wish to see is present. Scripts and the web interface only have one level so this is an on/off type option for them.', Category = 'logging', Readonly = '0', Requires = 'ZM_LOG_DEBUG=1'; +insert into Config set Id = 51, Name = 'ZM_LOG_DEBUG_FILE', Value = '/tmp/zm/zm_debug.log+', Type = 'string', DefaultValue = '/tmp/zm/zm_debug.log+', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Where extra debug is output to', Help = 'This option allows you to specify a different target for debug output. All components have a default log file which will norally be in /tmp or /var/log and this is where debug will be written to if this value is empty. Adding a path here will temporarily redirect debug, and other logging output, to this file. This option is a simple filename and you are debugging several components then they will all try and write to the same file with undesirable consequences. Appending a \'+\' to the filename will cause the file to be created with a \'.\' suffix containing your process id. In this way debug from each run of a component is kept separate. This is the recommended setting as it will also prevent subsequent runs from overwriting the same log. You should ensure that permissions are set up to allow writing to the file and directory specified here.', Category = 'logging', Readonly = '0', Requires = 'ZM_LOG_DEBUG=1'; +insert into Config set Id = 52, Name = 'ZM_LOG_CHECK_PERIOD', Value = '900', Type = 'integer', DefaultValue = '900', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Time period used when calculating overall system health', Help = 'When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to indicate what period of historical events are used in this calculation. This value is expressed in seconds and is ignored if LOG_LEVEL_DATABASE is set to None.', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 53, Name = 'ZM_LOG_ALERT_WAR_COUNT', Value = '1', Type = 'integer', DefaultValue = '1', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Number of warnings indicating system alert state', Help = 'When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many warnings must have occurred within the defined time period to generate an overall system alert state. A value of zero means warnings are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 54, Name = 'ZM_LOG_ALERT_ERR_COUNT', Value = '1', Type = 'integer', DefaultValue = '1', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Number of errors indicating system alert state', Help = 'When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many errors must have occurred within the defined time period to generate an overall system alert state. A value of zero means errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 55, Name = 'ZM_LOG_ALERT_FAT_COUNT', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Number of fatal error indicating system alert state', Help = 'When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many fatal errors (including panics) must have occurred within the defined time period to generate an overall system alert state. A value of zero means fatal errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 56, Name = 'ZM_LOG_ALARM_WAR_COUNT', Value = '100', Type = 'integer', DefaultValue = '100', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Number of warnings indicating system alarm state', Help = 'When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many warnings must have occurred within the defined time period to generate an overall system alarm state. A value of zero means warnings are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 57, Name = 'ZM_LOG_ALARM_ERR_COUNT', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Number of errors indicating system alarm state', Help = 'When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many errors must have occurred within the defined time period to generate an overall system alarm state. A value of zero means errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 58, Name = 'ZM_LOG_ALARM_FAT_COUNT', Value = '1', Type = 'integer', DefaultValue = '1', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Number of fatal error indicating system alarm state', Help = 'When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many fatal errors (including panics) must have occurred within the defined time period to generate an overall system alarm state. A value of zero means fatal errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 59, Name = 'ZM_RECORD_EVENT_STATS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Record event statistical information, switch off if too slow', Help = 'This version of ZoneMinder records detailed information about events in the Stats table. This can help in profiling what the optimum settings are for Zones though this is tricky at present. However in future releases this will be done more easily and intuitively, especially with a large sample of events. The default option of \'yes\' allows this information to be collected now in readiness for this but if you are concerned about performance you can switch this off in which case no Stats information will be saved.', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 60, Name = 'ZM_RECORD_DIAG_IMAGES', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Record intermediate alarm diagnostic images, can be very slow', Help = 'In addition to recording event statistics you can also record the intermediate diagnostic images that display the results of the various checks and processing that occur when trying to determine if an alarm event has taken place. There are several of these images generated for each frame and zone for each alarm or alert frame so this can have a massive impact on performance. Only switch this setting on for debug or analysis purposes and remember to switch it off again once no longer required.', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 61, Name = 'ZM_DUMP_CORES', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Create core files on unexpected process failure.', Help = 'When an unrecoverable error occurs in a ZoneMinder binary process is has traditionally been trapped and the details written to logs to aid in remote analysis. However in some cases it is easier to diagnose the error if a core file, which is a memory dump of the process at the time of the error, is created. This can be interactively analysed in the debugger and may reveal more or better information than that available from the logs. This option is recommended for advanced users only otherwise leave at the default. Note using this option to trigger core files will mean that there will be no indication in the binary logs that a process has died, they will just stop, however the zmdc log will still contain an entry. Also note that you may have to explicitly enable core file creation on your system via the \'ulimit -c\' command or other means otherwise no file will be created regardless of the value of this option.', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 62, Name = 'ZM_PATH_MAP', Value = '/dev/shm', Type = 'string', DefaultValue = '/dev/shm', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'Path to the mapped memory files that that ZoneMinder can use', Help = 'ZoneMinder has historically used IPC shared memory for shared data between processes. This has it\'s advantages and limitations. This version of ZoneMinder can use an alternate method, mapped memory, instead with can be enabled with the --enable--mmap directive to configure. This requires less system configuration and is generally more flexible. However it requires each shared data segment to map onto a filesystem file. This option indicates where those mapped files go. You should ensure that this location has sufficient space for these files and for the best performance it should be a tmpfs file system or ramdisk otherwise disk access may render this method slower than the regular shared memory one.', Category = 'paths', Readonly = '0', Requires = ''; +insert into Config set Id = 63, Name = 'ZM_PATH_SOCKS', Value = '/tmp/zm', Type = 'string', DefaultValue = '/tmp/zm', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'Path to the various Unix domain socket files that ZoneMinder uses', Help = 'ZoneMinder generally uses Unix domain sockets where possible. This reduces the need for port assignments and prevents external applications from possibly compromising the daemons. However each Unix socket requires a .sock file to be created. This option indicates where those socket files go.', Category = 'paths', Readonly = '0', Requires = ''; +insert into Config set Id = 64, Name = 'ZM_PATH_LOGS', Value = '/var/log/zm', Type = 'string', DefaultValue = '/var/log/zm', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'Path to the various logs that the ZoneMinder daemons generate', Help = 'There are various daemons that are used by ZoneMinder to perform various tasks. Most generate helpful log files and this is where they go. They can be deleted if not required for debugging.', Category = 'paths', Readonly = '0', Requires = ''; +insert into Config set Id = 65, Name = 'ZM_PATH_SWAP', Value = '/tmp/zm', Type = 'string', DefaultValue = '/tmp/zm', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'Path to location for temporary swap images used in streaming', Help = 'Buffered playback requires temporary swap images to be stored for each instance of the streaming daemons. This option determines where these images will be stored. The images will actually be stored in sub directories beneath this location and will be automatically cleaned up after a period of time.', Category = 'paths', Readonly = '0', Requires = ''; +insert into Config set Id = 66, Name = 'ZM_WEB_TITLE_PREFIX', Value = 'ZM', Type = 'string', DefaultValue = 'ZM', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The title prefix displayed on each window', Help = 'If you have more than one installation of ZoneMinder it can be helpful to display different titles for each one. Changing this option allows you to customise the window titles to include further information to aid identification.', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 67, Name = 'ZM_WEB_RESIZE_CONSOLE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should the console window resize itself to fit', Help = 'Traditionally the main ZoneMinder web console window has resized itself to shrink to a size small enough to list only the monitors that are actually present. This is intended to make the window more unobtrusize but may not be to everyones tastes, especially if opened in a tab in browsers which support this kind if layout. Switch this option off to have the console window size left to the users preference', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 68, Name = 'ZM_WEB_POPUP_ON_ALARM', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should the monitor window jump to the top if an alarm occurs', Help = 'When viewing a live monitor stream you can specify whether you want the window to pop to the front if an alarm occurs when the window is minimised or behind another window. This is most useful if your monitors are over doors for example when they can pop up if someone comes to the doorway.', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 69, Name = 'ZM_OPT_X10', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Support interfacing with X10 devices', Help = 'If you have an X10 Home Automation setup in your home you can use ZoneMinder to initiate or react to X10 signals if your computer has the appropriate interface controller. This option indicates whether X10 options will be available in the browser client.', Category = 'x10', Readonly = '0', Requires = ''; +insert into Config set Id = 70, Name = 'ZM_X10_DEVICE', Value = '/dev/ttyS0', Type = 'string', DefaultValue = '/dev/ttyS0', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'What device is your X10 controller connected on', Help = 'If you have an X10 controller device (e.g. XM10U) connected to your computer this option details which port it is conected on, the default of /dev/ttyS0 maps to serial or com port 1.', Category = 'x10', Readonly = '0', Requires = 'ZM_OPT_X10=1'; +insert into Config set Id = 71, Name = 'ZM_X10_HOUSE_CODE', Value = 'A', Type = 'string', DefaultValue = 'A', Hint = 'A-P', Pattern = '(?^i:^([A-P]))', Format = ' uc($1) ', Prompt = 'What X10 house code should be used', Help = 'X10 devices are grouped together by identifying them as all belonging to one House Code. This option details what that is. It should be a single letter between A and P.', Category = 'x10', Readonly = '0', Requires = 'ZM_OPT_X10=1'; +insert into Config set Id = 72, Name = 'ZM_X10_DB_RELOAD_INTERVAL', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the X10 daemon reloads the monitors from the database', Help = 'The zmx10 daemon periodically checks the database to find out what X10 events trigger, or result from, alarms. This option determines how frequently this check occurs, unless you change this area frequently this can be a fairly large value.', Category = 'x10', Readonly = '0', Requires = 'ZM_OPT_X10=1'; +insert into Config set Id = 73, Name = 'ZM_WEB_SOUND_ON_ALARM', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should the monitor window play a sound if an alarm occurs', Help = 'When viewing a live monitor stream you can specify whether you want the window to play a sound to alert you if an alarm occurs.', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 74, Name = 'ZM_WEB_ALARM_SOUND', Value = '', Type = 'string', DefaultValue = '', Hint = 'filename', Pattern = '(?^:^([a-zA-Z0-9-_.]+)$)', Format = ' $1 ', Prompt = 'The sound to play on alarm, put this in the sounds directory', Help = 'You can specify a sound file to play if an alarm occurs whilst you are watching a live monitor stream. So long as your browser understands the format it does not need to be any particular type. This file should be placed in the sounds directory defined earlier.', Category = 'web', Readonly = '0', Requires = 'ZM_WEB_SOUND_ON_ALARM=1'; +insert into Config set Id = 75, Name = 'ZM_WEB_COMPACT_MONTAGE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Compact the montage view by removing extra detail', Help = 'The montage view shows the output of all of your active monitors in one window. This include a small menu and status information for each one. This can increase the web traffic and make the window larger than may be desired. Setting this option on removes all this extraneous information and just displays the images.', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 76, Name = 'ZM_OPT_FAST_DELETE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Delete only event database records for speed', Help = 'Normally an event created as the result of an alarm consists of entries in one or more database tables plus the various files associated with it. When deleting events in the browser it can take a long time to remove all of this if your are trying to do a lot of events at once. It is recommended that you set this option which means that the browser client only deletes the key entries in the events table, which means the events will no longer appear in the listing, and leaves the zmaudit daemon to clear up the rest later.', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 77, Name = 'ZM_STRICT_VIDEO_CONFIG', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Allow errors in setting video config to be fatal', Help = 'With some video devices errors can be reported in setting the various video attributes when in fact the operation was successful. Switching this option off will still allow these errors to be reported but will not cause them to kill the video capture daemon. Note however that doing this will cause all errors to be ignored including those which are genuine and which may cause the video capture to not function correctly. Use this option with caution.', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 78, Name = 'ZM_SIGNAL_CHECK_POINTS', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How many points in a captured image to check for signal loss', Help = 'For locally attached video cameras ZoneMinder can check for signal loss by looking at a number of random points on each captured image. If all of these points are set to the same fixed colour then the camera is assumed to have lost signal. When this happens any open events are closed and a short one frame signal loss event is generated, as is another when the signal returns. This option defines how many points on each image to check. Note that this is a maximum, any points found to not have the check colour will abort any further checks so in most cases on a couple of points will actually be checked. Network and file based cameras are never checked.', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 79, Name = 'ZM_V4L_MULTI_BUFFER', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Use more than one buffer for Video 4 Linux devices', Help = 'Performance when using Video 4 Linux devices is usually best if multiple buffers are used allowing the next image to be captured while the previous one is being processed. If you have multiple devices on a card sharing one input that requires switching then this approach can sometimes cause frames from one source to be mixed up with frames from another. Switching this option off prevents multi buffering resulting in slower but more stable image capture. This option is ignored for non-local cameras or if only one input is present on a capture chip. This option addresses a similar problem to the ZM_CAPTURES_PER_FRAME option and you should normally change the value of only one of the options at a time.', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 80, Name = 'ZM_CAPTURES_PER_FRAME', Value = '1', Type = 'integer', DefaultValue = '1', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How many images are captured per returned frame, for shared local cameras', Help = 'If you are using cameras attached to a video capture card which forces multiple inputs to share one capture chip, it can sometimes produce images with interlaced frames reversed resulting in poor image quality and a distinctive comb edge appearance. Increasing this setting allows you to force additional image captures before one is selected as the captured frame. This allows the capture hardware to \'settle down\' and produce better quality images at the price of lesser capture rates. This option has no effect on (a) network cameras, or (b) where multiple inputs do not share a capture chip. This option addresses a similar problem to the ZM_V4L_MULTI_BUFFER option and you should normally change the value of only one of the options at a time.', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 81, Name = 'ZM_FILTER_RELOAD_DELAY', Value = '300', Type = 'integer', DefaultValue = '300', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) filters are reloaded in zmfilter', Help = 'ZoneMinder allows you to save filters to the database which allow events that match certain criteria to be emailed, deleted or uploaded to a remote machine etc. The zmfilter daemon loads these and does the actual operation. This option determines how often the filters are reloaded from the database to get the latest versions or new filters. If you don\'t change filters very often this value can be set to a large value.', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 82, Name = 'ZM_FILTER_EXECUTE_INTERVAL', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) to run automatic saved filters', Help = 'ZoneMinder allows you to save filters to the database which allow events that match certain criteria to be emailed, deleted or uploaded to a remote machine etc. The zmfilter daemon loads these and does the actual operation. This option determines how often the filters are executed on the saved event in the database. If you want a rapid response to new events this should be a smaller value, however this may increase the overall load on the system and affect performance of other elements.', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 83, Name = 'ZM_OPT_UPLOAD', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should ZoneMinder support uploading events from filters', Help = 'In ZoneMinder you can create event filters that specify whether events that match certain criteria should be uploaded to a remote server for archiving. This option specifies whether this functionality should be available', Category = 'upload', Readonly = '0', Requires = ''; +insert into Config set Id = 84, Name = 'ZM_UPLOAD_ARCH_FORMAT', Value = 'tar', Type = 'string', DefaultValue = 'tar', Hint = 'tar|zip', Pattern = '(?^i:^([tz]))', Format = ' $1 =~ /^t/ ? \"tar\" : \"zip\" ', Prompt = 'What format the uploaded events should be created in.', Help = 'Uploaded events may be stored in either .tar or .zip format, this option specifies which. Note that to use this you will need to have the Archive::Tar and/or Archive::Zip perl modules installed.', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 85, Name = 'ZM_UPLOAD_ARCH_COMPRESS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should archive files be compressed', Help = 'When the archive files are created they can be compressed. However in general since the images are compressed already this saves only a minimal amount of space versus utilising more CPU in their creation. Only enable if you have CPU to waste and are limited in disk space on your remote server or bandwidth.', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 86, Name = 'ZM_UPLOAD_ARCH_ANALYSE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Include the analysis files in the archive', Help = 'When the archive files are created they can contain either just the captured frames or both the captured frames and, for frames that caused an alarm, the analysed image with the changed area highlighted. This option controls files are included. Only include analysed frames if you have a high bandwidth connection to the remote server or if you need help in figuring out what caused an alarm in the first place as archives with these files in can be considerably larger.', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 87, Name = 'ZM_UPLOAD_PROTOCOL', Value = 'ftp', Type = 'string', DefaultValue = 'ftp', Hint = 'ftp|sftp', Pattern = '(?^i:^([tz]))', Format = ' $1 =~ /^f/ ? \"ftp\" : \"sftp\" ', Prompt = 'What protocol to use to upload events', Help = 'ZoneMinder can upload events to a remote server using either FTP or SFTP. Regular FTP is widely supported but not necessarily very secure whereas SFTP (Secure FTP) runs over an ssh connection and so is encrypted and uses regular ssh ports. Note that to use this you will need to have the appropriate perl module, either Net::FTP or Net::SFTP installed depending on your choice.', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 88, Name = 'ZM_UPLOAD_FTP_HOST', Value = '', Type = 'string', DefaultValue = '', Hint = 'host.your.domain', Pattern = '(?^:^([a-zA-Z0-9_.-]+)$)', Format = ' $1 ', Prompt = 'The remote server to upload to', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the name, or ip address, of the server to use.', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 89, Name = 'ZM_UPLOAD_HOST', Value = '', Type = 'string', DefaultValue = '', Hint = 'host.your.domain', Pattern = '(?^:^([a-zA-Z0-9_.-]+)$)', Format = ' $1 ', Prompt = 'The remote server to upload events to', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the name, or ip address, of the server to use.', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 90, Name = 'ZM_UPLOAD_PORT', Value = '', Type = 'integer', DefaultValue = '', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'The port on the remote upload server, if not the default (SFTP only)', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote server. If you are using the SFTP protocol then this option allows you to specify a particular port to use for connection. If this option is left blank then the default, port 22, is used. This option is ignored for FTP uploads.', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 91, Name = 'ZM_UPLOAD_FTP_USER', Value = '', Type = 'string', DefaultValue = '', Hint = 'alphanumeric', Pattern = '(?^:^([a-zA-Z0-9-_]+)$)', Format = ' $1 ', Prompt = 'Your ftp username', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the username that ZoneMinder should use to log in for ftp transfer.', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 92, Name = 'ZM_UPLOAD_USER', Value = '', Type = 'string', DefaultValue = '', Hint = 'alphanumeric', Pattern = '(?^:^([a-zA-Z0-9-_]+)$)', Format = ' $1 ', Prompt = 'Remote server username', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the username that ZoneMinder should use to log in for transfer.', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 93, Name = 'ZM_UPLOAD_FTP_PASS', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Your ftp password', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the password that ZoneMinder should use to log in for ftp transfer.', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 94, Name = 'ZM_UPLOAD_PASS', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Remote server password', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the password that ZoneMinder should use to log in for transfer. If you are using certicate based logins for SFTP servers you can leave this option blank.', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 95, Name = 'ZM_UPLOAD_FTP_LOC_DIR', Value = '/tmp/zm', Type = 'string', DefaultValue = '/tmp/zm', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'The local directory in which to create upload files', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the local directory that ZoneMinder should use for temporary upload files. These are files that are created from events, uploaded and then deleted.', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 96, Name = 'ZM_UPLOAD_LOC_DIR', Value = '/tmp/zm', Type = 'string', DefaultValue = '/tmp/zm', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'The local directory in which to create upload files', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the local directory that ZoneMinder should use for temporary upload files. These are files that are created from events, uploaded and then deleted.', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 97, Name = 'ZM_UPLOAD_FTP_REM_DIR', Value = '', Type = 'string', DefaultValue = '', Hint = 'relative/path/to/somewhere', Pattern = '(?^:^((?:[^/].*)?)/?$)', Format = ' $1 ', Prompt = 'The remote directory to upload to', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the remote directory that ZoneMinder should use to upload event files to.', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 98, Name = 'ZM_UPLOAD_REM_DIR', Value = '', Type = 'string', DefaultValue = '', Hint = 'relative/path/to/somewhere', Pattern = '(?^:^((?:[^/].*)?)/?$)', Format = ' $1 ', Prompt = 'The remote directory to upload to', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the remote directory that ZoneMinder should use to upload event files to.', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 99, Name = 'ZM_UPLOAD_FTP_TIMEOUT', Value = '120', Type = 'integer', DefaultValue = '120', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long to allow the transfer to take for each file', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the maximum ftp inactivity timeout (in seconds) that should be tolerated before ZoneMinder determines that the transfer has failed and closes down the connection.', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 100, Name = 'ZM_UPLOAD_TIMEOUT', Value = '120', Type = 'integer', DefaultValue = '120', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long to allow the transfer to take for each file', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the maximum inactivity timeout (in seconds) that should be tolerated before ZoneMinder determines that the transfer has failed and closes down the connection.', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 101, Name = 'ZM_UPLOAD_FTP_PASSIVE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Use passive ftp when uploading', Help = 'If your computer is behind a firewall or proxy you may need to set FTP to passive mode. In fact for simple transfers it makes little sense to do otherwise anyway but you can set this to \'No\' if you wish.', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 102, Name = 'ZM_UPLOAD_FTP_DEBUG', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Switch ftp debugging on', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. If you are having (or expecting) troubles with uploading events then setting this to \'yes\' permits additional information to be included in the zmfilter log file.', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 103, Name = 'ZM_UPLOAD_DEBUG', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Switch upload debugging on', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote server. If you are having (or expecting) troubles with uploading events then setting this to \'yes\' permits additional information to be generated by the underlying transfer modules and included in the logs.', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 104, Name = 'ZM_OPT_EMAIL', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should ZoneMinder email you details of events that match corresponding filters', Help = 'In ZoneMinder you can create event filters that specify whether events that match certain criteria should have their details emailed to you at a designated email address. This will allow you to be notified of events as soon as they occur and also to quickly view the events directly. This option specifies whether this functionality should be available. The email created with this option can be any size and is intended to be sent to a regular email reader rather than a mobile device.', Category = 'mail', Readonly = '0', Requires = ''; +insert into Config set Id = 105, Name = 'ZM_EMAIL_ADDRESS', Value = '', Type = 'string', DefaultValue = '', Hint = 'your.name@your.domain', Pattern = '(?^:^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$)', Format = ' $1\@$2 ', Prompt = 'The email address to send matching event details to', Help = 'This option is used to define the email address that any events that match the appropriate filters will be sent to.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1'; +insert into Config set Id = 106, Name = 'ZM_EMAIL_TEXT', Value = 'subject = \"ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)\" +body = \" +Hello, + +An alarm has been detected on your installation of the ZoneMinder. + +The details are as follows :- + + Monitor : %MN% + Event Id : %EI% + Length : %EL% + Frames : %EF% (%EFA%) + Scores : t%EST% m%ESM% a%ESA% + +This alarm was matched by the %FN% filter and can be viewed at %EPS% + +ZoneMinder\"', Type = 'text', DefaultValue = 'subject = \"ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)\" +body = \" +Hello, + +An alarm has been detected on your installation of the ZoneMinder. + +The details are as follows :- + + Monitor : %MN% + Event Id : %EI% + Length : %EL% + Frames : %EF% (%EFA%) + Scores : t%EST% m%ESM% a%ESA% + +This alarm was matched by the %FN% filter and can be viewed at %EPS% + +ZoneMinder\"', Hint = 'free text', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The text of the email used to send matching event details', Help = 'This option is used to define the content of the email that is sent for any events that match the appropriate filters.', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1'; +insert into Config set Id = 107, Name = 'ZM_EMAIL_SUBJECT', Value = 'ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)', Type = 'string', DefaultValue = 'ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The subject of the email used to send matching event details', Help = 'This option is used to define the subject of the email that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1'; +insert into Config set Id = 108, Name = 'ZM_EMAIL_BODY', Value = ' +Hello, + +An alarm has been detected on your installation of the ZoneMinder. + +The details are as follows :- + + Monitor : %MN% + Event Id : %EI% + Length : %EL% + Frames : %EF% (%EFA%) + Scores : t%EST% m%ESM% a%ESA% + +This alarm was matched by the %FN% filter and can be viewed at %EPS% + +ZoneMinder', Type = 'text', DefaultValue = ' +Hello, + +An alarm has been detected on your installation of the ZoneMinder. + +The details are as follows :- + + Monitor : %MN% + Event Id : %EI% + Length : %EL% + Frames : %EF% (%EFA%) + Scores : t%EST% m%ESM% a%ESA% + +This alarm was matched by the %FN% filter and can be viewed at %EPS% + +ZoneMinder', Hint = 'free text', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The body of the email used to send matching event details', Help = 'This option is used to define the content of the email that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1'; +insert into Config set Id = 109, Name = 'ZM_OPT_MESSAGE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should ZoneMinder message you with details of events that match corresponding filters', Help = 'In ZoneMinder you can create event filters that specify whether events that match certain criteria should have their details sent to you at a designated short message email address. This will allow you to be notified of events as soon as they occur. This option specifies whether this functionality should be available. The email created by this option will be brief and is intended to be sent to an SMS gateway or a minimal mail reader such as a mobile device or phone rather than a regular email reader.', Category = 'mail', Readonly = '0', Requires = ''; +insert into Config set Id = 110, Name = 'ZM_MESSAGE_ADDRESS', Value = '', Type = 'string', DefaultValue = '', Hint = 'your.name@your.domain', Pattern = '(?^:^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$)', Format = ' $1\@$2 ', Prompt = 'The email address to send matching event details to', Help = 'This option is used to define the short message email address that any events that match the appropriate filters will be sent to.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1'; +insert into Config set Id = 111, Name = 'ZM_MESSAGE_TEXT', Value = 'subject = \"ZoneMinder: Alarm - %MN%-%EI%\" +body = \"ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.\"', Type = 'text', DefaultValue = 'subject = \"ZoneMinder: Alarm - %MN%-%EI%\" +body = \"ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.\"', Hint = 'free text', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The text of the message used to send matching event details', Help = 'This option is used to define the content of the message that is sent for any events that match the appropriate filters.', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1'; +insert into Config set Id = 112, Name = 'ZM_MESSAGE_SUBJECT', Value = 'ZoneMinder: Alarm - %MN%-%EI%', Type = 'string', DefaultValue = 'ZoneMinder: Alarm - %MN%-%EI%', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The subject of the message used to send matching event details', Help = 'This option is used to define the subject of the message that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1'; +insert into Config set Id = 113, Name = 'ZM_MESSAGE_BODY', Value = 'ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.', Type = 'text', DefaultValue = 'ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.', Hint = 'free text', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The body of the message used to send matching event details', Help = 'This option is used to define the content of the message that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1'; +insert into Config set Id = 114, Name = 'ZM_NEW_MAIL_MODULES', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Use a newer perl method to send emails', Help = 'Traditionally ZoneMinder has used the MIME::Entity perl module to construct and send notification emails and messages. Some people have reported problems with this module not being present at all or flexible enough for their needs. If you are one of those people this option allows you to select a new mailing method using MIME::Lite and Net::SMTP instead. This method was contributed by Ross Melin and should work for everyone but has not been extensively tested so currently is not selected by default.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1'; +insert into Config set Id = 115, Name = 'ZM_EMAIL_HOST', Value = 'localhost', Type = 'string', DefaultValue = 'localhost', Hint = 'host.your.domain', Pattern = '(?^:^([a-zA-Z0-9_.-]+)$)', Format = ' $1 ', Prompt = 'The host address of your SMTP mail server', Help = 'If you have chosen SMTP as the method by which to send notification emails or messages then this option allows you to choose which SMTP server to use to send them. The default of localhost may work if you have the sendmail, exim or a similar daemon running however you may wish to enter your ISP\'s SMTP mail server here.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1'; +insert into Config set Id = 116, Name = 'ZM_FROM_EMAIL', Value = '', Type = 'string', DefaultValue = '', Hint = 'your.name@your.domain', Pattern = '(?^:^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$)', Format = ' $1\@$2 ', Prompt = 'The email address you wish your event notifications to originate from', Help = 'The emails or messages that will be sent to you informing you of events can appear to come from a designated email address to help you with mail filtering etc. An address of something like ZoneMinder@your.domain is recommended.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1'; +insert into Config set Id = 117, Name = 'ZM_URL', Value = '', Type = 'string', DefaultValue = '', Hint = 'http://host.your.domain/', Pattern = '(?^:^(?:http://)?(.+)$)', Format = ' \"http://\".$1 ', Prompt = 'The URL of your ZoneMinder installation', Help = 'The emails or messages that will be sent to you informing you of events can include a link to the events themselves for easy viewing. If you intend to use this feature then set this option to the url of your installation as it would appear from where you read your email, e.g. http://host.your.domain/zm.php.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1'; +insert into Config set Id = 118, Name = 'ZM_MAX_RESTART_DELAY', Value = '600', Type = 'integer', DefaultValue = '600', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Maximum delay (in seconds) for daemon restart attempts.', Help = 'The zmdc (zm daemon control) process controls when processeses are started or stopped and will attempt to restart any that fail. If a daemon fails frequently then a delay is introduced between each restart attempt. If the daemon stills fails then this delay is increased to prevent extra load being placed on the system by continual restarts. This option controls what this maximum delay is.', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 119, Name = 'ZM_WATCH_CHECK_INTERVAL', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often to check the capture daemons have not locked up', Help = 'The zmwatch daemon checks the image capture performance of the capture daemons to ensure that they have not locked up (rarely a sync error may occur which blocks indefinately). This option determines how often the daemons are checked.', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 120, Name = 'ZM_WATCH_MAX_DELAY', Value = '5', Type = 'decimal', DefaultValue = '5', Hint = 'decimal', Pattern = '(?^:^(\d+(?:\.\d+)?)$)', Format = ' $1 ', Prompt = 'The maximum delay allowed since the last captured image', Help = 'The zmwatch daemon checks the image capture performance of the capture daemons to ensure that they have not locked up (rarely a sync error may occur which blocks indefinately). This option determines the maximum delay to allow since the last captured frame. The daemon will be restarted if it has not captured any images after this period though the actual restart may take slightly longer in conjunction with the check interval value above.', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 121, Name = 'ZM_RUN_AUDIT', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Run zmaudit to check data consistency', Help = 'The zmaudit daemon exists to check that the saved information in the database and on the filesystem match and are consistent with each other. If an error occurs or if you are using \'fast deletes\' it may be that database records are deleted but files remain. In this case, and similar, zmaudit will remove redundant information to synchronise the two data stores. This option controls whether zmaudit is run in the background and performs these checks and fixes continuously. This is recommended for most systems however if you have a very large number of events the process of scanning the database and filesystem may take a long time and impact performance. In this case you may prefer to not have zmaudit running unconditionally and schedule occasional checks at other, more convenient, times.', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 122, Name = 'ZM_AUDIT_CHECK_INTERVAL', Value = '900', Type = 'integer', DefaultValue = '900', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often to check database and filesystem consistency', Help = 'The zmaudit daemon exists to check that the saved information in the database and on the filesystem match and are consistent with each other. If an error occurs or if you are using \'fast deletes\' it may be that database records are deleted but files remain. In this case, and similar, zmaudit will remove redundant information to synchronise the two data stores. The default check interval of 900 seconds (15 minutes) is fine for most systems however if you have a very large number of events the process of scanning the database and filesystem may take a long time and impact performance. In this case you may prefer to make this interval much larger to reduce the impact on your system. This option determines how often these checks are performed.', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 123, Name = 'ZM_FORCED_ALARM_SCORE', Value = '255', Type = 'integer', DefaultValue = '255', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Score to give forced alarms', Help = 'The \'zmu\' utility can be used to force an alarm on a monitor rather than rely on the motion detection algorithms. This option determines what score to give these alarms to distinguish them from regular ones. It must be 255 or less.', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 124, Name = 'ZM_BULK_FRAME_INTERVAL', Value = '100', Type = 'integer', DefaultValue = '100', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often a bulk frame should be written to the database', Help = 'Traditionally ZoneMinder writes an entry into the Frames database table for each frame that is captured and saved. This works well in motion detection scenarios but when in a DVR situation (\'Record\' or \'Mocord\' mode) this results in a huge number of frame writes and a lot of database and disk bandwidth for very little additional information. Setting this to a non-zero value will enabled ZoneMinder to group these non-alarm frames into one \'bulk\' frame entry which saves a lot of bandwidth and space. The only disadvantage of this is that timing information for individual frames is lost but in constant frame rate situations this is usually not significant. This setting is ignored in Modect mode and individual frames are still written if an alarm occurs in Mocord mode also.', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 125, Name = 'ZM_EVENT_CLOSE_MODE', Value = 'idle', Type = 'string', DefaultValue = 'idle', Hint = 'time|idle|alarm', Pattern = '(?^i:^([tia]))', Format = ' ($1 =~ /^t/) ? \"time\" : ($1 =~ /^i/ ? \"idle\" : \"time\" ) ', Prompt = 'When continuous events are closed.', Help = 'When a monitor is running in a continuous recording mode (Record or Mocord) events are usually closed after a fixed period of time (the section length). However in Mocord mode it is possible that motion detection may occur near the end of a section. This option controls what happens when an alarm occurs in Mocord mode. The \'time\' setting means that the event will be closed at the end of the section regardless of alarm activity. The \'idle\' setting means that the event will be closed at the end of the section if there is no alarm activity occuring at the time otherwise it will be closed once the alarm is over meaning the event may end up being longer than the normal section length. The \'alarm\' setting means that if an alarm occurs during the event, the event will be closed once the alarm is over regardless of when this occurs. This has the effect of limiting the number of alarms to one per event and the events will be shorter than the section length if an alarm has occurred.', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 126, Name = 'ZM_FORCE_CLOSE_EVENTS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Close events at section ends.', Help = 'When a monitor is running in a continuous recording mode (Record or Mocord) events are usually closed after a fixed period of time (the section length). However in Mocord mode it is possible that motion detection may occur near the end of a section and ordinarily this will prevent the event being closed until the motion has ceased. Switching this option on will force the event closed at the specified time regardless of any motion activity.', Category = 'hidden', Readonly = '0', Requires = ''; +insert into Config set Id = 127, Name = 'ZM_CREATE_ANALYSIS_IMAGES', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Create analysed alarm images with motion outlined', Help = 'By default during an alarm ZoneMinder records both the raw captured image and one that has been analysed and had areas where motion was detected outlined. This can be very useful during zone configuration or in analysing why events occured. However it also incurs some overhead and in a stable system may no longer be necessary. This parameter allows you to switch the generation of these images off.', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 128, Name = 'ZM_WEIGHTED_ALARM_CENTRES', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Use a weighted algorithm to calculate the centre of an alarm', Help = 'ZoneMinder will always calculate the centre point of an alarm in a zone to give some indication of where on the screen it is. This can be used by the experimental motion tracking feature or your own custom extensions. In the alarmed or filtered pixels mode this is a simple midpoint between the extents of the detected pxiesl. However in the blob method this can instead be calculated using weighted pixel locations to give more accurate positioning for irregularly shaped blobs. This method, while more precise is also slower and so is turned off by default.', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 129, Name = 'ZM_EVENT_IMAGE_DIGITS', Value = '3', Type = 'integer', DefaultValue = '3', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How many significant digits are used in event image numbering', Help = 'As event images are captured they are stored to the filesystem with a numerical index. By default this index has three digits so the numbers start 001, 002 etc. This works works for most scenarios as events with more than 999 frames are rarely captured. However if you have extremely long events and use external applications then you may wish to increase this to ensure correct sorting of images in listings etc. Warning, increasing this value on a live system may render existing events unviewable as the event will have been saved with the previous scheme. Decreasing this value should have no ill effects.', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 130, Name = 'ZM_DEFAULT_ASPECT_RATIO', Value = '4:3', Type = 'string', DefaultValue = '4:3', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The default width:height aspect ratio used in monitors', Help = 'When specifying the dimensions of monitors you can click a checkbox to ensure that the width stays in the correct ratio to the height, or vice versa. This setting allows you to indicate what the ratio of these settings should be. This should be specified in the format : and the default of 4:3 normally be acceptable but 11:9 is another common setting. If the checkbox is not clicked when specifying monitor dimensions this setting has no effect.', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 131, Name = 'ZM_USER_SELF_EDIT', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Allow unprivileged users to change their details', Help = 'Ordinarily only users with system edit privilege are able to change users details. Switching this option on allows ordinary users to change their passwords and their language settings', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 132, Name = 'ZM_OPT_FRAME_SERVER', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should analysis farm out the writing of images to disk', Help = 'In some circumstances it is possible for a slow disk to take so long writing images to disk that it causes the analysis daemon to fall behind especially during high frame rate events. Setting this option to yes enables a frame server daemon (zmf) which will be sent the images from the analysis daemon and will do the actual writing of images itself freeing up the analysis daemon to get on with other things. Should this transmission fail or other permanent or transient error occur, this function will fall back to the analysis daemon.', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 133, Name = 'ZM_FRAME_SOCKET_SIZE', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Specify the frame server socket buffer size if non-standard', Help = 'For large captured images it is possible for the writes from the analysis daemon to the frame server to fail as the amount to be written exceeds the default buffer size. While the images are then written by the analysis daemon so no data is lost, it defeats the object of the frame server daemon in the first place. You can use this option to indicate that a larger buffer size should be used. Note that you may have to change the existing maximum socket buffer size on your system via sysctl (or in /proc/sys/net/core/wmem_max) to allow this new size to be set. Alternatively you can change the default buffer size on your system in the same way in which case that will be used with no change necessary in this option', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_FRAME_SERVER=1'; +insert into Config set Id = 134, Name = 'ZM_OPT_CONTROL', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Support controllable (e.g. PTZ) cameras', Help = 'ZoneMinder includes limited support for controllable cameras. A number of sample protocols are included and others can easily be added. If you wish to control your cameras via ZoneMinder then select this option otherwise if you only have static cameras or use other control methods then leave this option off.', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 135, Name = 'ZM_OPT_TRIGGERS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Interface external event triggers via socket or device files', Help = 'ZoneMinder can interact with external systems which prompt or cancel alarms. This is done via the zmtrigger.pl script. This option indicates whether you want to use these external triggers. Most people will say no here.', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 136, Name = 'ZM_CHECK_FOR_UPDATES', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Check with zoneminder.com for updated versions', Help = 'From ZoneMinder version 1.17.0 onwards new versions are expected to be more frequent. To save checking manually for each new version ZoneMinder can check with the zoneminder.com website to determine the most recent release. These checks are infrequent, about once per week, and no personal or system information is transmitted other than your current version number. If you do not wish these checks to take place or your ZoneMinder system has no internet access you can switch these check off with this configuration variable', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 137, Name = 'ZM_UPDATE_CHECK_PROXY', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Proxy url if required to access zoneminder.com', Help = 'If you use a proxy to access the internet then ZoneMinder needs to know so it can access zoneminder.com to check for updates. If you do use a proxy enter the full proxy url here in the form of http://:/', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 138, Name = 'ZM_SHM_KEY', Value = '0x7a6d0000', Type = 'hexadecimal', DefaultValue = '0x7a6d0000', Hint = 'hexadecimal', Pattern = '(?^:^(?:0x)?([0-9a-f]{1,8})$)', Format = ' \"0x\".$1 ', Prompt = 'Shared memory root key to use', Help = 'ZoneMinder uses shared memory to speed up communication between modules. To identify the right area to use shared memory keys are used. This option controls what the base key is, each monitor will have it\'s Id or\'ed with this to get the actual key used. You will not normally need to change this value unless it clashes with another instance of ZoneMinder on the same machine. Only the first four hex digits are used, the lower four will be masked out and ignored.', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 139, Name = 'ZM_WEB_REFRESH_METHOD', Value = 'javascript', Type = 'string', DefaultValue = 'javascript', Hint = 'javascript|http', Pattern = '(?^i:^([jh]))', Format = ' $1 =~ /^j/ ? \"javascript\" : \"http\" ', Prompt = 'What method windows should use to refresh themselves', Help = 'Many windows in Javascript need to refresh themselves to keep their information current. This option determines what method they should use to do this. Choosing \'javascript\' means that each window will have a short JavaScript statement in with a timer to prompt the refresh. This is the most compatible method. Choosing \'http\' means the refresh instruction is put in the HTTP header. This is a cleaner method but refreshes are interrupted or cancelled when a link in the window is clicked meaning that the window will no longer refresh and this would have to be done manually.', Category = 'hidden', Readonly = '0', Requires = ''; +insert into Config set Id = 140, Name = 'ZM_WEB_EVENT_SORT_FIELD', Value = 'DateTime', Type = 'string', DefaultValue = 'DateTime', Hint = 'Id|Name|Cause|MonitorName|DateTime|Length|Frames|AlarmFrames|TotScore|AvgScore|MaxScore', Pattern = '(?^:.)', Format = ' $1 ', Prompt = 'Default field the event lists are sorted by', Help = 'Events in lists can be initially ordered in any way you want. This option controls what field is used to sort them. You can modify this ordering from filters or by clicking on headings in the lists themselves. Bear in mind however that the \'Prev\' and \'Next\' links, when scrolling through events, relate to the ordering in the lists and so not always to time based ordering.', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 141, Name = 'ZM_WEB_EVENT_SORT_ORDER', Value = 'asc', Type = 'string', DefaultValue = 'asc', Hint = 'asc|desc', Pattern = '(?^i:^([ad]))', Format = ' $1 =~ /^a/i ? \"asc\" : \"desc\" ', Prompt = 'Default order the event lists are sorted by', Help = 'Events in lists can be initially ordered in any way you want. This option controls what order (ascending or descending) is used to sort them. You can modify this ordering from filters or by clicking on headings in the lists themselves. Bear in mind however that the \'Prev\' and \'Next\' links, when scrolling through events, relate to the ordering in the lists and so not always to time based ordering.', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 142, Name = 'ZM_WEB_EVENTS_PER_PAGE', Value = '25', Type = 'integer', DefaultValue = '25', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How many events to list per page in paged mode', Help = 'In the event list view you can either list all events or just a page at a time. This option controls how many events are listed per page in paged mode and how often to repeat the column headers in non-paged mode.', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 143, Name = 'ZM_WEB_LIST_THUMBS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Display mini-thumbnails of event images in event lists', Help = 'Ordinarily the event lists just display text details of the events to save space and time. By switching this option on you can also display small thumbnails to help you identify events of interest. The size of these thumbnails is controlled by the following two options.', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 144, Name = 'ZM_WEB_LIST_THUMB_WIDTH', Value = '48', Type = 'integer', DefaultValue = '48', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'The width of the thumbnails that appear in the event lists', Help = 'This options controls the width of the thumbnail images that appear in the event lists. It should be fairly small to fit in with the rest of the table. If you prefer you can specify a height instead in the next option but you should only use one of the width or height and the other option should be set to zero. If both width and height are specified then width will be used and height ignored.', Category = 'web', Readonly = '0', Requires = 'ZM_WEB_LIST_THUMBS=1'; +insert into Config set Id = 145, Name = 'ZM_WEB_LIST_THUMB_HEIGHT', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'The height of the thumbnails that appear in the event lists', Help = 'This options controls the height of the thumbnail images that appear in the event lists. It should be fairly small to fit in with the rest of the table. If you prefer you can specify a width instead in the previous option but you should only use one of the width or height and the other option should be set to zero. If both width and height are specified then width will be used and height ignored.', Category = 'web', Readonly = '0', Requires = 'ZM_WEB_LIST_THUMBS=1'; +insert into Config set Id = 146, Name = 'ZM_WEB_USE_OBJECT_TAGS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Wrap embed in object tags for media content', Help = 'There are two methods of including media content in web pages. The most common way is use the EMBED tag which is able to give some indication of the type of content. However this is not a standard part of HTML. The official method is to use OBJECT tags which are able to give more information allowing the correct media viewers etc to be loaded. However these are less widely supported and content may be specifically tailored to a particular platform or player. This option controls whether media content is enclosed in EMBED tags only or whether, where appropriate, it is additionally wrapped in OBJECT tags. Currently OBJECT tags are only used in a limited number of circumstances but they may become more widespread in the future. It is suggested that you leave this option on unless you encounter problems playing some content.', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 147, Name = 'ZM_WEB_H_REFRESH_MAIN', Value = '300', Type = 'integer', DefaultValue = '300', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the main console window should refresh itself', Help = 'The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 148, Name = 'ZM_WEB_H_REFRESH_CYCLE', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the cycle watch window swaps to the next monitor', Help = 'The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 149, Name = 'ZM_WEB_H_REFRESH_IMAGE', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the watched image is refreshed (if not streaming)', Help = 'The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 150, Name = 'ZM_WEB_H_REFRESH_STATUS', Value = '3', Type = 'integer', DefaultValue = '3', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the status refreshes itself in the watch window', Help = 'The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 151, Name = 'ZM_WEB_H_REFRESH_EVENTS', Value = '30', Type = 'integer', DefaultValue = '30', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the event listing is refreshed in the watch window', Help = 'The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 152, Name = 'ZM_WEB_H_CAN_STREAM', Value = 'auto', Type = 'string', DefaultValue = 'auto', Hint = 'auto|yes|no', Pattern = '(?^i:^([ayn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : ($1 =~ /^n/ ? \"no\" : \"auto\" ) ', Prompt = 'Override the automatic detection of browser streaming capability', Help = '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.', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 153, Name = 'ZM_WEB_H_STREAM_METHOD', Value = 'jpeg', Type = 'string', DefaultValue = 'jpeg', Hint = 'mpeg|jpeg', Pattern = '(?^i:^([mj]))', Format = ' $1 =~ /^m/ ? \"mpeg\" : \"jpeg\" ', Prompt = 'Which method should be used to send video streams to your browser.', Help = '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', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 154, Name = 'ZM_WEB_H_DEFAULT_SCALE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|33|50|75|100|150|200|300|400', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default scaling factor applied to \'live\' or \'event\' views is (%)', Help = '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.', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 155, Name = 'ZM_WEB_H_DEFAULT_RATE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|50|100|150|200|400|1000|2500|5000|10000', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default replay rate factor applied to \'event\' views is (%)', Help = '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.', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 156, Name = 'ZM_WEB_H_VIDEO_BITRATE', Value = '150000', Type = 'integer', DefaultValue = '150000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the bitrate of the video encoded stream should be set to', Help = '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.', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 157, Name = 'ZM_WEB_H_VIDEO_MAXFPS', Value = '15', Type = 'integer', DefaultValue = '15', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the maximum frame rate for streamed video should be', Help = '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.', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 158, Name = 'ZM_WEB_H_SCALE_THUMBS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Scale thumbnails in events, bandwidth versus cpu in rescaling', Help = '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.', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 159, Name = 'ZM_WEB_H_EVENTS_VIEW', Value = 'events', Type = 'string', DefaultValue = 'events', Hint = 'events|timeline', Pattern = '(?^i:^([lt]))', Format = ' $1 =~ /^e/ ? \"events\" : \"timeline\" ', Prompt = 'What the default view of multiple events should be.', Help = 'Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 160, Name = 'ZM_WEB_H_SHOW_PROGRESS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Show the progress of replay in event view.', Help = 'When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 161, Name = 'ZM_WEB_H_AJAX_TIMEOUT', Value = '3000', Type = 'integer', DefaultValue = '3000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long to wait for Ajax request responses (ms)', Help = '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.', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 162, Name = 'ZM_WEB_M_REFRESH_MAIN', Value = '300', Type = 'integer', DefaultValue = '300', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the main console window should refresh itself', Help = 'The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 163, Name = 'ZM_WEB_M_REFRESH_CYCLE', Value = '20', Type = 'integer', DefaultValue = '20', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the cycle watch window swaps to the next monitor', Help = 'The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 164, Name = 'ZM_WEB_M_REFRESH_IMAGE', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the watched image is refreshed (if not streaming)', Help = 'The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 165, Name = 'ZM_WEB_M_REFRESH_STATUS', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the status refreshes itself in the watch window', Help = 'The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 166, Name = 'ZM_WEB_M_REFRESH_EVENTS', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the event listing is refreshed in the watch window', Help = 'The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 167, Name = 'ZM_WEB_M_CAN_STREAM', Value = 'auto', Type = 'string', DefaultValue = 'auto', Hint = 'auto|yes|no', Pattern = '(?^i:^([ayn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : ($1 =~ /^n/ ? \"no\" : \"auto\" ) ', Prompt = 'Override the automatic detection of browser streaming capability', Help = '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.', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 168, Name = 'ZM_WEB_M_STREAM_METHOD', Value = 'jpeg', Type = 'string', DefaultValue = 'jpeg', Hint = 'mpeg|jpeg', Pattern = '(?^i:^([mj]))', Format = ' $1 =~ /^m/ ? \"mpeg\" : \"jpeg\" ', Prompt = 'Which method should be used to send video streams to your browser.', Help = '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', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 169, Name = 'ZM_WEB_M_DEFAULT_SCALE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|33|50|75|100|150|200|300|400', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default scaling factor applied to \'live\' or \'event\' views is (%)', Help = '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.', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 170, Name = 'ZM_WEB_M_DEFAULT_RATE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|50|100|150|200|400|1000|2500|5000|10000', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default replay rate factor applied to \'event\' views is (%)', Help = '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.', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 171, Name = 'ZM_WEB_M_VIDEO_BITRATE', Value = '75000', Type = 'integer', DefaultValue = '75000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the bitrate of the video encoded stream should be set to', Help = '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.', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 172, Name = 'ZM_WEB_M_VIDEO_MAXFPS', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the maximum frame rate for streamed video should be', Help = '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.', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 173, Name = 'ZM_WEB_M_SCALE_THUMBS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Scale thumbnails in events, bandwidth versus cpu in rescaling', Help = '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.', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 174, Name = 'ZM_WEB_M_EVENTS_VIEW', Value = 'events', Type = 'string', DefaultValue = 'events', Hint = 'events|timeline', Pattern = '(?^i:^([lt]))', Format = ' $1 =~ /^e/ ? \"events\" : \"timeline\" ', Prompt = 'What the default view of multiple events should be.', Help = 'Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 175, Name = 'ZM_WEB_M_SHOW_PROGRESS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Show the progress of replay in event view.', Help = 'When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 176, Name = 'ZM_WEB_M_AJAX_TIMEOUT', Value = '5000', Type = 'integer', DefaultValue = '5000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long to wait for Ajax request responses (ms)', Help = '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.', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 177, Name = 'ZM_WEB_L_REFRESH_MAIN', Value = '300', Type = 'integer', DefaultValue = '300', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the main console window should refresh itself', Help = 'The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 178, Name = 'ZM_WEB_L_REFRESH_CYCLE', Value = '30', Type = 'integer', DefaultValue = '30', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the cycle watch window swaps to the next monitor', Help = 'The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 179, Name = 'ZM_WEB_L_REFRESH_IMAGE', Value = '15', Type = 'integer', DefaultValue = '15', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the watched image is refreshed (if not streaming)', Help = 'The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 180, Name = 'ZM_WEB_L_REFRESH_STATUS', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the status refreshes itself in the watch window', Help = 'The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 181, Name = 'ZM_WEB_L_REFRESH_EVENTS', Value = '180', Type = 'integer', DefaultValue = '180', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the event listing is refreshed in the watch window', Help = 'The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 182, Name = 'ZM_WEB_L_CAN_STREAM', Value = 'auto', Type = 'string', DefaultValue = 'auto', Hint = 'auto|yes|no', Pattern = '(?^i:^([ayn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : ($1 =~ /^n/ ? \"no\" : \"auto\" ) ', Prompt = 'Override the automatic detection of browser streaming capability', Help = '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.', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 183, Name = 'ZM_WEB_L_STREAM_METHOD', Value = 'jpeg', Type = 'string', DefaultValue = 'jpeg', Hint = 'mpeg|jpeg', Pattern = '(?^i:^([mj]))', Format = ' $1 =~ /^m/ ? \"mpeg\" : \"jpeg\" ', Prompt = 'Which method should be used to send video streams to your browser.', Help = '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', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 184, Name = 'ZM_WEB_L_DEFAULT_SCALE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|33|50|75|100|150|200|300|400', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default scaling factor applied to \'live\' or \'event\' views is (%)', Help = '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.', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 185, Name = 'ZM_WEB_L_DEFAULT_RATE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|50|100|150|200|400|1000|2500|5000|10000', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default replay rate factor applied to \'event\' views is (%)', Help = '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.', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 186, Name = 'ZM_WEB_L_VIDEO_BITRATE', Value = '25000', Type = 'integer', DefaultValue = '25000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the bitrate of the video encoded stream should be set to', Help = '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.', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 187, Name = 'ZM_WEB_L_VIDEO_MAXFPS', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the maximum frame rate for streamed video should be', Help = '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.', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 188, Name = 'ZM_WEB_L_SCALE_THUMBS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Scale thumbnails in events, bandwidth versus cpu in rescaling', Help = '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.', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 189, Name = 'ZM_WEB_L_EVENTS_VIEW', Value = 'events', Type = 'string', DefaultValue = 'events', Hint = 'events|timeline', Pattern = '(?^i:^([lt]))', Format = ' $1 =~ /^e/ ? \"events\" : \"timeline\" ', Prompt = 'What the default view of multiple events should be.', Help = 'Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 190, Name = 'ZM_WEB_L_SHOW_PROGRESS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Show the progress of replay in event view.', Help = 'When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 191, Name = 'ZM_WEB_L_AJAX_TIMEOUT', Value = '10000', Type = 'integer', DefaultValue = '10000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long to wait for Ajax request responses (ms)', Help = '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.', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 192, Name = 'ZM_WEB_P_CAN_STREAM', Value = 'auto', Type = 'string', DefaultValue = 'auto', Hint = 'auto|yes|no', Pattern = '(?^i:^([ayn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : ($1 =~ /^n/ ? \"no\" : \"auto\" ) ', Prompt = 'Override the automatic detection of browser streaming capability', Help = '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.', Category = 'phoneband', Readonly = '0', Requires = ''; +insert into Config set Id = 193, Name = 'ZM_WEB_P_STREAM_METHOD', Value = 'jpeg', Type = 'string', DefaultValue = 'jpeg', Hint = 'mpeg|jpeg', Pattern = '(?^i:^([mj]))', Format = ' $1 =~ /^m/ ? \"mpeg\" : \"jpeg\" ', Prompt = 'Which method should be used to send video streams to your browser.', Help = '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', Category = 'phoneband', Readonly = '0', Requires = ''; +insert into Config set Id = 194, Name = 'ZM_WEB_P_DEFAULT_SCALE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|33|50|75|100|150|200|300|400', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default scaling factor applied to \'live\' or \'event\' views is (%)', Help = '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.', Category = 'phoneband', Readonly = '0', Requires = ''; +insert into Config set Id = 195, Name = 'ZM_WEB_P_DEFAULT_RATE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|50|100|150|200|400|1000|2500|5000|10000', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default replay rate factor applied to \'event\' views is (%)', Help = '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.', Category = 'phoneband', Readonly = '0', Requires = ''; +insert into Config set Id = 196, Name = 'ZM_WEB_P_VIDEO_BITRATE', Value = '8000', Type = 'integer', DefaultValue = '8000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the bitrate of the video encoded stream should be set to', Help = '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.', Category = 'phoneband', Readonly = '0', Requires = ''; +insert into Config set Id = 197, Name = 'ZM_WEB_P_VIDEO_MAXFPS', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the maximum frame rate for streamed video should be', Help = '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.', Category = 'phoneband', Readonly = '0', Requires = ''; +insert into Config set Id = 198, Name = 'ZM_WEB_P_SCALE_THUMBS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Scale thumbnails in events, bandwidth versus cpu in rescaling', Help = '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.', Category = 'phoneband', Readonly = '0', Requires = ''; +insert into Config set Id = 199, Name = 'ZM_WEB_P_AJAX_TIMEOUT', Value = '10000', Type = 'integer', DefaultValue = '10000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long to wait for Ajax request responses (ms)', Help = '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.', Category = 'phoneband', Readonly = '0', Requires = ''; +insert into Config set Id = 200, Name = 'ZM_DYN_LAST_VERSION', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'What the last version of ZoneMinder recorded from zoneminder.com is', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; +insert into Config set Id = 201, Name = 'ZM_DYN_CURR_VERSION', Value = '1.25.0', Type = 'string', DefaultValue = '1.25.0', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'What the effective current version of ZoneMinder is, might be different from actual if versions ignored', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; +insert into Config set Id = 202, Name = 'ZM_DYN_DB_VERSION', Value = '1.25.0', Type = 'string', DefaultValue = '1.25.0', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'What the version of the database is, from zmupdate', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; +insert into Config set Id = 203, Name = 'ZM_DYN_LAST_CHECK', Value = '', Type = 'integer', DefaultValue = '', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'When the last check for version from zoneminder.com was', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; +insert into Config set Id = 204, Name = 'ZM_DYN_NEXT_REMINDER', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'When the earliest time to remind about versions will be', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; +insert into Config set Id = 205, Name = 'ZM_DYN_DONATE_REMINDER_TIME', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'When the earliest time to remind about donations will be', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; +insert into Config set Id = 206, Name = 'ZM_DYN_SHOW_DONATE_REMINDER', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Remind about donations or not', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; +insert into Config set Id = 207, Name = 'ZM_EYEZM_DEBUG', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Switch additional debugging on for eyeZm Plugin', Help = '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', Category = 'eyeZm', Readonly = '0', Requires = ''; +insert into Config set Id = 208, Name = 'ZM_EYEZM_LOG_TO_FILE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'When eyeZm Debugging is enabled, enabling this logs output to it\'s own file', Help = '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.', Category = 'eyeZm', Readonly = '0', Requires = ''; +insert into Config set Id = 209, Name = 'ZM_EYEZM_LOG_FILE', Value = '/var/log/zm/zm_xml.log', Type = 'string', DefaultValue = '/var/log/zm/zm_xml.log', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Default filename to use when logging eyeZm Output and EYEZM_LOG_TO_FILE is enabled', Help = 'This file will contain it\'s own output from the eyeZm Plugin when EYEZM_LOG_TO_FILE and EYEZM_DEBUG are both enabled', Category = 'eyeZm', Readonly = '0', Requires = ''; +insert into Config set Id = 210, Name = 'ZM_EYEZM_EVENT_VCODEC', Value = 'mpeg4', Type = 'string', DefaultValue = 'mpeg4', Hint = 'mpeg4|h264', Pattern = '(?^i:^([mh]))', Format = ' $1 =~ /^m/ ? \"mpeg4\" : \"h264\" ', Prompt = 'Default video-codec to use for encoding events', Help = '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+).', Category = 'eyeZm', Readonly = '0', Requires = ''; +insert into Config set Id = 211, Name = 'ZM_EYEZM_FEED_VCODEC', Value = 'mjpeg', Type = 'string', DefaultValue = 'mjpeg', Hint = 'mjpeg|h264', Pattern = '(?^i:^([mh]))', Format = ' $1 =~ /^m/ ? \"mjpeg\" : \"h264\" ', Prompt = 'Default video-codec to use for streaming the live feed', Help = '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.', Category = 'eyeZm', Readonly = '0', Requires = ''; +insert into Config set Id = 212, Name = 'ZM_EYEZM_H264_DEFAULT_BR', Value = '96k', Type = 'string', DefaultValue = '96k', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Default bit-rate to use with FFMPEG for H264 streaming', Help = '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.', Category = 'eyeZm', Readonly = '0', Requires = ''; +insert into Config set Id = 213, Name = 'ZM_EYEZM_H264_DEFAULT_EVBR', Value = '128k', Type = 'string', DefaultValue = '128k', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Default bit-rate to use with FFMPEG for H264 event viewing', Help = '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.', Category = 'eyeZm', Readonly = '0', Requires = ''; +insert into Config set Id = 214, Name = 'ZM_EYEZM_H264_TIMEOUT', Value = '20', Type = 'string', DefaultValue = '20', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Timeout (sec) to wait for H264 stream to start before terminating', Help = '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', Category = 'eyeZm', Readonly = '0', Requires = ''; +insert into Config set Id = 215, Name = 'ZM_EYEZM_SEG_DURATION', Value = '3', Type = 'string', DefaultValue = '3', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Segment duration used for streaming using HTTP-5 Streaming protocol', Help = '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.', Category = 'eyeZm', Readonly = '0', Requires = ''; +insert into Config set Id = 216, Name = 'ZM_PATH_PLUGINS', Value = '/usr/share/zm', Type = 'string', DefaultValue = '/usr/share/zm', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'Path to the plugin folder', Help = '3d-party plugins have to be placed here.', Category = 'paths', Readonly = '0', Requires = ''; +insert into Config set Id = 217, Name = 'ZM_PLUGIN_EXTENSION', Value = '.zmpl', Type = 'string', DefaultValue = '.zmpl', Hint = 'relative/path/to/somewhere', Pattern = '(?^:^((?:[^/].*)?)/?$)', Format = ' $1 ', Prompt = 'Default extension of plugins to found.', Help = 'Default extension of plugins to found.', Category = 'paths', Readonly = '0', Requires = ''; +insert into Config set Id = 218, Name = 'ZM_PLUGINS_CONFIG_PATH', Value = '/usr/share/zm/plugins.conf', Type = 'string', DefaultValue = '/usr/share/zm/plugins.conf', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'Path to the config file for plugins.', Help = 'Path to the config file for plugins.', Category = 'paths', Readonly = '0', Requires = ''; +insert into Config set Id = 219, Name = 'ZM_LOAD_PLUGINS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Load and use 3d-party plugins', Help = '3d-party plugins will be loaded and used for analysing.', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 220, Name = 'ZM_TURNOFF_NATIVE_ANALYSIS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Turn native ZM\'s image analysis possibility off', Help = 'Image analysis with ZM\'s motion detected function will be turned off. Only detection functions from loaded plugins will be used. Note, that if no plugins have be loaded, no detection will be done.', Category = 'config', Readonly = '0', Requires = ''; + diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in new file mode 100644 index 000000000..c68616c04 --- /dev/null +++ b/db/zm_create.sql.in @@ -0,0 +1,623 @@ +-- MySQL dump 10.9 +-- +-- Host: localhost Database: @ZM_DB_NAME@ +-- ------------------------------------------------------ +-- Server version 4.1.16-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Current Database: `@ZM_DB_NAME@` +-- + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `@ZM_DB_NAME@`; + +USE `@ZM_DB_NAME@`; + +-- +-- Table structure for table `Config` +-- + +DROP TABLE IF EXISTS `Config`; +CREATE TABLE `Config` ( + `Id` smallint(5) unsigned NOT NULL default '0', + `Name` varchar(32) NOT NULL default '', + `Value` text NOT NULL, + `Type` tinytext NOT NULL, + `DefaultValue` tinytext, + `Hint` tinytext, + `Pattern` tinytext, + `Format` tinytext, + `Prompt` tinytext, + `Help` text, + `Category` varchar(32) NOT NULL default '', + `Readonly` tinyint(3) unsigned NOT NULL default '0', + `Requires` text, + PRIMARY KEY (`Name`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `ControlPresets` +-- + +DROP TABLE IF EXISTS `ControlPresets`; +CREATE TABLE `ControlPresets` ( + `MonitorId` int(10) unsigned NOT NULL default '0', + `Preset` int(10) unsigned NOT NULL default '0', + `Label` varchar(64) NOT NULL default '', + PRIMARY KEY (`MonitorId`,`Preset`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Controls` +-- + +DROP TABLE IF EXISTS `Controls`; +CREATE TABLE `Controls` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `Type` enum('Local','Remote') NOT NULL default 'Local', + `Protocol` varchar(64) default NULL, + `CanWake` tinyint(3) unsigned NOT NULL default '0', + `CanSleep` tinyint(3) unsigned NOT NULL default '0', + `CanReset` tinyint(3) unsigned NOT NULL default '0', + `CanZoom` tinyint(3) unsigned NOT NULL default '0', + `CanAutoZoom` tinyint(3) unsigned NOT NULL default '0', + `CanZoomAbs` tinyint(3) unsigned NOT NULL default '0', + `CanZoomRel` tinyint(3) unsigned NOT NULL default '0', + `CanZoomCon` tinyint(3) unsigned NOT NULL default '0', + `MinZoomRange` int(10) unsigned default NULL, + `MaxZoomRange` int(10) unsigned default NULL, + `MinZoomStep` int(10) unsigned default NULL, + `MaxZoomStep` int(10) unsigned default NULL, + `HasZoomSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinZoomSpeed` int(10) unsigned default NULL, + `MaxZoomSpeed` int(10) unsigned default NULL, + `CanFocus` tinyint(3) unsigned NOT NULL default '0', + `CanAutoFocus` tinyint(3) unsigned NOT NULL default '0', + `CanFocusAbs` tinyint(3) unsigned NOT NULL default '0', + `CanFocusRel` tinyint(3) unsigned NOT NULL default '0', + `CanFocusCon` tinyint(3) unsigned NOT NULL default '0', + `MinFocusRange` int(10) unsigned default NULL, + `MaxFocusRange` int(10) unsigned default NULL, + `MinFocusStep` int(10) unsigned default NULL, + `MaxFocusStep` int(10) unsigned default NULL, + `HasFocusSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinFocusSpeed` int(10) unsigned default NULL, + `MaxFocusSpeed` int(10) unsigned default NULL, + `CanIris` tinyint(3) unsigned NOT NULL default '0', + `CanAutoIris` tinyint(3) unsigned NOT NULL default '0', + `CanIrisAbs` tinyint(3) unsigned NOT NULL default '0', + `CanIrisRel` tinyint(3) unsigned NOT NULL default '0', + `CanIrisCon` tinyint(3) unsigned NOT NULL default '0', + `MinIrisRange` int(10) unsigned default NULL, + `MaxIrisRange` int(10) unsigned default NULL, + `MinIrisStep` int(10) unsigned default NULL, + `MaxIrisStep` int(10) unsigned default NULL, + `HasIrisSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinIrisSpeed` int(10) unsigned default NULL, + `MaxIrisSpeed` int(10) unsigned default NULL, + `CanGain` tinyint(3) unsigned NOT NULL default '0', + `CanAutoGain` tinyint(3) unsigned NOT NULL default '0', + `CanGainAbs` tinyint(3) unsigned NOT NULL default '0', + `CanGainRel` tinyint(3) unsigned NOT NULL default '0', + `CanGainCon` tinyint(3) unsigned NOT NULL default '0', + `MinGainRange` int(10) unsigned default NULL, + `MaxGainRange` int(10) unsigned default NULL, + `MinGainStep` int(10) unsigned default NULL, + `MaxGainStep` int(10) unsigned default NULL, + `HasGainSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinGainSpeed` int(10) unsigned default NULL, + `MaxGainSpeed` int(10) unsigned default NULL, + `CanWhite` tinyint(3) unsigned NOT NULL default '0', + `CanAutoWhite` tinyint(3) unsigned NOT NULL default '0', + `CanWhiteAbs` tinyint(3) unsigned NOT NULL default '0', + `CanWhiteRel` tinyint(3) unsigned NOT NULL default '0', + `CanWhiteCon` tinyint(3) unsigned NOT NULL default '0', + `MinWhiteRange` int(10) unsigned default NULL, + `MaxWhiteRange` int(10) unsigned default NULL, + `MinWhiteStep` int(10) unsigned default NULL, + `MaxWhiteStep` int(10) unsigned default NULL, + `HasWhiteSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinWhiteSpeed` int(10) unsigned default NULL, + `MaxWhiteSpeed` int(10) unsigned default NULL, + `HasPresets` tinyint(3) unsigned NOT NULL default '0', + `NumPresets` tinyint(3) unsigned NOT NULL default '0', + `HasHomePreset` tinyint(3) unsigned NOT NULL default '0', + `CanSetPresets` tinyint(3) unsigned NOT NULL default '0', + `CanMove` tinyint(3) unsigned NOT NULL default '0', + `CanMoveDiag` tinyint(3) unsigned NOT NULL default '0', + `CanMoveMap` tinyint(3) unsigned NOT NULL default '0', + `CanMoveAbs` tinyint(3) unsigned NOT NULL default '0', + `CanMoveRel` tinyint(3) unsigned NOT NULL default '0', + `CanMoveCon` tinyint(3) unsigned NOT NULL default '0', + `CanPan` tinyint(3) unsigned NOT NULL default '0', + `MinPanRange` int(10) default NULL, + `MaxPanRange` int(10) default NULL, + `MinPanStep` int(10) default NULL, + `MaxPanStep` int(10) default NULL, + `HasPanSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinPanSpeed` int(10) default NULL, + `MaxPanSpeed` int(10) default NULL, + `HasTurboPan` tinyint(3) unsigned NOT NULL default '0', + `TurboPanSpeed` int(10) default NULL, + `CanTilt` tinyint(3) unsigned NOT NULL default '0', + `MinTiltRange` int(10) default NULL, + `MaxTiltRange` int(10) default NULL, + `MinTiltStep` int(10) default NULL, + `MaxTiltStep` int(10) default NULL, + `HasTiltSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinTiltSpeed` int(10) default NULL, + `MaxTiltSpeed` int(10) default NULL, + `HasTurboTilt` tinyint(3) unsigned NOT NULL default '0', + `TurboTiltSpeed` int(10) default NULL, + `CanAutoScan` tinyint(3) unsigned NOT NULL default '0', + `NumScanPaths` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`Id`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Devices` +-- + +DROP TABLE IF EXISTS `Devices`; +CREATE TABLE `Devices` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` tinytext NOT NULL, + `Type` enum('X10') NOT NULL default 'X10', + `KeyString` varchar(32) NOT NULL default '', + PRIMARY KEY (`Id`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Events` +-- + +DROP TABLE IF EXISTS `Events`; +CREATE TABLE `Events` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `MonitorId` int(10) unsigned NOT NULL default '0', + `Name` varchar(64) NOT NULL default '', + `Cause` varchar(32) NOT NULL default '', + `StartTime` datetime default NULL, + `EndTime` datetime default NULL, + `Width` smallint(5) unsigned NOT NULL default '0', + `Height` smallint(5) unsigned NOT NULL default '0', + `Length` decimal(10,2) NOT NULL default '0.00', + `Frames` int(10) unsigned default NULL, + `AlarmFrames` int(10) unsigned default NULL, + `TotScore` int(10) unsigned NOT NULL default '0', + `AvgScore` smallint(5) unsigned default '0', + `MaxScore` smallint(5) unsigned default '0', + `Archived` tinyint(3) unsigned NOT NULL default '0', + `Videoed` tinyint(3) unsigned NOT NULL default '0', + `Uploaded` tinyint(3) unsigned NOT NULL default '0', + `Emailed` tinyint(3) unsigned NOT NULL default '0', + `Messaged` tinyint(3) unsigned NOT NULL default '0', + `Executed` tinyint(3) unsigned NOT NULL default '0', + `Notes` text, + PRIMARY KEY (`Id`,`MonitorId`), + KEY `MonitorId` (`MonitorId`), + KEY `StartTime` (`StartTime`), + KEY `Frames` (`Frames`), + KEY `Archived` (`Archived`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Filters` +-- + +DROP TABLE IF EXISTS `Filters`; +CREATE TABLE `Filters` ( + `Name` varchar(64) NOT NULL default '', + `Query` text NOT NULL, + `AutoArchive` tinyint(3) unsigned NOT NULL default '0', + `AutoVideo` tinyint(3) unsigned NOT NULL default '0', + `AutoUpload` tinyint(3) unsigned NOT NULL default '0', + `AutoEmail` tinyint(3) unsigned NOT NULL default '0', + `AutoMessage` tinyint(3) unsigned NOT NULL default '0', + `AutoExecute` tinyint(3) unsigned NOT NULL default '0', + `AutoExecuteCmd` tinytext, + `AutoDelete` tinyint(3) unsigned NOT NULL default '0', + `Background` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`Name`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Frames` +-- + +DROP TABLE IF EXISTS `Frames`; +CREATE TABLE `Frames` ( + `EventId` int(10) unsigned NOT NULL default '0', + `FrameId` int(10) unsigned NOT NULL default '0', + `Type` enum('Normal','Bulk','Alarm') NOT NULL default 'Normal', + `TimeStamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `Delta` decimal(8,2) NOT NULL default '0.00', + `Score` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`EventId`,`FrameId`), + KEY `Type` (`Type`), + KEY `TimeStamp` (`TimeStamp`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Groups` +-- + +DROP TABLE IF EXISTS `Groups`; +CREATE TABLE `Groups` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `MonitorIds` tinytext NOT NULL, + PRIMARY KEY (`Id`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Logs` +-- +CREATE TABLE `Logs` ( + `TimeKey` decimal(16,6) NOT NULL, + `Component` varchar(32) NOT NULL, + `Pid` smallint(6) DEFAULT NULL, + `Level` tinyint(3) NOT NULL, + `Code` char(3) NOT NULL, + `Message` varchar(255) NOT NULL, + `File` varchar(255) DEFAULT NULL, + `Line` smallint(5) unsigned DEFAULT NULL, + KEY `TimeKey` (`TimeKey`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `MonitorPresets` +-- + +DROP TABLE IF EXISTS `MonitorPresets`; +CREATE TABLE `MonitorPresets` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `Type` enum('Local','Remote','File','Ffmpeg') NOT NULL default 'Local', + `Device` tinytext, + `Channel` tinyint(3) unsigned default NULL, + `Format` int(10) unsigned default NULL, + `Protocol` varchar(16) default NULL, + `Method` varchar(16) default NULL, + `Host` varchar(64) default NULL, + `Port` varchar(8) default NULL, + `Path` varchar(255) default NULL, + `SubPath` varchar(64) default NULL, + `Width` smallint(5) unsigned default NULL, + `Height` smallint(5) unsigned default NULL, + `Palette` int(10) unsigned default NULL, + `MaxFPS` decimal(5,2) default NULL, + `Controllable` tinyint(3) unsigned NOT NULL default '0', + `ControlId` varchar(16) default NULL, + `ControlDevice` varchar(255) default NULL, + `ControlAddress` varchar(255) default NULL, + `DefaultRate` smallint(5) unsigned NOT NULL default '100', + `DefaultScale` smallint(5) unsigned NOT NULL default '100', + PRIMARY KEY (`Id`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Monitors` +-- + +DROP TABLE IF EXISTS `Monitors`; +CREATE TABLE `Monitors` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `Type` enum('Local','Remote','File','Ffmpeg') NOT NULL default 'Local', + `Function` enum('None','Monitor','Modect','Record','Mocord','Nodect') NOT NULL default 'Monitor', + `Enabled` tinyint(3) unsigned NOT NULL default '1', + `LinkedMonitors` varchar(255) NOT NULL default '', + `Triggers` set('X10') NOT NULL default '', + `Device` varchar(64) NOT NULL default '', + `Channel` tinyint(3) unsigned NOT NULL default '0', + `Format` int(10) unsigned NOT NULL default '0', + `Protocol` varchar(16) NOT NULL default '', + `Method` varchar(16) NOT NULL default '', + `Host` varchar(64) NOT NULL default '', + `Port` varchar(8) NOT NULL default '', + `SubPath` varchar(64) NOT NULL default '', + `Path` varchar(255) NOT NULL default '', + `Width` smallint(5) unsigned NOT NULL default '0', + `Height` smallint(5) unsigned NOT NULL default '0', + `Colours` tinyint(3) unsigned NOT NULL default '1', + `Palette` int(10) unsigned NOT NULL default '0', + `Orientation` enum('0','90','180','270','hori','vert') NOT NULL default '0', + `Deinterlacing` int(10) unsigned NOT NULL default '0', + `Brightness` mediumint(7) NOT NULL default '-1', + `Contrast` mediumint(7) NOT NULL default '-1', + `Hue` mediumint(7) NOT NULL default '-1', + `Colour` mediumint(7) NOT NULL default '-1', + `EventPrefix` varchar(32) NOT NULL default 'Event-', + `LabelFormat` varchar(64) NOT NULL default '%N - %y/%m/%d %H:%M:%S', + `LabelX` smallint(5) unsigned NOT NULL default '0', + `LabelY` smallint(5) unsigned NOT NULL default '0', + `ImageBufferCount` smallint(5) unsigned NOT NULL default '100', + `WarmupCount` smallint(5) unsigned NOT NULL default '25', + `PreEventCount` smallint(5) unsigned NOT NULL default '10', + `PostEventCount` smallint(5) unsigned NOT NULL default '10', + `StreamReplayBuffer` int(10) unsigned NOT NULL default '1000', + `AlarmFrameCount` smallint(5) unsigned NOT NULL default '1', + `SectionLength` int(10) unsigned NOT NULL default '600', + `FrameSkip` smallint(5) unsigned NOT NULL default '0', + `MaxFPS` decimal(5,2) default NULL, + `AlarmMaxFPS` decimal(5,2) default NULL, + `FPSReportInterval` smallint(5) unsigned NOT NULL default '250', + `RefBlendPerc` tinyint(3) unsigned NOT NULL default '10', + `Controllable` tinyint(3) unsigned NOT NULL default '0', + `ControlId` int(10) unsigned NOT NULL default '0', + `ControlDevice` varchar(255) default NULL, + `ControlAddress` varchar(255) default NULL, + `AutoStopTimeout` decimal(5,2) default NULL, + `TrackMotion` tinyint(3) unsigned NOT NULL default '0', + `TrackDelay` smallint(5) unsigned NOT NULL default '0', + `ReturnLocation` tinyint(3) NOT NULL default '-1', + `ReturnDelay` smallint(5) unsigned NOT NULL default '0', + `DefaultView` enum('Events','Control') NOT NULL default 'Events', + `DefaultRate` smallint(5) unsigned NOT NULL default '100', + `DefaultScale` smallint(5) unsigned NOT NULL default '100', + `SignalCheckColour` varchar(32) NOT NULL default '#0000BE', + `WebColour` varchar(32) NOT NULL default 'red', + `Sequence` smallint(5) unsigned default NULL, + `UsedPl` varchar(88) NOT NULL default '', + `DoNativeMotDet` tinyint(3) unsigned NOT NULL default '1', + PRIMARY KEY (`Id`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `States` +-- + +DROP TABLE IF EXISTS `States`; +CREATE TABLE `States` ( + `Name` varchar(64) NOT NULL default '', + `Definition` text NOT NULL, + PRIMARY KEY (`Name`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Stats` +-- + +DROP TABLE IF EXISTS `Stats`; +CREATE TABLE `Stats` ( + `MonitorId` int(10) unsigned NOT NULL default '0', + `ZoneId` int(10) unsigned NOT NULL default '0', + `EventId` int(10) unsigned NOT NULL default '0', + `FrameId` int(10) unsigned NOT NULL default '0', + `PixelDiff` tinyint(3) unsigned NOT NULL default '0', + `AlarmPixels` int(10) unsigned NOT NULL default '0', + `FilterPixels` int(10) unsigned NOT NULL default '0', + `BlobPixels` int(10) unsigned NOT NULL default '0', + `Blobs` smallint(5) unsigned NOT NULL default '0', + `MinBlobSize` int(10) unsigned NOT NULL default '0', + `MaxBlobSize` int(10) unsigned NOT NULL default '0', + `MinX` smallint(5) unsigned NOT NULL default '0', + `MaxX` smallint(5) unsigned NOT NULL default '0', + `MinY` smallint(5) unsigned NOT NULL default '0', + `MaxY` smallint(5) unsigned NOT NULL default '0', + `Score` smallint(5) unsigned NOT NULL default '0', + KEY `EventId` (`EventId`), + KEY `MonitorId` (`MonitorId`), + KEY `ZoneId` (`ZoneId`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `TriggersX10` +-- + +DROP TABLE IF EXISTS `TriggersX10`; +CREATE TABLE `TriggersX10` ( + `MonitorId` int(10) unsigned NOT NULL default '0', + `Activation` varchar(32) default NULL, + `AlarmInput` varchar(32) default NULL, + `AlarmOutput` varchar(32) default NULL, + PRIMARY KEY (`MonitorId`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Users` +-- + +DROP TABLE IF EXISTS `Users`; +CREATE TABLE `Users` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Username` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `Password` varchar(64) NOT NULL default '', + `Language` varchar(8) NOT NULL default '', + `Enabled` tinyint(3) unsigned NOT NULL default '1', + `Stream` enum('None','View') NOT NULL default 'None', + `Events` enum('None','View','Edit') NOT NULL default 'None', + `Control` enum('None','View','Edit') NOT NULL default 'None', + `Monitors` enum('None','View','Edit') NOT NULL default 'None', + `Devices` enum('None','View','Edit') NOT NULL default 'None', + `System` enum('None','View','Edit') NOT NULL default 'None', + `MaxBandwidth` varchar(16) NOT NULL default '', + `MonitorIds` tinytext NOT NULL, + PRIMARY KEY (`Id`), + UNIQUE KEY `UC_Username` (`Username`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `ZonePresets` +-- + +DROP TABLE IF EXISTS `ZonePresets`; +CREATE TABLE `ZonePresets` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `Type` enum('Active','Inclusive','Exclusive','Preclusive','Inactive') NOT NULL default 'Active', + `Units` enum('Pixels','Percent') NOT NULL default 'Pixels', + `CheckMethod` enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs', + `MinPixelThreshold` smallint(5) unsigned default NULL, + `MaxPixelThreshold` smallint(5) unsigned default NULL, + `MinAlarmPixels` int(10) unsigned default NULL, + `MaxAlarmPixels` int(10) unsigned default NULL, + `FilterX` tinyint(3) unsigned default NULL, + `FilterY` tinyint(3) unsigned default NULL, + `MinFilterPixels` int(10) unsigned default NULL, + `MaxFilterPixels` int(10) unsigned default NULL, + `MinBlobPixels` int(10) unsigned default NULL, + `MaxBlobPixels` int(10) unsigned default NULL, + `MinBlobs` smallint(5) unsigned default NULL, + `MaxBlobs` smallint(5) unsigned default NULL, + `OverloadFrames` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`Id`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Zones` +-- + +DROP TABLE IF EXISTS `Zones`; +CREATE TABLE `Zones` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `MonitorId` int(10) unsigned NOT NULL default '0', + `Name` varchar(64) NOT NULL default '', + `Type` enum('Active','Inclusive','Exclusive','Preclusive','Inactive') NOT NULL default 'Active', + `Units` enum('Pixels','Percent') NOT NULL default 'Pixels', + `NumCoords` tinyint(3) unsigned NOT NULL default '0', + `Coords` tinytext NOT NULL, + `Area` int(10) unsigned NOT NULL default '0', + `AlarmRGB` int(10) unsigned default '0', + `CheckMethod` enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs', + `MinPixelThreshold` smallint(5) unsigned default NULL, + `MaxPixelThreshold` smallint(5) unsigned default NULL, + `MinAlarmPixels` int(10) unsigned default NULL, + `MaxAlarmPixels` int(10) unsigned default NULL, + `FilterX` tinyint(3) unsigned default NULL, + `FilterY` tinyint(3) unsigned default NULL, + `MinFilterPixels` int(10) unsigned default NULL, + `MaxFilterPixels` int(10) unsigned default NULL, + `MinBlobPixels` int(10) unsigned default NULL, + `MaxBlobPixels` int(10) unsigned default NULL, + `MinBlobs` smallint(5) unsigned default NULL, + `MaxBlobs` smallint(5) unsigned default NULL, + `OverloadFrames` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`Id`), + KEY `MonitorId` (`MonitorId`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- +-- Initial data to be loaded into ZoneMinder database +-- + +-- +-- Create a default admin user. +-- +insert into Users values ('','admin',password('admin'),'',1,'View','Edit','Edit','Edit','Edit','Edit','',''); + +-- +-- Add a sample filter to purge the oldest 5 events when the disk is 95% full, delete is disabled though +-- +insert into Filters values ('PurgeWhenFull','{"sort_field":"Id","terms":[{"val":0,"attr":"Archived","op":"="},{"cnj":"and","val":95,"attr":"DiskPercent","op":">="}],"limit":5,"sort_asc":1}',0,0,0,0,0,0,'',1,0); + +-- +-- Add in some sample control protocol definitions +-- +insert into Controls values (1,'Pelco-D','Local','PelcoD',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0); +insert into Controls values (2,'Pelco-P','Local','PelcoP',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0); +insert into Controls values (3,'Sony VISCA','Local','Visca',1,1,0,1,0,0,0,1,0,16384,10,4000,1,1,6,1,1,1,0,1,0,1536,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,3,1,1,1,1,0,1,1,0,1,-15578,15578,100,10000,1,1,50,1,254,1,-7789,7789,100,5000,1,1,50,1,254,0,0); +INSERT INTO Controls VALUES (4,'Axis API v2','Remote','AxisV2',0,0,0,1,0,0,1,0,0,9999,10,2500,0,NULL,NULL,1,1,0,1,0,0,9999,10,2500,0,NULL,NULL,1,1,0,1,0,0,9999,10,2500,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,12,1,1,1,1,1,0,1,0,1,-360,360,1,90,0,NULL,NULL,0,NULL,1,-360,360,1,90,0,NULL,NULL,0,NULL,0,0); +insert into Controls values (5,'Panasonic IP','Remote','PanasonicIP',0,0,0,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,8,1,1,1,0,1,0,0,1,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0); +insert into Controls values (6,'Neu-Fusion NCS370','Remote','Ncs370',0,0,0,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,24,1,0,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0); + +-- +-- Add some monitor preset values +-- +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, mpjpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&req_fps=5',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, mpjpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=5',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, mpjpeg, B&W','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&color=0',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, mpjpeg, B&W','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&color=0',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 320x240, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240',NULL,320,240,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 320x240, mpjpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&req_fps=5',NULL,320,240,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 320x240, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 320x240, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,5.0,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 640x480, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480',NULL,640,480,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 640x480, mpjpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=5',NULL,640,480,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 640x480, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 640x480, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,5.0,1,4,NULL,':',100,100); +INSERT into MonitorPresets VALUES ('','Axis IP, mpeg4, unicast','Remote',NULL,NULL,NULL,'rtsp','rtpUni','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT into MonitorPresets VALUES ('','Axis IP, mpeg4, multicast','Remote',NULL,NULL,NULL,'rtsp','rtpMulti','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT into MonitorPresets VALUES ('','Axis IP, mpeg4, RTP/RTSP','Remote',NULL,NULL,NULL,'rtsp','rtpRtsp','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT into MonitorPresets VALUES ('','Axis IP, mpeg4, RTP/RTSP/HTTP','Remote',NULL,NULL,NULL,'rtsp','rtpRtspHttp','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 320x240, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/nphMotionJpeg?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 320x240, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 320x240, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 640x480, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/nphMotionJpeg?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 640x480, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 640x480, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 320x240, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/nphMotionJpeg?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 320x240, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 320x240, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,5.0,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 640x480, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/nphMotionJpeg?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 640x480, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 640x480, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,5.0,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Gadspot IP, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Gadspot IP, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Gadspot IP, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/GetData.cgi',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Gadspot IP, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','VEO Observer, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Blue Net Video Server, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/cgi-bin/image.cgi?control=0&id=admin&passwd=admin',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT into MonitorPresets VALUES ('','ACTi IP, mpeg4, unicast','Remote',NULL,NULL,NULL,'rtsp','rtpUni','',7070,'','/track',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis FFMPEG H.264','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp:///axis-media/media.amp?videocodec=h264',NULL,NULL,NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Vivotek FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp://:554/live.sdp',NULL,NULL,NULL,352,240,NULL,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp:///axis-media/media.amp',NULL,NULL,NULL,640,480,NULL,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','ACTi TCM FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp://admin:123456@:7070',NULL,NULL,NULL,320,240,NULL,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), PAL, 320x240','Local','/dev/video','',255,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), PAL, 320x240, max 5 FPS','Local','/dev/video','',255,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), PAL, 640x480','Local','/dev/video','',255,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), PAL, 640x480, max 5 FPS','Local','/dev/video','',255,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), NTSC, 320x240','Local','/dev/video','',45056,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), NTSC, 320x240, max 5 FPS','Local','/dev/video','',45056,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), NTSC, 640x480','Local','/dev/video','',45056,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), NTSC, 640x480, max 5 FPS','Local','/dev/video','',45056,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), PAL, 320x240','Local','/dev/video','',0,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), PAL, 320x240, max 5 FPS','Local','/dev/video','',0,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), PAL, 640x480','Local','/dev/video','',0,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), PAL, 640x480, max 5 FPS','Local','/dev/video','',0,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), NTSC, 320x240','Local','/dev/video','',1,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), NTSC, 320x240, max 5 FPS','Local','/dev/video','',1,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), NTSC, 640x480','Local','/dev/video','',1,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), NTSC, 640x480, max 5 FPS','Local','/dev/video','',1,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Remote ZoneMinder','Remote',NULL,NULL,NULL,'http','simple','',80,'/cgi-bin/nph-zms?mode=jpeg&monitor=&scale=100&maxfps=5&buffer=0',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); + +-- +-- Add some zone preset values +-- +INSERT INTO ZonePresets VALUES (1,'Fast, low sensitivity','Active','Percent','AlarmedPixels',60,NULL,20,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0); +INSERT INTO ZonePresets VALUES (2,'Fast, medium sensitivity','Active','Percent','AlarmedPixels',40,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0); +INSERT INTO ZonePresets VALUES (3,'Fast, high sensitivity','Active','Percent','AlarmedPixels',20,NULL,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0); +INSERT INTO ZonePresets VALUES (4,'Best, low sensitivity','Active','Percent','Blobs',60,NULL,36,NULL,7,7,24,NULL,20,NULL,1,NULL,0); +INSERT INTO ZonePresets VALUES (5,'Best, medium sensitivity','Active','Percent','Blobs',40,NULL,16,NULL,5,5,12,NULL,10,NULL,1,NULL,0); +INSERT INTO ZonePresets VALUES (6,'Best, high sensitivity','Active','Percent','Blobs',20,NULL,8,NULL,3,3,6,NULL,5,NULL,1,NULL,0); + +-- +-- Apply the initial configuration +-- +-- This section is autogenerated by zmconfgen.pl +-- Do not edit this file as any changes will be overwritten +-- diff --git a/db/zm_create.sql.in.orig b/db/zm_create.sql.in.orig new file mode 100644 index 000000000..0c48e7ca3 --- /dev/null +++ b/db/zm_create.sql.in.orig @@ -0,0 +1,621 @@ +-- MySQL dump 10.9 +-- +-- Host: localhost Database: @ZM_DB_NAME@ +-- ------------------------------------------------------ +-- Server version 4.1.16-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Current Database: `@ZM_DB_NAME@` +-- + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `@ZM_DB_NAME@`; + +USE `@ZM_DB_NAME@`; + +-- +-- Table structure for table `Config` +-- + +DROP TABLE IF EXISTS `Config`; +CREATE TABLE `Config` ( + `Id` smallint(5) unsigned NOT NULL default '0', + `Name` varchar(32) NOT NULL default '', + `Value` text NOT NULL, + `Type` tinytext NOT NULL, + `DefaultValue` tinytext, + `Hint` tinytext, + `Pattern` tinytext, + `Format` tinytext, + `Prompt` tinytext, + `Help` text, + `Category` varchar(32) NOT NULL default '', + `Readonly` tinyint(3) unsigned NOT NULL default '0', + `Requires` text, + PRIMARY KEY (`Name`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `ControlPresets` +-- + +DROP TABLE IF EXISTS `ControlPresets`; +CREATE TABLE `ControlPresets` ( + `MonitorId` int(10) unsigned NOT NULL default '0', + `Preset` int(10) unsigned NOT NULL default '0', + `Label` varchar(64) NOT NULL default '', + PRIMARY KEY (`MonitorId`,`Preset`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Controls` +-- + +DROP TABLE IF EXISTS `Controls`; +CREATE TABLE `Controls` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `Type` enum('Local','Remote') NOT NULL default 'Local', + `Protocol` varchar(64) default NULL, + `CanWake` tinyint(3) unsigned NOT NULL default '0', + `CanSleep` tinyint(3) unsigned NOT NULL default '0', + `CanReset` tinyint(3) unsigned NOT NULL default '0', + `CanZoom` tinyint(3) unsigned NOT NULL default '0', + `CanAutoZoom` tinyint(3) unsigned NOT NULL default '0', + `CanZoomAbs` tinyint(3) unsigned NOT NULL default '0', + `CanZoomRel` tinyint(3) unsigned NOT NULL default '0', + `CanZoomCon` tinyint(3) unsigned NOT NULL default '0', + `MinZoomRange` int(10) unsigned default NULL, + `MaxZoomRange` int(10) unsigned default NULL, + `MinZoomStep` int(10) unsigned default NULL, + `MaxZoomStep` int(10) unsigned default NULL, + `HasZoomSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinZoomSpeed` int(10) unsigned default NULL, + `MaxZoomSpeed` int(10) unsigned default NULL, + `CanFocus` tinyint(3) unsigned NOT NULL default '0', + `CanAutoFocus` tinyint(3) unsigned NOT NULL default '0', + `CanFocusAbs` tinyint(3) unsigned NOT NULL default '0', + `CanFocusRel` tinyint(3) unsigned NOT NULL default '0', + `CanFocusCon` tinyint(3) unsigned NOT NULL default '0', + `MinFocusRange` int(10) unsigned default NULL, + `MaxFocusRange` int(10) unsigned default NULL, + `MinFocusStep` int(10) unsigned default NULL, + `MaxFocusStep` int(10) unsigned default NULL, + `HasFocusSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinFocusSpeed` int(10) unsigned default NULL, + `MaxFocusSpeed` int(10) unsigned default NULL, + `CanIris` tinyint(3) unsigned NOT NULL default '0', + `CanAutoIris` tinyint(3) unsigned NOT NULL default '0', + `CanIrisAbs` tinyint(3) unsigned NOT NULL default '0', + `CanIrisRel` tinyint(3) unsigned NOT NULL default '0', + `CanIrisCon` tinyint(3) unsigned NOT NULL default '0', + `MinIrisRange` int(10) unsigned default NULL, + `MaxIrisRange` int(10) unsigned default NULL, + `MinIrisStep` int(10) unsigned default NULL, + `MaxIrisStep` int(10) unsigned default NULL, + `HasIrisSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinIrisSpeed` int(10) unsigned default NULL, + `MaxIrisSpeed` int(10) unsigned default NULL, + `CanGain` tinyint(3) unsigned NOT NULL default '0', + `CanAutoGain` tinyint(3) unsigned NOT NULL default '0', + `CanGainAbs` tinyint(3) unsigned NOT NULL default '0', + `CanGainRel` tinyint(3) unsigned NOT NULL default '0', + `CanGainCon` tinyint(3) unsigned NOT NULL default '0', + `MinGainRange` int(10) unsigned default NULL, + `MaxGainRange` int(10) unsigned default NULL, + `MinGainStep` int(10) unsigned default NULL, + `MaxGainStep` int(10) unsigned default NULL, + `HasGainSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinGainSpeed` int(10) unsigned default NULL, + `MaxGainSpeed` int(10) unsigned default NULL, + `CanWhite` tinyint(3) unsigned NOT NULL default '0', + `CanAutoWhite` tinyint(3) unsigned NOT NULL default '0', + `CanWhiteAbs` tinyint(3) unsigned NOT NULL default '0', + `CanWhiteRel` tinyint(3) unsigned NOT NULL default '0', + `CanWhiteCon` tinyint(3) unsigned NOT NULL default '0', + `MinWhiteRange` int(10) unsigned default NULL, + `MaxWhiteRange` int(10) unsigned default NULL, + `MinWhiteStep` int(10) unsigned default NULL, + `MaxWhiteStep` int(10) unsigned default NULL, + `HasWhiteSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinWhiteSpeed` int(10) unsigned default NULL, + `MaxWhiteSpeed` int(10) unsigned default NULL, + `HasPresets` tinyint(3) unsigned NOT NULL default '0', + `NumPresets` tinyint(3) unsigned NOT NULL default '0', + `HasHomePreset` tinyint(3) unsigned NOT NULL default '0', + `CanSetPresets` tinyint(3) unsigned NOT NULL default '0', + `CanMove` tinyint(3) unsigned NOT NULL default '0', + `CanMoveDiag` tinyint(3) unsigned NOT NULL default '0', + `CanMoveMap` tinyint(3) unsigned NOT NULL default '0', + `CanMoveAbs` tinyint(3) unsigned NOT NULL default '0', + `CanMoveRel` tinyint(3) unsigned NOT NULL default '0', + `CanMoveCon` tinyint(3) unsigned NOT NULL default '0', + `CanPan` tinyint(3) unsigned NOT NULL default '0', + `MinPanRange` int(10) default NULL, + `MaxPanRange` int(10) default NULL, + `MinPanStep` int(10) default NULL, + `MaxPanStep` int(10) default NULL, + `HasPanSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinPanSpeed` int(10) default NULL, + `MaxPanSpeed` int(10) default NULL, + `HasTurboPan` tinyint(3) unsigned NOT NULL default '0', + `TurboPanSpeed` int(10) default NULL, + `CanTilt` tinyint(3) unsigned NOT NULL default '0', + `MinTiltRange` int(10) default NULL, + `MaxTiltRange` int(10) default NULL, + `MinTiltStep` int(10) default NULL, + `MaxTiltStep` int(10) default NULL, + `HasTiltSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinTiltSpeed` int(10) default NULL, + `MaxTiltSpeed` int(10) default NULL, + `HasTurboTilt` tinyint(3) unsigned NOT NULL default '0', + `TurboTiltSpeed` int(10) default NULL, + `CanAutoScan` tinyint(3) unsigned NOT NULL default '0', + `NumScanPaths` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`Id`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Devices` +-- + +DROP TABLE IF EXISTS `Devices`; +CREATE TABLE `Devices` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` tinytext NOT NULL, + `Type` enum('X10') NOT NULL default 'X10', + `KeyString` varchar(32) NOT NULL default '', + PRIMARY KEY (`Id`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Events` +-- + +DROP TABLE IF EXISTS `Events`; +CREATE TABLE `Events` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `MonitorId` int(10) unsigned NOT NULL default '0', + `Name` varchar(64) NOT NULL default '', + `Cause` varchar(32) NOT NULL default '', + `StartTime` datetime default NULL, + `EndTime` datetime default NULL, + `Width` smallint(5) unsigned NOT NULL default '0', + `Height` smallint(5) unsigned NOT NULL default '0', + `Length` decimal(10,2) NOT NULL default '0.00', + `Frames` int(10) unsigned default NULL, + `AlarmFrames` int(10) unsigned default NULL, + `TotScore` int(10) unsigned NOT NULL default '0', + `AvgScore` smallint(5) unsigned default '0', + `MaxScore` smallint(5) unsigned default '0', + `Archived` tinyint(3) unsigned NOT NULL default '0', + `Videoed` tinyint(3) unsigned NOT NULL default '0', + `Uploaded` tinyint(3) unsigned NOT NULL default '0', + `Emailed` tinyint(3) unsigned NOT NULL default '0', + `Messaged` tinyint(3) unsigned NOT NULL default '0', + `Executed` tinyint(3) unsigned NOT NULL default '0', + `Notes` text, + PRIMARY KEY (`Id`,`MonitorId`), + KEY `MonitorId` (`MonitorId`), + KEY `StartTime` (`StartTime`), + KEY `Frames` (`Frames`), + KEY `Archived` (`Archived`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Filters` +-- + +DROP TABLE IF EXISTS `Filters`; +CREATE TABLE `Filters` ( + `Name` varchar(64) NOT NULL default '', + `Query` text NOT NULL, + `AutoArchive` tinyint(3) unsigned NOT NULL default '0', + `AutoVideo` tinyint(3) unsigned NOT NULL default '0', + `AutoUpload` tinyint(3) unsigned NOT NULL default '0', + `AutoEmail` tinyint(3) unsigned NOT NULL default '0', + `AutoMessage` tinyint(3) unsigned NOT NULL default '0', + `AutoExecute` tinyint(3) unsigned NOT NULL default '0', + `AutoExecuteCmd` tinytext, + `AutoDelete` tinyint(3) unsigned NOT NULL default '0', + `Background` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`Name`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Frames` +-- + +DROP TABLE IF EXISTS `Frames`; +CREATE TABLE `Frames` ( + `EventId` int(10) unsigned NOT NULL default '0', + `FrameId` int(10) unsigned NOT NULL default '0', + `Type` enum('Normal','Bulk','Alarm') NOT NULL default 'Normal', + `TimeStamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `Delta` decimal(8,2) NOT NULL default '0.00', + `Score` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`EventId`,`FrameId`), + KEY `Type` (`Type`), + KEY `TimeStamp` (`TimeStamp`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Groups` +-- + +DROP TABLE IF EXISTS `Groups`; +CREATE TABLE `Groups` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `MonitorIds` tinytext NOT NULL, + PRIMARY KEY (`Id`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Logs` +-- +CREATE TABLE `Logs` ( + `TimeKey` decimal(16,6) NOT NULL, + `Component` varchar(32) NOT NULL, + `Pid` smallint(6) DEFAULT NULL, + `Level` tinyint(3) NOT NULL, + `Code` char(3) NOT NULL, + `Message` varchar(255) NOT NULL, + `File` varchar(255) DEFAULT NULL, + `Line` smallint(5) unsigned DEFAULT NULL, + KEY `TimeKey` (`TimeKey`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `MonitorPresets` +-- + +DROP TABLE IF EXISTS `MonitorPresets`; +CREATE TABLE `MonitorPresets` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `Type` enum('Local','Remote','File','Ffmpeg') NOT NULL default 'Local', + `Device` tinytext, + `Channel` tinyint(3) unsigned default NULL, + `Format` int(10) unsigned default NULL, + `Protocol` varchar(16) default NULL, + `Method` varchar(16) default NULL, + `Host` varchar(64) default NULL, + `Port` varchar(8) default NULL, + `Path` varchar(255) default NULL, + `SubPath` varchar(64) default NULL, + `Width` smallint(5) unsigned default NULL, + `Height` smallint(5) unsigned default NULL, + `Palette` int(10) unsigned default NULL, + `MaxFPS` decimal(5,2) default NULL, + `Controllable` tinyint(3) unsigned NOT NULL default '0', + `ControlId` varchar(16) default NULL, + `ControlDevice` varchar(255) default NULL, + `ControlAddress` varchar(255) default NULL, + `DefaultRate` smallint(5) unsigned NOT NULL default '100', + `DefaultScale` smallint(5) unsigned NOT NULL default '100', + PRIMARY KEY (`Id`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Monitors` +-- + +DROP TABLE IF EXISTS `Monitors`; +CREATE TABLE `Monitors` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `Type` enum('Local','Remote','File','Ffmpeg') NOT NULL default 'Local', + `Function` enum('None','Monitor','Modect','Record','Mocord','Nodect') NOT NULL default 'Monitor', + `Enabled` tinyint(3) unsigned NOT NULL default '1', + `LinkedMonitors` varchar(255) NOT NULL default '', + `Triggers` set('X10') NOT NULL default '', + `Device` varchar(64) NOT NULL default '', + `Channel` tinyint(3) unsigned NOT NULL default '0', + `Format` int(10) unsigned NOT NULL default '0', + `Protocol` varchar(16) NOT NULL default '', + `Method` varchar(16) NOT NULL default '', + `Host` varchar(64) NOT NULL default '', + `Port` varchar(8) NOT NULL default '', + `SubPath` varchar(64) NOT NULL default '', + `Path` varchar(255) NOT NULL default '', + `Width` smallint(5) unsigned NOT NULL default '0', + `Height` smallint(5) unsigned NOT NULL default '0', + `Colours` tinyint(3) unsigned NOT NULL default '1', + `Palette` int(10) unsigned NOT NULL default '0', + `Orientation` enum('0','90','180','270','hori','vert') NOT NULL default '0', + `Deinterlacing` int(10) unsigned NOT NULL default '0', + `Brightness` mediumint(7) NOT NULL default '-1', + `Contrast` mediumint(7) NOT NULL default '-1', + `Hue` mediumint(7) NOT NULL default '-1', + `Colour` mediumint(7) NOT NULL default '-1', + `EventPrefix` varchar(32) NOT NULL default 'Event-', + `LabelFormat` varchar(64) NOT NULL default '%N - %y/%m/%d %H:%M:%S', + `LabelX` smallint(5) unsigned NOT NULL default '0', + `LabelY` smallint(5) unsigned NOT NULL default '0', + `ImageBufferCount` smallint(5) unsigned NOT NULL default '100', + `WarmupCount` smallint(5) unsigned NOT NULL default '25', + `PreEventCount` smallint(5) unsigned NOT NULL default '10', + `PostEventCount` smallint(5) unsigned NOT NULL default '10', + `StreamReplayBuffer` int(10) unsigned NOT NULL default '1000', + `AlarmFrameCount` smallint(5) unsigned NOT NULL default '1', + `SectionLength` int(10) unsigned NOT NULL default '600', + `FrameSkip` smallint(5) unsigned NOT NULL default '0', + `MaxFPS` decimal(5,2) default NULL, + `AlarmMaxFPS` decimal(5,2) default NULL, + `FPSReportInterval` smallint(5) unsigned NOT NULL default '250', + `RefBlendPerc` tinyint(3) unsigned NOT NULL default '10', + `Controllable` tinyint(3) unsigned NOT NULL default '0', + `ControlId` int(10) unsigned NOT NULL default '0', + `ControlDevice` varchar(255) default NULL, + `ControlAddress` varchar(255) default NULL, + `AutoStopTimeout` decimal(5,2) default NULL, + `TrackMotion` tinyint(3) unsigned NOT NULL default '0', + `TrackDelay` smallint(5) unsigned NOT NULL default '0', + `ReturnLocation` tinyint(3) NOT NULL default '-1', + `ReturnDelay` smallint(5) unsigned NOT NULL default '0', + `DefaultView` enum('Events','Control') NOT NULL default 'Events', + `DefaultRate` smallint(5) unsigned NOT NULL default '100', + `DefaultScale` smallint(5) unsigned NOT NULL default '100', + `SignalCheckColour` varchar(32) NOT NULL default '#0000BE', + `WebColour` varchar(32) NOT NULL default 'red', + `Sequence` smallint(5) unsigned default NULL, + PRIMARY KEY (`Id`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `States` +-- + +DROP TABLE IF EXISTS `States`; +CREATE TABLE `States` ( + `Name` varchar(64) NOT NULL default '', + `Definition` text NOT NULL, + PRIMARY KEY (`Name`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Stats` +-- + +DROP TABLE IF EXISTS `Stats`; +CREATE TABLE `Stats` ( + `MonitorId` int(10) unsigned NOT NULL default '0', + `ZoneId` int(10) unsigned NOT NULL default '0', + `EventId` int(10) unsigned NOT NULL default '0', + `FrameId` int(10) unsigned NOT NULL default '0', + `PixelDiff` tinyint(3) unsigned NOT NULL default '0', + `AlarmPixels` int(10) unsigned NOT NULL default '0', + `FilterPixels` int(10) unsigned NOT NULL default '0', + `BlobPixels` int(10) unsigned NOT NULL default '0', + `Blobs` smallint(5) unsigned NOT NULL default '0', + `MinBlobSize` int(10) unsigned NOT NULL default '0', + `MaxBlobSize` int(10) unsigned NOT NULL default '0', + `MinX` smallint(5) unsigned NOT NULL default '0', + `MaxX` smallint(5) unsigned NOT NULL default '0', + `MinY` smallint(5) unsigned NOT NULL default '0', + `MaxY` smallint(5) unsigned NOT NULL default '0', + `Score` smallint(5) unsigned NOT NULL default '0', + KEY `EventId` (`EventId`), + KEY `MonitorId` (`MonitorId`), + KEY `ZoneId` (`ZoneId`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `TriggersX10` +-- + +DROP TABLE IF EXISTS `TriggersX10`; +CREATE TABLE `TriggersX10` ( + `MonitorId` int(10) unsigned NOT NULL default '0', + `Activation` varchar(32) default NULL, + `AlarmInput` varchar(32) default NULL, + `AlarmOutput` varchar(32) default NULL, + PRIMARY KEY (`MonitorId`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Users` +-- + +DROP TABLE IF EXISTS `Users`; +CREATE TABLE `Users` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Username` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `Password` varchar(64) NOT NULL default '', + `Language` varchar(8) NOT NULL default '', + `Enabled` tinyint(3) unsigned NOT NULL default '1', + `Stream` enum('None','View') NOT NULL default 'None', + `Events` enum('None','View','Edit') NOT NULL default 'None', + `Control` enum('None','View','Edit') NOT NULL default 'None', + `Monitors` enum('None','View','Edit') NOT NULL default 'None', + `Devices` enum('None','View','Edit') NOT NULL default 'None', + `System` enum('None','View','Edit') NOT NULL default 'None', + `MaxBandwidth` varchar(16) NOT NULL default '', + `MonitorIds` tinytext NOT NULL, + PRIMARY KEY (`Id`), + UNIQUE KEY `UC_Username` (`Username`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `ZonePresets` +-- + +DROP TABLE IF EXISTS `ZonePresets`; +CREATE TABLE `ZonePresets` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `Type` enum('Active','Inclusive','Exclusive','Preclusive','Inactive') NOT NULL default 'Active', + `Units` enum('Pixels','Percent') NOT NULL default 'Pixels', + `CheckMethod` enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs', + `MinPixelThreshold` smallint(5) unsigned default NULL, + `MaxPixelThreshold` smallint(5) unsigned default NULL, + `MinAlarmPixels` int(10) unsigned default NULL, + `MaxAlarmPixels` int(10) unsigned default NULL, + `FilterX` tinyint(3) unsigned default NULL, + `FilterY` tinyint(3) unsigned default NULL, + `MinFilterPixels` int(10) unsigned default NULL, + `MaxFilterPixels` int(10) unsigned default NULL, + `MinBlobPixels` int(10) unsigned default NULL, + `MaxBlobPixels` int(10) unsigned default NULL, + `MinBlobs` smallint(5) unsigned default NULL, + `MaxBlobs` smallint(5) unsigned default NULL, + `OverloadFrames` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`Id`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +-- +-- Table structure for table `Zones` +-- + +DROP TABLE IF EXISTS `Zones`; +CREATE TABLE `Zones` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `MonitorId` int(10) unsigned NOT NULL default '0', + `Name` varchar(64) NOT NULL default '', + `Type` enum('Active','Inclusive','Exclusive','Preclusive','Inactive') NOT NULL default 'Active', + `Units` enum('Pixels','Percent') NOT NULL default 'Pixels', + `NumCoords` tinyint(3) unsigned NOT NULL default '0', + `Coords` tinytext NOT NULL, + `Area` int(10) unsigned NOT NULL default '0', + `AlarmRGB` int(10) unsigned default '0', + `CheckMethod` enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs', + `MinPixelThreshold` smallint(5) unsigned default NULL, + `MaxPixelThreshold` smallint(5) unsigned default NULL, + `MinAlarmPixels` int(10) unsigned default NULL, + `MaxAlarmPixels` int(10) unsigned default NULL, + `FilterX` tinyint(3) unsigned default NULL, + `FilterY` tinyint(3) unsigned default NULL, + `MinFilterPixels` int(10) unsigned default NULL, + `MaxFilterPixels` int(10) unsigned default NULL, + `MinBlobPixels` int(10) unsigned default NULL, + `MaxBlobPixels` int(10) unsigned default NULL, + `MinBlobs` smallint(5) unsigned default NULL, + `MaxBlobs` smallint(5) unsigned default NULL, + `OverloadFrames` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`Id`), + KEY `MonitorId` (`MonitorId`) +) ENGINE=@ZM_MYSQL_ENGINE@; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- +-- Initial data to be loaded into ZoneMinder database +-- + +-- +-- Create a default admin user. +-- +insert into Users values ('','admin',password('admin'),'',1,'View','Edit','Edit','Edit','Edit','Edit','',''); + +-- +-- Add a sample filter to purge the oldest 5 events when the disk is 95% full, delete is disabled though +-- +insert into Filters values ('PurgeWhenFull','{"sort_field":"Id","terms":[{"val":0,"attr":"Archived","op":"="},{"cnj":"and","val":95,"attr":"DiskPercent","op":">="}],"limit":5,"sort_asc":1}',0,0,0,0,0,0,'',1,0); + +-- +-- Add in some sample control protocol definitions +-- +insert into Controls values (1,'Pelco-D','Local','PelcoD',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0); +insert into Controls values (2,'Pelco-P','Local','PelcoP',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0); +insert into Controls values (3,'Sony VISCA','Local','Visca',1,1,0,1,0,0,0,1,0,16384,10,4000,1,1,6,1,1,1,0,1,0,1536,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,3,1,1,1,1,0,1,1,0,1,-15578,15578,100,10000,1,1,50,1,254,1,-7789,7789,100,5000,1,1,50,1,254,0,0); +INSERT INTO Controls VALUES (4,'Axis API v2','Remote','AxisV2',0,0,0,1,0,0,1,0,0,9999,10,2500,0,NULL,NULL,1,1,0,1,0,0,9999,10,2500,0,NULL,NULL,1,1,0,1,0,0,9999,10,2500,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,12,1,1,1,1,1,0,1,0,1,-360,360,1,90,0,NULL,NULL,0,NULL,1,-360,360,1,90,0,NULL,NULL,0,NULL,0,0); +insert into Controls values (5,'Panasonic IP','Remote','PanasonicIP',0,0,0,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,8,1,1,1,0,1,0,0,1,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0); +insert into Controls values (6,'Neu-Fusion NCS370','Remote','Ncs370',0,0,0,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,24,1,0,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0); + +-- +-- Add some monitor preset values +-- +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, mpjpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&req_fps=5',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, mpjpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=5',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, mpjpeg, B&W','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&color=0',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, mpjpeg, B&W','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&color=0',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 320x240, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240',NULL,320,240,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 320x240, mpjpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&req_fps=5',NULL,320,240,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 320x240, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 320x240, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,5.0,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 640x480, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480',NULL,640,480,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 640x480, mpjpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=5',NULL,640,480,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 640x480, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 640x480, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,5.0,1,4,NULL,':',100,100); +INSERT into MonitorPresets VALUES ('','Axis IP, mpeg4, unicast','Remote',NULL,NULL,NULL,'rtsp','rtpUni','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT into MonitorPresets VALUES ('','Axis IP, mpeg4, multicast','Remote',NULL,NULL,NULL,'rtsp','rtpMulti','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT into MonitorPresets VALUES ('','Axis IP, mpeg4, RTP/RTSP','Remote',NULL,NULL,NULL,'rtsp','rtpRtsp','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT into MonitorPresets VALUES ('','Axis IP, mpeg4, RTP/RTSP/HTTP','Remote',NULL,NULL,NULL,'rtsp','rtpRtspHttp','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 320x240, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/nphMotionJpeg?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 320x240, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 320x240, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 640x480, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/nphMotionJpeg?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 640x480, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 640x480, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 320x240, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/nphMotionJpeg?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 320x240, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 320x240, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,5.0,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 640x480, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/nphMotionJpeg?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 640x480, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 640x480, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,5.0,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Gadspot IP, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Gadspot IP, jpeg, max 5 FPS','Remote','http','simple',NULL,NULL,NULL,'',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Gadspot IP, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/GetData.cgi',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Gadspot IP, mpjpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','VEO Observer, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Blue Net Video Server, jpeg','Remote','http','simple',NULL,NULL,NULL,'',80,'/cgi-bin/image.cgi?control=0&id=admin&passwd=admin',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT into MonitorPresets VALUES ('','ACTi IP, mpeg4, unicast','Remote',NULL,NULL,NULL,'rtsp','rtpUni','',7070,'','/track',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis FFMPEG H.264','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp:///axis-media/media.amp?videocodec=h264',NULL,NULL,NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Vivotek FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp://:554/live.sdp',NULL,NULL,NULL,352,240,NULL,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp:///axis-media/media.amp',NULL,NULL,NULL,640,480,NULL,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','ACTi TCM FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp://admin:123456@:7070',NULL,NULL,NULL,320,240,NULL,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), PAL, 320x240','Local','/dev/video','',255,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), PAL, 320x240, max 5 FPS','Local','/dev/video','',255,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), PAL, 640x480','Local','/dev/video','',255,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), PAL, 640x480, max 5 FPS','Local','/dev/video','',255,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), NTSC, 320x240','Local','/dev/video','',45056,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), NTSC, 320x240, max 5 FPS','Local','/dev/video','',45056,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), NTSC, 640x480','Local','/dev/video','',45056,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), NTSC, 640x480, max 5 FPS','Local','/dev/video','',45056,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), PAL, 320x240','Local','/dev/video','',0,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), PAL, 320x240, max 5 FPS','Local','/dev/video','',0,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), PAL, 640x480','Local','/dev/video','',0,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), PAL, 640x480, max 5 FPS','Local','/dev/video','',0,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), NTSC, 320x240','Local','/dev/video','',1,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), NTSC, 320x240, max 5 FPS','Local','/dev/video','',1,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), NTSC, 640x480','Local','/dev/video','',1,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), NTSC, 640x480, max 5 FPS','Local','/dev/video','',1,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Remote ZoneMinder','Remote',NULL,NULL,NULL,'http','simple','',80,'/cgi-bin/nph-zms?mode=jpeg&monitor=&scale=100&maxfps=5&buffer=0',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); + +-- +-- Add some zone preset values +-- +INSERT INTO ZonePresets VALUES (1,'Fast, low sensitivity','Active','Percent','AlarmedPixels',60,NULL,20,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0); +INSERT INTO ZonePresets VALUES (2,'Fast, medium sensitivity','Active','Percent','AlarmedPixels',40,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0); +INSERT INTO ZonePresets VALUES (3,'Fast, high sensitivity','Active','Percent','AlarmedPixels',20,NULL,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0); +INSERT INTO ZonePresets VALUES (4,'Best, low sensitivity','Active','Percent','Blobs',60,NULL,36,NULL,7,7,24,NULL,20,NULL,1,NULL,0); +INSERT INTO ZonePresets VALUES (5,'Best, medium sensitivity','Active','Percent','Blobs',40,NULL,16,NULL,5,5,12,NULL,10,NULL,1,NULL,0); +INSERT INTO ZonePresets VALUES (6,'Best, high sensitivity','Active','Percent','Blobs',20,NULL,8,NULL,3,3,6,NULL,5,NULL,1,NULL,0); + +-- +-- Apply the initial configuration +-- +-- This section is autogenerated by zmconfgen.pl +-- Do not edit this file as any changes will be overwritten +-- diff --git a/db/zm_update-0.0.1.sql b/db/zm_update-0.0.1.sql new file mode 100644 index 000000000..373afd273 --- /dev/null +++ b/db/zm_update-0.0.1.sql @@ -0,0 +1,62 @@ +-- +-- This updates a 0.0.1 database to 0.9.7 +-- +alter table Monitors modify Device tinyint unsigned NOT NULL default '0'; +alter table Monitors modify Format tinyint unsigned NOT NULL; +alter table Monitors drop column WarmUpCount; +alter table Monitors drop column PreEventCount; +alter table Monitors drop column PostEventCount; +alter table Monitors modify LabelFormat varchar(32) not null default '%%s - %y/%m/%d %H:%M:%S'; +alter table Monitors modify LabelX smallint unsigned not null; +alter table Monitors modify LabelY smallint unsigned not null; +alter table Monitors add column ImageBufferCount smallint unsigned NOT NULL default '100'; +alter table Monitors add column WarmupCount smallint unsigned NOT NULL default '25'; +alter table Monitors add column PreEventCount smallint unsigned NOT NULL default '10'; +alter table Monitors add column PostEventCount smallint unsigned NOT NULL default '10'; +alter table Monitors add column AlarmFrameCount smallint unsigned NOT NULL default '1'; +alter table Monitors add column FPSReportInterval smallint unsigned NOT NULL default '250'; +alter table Monitors add column RefBlendPerc tinyint unsigned NOT NULL default '10'; +alter table Monitors add column X10Activation char(32); +alter table Monitors add column X10AlarmInput char(32); +alter table Monitors add column X10AlarmOutput char(32); +alter table Monitors modify column Function enum('None','Passive','Active','X10') default 'Passive' not null; +update Monitors set LabelFormat = '%%s - %y/%m/%d %H:%M:%S'; +update Monitors set LabelX = 0; +update Monitors set LabelY = Height-8; +alter table Events add column TotScore int unsigned not null default 0 after AlarmFrames; +update Events set TotScore = AlarmFrames * AvgScore where TotScore = 0; +alter table Events modify column Archived tinyint unsigned not null default 0; +alter table Events add column Uploaded tinyint unsigned not null default 0 after Archived; +alter table Events add column LearnState char(1) default '' after Uploaded; +CREATE TABLE Filters ( +Id int(10) unsigned NOT NULL auto_increment, +MonitorId int(10) unsigned NOT NULL default '0', +Name varchar(64) NOT NULL default '', +Query text NOT NULL, +AutoDelete tinyint(4) unsigned NOT NULL default '0', +AutoUpload tinyint(4) unsigned NOT NULL default '0', +PRIMARY KEY (Id), +UNIQUE KEY FilterIDX (MonitorId,Name) +) TYPE=MyISAM; +CREATE TABLE Stats ( +MonitorId int(10) unsigned NOT NULL default '0', +ZoneId int(10) unsigned NOT NULL default '0', +EventId int(10) unsigned NOT NULL default '0', +FrameId int(10) unsigned NOT NULL default '0', +AlarmPixels int(10) unsigned NOT NULL default '0', +FilterPixels int(10) unsigned NOT NULL default '0', +BlobPixels int(10) unsigned NOT NULL default '0', +Blobs smallint(5) unsigned NOT NULL default '0', +MinBlobSize smallint(5) unsigned NOT NULL default '0', +MaxBlobSize smallint(5) unsigned NOT NULL default '0', +MinX smallint(5) unsigned NOT NULL default '0', +MaxX smallint(5) unsigned NOT NULL default '0', +MinY smallint(5) unsigned NOT NULL default '0', +MaxY smallint(5) unsigned NOT NULL default '0', +Score smallint(5) unsigned NOT NULL default '0', +KEY EventId (EventId), +KEY MonitorId (MonitorId), +KEY ZoneId (ZoneId) +) TYPE=MyISAM; +-- Not a problem if this fails +drop table Alarms; diff --git a/db/zm_update-0.9.10.sql b/db/zm_update-0.9.10.sql new file mode 100644 index 000000000..cf8d6f805 --- /dev/null +++ b/db/zm_update-0.9.10.sql @@ -0,0 +1,15 @@ +-- +-- This updates a 0.9.10 database to 0.9.11 +-- +alter table Monitors change column Colours Palette tinyint(3) unsigned NOT NULL default '1'; +update Monitors set Palette = 1 where Palette = 8; +update Monitors set Palette = 4 where Palette = 24; +alter table Zones modify column Type enum('Active','Inclusive','Exclusive','Preclusive','Inactive') not null default 'Active'; +alter table Filters add column AutoArchive tinyint unsigned not null default 0 after Query; +-- These are optional, it just seemed a good time... +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-0.9.11.sql b/db/zm_update-0.9.11.sql new file mode 100644 index 000000000..db7ec81e0 --- /dev/null +++ b/db/zm_update-0.9.11.sql @@ -0,0 +1,11 @@ +-- +-- This updates a 0.9.11 database to 0.9.12 +-- +alter table Monitors add column Orientation enum('0','90','180','270') not null default '0' after Palette; +-- These are optional, it just seemed a good time... +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-0.9.12.sql b/db/zm_update-0.9.12.sql new file mode 100644 index 000000000..a1f6b3b33 --- /dev/null +++ b/db/zm_update-0.9.12.sql @@ -0,0 +1,26 @@ +-- +-- This updates a 0.9.12 database to 0.9.13 +-- +CREATE TABLE Users ( + Id int(10) unsigned NOT NULL auto_increment, + Username varchar(32) NOT NULL default '', + Password varchar(32) NOT NULL default '', + Enabled tinyint(3) unsigned NOT NULL default '1', + Stream enum('None','View') NOT NULL default 'None', + Events enum('None','View','Edit') NOT NULL default 'None', + Monitors enum('None','View','Edit') NOT NULL default 'None', + System enum('None','View','Edit') NOT NULL default 'None', + MonitorIds tinytext, + PRIMARY KEY (Id), + UNIQUE KEY UC_Id (Id), + UNIQUE KEY UC_Username (Username) +) TYPE=MyISAM; +insert into Users values ('','admin',password('admin'),1,'View','Edit','Edit','Edit',NULL); +-- +-- These are optional, it just seemed a good time... +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-0.9.13.sql b/db/zm_update-0.9.13.sql new file mode 100644 index 000000000..932ad5a4c --- /dev/null +++ b/db/zm_update-0.9.13.sql @@ -0,0 +1,28 @@ +-- +-- This updates a 0.9.13 database to 0.9.14 +-- +CREATE TABLE Config ( + Id smallint(5) unsigned NOT NULL default '0', + Name varchar(32) NOT NULL default '', + Value text NOT NULL, + Type tinytext NOT NULL, + DefaultValue tinytext, + Hint tinytext, + Pattern tinytext, + Format tinytext, + Prompt tinytext, + Help text, + Category varchar(32) NOT NULL default '', + Readonly tinyint(3) unsigned NOT NULL default '0', + Requires text, + PRIMARY KEY (Name), + UNIQUE KEY UC_Name (Name) +) TYPE=MyISAM; +-- +-- These are optional, but we might as well +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-0.9.15.sql b/db/zm_update-0.9.15.sql new file mode 100644 index 000000000..43538f4ca --- /dev/null +++ b/db/zm_update-0.9.15.sql @@ -0,0 +1,57 @@ +-- +-- This updates a 0.9.15 database to 0.9.16 +-- +-- Make changes to Monitor table +-- +alter table Monitors change column Function OldFunction enum('None','Passive','Active','X10') NOT NULL default 'Passive'; +alter table Monitors add column Function enum('None','Monitor','Modect','Record','Mocord') NOT NULL default 'Monitor'; +alter table Monitors add column RunMode enum('Continuous','Triggered') NOT NULL default 'Continuous' after Function; +alter table Monitors add column Triggers set('X10') NOT NULL after RunMode; +alter table Monitors add column SectionLength int(10) unsigned not null default 600 after PostEventCount; +alter table Monitors add column FrameSkip smallint unsigned not null default 0 after SectionLength; +-- +-- Update to reflect existing setup +-- +update Monitors set Function = 'Monitor' where OldFunction = 'Passive'; +update Monitors set Function = 'Modect' where OldFunction = 'Active'; +update Monitors set Function = 'Modect' where OldFunction = 'X10'; +update Monitors set RunMode = 'Triggered' where OldFunction = 'X10'; +update Monitors set Triggers = 'X10' where OldFunction = 'X10'; +-- +-- Create the X10 triggers table +-- +CREATE TABLE TriggersX10 ( + MonitorId int(10) unsigned NOT NULL default '0', + Activation varchar(32) default NULL, + AlarmInput varchar(32) default NULL, + AlarmOutput varchar(32) default NULL, + PRIMARY KEY (MonitorId) +) TYPE=MyISAM; +-- +-- Update to reflect existing setup +-- +insert into TriggersX10 select Id, X10Activation, X10AlarmInput, X10AlarmOutput from Monitors where Function = 'X10'; +-- +-- Clean up temporary and unused columns +-- +alter table Monitors drop column OldFunction ; +alter table Monitors drop column X10Activation ; +alter table Monitors drop column X10AlarmInput ; +alter table Monitors drop column X10AlarmOutput ; +-- +-- Table structure for table `States` +-- +CREATE TABLE States ( + Name varchar(32) NOT NULL default '', + Definition tinytext NOT NULL, + PRIMARY KEY (Name) +) TYPE=MyISAM; +-- +-- These are optional, but we might as well +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-0.9.16.sql b/db/zm_update-0.9.16.sql new file mode 100644 index 000000000..f6bb803a9 --- /dev/null +++ b/db/zm_update-0.9.16.sql @@ -0,0 +1,15 @@ +-- +-- This updates a 0.9.16 database to 0.9.17 +-- +-- Make changes to Users table +-- +alter table Users add column Language varchar(8) not null default "" after Password; +-- +-- These are optional, but we might as well +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-0.9.7.sql b/db/zm_update-0.9.7.sql new file mode 100644 index 000000000..68f7d5111 --- /dev/null +++ b/db/zm_update-0.9.7.sql @@ -0,0 +1,9 @@ +-- +-- This updates a 0.9.7 database to 0.9.8 +-- +alter table Filters modify column AutoDelete tinyint unsigned not null default 0; +alter table Filters modify column AutoUpload tinyint unsigned not null default 0; +alter table Filters add column AutoEmail tinyint unsigned not null default 0; +alter table Filters add column AutoMessage tinyint unsigned not null default 0; +alter table Events add column Emailed tinyint unsigned not null default 0 after Uploaded; +alter table Events add column Messaged tinyint unsigned not null default 0 after Emailed; diff --git a/db/zm_update-0.9.8.sql b/db/zm_update-0.9.8.sql new file mode 100644 index 000000000..9176c0296 --- /dev/null +++ b/db/zm_update-0.9.8.sql @@ -0,0 +1,8 @@ +-- +-- This updates a 0.9.8 database to 0.9.9 +-- +update Monitors set Colours = Colours * 8; +optimize table Events; +alter table Events modify column Length numeric( 10, 2 ) not null default 0.00; +optimize table Frames; +alter table Frames add column Delta numeric( 8, 2 ) not null default 0.00 after TimeStamp; diff --git a/db/zm_update-0.9.9.sql b/db/zm_update-0.9.9.sql new file mode 100644 index 000000000..77d2d9c27 --- /dev/null +++ b/db/zm_update-0.9.9.sql @@ -0,0 +1,15 @@ +-- +-- This updates a 0.9.9 database to 0.9.10 +-- +alter table Monitors add column Type enum('Local','Remote') NOT NULL default 'Local' after Name; +alter table Monitors add column Host varchar(64) default NULL after Format; +alter table Monitors add column Port varchar(8) default '80' after Host; +alter table Monitors add column Path varchar(255) default NULL after Port; +alter table Monitors add column MaxFPS decimal( 5, 2) not null default 0.0 after AlarmFrameCount; +alter table Monitors drop column AlarmFrameCount; +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.17.1.sql b/db/zm_update-1.17.1.sql new file mode 100644 index 000000000..bcedd219a --- /dev/null +++ b/db/zm_update-1.17.1.sql @@ -0,0 +1,17 @@ +-- +-- This updates a 1.17.1 database to 1.17.2 +-- +-- Make changes to Zones table +-- +alter table Zones change column AlarmThreshold MinPixelThreshold smallint unsigned; +alter table Zones add column MaxPixelThreshold smallint unsigned after MinPixelThreshold; +alter table Events drop column ImagePath; +-- +-- These are optional, but we might as well +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.17.2.sql b/db/zm_update-1.17.2.sql new file mode 100644 index 000000000..15197bdf5 --- /dev/null +++ b/db/zm_update-1.17.2.sql @@ -0,0 +1,18 @@ +-- +-- This updates a 1.17.2 database to 1.18.0 +-- +-- Make changes to Filter table +-- +alter table Zones add column CheckMethod enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs' after AlarmRGB; +alter table Filters drop index FilterIDX; +alter table Filters drop column MonitorId; +update Filters set AutoArchive = 0, AutoDelete = 0, AutoUpload = 0, AutoEmail = 0, AutoMessage = 0; +-- +-- These are optional, but we might as well +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.18.0.sql b/db/zm_update-1.18.0.sql new file mode 100644 index 000000000..9bd6b37c9 --- /dev/null +++ b/db/zm_update-1.18.0.sql @@ -0,0 +1,3 @@ +-- +-- There are no updates from a 1.18.0 database to 1.18.1 +-- diff --git a/db/zm_update-1.18.1.sql b/db/zm_update-1.18.1.sql new file mode 100644 index 000000000..febfcd87e --- /dev/null +++ b/db/zm_update-1.18.1.sql @@ -0,0 +1,22 @@ +-- +-- This updates a 1.18.1 database to 1.19.0 +-- +-- Make changes to Frames table +-- +alter table Frames add column Type enum('Normal','Bulk','Alarm') NOT NULL default 'Normal' after FrameId; +update Frames set Type = 'Alarm' where AlarmFrame = 1; +alter table Frames drop column AlarmFrame; +-- +-- Make changes to Filters table +update Filters set Name = concat( Name, '_', Id ); +alter table Filters drop column Id; +alter table Filters add primary key(Name); +-- +-- These are optional, but we might as well +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.19.0.sql b/db/zm_update-1.19.0.sql new file mode 100644 index 000000000..7eddc1531 --- /dev/null +++ b/db/zm_update-1.19.0.sql @@ -0,0 +1,3 @@ +-- +-- There are no updates from a 1.19.0 database to 1.19.1 +-- diff --git a/db/zm_update-1.19.1.sql b/db/zm_update-1.19.1.sql new file mode 100644 index 000000000..6cdc7dd4c --- /dev/null +++ b/db/zm_update-1.19.1.sql @@ -0,0 +1,23 @@ +-- +-- This updates a 1.19.1 database to 1.19.2 +-- +-- Make changes to Events table +-- +alter table Events add column Executed tinyint(3) unsigned not null default 0 after Messaged; +-- +-- Make changes to Filters table +-- +alter table Filters add column AutoExecute tinytext default ''; +-- +-- Add in a sample filter to purge the oldest 5 events when the disk is 99% full, delete is disabled though +-- +insert into Filters values ('PurgeWhenFull','trms=2&obr1=&cbr1=&attr1=Archived&op1=&val1=0&cnj2=and&obr2=&cbr2=&attr2=DiskPercent&op2=>=&val2=99&sort_field=Id&sort_asc=1&limit=5',0,0,0,0,0,''); +-- +-- These are optional, but we might as well +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.19.2.sql b/db/zm_update-1.19.2.sql new file mode 100644 index 000000000..03e5c5316 --- /dev/null +++ b/db/zm_update-1.19.2.sql @@ -0,0 +1,15 @@ +-- +-- This updates a 1.19.2 database to 1.19.3 +-- +-- Make changes to Users table +-- +alter table Users modify column Password varchar(64) not null default ''; +-- +-- These are optional, but we might as well +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.19.3.sql b/db/zm_update-1.19.3.sql new file mode 100644 index 000000000..10ff33f19 --- /dev/null +++ b/db/zm_update-1.19.3.sql @@ -0,0 +1,3 @@ +-- +-- There are no updates from a 1.19.3 database to 1.19.4 +-- diff --git a/db/zm_update-1.19.4.sql b/db/zm_update-1.19.4.sql new file mode 100644 index 000000000..1085e82f3 --- /dev/null +++ b/db/zm_update-1.19.4.sql @@ -0,0 +1,20 @@ +-- +-- This updates a 1.19.4 database to 1.19.5 +-- +-- Make changes to Monitors table +-- +alter table Monitors add column EventPrefix varchar(32) not null default 'Event-' after Orientation; +alter table Monitors add column AlarmFrameCount smallint(5) unsigned not null default '1' after PostEventCount; +alter table Monitors add column Brightness mediumint(7) NOT NULL default '-1' after Orientation; +alter table Monitors add column Contrast mediumint(7) NOT NULL default '-1' after Brightness; +alter table Monitors add column Hue mediumint(7) NOT NULL default '-1' after Contrast; +alter table Monitors add column Colour mediumint(7) NOT NULL default '-1' after Hue; +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.19.5.sql b/db/zm_update-1.19.5.sql new file mode 100644 index 000000000..bb2f27aa1 --- /dev/null +++ b/db/zm_update-1.19.5.sql @@ -0,0 +1,44 @@ +-- +-- This updates a 1.19.5 database to 1.20.0 +-- +-- Create the Groups table +-- +CREATE TABLE Groups ( + Id int(10) unsigned NOT NULL auto_increment, + Name varchar(64) NOT NULL, + MonitorIds tinytext NOT NULL, + PRIMARY KEY (Id) +) TYPE=MyISAM; +-- +-- Make changes to Users table +-- +alter table Users modify MonitorIds tinytext not null default ''; +-- +-- Make changes to Monitors table +-- +alter table Monitors modify column Function enum('None','Monitor','Modect','Record','Mocord','Nodect') NOT NULL default 'Monitor'; +-- +-- Make changes to Events table +-- +alter table Events add column Cause varchar(32) not null default '' after Name; +alter table Events add column Notes tinytext after LearnState; +-- +-- Add a new index to the Events table +-- +alter table Events add index (Frames); +-- +-- Rationalise some of the name columns +alter table Events modify column Name varchar(64) not null; +alter table Filters modify column Name varchar(64) not null; +alter table Monitors modify column Name varchar(64) not null; +alter table States modify column Name varchar(64) not null; +alter table Zones modify column Name varchar(64) not null; +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.20.0.sql b/db/zm_update-1.20.0.sql new file mode 100644 index 000000000..de5e10ac3 --- /dev/null +++ b/db/zm_update-1.20.0.sql @@ -0,0 +1,15 @@ +-- +-- This updates a 1.20.0 database to 1.20.1 +-- +-- Make changes to Users table +-- +alter table Users modify column Username varchar(32) BINARY NOT NULL default ''; +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.20.1.sql b/db/zm_update-1.20.1.sql new file mode 100644 index 000000000..2449ba664 --- /dev/null +++ b/db/zm_update-1.20.1.sql @@ -0,0 +1,148 @@ +-- +-- This updates a 1.20.0 database to 1.20.1 +-- +-- Make changes to Monitors table +-- +alter table Monitors add column Controllable tinyint(3) unsigned NOT NULL default '0'; +alter table Monitors add column ControlId int(10) unsigned NOT NULL default '0'; +alter table Monitors add column ControlDevice varchar(255) default NULL; +alter table Monitors add column ControlAddress varchar(255) default NULL; +alter table Monitors add column TrackMotion tinyint(3) unsigned NOT NULL default '0'; +alter table Monitors add column TrackDelay smallint(5) unsigned NOT NULL default '0'; +alter table Monitors add column ReturnLocation tinyint(3) NOT NULL default '-1'; +alter table Monitors add column ReturnDelay smallint(5) unsigned NOT NULL default '0'; + +-- +-- Add new table `Controls` +-- +CREATE TABLE Controls ( + Id int(10) unsigned NOT NULL auto_increment, + Name varchar(64) NOT NULL default '', + Type enum('Local','Remote') NOT NULL default 'Local', + Command varchar(255) default NULL, + + CanWake tinyint(3) unsigned NOT NULL default '0', + CanSleep tinyint(3) unsigned NOT NULL default '0', + CanReset tinyint(3) unsigned NOT NULL default '0', + + CanZoom tinyint(3) unsigned NOT NULL default '0', + CanAutoZoom tinyint(3) unsigned NOT NULL default '0', + CanZoomAbs tinyint(3) unsigned NOT NULL default '0', + CanZoomRel tinyint(3) unsigned NOT NULL default '0', + CanZoomCon tinyint(3) unsigned NOT NULL default '0', + MinZoomRange int(10) unsigned default NULL, + MaxZoomRange int(10) unsigned default NULL, + MinZoomStep int(10) unsigned default NULL, + MaxZoomStep int(10) unsigned default NULL, + HasZoomSpeed tinyint(3) unsigned NOT NULL default '0', + MinZoomSpeed int(10) unsigned default NULL, + MaxZoomSpeed int(10) unsigned default NULL, + + CanFocus tinyint(3) unsigned NOT NULL default '0', + CanAutoFocus tinyint(3) unsigned NOT NULL default '0', + CanFocusAbs tinyint(3) unsigned NOT NULL default '0', + CanFocusRel tinyint(3) unsigned NOT NULL default '0', + CanFocusCon tinyint(3) unsigned NOT NULL default '0', + MinFocusRange int(10) unsigned default NULL, + MaxFocusRange int(10) unsigned default NULL, + MinFocusStep int(10) unsigned default NULL, + MaxFocusStep int(10) unsigned default NULL, + HasFocusSpeed tinyint(3) unsigned NOT NULL default '0', + MinFocusSpeed int(10) unsigned default NULL, + MaxFocusSpeed int(10) unsigned default NULL, + + CanIris tinyint(3) unsigned NOT NULL default '0', + CanAutoIris tinyint(3) unsigned NOT NULL default '0', + CanIrisAbs tinyint(3) unsigned NOT NULL default '0', + CanIrisRel tinyint(3) unsigned NOT NULL default '0', + CanIrisCon tinyint(3) unsigned NOT NULL default '0', + MinIrisRange int(10) unsigned default NULL, + MaxIrisRange int(10) unsigned default NULL, + MinIrisStep int(10) unsigned default NULL, + MaxIrisStep int(10) unsigned default NULL, + HasIrisSpeed tinyint(3) unsigned NOT NULL default '0', + MinIrisSpeed int(10) unsigned default NULL, + MaxIrisSpeed int(10) unsigned default NULL, + + CanGain tinyint(3) unsigned NOT NULL default '0', + CanAutoGain tinyint(3) unsigned NOT NULL default '0', + CanGainAbs tinyint(3) unsigned NOT NULL default '0', + CanGainRel tinyint(3) unsigned NOT NULL default '0', + CanGainCon tinyint(3) unsigned NOT NULL default '0', + MinGainRange int(10) unsigned default NULL, + MaxGainRange int(10) unsigned default NULL, + MinGainStep int(10) unsigned default NULL, + MaxGainStep int(10) unsigned default NULL, + HasGainSpeed tinyint(3) unsigned NOT NULL default '0', + MinGainSpeed int(10) unsigned default NULL, + MaxGainSpeed int(10) unsigned default NULL, + + CanWhite tinyint(3) unsigned NOT NULL default '0', + CanAutoWhite tinyint(3) unsigned NOT NULL default '0', + CanWhiteAbs tinyint(3) unsigned NOT NULL default '0', + CanWhiteRel tinyint(3) unsigned NOT NULL default '0', + CanWhiteCon tinyint(3) unsigned NOT NULL default '0', + MinWhiteRange int(10) unsigned default NULL, + MaxWhiteRange int(10) unsigned default NULL, + MinWhiteStep int(10) unsigned default NULL, + MaxWhiteStep int(10) unsigned default NULL, + HasWhiteSpeed tinyint(3) unsigned NOT NULL default '0', + MinWhiteSpeed int(10) unsigned default NULL, + MaxWhiteSpeed int(10) unsigned default NULL, + + HasPresets tinyint(3) unsigned NOT NULL default '0', + NumPresets tinyint(3) unsigned NOT NULL default '0', + HasHomePreset tinyint(3) unsigned NOT NULL default '0', + CanSetPresets tinyint(3) unsigned NOT NULL default '0', + + CanMove tinyint(3) unsigned NOT NULL default '0', + CanMoveDiag tinyint(3) unsigned NOT NULL default '0', + CanMoveMap tinyint(3) unsigned NOT NULL default '0', + CanMoveAbs tinyint(3) unsigned NOT NULL default '0', + CanMoveRel tinyint(3) unsigned NOT NULL default '0', + CanMoveCon tinyint(3) unsigned NOT NULL default '0', + CanPan tinyint(3) unsigned NOT NULL default '0', + MinPanRange int(10) default NULL, + MaxPanRange int(10) default NULL, + MinPanStep int(10) default NULL, + MaxPanStep int(10) default NULL, + HasPanSpeed tinyint(3) unsigned NOT NULL default '0', + MinPanSpeed int(10) default NULL, + MaxPanSpeed int(10) default NULL, + HasTurboPan tinyint(3) unsigned NOT NULL default '0', + TurboPanSpeed int(10) default NULL, + CanTilt tinyint(3) unsigned NOT NULL default '0', + MinTiltRange int(10) default NULL, + MaxTiltRange int(10) default NULL, + MinTiltStep int(10) default NULL, + MaxTiltStep int(10) default NULL, + HasTiltSpeed tinyint(3) unsigned NOT NULL default '0', + MinTiltSpeed int(10) default NULL, + MaxTiltSpeed int(10) default NULL, + HasTurboTilt tinyint(3) unsigned NOT NULL default '0', + TurboTiltSpeed int(10) default NULL, + + CanAutoScan tinyint(3) unsigned NOT NULL default '0', + NumScanPaths tinyint(3) unsigned NOT NULL default '0', + + PRIMARY KEY (Id), + UNIQUE KEY UC_Id (Id) +) TYPE=MyISAM; + +-- +-- Some sample control protocol definitions +-- +insert into Controls values (1,'pelco-d','Local','/usr/local/bin/zmcontrol-pelco-d.pl',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0); +insert into Controls values (2,'visca','Local','/usr/local/bin/zmcontrol-visca.pl',1,1,0,1,0,0,0,1,0,16384,10,4000,1,1,6,1,1,1,0,1,0,1536,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,3,1,1,1,1,0,1,1,0,1,-15578,15578,100,10000,1,1,50,1,254,1,-7789,7789,100,5000,1,1,50,1,254,0,0); +insert into Controls values (3,'KX-HCM10','Remote','/usr/local/bin/zmcontrol-kx-hcm10.pl',0,0,0,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,8,1,1,1,0,1,0,0,1,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0); +insert into Controls values (4,'pelco-d-full','Local','/usr/local/bin/zmcontrol-pelco-d.pl',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0); + +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.21.0.sql b/db/zm_update-1.21.0.sql new file mode 100644 index 000000000..4ef18e511 --- /dev/null +++ b/db/zm_update-1.21.0.sql @@ -0,0 +1,31 @@ +-- +-- This updates a 1.21.0 database to 1.21.1 +-- +-- Make changes to Monitors table +-- +alter table Monitors modify column Orientation enum('0','90','180','270','hori','vert') NOT NULL default '0'; +alter table Monitors add column AutoStopTimeout decimal(5,2) default NULL after ControlAddress; +-- +-- Make changes to Stats table +-- +alter table Stats modify column MinBlobSize int(10) unsigned NOT NULL default '0'; +alter table Stats modify column MaxBlobSize int(10) unsigned NOT NULL default '0'; +-- +-- Make changes to Zones table +-- +alter table Zones modify column MinBlobPixels int(10) unsigned default NULL; +alter table Zones modify column MaxBlobPixels int(10) unsigned default NULL; +-- +-- Add in extra PTZ protocol +-- +insert into Controls values (0,'PELCO-P','Local','/usr/local/bin/zmcontrol-pelco-p.pl',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0); +INSERT INTO Controls VALUES (0,'Axis API v2','Remote','/usr/local/bin/zmcontrol-axis-v2.pl',0,0,0,1,0,0,1,0,0,9999,10,2500,0,NULL,NULL,1,1,0,1,0,0,9999,10,2500,0,NULL,NULL,1,1,0,1,0,0,9999,10,2500,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,12,1,1,1,1,1,0,1,0,1,-360,360,1,90,0,NULL,NULL,0,NULL,1,-360,360,1,90,0,NULL,NULL,0,NULL,0,0); +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.21.1.sql b/db/zm_update-1.21.1.sql new file mode 100644 index 000000000..aedfe7d29 --- /dev/null +++ b/db/zm_update-1.21.1.sql @@ -0,0 +1,13 @@ +-- +-- This updates a 1.21.1 database to 1.21.2 +-- +-- No changes required +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.21.2.sql b/db/zm_update-1.21.2.sql new file mode 100644 index 000000000..c47aa54cf --- /dev/null +++ b/db/zm_update-1.21.2.sql @@ -0,0 +1,13 @@ +-- +-- This updates a 1.21.2 database to 1.21.3 +-- +-- No changes required +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.21.3.sql b/db/zm_update-1.21.3.sql new file mode 100644 index 000000000..0ecf4b862 --- /dev/null +++ b/db/zm_update-1.21.3.sql @@ -0,0 +1,25 @@ +-- +-- This updates a 1.21.3 database to 1.21.4 +-- +alter table Monitors add column WebColour varchar(32) not null default 'red'; +update Monitors set WebColour = concat( '#', hex(14*rand()),hex(15*rand()),hex(14*rand()),hex(15*rand()),hex(14*rand()),hex(15*rand()) ); +alter table Monitors add column Sequence smallint unsigned; +alter table Monitors modify column Device tinytext; +update Monitors set Device = concat( "/dev/video", Device ); +update Monitors set Device = NULL where Type = "Remote"; +alter table Monitors add column DefaultScale smallint unsigned after ReturnDelay; +alter table Monitors modify column Type enum('Local','Remote','File') NOT NULL default 'Local'; +alter table Events add column Height smallint(5) unsigned not null default '0' after EndTime; +alter table Events add column Width smallint(5) unsigned not null default '0' after EndTime; +alter table Users add column Control enum('None','View','Edit') NOT NULL default 'None' after Events; +update Users set Control = System; +alter table Users add column MaxBandwidth varchar(16) not null default '' after System; +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.21.4.sql b/db/zm_update-1.21.4.sql new file mode 100644 index 000000000..3fd2444f3 --- /dev/null +++ b/db/zm_update-1.21.4.sql @@ -0,0 +1,134 @@ +-- +-- This updates a 1.21.4 database to 1.22.0 +-- +alter table Monitors change column RunMode Enabled tinyint(3) unsigned NOT NULL default '1'; +alter table Monitors add column DefaultRate smallint unsigned not null default 100 after ReturnDelay; +-- +alter table Events add column Videoed tinyint unsigned not null default 0 after Archived; +alter table Filters add column AutoVideo tinyint unsigned not null default 0 after AutoArchive; +alter table Filters add column Temp tinyint unsigned not null default 0; +update Filters set Temp = AutoDelete; +alter table Filters drop column AutoDelete; +alter table Filters change column Temp AutoDelete tinyint unsigned not null default 0; +alter table Filters change column AutoExecute AutoExecuteCmd tinytext; +alter table Filters add column AutoExecute tinyint unsigned not null default 0 after AutoMessage; +update Filters set AutoExecute = if(isnull(AutoExecuteCmd)||AutoExecuteCmd='', 0, 1 ); +-- +alter table Zones add column NumCoords tinyint(3) unsigned NOT NULL default '0' after Units; +alter table Zones add column Coords tinytext NOT NULL after NumCoords; +alter table Zones add column Area int(10) unsigned not null default 0 after Coords; +alter table Zones modify column AlarmRGB int(10) unsigned default '0'; +alter table Zones add index MonitorId (MonitorId); +-- +insert into Controls values ('','Neu-Fusion NCS370','Remote','zmcontrol-ncs370.pl',0,0,0,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,24,1,0,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0); + +-- +-- Table structure for table `MonitorPresets` +-- +CREATE TABLE MonitorPresets ( + Id int(10) unsigned NOT NULL auto_increment, + Name varchar(64) NOT NULL, + Type enum('Local','Remote','File') NOT NULL default 'Local', + Device tinytext, + Channel varchar(32) default NULL, + Format varchar(32) default NULL, + Host varchar(64) default NULL, + Port varchar(8) default NULL, + Path varchar(255) default NULL, + Width smallint(5) unsigned default NULL, + Height smallint(5) unsigned default NULL, + Palette tinyint(3) unsigned default NULL, + MaxFPS decimal(5,2) default NULL, + Controllable tinyint(3) unsigned NOT NULL default '0', + ControlId varchar(16) default NULL, + ControlDevice varchar(255) default NULL, + ControlAddress varchar(255) default NULL, + DefaultRate smallint(5) unsigned NOT NULL default '100', + DefaultScale smallint(5) unsigned NOT NULL default '100', + PRIMARY KEY (Id) +) TYPE=MyISAM; + +-- +-- Dumping data for table `MonitorPresets` +-- +INSERT INTO MonitorPresets VALUES ('','BTTV Video, PAL, 320x240','Local','/dev/video','','0',NULL,NULL,NULL,320,240,4,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video, PAL, 320x240, max 5 FPS','Local','/dev/video','','0',NULL,NULL,NULL,320,240,4,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video, PAL, 640x480','Local','/dev/video','','0',NULL,NULL,NULL,640,480,4,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video, PAL, 640x480, max 5 FPS','Local','/dev/video','','0',NULL,NULL,NULL,640,480,4,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video, NTSC, 320x240','Local','/dev/video','','1',NULL,NULL,NULL,320,240,4,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video, NTSC, 320x240, max 5 FPS','Local','/dev/video','','1',NULL,NULL,NULL,320,240,4,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video, NTSC, 640x480','Local','/dev/video','','1',NULL,NULL,NULL,640,480,4,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video, NTSC, 640x480, max 5 FPS','Local','/dev/video','','1',NULL,NULL,NULL,640,480,4,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, mpjpeg','Remote',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240',320,240,4,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, mpjpeg, max 5 FPS','Remote',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&req_fps=5',320,240,4,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, jpeg','Remote',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',320,240,4,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, jpeg, max 5 FPS','Remote',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',320,240,4,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, mpjpeg','Remote',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480',640,480,4,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, mpjpeg, max 5 FPS','Remote',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=5',640,480,4,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, jpeg','Remote',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',640,480,4,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, jpeg, max 5 FPS','Remote',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',640,480,4,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 320x240, mpjpeg','Remote',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240',320,240,4,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 320x240, mpjpeg, max 5 FPS','Remote',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&req_fps=5',320,240,4,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 320x240, jpeg','Remote',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',320,240,4,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 320x240, jpeg, max 5 FPS','Remote',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',320,240,4,5.0,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 640x480, mpjpeg','Remote',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480',640,480,4,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 640x480, mpjpeg, max 5 FPS','Remote',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=5',640,480,4,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 640x480, jpeg','Remote',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',640,480,4,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP PTZ, 640x480, jpeg, max 5 FPS','Remote',NULL,NULL,NULL,'',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',640,480,4,5.0,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 320x240, mpjpeg','Remote',NULL,NULL,NULL,'',80,'/nphMotionJpeg?Resolution=320x240&Quality=Standard',320,240,4,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 320x240, jpeg','Remote',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',320,240,4,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 320x240, jpeg, max 5 FPS','Remote',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',320,240,4,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 640x480, mpjpeg','Remote',NULL,NULL,NULL,'',80,'/nphMotionJpeg?Resolution=640x480&Quality=Standard',640,480,4,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 640x480, jpeg','Remote',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',640,480,4,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP, 640x480, jpeg, max 5 FPS','Remote',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',640,480,4,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 320x240, mpjpeg','Remote',NULL,NULL,NULL,'',80,'/nphMotionJpeg?Resolution=320x240&Quality=Standard',320,240,4,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 320x240, jpeg','Remote',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',320,240,4,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 320x240, jpeg, max 5 FPS','Remote',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',320,240,4,5.0,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 640x480, mpjpeg','Remote',NULL,NULL,NULL,'',80,'/nphMotionJpeg?Resolution=640x480&Quality=Standard',640,480,4,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 640x480, jpeg','Remote',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',640,480,4,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES ('','Panasonic IP PTZ, 640x480, jpeg, max 5 FPS','Remote',NULL,NULL,NULL,'',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',640,480,4,5.0,1,5,NULL,':',100,100); + +-- +-- Table structure for table `ZonePresets` +-- +CREATE TABLE ZonePresets ( + Id int(10) unsigned NOT NULL auto_increment, + Name varchar(64) NOT NULL default '', + Type enum('Active','Inclusive','Exclusive','Preclusive','Inactive') NOT NULL default 'Active', + Units enum('Pixels','Percent') NOT NULL default 'Pixels', + CheckMethod enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs', + MinPixelThreshold smallint(5) unsigned default NULL, + MaxPixelThreshold smallint(5) unsigned default NULL, + MinAlarmPixels int(10) unsigned default NULL, + MaxAlarmPixels int(10) unsigned default NULL, + FilterX tinyint(3) unsigned default NULL, + FilterY tinyint(3) unsigned default NULL, + MinFilterPixels int(10) unsigned default NULL, + MaxFilterPixels int(10) unsigned default NULL, + MinBlobPixels int(10) unsigned default NULL, + MaxBlobPixels int(10) unsigned default NULL, + MinBlobs smallint(5) unsigned default NULL, + MaxBlobs smallint(5) unsigned default NULL, + PRIMARY KEY (Id), + UNIQUE KEY UC_Id (Id) +) TYPE=MyISAM; + +-- +-- Dumping data for table `ZonePresets` +-- +INSERT INTO ZonePresets VALUES (1,'Fast, low sensitivity','Active','Percent','AlarmedPixels',25,NULL,20,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO ZonePresets VALUES (2,'Fast, medium sensitivity','Active','Percent','AlarmedPixels',15,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO ZonePresets VALUES (3,'Fast, high sensitivity','Active','Percent','AlarmedPixels',10,NULL,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO ZonePresets VALUES (4,'Best, low sensitivity','Active','Percent','Blobs',25,NULL,36,NULL,7,7,24,NULL,20,NULL,1,NULL); +INSERT INTO ZonePresets VALUES (5,'Best, medium sensitivity','Active','Percent','Blobs',15,NULL,16,NULL,5,5,12,NULL,10,NULL,1,NULL); +INSERT INTO ZonePresets VALUES (6,'Best, high sensitivity','Active','Percent','Blobs',10,NULL,8,NULL,3,3,6,NULL,5,NULL,1,NULL); + +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.22.0.sql b/db/zm_update-1.22.0.sql new file mode 100644 index 000000000..30bf17066 --- /dev/null +++ b/db/zm_update-1.22.0.sql @@ -0,0 +1,56 @@ +-- +-- This updates a 1.22.0 database to 1.22.1 +-- + +-- +-- Add support for linked monitors +-- +alter table Monitors add column LinkedMonitors varchar(255) NOT NULL default '' after Enabled; + +-- +-- Revise some defaults and sizes +-- +alter table Monitors modify column Device varchar(64) not null default ''; +alter table Monitors modify column Host varchar(64) not null default ''; +alter table Monitors modify column Port varchar(8) not null default ''; +alter table Monitors modify column Path varchar(255) not null default ''; +alter table Monitors modify column LabelX smallint(5) unsigned not null default 0; +alter table Monitors modify column LabelY smallint(5) unsigned not null default 0; +alter table Monitors modify column MaxFPS decimal(5,2) default NULL; +update Monitors set MaxFPS = NULL where MaxFPS = 0.00; + +-- +-- Add monitor specific alarm max FPS +-- +alter table Monitors add column AlarmMaxFPS decimal(5,2) default NULL after MaxFPS; + +-- +-- Add average pixel difference to stats +-- +alter table Stats add column PixelDiff tinyint(3) unsigned NOT NULL default '0' after FrameId; + +-- +-- Add some new monitor presets +-- +INSERT INTO MonitorPresets VALUES ('','Axis IP, 320x240, mpjpeg, B&W','Remote',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&color=0',320,240,4,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Axis IP, 640x480, mpjpeg, B&W','Remote',NULL,NULL,NULL,'',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&color=0',640,480,4,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Gadspot IP, jpeg, max 5 FPS','Remote',NULL,NULL,NULL,'',80,'/Jpeg/CamImg.jpg',NULL,NULL,4,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Gadspot IP, mpjpeg','Remote',NULL,NULL,NULL,'',80,'/GetData.cgi',NULL,NULL,4,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','Gadspot IP, mpjpeg','Remote',NULL,NULL,NULL,'',80,'/Jpeg/CamImg.jpg',NULL,NULL,4,5.0,0,NULL,NULL,NULL,100,100); + +-- +-- Modify zone presets a bit +-- +UPDATE ZonePresets SET MinPixelThreshold = 60 WHERE Id = 1 OR Id = 4; +UPDATE ZonePresets SET MinPixelThreshold = 40 WHERE Id = 2 OR Id = 5; +UPDATE ZonePresets SET MinPixelThreshold = 20 WHERE Id = 3 OR Id = 6; + +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.22.1.sql b/db/zm_update-1.22.1.sql new file mode 100644 index 000000000..86429c561 --- /dev/null +++ b/db/zm_update-1.22.1.sql @@ -0,0 +1,26 @@ +-- +-- This updates a 1.22.1 database to 1.22.2 +-- + +-- +-- Add missing Zone Preset +-- +replace into ZonePresets values (6,'Best, high sensitivity','Active','Percent','Blobs',20,NULL,8,NULL,3,3,6,NULL,5,NULL,1,NULL); + +-- +-- Remove redundant Zone columns +-- +alter table Zones drop column LoX; +alter table Zones drop column HiX; +alter table Zones drop column LoY; +alter table Zones drop column HiY; + +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.22.2.sql b/db/zm_update-1.22.2.sql new file mode 100644 index 000000000..dcc8523dd --- /dev/null +++ b/db/zm_update-1.22.2.sql @@ -0,0 +1,63 @@ +-- +-- This updates a 1.22.2 database to 1.22.3 +-- + +-- +-- Add new Background column into Filters +-- +alter table Filters add column Background tinyint(1) unsigned not null default 0; + +-- +-- Set the Background flag for any filters currently saved with Auto tasks +-- +update Filters set Background = 1 where (AutoArchive = 1 or AutoVideo = 1 or AutoUpload = 1 or AutoEmail = 1 or AutoMessage = 1 or AutoExecute = 1 or AutoDelete = 1); + +-- +-- Add default view column into Monitors +-- +alter table Monitors add column DefaultView enum ('Events','Control') not null default 'Events' after ReturnDelay; +alter table Monitors modify LabelFormat varchar(64) NOT NULL default '%%s - %y/%m/%d %H:%M:%S'; + +-- +-- Add device permissions column into Users, set the permissions for existing users to +-- be the same as for Monitors as a default +-- +alter table Users add column Devices enum('None','View','Edit') NOT NULL default 'None' after Monitors; +update Users set Devices = Monitors; + +-- +-- Increase size of Notes field in Events +-- +alter table Events modify column Notes text; + +-- +-- Create new preset labels table +-- +CREATE TABLE `ControlPresets` ( + `MonitorId` int(10) unsigned NOT NULL default '0', + `Preset` int(10) unsigned NOT NULL default '0', + `Label` varchar(64) NOT NULL default '', + PRIMARY KEY (`MonitorId`,`Preset`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Create new devices table +-- +CREATE TABLE `Devices` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` tinytext NOT NULL, + `Type` enum('X10') NOT NULL default 'X10', + `KeyString` varchar(32) NOT NULL default '', + PRIMARY KEY (`Id`), + UNIQUE KEY `UC_Id` (`Id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.22.3.sql b/db/zm_update-1.22.3.sql new file mode 100644 index 000000000..d86b4d021 --- /dev/null +++ b/db/zm_update-1.22.3.sql @@ -0,0 +1,70 @@ +-- +-- This updates a 1.22.3 database to 1.23.0 +-- + +-- +-- Add a column for buffer replay streams +-- +alter table Monitors add column `StreamReplayBuffer` int(10) unsigned NOT NULL default '1000' after PostEventCount; + +-- +-- Change the default timestamp format +-- +alter table Monitors modify column `LabelFormat` varchar(64) NOT NULL default '%N - %y/%m/%d %H:%M:%S'; + +-- +-- Add a column for signal check colour +-- +alter table Monitors add column `SignalCheckColour` varchar(32) NOT NULL default '#0100BE' after DefaultScale; + +-- +-- Increase the size of the run state definition column +-- +alter table States modify column Definition text; + +-- +-- Add overload shutout to zones and presets +-- +alter table Zones add column OverloadFrames smallint(5) unsigned NOT NULL default '0' after MaxBlobs; +alter table ZonePresets add column OverloadFrames smallint(5) unsigned NOT NULL default '0' after MaxBlobs; + +-- +-- Change control command to protocol module +-- +alter table Controls add column Protocol varchar(32) after Command; +update Controls set Protocol = "PelcoD" where Command like "%zmcontrol-pelco-d.pl"; +update Controls set Protocol = "PelcoP" where Command like "%zmcontrol-pelco-p.pl"; +update Controls set Protocol = "Visca" where Command like "%zmcontrol-visca.pl"; +update Controls set Protocol = "PanasonicIP" where Command like "%zmcontrol-panasonic-ip.pl"; +update Controls set Protocol = "AxisV2" where Command like "%zmcontrol-axis-v2.pl"; +update Controls set Protocol = "Ncs370" where Command like "%zmcontrol-ncs370.pl"; +update Controls set Protocol = "VclTP" where Command like "%zmcontrol-vcltp.pl"; +alter table Controls drop column Command; + +-- +-- Drop some duplicate/redundant indices +-- +alter table Config drop index `UC_Name`; +alter table Controls drop index `UC_Id`; +alter table Devices drop index `UC_Id`; +alter table Events drop index `UC_Id`; +alter table Frames drop index `UC_Id`; +alter table Users drop index `UC_Id`; +alter table ZonePresets drop index `UC_Id`; +alter table Zones drop index `UC_Id`; +alter table Events drop primary key; +alter table Events add primary key ( `Id`, `MonitorId` ); +alter table Events drop index `Id`; +alter table Frames drop column `Id`; +alter table Frames drop index `EventId`; +alter table Frames add primary key ( `EventId`, `FrameId` ); + +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.23.0.sql b/db/zm_update-1.23.0.sql new file mode 100644 index 000000000..d521e2f09 --- /dev/null +++ b/db/zm_update-1.23.0.sql @@ -0,0 +1,18 @@ +-- +-- This updates a 1.23.0 database to 1.23.1 +-- + +-- +-- Change protocol field slightly +-- +alter table Controls modify Protocol varchar(64); + +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.23.1.sql b/db/zm_update-1.23.1.sql new file mode 100644 index 000000000..bc0c4fa28 --- /dev/null +++ b/db/zm_update-1.23.1.sql @@ -0,0 +1,19 @@ +-- +-- This updates a 1.23.1 database to 1.23.2 +-- + +-- +-- Rename and fix typo version of PurgeWhenFull +-- +update Filters set Name = "PurgeWhenFull" where Name = "xPurgeWhenFull"; +update Filters set Query = 'a:4:{s:5:"terms";a:2:{i:0;a:3:{s:3:"val";s:1:"0";s:4:"attr";s:8:"Archived";s:2:"op";s:1:"=";}i:1;a:4:{s:3:"cnj";s:3:"and";s:3:"val";s:2:"95";s:4:"attr";s:11:"DiskPercent";s:2:"op";s:2:">=";}}s:10:"sort_field";s:2:"Id";s:8:"sort_asc";s:1:"1";s:5:"limit";s:2:"5";}' where Name = "PurgeWhenFull" and Query like "trms=%"; + +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.23.2.sql b/db/zm_update-1.23.2.sql new file mode 100644 index 000000000..3897a4dda --- /dev/null +++ b/db/zm_update-1.23.2.sql @@ -0,0 +1,18 @@ +-- +-- This updates a 1.23.2 database to 1.23.3 +-- + +-- +-- Rename and fix typo version of PurgeWhenFull +-- +update Filters set Query = 'a:4:{s:5:"terms";a:2:{i:0;a:3:{s:3:"val";s:1:"0";s:4:"attr";s:8:"Archived";s:2:"op";s:1:"=";}i:1;a:4:{s:3:"cnj";s:3:"and";s:3:"val";s:2:"95";s:4:"attr";s:11:"DiskPercent";s:2:"op";s:2:">=";}}s:10:"sort_field";s:2:"Id";s:8:"sort_asc";s:1:"1";s:5:"limit";s:1:"5";}' where Name = "PurgeWhenFull" and Query = 'a:4:{s:5:"terms";a:2:{i:0;a:3:{s:3:"val";s:1:"0";s:4:"attr";s:8:"Archived";s:2:"op";s:1:"=";}i:1;a:4:{s:3:"cnj";s:3:"and";s:3:"val";s:2:"95";s:4:"attr";s:11:"DiskPercent";s:2:"op";s:2:">=";}}s:10:"sort_field";s:2:"Id";s:8:"sort_asc";s:1:"1";s:5:"limit";s:2:"5";}'; + +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.23.3.sql b/db/zm_update-1.23.3.sql new file mode 100644 index 000000000..5c1757fca --- /dev/null +++ b/db/zm_update-1.23.3.sql @@ -0,0 +1,83 @@ +-- +-- This updates a 1.23.3 database to 1.24.0 +-- + +-- +-- Add protocol column for monitors +-- +alter table Monitors add column `Protocol` varchar(16) not null default '' after `Format`; +alter table MonitorPresets add column `Protocol` varchar(16) default NULL after `Format`; +update Monitors set Protocol = "http" where Type = "Remote"; +update MonitorPresets set Protocol = "http" where Type = "Remote"; + +-- +-- Add method column for monitors; +-- +alter table Monitors add column `Method` varchar(16) not null default '' after `Protocol`; +alter table MonitorPresets add column `Method` varchar(16) default NULL after `Protocol`; +update Monitors set Method = "simple" where Type = "Remote" and ( select Value from Config where Name = "ZM_NETCAM_REGEXPS" ) = 0; +update Monitors set Method = "regexp" where Type = "Remote" and ( select Value from Config where Name = "ZM_NETCAM_REGEXPS" ) = 1; +update MonitorPresets set Method = "simple" where Type = "Remote" and ( select Value from Config where Name = "ZM_NETCAM_REGEXPS" ) = 0; +update MonitorPresets set Method = "regexp" where Type = "Remote" and ( select Value from Config where Name = "ZM_NETCAM_REGEXPS" ) = 1; + +-- +-- Add subpath for remote RTSP monitors (only for now at least) +-- +alter table Monitors add column `SubPath` varchar(64) not null default '' after `Path`; +alter table MonitorPresets add column `SubPath` varchar(64) default NULL after `Path`; + +-- +-- Update Palette for new meaning as Colours for non-Local monitors +-- +update Monitors set Palette = 3 where Type != 'Local' and Palette = 4; +update MonitorPresets set Palette = 3 where Type != 'Local' and Palette = 4; + +-- +-- Update Method for Local monitors +-- +update Monitors set Method = "v4l1" where Type = 'Local'; + +-- +-- Add monitor type for FFMPEG cameras +-- +alter table Monitors modify column `Type` enum('Local','Remote','File','Ffmpeg') NOT NULL default 'Local'; +alter table MonitorPresets modify column `Type` enum('Local','Remote','File','Ffmpeg') NOT NULL default 'Local'; + +-- +-- Fix columns to fit V4L2 formats and palettes +-- +alter table Monitors modify column `Format` int(10) unsigned NOT NULL default '0'; +alter table Monitors modify column `Palette` int(10) unsigned NOT NULL default '0'; +alter table MonitorPresets modify column `Channel` tinyint(3) unsigned default NULL; +alter table MonitorPresets modify column `Format` int(10) unsigned default NULL; +alter table MonitorPresets modify column `Palette` int(10) unsigned default NULL; + +-- +-- Add in new MPEG presets +-- +insert into MonitorPresets values ('','Axis IP, mpeg4, unicast','Remote',NULL,NULL,NULL,'rtsp','rtpUni','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +insert into MonitorPresets values ('','Axis IP, mpeg4, multicast','Remote',NULL,NULL,NULL,'rtsp','rtpMulti','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +insert into MonitorPresets values ('','Axis IP, mpeg4, RTP/RTSP','Remote',NULL,NULL,NULL,'rtsp','rtpRtsp','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +insert into MonitorPresets values ('','Axis IP, mpeg4, RTP/RTSP/HTTP','Remote',NULL,NULL,NULL,'rtsp','rtpRtspHttp','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +insert into MonitorPresets values ('','ACTi IP, mpeg4, unicast','Remote',NULL,NULL,NULL,'rtsp','rtpUni','',7070,'','/track',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); + +-- +-- Get rid of never used columnn Learn State +-- +alter table Events drop column LearnState; + +-- +-- Update for new event close mode +-- +update Config set Value = "time" where Name = "ZM_EVENT_CLOSE_MODE" and ( select Value from ( select * from Config ) as TempConfig where Name = "ZM_FORCE_CLOSE_EVENTS" ) = 1; +update Config set Value = "idle" where Name = "ZM_EVENT_CLOSE_MODE" and ( select Value from ( select * from Config ) as TempConfig where Name = "ZM_FORCE_CLOSE_EVENTS" ) = 0; + +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.24.0.sql b/db/zm_update-1.24.0.sql new file mode 100644 index 000000000..ea2b2dcfa --- /dev/null +++ b/db/zm_update-1.24.0.sql @@ -0,0 +1,17 @@ +-- +-- This updates a 1.24.0 database to 1.24.1 +-- + +-- +-- No database changes +-- + +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.24.1.sql b/db/zm_update-1.24.1.sql new file mode 100644 index 000000000..903ef0b81 --- /dev/null +++ b/db/zm_update-1.24.1.sql @@ -0,0 +1,34 @@ +-- +-- This updates a 1.24.1 database to the next version +-- + +-- +-- Replace local presets with V4L versioned ones +-- +delete from MonitorPresets where Type = 'Local'; +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), PAL, 320x240','Local','/dev/video','',255,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), PAL, 320x240, max 5 FPS','Local','/dev/video','',255,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), PAL, 640x480','Local','/dev/video','',255,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), PAL, 640x480, max 5 FPS','Local','/dev/video','',255,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), NTSC, 320x240','Local','/dev/video','',45056,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), NTSC, 320x240, max 5 FPS','Local','/dev/video','',45056,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), NTSC, 640x480','Local','/dev/video','',45056,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L2), NTSC, 640x480, max 5 FPS','Local','/dev/video','',45056,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), PAL, 320x240','Local','/dev/video','',0,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), PAL, 320x240, max 5 FPS','Local','/dev/video','',0,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), PAL, 640x480','Local','/dev/video','',0,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), PAL, 640x480, max 5 FPS','Local','/dev/video','',0,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), NTSC, 320x240','Local','/dev/video','',1,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), NTSC, 320x240, max 5 FPS','Local','/dev/video','',1,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), NTSC, 640x480','Local','/dev/video','',1,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES ('','BTTV Video (V4L1), NTSC, 640x480, max 5 FPS','Local','/dev/video','',1,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,5.0,0,NULL,NULL,NULL,100,100); + +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.24.2.sql b/db/zm_update-1.24.2.sql new file mode 100644 index 000000000..0d93185e6 --- /dev/null +++ b/db/zm_update-1.24.2.sql @@ -0,0 +1,22 @@ +-- +-- This updates a 1.24.2 database to the next version +-- + +-- +-- Add in remote ZoneMinder preset. +-- +INSERT INTO `MonitorPresets` VALUES ('','Axis FFMPEG H.264','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp:///axis-media/media.amp?videocodec=h264',NULL,NULL,NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO `MonitorPresets` VALUES ('','Vivotek FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp://:554/live.sdp',NULL,NULL,NULL,352,240,NULL,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO `MonitorPresets` VALUES ('','Axis FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp:///axis-media/media.amp',NULL,NULL,NULL,640,480,NULL,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO `MonitorPresets` VALUES ('','ACTi TCM FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp://admin:123456@:7070',NULL,NULL,NULL,320,240,NULL,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO `MonitorPresets` VALUES ('','Remote ZoneMinder','Remote',NULL,NULL,NULL,'http','simple','',80,'/cgi-bin/nph-zms?mode=jpeg&monitor=&scale=100&maxfps=5&buffer=0',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); + +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.24.3.sql b/db/zm_update-1.24.3.sql new file mode 100644 index 000000000..6243e08fa --- /dev/null +++ b/db/zm_update-1.24.3.sql @@ -0,0 +1,13 @@ +-- +-- This updates a 1.24.3 database to the next version +-- + +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-1.24.4.sql b/db/zm_update-1.24.4.sql new file mode 100644 index 000000000..49253e5c0 --- /dev/null +++ b/db/zm_update-1.24.4.sql @@ -0,0 +1,30 @@ +-- +-- This updates a 1.24.4 database to the next version +-- + +-- +-- Create Logs table +-- TODO - defaults to MyISAM as not easy to import selected engine +-- + +CREATE TABLE `Logs` ( + `TimeKey` decimal(16,6) NOT NULL, + `Component` varchar(32) NOT NULL, + `Pid` smallint(6) DEFAULT NULL, + `Level` tinyint(3) NOT NULL, + `Code` char(3) NOT NULL, + `Message` varchar(255) NOT NULL, + `File` varchar(255) DEFAULT NULL, + `Line` smallint(5) unsigned DEFAULT NULL, + KEY `TimeKey` (`TimeKey`) +) ENGINE=MyISAM; + +-- +-- These are optional, but we might as well do it now +-- +optimize table Frames; +optimize table Events; +optimize table Filters; +optimize table Zones; +optimize table Monitors; +optimize table Stats; diff --git a/db/zm_update-kfir-to-zum.sql b/db/zm_update-kfir-to-zum.sql new file mode 100644 index 000000000..be23f33f3 --- /dev/null +++ b/db/zm_update-kfir-to-zum.sql @@ -0,0 +1,24 @@ +-- +-- Table structure for table `PluginsConfig` +-- + +CREATE TABLE IF NOT EXISTS `PluginsConfig` ( + `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `Name` varchar(32) NOT NULL DEFAULT '', + `Value` text NOT NULL, + `Type` tinytext NOT NULL, + `Choices` text NOT NULL, + `MonitorId` int(10) unsigned NOT NULL, + `ZoneId` int(10) unsigned NOT NULL, + `pluginName` tinytext NOT NULL, + PRIMARY KEY (`Id`), + KEY `ZoneId` (`ZoneId`), + KEY `MonitorId` (`MonitorId`), + KEY `Name` (`Name`), + FULLTEXT KEY `pluginName` (`pluginName`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; + + +ALTER TABLE `Monitors` ADD `UsedPl` varchar(88) NOT NULL default '' AFTER `Sequence`; +ALTER TABLE `Monitors` ADD `DoNativeMotDet` varchar(5) NOT NULL default 'yes' AFTER `UsedPl`; + diff --git a/db/zm_update_1.25.0-to-zum.sql b/db/zm_update_1.25.0-to-zum.sql new file mode 100644 index 000000000..e1b7b1575 --- /dev/null +++ b/db/zm_update_1.25.0-to-zum.sql @@ -0,0 +1,26 @@ +-- +-- Table structure for table `PluginsConfig` +-- + +CREATE TABLE IF NOT EXISTS `PluginsConfig` ( + `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `Name` varchar(32) NOT NULL DEFAULT '', + `Value` text NOT NULL, + `Type` tinytext NOT NULL, + `Choices` text NOT NULL, + `MonitorId` int(10) unsigned NOT NULL, + `ZoneId` int(10) unsigned NOT NULL, + `pluginName` tinytext NOT NULL, + PRIMARY KEY (`Id`), + KEY `ZoneId` (`ZoneId`), + KEY `MonitorId` (`MonitorId`), + KEY `Name` (`Name`), + FULLTEXT KEY `pluginName` (`pluginName`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; + + +ALTER TABLE `Monitors` ADD `UsedPl` varchar(88) NOT NULL default '' AFTER `Sequence`; +ALTER TABLE `Monitors` ADD `DoNativeMotDet` varchar(5) NOT NULL default 'yes' AFTER `UsedPl`; +ALTER TABLE `Monitors` ADD `Colours` TINYINT UNSIGNED NOT NULL DEFAULT '1' AFTER `Height`; +ALTER TABLE `Monitors` ADD `Deinterlacing` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `Orientation`; + diff --git a/depcomp b/depcomp new file mode 100755 index 000000000..807b991f4 --- /dev/null +++ b/depcomp @@ -0,0 +1,423 @@ +#! /bin/sh + +# depcomp - compile a program generating dependencies as side-effects +# Copyright 1999, 2000 Free Software Foundation, Inc. + +# 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, 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. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi +# `libtool' can also be set to `yes' or `no'. + +if test -z "$depfile"; then + base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` + dir=`echo "$object" | sed 's,/.*$,/,'` + if test "$dir" = "$object"; then + dir= + fi + # FIXME: should be _deps on DOS. + depfile="$dir.deps/$base" +fi + +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. This file always lives in the current directory. + # Also, the AIX compiler puts `$object:' at the start of each line; + # $object doesn't have directory information. + stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + outname="$stripped.o" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + tmpdepfile1="$dir.libs/$base.lo.d" + tmpdepfile2="$dir.libs/$base.d" + "$@" -Wc,-MD + else + tmpdepfile1="$dir$base.o.d" + tmpdepfile2="$dir$base.d" + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + if test -f "$tmpdepfile1"; then + tmpdepfile="$tmpdepfile1" + else + tmpdepfile="$tmpdepfile2" + fi + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a space and a tab in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. We will use -o /dev/null later, + # however we can't do the remplacement now because + # `-o $object' might simply not be used + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + "$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + -*) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 diff --git a/description-pak b/description-pak new file mode 100644 index 000000000..368e50fce --- /dev/null +++ b/description-pak @@ -0,0 +1 @@ +Zoneminder with kfir performances patches and plugin patches from UnixMedia diff --git a/doc-pak/AUTHORS b/doc-pak/AUTHORS new file mode 100644 index 000000000..7f0362072 --- /dev/null +++ b/doc-pak/AUTHORS @@ -0,0 +1,6 @@ +ZoneMinder - A Linux based camera monitoring and analysis tool. + +This project was imagined and created by Philip Coombes in +September 2002, shortly after being burglarised of his power tools. + +mailto:philip.coombes@zoneminder.com diff --git a/doc-pak/BUGS b/doc-pak/BUGS new file mode 100644 index 000000000..3160e2dce --- /dev/null +++ b/doc-pak/BUGS @@ -0,0 +1 @@ +Please see README file. diff --git a/doc-pak/COPYING b/doc-pak/COPYING new file mode 100644 index 000000000..d60c31a97 --- /dev/null +++ b/doc-pak/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/doc-pak/ChangeLog b/doc-pak/ChangeLog new file mode 100644 index 000000000..3160e2dce --- /dev/null +++ b/doc-pak/ChangeLog @@ -0,0 +1 @@ +Please see README file. diff --git a/doc-pak/INSTALL b/doc-pak/INSTALL new file mode 100644 index 000000000..1de0ac2ad --- /dev/null +++ b/doc-pak/INSTALL @@ -0,0 +1,185 @@ +Basic Installation +================== + + These are generic installation instructions. + + Please see http://www.zoneminder.com/wiki/index.php/Documentation + for full details. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. diff --git a/doc-pak/NEWS b/doc-pak/NEWS new file mode 100644 index 000000000..3160e2dce --- /dev/null +++ b/doc-pak/NEWS @@ -0,0 +1 @@ +Please see README file. diff --git a/doc-pak/README b/doc-pak/README new file mode 100644 index 000000000..e3dfa62e1 --- /dev/null +++ b/doc-pak/README @@ -0,0 +1,5 @@ + +All documentation for ZoneMinder is now online at + +http://www.zoneminder.com/wiki/index.php/Documentation + diff --git a/doc-pak/TODO b/doc-pak/TODO new file mode 100644 index 000000000..69af9c87e --- /dev/null +++ b/doc-pak/TODO @@ -0,0 +1,2 @@ +Please see README file. + diff --git a/install-sh b/install-sh new file mode 100755 index 000000000..e9de23842 --- /dev/null +++ b/install-sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/misc/Makefile.am b/misc/Makefile.am new file mode 100644 index 000000000..3cd03a090 --- /dev/null +++ b/misc/Makefile.am @@ -0,0 +1,6 @@ +AUTOMAKE_OPTIONS = gnu + +EXTRA_DIST = \ + apache.conf.in \ + logrotate.conf.in \ + syslog.conf.in diff --git a/misc/Makefile.in b/misc/Makefile.in new file mode 100644 index 000000000..8597872ce --- /dev/null +++ b/misc/Makefile.in @@ -0,0 +1,406 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = misc +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/apache.conf.in $(srcdir)/logrotate.conf.in \ + $(srcdir)/syslog.conf.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = apache.conf logrotate.conf syslog.conf +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +EXTRA_DIST = \ + apache.conf.in \ + logrotate.conf.in \ + syslog.conf.in + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu misc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu misc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +apache.conf: $(top_builddir)/config.status $(srcdir)/apache.conf.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +logrotate.conf: $(top_builddir)/config.status $(srcdir)/logrotate.conf.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +syslog.conf: $(top_builddir)/config.status $(srcdir)/syslog.conf.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/misc/apache.conf b/misc/apache.conf new file mode 100644 index 000000000..61b3df80e --- /dev/null +++ b/misc/apache.conf @@ -0,0 +1,39 @@ +# +# PLEASE NOTE THAT THIS FILE IS INTENDED FOR GUIDANCE ONLY AND MAY NOT BE APPROPRIATE FOR YOUR DISTRIBUTION +# +# Sample configuration file for running ZoneMinder as name based virtual host +# Some values may need to manually adjusted to suit your setup +# + + ServerName zm.local + ServerAdmin webmaster@localhost + + DocumentRoot "/usr/share/zoneminder" + + Options FollowSymLinks + AllowOverride All + + + ScriptAlias /cgi-bin/ "/usr/lib/cgi-bin" + + Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch + AllowOverride All + + + # Use the first option to have Apache logs written to the general log + # directory, or the second to have them written to the regular Apache + # directory (you may have to change the path to that used on your system) + ErrorLog /var/log/zm/apache-error.log + ErrorLog /var/log/httpd/zm-error.log + + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + + # Use the first option to have Apache logs written to the general log + # directory, or the second to have them written to the regular Apache + # directory (you may have to change the path to that used on your system) + CustomLog /var/log/zm/apache-access.log combined + CustomLog /var/log/httpd/zm-access.log combined + + diff --git a/misc/apache.conf.in b/misc/apache.conf.in new file mode 100644 index 000000000..06c9beb15 --- /dev/null +++ b/misc/apache.conf.in @@ -0,0 +1,39 @@ +# +# PLEASE NOTE THAT THIS FILE IS INTENDED FOR GUIDANCE ONLY AND MAY NOT BE APPROPRIATE FOR YOUR DISTRIBUTION +# +# Sample configuration file for running ZoneMinder as name based virtual host +# Some values may need to manually adjusted to suit your setup +# + + ServerName @WEB_HOST@ + ServerAdmin webmaster@localhost + + DocumentRoot "@WEB_PREFIX@" + + Options FollowSymLinks + AllowOverride All + + + ScriptAlias /cgi-bin/ "@CGI_PREFIX@" + + Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch + AllowOverride All + + + # Use the first option to have Apache logs written to the general log + # directory, or the second to have them written to the regular Apache + # directory (you may have to change the path to that used on your system) + ErrorLog @ZM_LOGDIR@/apache-error.log + ErrorLog /var/log/httpd/zm-error.log + + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + + # Use the first option to have Apache logs written to the general log + # directory, or the second to have them written to the regular Apache + # directory (you may have to change the path to that used on your system) + CustomLog @ZM_LOGDIR@/apache-access.log combined + CustomLog /var/log/httpd/zm-access.log combined + + diff --git a/misc/logrotate.conf b/misc/logrotate.conf new file mode 100644 index 000000000..4205ab899 --- /dev/null +++ b/misc/logrotate.conf @@ -0,0 +1,19 @@ +# +# PLEASE NOTE THAT THIS FILE IS INTENDED FOR GUIDANCE ONLY AND MAY NOT BE APPROPRIATE FOR YOUR DISTRIBUTION +# +# Sample logrotate file for ZoneMinder. Copy this to /etc/logrotate.d/zm or similar +# if you wish your system to prevent your log files from growing too large. +# You can remove the 'kill' of syslogd if you have another logrotate file that does +# this but in that case you will want this file run first, so it will need to be +# named something lexically ahead of the other logrotate file, for example 0zm to +# ensure it is executed first. +# +/var/log/zm/*.log { + missingok + notifempty + sharedscripts + postrotate + /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true + /usr/bin/zmpkg.pl logrot 2> /dev/null > /dev/null || true + endscript +} diff --git a/misc/logrotate.conf.in b/misc/logrotate.conf.in new file mode 100644 index 000000000..664b206c3 --- /dev/null +++ b/misc/logrotate.conf.in @@ -0,0 +1,19 @@ +# +# PLEASE NOTE THAT THIS FILE IS INTENDED FOR GUIDANCE ONLY AND MAY NOT BE APPROPRIATE FOR YOUR DISTRIBUTION +# +# Sample logrotate file for ZoneMinder. Copy this to /etc/logrotate.d/zm or similar +# if you wish your system to prevent your log files from growing too large. +# You can remove the 'kill' of syslogd if you have another logrotate file that does +# this but in that case you will want this file run first, so it will need to be +# named something lexically ahead of the other logrotate file, for example 0zm to +# ensure it is executed first. +# +@ZM_LOGDIR@/*.log { + missingok + notifempty + sharedscripts + postrotate + /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true + @BINDIR@/zmpkg.pl logrot 2> /dev/null > /dev/null || true + endscript +} diff --git a/misc/syslog.conf b/misc/syslog.conf new file mode 100644 index 000000000..79e8f8dcd --- /dev/null +++ b/misc/syslog.conf @@ -0,0 +1,19 @@ +# +# PLEASE NOTE THAT THIS FILE IS INTENDED FOR GUIDANCE ONLY AND MAY NOT BE APPROPRIATE FOR YOUR DISTRIBUTION +# +# Sample instruction to put in /etc/syslog.conf (or rsyslog.conf) to redirect +# ZoneMinder syslog message to a separate file, apart from warnings and errors. +# This is done by assigning ZoneMinder messages to one of the user logging facilities +# which are local0-7. In this example local1 is used but if this is used by other +# packages then this can be changed to another which is unused (e.g. local3). +# + +# Save ZoneMinder messages to zm.log, this uses the local1 facility, +local1.* /var/log/zm/zm.log + +# You will need to edit the existing config line that directs to /var/log/messages +# or /var/log/syslog and insert the 'local1.!*;local1.warning' directives. This +# first excludes all local1 messages, and then re-enables local1 messages of warning +# level or above. Remove the second part if you want no ZoneMinder messages to go +# to your system logs at all. +*.info;local1.!*;local1.warning;mail.none;news.none;authpriv.none;cron.none /var/log/messages diff --git a/misc/syslog.conf.in b/misc/syslog.conf.in new file mode 100644 index 000000000..68df63eaa --- /dev/null +++ b/misc/syslog.conf.in @@ -0,0 +1,19 @@ +# +# PLEASE NOTE THAT THIS FILE IS INTENDED FOR GUIDANCE ONLY AND MAY NOT BE APPROPRIATE FOR YOUR DISTRIBUTION +# +# Sample instruction to put in /etc/syslog.conf (or rsyslog.conf) to redirect +# ZoneMinder syslog message to a separate file, apart from warnings and errors. +# This is done by assigning ZoneMinder messages to one of the user logging facilities +# which are local0-7. In this example local1 is used but if this is used by other +# packages then this can be changed to another which is unused (e.g. local3). +# + +# Save ZoneMinder messages to zm.log, this uses the local1 facility, +local1.* @ZM_LOGDIR@/zm.log + +# You will need to edit the existing config line that directs to /var/log/messages +# or /var/log/syslog and insert the 'local1.!*;local1.warning' directives. This +# first excludes all local1 messages, and then re-enables local1 messages of warning +# level or above. Remove the second part if you want no ZoneMinder messages to go +# to your system logs at all. +*.info;local1.!*;local1.warning;mail.none;news.none;authpriv.none;cron.none /var/log/messages diff --git a/missing b/missing new file mode 100755 index 000000000..6a37006e8 --- /dev/null +++ b/missing @@ -0,0 +1,336 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. +# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# 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, 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. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing 0.4 - GNU automake" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal*) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. + You can get \`$1Help2man' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then + # We have makeinfo, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + tar) + shift + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + fi + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequirements for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 000000000..6b3b5fc5d --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id$ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/plugins/.sconsign.dblite b/plugins/.sconsign.dblite new file mode 100644 index 000000000..fd10c8412 Binary files /dev/null and b/plugins/.sconsign.dblite differ diff --git a/plugins/libzm_plugin_anpr/Makefile b/plugins/libzm_plugin_anpr/Makefile new file mode 100644 index 000000000..b6ec92f59 --- /dev/null +++ b/plugins/libzm_plugin_anpr/Makefile @@ -0,0 +1,60 @@ +#/*********************************************************************** +# This file is part of libzm_anpr_plugin, License Plate REcognition. +# +# Copyright (C) 2012 Franco (nextime) Lanza +# +# LiPRec is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# LiPRec 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with LiPRec. If not, see . +#************************************************************************/ + + +OBJECTS = anpr_plugin.o +SOBJ=anpr_plugin.so + +ZMSRC = zm_detector.cpp zm_config.cpp zm_poly.cpp zm_zone.cpp zm_image.cpp zm_db.cpp +ZMSRC+= zm_logger.cpp zm_utils.cpp zm_thread.cpp zm_jpeg.cpp +ZMOBJ = $(ZMSRC:.cpp=.o) + +#CPPFLAGS= -fpermissive -O3 -march=native -Wall -lliprec -msse2 +CPPFLAGS= -fpermissive -O3 -Wall -lliprec -msse2 +CPPFLAGS+=-D__STDC_CONSTANT_MACROS -DZM_FFMPEG_CVS -DHAVE_LIBCRYPTO +CPPFLAGS+=-DJPEG_INCLUDE_DIR=../../../../../libjpeg-turbo-1.2.1/.libs/ +LDFLAGS=-L. -L../../../../../libjpeg-turbo-1.2.1/.libs/ +LDFLAGS+=-I../../src/ -I../../ -I./ +LDFLAGS+=-L/usr/lib -I/usr/include -I../../../../../libjpeg-turbo-1.2.1/ +LDFLAGS+=$(shell pkg-config --cflags opencv) + +LINKFLAGS=$(shell pkg-config --libs opencv) +LINKFLAGS+= -lliprec -lboost_program_options -lmysqlclient -lpthread -ljpeg -lz + + +all: anpr_plugin.o $(SOBJ) + + +$(ZMOBJ): %.o : ../../src/%.cpp + $(CXX) $^ -fPIC -c -o $@ ${LDFLAGS} $(CPPFLAGS) + +anpr_plugin.o: anpr_plugin.cpp + $(CXX) anpr_plugin.cpp -fPIC -c -o anpr_plugin.o ${LDFLAGS} $(CPPFLAGS) + +anpr_plugin.so: $(ZMOBJ) anpr_plugin.o + $(CXX) -o anpr_plugin.so -Wall anpr_plugin.o -shared $(ZMOBJ) $(LINKFLAGS) + cp anpr_plugin.so libzm_plugin_anpr.zmpl + +install: anpr_plugin.o $(SOBJ) + install -m 0644 libzm_plugin_anpr.zmpl /usr/share/zm/libzm_plugin_anpr.zmpl + $(shell cat plugin.conf >> /usr/share/zm/plugin.conf) + +clean: + rm -f $(OBJECTS) $(ZMOBJ) $(SOBJ) libzm_plugin_anpr.zmpl + diff --git a/plugins/libzm_plugin_anpr/anpr_plugin.cpp b/plugins/libzm_plugin_anpr/anpr_plugin.cpp new file mode 100644 index 000000000..987e4c748 --- /dev/null +++ b/plugins/libzm_plugin_anpr/anpr_plugin.cpp @@ -0,0 +1,250 @@ +/*********************************************************************** + This file is part of libzm_anpr_plugin, License Plate REcognition. + + Copyright (C) 2012 Franco (nextime) Lanza + + LiPRec is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LiPRec 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with LiPRec. If not, see . +************************************************************************/ + + +#define LIST LIPREC_LIST // This is a workaround to avoid the conflict +#include // of typedef LIST in both mysql and tesseract headers... +//#include "opencv2/highgui/highgui.hpp" +#undef LIST +#include "anpr_plugin.h" + +//! Retrieve the engine version we're going to expect +extern "C" int getEngineVersion() +{ + return ZM_ENGINE_VERSION; +} + +//! Tells us to register our functionality to an engine kernel +extern "C" void registerPlugin(PluginManager &PlM, string sPluginName) +{ + PlM.getImageAnalyser().addDetector( + auto_ptr(new ANPRPlugin(sPluginName)) + ); +} + + +using namespace cv; +//using namespace liprec; + +ANPRPlugin::ANPRPlugin() + : Detector(), + m_nMinObjSize(DEFAULT_DETECTOR_MIN_OBJECT_SIZE), + m_nMaxObjSize(DEFAULT_DETECTOR_MAX_OBJECT_SIZE) +{ + m_sDetectionCause = DETECTED_CAUSE; + m_sLogPrefix = LOG_PREFIX; + + + log(LOG_NOTICE, "License Plate Recognition Plugin\'s Object has been created."); +} + + + + +ANPRPlugin::ANPRPlugin(string sPluginName) + : Detector(sPluginName), + m_nMinObjSize(DEFAULT_DETECTOR_MIN_OBJECT_SIZE), + m_nMaxObjSize(DEFAULT_DETECTOR_MAX_OBJECT_SIZE) +{ + m_sDetectionCause = DETECTED_CAUSE; + m_sLogPrefix = LOG_PREFIX; + + log(LOG_NOTICE, "License Plate Recognition Plugin\'s Object has been created."); +} + + + +/*! \fn ANPRPlugin::loadConfig(string sConfigFileName) + * \param sConfigFileName is path to configuration to load parameters from + */ +void ANPRPlugin::loadConfig(string sConfigFileName) +{ + options_description config_file("Configuration file options."); + variables_map vm; + config_file.add_options() + ((m_sConfigSectionName + string(".min-obj-size")).c_str(), + value()->default_value(DEFAULT_DETECTOR_MIN_OBJECT_SIZE)) + ((m_sConfigSectionName + string(".max-obj-size")).c_str(), + value()->default_value(DEFAULT_DETECTOR_MAX_OBJECT_SIZE)) + ((m_sConfigSectionName + string(".alarm-score")).c_str(), + value()->default_value(DEFAULT_ALARM_SCORE)) + ((m_sConfigSectionName + string(".det-cause")).c_str(), + value()->default_value(DETECTED_CAUSE)) + ((m_sConfigSectionName + string(".log-prefix")).c_str(), + value()->default_value(LOG_PREFIX)) + ; + ifstream ifs(sConfigFileName.c_str()); + store(parse_config_file(ifs, config_file, true), vm); + notify(vm); + + m_nMinObjSize = vm[(m_sConfigSectionName + string(".min-obj-size")).c_str()].as(); + m_nMaxObjSize = vm[(m_sConfigSectionName + string(".max-obj-size")).c_str()].as(); + m_nAlarmScore = vm[(m_sConfigSectionName + string(".alarm-score")).c_str()].as(); + + m_sDetectionCause = vm[(m_sConfigSectionName + string(".det-cause")).c_str()].as(); + m_sLogPrefix = vm[(m_sConfigSectionName + string(".log-prefix")).c_str()].as(); + zmLoadConfig(); + log(LOG_NOTICE, "License Plate Recognition Plugin\'s Object is configured."); +} + + + +ANPRPlugin::~ANPRPlugin() +{ +} + + +/*! \fn ANPRPlugin::ANPRPlugin(const ANPRPlugin& source) + * \param source is the object for copying + */ +ANPRPlugin::ANPRPlugin(const ANPRPlugin& source) + : Detector(source), + m_nMinObjSize(source.m_nMinObjSize), + m_nMaxObjSize(source.m_nMaxObjSize) +{ +} + + + +/*! \fn ANPRPlugin:: operator=(const ANPRPlugin& source) + * \param source is the object for copying + */ +ANPRPlugin & ANPRPlugin:: operator=(const ANPRPlugin& source) +{ + Detector::operator=(source); + m_nMinObjSize = source.m_nMinObjSize; + m_nMaxObjSize = source.m_nMaxObjSize; + return *this; +} + + + + +/*! \fn ANPRPlugin::checkZone(Zone *zone, const Image *zmImage) + * \param zone is a zone where faces will be detected + * \param zmImage is an image to perform face detection (in the form of ZM' Image) + * \return true if there were objects detected in given image and + * false otherwise + */ +bool ANPRPlugin::checkZone(Zone *zone, const Image *zmImage) +{ + + double score; + Polygon zone_polygon = Polygon(zone->GetPolygon()); // Polygon of interest of the processed zone. + + Image *pMaskImage = new Image(zmImage->Width(), zmImage->Height(), ZM_COLOUR_GRAY8, ZM_SUBPIX_ORDER_NONE ); + pMaskImage->Fill(BLACK); + // An temporary image in the form of ZM for making from it CvMat. + // If don't use temp image, after rgb->bgr it will change. + Image *tempZmImage = new Image(*zmImage); + int imgtype=CV_8UC1; + if (tempZmImage->Colours() == ZM_COLOUR_RGB24) + imgtype=CV_8UC3; + Mat cvInputImage = Mat( + tempZmImage->Height(), + tempZmImage->Width(), + imgtype, (unsigned char*)tempZmImage->Buffer()).clone(); + //Mat cvInputImage = cvtmpInputImage.reshape(0, tempZmImage->Colours()); + //Mat cvInputImage = cvtmpInputImage.reshape(0, tempZmImage->Height()); + if (tempZmImage->Colours() == ZM_COLOUR_RGB24) + { + cvtColor(cvInputImage, cvInputImage, CV_RGB2BGR); + } + //imwrite("/tmp/sarca.jpg", cvInputImage); + //Process image + liprec::LiPRec plateDetector; + liprec::PlatesImage plates; + plateDetector.detectPlates(cvInputImage, &plates); + score = 0; + if(plates.plates.size() > 0) { + log(LOG_INFO, "PLATES WERE DETECTED"); + for(unsigned int i=0;iFill(WHITE, plateBox); + score=m_nAlarmScore; + delete plateBox; + } + } + + + if (score == 0) + { + //log(LOG_DEBUG, "No objects found. Exit."); + delete pMaskImage; + delete tempZmImage; + + // XXX We need to delete Mats? + + return( false ); + } + /* + else + { + zone->SetOverloadCount(zone->GetOverloadFrames()); + delete pMaskImage; + delete tempZmImage; + + return( false ); + }*/ + + + zone->SetScore((int)score); + + //Get mask by highlighting contours of objects and overlaying them with previous contours. + Rgb alarm_colour = RGB_GREEN; + Image *hlZmImage = pMaskImage->HighlightEdges(alarm_colour, ZM_COLOUR_RGB24, + ZM_SUBPIX_ORDER_RGB, &zone_polygon.Extent()); + + if (zone->Alarmed()) + { + // if there were previous detection and they have already set up alarm image + // then overlay it with current mask + Image* pPrevZoneMask = new Image(*(zone->AlarmImage())); + pPrevZoneMask->Overlay(*hlZmImage); + zone->SetAlarmImage(pPrevZoneMask); + delete pPrevZoneMask; + } + else + zone->SetAlarmImage(hlZmImage); + + delete pMaskImage; + delete hlZmImage; + delete tempZmImage; + + return true; +} + + diff --git a/plugins/libzm_plugin_anpr/anpr_plugin.h b/plugins/libzm_plugin_anpr/anpr_plugin.h new file mode 100644 index 000000000..ccab00eb2 --- /dev/null +++ b/plugins/libzm_plugin_anpr/anpr_plugin.h @@ -0,0 +1,89 @@ +/*********************************************************************** + This file is part of libzm_anpr_plugin, License Plate REcognition. + + Copyright (C) 2012 Franco (nextime) Lanza + + LiPRec is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LiPRec 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with LiPRec. If not, see . +************************************************************************/ + +#ifndef ANPR_PLUGIN_H +#define ANPR_PLUGIN_H + +#include +//#include +#include +#include +#include + + +#include +#include +#include +#include + +#include "zm_plugin_manager.h" +#include "zm_detector.h" +#include "zm_rgb.h" + +#define DETECTED_CAUSE "Plate Detected" +#define LOG_PREFIX "ZM PLATEDEC PLUGIN" + + +#define DEFAULT_DETECTOR_MIN_OBJECT_SIZE 600 +#define DEFAULT_DETECTOR_MAX_OBJECT_SIZE 6000 +#define DEFAULT_ALARM_SCORE 99 + +using namespace std; +using namespace boost::program_options; + + +//! Face detector plugin class. +/*! The class derived from Detector. + * This class provides face detection based on OpenCV's implementation of Haar cascade classifier detector. + */ +class ANPRPlugin : public Detector { + public: + + //! Default Constructor. + ANPRPlugin(); + + //! Constructor. + ANPRPlugin(string sConfigSectionName); + + //! Destructor. + virtual ~ANPRPlugin(); + + //! Copy constructor. + ANPRPlugin(const ANPRPlugin& source); + + //! Overloaded operator=. + ANPRPlugin& operator=(const ANPRPlugin& source); + + void loadConfig(string sConfigFileName); + +protected: + + bool checkZone(Zone *zone, const Image *zmImage); + + int m_nMinObjSize; + int m_nMaxObjSize; + + int m_nAlarmScore; + +}; + + + +#endif // ANPR_PLUGIN_H + diff --git a/plugins/libzm_plugin_anpr/plugin.conf b/plugins/libzm_plugin_anpr/plugin.conf new file mode 100644 index 000000000..b947346a1 --- /dev/null +++ b/plugins/libzm_plugin_anpr/plugin.conf @@ -0,0 +1,8 @@ +[libzm_plugin_anpr] + +min-obj-size = 600 +max-obj-size = 6000 +alarm-score = 99 +det-cause = Plate Detected +log-prefix = PLATEDET PLUGIN + diff --git a/plugins/libzm_plugin_face_haar/.sconsign.dblite b/plugins/libzm_plugin_face_haar/.sconsign.dblite new file mode 100644 index 000000000..d992fa609 Binary files /dev/null and b/plugins/libzm_plugin_face_haar/.sconsign.dblite differ diff --git a/plugins/libzm_plugin_face_haar/SConstruct b/plugins/libzm_plugin_face_haar/SConstruct new file mode 100644 index 000000000..e864f6ce7 --- /dev/null +++ b/plugins/libzm_plugin_face_haar/SConstruct @@ -0,0 +1,78 @@ +import os, glob, sys +env = Environment() + +# Short messages while compiling and linking. +if ARGUMENTS.get('VERBOSE') != "1": + env.Append(CXXCOMSTR = "Compiling static object $TARGET") + env.Append(LINKCOMSTR = "Linking $TARGET") + env.Append(SHCXXCOMSTR = "Compiling shared object $TARGET") + env.Append(SHLINKCOMSTR = "Linking shared $TARGET" ) + + +# CXXFLAGS +if ARGUMENTS.get('debug', 0): + env.Append(CXXFLAGS = ['-g']) + build_dir = 'debug/' +else: + build_dir = 'release/' + +env.BuildDir(build_dir, 'src/', duplicate=0) + + + +env.Append(CXXFLAGS=['-msse2', '-march=native','-Wno-write-strings','-D__STDC_CONSTANT_MACROS']) +env.Append(CXXFLAGS=['-DZM_FFMPEG_CVS','-DHAVE_LIBCRYPTO','-DJPEG_INCLUDE_DIR=../../../../../libjpeg-turbo-1.2.1/']) +env.Append(LINKFLAGS = ['-Wl,--no-undefined']) +env.Append(LDFLAGS = [" -L../../../../../libjpeg-turbo-1.2.1/.libs "]) + + +# Headers and libs +env['CPPPATH'] = [ build_dir, + 'src', + '../../src', + '../../', + '../../../../../libjpeg-turbo-1.2.1/', + '/usr/include/opencv', '/usr/local/include/opencv', + '/usr/local/include/boost', + '.' + ] + +env['LIBPATH'] = [ + '../../../../../libjpeg-turbo-1.2.1/.libs/', + '/usr/local/lib', + '/usr/lib', + './'] + +env['LIBS'] = [ + 'opencv_core', + 'opencv_highgui', + 'opencv_objdetect', + 'opencv_imgproc', + 'boost_program_options', + 'mysqlclient', + 'pthread', + 'jpeg', + 'z' +] + +# Common sources. +# common_src = env.Glob( build_dir + '*.cpp') + +zoneminder_src = env.Glob('../../src/' + 'zm_detector.cpp') +zoneminder_src += env.Glob('../../src/' + 'zm_config.cpp') +zoneminder_src += env.Glob('../../src/' + 'zm_poly.cpp') +zoneminder_src += env.Glob('../../src/' + 'zm_zone.cpp') +zoneminder_src += env.Glob('../../src/' + 'zm_image.cpp') +zoneminder_src += env.Glob('../../src/' + 'zm_db.cpp') +zoneminder_src += env.Glob('../../src/' + 'zm_jpeg.cpp') +zoneminder_src += env.Glob('../../src/' + 'zm_logger.cpp') +zoneminder_src += env.Glob('../../src/' + 'zm_utils.cpp') +zoneminder_src += env.Glob('../../src/' + 'zm_thread.cpp') + + +# Face detector sources. +face_haar_src = env.Glob( build_dir + 'face_detector_plugin.cpp') + +# Shared lib +env.SharedLibrary(target = 'zm_plugin_face_haar', source = [face_haar_src, zoneminder_src]) + diff --git a/plugins/libzm_plugin_face_haar/data/haarcascade_frontalface_alt2.xml b/plugins/libzm_plugin_face_haar/data/haarcascade_frontalface_alt2.xml new file mode 100644 index 000000000..caa86f6c3 --- /dev/null +++ b/plugins/libzm_plugin_face_haar/data/haarcascade_frontalface_alt2.xml @@ -0,0 +1,23550 @@ + + + + + 20 20 + + <_> + + + <_> + + <_> + + + + <_>2 7 16 4 -1. + <_>2 9 16 2 2. + 0 + 4.3272329494357109e-003 + 0.0383819006383419 + 1 + <_> + + + + <_>8 4 3 14 -1. + <_>8 11 3 7 2. + 0 + 0.0130761601030827 + 0.8965256810188294 + 0.2629314064979553 + <_> + + <_> + + + + <_>13 6 1 6 -1. + <_>13 9 1 3 2. + 0 + 5.2434601821005344e-004 + 0.1021663025021553 + 1 + <_> + + + + <_>4 2 12 8 -1. + <_>8 2 4 8 3. + 0 + 4.4573000632226467e-003 + 0.1238401979207993 + 0.6910383105278015 + <_> + + <_> + + + + <_>6 3 1 9 -1. + <_>6 6 1 3 3. + 0 + -9.2708261217921972e-004 + 1 + 0.1953697055578232 + <_> + + + + <_>3 7 14 9 -1. + <_>3 10 14 3 3. + 0 + 3.3989109215326607e-004 + 0.2101441025733948 + 0.8258674740791321 + 0.3506923019886017 + -1 + -1 + <_> + + + <_> + + <_> + + + + <_>4 7 4 4 -1. + <_>4 9 4 2 2. + 0 + 2.3025739938020706e-003 + 0.1018375977873802 + 1 + <_> + + + + <_>9 4 2 16 -1. + <_>9 12 2 8 2. + 0 + 4.4174338690936565e-003 + 0.8219057917594910 + 0.1956554949283600 + <_> + + <_> + + + + <_>1 1 18 5 -1. + <_>7 1 6 5 3. + 0 + 0.0222032107412815 + 0.2205407023429871 + 1 + <_> + + + + <_>4 5 13 8 -1. + <_>4 9 13 4 2. + 0 + -1.7283110355492681e-004 + 0.0732632577419281 + 0.5931484103202820 + <_> + + <_> + + + + <_>1 7 16 9 -1. + <_>1 10 16 3 3. + 0 + 4.3567270040512085e-003 + 0.1844114959239960 + 1 + <_> + + + + <_>2 0 15 4 -1. + <_>2 2 15 2 2. + 0 + -2.6032889727503061e-003 + 0.4032213985919952 + 0.8066521286964417 + <_> + + <_> + + + + <_>7 5 6 4 -1. + <_>9 5 2 4 3. + 0 + 1.7309630056843162e-003 + 0.2548328042030335 + 1 + <_> + + + + <_>6 3 8 9 -1. + <_>6 6 8 3 3. + 0 + -7.8146401792764664e-003 + 0.6057069897651672 + 0.2779063880443573 + <_> + + <_> + + + + <_>8 12 3 8 -1. + <_>8 16 3 4 2. + 0 + -8.7343417108058929e-003 + 0.2889980077743530 + 1 + <_> + + + + <_>3 16 2 2 -1. + <_>3 17 2 1 2. + 0 + 9.4522320432588458e-004 + 0.7616587281227112 + 0.3495643138885498 + <_> + + <_> + + + + <_>14 1 6 12 -1. + <_>14 1 3 12 2. + 0 + 0.0494148582220078 + 1 + 0.8151652812957764 + <_> + + + + <_>4 4 12 6 -1. + <_>8 4 4 6 3. + 0 + 4.4891750440001488e-003 + 0.2808783054351807 + 0.6027774810791016 + <_> + + <_> + + + + <_>0 2 6 15 -1. + <_>3 2 3 15 2. + 0 + 0.0603136196732521 + 1 + 0.7607501745223999 + <_> + + + + <_>5 4 9 6 -1. + <_>5 6 9 2 3. + 0 + -1.0762850288301706e-003 + 0.4444035887718201 + 0.1437312066555023 + <_> + + <_> + + + + <_>13 11 6 3 -1. + <_>13 12 6 1 3. + 0 + -9.5083238556981087e-003 + 1 + 0.5318170189857483 + <_> + + + + <_>12 12 6 4 -1. + <_>12 14 6 2 2. + 0 + 7.6601309701800346e-003 + 0.5411052107810974 + 0.2180687040090561 + <_> + + <_> + + + + <_>1 11 6 3 -1. + <_>1 12 6 1 3. + 0 + 7.6467678882181644e-003 + 1 + 0.1158960014581680 + <_> + + + + <_>2 5 5 8 -1. + <_>2 9 5 4 2. + 0 + -8.4662932204082608e-004 + 0.2340679019689560 + 0.5990381836891174 + 3.4721779823303223 + 0 + -1 + <_> + + + <_> + + <_> + + + + <_>5 4 10 4 -1. + <_>5 6 10 2 2. + 0 + -4.8506218008697033e-003 + 1 + 0.1805496066808701 + <_> + + + + <_>2 4 16 12 -1. + <_>2 8 16 4 3. + 0 + -4.6141650527715683e-003 + 0.2177893966436386 + 0.8018236756324768 + <_> + + <_> + + + + <_>4 5 12 6 -1. + <_>8 5 4 6 3. + 0 + -2.4301309604197741e-003 + 0.1141354963183403 + 1 + <_> + + + + <_>13 7 2 9 -1. + <_>13 10 2 3 3. + 0 + 4.1787960799410939e-004 + 0.1203093975782394 + 0.6108530759811401 + <_> + + <_> + + + + <_>5 7 2 9 -1. + <_>5 10 2 3 3. + 0 + 1.0010929545387626e-003 + 0.2079959958791733 + 1 + <_> + + + + <_>7 1 6 8 -1. + <_>9 1 2 8 3. + 0 + 1.0577100329101086e-003 + 0.3302054107189179 + 0.7511094212532044 + <_> + + <_> + + + + <_>12 0 4 12 -1. + <_>14 0 2 6 2. + <_>12 6 2 6 2. + 0 + 1.2376549420878291e-003 + 1 + 0.2768222093582153 + <_> + + + + <_>5 8 10 2 -1. + <_>5 9 10 1 2. + 0 + 3.5315038985572755e-004 + 0.1668293029069901 + 0.5829476714134216 + <_> + + <_> + + + + <_>5 1 6 4 -1. + <_>7 1 2 4 3. + 0 + -0.0119536602869630 + 0.1508788019418716 + 1 + <_> + + + + <_>0 3 9 12 -1. + <_>3 3 3 12 3. + 0 + 1.4182999730110168e-003 + 0.4391227960586548 + 0.7646595239639282 + <_> + + <_> + + + + <_>9 8 3 12 -1. + <_>9 12 3 4 3. + 0 + 3.4642980899661779e-003 + 1 + 0.2651556134223938 + <_> + + + + <_>0 5 20 15 -1. + <_>0 10 20 5 3. + 0 + -0.0149489501491189 + 0.2298053056001663 + 0.5442165732383728 + <_> + + <_> + + + + <_>2 2 6 8 -1. + <_>2 2 3 4 2. + <_>5 6 3 4 2. + 0 + -1.0506849503144622e-003 + 1 + 0.3622843921184540 + <_> + + + + <_>2 1 6 2 -1. + <_>2 2 6 1 2. + 0 + -4.0782918222248554e-003 + 0.2601259946823120 + 0.7233657836914063 + <_> + + <_> + + + + <_>10 15 6 4 -1. + <_>13 15 3 2 2. + <_>10 17 3 2 2. + 0 + 5.4242828628048301e-004 + 0.3849678933620453 + 1 + <_> + + + + <_>12 14 2 6 -1. + <_>12 16 2 2 3. + 0 + -7.3204059153795242e-003 + 0.2965512871742249 + 0.5480309128761292 + <_> + + <_> + + + + <_>5 15 4 4 -1. + <_>5 15 2 2 2. + <_>7 17 2 2 2. + 0 + 1.1421289527788758e-003 + 0.4104770123958588 + 1 + <_> + + + + <_>7 18 1 2 -1. + <_>7 19 1 1 2. + 0 + 1.1783400550484657e-003 + 0.7239024043083191 + 0.2787283957004547 + <_> + + <_> + + + + <_>4 5 12 10 -1. + <_>10 5 6 5 2. + <_>4 10 6 5 2. + 0 + 0.0440771095454693 + 0.5640516281127930 + 1 + <_> + + + + <_>7 4 8 12 -1. + <_>11 4 4 6 2. + <_>7 10 4 6 2. + 0 + 3.7900090683251619e-003 + 0.5947548151016235 + 0.3312020003795624 + <_> + + <_> + + + + <_>9 11 2 3 -1. + <_>9 12 2 1 3. + 0 + -2.4291418958455324e-003 + 0.6603232026100159 + 1 + <_> + + + + <_>3 3 12 12 -1. + <_>3 3 6 6 2. + <_>9 9 6 6 2. + 0 + 9.4262324273586273e-003 + 0.4680665135383606 + 0.2064338028430939 + <_> + + <_> + + + + <_>15 11 5 3 -1. + <_>15 12 5 1 3. + 0 + 8.0630257725715637e-003 + 0.5298851132392883 + 1 + <_> + + + + <_>10 18 3 2 -1. + <_>11 18 1 2 3. + 0 + 5.2240812219679356e-003 + 0.5281602740287781 + 0.1909549981355667 + <_> + + <_> + + + + <_>0 11 5 3 -1. + <_>0 12 5 1 3. + 0 + -7.0630568079650402e-003 + 0.1380645930767059 + 1 + <_> + + + + <_>7 18 3 2 -1. + <_>8 18 1 2 3. + 0 + 5.6897541508078575e-003 + 0.5490636825561523 + 0.1260281056165695 + <_> + + <_> + + + + <_>2 8 16 2 -1. + <_>2 9 16 1 2. + 0 + 1.2472929665818810e-003 + 0.2372663021087647 + 1 + <_> + + + + <_>9 6 5 12 -1. + <_>9 12 5 6 2. + 0 + 0.0495434887707233 + 0.5240166187286377 + 0.1769216060638428 + 5.9844889640808105 + 1 + -1 + <_> + + + <_> + + <_> + + + + <_>6 3 8 6 -1. + <_>6 6 8 3 2. + 0 + -4.9326149746775627e-003 + 1 + 0.1998064965009689 + <_> + + + + <_>4 7 12 2 -1. + <_>8 7 4 2 3. + 0 + 2.7918140403926373e-005 + 0.2299380004405975 + 0.7393211126327515 + <_> + + <_> + + + + <_>10 9 6 8 -1. + <_>10 13 6 4 2. + 0 + 3.0876200180500746e-003 + 1 + 0.1533840000629425 + <_> + + + + <_>12 5 3 10 -1. + <_>12 10 3 5 2. + 0 + 7.4669660534709692e-006 + 0.2036858946084976 + 0.5854915976524353 + <_> + + <_> + + + + <_>4 6 3 9 -1. + <_>4 9 3 3 3. + 0 + 1.8739729421213269e-003 + 0.2049895972013474 + 1 + <_> + + + + <_>7 4 6 4 -1. + <_>9 4 2 4 3. + 0 + 9.3380251200869679e-004 + 0.3234199881553650 + 0.7323014140129089 + <_> + + <_> + + + + <_>12 3 8 3 -1. + <_>12 3 4 3 2. + 0 + 1.9151850137859583e-003 + 0.3045149147510529 + 1 + <_> + + + + <_>15 0 3 6 -1. + <_>15 3 3 3 2. + 0 + -5.9683797881007195e-003 + 0.2932133972644806 + 0.5621296167373657 + <_> + + <_> + + + + <_>2 12 10 8 -1. + <_>2 12 5 4 2. + <_>7 16 5 4 2. + 0 + -7.2115601506084204e-004 + 0.3658036887645721 + 1 + <_> + + + + <_>5 5 6 8 -1. + <_>5 9 6 4 2. + 0 + -5.9663117863237858e-003 + 0.2712155878543854 + 0.7226334810256958 + <_> + + <_> + + + + <_>12 3 8 3 -1. + <_>12 3 4 3 2. + 0 + 0.0308741796761751 + 0.4419837892055512 + 1 + <_> + + + + <_>15 0 3 6 -1. + <_>15 3 3 3 2. + 0 + -0.0110997101292014 + 0.3612976968288422 + 0.5251451134681702 + <_> + + <_> + + + + <_>0 3 8 3 -1. + <_>4 3 4 3 2. + 0 + 2.1164179779589176e-003 + 0.3628616929054260 + 1 + <_> + + + + <_>2 1 4 4 -1. + <_>2 3 4 2 2. + 0 + -9.4317439943552017e-003 + 0.1601095050573349 + 0.7052276730537415 + <_> + + <_> + + + + <_>10 2 3 2 -1. + <_>11 2 1 2 3. + 0 + -3.5266019403934479e-003 + 0.1301288008689880 + 1 + <_> + + + + <_>10 3 3 1 -1. + <_>11 3 1 1 3. + 0 + -1.6907559474930167e-003 + 0.1786323934793472 + 0.5521529912948608 + <_> + + <_> + + + + <_>7 15 3 4 -1. + <_>7 17 3 2 2. + 0 + 4.6470930101349950e-004 + 0.3487383127212524 + 1 + <_> + + + + <_>4 13 3 6 -1. + <_>4 15 3 2 3. + 0 + -0.0102155702188611 + 0.2673991024494171 + 0.6667919158935547 + <_> + + <_> + + + + <_>10 5 1 14 -1. + <_>10 12 1 7 2. + 0 + 1.2634709710255265e-003 + 1 + 0.3437863886356354 + <_> + + + + <_>5 4 10 6 -1. + <_>5 6 10 2 3. + 0 + -0.0118752997368574 + 0.5995336174964905 + 0.3497717976570129 + <_> + + <_> + + + + <_>5 0 6 3 -1. + <_>7 0 2 3 3. + 0 + -0.0107323396950960 + 0.2150489985942841 + 1 + <_> + + + + <_>6 0 3 5 -1. + <_>7 0 1 5 3. + 0 + 7.1836481802165508e-003 + 0.6271436214447022 + 0.2519541978836060 + <_> + + <_> + + + + <_>7 15 6 5 -1. + <_>9 15 2 5 3. + 0 + -0.0283408891409636 + 0.0824118927121162 + 1 + <_> + + + + <_>9 10 2 6 -1. + <_>9 12 2 2 3. + 0 + -4.5813230099156499e-004 + 0.5910056829452515 + 0.3705201148986816 + <_> + + <_> + + + + <_>8 17 3 2 -1. + <_>9 17 1 2 3. + 0 + 4.2940340936183929e-003 + 1 + 0.1594727933406830 + <_> + + + + <_>1 12 7 6 -1. + <_>1 14 7 2 3. + 0 + 0.0107510797679424 + 0.5980480909347534 + 0.2832508087158203 + <_> + + <_> + + + + <_>9 6 3 7 -1. + <_>10 6 1 7 3. + 0 + 0.0224651191383600 + 1 + 0.7877091169357300 + <_> + + + + <_>16 3 4 9 -1. + <_>16 6 4 3 3. + 0 + -0.0579885393381119 + 0.1555740982294083 + 0.5239657163619995 + <_> + + <_> + + + + <_>8 6 3 7 -1. + <_>9 6 1 7 3. + 0 + 7.2110891342163086e-003 + 1 + 0.6620365977287293 + <_> + + + + <_>0 5 18 8 -1. + <_>0 5 9 4 2. + <_>9 9 9 4 2. + 0 + -0.0483675710856915 + 0.1424719989299774 + 0.4429833889007568 + <_> + + <_> + + + + <_>13 5 2 10 -1. + <_>13 10 2 5 2. + 0 + -0.0144180599600077 + 0.1588540971279144 + 1 + <_> + + + + <_>12 10 2 6 -1. + <_>12 13 2 3 2. + 0 + -0.0231563895940781 + 0.2375798970460892 + 0.5217134952545166 + <_> + + <_> + + + + <_>7 0 3 5 -1. + <_>8 0 1 5 3. + 0 + 7.6985340565443039e-003 + 1 + 0.1941725015640259 + <_> + + + + <_>6 5 8 6 -1. + <_>6 7 8 2 3. + 0 + -5.6248619221150875e-003 + 0.6278405785560608 + 0.3746044933795929 + <_> + + <_> + + + + <_>10 3 6 14 -1. + <_>13 3 3 7 2. + <_>10 10 3 7 2. + 0 + -7.2936748620122671e-004 + 1 + 0.3840922117233276 + <_> + + + + <_>13 5 1 8 -1. + <_>13 9 1 4 2. + 0 + 6.1783898854628205e-004 + 0.3106493055820465 + 0.5537847280502319 + <_> + + <_> + + + + <_>4 3 6 14 -1. + <_>4 3 3 7 2. + <_>7 10 3 7 2. + 0 + -4.5803939428878948e-005 + 1 + 0.3444449007511139 + <_> + + + + <_>6 5 1 8 -1. + <_>6 9 1 4 2. + 0 + -1.4719359569426160e-005 + 0.2729552090167999 + 0.6428951025009155 + 8.5117864608764648 + 2 + -1 + <_> + + + <_> + + <_> + + + + <_>8 1 1 6 -1. + <_>8 3 1 2 3. + 0 + -1.3469370314851403e-003 + 0.1657086014747620 + 1 + <_> + + + + <_>2 0 15 2 -1. + <_>2 1 15 1 2. + 0 + -2.4774789344519377e-003 + 0.2273851037025452 + 0.6989349722862244 + <_> + + <_> + + + + <_>0 7 20 6 -1. + <_>0 9 20 2 3. + 0 + 5.2632777951657772e-003 + 0.1512074023485184 + 1 + <_> + + + + <_>10 10 6 8 -1. + <_>10 14 6 4 2. + 0 + 4.9075339920818806e-003 + 0.5564470291137695 + 0.1605442017316818 + <_> + + <_> + + + + <_>7 1 3 2 -1. + <_>8 1 1 2 3. + 0 + -2.3254349362105131e-003 + 0.1880259066820145 + 1 + <_> + + + + <_>8 1 2 2 -1. + <_>9 1 1 2 2. + 0 + -1.4665479538962245e-003 + 0.3122498989105225 + 0.7165396213531494 + <_> + + <_> + + + + <_>4 3 12 9 -1. + <_>4 6 12 3 3. + 0 + -0.1231169030070305 + 1 + 0.3859583139419556 + <_> + + + + <_>6 5 9 5 -1. + <_>9 5 3 5 3. + 0 + 2.2108340635895729e-003 + 0.2455293983221054 + 0.5695710182189941 + <_> + + <_> + + + + <_>5 5 9 5 -1. + <_>8 5 3 5 3. + 0 + 2.0661531016230583e-003 + 0.2716520130634308 + 1 + <_> + + + + <_>4 6 6 12 -1. + <_>4 10 6 4 3. + 0 + 3.6130280932411551e-004 + 0.2293362021446228 + 0.7208629846572876 + <_> + + <_> + + + + <_>13 0 6 18 -1. + <_>13 0 3 18 2. + 0 + 0.0799578726291656 + 1 + 0.7833620905876160 + <_> + + + + <_>10 8 1 12 -1. + <_>10 12 1 4 3. + 0 + 2.6064720004796982e-003 + 0.5545232295989990 + 0.2550689876079559 + <_> + + <_> + + + + <_>3 2 6 10 -1. + <_>3 2 3 5 2. + <_>6 7 3 5 2. + 0 + 6.5699010156095028e-003 + 1 + 0.1819390058517456 + <_> + + + + <_>1 2 4 6 -1. + <_>3 2 2 6 2. + 0 + 1.6259610420092940e-003 + 0.3529875874519348 + 0.6552819013595581 + <_> + + <_> + + + + <_>9 18 3 2 -1. + <_>10 18 1 2 3. + 0 + 3.6204981151968241e-003 + 0.5462309718132019 + 1 + <_> + + + + <_>10 18 3 2 -1. + <_>11 18 1 2 3. + 0 + -4.4391951523721218e-003 + 0.1359843015670776 + 0.5415815114974976 + <_> + + <_> + + + + <_>2 8 2 6 -1. + <_>2 10 2 2 3. + 0 + -9.0540945529937744e-003 + 0.1115119978785515 + 1 + <_> + + + + <_>7 5 6 6 -1. + <_>7 7 6 2 3. + 0 + -4.6067481162026525e-004 + 0.5846719741821289 + 0.2598348855972290 + <_> + + <_> + + + + <_>7 19 6 1 -1. + <_>9 19 2 1 3. + 0 + -5.6621041148900986e-003 + 0.1610569059848785 + 1 + <_> + + + + <_>10 18 3 2 -1. + <_>11 18 1 2 3. + 0 + 5.1165837794542313e-003 + 0.5376678705215454 + 0.1739455014467239 + <_> + + <_> + + + + <_>8 3 3 1 -1. + <_>9 3 1 1 3. + 0 + -2.1362339612096548e-003 + 0.1902073025703430 + 1 + <_> + + + + <_>2 2 16 2 -1. + <_>2 2 8 1 2. + <_>10 3 8 1 2. + 0 + -5.4809921421110630e-003 + 0.3272008001804352 + 0.6364840865135193 + <_> + + <_> + + + + <_>8 11 5 3 -1. + <_>8 12 5 1 3. + 0 + -8.1061907112598419e-003 + 0.6914852857589722 + 1 + <_> + + + + <_>7 13 6 3 -1. + <_>7 14 6 1 3. + 0 + 6.0048708692193031e-003 + 0.4327326118946075 + 0.6963843107223511 + <_> + + <_> + + + + <_>0 1 6 15 -1. + <_>2 1 2 15 3. + 0 + -0.0870285481214523 + 0.8594133853912354 + 1 + <_> + + + + <_>2 12 2 3 -1. + <_>2 13 2 1 3. + 0 + -4.7809639945626259e-003 + 0.0973944664001465 + 0.4587030112743378 + <_> + + <_> + + + + <_>16 13 1 3 -1. + <_>16 14 1 1 3. + 0 + -2.2166660055518150e-003 + 0.2554625868797302 + 1 + <_> + + + + <_>13 7 6 4 -1. + <_>16 7 3 2 2. + <_>13 9 3 2 2. + 0 + 1.3642730191349983e-003 + 0.3319090902805328 + 0.5964102745056152 + <_> + + <_> + + + + <_>7 13 3 6 -1. + <_>7 16 3 3 2. + 0 + -9.0077864006161690e-003 + 0.2666594982147217 + 1 + <_> + + + + <_>7 5 1 14 -1. + <_>7 12 1 7 2. + 0 + -0.0154941203072667 + 0.1848185956478119 + 0.6245970726013184 + <_> + + <_> + + + + <_>15 12 2 3 -1. + <_>15 13 2 1 3. + 0 + -4.2165028862655163e-003 + 1 + 0.5379927158355713 + <_> + + + + <_>10 5 3 14 -1. + <_>10 12 3 7 2. + 0 + 0.0432497598230839 + 0.5183029174804688 + 0.2170419991016388 + <_> + + <_> + + + + <_>6 10 2 6 -1. + <_>6 13 2 3 2. + 0 + 2.8786511393263936e-004 + 1 + 0.2613384127616882 + <_> + + + + <_>6 5 1 8 -1. + <_>6 9 1 4 2. + 0 + 1.2373150093480945e-003 + 0.2786532044410706 + 0.5908988118171692 + <_> + + <_> + + + + <_>13 11 2 1 -1. + <_>13 11 1 1 2. + 0 + 1.9528300035744905e-003 + 1 + 0.2612869143486023 + <_> + + + + <_>12 1 6 10 -1. + <_>15 1 3 5 2. + <_>12 6 3 5 2. + 0 + -1.4947060262784362e-003 + 0.5915412902832031 + 0.3455781936645508 + <_> + + <_> + + + + <_>3 12 2 3 -1. + <_>3 13 2 1 3. + 0 + 3.5878680646419525e-003 + 1 + 0.1587052047252655 + <_> + + + + <_>9 18 2 1 -1. + <_>10 18 1 1 2. + 0 + -2.5938691105693579e-003 + 0.1270411014556885 + 0.5979428887367249 + 8.4680156707763672 + 3 + -1 + <_> + + + <_> + + <_> + + + + <_>1 0 17 9 -1. + <_>1 3 17 3 3. + 0 + 3.5810680128633976e-003 + 0.1995104998350143 + 1 + <_> + + + + <_>1 2 8 8 -1. + <_>1 2 4 4 2. + <_>5 6 4 4 2. + 0 + -2.8552350122481585e-003 + 0.7373070120811462 + 0.2921737134456635 + <_> + + <_> + + + + <_>9 5 6 4 -1. + <_>9 5 3 4 2. + 0 + 1.9758539274334908e-003 + 0.1956419944763184 + 1 + <_> + + + + <_>10 9 7 10 -1. + <_>10 14 7 5 2. + 0 + 3.2583118882030249e-003 + 0.5692046880722046 + 0.1839064955711365 + <_> + + <_> + + + + <_>5 5 6 4 -1. + <_>8 5 3 4 2. + 0 + 2.3711679386906326e-004 + 0.2171667069196701 + 1 + <_> + + + + <_>0 7 20 6 -1. + <_>0 9 20 2 3. + 0 + 2.5942500215023756e-003 + 0.2719989120960236 + 0.7150244116783142 + <_> + + <_> + + + + <_>6 5 9 10 -1. + <_>6 10 9 5 2. + 0 + -0.0250324495136738 + 0.1825183928012848 + 1 + <_> + + + + <_>8 4 4 12 -1. + <_>8 10 4 6 2. + 0 + 6.3087949529290199e-003 + 0.5699837803840637 + 0.3509852886199951 + <_> + + <_> + + + + <_>6 6 8 3 -1. + <_>6 7 8 1 3. + 0 + -3.2494920305907726e-003 + 1 + 0.4023926854133606 + <_> + + + + <_>3 13 10 6 -1. + <_>3 13 5 3 2. + <_>8 16 5 3 2. + 0 + -0.0148857301101089 + 0.3604095876216888 + 0.7291995286941528 + <_> + + <_> + + + + <_>15 1 4 11 -1. + <_>15 1 2 11 2. + 0 + 8.0623216927051544e-003 + 1 + 0.6491490006446838 + <_> + + + + <_>5 7 10 10 -1. + <_>10 7 5 5 2. + <_>5 12 5 5 2. + 0 + 0.0274056792259216 + 0.5518993139266968 + 0.2659681141376495 + <_> + + <_> + + + + <_>1 1 4 11 -1. + <_>3 1 2 11 2. + 0 + 0.0343686006963253 + 1 + 0.6712512969970703 + <_> + + + + <_>1 5 8 12 -1. + <_>1 11 8 6 2. + 0 + -0.0272929705679417 + 0.1691378057003021 + 0.4326277971267700 + <_> + + <_> + + + + <_>13 7 6 4 -1. + <_>16 7 3 2 2. + <_>13 9 3 2 2. + 0 + 7.4452121043577790e-004 + 0.3405100107192993 + 1 + <_> + + + + <_>11 10 7 4 -1. + <_>11 12 7 2 2. + 0 + 7.0336280623450875e-004 + 0.5516793131828308 + 0.3311387896537781 + <_> + + <_> + + + + <_>0 4 20 12 -1. + <_>0 4 10 6 2. + <_>10 10 10 6 2. + 0 + -0.1227546036243439 + 0.1675315052270889 + 1 + <_> + + + + <_>1 5 6 15 -1. + <_>1 10 6 5 3. + 0 + 3.2559928949922323e-003 + 0.3615751862525940 + 0.6420782804489136 + <_> + + <_> + + + + <_>11 10 3 8 -1. + <_>11 14 3 4 2. + 0 + -0.0320903994143009 + 0.2921079099178314 + 1 + <_> + + + + <_>11 12 7 6 -1. + <_>11 14 7 2 3. + 0 + 3.2957999501377344e-003 + 0.5613031983375549 + 0.3357860147953033 + <_> + + <_> + + + + <_>9 11 2 3 -1. + <_>9 12 2 1 3. + 0 + -3.2273170072585344e-003 + 0.6970642805099487 + 1 + <_> + + + + <_>8 13 4 3 -1. + <_>8 14 4 1 3. + 0 + 1.1171669466421008e-003 + 0.3541150093078613 + 0.6144006252288818 + <_> + + <_> + + + + <_>3 14 14 4 -1. + <_>10 14 7 2 2. + <_>3 16 7 2 2. + 0 + -0.0172799509018660 + 1 + 0.5537180900573731 + <_> + + + + <_>18 7 2 4 -1. + <_>18 9 2 2 2. + 0 + 0.0117412004619837 + 0.5341957211494446 + 0.2757104933261871 + <_> + + <_> + + + + <_>3 12 6 6 -1. + <_>3 14 6 2 3. + 0 + 4.6405228786170483e-003 + 1 + 0.2489521056413651 + <_> + + + + <_>0 4 3 6 -1. + <_>0 6 3 2 3. + 0 + -0.0169130302965641 + 0.1711928993463516 + 0.5523952841758728 + <_> + + <_> + + + + <_>9 14 3 3 -1. + <_>9 15 3 1 3. + 0 + 0.0100601697340608 + 1 + 0.8273450732231140 + <_> + + + + <_>10 7 10 4 -1. + <_>15 7 5 2 2. + <_>10 9 5 2 2. + 0 + -6.0715491417795420e-004 + 0.3779391050338745 + 0.5476251840591431 + <_> + + <_> + + + + <_>7 2 6 8 -1. + <_>7 6 6 4 2. + 0 + -1.0865400545299053e-003 + 1 + 0.3296540975570679 + <_> + + + + <_>6 3 6 2 -1. + <_>8 3 2 2 3. + 0 + 8.9362077414989471e-003 + 0.6062883734703064 + 0.2434220016002655 + <_> + + <_> + + + + <_>10 6 3 5 -1. + <_>11 6 1 5 3. + 0 + -2.6372660067863762e-004 + 1 + 0.3814094960689545 + <_> + + + + <_>9 0 6 19 -1. + <_>11 0 2 19 3. + 0 + 0.0131100500002503 + 0.5517616271972656 + 0.3726893067359924 + <_> + + <_> + + + + <_>3 12 1 2 -1. + <_>3 13 1 1 2. + 0 + -2.9806280508637428e-003 + 0.1229664012789726 + 1 + <_> + + + + <_>7 14 5 3 -1. + <_>7 15 5 1 3. + 0 + -4.1619571857154369e-003 + 0.7252274751663208 + 0.4973455071449280 + <_> + + <_> + + + + <_>2 1 18 4 -1. + <_>11 1 9 2 2. + <_>2 3 9 2 2. + 0 + 0.0338423289358616 + 0.5348312854766846 + 1 + <_> + + + + <_>10 5 3 8 -1. + <_>11 5 1 8 3. + 0 + -1.2564560165628791e-003 + 0.5851914882659912 + 0.4384166896343231 + <_> + + <_> + + + + <_>0 1 18 4 -1. + <_>0 1 9 2 2. + <_>9 3 9 2 2. + 0 + -0.0196352303028107 + 0.2297834008932114 + 1 + <_> + + + + <_>7 5 3 8 -1. + <_>8 5 1 8 3. + 0 + -9.9625496659427881e-004 + 0.6295937895774841 + 0.4131599068641663 + <_> + + <_> + + + + <_>9 5 2 6 -1. + <_>9 7 2 2 3. + 0 + -0.0231271106749773 + 0.1695459038019180 + 1 + <_> + + + + <_>10 8 5 2 -1. + <_>10 9 5 1 2. + 0 + 0.0235257092863321 + 0.5174130201339722 + 0.0595193915069103 + <_> + + <_> + + + + <_>2 10 15 1 -1. + <_>7 10 5 1 3. + 0 + -0.0193565208464861 + 0.1357247978448868 + 1 + <_> + + + + <_>2 7 2 6 -1. + <_>2 9 2 2 3. + 0 + -4.1787112131714821e-003 + 0.2996628880500794 + 0.5791695117950440 + <_> + + <_> + + + + <_>9 14 3 3 -1. + <_>9 15 3 1 3. + 0 + 3.1488779932260513e-003 + 1 + 0.6592589020729065 + <_> + + + + <_>9 7 4 10 -1. + <_>9 12 4 5 2. + 0 + 7.3972279205918312e-003 + 0.5307171940803528 + 0.3795121014118195 + <_> + + <_> + + + + <_>0 8 8 2 -1. + <_>0 8 4 1 2. + <_>4 9 4 1 2. + 0 + 7.1955118983169086e-006 + 0.3128314912319183 + 1 + <_> + + + + <_>5 9 10 8 -1. + <_>5 9 5 4 2. + <_>10 13 5 4 2. + 0 + 0.0471144095063210 + 0.5537893176078796 + 0.1027309000492096 + <_> + + <_> + + + + <_>9 7 2 4 -1. + <_>9 7 1 4 2. + 0 + 7.2878710925579071e-003 + 0.4660859107971191 + 1 + <_> + + + + <_>9 6 3 4 -1. + <_>10 6 1 4 3. + 0 + -6.1887511983513832e-003 + 0.7158858180046082 + 0.4724448919296265 + <_> + + <_> + + + + <_>8 3 2 1 -1. + <_>9 3 1 1 2. + 0 + 2.9757320880889893e-003 + 1 + 0.0593456886708736 + <_> + + + + <_>8 6 3 4 -1. + <_>9 6 1 4 3. + 0 + -1.8449809867888689e-003 + 0.7027301788330078 + 0.4718731045722961 + <_> + + <_> + + + + <_>12 0 4 14 -1. + <_>14 0 2 7 2. + <_>12 7 2 7 2. + 0 + 1.0239540279144421e-004 + 0.5894734263420105 + 1 + <_> + + + + <_>12 5 6 9 -1. + <_>12 5 3 9 2. + 0 + 2.4277009069919586e-003 + 0.4862355887889862 + 0.5247588157653809 + <_> + + <_> + + + + <_>0 2 6 16 -1. + <_>3 2 3 16 2. + 0 + -0.0647513121366501 + 0.6917471289634705 + 1 + <_> + + + + <_>1 12 4 2 -1. + <_>1 13 4 1 2. + 0 + 3.9380151429213583e-004 + 0.4669617116451263 + 0.2382405996322632 + 12.5784997940063480 + 4 + -1 + <_> + + + <_> + + <_> + + + + <_>7 7 6 1 -1. + <_>9 7 2 1 3. + 0 + 1.4397440245375037e-003 + 0.2773470878601074 + 1 + <_> + + + + <_>8 3 4 9 -1. + <_>8 6 4 3 3. + 0 + -5.4068560712039471e-004 + 0.7427154779434204 + 0.2479735016822815 + <_> + + <_> + + + + <_>12 10 4 6 -1. + <_>12 13 4 3 2. + 0 + -7.1237959673453588e-006 + 1 + 0.2199503034353256 + <_> + + + + <_>8 1 8 16 -1. + <_>12 1 4 8 2. + <_>8 9 4 8 2. + 0 + -2.3661039303988218e-003 + 0.5889989733695984 + 0.2595716118812561 + <_> + + <_> + + + + <_>4 6 3 6 -1. + <_>4 9 3 3 2. + 0 + 1.7343269428238273e-003 + 0.1860125958919525 + 1 + <_> + + + + <_>1 3 6 2 -1. + <_>4 3 3 2 2. + 0 + 1.5874590026214719e-003 + 0.4151870906352997 + 0.7103474140167236 + <_> + + <_> + + + + <_>9 8 3 12 -1. + <_>9 12 3 4 3. + 0 + 3.7285638973116875e-003 + 1 + 0.2527967095375061 + <_> + + + + <_>10 9 7 10 -1. + <_>10 14 7 5 2. + 0 + -0.1288381963968277 + 0.1393000930547714 + 0.5254514813423157 + <_> + + <_> + + + + <_>3 9 7 10 -1. + <_>3 14 7 5 2. + 0 + 7.9412180930376053e-003 + 1 + 0.2487729042768478 + <_> + + + + <_>7 5 1 14 -1. + <_>7 12 1 7 2. + 0 + -0.0126617299392819 + 0.2710700035095215 + 0.6618837714195252 + <_> + + <_> + + + + <_>13 14 1 6 -1. + <_>13 16 1 2 3. + 0 + 3.0146789868013002e-005 + 0.3812825977802277 + 1 + <_> + + + + <_>14 12 3 6 -1. + <_>14 14 3 2 3. + 0 + -0.0163301602005959 + 0.2326432019472122 + 0.5263010859489441 + <_> + + <_> + + + + <_>6 14 1 6 -1. + <_>6 16 1 2 3. + 0 + 1.4622770322603174e-005 + 0.4293332099914551 + 1 + <_> + + + + <_>3 12 3 6 -1. + <_>3 14 3 2 3. + 0 + -0.0208586603403091 + 0.1600403934717178 + 0.6782314777374268 + <_> + + <_> + + + + <_>8 13 5 3 -1. + <_>8 14 5 1 3. + 0 + 2.8194559272378683e-003 + 1 + 0.6679294109344482 + <_> + + + + <_>9 14 2 3 -1. + <_>9 15 2 1 3. + 0 + 3.7899368908256292e-003 + 0.4587705135345459 + 0.7176238894462585 + <_> + + <_> + + + + <_>5 1 10 8 -1. + <_>5 1 5 4 2. + <_>10 5 5 4 2. + 0 + 0.0353446416556835 + 1 + 0.1864075064659119 + <_> + + + + <_>6 4 5 4 -1. + <_>6 6 5 2 2. + 0 + -1.1571600334718823e-003 + 0.5538259744644165 + 0.3150450885295868 + <_> + + <_> + + + + <_>1 10 18 1 -1. + <_>7 10 6 1 3. + 0 + -5.8742752298712730e-003 + 0.2828791141510010 + 1 + <_> + + + + <_>11 10 4 3 -1. + <_>11 10 2 3 2. + 0 + -1.5201780115603469e-005 + 0.5870224237442017 + 0.3704823851585388 + <_> + + <_> + + + + <_>5 11 6 1 -1. + <_>7 11 2 1 3. + 0 + -2.2681879636365920e-004 + 1 + 0.4218930900096893 + <_> + + + + <_>3 13 2 3 -1. + <_>3 14 2 1 3. + 0 + 3.7845689803361893e-003 + 0.6667001247406006 + 0.2461182028055191 + <_> + + <_> + + + + <_>12 12 3 4 -1. + <_>12 14 3 2 2. + 0 + -8.5295992903411388e-005 + 1 + 0.3557587862014771 + <_> + + + + <_>11 10 5 6 -1. + <_>11 12 5 2 3. + 0 + -0.0443948917090893 + 0.1665547043085098 + 0.5234848856925964 + <_> + + <_> + + + + <_>0 8 16 2 -1. + <_>0 9 16 1 2. + 0 + 1.0126030538231134e-003 + 0.2884612977504730 + 1 + <_> + + + + <_>2 1 3 4 -1. + <_>2 3 3 2 2. + 0 + -7.6327780261635780e-003 + 0.2969340085983276 + 0.6080111265182495 + <_> + + <_> + + + + <_>9 7 3 3 -1. + <_>10 7 1 3 3. + 0 + 4.0330411866307259e-003 + 0.4536390006542206 + 1 + <_> + + + + <_>5 6 12 6 -1. + <_>9 6 4 6 3. + 0 + 0.1367668956518173 + 0.5177264213562012 + 0.1449182033538818 + <_> + + <_> + + + + <_>8 7 3 3 -1. + <_>9 7 1 3 3. + 0 + -5.0060478970408440e-003 + 0.7616909742355347 + 1 + <_> + + + + <_>3 6 12 6 -1. + <_>7 6 4 6 3. + 0 + -0.0124758398160338 + 0.2159706056118012 + 0.5460187792778015 + <_> + + <_> + + + + <_>10 5 6 5 -1. + <_>12 5 2 5 3. + 0 + -9.4012258341535926e-004 + 1 + 0.3926295936107636 + <_> + + + + <_>5 7 10 2 -1. + <_>5 7 5 2 2. + 0 + -0.0121919801458716 + 0.3478881120681763 + 0.5542662739753723 + <_> + + <_> + + + + <_>4 5 6 5 -1. + <_>6 5 2 5 3. + 0 + -5.4959481349214911e-004 + 0.6064276099205017 + 1 + <_> + + + + <_>9 3 2 10 -1. + <_>9 8 2 5 2. + 0 + -2.1802430273965001e-004 + 0.5697407126426697 + 0.1779713928699493 + <_> + + <_> + + + + <_>3 1 16 2 -1. + <_>11 1 8 1 2. + <_>3 2 8 1 2. + 0 + 6.9115799851715565e-003 + 0.5379372239112854 + 1 + <_> + + + + <_>9 9 3 2 -1. + <_>9 10 3 1 2. + 0 + -9.7631698008626699e-004 + 0.3327839076519013 + 0.5461531281471252 + <_> + + <_> + + + + <_>1 1 16 2 -1. + <_>1 1 8 1 2. + <_>9 2 8 1 2. + 0 + -8.7870173156261444e-003 + 0.2116160988807678 + 1 + <_> + + + + <_>8 14 1 3 -1. + <_>8 15 1 1 3. + 0 + -1.6761029837653041e-003 + 0.6635823249816895 + 0.4365859031677246 + <_> + + <_> + + + + <_>4 5 12 10 -1. + <_>10 5 6 5 2. + <_>4 10 6 5 2. + 0 + -0.0556949488818645 + 1 + 0.5387424826622009 + <_> + + + + <_>7 13 6 6 -1. + <_>10 13 3 3 2. + <_>7 16 3 3 2. + 0 + -0.0198443792760372 + 0.1602804958820343 + 0.5330458879470825 + <_> + + <_> + + + + <_>8 9 3 2 -1. + <_>8 10 3 1 2. + 0 + -7.4751611100509763e-004 + 0.2917476892471314 + 1 + <_> + + + + <_>7 2 6 4 -1. + <_>9 2 2 4 3. + 0 + 0.0230328906327486 + 0.5608124136924744 + 0.1997981071472168 + <_> + + <_> + + + + <_>6 6 9 3 -1. + <_>6 7 9 1 3. + 0 + -3.0700280331075191e-003 + 1 + 0.3938314020633698 + <_> + + + + <_>10 7 6 1 -1. + <_>12 7 2 1 3. + 0 + -1.1636839481070638e-003 + 0.5757436156272888 + 0.4239456951618195 + <_> + + <_> + + + + <_>0 0 18 6 -1. + <_>6 0 6 6 3. + 0 + 0.2246433943510056 + 1 + 0.7676553130149841 + <_> + + + + <_>6 10 2 6 -1. + <_>6 13 2 3 2. + 0 + 1.4412109740078449e-003 + 0.5353866219520569 + 0.2514776885509491 + <_> + + <_> + + + + <_>11 12 3 6 -1. + <_>11 15 3 3 2. + 0 + -0.0300112497061491 + 0.2364903986454010 + 1 + <_> + + + + <_>4 4 12 12 -1. + <_>10 4 6 6 2. + <_>4 10 6 6 2. + 0 + -0.0530789606273174 + 0.2385863959789276 + 0.5414664745330811 + <_> + + <_> + + + + <_>1 2 3 6 -1. + <_>2 2 1 6 3. + 0 + 2.0800929050892591e-003 + 1 + 0.6511614918708801 + <_> + + + + <_>1 5 3 7 -1. + <_>2 5 1 7 3. + 0 + -4.0738182142376900e-003 + 0.6030414104461670 + 0.3587701022624970 + <_> + + <_> + + + + <_>4 13 12 4 -1. + <_>10 13 6 2 2. + <_>4 15 6 2 2. + 0 + -0.0195293705910444 + 1 + 0.5423592925071716 + <_> + + + + <_>3 3 17 12 -1. + <_>3 9 17 6 2. + 0 + -0.0533094704151154 + 0.2360953986644745 + 0.5401757955551148 + <_> + + <_> + + + + <_>3 3 14 12 -1. + <_>3 3 7 6 2. + <_>10 9 7 6 2. + 0 + -0.0348495617508888 + 0.2836985886096954 + 1 + <_> + + + + <_>2 11 16 9 -1. + <_>2 14 16 3 3. + 0 + -0.1265845000743866 + 0.1813516020774841 + 0.5421046018600464 + <_> + + <_> + + + + <_>9 14 3 6 -1. + <_>9 17 3 3 2. + 0 + 7.3325118137290701e-006 + 0.3980365991592407 + 1 + <_> + + + + <_>8 14 4 6 -1. + <_>10 14 2 3 2. + <_>8 17 2 3 2. + 0 + -0.0118438703939319 + 0.2616384923458099 + 0.5237730145454407 + <_> + + <_> + + + + <_>6 2 6 1 -1. + <_>8 2 2 1 3. + 0 + -4.8470678739249706e-003 + 0.2438108026981354 + 1 + <_> + + + + <_>9 5 2 5 -1. + <_>10 5 1 5 2. + 0 + 8.1693977117538452e-003 + 0.5327146053314209 + 0.8190376758575440 + <_> + + <_> + + + + <_>9 8 3 5 -1. + <_>10 8 1 5 3. + 0 + -6.4716790802776814e-003 + 1 + 0.4679693877696991 + <_> + + + + <_>9 12 6 1 -1. + <_>9 12 3 1 2. + 0 + -1.5188479665084742e-005 + 0.5563911795616150 + 0.4367586076259613 + <_> + + <_> + + + + <_>8 8 3 5 -1. + <_>9 8 1 5 3. + 0 + 3.0696711037307978e-003 + 1 + 0.6664348840713501 + <_> + + + + <_>6 10 4 3 -1. + <_>8 10 2 3 2. + 0 + -1.6296720423270017e-004 + 0.5594611167907715 + 0.3042711913585663 + 14.5467500686645510 + 5 + -1 + <_> + + + <_> + + <_> + + + + <_>0 4 20 6 -1. + <_>0 6 20 2 3. + 0 + -9.8275858908891678e-003 + 1 + 0.2116018980741501 + <_> + + + + <_>1 3 8 6 -1. + <_>1 3 4 3 2. + <_>5 6 4 3 2. + 0 + -4.1693858802318573e-003 + 0.6924685239791870 + 0.3043777048587799 + <_> + + <_> + + + + <_>7 15 6 4 -1. + <_>7 17 6 2 2. + 0 + 3.5341319744475186e-004 + 0.3183285892009735 + 1 + <_> + + + + <_>3 10 14 10 -1. + <_>3 15 14 5 2. + 0 + 4.8054549843072891e-003 + 0.5456559062004089 + 0.2522268891334534 + <_> + + <_> + + + + <_>6 4 4 4 -1. + <_>8 4 2 4 2. + 0 + 2.1071180526632816e-004 + 0.2902618050575256 + 1 + <_> + + + + <_>0 4 20 10 -1. + <_>0 9 20 5 2. + 0 + -2.8318869881331921e-003 + 0.3130455911159515 + 0.6884937286376953 + <_> + + <_> + + + + <_>9 4 2 14 -1. + <_>9 11 2 7 2. + 0 + -7.5633679443853907e-006 + 1 + 0.2962465882301331 + <_> + + + + <_>2 0 16 4 -1. + <_>2 2 16 2 2. + 0 + -8.2888139877468348e-004 + 0.3099626004695892 + 0.5752515196800232 + <_> + + <_> + + + + <_>4 12 6 8 -1. + <_>4 12 3 4 2. + <_>7 16 3 4 2. + 0 + 1.6209259629249573e-003 + 0.3993195891380310 + 1 + <_> + + + + <_>0 5 6 7 -1. + <_>3 5 3 7 2. + 0 + 9.1338958591222763e-003 + 0.4827372133731842 + 0.7537832856178284 + <_> + + <_> + + + + <_>10 7 10 4 -1. + <_>15 7 5 2 2. + <_>10 9 5 2 2. + 0 + -4.1212290525436401e-003 + 0.2616927027702332 + 1 + <_> + + + + <_>5 8 12 1 -1. + <_>9 8 4 1 3. + 0 + -2.5447290390729904e-003 + 0.3108702898025513 + 0.5491235852241516 + <_> + + <_> + + + + <_>9 9 2 2 -1. + <_>9 10 2 1 2. + 0 + -6.2652782071381807e-004 + 0.3239691853523254 + 1 + <_> + + + + <_>9 4 2 4 -1. + <_>9 6 2 2 2. + 0 + -3.6596331483451650e-005 + 0.6517410874366760 + 0.4178912043571472 + <_> + + <_> + + + + <_>9 6 3 6 -1. + <_>10 6 1 6 3. + 0 + 0.0138827199116349 + 1 + 0.6771203875541687 + <_> + + + + <_>12 7 6 4 -1. + <_>15 7 3 2 2. + <_>12 9 3 2 2. + 0 + 1.0493700392544270e-003 + 0.4159511029720306 + 0.5652891993522644 + <_> + + <_> + + + + <_>8 6 3 6 -1. + <_>9 6 1 6 3. + 0 + 0.0182153601199389 + 1 + 0.7689601182937622 + <_> + + + + <_>1 6 18 6 -1. + <_>1 6 9 3 2. + <_>10 9 9 3 2. + 0 + -0.0113345803692937 + 0.2873323857784271 + 0.4988932907581329 + <_> + + <_> + + + + <_>9 1 3 3 -1. + <_>10 1 1 3 3. + 0 + -4.1097560897469521e-003 + 1 + 0.5463008284568787 + <_> + + + + <_>10 8 5 2 -1. + <_>10 9 5 1 2. + 0 + 4.2612891411408782e-004 + 0.3631235063076019 + 0.5512552261352539 + <_> + + <_> + + + + <_>8 1 3 3 -1. + <_>9 1 1 3 3. + 0 + 6.0301548801362514e-003 + 1 + 0.1143767014145851 + <_> + + + + <_>5 8 5 2 -1. + <_>5 9 5 1 2. + 0 + 3.3587709185667336e-004 + 0.2891078889369965 + 0.5447341799736023 + <_> + + <_> + + + + <_>8 6 8 8 -1. + <_>12 6 4 4 2. + <_>8 10 4 4 2. + 0 + 6.2279507983475924e-004 + 1 + 0.3023431897163391 + <_> + + + + <_>5 7 10 2 -1. + <_>5 7 5 2 2. + 0 + -0.0258371196687222 + 0.2167005985975266 + 0.5278152823448181 + <_> + + <_> + + + + <_>4 5 12 10 -1. + <_>4 5 6 5 2. + <_>10 10 6 5 2. + 0 + 0.0217749103903770 + 1 + 0.3254834115505219 + <_> + + + + <_>5 5 2 3 -1. + <_>5 6 2 1 3. + 0 + 1.7682299949228764e-003 + 0.5263050794601440 + 0.7526329159736633 + <_> + + <_> + + + + <_>7 14 6 3 -1. + <_>7 15 6 1 3. + 0 + -0.0137938102707267 + 0.7410330176353455 + 1 + <_> + + + + <_>9 14 3 3 -1. + <_>9 15 3 1 3. + 0 + -5.0852829590439796e-003 + 0.6836609840393066 + 0.4579071104526520 + <_> + + <_> + + + + <_>8 14 3 3 -1. + <_>8 15 3 1 3. + 0 + 6.1795017682015896e-003 + 1 + 0.7449936270713806 + <_> + + + + <_>1 10 8 9 -1. + <_>1 13 8 3 3. + 0 + 0.0100303199142218 + 0.4860779941082001 + 0.2361457049846649 + <_> + + <_> + + + + <_>9 7 2 3 -1. + <_>9 8 2 1 3. + 0 + -6.4201927743852139e-003 + 0.1467327028512955 + 1 + <_> + + + + <_>12 3 3 3 -1. + <_>13 3 1 3 3. + 0 + -5.6961281225085258e-003 + 0.2347819954156876 + 0.5323377251625061 + <_> + + <_> + + + + <_>5 3 3 3 -1. + <_>6 3 1 3 3. + 0 + -7.1498160250484943e-003 + 0.1477057039737701 + 1 + <_> + + + + <_>5 6 2 12 -1. + <_>5 10 2 4 3. + 0 + 2.4450740311294794e-003 + 0.3498533964157105 + 0.5803561806678772 + <_> + + <_> + + + + <_>1 11 18 4 -1. + <_>10 11 9 2 2. + <_>1 13 9 2 2. + 0 + -0.0375034101307392 + 1 + 0.5259550809860230 + <_> + + + + <_>7 12 6 2 -1. + <_>7 13 6 1 2. + 0 + 4.7799441381357610e-004 + 0.4362882971763611 + 0.6208922863006592 + <_> + + <_> + + + + <_>6 0 3 6 -1. + <_>7 0 1 6 3. + 0 + -7.0806080475449562e-003 + 0.2039460986852646 + 1 + <_> + + + + <_>0 11 18 4 -1. + <_>0 11 9 2 2. + <_>9 13 9 2 2. + 0 + 0.0328180007636547 + 0.5198358893394470 + 0.1371196061372757 + <_> + + <_> + + + + <_>7 12 6 2 -1. + <_>7 13 6 1 2. + 0 + 6.5188988810405135e-004 + 1 + 0.6323429942131043 + <_> + + + + <_>9 12 3 3 -1. + <_>9 13 3 1 3. + 0 + 4.6485587954521179e-003 + 0.4720163047313690 + 0.6567087173461914 + <_> + + <_> + + + + <_>9 12 2 3 -1. + <_>9 13 2 1 3. + 0 + -1.9827929791063070e-003 + 0.6053060293197632 + 1 + <_> + + + + <_>8 11 4 3 -1. + <_>8 12 4 1 3. + 0 + -1.6011310508474708e-003 + 0.5090519189834595 + 0.3116933107376099 + <_> + + <_> + + + + <_>13 3 4 2 -1. + <_>13 4 4 1 2. + 0 + -3.0539939180016518e-003 + 0.3429804146289825 + 1 + <_> + + + + <_>4 0 12 2 -1. + <_>4 1 12 1 2. + 0 + 4.3212040327489376e-004 + 0.3838402926921845 + 0.5775598287582398 + <_> + + <_> + + + + <_>6 9 8 8 -1. + <_>6 9 4 4 2. + <_>10 13 4 4 2. + 0 + -0.0274521205574274 + 0.2143469005823135 + 1 + <_> + + + + <_>1 11 6 2 -1. + <_>1 12 6 1 2. + 0 + 9.3099439982324839e-004 + 0.5952966213226318 + 0.3760158121585846 + <_> + + <_> + + + + <_>2 5 18 8 -1. + <_>11 5 9 4 2. + <_>2 9 9 4 2. + 0 + 6.7144189961254597e-003 + 0.5692626833915710 + 1 + <_> + + + + <_>7 1 6 10 -1. + <_>7 6 6 5 2. + 0 + -3.3701690845191479e-003 + 0.5784304141998291 + 0.3974282145500183 + <_> + + <_> + + + + <_>0 3 3 6 -1. + <_>0 5 3 2 3. + 0 + -0.0189039595425129 + 0.1818892955780029 + 1 + <_> + + + + <_>4 5 4 3 -1. + <_>4 6 4 1 3. + 0 + -6.5850871615111828e-003 + 0.6849110126495361 + 0.4351584017276764 + <_> + + <_> + + + + <_>19 3 1 6 -1. + <_>19 5 1 2 3. + 0 + 5.8810501359403133e-003 + 1 + 0.2726660966873169 + <_> + + + + <_>6 15 8 2 -1. + <_>6 16 8 1 2. + 0 + 8.0092082498595119e-004 + 0.4236431121826172 + 0.5844675898551941 + <_> + + <_> + + + + <_>0 3 1 6 -1. + <_>0 5 1 2 3. + 0 + 1.8510579830035567e-003 + 1 + 0.3371320962905884 + <_> + + + + <_>5 5 3 3 -1. + <_>5 6 3 1 3. + 0 + 6.3273650594055653e-003 + 0.5270221829414368 + 0.8053650856018066 + <_> + + <_> + + + + <_>8 8 4 3 -1. + <_>8 9 4 1 3. + 0 + -3.3820930402725935e-003 + 0.2866018116474152 + 1 + <_> + + + + <_>10 6 6 3 -1. + <_>12 6 2 3 3. + 0 + -1.9292969955131412e-003 + 0.5888946056365967 + 0.3895787000656128 + <_> + + <_> + + + + <_>8 13 2 6 -1. + <_>8 16 2 3 2. + 0 + 0.0149952201172709 + 1 + 0.2177816927433014 + <_> + + + + <_>9 11 2 8 -1. + <_>9 15 2 4 2. + 0 + -0.0263307504355907 + 0.1775317043066025 + 0.5671470165252686 + <_> + + <_> + + + + <_>10 6 6 3 -1. + <_>12 6 2 3 3. + 0 + -4.1734222322702408e-003 + 1 + 0.4652962088584900 + <_> + + + + <_>5 15 15 5 -1. + <_>10 15 5 5 3. + 0 + 0.0272683501243591 + 0.4768311083316803 + 0.5695238709449768 + <_> + + <_> + + + + <_>2 14 2 2 -1. + <_>2 15 2 1 2. + 0 + 9.8880263976752758e-004 + 1 + 0.3397401869297028 + <_> + + + + <_>4 7 6 2 -1. + <_>6 7 2 2 3. + 0 + -1.0528849670663476e-003 + 0.6250041127204895 + 0.4288412034511566 + <_> + + <_> + + + + <_>8 3 6 1 -1. + <_>10 3 2 1 3. + 0 + 5.2288072183728218e-003 + 0.5347762107849121 + 1 + <_> + + + + <_>1 0 18 12 -1. + <_>7 0 6 12 3. + 0 + 0.0303954593837261 + 0.4115518927574158 + 0.5660753846168518 + <_> + + <_> + + + + <_>0 14 8 6 -1. + <_>4 14 4 6 2. + 0 + -0.0791139304637909 + 0.7881323099136353 + 1 + <_> + + + + <_>0 15 15 5 -1. + <_>5 15 5 5 3. + 0 + 0.0182316694408655 + 0.3604339957237244 + 0.5569505095481873 + <_> + + <_> + + + + <_>8 3 6 1 -1. + <_>10 3 2 1 3. + 0 + 5.2288072183728218e-003 + 0.5416644215583801 + 1 + <_> + + + + <_>11 11 3 6 -1. + <_>11 14 3 3 2. + 0 + 4.3922828626818955e-004 + 0.5507156848907471 + 0.3882277011871338 + <_> + + <_> + + + + <_>6 3 6 1 -1. + <_>8 3 2 1 3. + 0 + -8.6501962505280972e-004 + 0.3185850977897644 + 1 + <_> + + + + <_>6 11 3 6 -1. + <_>6 14 3 3 2. + 0 + 1.0326979681849480e-003 + 0.5578364133834839 + 0.3219245970249176 + <_> + + <_> + + + + <_>9 6 3 4 -1. + <_>10 6 1 4 3. + 0 + -7.2997747920453548e-003 + 0.7073233127593994 + 1 + <_> + + + + <_>12 10 4 7 -1. + <_>12 10 2 7 2. + 0 + -9.3629042385146022e-004 + 0.5558015704154968 + 0.4613842070102692 + <_> + + <_> + + + + <_>8 6 3 4 -1. + <_>9 6 1 4 3. + 0 + -6.0483231209218502e-003 + 0.6869289875030518 + 1 + <_> + + + + <_>4 6 4 7 -1. + <_>6 6 2 7 2. + 0 + 6.7529221996665001e-003 + 0.4870317876338959 + 0.2650370895862579 + <_> + + <_> + + + + <_>10 3 4 12 -1. + <_>10 3 2 12 2. + 0 + 0.0530780293047428 + 0.5281515121459961 + 1 + <_> + + + + <_>10 8 3 4 -1. + <_>11 8 1 4 3. + 0 + -1.0225810110569000e-003 + 0.6085882186889648 + 0.4304867982864380 + <_> + + <_> + + + + <_>1 0 18 14 -1. + <_>7 0 6 14 3. + 0 + 0.0312706492841244 + 1 + 0.5445832014083862 + <_> + + + + <_>2 8 6 11 -1. + <_>5 8 3 11 2. + 0 + -6.3522169366478920e-003 + 0.5328335762023926 + 0.2364324033260346 + 18.5722503662109380 + 6 + -1 + <_> + + + <_> + + <_> + + + + <_>1 4 15 4 -1. + <_>1 6 15 2 2. + 0 + -6.2215630896389484e-003 + 1 + 0.2625581026077271 + <_> + + + + <_>5 5 10 8 -1. + <_>5 9 10 4 2. + 0 + 2.1097389981150627e-003 + 0.1564992964267731 + 0.6792883276939392 + <_> + + <_> + + + + <_>14 2 6 8 -1. + <_>14 2 3 8 2. + 0 + 0.0108458595350385 + 0.3485808968544006 + 1 + <_> + + + + <_>11 6 6 14 -1. + <_>14 6 3 7 2. + <_>11 13 3 7 2. + 0 + 6.4230401767417789e-004 + 0.3698255121707916 + 0.5921658277511597 + <_> + + <_> + + + + <_>9 5 2 12 -1. + <_>9 11 2 6 2. + 0 + 7.3311722371727228e-004 + 1 + 0.3007084131240845 + <_> + + + + <_>3 7 4 6 -1. + <_>3 9 4 2 3. + 0 + 1.0134200565516949e-003 + 0.3624922931194305 + 0.7072426080703735 + <_> + + <_> + + + + <_>14 3 6 6 -1. + <_>14 3 3 6 2. + 0 + 0.0110935596749187 + 0.4416702091693878 + 1 + <_> + + + + <_>15 2 4 4 -1. + <_>15 4 4 2 2. + 0 + -7.9127531498670578e-003 + 0.3028708100318909 + 0.5417376160621643 + <_> + + <_> + + + + <_>0 2 6 7 -1. + <_>3 2 3 7 2. + 0 + 0.0129053099080920 + 0.4374504089355469 + 1 + <_> + + + + <_>3 6 6 14 -1. + <_>3 6 3 7 2. + <_>6 13 3 7 2. + 0 + -4.2430912144482136e-003 + 0.4401589930057526 + 0.7565190792083740 + <_> + + <_> + + + + <_>4 6 16 8 -1. + <_>4 10 16 4 2. + 0 + -2.1304309484548867e-004 + 0.2310786992311478 + 1 + <_> + + + + <_>10 12 2 8 -1. + <_>10 16 2 4 2. + 0 + -2.2308640182018280e-003 + 0.3568195998668671 + 0.5749999284744263 + <_> + + <_> + + + + <_>7 0 6 20 -1. + <_>9 0 2 20 3. + 0 + 2.6400520000606775e-003 + 0.3593688905239105 + 1 + <_> + + + + <_>1 7 16 12 -1. + <_>1 7 8 6 2. + <_>9 13 8 6 2. + 0 + 0.0751010328531265 + 0.6363567709922791 + 0.2327028959989548 + <_> + + <_> + + + + <_>9 11 3 3 -1. + <_>9 12 3 1 3. + 0 + -7.7012968249619007e-003 + 0.7074623703956604 + 1 + <_> + + + + <_>11 9 4 5 -1. + <_>11 9 2 5 2. + 0 + 1.5588370151817799e-003 + 0.5700237154960632 + 0.3590450882911682 + <_> + + <_> + + + + <_>3 3 1 2 -1. + <_>3 4 1 1 2. + 0 + -4.7687938786111772e-004 + 0.2805441021919251 + 1 + <_> + + + + <_>7 17 5 3 -1. + <_>7 18 5 1 3. + 0 + 8.4234727546572685e-004 + 0.4125418961048126 + 0.6177995800971985 + <_> + + <_> + + + + <_>8 12 4 8 -1. + <_>10 12 2 4 2. + <_>8 16 2 4 2. + 0 + -0.0128251099959016 + 1 + 0.5403078198432922 + <_> + + + + <_>7 4 10 12 -1. + <_>12 4 5 6 2. + <_>7 10 5 6 2. + 0 + -6.5156567143276334e-004 + 0.5633643865585327 + 0.3356539011001587 + <_> + + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + -0.0120061598718166 + 0.7109510898590088 + 1 + <_> + + + + <_>5 9 4 5 -1. + <_>7 9 2 5 2. + 0 + 1.3213419588282704e-003 + 0.4903850853443146 + 0.2824583053588867 + <_> + + <_> + + + + <_>9 9 8 2 -1. + <_>9 9 4 2 2. + 0 + -0.0203074403107166 + 0.1891369968652725 + 1 + <_> + + + + <_>14 15 5 2 -1. + <_>14 16 5 1 2. + 0 + 4.0180929936468601e-003 + 0.5377966165542603 + 0.3119494915008545 + <_> + + <_> + + + + <_>9 14 2 3 -1. + <_>9 15 2 1 3. + 0 + 4.5315311290323734e-003 + 1 + 0.7206758260726929 + <_> + + + + <_>1 7 8 4 -1. + <_>1 7 4 2 2. + <_>5 9 4 2 2. + 0 + -4.4381739571690559e-003 + 0.1854667961597443 + 0.4981732964515686 + <_> + + <_> + + + + <_>19 3 1 2 -1. + <_>19 4 1 1 2. + 0 + 1.5692010056227446e-003 + 1 + 0.2638274133205414 + <_> + + + + <_>9 12 2 3 -1. + <_>9 13 2 1 3. + 0 + -4.9516442231833935e-003 + 0.6871067285537720 + 0.4714686870574951 + <_> + + <_> + + + + <_>3 14 14 4 -1. + <_>3 14 7 2 2. + <_>10 16 7 2 2. + 0 + -0.0274296794086695 + 0.1548285037279129 + 1 + <_> + + + + <_>5 0 10 2 -1. + <_>5 1 10 1 2. + 0 + 1.4181969454512000e-003 + 0.4376842975616455 + 0.6327368021011353 + <_> + + <_> + + + + <_>11 14 4 6 -1. + <_>11 16 4 2 3. + 0 + -0.0130789401009679 + 0.3166814148426056 + 1 + <_> + + + + <_>7 14 6 3 -1. + <_>7 15 6 1 3. + 0 + -3.5092779435217381e-003 + 0.6199743747711182 + 0.4379687011241913 + <_> + + <_> + + + + <_>7 13 6 6 -1. + <_>7 13 3 3 2. + <_>10 16 3 3 2. + 0 + 0.0189207307994366 + 1 + 0.1470714062452316 + <_> + + + + <_>0 2 1 6 -1. + <_>0 4 1 2 3. + 0 + 2.1683350205421448e-003 + 0.5809459090232849 + 0.3431949019432068 + <_> + + <_> + + + + <_>6 7 8 2 -1. + <_>6 8 8 1 2. + 0 + 1.6401590546593070e-003 + 0.3959457874298096 + 1 + <_> + + + + <_>9 7 6 1 -1. + <_>9 7 3 1 2. + 0 + 1.4005920093040913e-004 + 0.3240025043487549 + 0.5646647214889526 + <_> + + <_> + + + + <_>7 1 6 10 -1. + <_>7 6 6 5 2. + 0 + -3.3137591090053320e-003 + 1 + 0.4274528026580811 + <_> + + + + <_>0 2 6 2 -1. + <_>0 3 6 1 2. + 0 + -2.9459029901772738e-003 + 0.3341667950153351 + 0.6627960205078125 + <_> + + <_> + + + + <_>11 4 2 4 -1. + <_>11 4 1 4 2. + 0 + 1.3612229668069631e-004 + 0.4046927988529205 + 1 + <_> + + + + <_>11 10 3 6 -1. + <_>11 13 3 3 2. + 0 + 6.0512032359838486e-004 + 0.5484058260917664 + 0.3569940924644470 + <_> + + <_> + + + + <_>3 9 8 2 -1. + <_>7 9 4 2 2. + 0 + -0.0175139904022217 + 0.1824150979518890 + 1 + <_> + + + + <_>0 0 4 6 -1. + <_>2 0 2 6 2. + 0 + -0.0187350306659937 + 0.7971820235252380 + 0.5068569183349609 + <_> + + <_> + + + + <_>7 0 6 2 -1. + <_>9 0 2 2 3. + 0 + 0.0120656499639153 + 1 + 0.2167007029056549 + <_> + + + + <_>9 15 2 3 -1. + <_>9 16 2 1 3. + 0 + -2.6544178836047649e-003 + 0.6584178805351257 + 0.4628243148326874 + <_> + + <_> + + + + <_>3 12 1 2 -1. + <_>3 13 1 1 2. + 0 + 1.4501289697363973e-003 + 1 + 0.2090252041816711 + <_> + + + + <_>4 5 11 3 -1. + <_>4 6 11 1 3. + 0 + 0.0109540196135640 + 0.5112305283546448 + 0.7784575819969177 + <_> + + <_> + + + + <_>11 4 2 4 -1. + <_>11 4 1 4 2. + 0 + 0.0157717093825340 + 0.5132359266281128 + 1 + <_> + + + + <_>8 3 6 3 -1. + <_>10 3 2 3 3. + 0 + -0.0142526896670461 + 0.1742414981126785 + 0.5267148017883301 + <_> + + <_> + + + + <_>7 4 2 4 -1. + <_>8 4 1 4 2. + 0 + 3.0411860279855318e-005 + 0.3418447971343994 + 1 + <_> + + + + <_>6 3 6 3 -1. + <_>8 3 2 3 3. + 0 + 0.0234862994402647 + 0.5631265044212341 + 0.2006393969058991 + <_> + + <_> + + + + <_>11 4 4 3 -1. + <_>11 5 4 1 3. + 0 + 5.2205449901521206e-003 + 1 + 0.6249648928642273 + <_> + + + + <_>11 8 2 8 -1. + <_>11 12 2 4 2. + 0 + -0.0258124303072691 + 0.3203228116035461 + 0.5199329853057861 + <_> + + <_> + + + + <_>8 7 3 5 -1. + <_>9 7 1 5 3. + 0 + -1.9526650430634618e-003 + 0.6140705943107605 + 1 + <_> + + + + <_>9 7 2 5 -1. + <_>10 7 1 5 2. + 0 + -8.1470049917697906e-003 + 0.6592895984649658 + 0.3711124956607819 + <_> + + <_> + + + + <_>14 11 1 6 -1. + <_>14 13 1 2 3. + 0 + 3.2962448894977570e-003 + 1 + 0.2952111959457398 + <_> + + + + <_>8 8 4 3 -1. + <_>8 9 4 1 3. + 0 + -1.3961310032755136e-003 + 0.3320803940296173 + 0.5528414845466614 + <_> + + <_> + + + + <_>0 3 2 2 -1. + <_>0 4 2 1 2. + 0 + -4.1055441834032536e-003 + 0.1710550040006638 + 1 + <_> + + + + <_>4 14 5 6 -1. + <_>4 16 5 2 3. + 0 + -0.0108887795358896 + 0.3359434902667999 + 0.5674905180931091 + <_> + + <_> + + + + <_>11 4 4 3 -1. + <_>11 5 4 1 3. + 0 + -7.6768421567976475e-003 + 1 + 0.4773241877555847 + <_> + + + + <_>12 4 3 3 -1. + <_>12 5 3 1 3. + 0 + -9.7729787230491638e-003 + 0.8081045150756836 + 0.4845828115940094 + <_> + + <_> + + + + <_>5 4 4 3 -1. + <_>5 5 4 1 3. + 0 + 6.0439710505306721e-003 + 1 + 0.6784002184867859 + <_> + + + + <_>5 15 4 2 -1. + <_>7 15 2 2 2. + 0 + -4.6134641161188483e-004 + 0.5514639019966126 + 0.3642359972000122 + <_> + + <_> + + + + <_>15 1 5 9 -1. + <_>15 4 5 3 3. + 0 + 0.0579923614859581 + 1 + 0.1254435032606125 + <_> + + + + <_>9 10 3 3 -1. + <_>9 11 3 1 3. + 0 + 5.9384980704635382e-004 + 0.4424878954887390 + 0.5728461742401123 + <_> + + <_> + + + + <_>1 6 2 6 -1. + <_>1 8 2 2 3. + 0 + -6.2353480607271194e-003 + 0.2805041968822479 + 1 + <_> + + + + <_>2 4 8 15 -1. + <_>2 9 8 5 3. + 0 + -0.0127849299460649 + 0.1950912028551102 + 0.5652924776077271 + <_> + + <_> + + + + <_>9 12 3 2 -1. + <_>9 13 3 1 2. + 0 + 4.1973669431172311e-004 + 1 + 0.6166483759880066 + <_> + + + + <_>9 12 3 3 -1. + <_>9 13 3 1 3. + 0 + 8.0646801507100463e-004 + 0.4526579976081848 + 0.5944486856460571 + <_> + + <_> + + + + <_>7 6 3 5 -1. + <_>8 6 1 5 3. + 0 + -1.6339010326191783e-003 + 1 + 0.4086942076683044 + <_> + + + + <_>5 3 6 2 -1. + <_>7 3 2 2 3. + 0 + -4.8299999907612801e-003 + 0.2793526947498322 + 0.6444935202598572 + <_> + + <_> + + + + <_>6 1 8 10 -1. + <_>10 1 4 5 2. + <_>6 6 4 5 2. + 0 + -6.3992068171501160e-003 + 1 + 0.5671656131744385 + <_> + + + + <_>0 0 20 10 -1. + <_>10 0 10 5 2. + <_>0 5 10 5 2. + 0 + 0.1081919968128204 + 0.5311812162399292 + 0.2614356875419617 + <_> + + <_> + + + + <_>6 3 3 1 -1. + <_>7 3 1 1 3. + 0 + 6.5056560561060905e-004 + 1 + 0.2996774017810822 + <_> + + + + <_>0 2 6 8 -1. + <_>2 2 2 8 3. + 0 + 0.0206112507730722 + 0.4489943087100983 + 0.6888279914855957 + <_> + + <_> + + + + <_>11 10 3 4 -1. + <_>11 12 3 2 2. + 0 + -0.0251290500164032 + 1 + 0.5196864008903503 + <_> + + + + <_>12 6 3 8 -1. + <_>12 10 3 4 2. + 0 + 1.7922939732670784e-003 + 0.3466995954513550 + 0.5533587932586670 + <_> + + <_> + + + + <_>6 10 3 4 -1. + <_>6 12 3 2 2. + 0 + 1.5626220265403390e-003 + 1 + 0.3081440031528473 + <_> + + + + <_>5 6 3 8 -1. + <_>5 10 3 4 2. + 0 + -6.1898730928078294e-004 + 0.2693870961666107 + 0.5544489026069641 + <_> + + <_> + + + + <_>2 6 18 6 -1. + <_>11 6 9 3 2. + <_>2 9 9 3 2. + 0 + 4.8111421056091785e-003 + 0.5587847828865051 + 1 + <_> + + + + <_>7 14 7 3 -1. + <_>7 15 7 1 3. + 0 + 2.2484229411929846e-003 + 0.4672113060951233 + 0.6090825200080872 + <_> + + <_> + + + + <_>0 0 2 12 -1. + <_>1 0 1 12 2. + 0 + -0.0301472395658493 + 0.9027591943740845 + 1 + <_> + + + + <_>1 2 18 16 -1. + <_>1 10 18 8 2. + 0 + 0.2754867970943451 + 0.4719834923744202 + 0.2196920067071915 + <_> + + <_> + + + + <_>9 13 5 3 -1. + <_>9 14 5 1 3. + 0 + 3.6894630175083876e-003 + 1 + 0.6273009181022644 + <_> + + + + <_>8 13 4 3 -1. + <_>8 14 4 1 3. + 0 + 7.2957701049745083e-003 + 0.4839217960834503 + 0.6909062266349793 + <_> + + <_> + + + + <_>0 6 18 6 -1. + <_>0 6 9 3 2. + <_>9 9 9 3 2. + 0 + -0.0562110692262650 + 0.1738487929105759 + 1 + <_> + + + + <_>7 13 6 3 -1. + <_>7 14 6 1 3. + 0 + -2.6478560175746679e-003 + 0.6304144859313965 + 0.4474301934242249 + <_> + + <_> + + + + <_>17 4 1 3 -1. + <_>17 5 1 1 3. + 0 + -1.4534000074490905e-003 + 1 + 0.5302538275718689 + <_> + + + + <_>12 11 1 9 -1. + <_>12 14 1 3 3. + 0 + 2.8540920466184616e-003 + 0.5338397026062012 + 0.3796882927417755 + <_> + + <_> + + + + <_>2 4 1 3 -1. + <_>2 5 1 1 3. + 0 + 5.8243022067472339e-004 + 1 + 0.3269836902618408 + <_> + + + + <_>5 4 2 3 -1. + <_>5 5 2 1 3. + 0 + 9.2509482055902481e-004 + 0.4554812014102936 + 0.6358348131179810 + 21.5781192779541020 + 7 + -1 + <_> + + + <_> + + <_> + + + + <_>1 2 18 3 -1. + <_>7 2 6 3 3. + 0 + 0.0198064409196377 + 0.2809725105762482 + 1 + <_> + + + + <_>0 1 20 6 -1. + <_>0 3 20 2 3. + 0 + 7.0395611692219973e-004 + 0.3119826018810272 + 0.7090306282043457 + <_> + + <_> + + + + <_>7 5 6 3 -1. + <_>9 5 2 3 3. + 0 + 2.5563780218362808e-003 + 0.2981947958469391 + 1 + <_> + + + + <_>13 7 6 4 -1. + <_>16 7 3 2 2. + <_>13 9 3 2 2. + 0 + 1.0824160417541862e-003 + 0.3020560145378113 + 0.5808811187744141 + <_> + + <_> + + + + <_>3 1 4 10 -1. + <_>3 1 2 5 2. + <_>5 6 2 5 2. + 0 + -9.2893769033253193e-004 + 1 + 0.3738102912902832 + <_> + + + + <_>0 4 19 10 -1. + <_>0 9 19 5 2. + 0 + -0.0180097296833992 + 0.2163126021623612 + 0.6619253754615784 + <_> + + <_> + + + + <_>9 8 3 12 -1. + <_>9 12 3 4 3. + 0 + 2.3500190582126379e-003 + 1 + 0.2910403907299042 + <_> + + + + <_>11 18 5 2 -1. + <_>11 19 5 1 2. + 0 + 8.1822491483762860e-004 + 0.5578622817993164 + 0.3366627991199493 + <_> + + <_> + + + + <_>5 16 6 4 -1. + <_>5 16 3 2 2. + <_>8 18 3 2 2. + 0 + 6.2095321482047439e-004 + 0.4072425961494446 + 1 + <_> + + + + <_>5 18 3 2 -1. + <_>5 19 3 1 2. + 0 + 9.6780969761312008e-004 + 0.6859595775604248 + 0.3105461895465851 + <_> + + <_> + + + + <_>13 11 3 2 -1. + <_>13 12 3 1 2. + 0 + 4.8000211245380342e-004 + 1 + 0.3337332904338837 + <_> + + + + <_>8 5 8 4 -1. + <_>8 5 4 4 2. + 0 + 9.0538640506565571e-005 + 0.3370958864688873 + 0.5451210737228394 + <_> + + <_> + + + + <_>1 2 18 6 -1. + <_>1 2 9 3 2. + <_>10 5 9 3 2. + 0 + -0.0439147986471653 + 0.2625670135021210 + 1 + <_> + + + + <_>3 5 14 6 -1. + <_>3 7 14 2 3. + 0 + -5.6501338258385658e-003 + 0.6050462722778320 + 0.3232415020465851 + <_> + + <_> + + + + <_>18 1 2 6 -1. + <_>18 3 2 2 3. + 0 + 3.8661491125822067e-003 + 1 + 0.3262613117694855 + <_> + + + + <_>9 11 6 1 -1. + <_>11 11 2 1 3. + 0 + -6.3069426687434316e-005 + 0.5817307829856873 + 0.4164389967918396 + <_> + + <_> + + + + <_>0 2 6 11 -1. + <_>3 2 3 11 2. + 0 + 0.0525337383151054 + 1 + 0.7095398902893066 + <_> + + + + <_>4 12 2 3 -1. + <_>4 13 2 1 3. + 0 + 1.3818660518154502e-003 + 0.5292875766754150 + 0.2541388869285584 + <_> + + <_> + + + + <_>6 12 9 2 -1. + <_>9 12 3 2 3. + 0 + -8.9264067355543375e-004 + 1 + 0.4085341095924377 + <_> + + + + <_>9 4 6 15 -1. + <_>9 4 3 15 2. + 0 + 0.0855795070528984 + 0.5263236165046692 + 0.3003202974796295 + <_> + + <_> + + + + <_>5 11 6 1 -1. + <_>7 11 2 1 3. + 0 + -1.8343339615967125e-004 + 1 + 0.4029205143451691 + <_> + + + + <_>5 4 6 15 -1. + <_>8 4 3 15 2. + 0 + -9.7924815490841866e-003 + 0.3521319925785065 + 0.6664004921913147 + <_> + + <_> + + + + <_>14 12 6 7 -1. + <_>14 12 3 7 2. + 0 + 0.0144286202266812 + 0.4593566060066223 + 1 + <_> + + + + <_>18 3 2 9 -1. + <_>18 6 2 3 3. + 0 + -0.0456870011985302 + 0.1474756002426148 + 0.5178632140159607 + <_> + + <_> + + + + <_>8 1 3 1 -1. + <_>9 1 1 1 3. + 0 + -2.5763090234249830e-003 + 0.1837278008460999 + 1 + <_> + + + + <_>0 12 6 7 -1. + <_>3 12 3 7 2. + 0 + -0.0383018590509892 + 0.8082658052444458 + 0.5166687965393066 + <_> + + <_> + + + + <_>13 7 6 4 -1. + <_>16 7 3 2 2. + <_>13 9 3 2 2. + 0 + 2.8978290501981974e-003 + 0.4798013865947723 + 1 + <_> + + + + <_>8 0 10 2 -1. + <_>8 1 10 1 2. + 0 + -2.5165060069411993e-003 + 0.3346295952796936 + 0.5444449186325073 + <_> + + <_> + + + + <_>1 7 6 4 -1. + <_>1 7 3 2 2. + <_>4 9 3 2 2. + 0 + 5.6281982688233256e-004 + 0.3589026927947998 + 1 + <_> + + + + <_>1 2 3 3 -1. + <_>1 3 3 1 3. + 0 + 3.6684391088783741e-003 + 0.5983129739761353 + 0.2983964085578919 + <_> + + <_> + + + + <_>9 13 4 3 -1. + <_>9 14 4 1 3. + 0 + 2.1319789811968803e-003 + 1 + 0.6163223981857300 + <_> + + + + <_>12 13 7 2 -1. + <_>12 14 7 1 2. + 0 + 7.6037310063838959e-003 + 0.5217130184173584 + 0.2054159045219421 + <_> + + <_> + + + + <_>5 12 9 2 -1. + <_>8 12 3 2 3. + 0 + -1.1668079969240353e-004 + 1 + 0.3446668982505798 + <_> + + + + <_>6 10 4 8 -1. + <_>6 14 4 4 2. + 0 + 3.1659509986639023e-003 + 0.5597484707832336 + 0.2673786878585815 + <_> + + <_> + + + + <_>1 0 18 4 -1. + <_>7 0 6 4 3. + 0 + -0.0225694999098778 + 0.6900268197059631 + 1 + <_> + + + + <_>12 0 5 2 -1. + <_>12 1 5 1 2. + 0 + 2.7129601221531630e-004 + 0.4486638903617859 + 0.5508785247802734 + <_> + + <_> + + + + <_>7 7 1 12 -1. + <_>7 13 1 6 2. + 0 + -0.0154344597831368 + 0.2048323005437851 + 1 + <_> + + + + <_>6 2 3 4 -1. + <_>7 2 1 4 3. + 0 + -8.4861656650900841e-003 + 0.1254952996969223 + 0.5060356259346008 + <_> + + <_> + + + + <_>0 13 20 6 -1. + <_>0 15 20 2 3. + 0 + -0.1180747002363205 + 0.0676330626010895 + 1 + <_> + + + + <_>8 5 12 2 -1. + <_>14 5 6 1 2. + <_>8 6 6 1 2. + 0 + -1.2300079688429832e-003 + 0.5660700798034668 + 0.4292201101779938 + <_> + + <_> + + + + <_>8 14 2 3 -1. + <_>8 15 2 1 3. + 0 + -7.0290351286530495e-003 + 0.7136403918266296 + 1 + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + 8.9325206354260445e-003 + 0.4338876008987427 + 0.7060875296592712 + <_> + + <_> + + + + <_>12 13 7 6 -1. + <_>12 15 7 2 3. + 0 + -0.0477359816431999 + 1 + 0.5268685221672058 + <_> + + + + <_>6 0 8 12 -1. + <_>10 0 4 6 2. + <_>6 6 4 6 2. + 0 + -0.0441555790603161 + 0.2580580115318298 + 0.5406960844993591 + <_> + + <_> + + + + <_>0 15 9 4 -1. + <_>0 17 9 2 2. + 0 + -0.0259834807366133 + 0.1905054003000259 + 1 + <_> + + + + <_>9 0 2 5 -1. + <_>10 0 1 5 2. + 0 + -4.7885831445455551e-003 + 0.2551892995834351 + 0.5339077115058899 + <_> + + <_> + + + + <_>9 5 2 6 -1. + <_>9 5 1 6 2. + 0 + 6.7423451691865921e-003 + 0.4693309962749481 + 1 + <_> + + + + <_>17 2 3 6 -1. + <_>17 4 3 2 3. + 0 + 0.0116547504439950 + 0.5261964201927185 + 0.3145434856414795 + <_> + + <_> + + + + <_>3 11 2 3 -1. + <_>3 12 2 1 3. + 0 + -5.6982729583978653e-003 + 0.1756853014230728 + 1 + <_> + + + + <_>7 13 3 3 -1. + <_>7 14 3 1 3. + 0 + -7.2983349673449993e-003 + 0.7774729728698731 + 0.5124292969703674 + <_> + + <_> + + + + <_>14 12 5 3 -1. + <_>14 13 5 1 3. + 0 + 7.9091778025031090e-003 + 0.5284559726715088 + 1 + <_> + + + + <_>4 8 14 3 -1. + <_>4 9 14 1 3. + 0 + -1.5874979726504534e-004 + 0.3887802064418793 + 0.5501173734664917 + <_> + + <_> + + + + <_>1 12 5 3 -1. + <_>1 13 5 1 3. + 0 + -6.2235877849161625e-003 + 0.2489829063415527 + 1 + <_> + + + + <_>1 15 12 2 -1. + <_>1 15 6 1 2. + <_>7 16 6 1 2. + 0 + 1.3308860361576080e-003 + 0.4262146055698395 + 0.5935062170028687 + <_> + + <_> + + + + <_>12 11 4 2 -1. + <_>12 12 4 1 2. + 0 + 5.2055278792977333e-003 + 1 + 0.2545222938060761 + <_> + + + + <_>9 8 3 5 -1. + <_>10 8 1 5 3. + 0 + 0.0140651697292924 + 0.4851990044116974 + 0.7021418809890747 + <_> + + <_> + + + + <_>9 5 2 6 -1. + <_>10 5 1 6 2. + 0 + -6.7384149879217148e-003 + 0.7143270969390869 + 1 + <_> + + + + <_>0 2 3 6 -1. + <_>0 4 3 2 3. + 0 + 3.3406780567020178e-003 + 0.5175725221633911 + 0.2808643877506256 + <_> + + <_> + + + + <_>12 11 4 2 -1. + <_>12 12 4 1 2. + 0 + -0.0118806995451450 + 1 + 0.5173221826553345 + <_> + + + + <_>9 7 3 5 -1. + <_>10 7 1 5 3. + 0 + 1.4226379571482539e-003 + 0.4502865970134735 + 0.5795695185661316 + <_> + + <_> + + + + <_>4 11 4 2 -1. + <_>4 12 4 1 2. + 0 + 2.9858129564672709e-003 + 1 + 0.1915116012096405 + <_> + + + + <_>8 8 3 5 -1. + <_>9 8 1 5 3. + 0 + -2.0481580868363380e-003 + 0.6502432227134705 + 0.4559315145015717 + <_> + + <_> + + + + <_>9 3 3 1 -1. + <_>10 3 1 1 3. + 0 + 1.7122729914262891e-003 + 0.5376247167587280 + 1 + <_> + + + + <_>16 5 3 8 -1. + <_>17 5 1 8 3. + 0 + -0.0169808696955442 + 0.7056233286857605 + 0.4914605915546417 + <_> + + <_> + + + + <_>8 3 3 1 -1. + <_>9 3 1 1 3. + 0 + -1.1290470138192177e-003 + 0.2678706049919128 + 1 + <_> + + + + <_>1 5 3 8 -1. + <_>2 5 1 8 3. + 0 + 2.8620059601962566e-003 + 0.4410853981971741 + 0.6368319988250732 + <_> + + <_> + + + + <_>10 1 3 3 -1. + <_>11 1 1 3 3. + 0 + -3.8065758999437094e-003 + 0.2763563990592957 + 1 + <_> + + + + <_>17 5 2 4 -1. + <_>17 5 1 4 2. + 0 + 5.9090270660817623e-003 + 0.4867301881313324 + 0.6728776097297669 + <_> + + <_> + + + + <_>2 8 14 3 -1. + <_>2 9 14 1 3. + 0 + 1.1004370171576738e-003 + 0.4070514142513275 + 1 + <_> + + + + <_>9 7 1 3 -1. + <_>9 8 1 1 3. + 0 + -2.3396299220621586e-003 + 0.2604948878288269 + 0.6154860258102417 + <_> + + <_> + + + + <_>6 1 8 10 -1. + <_>6 6 8 5 2. + 0 + -3.6068160552531481e-003 + 0.5731999874114990 + 1 + <_> + + + + <_>13 0 6 8 -1. + <_>16 0 3 4 2. + <_>13 4 3 4 2. + 0 + 0.0408311896026134 + 0.4973376989364624 + 0.7387006878852844 + <_> + + <_> + + + + <_>1 5 2 4 -1. + <_>2 5 1 4 2. + 0 + -7.1082250215113163e-003 + 0.6984751224517822 + 1 + <_> + + + + <_>4 2 12 2 -1. + <_>4 3 12 1 2. + 0 + -9.3759730225428939e-004 + 0.2691167891025543 + 0.4741779863834381 + <_> + + <_> + + + + <_>8 8 4 4 -1. + <_>8 10 4 2 2. + 0 + -1.6740820137783885e-003 + 0.3551014065742493 + 1 + <_> + + + + <_>5 6 12 4 -1. + <_>9 6 4 4 3. + 0 + 0.0882877036929131 + 0.5244613885879517 + 0.2096650004386902 + <_> + + <_> + + + + <_>1 2 8 1 -1. + <_>5 2 4 1 2. + 0 + 8.2009629113599658e-004 + 0.4131096899509430 + 1 + <_> + + + + <_>1 1 6 10 -1. + <_>3 1 2 10 3. + 0 + -7.6624617213383317e-004 + 0.4620293080806732 + 0.6775410175323486 + <_> + + <_> + + + + <_>8 6 8 2 -1. + <_>8 6 4 2 2. + 0 + 6.5769668435677886e-004 + 1 + 0.5628275275230408 + <_> + + + + <_>10 7 6 6 -1. + <_>12 7 2 6 3. + 0 + -2.1304790861904621e-003 + 0.5576859712600708 + 0.4577650129795075 + <_> + + <_> + + + + <_>4 6 8 2 -1. + <_>8 6 4 2 2. + 0 + -3.7317050737328827e-004 + 1 + 0.4959256052970886 + <_> + + + + <_>4 7 6 6 -1. + <_>6 7 2 6 3. + 0 + -0.0111722303554416 + 0.5625635981559753 + 0.2047107964754105 + <_> + + <_> + + + + <_>3 14 16 4 -1. + <_>3 16 16 2 2. + 0 + 0.0434352196753025 + 1 + 0.2242148071527481 + <_> + + + + <_>8 12 4 2 -1. + <_>8 13 4 1 2. + 0 + 9.6736161503940821e-004 + 0.4533343911170960 + 0.6199932098388672 + <_> + + <_> + + + + <_>8 12 3 3 -1. + <_>8 13 3 1 3. + 0 + -3.1452889088541269e-003 + 0.6662756204605103 + 1 + <_> + + + + <_>5 12 6 1 -1. + <_>8 12 3 1 2. + 0 + 1.5233129961416125e-003 + 0.5007988214492798 + 0.2384992986917496 + <_> + + <_> + + + + <_>18 10 2 3 -1. + <_>18 11 2 1 3. + 0 + 2.0854279864579439e-003 + 1 + 0.3753500878810883 + <_> + + + + <_>16 8 4 6 -1. + <_>16 10 4 2 3. + 0 + 0.0360982008278370 + 0.5177171230316162 + 0.1634493023157120 + <_> + + <_> + + + + <_>8 3 2 1 -1. + <_>9 3 1 1 2. + 0 + 1.6179570229724050e-003 + 1 + 0.2587381899356842 + <_> + + + + <_>7 1 3 9 -1. + <_>8 1 1 9 3. + 0 + -6.2132300809025764e-004 + 0.6299533843994141 + 0.4658789932727814 + <_> + + <_> + + + + <_>5 11 11 6 -1. + <_>5 14 11 3 2. + 0 + 7.1878539165481925e-004 + 1 + 0.3354076147079468 + <_> + + + + <_>12 2 3 14 -1. + <_>12 9 3 7 2. + 0 + -0.0393395200371742 + 0.2154128998517990 + 0.5235713720321655 + <_> + + <_> + + + + <_>8 7 3 3 -1. + <_>9 7 1 3 3. + 0 + -1.0988829890266061e-003 + 0.6468896865844727 + 1 + <_> + + + + <_>3 5 12 5 -1. + <_>7 5 4 5 3. + 0 + 2.1191420964896679e-003 + 0.2893089056015015 + 0.5254815816879273 + 22.5852909088134770 + 8 + -1 + <_> + + + <_> + + <_> + + + + <_>1 2 6 3 -1. + <_>4 2 3 3 2. + 0 + 5.2359891124069691e-003 + 0.3299711048603058 + 1 + <_> + + + + <_>5 5 6 10 -1. + <_>5 5 3 5 2. + <_>8 10 3 5 2. + 0 + -2.2169889416545630e-003 + 0.7041593194007874 + 0.3235465884208679 + <_> + + <_> + + + + <_>16 18 2 2 -1. + <_>16 18 1 2 2. + 0 + -8.2303592935204506e-003 + 1 + 0.4961170852184296 + <_> + + + + <_>16 18 2 2 -1. + <_>16 18 1 2 2. + 0 + -8.2303592935204506e-003 + 0.7128043174743652 + 0.4961170852184296 + <_> + + <_> + + + + <_>8 4 2 5 -1. + <_>9 4 1 5 2. + 0 + 4.5343261444941163e-004 + 0.3208472132682800 + 1 + <_> + + + + <_>8 4 1 4 -1. + <_>8 6 1 2 2. + 0 + -4.1777061414904892e-004 + 0.6613916754722595 + 0.3551332950592041 + <_> + + <_> + + + + <_>7 15 12 4 -1. + <_>13 15 6 2 2. + <_>7 17 6 2 2. + 0 + 2.7823769487440586e-003 + 0.3710134923458099 + 1 + <_> + + + + <_>11 18 6 2 -1. + <_>11 19 6 1 2. + 0 + -6.0361868236213923e-005 + 0.5746393799781799 + 0.3894880115985870 + <_> + + <_> + + + + <_>7 7 4 10 -1. + <_>7 12 4 5 2. + 0 + 3.5061789676547050e-003 + 1 + 0.3054102957248688 + <_> + + + + <_>5 6 10 8 -1. + <_>5 10 10 4 2. + 0 + 1.7013119941111654e-004 + 0.2885577976703644 + 0.6487745046615601 + <_> + + <_> + + + + <_>11 1 6 12 -1. + <_>14 1 3 6 2. + <_>11 7 3 6 2. + 0 + -2.3378930054605007e-003 + 1 + 0.3174431025981903 + <_> + + + + <_>5 8 12 1 -1. + <_>9 8 4 1 3. + 0 + -2.1369170863181353e-003 + 0.3820919990539551 + 0.5232893228530884 + <_> + + <_> + + + + <_>4 7 3 6 -1. + <_>4 9 3 2 3. + 0 + 1.0250400518998504e-003 + 0.3622795045375824 + 1 + <_> + + + + <_>4 11 3 4 -1. + <_>4 13 3 2 2. + 0 + -4.4726220949087292e-005 + 0.6538959145545960 + 0.4003680944442749 + <_> + + <_> + + + + <_>14 16 2 2 -1. + <_>14 17 2 1 2. + 0 + 5.7102291611954570e-004 + 1 + 0.3893173038959503 + <_> + + + + <_>15 15 2 2 -1. + <_>15 16 2 1 2. + 0 + 5.7743012439459562e-004 + 0.5614532828330994 + 0.3687644004821777 + <_> + + <_> + + + + <_>7 12 6 2 -1. + <_>7 13 6 1 2. + 0 + 7.9692091094329953e-004 + 1 + 0.6443027853965759 + <_> + + + + <_>8 13 4 2 -1. + <_>8 14 4 1 2. + 0 + 3.5945948911830783e-004 + 0.3380852937698364 + 0.5824648141860962 + <_> + + <_> + + + + <_>11 1 6 12 -1. + <_>14 1 3 6 2. + <_>11 7 3 6 2. + 0 + 4.3973900028504431e-004 + 1 + 0.3938767015933991 + <_> + + + + <_>12 2 4 2 -1. + <_>12 3 4 1 2. + 0 + -8.9061429025605321e-004 + 0.3427971005439758 + 0.5515698790550232 + <_> + + <_> + + + + <_>3 10 12 6 -1. + <_>3 10 6 3 2. + <_>9 13 6 3 2. + 0 + 5.4110242053866386e-003 + 1 + 0.3803538084030151 + <_> + + + + <_>3 1 6 12 -1. + <_>3 1 3 6 2. + <_>6 7 3 6 2. + 0 + -8.5764907998964190e-004 + 0.6439505219459534 + 0.4168345928192139 + <_> + + <_> + + + + <_>16 6 4 14 -1. + <_>18 6 2 7 2. + <_>16 13 2 7 2. + 0 + -0.0220006499439478 + 0.6654601097106934 + 1 + <_> + + + + <_>5 1 10 8 -1. + <_>10 1 5 4 2. + <_>5 5 5 4 2. + 0 + -7.8731682151556015e-003 + 0.4182722866535187 + 0.5604724287986755 + <_> + + <_> + + + + <_>0 6 4 14 -1. + <_>0 6 2 7 2. + <_>2 13 2 7 2. + 0 + -0.0274444594979286 + 0.6586862802505493 + 1 + <_> + + + + <_>1 15 12 4 -1. + <_>1 15 6 2 2. + <_>7 17 6 2 2. + 0 + 1.9792269449681044e-003 + 0.3244912028312683 + 0.4882870018482208 + <_> + + <_> + + + + <_>10 17 3 3 -1. + <_>11 17 1 3 3. + 0 + -5.6783691979944706e-003 + 0.2229079008102417 + 1 + <_> + + + + <_>11 2 2 6 -1. + <_>12 2 1 3 2. + <_>11 5 1 3 2. + 0 + 1.5057219570735469e-005 + 0.4107285141944885 + 0.5747591257095337 + <_> + + <_> + + + + <_>7 17 3 3 -1. + <_>8 17 1 3 3. + 0 + -5.4136710241436958e-003 + 0.2065797001123428 + 1 + <_> + + + + <_>8 15 4 3 -1. + <_>8 16 4 1 3. + 0 + 5.3679239936172962e-003 + 0.4926423132419586 + 0.7139484882354736 + <_> + + <_> + + + + <_>10 15 4 2 -1. + <_>12 15 2 1 2. + <_>10 16 2 1 2. + 0 + -3.1426660716533661e-003 + 0.6780086755752564 + 1 + <_> + + + + <_>13 13 4 3 -1. + <_>13 14 4 1 3. + 0 + 0.0109073901548982 + 0.5214930176734924 + 0.1143995970487595 + <_> + + <_> + + + + <_>3 13 4 3 -1. + <_>3 14 4 1 3. + 0 + 5.8436761610209942e-003 + 1 + 0.1937526017427445 + <_> + + + + <_>7 2 2 6 -1. + <_>7 2 1 3 2. + <_>8 5 1 3 2. + 0 + 9.0507230197545141e-005 + 0.3812577128410339 + 0.5514187812805176 + <_> + + <_> + + + + <_>2 1 16 3 -1. + <_>2 2 16 1 3. + 0 + -0.0163457896560431 + 0.2474023997783661 + 1 + <_> + + + + <_>10 15 4 2 -1. + <_>12 15 2 1 2. + <_>10 16 2 1 2. + 0 + 1.5987500082701445e-003 + 0.4817782938480377 + 0.5923079848289490 + <_> + + <_> + + + + <_>6 15 4 2 -1. + <_>6 15 2 1 2. + <_>8 16 2 1 2. + 0 + -4.0257978253066540e-003 + 0.7508208751678467 + 1 + <_> + + + + <_>3 0 13 3 -1. + <_>3 1 13 1 3. + 0 + -6.7750471644103527e-003 + 0.2879810929298401 + 0.5199695229530335 + <_> + + <_> + + + + <_>0 9 20 3 -1. + <_>0 10 20 1 3. + 0 + -3.2470689620822668e-003 + 0.3044910132884979 + 1 + <_> + + + + <_>6 7 9 2 -1. + <_>6 8 9 1 2. + 0 + 1.5409620245918632e-003 + 0.4063482880592346 + 0.5676562786102295 + <_> + + <_> + + + + <_>8 14 3 6 -1. + <_>9 14 1 6 3. + 0 + -0.0128581197932363 + 0.0967175588011742 + 1 + <_> + + + + <_>9 10 2 2 -1. + <_>9 11 2 1 2. + 0 + -1.4824670506641269e-004 + 0.4537833034992218 + 0.6115375161170960 + <_> + + <_> + + + + <_>9 7 2 5 -1. + <_>9 7 1 5 2. + 0 + -9.0210810303688049e-003 + 1 + 0.4807750880718231 + <_> + + + + <_>5 6 10 3 -1. + <_>5 6 5 3 2. + 0 + -0.0287950299680233 + 0.3403795063495636 + 0.5255529284477234 + <_> + + <_> + + + + <_>9 7 2 5 -1. + <_>10 7 1 5 2. + 0 + 9.0210810303688049e-003 + 1 + 0.7505835890769959 + <_> + + + + <_>5 6 10 3 -1. + <_>10 6 5 3 2. + 0 + 7.4121179059147835e-003 + 0.5455446839332581 + 0.3226068913936615 + <_> + + <_> + + + + <_>13 9 2 2 -1. + <_>13 9 1 2 2. + 0 + -3.7217529024928808e-003 + 0.2311848998069763 + 1 + <_> + + + + <_>4 3 12 11 -1. + <_>8 3 4 11 3. + 0 + 0.1986588984727860 + 0.5271047949790955 + 0.1469929963350296 + <_> + + <_> + + + + <_>7 1 2 7 -1. + <_>8 1 1 7 2. + 0 + 1.5208719560177997e-005 + 0.3678138852119446 + 1 + <_> + + + + <_>7 4 3 8 -1. + <_>8 4 1 8 3. + 0 + -3.9089918136596680e-003 + 0.7131929993629456 + 0.4993866980075836 + <_> + + <_> + + + + <_>13 9 2 2 -1. + <_>13 9 1 2 2. + 0 + 2.5106288958340883e-003 + 0.5312054157257080 + 1 + <_> + + + + <_>11 6 2 2 -1. + <_>12 6 1 1 2. + <_>11 7 1 1 2. + 0 + 2.3921660613268614e-004 + 0.4689378142356873 + 0.5714021921157837 + <_> + + <_> + + + + <_>5 4 2 3 -1. + <_>5 5 2 1 3. + 0 + 6.9443131797015667e-003 + 1 + 0.6948797702789307 + <_> + + + + <_>6 5 1 3 -1. + <_>6 6 1 1 3. + 0 + 1.2065629707649350e-003 + 0.4004504978656769 + 0.5874881744384766 + <_> + + <_> + + + + <_>13 9 2 2 -1. + <_>13 9 1 2 2. + 0 + 2.5106288958340883e-003 + 0.5329571962356567 + 1 + <_> + + + + <_>16 14 3 3 -1. + <_>16 15 3 1 3. + 0 + 1.7514040227979422e-003 + 0.5545849204063416 + 0.3449581861495972 + <_> + + <_> + + + + <_>5 9 2 2 -1. + <_>6 9 1 2 2. + 0 + -4.1978210210800171e-003 + 0.1217183023691177 + 1 + <_> + + + + <_>1 14 3 3 -1. + <_>1 15 3 1 3. + 0 + 1.3092850567772985e-003 + 0.5375049710273743 + 0.3415625095367432 + <_> + + <_> + + + + <_>13 1 1 6 -1. + <_>13 3 1 2 3. + 0 + 6.7396182566881180e-004 + 0.4195179045200348 + 1 + <_> + + + + <_>13 3 7 2 -1. + <_>13 4 7 1 2. + 0 + -0.0105307102203369 + 0.3460753858089447 + 0.5155860185623169 + <_> + + <_> + + + + <_>0 6 20 14 -1. + <_>0 13 20 7 2. + 0 + -0.4067229926586151 + 0.0580656789243221 + 1 + <_> + + + + <_>0 4 3 6 -1. + <_>0 6 3 2 3. + 0 + -0.0263145491480827 + 0.1473449021577835 + 0.5559378266334534 + <_> + + <_> + + + + <_>10 1 9 6 -1. + <_>10 3 9 2 3. + 0 + 2.2557149641215801e-003 + 1 + 0.5477715134620667 + <_> + + + + <_>8 0 12 5 -1. + <_>8 0 6 5 2. + 0 + 0.0121548604220152 + 0.4207791090011597 + 0.5621880888938904 + <_> + + <_> + + + + <_>0 0 18 5 -1. + <_>6 0 6 5 3. + 0 + -0.0184365399181843 + 0.6447147130966187 + 1 + <_> + + + + <_>1 1 9 6 -1. + <_>1 3 9 2 3. + 0 + 5.3676147945225239e-004 + 0.2765127122402191 + 0.4888595938682556 + <_> + + <_> + + + + <_>15 15 2 2 -1. + <_>15 16 2 1 2. + 0 + -2.6265541091561317e-003 + 1 + 0.5264691114425659 + <_> + + + + <_>13 16 3 4 -1. + <_>13 18 3 2 2. + 0 + -5.1119807176291943e-004 + 0.5785310268402100 + 0.4291102886199951 + <_> + + <_> + + + + <_>3 15 2 2 -1. + <_>3 16 2 1 2. + 0 + 4.1454841266386211e-004 + 1 + 0.3455410897731781 + <_> + + + + <_>4 16 3 4 -1. + <_>4 18 3 2 2. + 0 + -5.5028748465701938e-004 + 0.6026918888092041 + 0.4143893122673035 + <_> + + <_> + + + + <_>11 14 1 3 -1. + <_>11 15 1 1 3. + 0 + -1.0347720235586166e-003 + 0.6095293760299683 + 1 + <_> + + + + <_>9 13 5 3 -1. + <_>9 14 5 1 3. + 0 + -3.3966631162911654e-003 + 0.6108282208442688 + 0.4707720875740051 + <_> + + <_> + + + + <_>0 0 3 6 -1. + <_>0 2 3 2 3. + 0 + 3.1795909162610769e-003 + 1 + 0.3244366943836212 + <_> + + + + <_>4 1 6 3 -1. + <_>6 1 2 3 3. + 0 + -1.6528950072824955e-004 + 0.3830757141113281 + 0.5734326243400574 + <_> + + <_> + + + + <_>9 13 4 3 -1. + <_>9 14 4 1 3. + 0 + 8.3725210279226303e-003 + 1 + 0.6610919237136841 + <_> + + + + <_>8 15 5 3 -1. + <_>8 16 5 1 3. + 0 + -2.5799809955060482e-003 + 0.6139307022094727 + 0.4686149954795837 + <_> + + <_> + + + + <_>8 3 3 2 -1. + <_>9 3 1 2 3. + 0 + 9.0194388758391142e-004 + 1 + 0.3520022034645081 + <_> + + + + <_>1 8 18 2 -1. + <_>1 9 18 1 2. + 0 + 3.6952210939489305e-004 + 0.2578754127025604 + 0.5467242002487183 + <_> + + <_> + + + + <_>11 14 1 3 -1. + <_>11 15 1 1 3. + 0 + 9.9746137857437134e-004 + 0.4820146858692169 + 1 + <_> + + + + <_>8 13 6 3 -1. + <_>8 14 6 1 3. + 0 + -3.6688039544969797e-003 + 0.5710150003433228 + 0.4831911027431488 + <_> + + <_> + + + + <_>8 14 1 3 -1. + <_>8 15 1 1 3. + 0 + -8.9501030743122101e-004 + 0.6133679151535034 + 1 + <_> + + + + <_>4 13 12 4 -1. + <_>4 13 6 2 2. + <_>10 15 6 2 2. + 0 + 5.1904921419918537e-003 + 0.4928582906723023 + 0.2581309080123901 + <_> + + <_> + + + + <_>10 7 2 2 -1. + <_>10 7 1 2 2. + 0 + 4.2274440056644380e-004 + 0.4471124112606049 + 1 + <_> + + + + <_>13 4 2 8 -1. + <_>14 4 1 4 2. + <_>13 8 1 4 2. + 0 + 8.5176713764667511e-003 + 0.5161024928092957 + 0.3316533863544464 + <_> + + <_> + + + + <_>0 5 4 6 -1. + <_>0 7 4 2 3. + 0 + -0.0366236083209515 + 0.0926062166690826 + 1 + <_> + + + + <_>8 7 2 2 -1. + <_>9 7 1 2 2. + 0 + -4.1103712283074856e-003 + 0.8522114753723145 + 0.5137907862663269 + <_> + + <_> + + + + <_>13 0 3 7 -1. + <_>14 0 1 7 3. + 0 + -6.6017331555485725e-003 + 1 + 0.5459060072898865 + <_> + + + + <_>11 2 2 14 -1. + <_>11 2 1 14 2. + 0 + 0.0255786404013634 + 0.5219352841377258 + 0.1927185952663422 + <_> + + <_> + + + + <_>4 0 3 7 -1. + <_>5 0 1 7 3. + 0 + 0.0114474399015307 + 1 + 0.1916002035140991 + <_> + + + + <_>5 5 8 12 -1. + <_>5 5 4 6 2. + <_>9 11 4 6 2. + 0 + 7.2427501436322927e-004 + 0.5231571197509766 + 0.3535340130329132 + <_> + + <_> + + + + <_>11 4 6 3 -1. + <_>11 5 6 1 3. + 0 + 9.7127500921487808e-003 + 1 + 0.6464101076126099 + <_> + + + + <_>12 3 4 3 -1. + <_>12 4 4 1 3. + 0 + -0.0113375699147582 + 0.7383037805557251 + 0.4964743852615356 + <_> + + <_> + + + + <_>5 5 10 12 -1. + <_>5 5 5 6 2. + <_>10 11 5 6 2. + 0 + -8.1453882157802582e-003 + 0.3611705899238586 + 1 + <_> + + + + <_>3 6 12 3 -1. + <_>9 6 6 3 2. + 0 + -8.5570756345987320e-003 + 0.3421907126903534 + 0.5943511724472046 + <_> + + <_> + + + + <_>9 6 2 7 -1. + <_>9 6 1 7 2. + 0 + 2.2993308957666159e-003 + 0.4550104141235352 + 1 + <_> + + + + <_>9 5 2 4 -1. + <_>9 5 1 4 2. + 0 + 3.8430930580943823e-003 + 0.4716862142086029 + 0.6656190752983093 + <_> + + <_> + + + + <_>8 7 3 3 -1. + <_>9 7 1 3 3. + 0 + -9.9116540513932705e-004 + 1 + 0.4592716991901398 + <_> + + + + <_>5 1 6 4 -1. + <_>7 1 2 4 3. + 0 + 0.0254964698106050 + 0.6563401222229004 + 0.1258835047483444 + <_> + + <_> + + + + <_>13 16 7 3 -1. + <_>13 17 7 1 3. + 0 + -0.0157483592629433 + 1 + 0.5239502191543579 + <_> + + + + <_>12 4 3 3 -1. + <_>12 5 3 1 3. + 0 + -0.0180461201816797 + 0.8015851974487305 + 0.5007957816123962 + <_> + + <_> + + + + <_>0 16 7 3 -1. + <_>0 17 7 1 3. + 0 + 0.0103233903646469 + 1 + 0.2274820059537888 + <_> + + + + <_>5 4 3 3 -1. + <_>5 5 3 1 3. + 0 + 1.6452240524813533e-003 + 0.4351946115493774 + 0.5867627859115601 + <_> + + <_> + + + + <_>12 9 8 10 -1. + <_>12 9 4 10 2. + 0 + 0.0158811490982771 + 0.4465051889419556 + 1 + <_> + + + + <_>8 10 12 5 -1. + <_>12 10 4 5 3. + 0 + 0.0105865197256207 + 0.4544458091259003 + 0.5707110762596130 + <_> + + <_> + + + + <_>0 9 8 10 -1. + <_>4 9 4 10 2. + 0 + -0.0215316899120808 + 0.6527643799781799 + 1 + <_> + + + + <_>0 10 12 5 -1. + <_>4 10 4 5 3. + 0 + 5.2480469457805157e-003 + 0.3444727957248688 + 0.5324636101722717 + 25.6093006134033200 + 9 + -1 + <_> + + + <_> + + <_> + + + + <_>2 3 6 2 -1. + <_>5 3 3 2 2. + 0 + 1.8219340126961470e-003 + 0.3108788132667542 + 1 + <_> + + + + <_>0 0 17 9 -1. + <_>0 3 17 3 3. + 0 + 8.1313941627740860e-003 + 0.3133237063884735 + 0.6645867228507996 + <_> + + <_> + + + + <_>4 7 12 2 -1. + <_>8 7 4 2 3. + 0 + 1.7055979697033763e-003 + 0.2640131115913391 + 1 + <_> + + + + <_>10 4 6 4 -1. + <_>12 4 2 4 3. + 0 + -7.4483548814896494e-005 + 0.5647205114364624 + 0.3485372960567474 + <_> + + <_> + + + + <_>0 10 20 4 -1. + <_>0 12 20 2 2. + 0 + 3.8342390325851738e-004 + 1 + 0.3140654861927033 + <_> + + + + <_>4 3 6 5 -1. + <_>6 3 2 5 3. + 0 + 3.1868910882622004e-003 + 0.6489198803901672 + 0.3887729048728943 + <_> + + <_> + + + + <_>1 1 18 4 -1. + <_>7 1 6 4 3. + 0 + 0.1604432016611099 + 1 + 0.7216529846191406 + <_> + + + + <_>13 9 2 3 -1. + <_>13 9 1 3 2. + 0 + -6.7285560071468353e-003 + 0.1653137952089310 + 0.5139825940132141 + <_> + + <_> + + + + <_>6 15 7 4 -1. + <_>6 17 7 2 2. + 0 + 7.2638481469766703e-006 + 0.3140619993209839 + 1 + <_> + + + + <_>3 17 4 2 -1. + <_>3 18 4 1 2. + 0 + 5.5551197146996856e-004 + 0.5993698835372925 + 0.3317398130893707 + <_> + + <_> + + + + <_>9 4 8 10 -1. + <_>9 9 8 5 2. + 0 + -0.0108223203569651 + 0.2652938067913055 + 1 + <_> + + + + <_>9 17 3 2 -1. + <_>10 17 1 2 3. + 0 + -4.5834020711481571e-003 + 0.1849568933248520 + 0.5313957929611206 + <_> + + <_> + + + + <_>8 2 4 8 -1. + <_>8 6 4 4 2. + 0 + -3.0205070506781340e-003 + 1 + 0.4040099978446960 + <_> + + + + <_>3 4 14 12 -1. + <_>3 4 7 6 2. + <_>10 10 7 6 2. + 0 + 0.0778646171092987 + 0.6158189773559570 + 0.1786486953496933 + <_> + + <_> + + + + <_>7 7 6 4 -1. + <_>9 7 2 4 3. + 0 + 0.0264943800866604 + 0.4511089920997620 + 1 + <_> + + + + <_>6 7 9 4 -1. + <_>6 9 9 2 2. + 0 + 0.0369121097028255 + 0.4528219997882843 + 0.5972282886505127 + <_> + + <_> + + + + <_>2 10 3 3 -1. + <_>2 11 3 1 3. + 0 + 5.7857790961861610e-003 + 1 + 0.2533892095088959 + <_> + + + + <_>4 6 2 9 -1. + <_>4 9 2 3 3. + 0 + 9.3849771656095982e-004 + 0.3410412073135376 + 0.5923643708229065 + <_> + + <_> + + + + <_>9 11 3 3 -1. + <_>9 12 3 1 3. + 0 + -0.0110031999647617 + 0.6958044171333313 + 1 + <_> + + + + <_>3 1 15 2 -1. + <_>3 2 15 1 2. + 0 + -1.1737640015780926e-003 + 0.3851084113121033 + 0.5408189296722412 + <_> + + <_> + + + + <_>9 8 2 3 -1. + <_>9 9 2 1 3. + 0 + -3.6596669815480709e-003 + 0.2009308934211731 + 1 + <_> + + + + <_>9 6 2 5 -1. + <_>10 6 1 5 2. + 0 + -2.4822750128805637e-003 + 0.6295393109321594 + 0.4395040869712830 + <_> + + <_> + + + + <_>9 7 2 3 -1. + <_>9 8 2 1 3. + 0 + -4.4606071896851063e-003 + 0.2405299991369247 + 1 + <_> + + + + <_>4 10 12 10 -1. + <_>4 15 12 5 2. + 0 + -3.5969649907201529e-003 + 0.5450174212455750 + 0.3782357871532440 + <_> + + <_> + + + + <_>0 10 4 2 -1. + <_>0 11 4 1 2. + 0 + -3.6222559865564108e-003 + 0.3033896982669830 + 1 + <_> + + + + <_>5 15 9 2 -1. + <_>5 16 9 1 2. + 0 + 1.2059339787811041e-003 + 0.4633778929710388 + 0.6335952281951904 + <_> + + <_> + + + + <_>8 14 6 3 -1. + <_>8 15 6 1 3. + 0 + 4.3124938383698463e-003 + 1 + 0.6598826050758362 + <_> + + + + <_>8 16 4 3 -1. + <_>8 17 4 1 3. + 0 + -4.4961250387132168e-003 + 0.6621696949005127 + 0.4755246937274933 + <_> + + <_> + + + + <_>8 9 4 2 -1. + <_>8 10 4 1 2. + 0 + -1.3860689941793680e-003 + 0.2801201045513153 + 1 + <_> + + + + <_>3 3 14 2 -1. + <_>3 4 14 1 2. + 0 + -5.1588460337370634e-004 + 0.3829489052295685 + 0.5623626708984375 + <_> + + <_> + + + + <_>11 12 1 2 -1. + <_>11 13 1 1 2. + 0 + 7.0330002927221358e-005 + 0.4536342918872833 + 1 + <_> + + + + <_>4 12 12 1 -1. + <_>8 12 4 1 3. + 0 + -2.0976549421902746e-004 + 0.5608139038085938 + 0.4265779852867127 + <_> + + <_> + + + + <_>0 2 1 2 -1. + <_>0 3 1 1 2. + 0 + 1.3642259873449802e-003 + 1 + 0.2637091875076294 + <_> + + + + <_>7 4 4 6 -1. + <_>9 4 2 6 2. + 0 + 1.5483660390600562e-003 + 0.4170750975608826 + 0.5932987928390503 + <_> + + <_> + + + + <_>0 2 20 14 -1. + <_>10 2 10 7 2. + <_>0 9 10 7 2. + 0 + 0.1917960941791534 + 0.5256764292716980 + 1 + <_> + + + + <_>14 6 1 3 -1. + <_>14 7 1 1 3. + 0 + -4.4776909053325653e-003 + 0.6632621884346008 + 0.4892588853836060 + <_> + + <_> + + + + <_>0 4 20 12 -1. + <_>0 4 10 6 2. + <_>10 10 10 6 2. + 0 + -0.1264917999505997 + 0.1499778926372528 + 1 + <_> + + + + <_>8 12 1 2 -1. + <_>8 13 1 1 2. + 0 + 6.5253327193204314e-005 + 0.4233320057392120 + 0.5756040215492249 + <_> + + <_> + + + + <_>9 18 3 2 -1. + <_>10 18 1 2 3. + 0 + 4.1856421157717705e-003 + 0.5288826823234558 + 1 + <_> + + + + <_>9 17 6 2 -1. + <_>11 17 2 2 3. + 0 + 2.7478230185806751e-004 + 0.4524017870426178 + 0.5604125261306763 + <_> + + <_> + + + + <_>5 6 2 3 -1. + <_>5 7 2 1 3. + 0 + -2.2906810045242310e-003 + 0.5578274130821228 + 1 + <_> + + + + <_>5 4 3 3 -1. + <_>5 5 3 1 3. + 0 + 1.6744500026106834e-003 + 0.3323057889938355 + 0.5558788180351257 + <_> + + <_> + + + + <_>14 15 3 2 -1. + <_>14 16 3 1 2. + 0 + 1.2349759927019477e-003 + 1 + 0.3653947114944458 + <_> + + + + <_>11 3 3 4 -1. + <_>12 3 1 4 3. + 0 + -8.7158754467964172e-003 + 0.1924533993005753 + 0.5313649773597717 + <_> + + <_> + + + + <_>3 15 3 2 -1. + <_>3 16 3 1 2. + 0 + 4.6613621525466442e-003 + 1 + 0.2027730941772461 + <_> + + + + <_>9 12 2 3 -1. + <_>9 13 2 1 3. + 0 + -8.5815992206335068e-003 + 0.7636060118675232 + 0.5140826106071472 + <_> + + <_> + + + + <_>9 13 3 7 -1. + <_>10 13 1 7 3. + 0 + 0.0143521204590797 + 0.5252975821495056 + 1 + <_> + + + + <_>12 12 5 3 -1. + <_>12 13 5 1 3. + 0 + -7.7948719263076782e-003 + 0.2632937133312225 + 0.5328689217567444 + <_> + + <_> + + + + <_>8 18 3 2 -1. + <_>9 18 1 2 3. + 0 + -3.4155680332332850e-003 + 0.2416087985038757 + 1 + <_> + + + + <_>4 7 12 4 -1. + <_>4 7 6 2 2. + <_>10 9 6 2 2. + 0 + -4.2639090679585934e-003 + 0.3936544954776764 + 0.5478742122650147 + <_> + + <_> + + + + <_>6 19 14 1 -1. + <_>6 19 7 1 2. + 0 + 8.7177697569131851e-003 + 0.4788199067115784 + 1 + <_> + + + + <_>16 14 3 2 -1. + <_>16 15 3 1 2. + 0 + -3.2232629600912333e-003 + 0.3631612062454224 + 0.5288316011428833 + <_> + + <_> + + + + <_>1 0 6 10 -1. + <_>1 0 3 5 2. + <_>4 5 3 5 2. + 0 + -0.0421883687376976 + 0.6931139230728149 + 1 + <_> + + + + <_>1 0 4 10 -1. + <_>1 0 2 5 2. + <_>3 5 2 5 2. + 0 + 0.0198757499456406 + 0.4520100057125092 + 0.6855055093765259 + <_> + + <_> + + + + <_>15 3 5 6 -1. + <_>15 5 5 2 3. + 0 + -0.0311345104128122 + 1 + 0.5300424098968506 + <_> + + + + <_>9 5 2 15 -1. + <_>9 10 2 5 3. + 0 + 5.7032387703657150e-003 + 0.5606892108917236 + 0.4230622947216034 + <_> + + <_> + + + + <_>0 3 5 6 -1. + <_>0 5 5 2 3. + 0 + 5.2733682096004486e-003 + 1 + 0.3247228860855103 + <_> + + + + <_>6 0 3 2 -1. + <_>7 0 1 2 3. + 0 + -3.1231069006025791e-003 + 0.1985695958137512 + 0.5349872708320618 + <_> + + <_> + + + + <_>12 8 8 2 -1. + <_>16 8 4 1 2. + <_>12 9 4 1 2. + 0 + 4.6453849063254893e-004 + 0.4207508862018585 + 1 + <_> + + + + <_>5 8 12 1 -1. + <_>9 8 4 1 3. + 0 + 0.0303558893501759 + 0.5153458714485169 + 0.3118101060390472 + <_> + + <_> + + + + <_>3 13 3 3 -1. + <_>3 14 3 1 3. + 0 + -4.2992769740521908e-003 + 0.3274506926536560 + 1 + <_> + + + + <_>5 13 3 2 -1. + <_>5 14 3 1 2. + 0 + 1.9509199773892760e-004 + 0.5953078269958496 + 0.4225521087646484 + <_> + + <_> + + + + <_>9 15 3 3 -1. + <_>9 16 3 1 3. + 0 + -7.7784480527043343e-003 + 0.7211179733276367 + 1 + <_> + + + + <_>7 15 7 3 -1. + <_>7 16 7 1 3. + 0 + 0.0169175993651152 + 0.4936591982841492 + 0.7030277252197266 + <_> + + <_> + + + + <_>3 14 11 6 -1. + <_>3 16 11 2 3. + 0 + -0.0519485697150230 + 0.1425534933805466 + 1 + <_> + + + + <_>0 19 14 1 -1. + <_>7 19 7 1 2. + 0 + -5.4751220159232616e-003 + 0.6059331893920898 + 0.4393995106220245 + <_> + + <_> + + + + <_>9 17 6 2 -1. + <_>11 17 2 2 3. + 0 + 1.5210839592327829e-005 + 0.4488849937915802 + 1 + <_> + + + + <_>12 11 6 2 -1. + <_>14 11 2 2 3. + 0 + 1.0235579684376717e-003 + 0.4256550073623657 + 0.5795438289642334 + <_> + + <_> + + + + <_>5 17 6 2 -1. + <_>7 17 2 2 3. + 0 + -1.0427719826111570e-004 + 0.4246039986610413 + 1 + <_> + + + + <_>0 1 9 10 -1. + <_>3 1 3 10 3. + 0 + 8.7853781878948212e-003 + 0.4958009123802185 + 0.6759430766105652 + <_> + + <_> + + + + <_>10 1 3 3 -1. + <_>11 1 1 3 3. + 0 + 3.4012699034065008e-003 + 0.5423480868339539 + 1 + <_> + + + + <_>9 5 6 4 -1. + <_>9 5 3 4 2. + 0 + 5.8582378551363945e-004 + 0.3636542856693268 + 0.5464348793029785 + <_> + + <_> + + + + <_>7 1 3 3 -1. + <_>8 1 1 3 3. + 0 + -2.2973360028117895e-003 + 0.2548818886280060 + 1 + <_> + + + + <_>0 4 4 11 -1. + <_>2 4 2 11 2. + 0 + -0.0143301896750927 + 0.6587656736373901 + 0.4532802104949951 + <_> + + <_> + + + + <_>9 5 6 4 -1. + <_>9 5 3 4 2. + 0 + 9.8565965890884399e-004 + 0.3822771012783051 + 1 + <_> + + + + <_>6 0 8 10 -1. + <_>10 0 4 5 2. + <_>6 5 4 5 2. + 0 + -0.0466407611966133 + 0.3077321946620941 + 0.5244132876396179 + <_> + + <_> + + + + <_>6 6 5 14 -1. + <_>6 13 5 7 2. + 0 + -0.1190730035305023 + 0.1033862978219986 + 1 + <_> + + + + <_>8 5 4 14 -1. + <_>8 12 4 7 2. + 0 + 0.0193332806229591 + 0.5554745197296143 + 0.3221316933631897 + <_> + + <_> + + + + <_>7 7 6 5 -1. + <_>9 7 2 5 3. + 0 + 0.0314278490841389 + 0.4682379066944122 + 1 + <_> + + + + <_>9 3 3 9 -1. + <_>9 6 3 3 3. + 0 + 2.0082130504306406e-004 + 0.5373070240020752 + 0.3800666928291321 + <_> + + <_> + + + + <_>8 1 3 3 -1. + <_>9 1 1 3 3. + 0 + -6.2584900297224522e-003 + 0.1799207031726837 + 1 + <_> + + + + <_>9 6 2 4 -1. + <_>10 6 1 4 2. + 0 + 8.2861045375466347e-003 + 0.5095068812370300 + 0.7544605135917664 + <_> + + <_> + + + + <_>10 8 6 9 -1. + <_>10 8 3 9 2. + 0 + 2.0529709290713072e-003 + 0.5628644824028015 + 1 + <_> + + + + <_>16 4 3 8 -1. + <_>17 4 1 8 3. + 0 + 3.2524869311600924e-003 + 0.4801689088344574 + 0.5802102088928223 + <_> + + <_> + + + + <_>5 9 10 6 -1. + <_>5 9 5 3 2. + <_>10 12 5 3 2. + 0 + -0.0318849012255669 + 0.1742745041847229 + 1 + <_> + + + + <_>5 5 6 4 -1. + <_>8 5 3 4 2. + 0 + 1.8379340181127191e-003 + 0.3466596901416779 + 0.5107154846191406 + <_> + + <_> + + + + <_>9 8 4 2 -1. + <_>9 9 4 1 2. + 0 + -4.8512680223211646e-004 + 1 + 0.5326086282730103 + <_> + + + + <_>11 7 2 2 -1. + <_>11 7 1 2 2. + 0 + -2.5407879147678614e-003 + 0.6342775225639343 + 0.4992693066596985 + <_> + + <_> + + + + <_>8 12 4 8 -1. + <_>8 12 2 4 2. + <_>10 16 2 4 2. + 0 + -5.1559060811996460e-003 + 0.3433429002761841 + 1 + <_> + + + + <_>0 1 4 9 -1. + <_>0 4 4 3 3. + 0 + -0.0449687503278255 + 0.1868136972188950 + 0.5215464830398560 + <_> + + <_> + + + + <_>9 10 3 3 -1. + <_>9 11 3 1 3. + 0 + 5.8984281495213509e-003 + 1 + 0.6229305267333984 + <_> + + + + <_>8 11 4 2 -1. + <_>8 12 4 1 2. + 0 + 3.2763120252639055e-003 + 0.4935772120952606 + 0.7217944860458374 + <_> + + <_> + + + + <_>7 8 4 2 -1. + <_>7 9 4 1 2. + 0 + -1.0161520185647532e-004 + 1 + 0.5007976293563843 + <_> + + + + <_>7 8 6 1 -1. + <_>9 8 2 1 3. + 0 + -1.6290300118271261e-004 + 0.6024149060249329 + 0.2329508066177368 + <_> + + <_> + + + + <_>16 0 4 9 -1. + <_>16 0 2 9 2. + 0 + 9.0541364625096321e-003 + 0.4510416984558106 + 1 + <_> + + + + <_>16 0 3 6 -1. + <_>16 3 3 3 2. + 0 + 0.0353984907269478 + 0.5141996741294861 + 0.2860291898250580 + <_> + + <_> + + + + <_>0 0 4 9 -1. + <_>2 0 2 9 2. + 0 + 5.6469351984560490e-003 + 0.4704925119876862 + 1 + <_> + + + + <_>1 0 3 6 -1. + <_>1 3 3 3 2. + 0 + -2.4807190056890249e-003 + 0.4179851114749908 + 0.6726647019386292 + <_> + + <_> + + + + <_>9 7 6 9 -1. + <_>11 7 2 9 3. + 0 + -4.1088787838816643e-003 + 0.5809801816940308 + 1 + <_> + + + + <_>10 6 3 6 -1. + <_>11 6 1 6 3. + 0 + -2.0714469719678164e-003 + 0.6074783802032471 + 0.4524059891700745 + <_> + + <_> + + + + <_>1 2 18 2 -1. + <_>1 2 9 1 2. + <_>10 3 9 1 2. + 0 + -2.8939060866832733e-003 + 0.3383519947528839 + 1 + <_> + + + + <_>5 8 6 8 -1. + <_>7 8 2 8 3. + 0 + 1.3467279495671391e-003 + 0.5696910023689270 + 0.3970845043659210 + <_> + + <_> + + + + <_>9 0 6 16 -1. + <_>11 0 2 16 3. + 0 + -0.0907791331410408 + 0.1502701938152313 + 1 + <_> + + + + <_>14 1 6 18 -1. + <_>17 1 3 9 2. + <_>14 10 3 9 2. + 0 + -0.0831717625260353 + 0.7573670744895935 + 0.4936437010765076 + <_> + + <_> + + + + <_>2 9 2 3 -1. + <_>2 10 2 1 3. + 0 + -1.4107000315561891e-003 + 0.3390932977199554 + 1 + <_> + + + + <_>0 1 6 18 -1. + <_>0 1 3 9 2. + <_>3 10 3 9 2. + 0 + 0.0556687600910664 + 0.5025097131729126 + 0.7422083020210266 + <_> + + <_> + + + + <_>11 8 4 12 -1. + <_>11 8 2 12 2. + 0 + 0.0577015392482281 + 0.5197371840476990 + 1 + <_> + + + + <_>2 1 18 18 -1. + <_>2 10 18 9 2. + 0 + -0.4250329136848450 + 0.0973469167947769 + 0.5185739994049072 + <_> + + <_> + + + + <_>6 3 3 1 -1. + <_>7 3 1 1 3. + 0 + -4.4380719191394746e-004 + 0.3649350106716156 + 1 + <_> + + + + <_>4 12 2 2 -1. + <_>4 13 2 1 2. + 0 + 1.7924769781529903e-004 + 0.5619279146194458 + 0.3760297000408173 + <_> + + <_> + + + + <_>8 13 5 3 -1. + <_>8 14 5 1 3. + 0 + 5.0382469780743122e-003 + 1 + 0.6328445076942444 + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + 0.0151911703869700 + 0.4936082065105438 + 0.7426524758338928 + <_> + + <_> + + + + <_>3 12 5 3 -1. + <_>3 13 5 1 3. + 0 + -0.0123003898188472 + 0.1389349997043610 + 1 + <_> + + + + <_>6 3 3 4 -1. + <_>7 3 1 4 3. + 0 + 1.5168030513450503e-003 + 0.5091962218284607 + 0.3482648134231567 + <_> + + <_> + + + + <_>11 10 2 2 -1. + <_>12 10 1 1 2. + <_>11 11 1 1 2. + 0 + 9.5754547510296106e-004 + 1 + 0.6036316752433777 + <_> + + + + <_>5 8 12 1 -1. + <_>9 8 4 1 3. + 0 + -0.0189622007310390 + 0.2319173067808151 + 0.5116652846336365 + <_> + + <_> + + + + <_>8 4 4 8 -1. + <_>10 4 2 8 2. + 0 + -0.0222722608596087 + 0.6555022001266480 + 1 + <_> + + + + <_>6 6 8 5 -1. + <_>10 6 4 5 2. + 0 + -0.0251452308148146 + 0.1326071023941040 + 0.4674034118652344 + <_> + + <_> + + + + <_>10 4 6 4 -1. + <_>12 4 2 4 3. + 0 + 0.0195339005440474 + 0.5182027220726013 + 1 + <_> + + + + <_>12 7 2 2 -1. + <_>13 7 1 1 2. + <_>12 8 1 1 2. + 0 + -1.1231349781155586e-003 + 0.6318243145942688 + 0.4825519025325775 + <_> + + <_> + + + + <_>3 5 10 8 -1. + <_>3 9 10 4 2. + 0 + -1.4861139934509993e-003 + 0.2918671071529388 + 1 + <_> + + + + <_>7 1 2 12 -1. + <_>7 7 2 6 2. + 0 + 3.5002888762392104e-004 + 0.5621371269226074 + 0.4249213039875031 + <_> + + <_> + + + + <_>12 7 2 2 -1. + <_>13 7 1 1 2. + <_>12 8 1 1 2. + 0 + -1.1231349781155586e-003 + 1 + 0.4813745021820068 + <_> + + + + <_>11 13 1 6 -1. + <_>11 16 1 3 2. + 0 + 0.0104097397997975 + 0.5184006094932556 + 0.2051223069429398 + <_> + + <_> + + + + <_>5 1 6 15 -1. + <_>7 1 2 15 3. + 0 + -0.0878325626254082 + 0.1179921999573708 + 1 + <_> + + + + <_>6 7 2 2 -1. + <_>6 7 1 1 2. + <_>7 8 1 1 2. + 0 + 1.6584879485890269e-003 + 0.4987811148166657 + 0.6973755955696106 + <_> + + <_> + + + + <_>17 5 2 2 -1. + <_>17 6 2 1 2. + 0 + -2.3008750285953283e-003 + 1 + 0.5339831113815308 + <_> + + + + <_>10 3 4 10 -1. + <_>12 3 2 5 2. + <_>10 8 2 5 2. + 0 + 0.0330261699855328 + 0.5033289194107056 + 0.6851906776428223 + <_> + + <_> + + + + <_>1 5 2 2 -1. + <_>1 6 2 1 2. + 0 + -1.3585069682449102e-003 + 0.3002822101116180 + 1 + <_> + + + + <_>7 10 2 2 -1. + <_>7 10 1 1 2. + <_>8 11 1 1 2. + 0 + 7.8067491995170712e-004 + 0.4593083858489990 + 0.6440045237541199 + <_> + + <_> + + + + <_>3 12 14 4 -1. + <_>10 12 7 2 2. + <_>3 14 7 2 2. + 0 + -0.0180257596075535 + 1 + 0.5311291217803955 + <_> + + + + <_>9 15 3 2 -1. + <_>9 16 3 1 2. + 0 + 1.2354910140857100e-003 + 0.4729106128215790 + 0.5721461176872253 + <_> + + <_> + + + + <_>1 13 3 3 -1. + <_>1 14 3 1 3. + 0 + -9.2583027435466647e-004 + 0.3662332892417908 + 1 + <_> + + + + <_>0 3 1 2 -1. + <_>0 4 1 1 2. + 0 + 8.0123997759073973e-004 + 0.5361989736557007 + 0.3008632957935333 + 32.6471290588378910 + 10 + -1 + <_> + + + <_> + + <_> + + + + <_>7 7 6 1 -1. + <_>9 7 2 1 3. + 0 + 2.4914839304983616e-003 + 0.3422389030456543 + 1 + <_> + + + + <_>0 4 16 6 -1. + <_>0 6 16 2 3. + 0 + -0.0504885986447334 + 0.7703458070755005 + 0.4516390860080719 + <_> + + <_> + + + + <_>9 3 2 14 -1. + <_>9 10 2 7 2. + 0 + -7.7838351717218757e-004 + 1 + 0.3256342113018036 + <_> + + + + <_>12 0 4 3 -1. + <_>12 0 2 3 2. + 0 + 2.3572890495415777e-004 + 0.3406555950641632 + 0.5897027254104614 + <_> + + <_> + + + + <_>4 18 12 2 -1. + <_>8 18 4 2 3. + 0 + 4.5575071126222610e-003 + 0.4306578934192658 + 1 + <_> + + + + <_>4 10 12 4 -1. + <_>8 10 4 4 3. + 0 + 8.1241987645626068e-003 + 0.7149587273597717 + 0.4345684945583344 + <_> + + <_> + + + + <_>9 9 2 2 -1. + <_>9 10 2 1 2. + 0 + -4.4612158671952784e-004 + 0.3295974135398865 + 1 + <_> + + + + <_>14 1 2 8 -1. + <_>15 1 1 4 2. + <_>14 5 1 4 2. + 0 + -2.8972938889637589e-004 + 0.5845620036125183 + 0.3526687920093536 + <_> + + <_> + + + + <_>3 4 9 1 -1. + <_>6 4 3 1 3. + 0 + 7.1604831646254752e-006 + 0.4081954956054688 + 1 + <_> + + + + <_>3 3 4 2 -1. + <_>3 4 4 1 2. + 0 + -3.8497708737850189e-004 + 0.4203113019466400 + 0.6634126901626587 + <_> + + <_> + + + + <_>11 15 2 4 -1. + <_>11 17 2 2 2. + 0 + 1.9489860278554261e-004 + 0.3942466974258423 + 1 + <_> + + + + <_>14 13 2 6 -1. + <_>14 15 2 2 3. + 0 + -0.0170838497579098 + 0.2294072061777115 + 0.5238960981369019 + <_> + + <_> + + + + <_>6 6 1 6 -1. + <_>6 9 1 3 2. + 0 + 8.3513697609305382e-004 + 0.3026031851768494 + 1 + <_> + + + + <_>6 10 8 8 -1. + <_>6 14 8 4 2. + 0 + 7.5499608647078276e-004 + 0.6032196283340454 + 0.3412458896636963 + <_> + + <_> + + + + <_>8 13 4 3 -1. + <_>8 14 4 1 3. + 0 + 8.0216713249683380e-003 + 1 + 0.7306240797042847 + <_> + + + + <_>10 11 4 8 -1. + <_>10 15 4 4 2. + 0 + -0.0389305092394352 + 0.3599325120449066 + 0.5234380960464478 + <_> + + <_> + + + + <_>5 11 6 1 -1. + <_>7 11 2 1 3. + 0 + -7.0348767621908337e-005 + 1 + 0.3493758141994476 + <_> + + + + <_>5 4 6 10 -1. + <_>8 4 3 10 2. + 0 + -8.5350573062896729e-003 + 0.2746109068393707 + 0.5626586079597473 + <_> + + <_> + + + + <_>14 2 6 3 -1. + <_>14 3 6 1 3. + 0 + 0.0108544500544667 + 0.5282226204872131 + 1 + <_> + + + + <_>9 12 3 2 -1. + <_>9 13 3 1 2. + 0 + 4.5329501153901219e-004 + 0.4522049129009247 + 0.6054301857948303 + <_> + + <_> + + + + <_>8 1 4 6 -1. + <_>8 3 4 2 3. + 0 + 1.8117150466423482e-004 + 0.3306862115859985 + 1 + <_> + + + + <_>3 5 13 8 -1. + <_>3 9 13 4 2. + 0 + 4.6641560038551688e-004 + 0.1455000042915344 + 0.5384927988052368 + <_> + + <_> + + + + <_>12 5 5 3 -1. + <_>12 6 5 1 3. + 0 + -8.4854792803525925e-003 + 1 + 0.4814155995845795 + <_> + + + + <_>5 14 15 6 -1. + <_>5 16 15 2 3. + 0 + -0.0189343094825745 + 0.3563741147518158 + 0.5405145287513733 + <_> + + <_> + + + + <_>3 5 5 3 -1. + <_>3 6 5 1 3. + 0 + 4.9814549274742603e-003 + 1 + 0.6957743167877197 + <_> + + + + <_>9 14 2 6 -1. + <_>9 14 1 3 2. + <_>10 17 1 3 2. + 0 + 3.4286780282855034e-003 + 0.5050892829895020 + 0.2316994965076447 + <_> + + <_> + + + + <_>9 12 3 2 -1. + <_>9 13 3 1 2. + 0 + 4.4203791185282171e-004 + 1 + 0.6018581986427307 + <_> + + + + <_>9 13 3 2 -1. + <_>9 14 3 1 2. + 0 + 2.3822550429031253e-004 + 0.4755082130432129 + 0.5585237741470337 + <_> + + <_> + + + + <_>0 2 6 3 -1. + <_>0 3 6 1 3. + 0 + -6.4261639490723610e-003 + 0.2282465994358063 + 1 + <_> + + + + <_>0 1 9 11 -1. + <_>3 1 3 11 3. + 0 + 9.9637769162654877e-003 + 0.4040588140487671 + 0.5650169849395752 + <_> + + <_> + + + + <_>8 13 4 6 -1. + <_>10 13 2 3 2. + <_>8 16 2 3 2. + 0 + 0.0136540504172444 + 0.5267739295959473 + 1 + <_> + + + + <_>7 13 6 3 -1. + <_>7 14 6 1 3. + 0 + -9.9892877042293549e-003 + 0.6794049739837647 + 0.4797033965587616 + <_> + + <_> + + + + <_>3 12 14 4 -1. + <_>3 12 7 2 2. + <_>10 14 7 2 2. + 0 + 0.0365586318075657 + 1 + 0.0884257331490517 + <_> + + + + <_>7 14 1 4 -1. + <_>7 16 1 2 2. + 0 + 4.8999379941960797e-005 + 0.4020788073539734 + 0.5457332134246826 + <_> + + <_> + + + + <_>8 13 4 6 -1. + <_>10 13 2 3 2. + <_>8 16 2 3 2. + 0 + 0.0136540504172444 + 0.5267612934112549 + 1 + <_> + + + + <_>10 14 1 3 -1. + <_>10 15 1 1 3. + 0 + 1.8802779959514737e-003 + 0.4806052148342133 + 0.6394364833831787 + <_> + + <_> + + + + <_>8 13 4 6 -1. + <_>8 13 2 3 2. + <_>10 16 2 3 2. + 0 + -0.0136540504172444 + 0.1724810004234314 + 1 + <_> + + + + <_>9 14 1 3 -1. + <_>9 15 1 1 3. + 0 + 1.2778700329363346e-003 + 0.4479824006557465 + 0.6310008764266968 + <_> + + <_> + + + + <_>10 15 2 3 -1. + <_>10 16 2 1 3. + 0 + 9.8843395244330168e-004 + 1 + 0.5948169231414795 + <_> + + + + <_>11 16 1 2 -1. + <_>11 17 1 1 2. + 0 + 1.4511500012304168e-005 + 0.4854174852371216 + 0.5309361219406128 + <_> + + <_> + + + + <_>9 0 2 2 -1. + <_>9 1 2 1 2. + 0 + -2.2775429533794522e-004 + 0.3183631896972656 + 1 + <_> + + + + <_>0 1 5 8 -1. + <_>0 5 5 4 2. + 0 + -0.0147537402808666 + 0.3084976077079773 + 0.5352026224136353 + <_> + + <_> + + + + <_>10 14 2 3 -1. + <_>10 15 2 1 3. + 0 + -3.4148250706493855e-003 + 0.6115326881408691 + 1 + <_> + + + + <_>10 13 2 3 -1. + <_>10 14 2 1 3. + 0 + 7.5806681998074055e-003 + 0.4951646029949188 + 0.7061331272125244 + <_> + + <_> + + + + <_>0 3 16 6 -1. + <_>0 6 16 3 2. + 0 + -5.7734688743948936e-003 + 1 + 0.3754220902919769 + <_> + + + + <_>4 1 2 2 -1. + <_>5 1 1 2 2. + 0 + 7.4033669079653919e-005 + 0.4115517139434815 + 0.5889444947242737 + <_> + + <_> + + + + <_>9 7 2 3 -1. + <_>9 8 2 1 3. + 0 + -8.2278084009885788e-003 + 0.0956105664372444 + 1 + <_> + + + + <_>10 8 2 12 -1. + <_>10 12 2 4 3. + 0 + 5.3380909375846386e-003 + 0.5300508737564087 + 0.3961898088455200 + <_> + + <_> + + + + <_>9 7 2 2 -1. + <_>10 7 1 2 2. + 0 + -2.7049109339714050e-003 + 0.6481869220733643 + 1 + <_> + + + + <_>5 0 6 8 -1. + <_>7 0 2 8 3. + 0 + 7.7341338619589806e-003 + 0.5110440254211426 + 0.3121519088745117 + <_> + + <_> + + + + <_>9 7 3 6 -1. + <_>10 7 1 6 3. + 0 + 0.0108866095542908 + 0.4801428914070129 + 1 + <_> + + + + <_>8 12 10 8 -1. + <_>8 16 10 4 2. + 0 + 0.0110386600717902 + 0.5429710149765015 + 0.4162363111972809 + <_> + + <_> + + + + <_>8 7 3 6 -1. + <_>9 7 1 6 3. + 0 + -0.0100541999563575 + 0.7329335212707520 + 1 + <_> + + + + <_>4 7 12 2 -1. + <_>10 7 6 2 2. + 0 + 7.7072880230844021e-003 + 0.5356872081756592 + 0.3455547094345093 + <_> + + <_> + + + + <_>8 6 8 3 -1. + <_>8 6 4 3 2. + 0 + -5.8278098003938794e-004 + 0.3655022084712982 + 1 + <_> + + + + <_>16 15 3 3 -1. + <_>16 16 3 1 3. + 0 + -2.5739220436662436e-003 + 0.3776760101318359 + 0.5391774773597717 + <_> + + <_> + + + + <_>4 6 12 3 -1. + <_>10 6 6 3 2. + 0 + -7.0167761296033859e-003 + 0.4039304852485657 + 1 + <_> + + + + <_>7 8 3 5 -1. + <_>8 8 1 5 3. + 0 + -1.7727289814502001e-003 + 0.6950443983078003 + 0.4981116950511932 + <_> + + <_> + + + + <_>0 10 20 2 -1. + <_>10 10 10 1 2. + <_>0 11 10 1 2. + 0 + -0.0163182895630598 + 1 + 0.5296732783317566 + <_> + + + + <_>11 16 9 4 -1. + <_>14 16 3 4 3. + 0 + -0.0116630000993609 + 0.5842639803886414 + 0.4789502918720245 + <_> + + <_> + + + + <_>0 5 3 4 -1. + <_>1 5 1 4 3. + 0 + 2.5881489273160696e-003 + 1 + 0.6092178821563721 + <_> + + + + <_>8 15 4 2 -1. + <_>8 15 2 1 2. + <_>10 16 2 1 2. + 0 + -3.7328999023884535e-003 + 0.6721742749214172 + 0.4066894054412842 + <_> + + <_> + + + + <_>1 8 19 3 -1. + <_>1 9 19 1 3. + 0 + -1.4355930034071207e-003 + 0.3585087954998016 + 1 + <_> + + + + <_>15 16 3 3 -1. + <_>15 17 3 1 3. + 0 + 1.8340899841859937e-003 + 0.5371158123016357 + 0.4033507108688355 + <_> + + <_> + + + + <_>0 4 20 10 -1. + <_>0 4 10 5 2. + <_>10 9 10 5 2. + 0 + 0.1228028982877731 + 1 + 0.1547572016716003 + <_> + + + + <_>2 14 7 6 -1. + <_>2 16 7 2 3. + 0 + 0.0502287000417709 + 0.5433843731880188 + 0.0842926725745201 + <_> + + <_> + + + + <_>8 6 6 6 -1. + <_>10 6 2 6 3. + 0 + -0.0214370004832745 + 1 + 0.4860053956508637 + <_> + + + + <_>16 4 4 6 -1. + <_>16 6 4 2 3. + 0 + -0.0310096200555563 + 0.1833010017871857 + 0.5207554101943970 + <_> + + <_> + + + + <_>7 13 6 3 -1. + <_>7 14 6 1 3. + 0 + -0.0129737202078104 + 0.7048240900039673 + 1 + <_> + + + + <_>7 13 4 3 -1. + <_>7 14 4 1 3. + 0 + 1.5818020328879356e-003 + 0.4170587062835693 + 0.5865163803100586 + <_> + + <_> + + + + <_>13 13 6 2 -1. + <_>13 14 6 1 2. + 0 + -9.7806248813867569e-003 + 1 + 0.5307918190956116 + <_> + + + + <_>14 12 2 3 -1. + <_>14 13 2 1 3. + 0 + 1.1735740117728710e-003 + 0.5522453188896179 + 0.3507165014743805 + <_> + + <_> + + + + <_>1 13 6 2 -1. + <_>1 14 6 1 2. + 0 + 1.4651629608124495e-003 + 1 + 0.3042651116847992 + <_> + + + + <_>4 12 2 3 -1. + <_>4 13 2 1 3. + 0 + 2.3532148916274309e-003 + 0.5339323282241821 + 0.2806236147880554 + <_> + + <_> + + + + <_>17 4 3 5 -1. + <_>18 4 1 5 3. + 0 + -6.1809681355953217e-003 + 0.6410133242607117 + 1 + <_> + + + + <_>5 5 14 8 -1. + <_>12 5 7 4 2. + <_>5 9 7 4 2. + 0 + 6.5688649192452431e-004 + 0.5620871186256409 + 0.4390318989753723 + <_> + + <_> + + + + <_>6 8 6 5 -1. + <_>8 8 2 5 3. + 0 + 0.0262280106544495 + 1 + 0.6445556879043579 + <_> + + + + <_>0 4 4 6 -1. + <_>0 6 4 2 3. + 0 + -0.0179581101983786 + 0.2002713978290558 + 0.4624665081501007 + <_> + + <_> + + + + <_>9 1 3 6 -1. + <_>10 1 1 6 3. + 0 + -7.6468721963465214e-003 + 1 + 0.5263200998306274 + <_> + + + + <_>10 4 6 3 -1. + <_>10 5 6 1 3. + 0 + -2.7482809964567423e-003 + 0.5873981118202210 + 0.4836600124835968 + <_> + + <_> + + + + <_>8 1 3 6 -1. + <_>9 1 1 6 3. + 0 + 0.0138518502935767 + 1 + 0.1566130965948105 + <_> + + + + <_>4 4 6 3 -1. + <_>4 5 6 1 3. + 0 + 2.6369190309196711e-003 + 0.4270178973674774 + 0.5806660056114197 + <_> + + <_> + + + + <_>12 4 3 3 -1. + <_>12 5 3 1 3. + 0 + -3.1513599678874016e-003 + 0.6215866208076477 + 1 + <_> + + + + <_>12 11 4 2 -1. + <_>12 12 4 1 2. + 0 + -1.4788460248382762e-005 + 0.5576642751693726 + 0.4122002124786377 + <_> + + <_> + + + + <_>0 2 20 6 -1. + <_>0 2 10 3 2. + <_>10 5 10 3 2. + 0 + -0.0736769884824753 + 0.1536709964275360 + 1 + <_> + + + + <_>5 4 3 3 -1. + <_>5 5 3 1 3. + 0 + -3.0912780202925205e-003 + 0.6344268918037415 + 0.4507412016391754 + <_> + + <_> + + + + <_>2 10 16 4 -1. + <_>10 10 8 2 2. + <_>2 12 8 2 2. + 0 + 7.9240966588258743e-003 + 0.5457975268363953 + 1 + <_> + + + + <_>3 10 16 6 -1. + <_>11 10 8 3 2. + <_>3 13 8 3 2. + 0 + 8.5778040811419487e-003 + 0.5401657223701477 + 0.3890799880027771 + <_> + + <_> + + + + <_>1 10 16 6 -1. + <_>1 10 8 3 2. + <_>9 13 8 3 2. + 0 + 5.5403169244527817e-003 + 1 + 0.3555611073970795 + <_> + + + + <_>4 7 2 4 -1. + <_>5 7 1 4 2. + 0 + -1.1886510037584230e-004 + 0.5836750268936157 + 0.4274316132068634 + <_> + + <_> + + + + <_>11 16 9 4 -1. + <_>14 16 3 4 3. + 0 + -0.0184083692729473 + 0.5860440135002136 + 1 + <_> + + + + <_>3 16 14 4 -1. + <_>10 16 7 2 2. + <_>3 18 7 2 2. + 0 + -2.3490579333156347e-003 + 0.4498957991600037 + 0.5498198866844177 + <_> + + <_> + + + + <_>0 16 9 4 -1. + <_>3 16 3 4 3. + 0 + -7.6157399453222752e-003 + 1 + 0.4100992977619171 + <_> + + + + <_>1 14 6 6 -1. + <_>1 14 3 3 2. + <_>4 17 3 3 2. + 0 + -3.3190969843417406e-003 + 0.6701378822326660 + 0.4353001117706299 + <_> + + <_> + + + + <_>9 0 2 1 -1. + <_>9 0 1 1 2. + 0 + -9.4642979092895985e-004 + 1 + 0.5391176939010620 + <_> + + + + <_>6 7 8 10 -1. + <_>10 7 4 5 2. + <_>6 12 4 5 2. + 0 + 8.7858550250530243e-003 + 0.5504050254821777 + 0.3990935087203980 + <_> + + <_> + + + + <_>2 15 1 2 -1. + <_>2 16 1 1 2. + 0 + 1.6395459533669055e-004 + 1 + 0.3592933118343353 + <_> + + + + <_>0 14 7 6 -1. + <_>0 16 7 2 3. + 0 + -2.3508940357714891e-003 + 0.4034172892570496 + 0.5806077122688294 + <_> + + <_> + + + + <_>7 8 6 2 -1. + <_>7 9 6 1 2. + 0 + 7.5449963333085179e-005 + 1 + 0.5412384867668152 + <_> + + + + <_>9 2 2 15 -1. + <_>9 7 2 5 3. + 0 + 0.0270184893161058 + 0.4944922924041748 + 0.5589436292648315 + <_> + + <_> + + + + <_>5 6 2 2 -1. + <_>5 7 2 1 2. + 0 + 8.4561208495870233e-004 + 1 + 0.5809218287467957 + <_> + + + + <_>6 6 8 3 -1. + <_>6 7 8 1 3. + 0 + -1.1687109945341945e-003 + 0.4746957123279572 + 0.2845895886421204 + <_> + + <_> + + + + <_>12 13 5 6 -1. + <_>12 15 5 2 3. + 0 + 0.0228975005447865 + 1 + 0.2414411008358002 + <_> + + + + <_>0 0 20 18 -1. + <_>0 9 20 9 2. + 0 + 0.7087926268577576 + 0.5195764899253845 + 0.1030092015862465 + <_> + + <_> + + + + <_>5 1 6 6 -1. + <_>7 1 2 6 3. + 0 + 0.0374838300049305 + 1 + 0.1814638972282410 + <_> + + + + <_>5 1 4 9 -1. + <_>7 1 2 9 2. + 0 + 1.2827500468119979e-003 + 0.4246071875095367 + 0.5707973241806030 + <_> + + <_> + + + + <_>1 19 18 1 -1. + <_>7 19 6 1 3. + 0 + -5.1718312315642834e-003 + 0.6143323183059692 + 1 + <_> + + + + <_>14 16 5 2 -1. + <_>14 17 5 1 2. + 0 + 2.7545939665287733e-003 + 0.5205671191215515 + 0.4220441877841950 + <_> + + <_> + + + + <_>0 5 15 10 -1. + <_>0 10 15 5 2. + 0 + -3.6072919610887766e-003 + 0.3182592093944550 + 1 + <_> + + + + <_>7 15 4 2 -1. + <_>7 15 2 1 2. + <_>9 16 2 1 2. + 0 + -2.5258748792111874e-004 + 0.5710468292236328 + 0.4226093888282776 + <_> + + <_> + + + + <_>14 11 2 2 -1. + <_>14 12 2 1 2. + 0 + -7.0514748804271221e-003 + 1 + 0.5162829756736755 + <_> + + + + <_>9 8 3 3 -1. + <_>9 9 3 1 3. + 0 + -5.4323761723935604e-003 + 0.2666288912296295 + 0.5214679837226868 + <_> + + <_> + + + + <_>4 11 2 2 -1. + <_>4 12 2 1 2. + 0 + -1.4652940080850385e-005 + 1 + 0.3981761038303375 + <_> + + + + <_>8 8 3 3 -1. + <_>8 9 3 1 3. + 0 + -1.8556920113041997e-003 + 0.3322763144969940 + 0.5705834031105042 + <_> + + <_> + + + + <_>9 10 2 3 -1. + <_>9 11 2 1 3. + 0 + 4.7609540633857250e-003 + 1 + 0.6636558175086975 + <_> + + + + <_>8 8 4 3 -1. + <_>8 9 4 1 3. + 0 + 1.5676260227337480e-003 + 0.5505567789077759 + 0.4420661926269531 + <_> + + <_> + + + + <_>1 9 4 10 -1. + <_>1 9 2 5 2. + <_>3 14 2 5 2. + 0 + 5.4239919409155846e-003 + 1 + 0.5959938168525696 + <_> + + + + <_>0 12 6 8 -1. + <_>2 12 2 8 3. + 0 + -6.4692399464547634e-003 + 0.5369594097137451 + 0.3744339942932129 + <_> + + <_> + + + + <_>9 1 4 2 -1. + <_>11 1 2 1 2. + <_>9 2 2 1 2. + 0 + -7.8038539504632354e-004 + 0.4103595018386841 + 1 + <_> + + + + <_>12 13 7 6 -1. + <_>12 15 7 2 3. + 0 + 0.0450864508748055 + 0.5177506804466248 + 0.1878100037574768 + <_> + + <_> + + + + <_>7 0 2 3 -1. + <_>7 1 2 1 3. + 0 + -5.1405387930572033e-003 + 0.2352892011404038 + 1 + <_> + + + + <_>7 14 6 3 -1. + <_>9 14 2 3 3. + 0 + -0.0212361291050911 + 0.1708751022815704 + 0.5424973964691162 + <_> + + <_> + + + + <_>9 6 6 4 -1. + <_>11 6 2 4 3. + 0 + -2.3763340432196856e-003 + 0.5836530923843384 + 1 + <_> + + + + <_>8 10 8 3 -1. + <_>8 10 4 3 2. + 0 + 0.0541225895285606 + 0.5117433071136475 + 0.1865931004285812 + <_> + + <_> + + + + <_>6 10 4 3 -1. + <_>8 10 2 3 2. + 0 + -5.3492980077862740e-004 + 0.5108693242073059 + 1 + <_> + + + + <_>6 8 3 5 -1. + <_>7 8 1 5 3. + 0 + -5.8454048121348023e-004 + 0.4775491058826447 + 0.2439853996038437 + 30.6721305847167970 + 11 + -1 + <_> + + + <_> + + <_> + + + + <_>0 4 8 1 -1. + <_>4 4 4 1 2. + 0 + 3.0031939968466759e-003 + 0.3349649906158447 + 1 + <_> + + + + <_>8 2 2 6 -1. + <_>8 2 1 3 2. + <_>9 5 1 3 2. + 0 + 6.9161207647994161e-004 + 0.4518367946147919 + 0.7289354205131531 + <_> + + <_> + + + + <_>0 7 20 6 -1. + <_>0 9 20 2 3. + 0 + 0.0112127903848886 + 0.2950800955295563 + 1 + <_> + + + + <_>12 10 3 6 -1. + <_>12 13 3 3 2. + 0 + -7.6108198845759034e-004 + 0.5669054985046387 + 0.2830851078033447 + <_> + + <_> + + + + <_>8 15 1 4 -1. + <_>8 17 1 2 2. + 0 + 1.1984579759882763e-004 + 0.4090577960014343 + 1 + <_> + + + + <_>5 16 2 4 -1. + <_>5 18 2 2 2. + 0 + -1.9725349557120353e-004 + 0.6951494216918945 + 0.4637868106365204 + <_> + + <_> + + + + <_>6 2 8 12 -1. + <_>6 6 8 4 3. + 0 + -5.5180420167744160e-003 + 1 + 0.3167675137519836 + <_> + + + + <_>4 7 12 2 -1. + <_>8 7 4 2 3. + 0 + 1.2148249661549926e-003 + 0.3316706120967865 + 0.5396397709846497 + <_> + + <_> + + + + <_>7 0 6 1 -1. + <_>9 0 2 1 3. + 0 + -4.2497441172599792e-003 + 0.2600573897361755 + 1 + <_> + + + + <_>8 11 3 3 -1. + <_>8 12 3 1 3. + 0 + -9.4915721565485001e-003 + 0.7484294772148132 + 0.5073192119598389 + <_> + + <_> + + + + <_>12 11 3 6 -1. + <_>12 14 3 3 2. + 0 + 6.5378600265830755e-004 + 1 + 0.3952010869979858 + <_> + + + + <_>11 2 6 10 -1. + <_>14 2 3 5 2. + <_>11 7 3 5 2. + 0 + -4.9741100519895554e-004 + 0.5880274772644043 + 0.3552120029926300 + <_> + + <_> + + + + <_>5 7 10 12 -1. + <_>5 7 5 6 2. + <_>10 13 5 6 2. + 0 + -0.0430792495608330 + 0.2434878051280975 + 1 + <_> + + + + <_>4 4 2 10 -1. + <_>4 9 2 5 2. + 0 + -5.1999092102050781e-004 + 0.3195562958717346 + 0.5585454702377319 + <_> + + <_> + + + + <_>9 7 2 3 -1. + <_>9 7 1 3 2. + 0 + -4.5451628975570202e-003 + 1 + 0.4845289885997772 + <_> + + + + <_>11 9 6 2 -1. + <_>11 9 3 2 2. + 0 + -7.9610403627157211e-003 + 0.3801181018352509 + 0.5358511805534363 + <_> + + <_> + + + + <_>4 7 2 2 -1. + <_>5 7 1 2 2. + 0 + -3.1919340835884213e-004 + 1 + 0.4356329143047333 + <_> + + + + <_>0 2 4 6 -1. + <_>0 4 4 2 3. + 0 + -0.0192238893359900 + 0.2613066136837006 + 0.6155496239662170 + <_> + + <_> + + + + <_>10 7 3 4 -1. + <_>11 7 1 4 3. + 0 + -1.3076990144327283e-003 + 0.5942062139511108 + 1 + <_> + + + + <_>9 7 3 5 -1. + <_>10 7 1 5 3. + 0 + 0.0198250394314528 + 0.4945428073406220 + 0.7384855151176453 + <_> + + <_> + + + + <_>9 1 1 3 -1. + <_>9 2 1 1 3. + 0 + -2.2013280540704727e-003 + 0.2214481979608536 + 1 + <_> + + + + <_>0 6 16 6 -1. + <_>0 6 8 3 2. + <_>8 9 8 3 2. + 0 + -7.8596705570816994e-003 + 0.3600977063179016 + 0.5298550128936768 + <_> + + <_> + + + + <_>10 15 3 3 -1. + <_>10 16 3 1 3. + 0 + 1.4142199652269483e-003 + 1 + 0.5776566267013550 + <_> + + + + <_>9 14 4 3 -1. + <_>9 15 4 1 3. + 0 + -0.0112327598035336 + 0.6934456825256348 + 0.4827207028865814 + <_> + + <_> + + + + <_>3 2 6 10 -1. + <_>3 2 3 5 2. + <_>6 7 3 5 2. + 0 + 2.9746301006525755e-003 + 1 + 0.3216677010059357 + <_> + + + + <_>3 0 14 2 -1. + <_>3 1 14 1 2. + 0 + 5.3283828310668468e-004 + 0.3962500095367432 + 0.5680363774299622 + <_> + + <_> + + + + <_>9 14 3 3 -1. + <_>9 15 3 1 3. + 0 + 0.0101052597165108 + 1 + 0.7567418217658997 + <_> + + + + <_>10 15 3 3 -1. + <_>10 16 3 1 3. + 0 + -0.0116536999121308 + 0.6523556709289551 + 0.5027053952217102 + <_> + + <_> + + + + <_>9 13 2 6 -1. + <_>9 16 2 3 2. + 0 + -7.0609981194138527e-003 + 0.2538770139217377 + 1 + <_> + + + + <_>7 13 6 3 -1. + <_>7 14 6 1 3. + 0 + 2.2343141026794910e-003 + 0.4387277066707611 + 0.6177632212638855 + <_> + + <_> + + + + <_>12 11 3 6 -1. + <_>12 14 3 3 2. + 0 + -0.0298022795468569 + 1 + 0.5201140046119690 + <_> + + + + <_>8 12 5 2 -1. + <_>8 13 5 1 2. + 0 + 1.1611840454861522e-003 + 0.4647909998893738 + 0.6184254884719849 + <_> + + <_> + + + + <_>5 11 3 6 -1. + <_>5 14 3 3 2. + 0 + 9.4824447296559811e-004 + 1 + 0.3040994107723236 + <_> + + + + <_>8 12 3 2 -1. + <_>8 13 3 1 2. + 0 + 4.1284630424343050e-004 + 0.4518808126449585 + 0.6245782971382141 + <_> + + <_> + + + + <_>11 13 7 6 -1. + <_>11 15 7 2 3. + 0 + -0.0312035400420427 + 0.2788935899734497 + 1 + <_> + + + + <_>7 14 6 3 -1. + <_>7 15 6 1 3. + 0 + 2.7652881108224392e-003 + 0.4698500037193298 + 0.6502454280853272 + <_> + + <_> + + + + <_>3 13 14 4 -1. + <_>3 13 7 2 2. + <_>10 15 7 2 2. + 0 + 0.0256447792053223 + 1 + 0.1805171072483063 + <_> + + + + <_>8 14 4 6 -1. + <_>8 14 2 3 2. + <_>10 17 2 3 2. + 0 + -7.5331530533730984e-003 + 0.3208068907260895 + 0.5522022843360901 + <_> + + <_> + + + + <_>8 15 4 3 -1. + <_>8 16 4 1 3. + 0 + 3.2047149725258350e-003 + 1 + 0.6436933875083923 + <_> + + + + <_>7 16 6 2 -1. + <_>9 16 2 2 3. + 0 + -2.4282479716930538e-004 + 0.5676705241203308 + 0.4509103894233704 + <_> + + <_> + + + + <_>7 7 6 2 -1. + <_>7 8 6 1 2. + 0 + -6.1979342717677355e-004 + 0.3122146129608154 + 1 + <_> + + + + <_>3 9 13 3 -1. + <_>3 10 13 1 3. + 0 + -8.0101029016077518e-004 + 0.2965193986892700 + 0.5230494737625122 + <_> + + <_> + + + + <_>9 8 3 4 -1. + <_>9 10 3 2 2. + 0 + -9.1816839994862676e-004 + 1 + 0.5464711785316467 + <_> + + + + <_>8 10 4 3 -1. + <_>8 11 4 1 3. + 0 + 1.2239529751241207e-003 + 0.4618502855300903 + 0.5679548978805542 + <_> + + <_> + + + + <_>7 7 3 4 -1. + <_>8 7 1 4 3. + 0 + -6.8743730662390590e-004 + 0.5430880188941956 + 1 + <_> + + + + <_>8 7 3 5 -1. + <_>9 7 1 5 3. + 0 + -1.8252469599246979e-003 + 0.5433623194694519 + 0.3385221064090729 + <_> + + <_> + + + + <_>12 3 3 4 -1. + <_>13 3 1 4 3. + 0 + -7.4570789001882076e-003 + 1 + 0.5265594720840454 + <_> + + + + <_>9 7 2 3 -1. + <_>9 7 1 3 2. + 0 + 5.3775748237967491e-003 + 0.4857215881347656 + 0.6815124154090881 + <_> + + <_> + + + + <_>5 3 3 4 -1. + <_>6 3 1 4 3. + 0 + 3.7602309603244066e-003 + 1 + 0.2832160890102387 + <_> + + + + <_>3 7 12 1 -1. + <_>7 7 4 1 3. + 0 + 8.7752222316339612e-004 + 0.3966830968856812 + 0.5512480735778809 + <_> + + <_> + + + + <_>12 5 3 3 -1. + <_>12 6 3 1 3. + 0 + 5.5084479972720146e-003 + 1 + 0.6784620285034180 + <_> + + + + <_>11 2 6 2 -1. + <_>11 3 6 1 2. + 0 + -7.5949047459289432e-004 + 0.3906503021717072 + 0.5457202792167664 + <_> + + <_> + + + + <_>3 2 14 2 -1. + <_>3 2 7 1 2. + <_>10 3 7 1 2. + 0 + 1.6352660022675991e-003 + 1 + 0.3640204071998596 + <_> + + + + <_>6 1 7 14 -1. + <_>6 8 7 7 2. + 0 + -1.2750849418807775e-004 + 0.5829724073410034 + 0.4194979965686798 + <_> + + <_> + + + + <_>8 0 12 5 -1. + <_>8 0 6 5 2. + 0 + 0.0220676101744175 + 0.4606702923774719 + 1 + <_> + + + + <_>1 9 18 1 -1. + <_>7 9 6 1 3. + 0 + -0.0192037895321846 + 0.3261483013629913 + 0.5236080884933472 + <_> + + <_> + + + + <_>0 0 10 5 -1. + <_>5 0 5 5 2. + 0 + -0.0129981096833944 + 0.7022112011909485 + 1 + <_> + + + + <_>2 5 8 15 -1. + <_>2 10 8 5 3. + 0 + -3.1332690268754959e-003 + 0.2870470881462097 + 0.5076476931571960 + <_> + + <_> + + + + <_>12 5 3 3 -1. + <_>12 6 3 1 3. + 0 + -5.2937557920813560e-003 + 1 + 0.4709520936012268 + <_> + + + + <_>13 4 2 3 -1. + <_>13 5 2 1 3. + 0 + 2.1857069805264473e-003 + 0.4708291888237000 + 0.6169841885566711 + <_> + + <_> + + + + <_>2 15 4 3 -1. + <_>2 16 4 1 3. + 0 + -4.5750709250569344e-003 + 0.3114252984523773 + 1 + <_> + + + + <_>5 6 10 3 -1. + <_>10 6 5 3 2. + 0 + -0.0451521389186382 + 0.1851435005664825 + 0.5504814982414246 + <_> + + <_> + + + + <_>11 6 2 2 -1. + <_>12 6 1 1 2. + <_>11 7 1 1 2. + 0 + -2.7783559635281563e-003 + 1 + 0.4937348067760468 + <_> + + + + <_>12 4 4 3 -1. + <_>12 5 4 1 3. + 0 + -2.5752480141818523e-003 + 0.6152948141098023 + 0.4735499918460846 + <_> + + <_> + + + + <_>7 6 2 2 -1. + <_>7 6 1 1 2. + <_>8 7 1 1 2. + 0 + 1.1614130344241858e-003 + 1 + 0.6510571837425232 + <_> + + + + <_>4 4 4 3 -1. + <_>4 5 4 1 3. + 0 + 2.3350189439952374e-003 + 0.4088341891765595 + 0.5684152245521545 + <_> + + <_> + + + + <_>11 4 3 3 -1. + <_>12 4 1 3 3. + 0 + 3.8499289657920599e-003 + 1 + 0.3025828897953033 + <_> + + + + <_>9 3 2 1 -1. + <_>9 3 1 1 2. + 0 + 2.4529630318284035e-003 + 0.5232502818107605 + 0.2017620950937271 + <_> + + <_> + + + + <_>4 5 5 3 -1. + <_>4 6 5 1 3. + 0 + 3.6731390282511711e-003 + 1 + 0.6428425908088684 + <_> + + + + <_>4 6 4 3 -1. + <_>4 7 4 1 3. + 0 + 2.1937100682407618e-003 + 0.4328865110874176 + 0.6420509815216065 + <_> + + <_> + + + + <_>11 4 3 3 -1. + <_>12 4 1 3 3. + 0 + -6.4666871912777424e-003 + 1 + 0.5254065990447998 + <_> + + + + <_>8 8 4 3 -1. + <_>8 9 4 1 3. + 0 + -5.7186251506209373e-003 + 0.2490984052419663 + 0.5287619233131409 + <_> + + <_> + + + + <_>6 4 3 3 -1. + <_>7 4 1 3 3. + 0 + 9.9941878579556942e-004 + 1 + 0.3329795897006989 + <_> + + + + <_>4 14 1 3 -1. + <_>4 15 1 1 3. + 0 + -7.8276498243212700e-004 + 0.3598344922065735 + 0.5498340725898743 + <_> + + <_> + + + + <_>9 7 2 3 -1. + <_>9 7 1 3 2. + 0 + 4.3231188319623470e-003 + 0.4818705022335053 + 1 + <_> + + + + <_>17 0 3 2 -1. + <_>17 1 3 1 2. + 0 + 4.0838290005922318e-003 + 0.5266330242156982 + 0.3105789124965668 + <_> + + <_> + + + + <_>8 10 2 9 -1. + <_>8 13 2 3 3. + 0 + 3.0515898833982646e-004 + 1 + 0.3995291888713837 + <_> + + + + <_>0 8 18 2 -1. + <_>0 9 18 1 2. + 0 + 1.2640280183404684e-003 + 0.3228437900543213 + 0.5819215178489685 + <_> + + <_> + + + + <_>9 15 2 3 -1. + <_>9 16 2 1 3. + 0 + -0.0101526603102684 + 0.8026071190834045 + 1 + <_> + + + + <_>8 7 4 3 -1. + <_>8 8 4 1 3. + 0 + -2.6863690000027418e-003 + 0.3875617086887360 + 0.5466570854187012 + <_> + + <_> + + + + <_>1 14 6 6 -1. + <_>1 14 3 3 2. + <_>4 17 3 3 2. + 0 + -9.0515613555908203e-003 + 1 + 0.4372057914733887 + <_> + + + + <_>0 18 6 2 -1. + <_>0 19 6 1 2. + 0 + -6.3204211182892323e-003 + 0.1126551032066345 + 0.6395416259765625 + <_> + + <_> + + + + <_>12 9 4 3 -1. + <_>12 9 2 3 2. + 0 + 2.6117300149053335e-003 + 0.5423989295959473 + 1 + <_> + + + + <_>9 8 3 8 -1. + <_>10 8 1 8 3. + 0 + 0.0143390195444226 + 0.4979273080825806 + 0.6042236089706421 + <_> + + <_> + + + + <_>4 9 4 3 -1. + <_>6 9 2 3 2. + 0 + 2.8452780097723007e-003 + 1 + 0.3491092026233673 + <_> + + + + <_>4 18 6 1 -1. + <_>6 18 2 1 3. + 0 + 1.4783289771003183e-005 + 0.4195067882537842 + 0.5775966048240662 + <_> + + <_> + + + + <_>9 7 3 2 -1. + <_>10 7 1 2 3. + 0 + 8.1814555451273918e-003 + 0.4885987043380737 + 1 + <_> + + + + <_>6 7 8 12 -1. + <_>10 7 4 6 2. + <_>6 13 4 6 2. + 0 + 6.6321990452706814e-003 + 0.5444468259811401 + 0.4420995116233826 + <_> + + <_> + + + + <_>8 7 3 2 -1. + <_>9 7 1 2 3. + 0 + -2.2483461070805788e-003 + 0.6699792146682739 + 1 + <_> + + + + <_>8 7 3 6 -1. + <_>9 7 1 6 3. + 0 + 0.0123745603486896 + 0.4478605985641480 + 0.6564893722534180 + <_> + + <_> + + + + <_>3 16 14 4 -1. + <_>10 16 7 2 2. + <_>3 18 7 2 2. + 0 + -6.6516688093543053e-003 + 1 + 0.5511878728866577 + <_> + + + + <_>1 14 18 4 -1. + <_>10 14 9 2 2. + <_>1 16 9 2 2. + 0 + -8.5750613361597061e-003 + 0.4017445147037506 + 0.5405536293983460 + <_> + + <_> + + + + <_>8 7 3 3 -1. + <_>8 8 3 1 3. + 0 + 6.5078441984951496e-003 + 1 + 0.2294393032789230 + <_> + + + + <_>0 4 20 12 -1. + <_>0 4 10 6 2. + <_>10 10 10 6 2. + 0 + 0.0286752097308636 + 0.5177900195121765 + 0.3567756116390228 + <_> + + <_> + + + + <_>5 5 10 12 -1. + <_>10 5 5 6 2. + <_>5 11 5 6 2. + 0 + 7.0673860609531403e-003 + 0.5564699769020081 + 1 + <_> + + + + <_>10 2 4 7 -1. + <_>10 2 2 7 2. + 0 + 1.2367829913273454e-003 + 0.3627698123455048 + 0.5572413802146912 + <_> + + <_> + + + + <_>8 11 4 3 -1. + <_>8 12 4 1 3. + 0 + 7.4818679131567478e-003 + 1 + 0.6784911155700684 + <_> + + + + <_>8 12 3 3 -1. + <_>8 13 3 1 3. + 0 + 4.7109839506447315e-003 + 0.4121252894401550 + 0.6072235703468323 + <_> + + <_> + + + + <_>13 13 5 6 -1. + <_>13 15 5 2 3. + 0 + -6.9405790418386459e-003 + 1 + 0.5459766983985901 + <_> + + + + <_>7 0 6 6 -1. + <_>9 0 2 6 3. + 0 + 0.0333020985126495 + 0.5276706814765930 + 0.2374915927648544 + <_> + + <_> + + + + <_>2 13 5 6 -1. + <_>2 15 5 2 3. + 0 + 0.0361046306788921 + 1 + 0.0724927932024002 + <_> + + + + <_>0 4 2 12 -1. + <_>0 4 1 6 2. + <_>1 10 1 6 2. + 0 + 0.0196746494621038 + 0.4626345932483673 + 0.8208963274955750 + <_> + + <_> + + + + <_>9 19 3 1 -1. + <_>10 19 1 1 3. + 0 + 3.4766150638461113e-003 + 0.5208731889724731 + 1 + <_> + + + + <_>18 0 2 6 -1. + <_>18 2 2 2 3. + 0 + 1.3987369602546096e-003 + 0.5484414100646973 + 0.4230034947395325 + <_> + + <_> + + + + <_>0 3 1 6 -1. + <_>0 5 1 2 3. + 0 + 4.0974249131977558e-003 + 1 + 0.2780553102493286 + <_> + + + + <_>0 0 3 6 -1. + <_>0 2 3 2 3. + 0 + 2.6973790954798460e-003 + 0.5403831005096436 + 0.3790988922119141 + <_> + + <_> + + + + <_>17 2 3 7 -1. + <_>18 2 1 7 3. + 0 + -5.6591699831187725e-003 + 1 + 0.4798336029052734 + <_> + + + + <_>10 3 4 7 -1. + <_>10 3 2 7 2. + 0 + 3.9460969856008887e-004 + 0.3766950070858002 + 0.5429229140281677 + <_> + + <_> + + + + <_>0 2 3 7 -1. + <_>1 2 1 7 3. + 0 + 2.1750570740550756e-003 + 1 + 0.6207162737846375 + <_> + + + + <_>6 2 4 8 -1. + <_>8 2 2 8 2. + 0 + 1.4614439569413662e-003 + 0.3357945084571838 + 0.5142632126808167 + <_> + + <_> + + + + <_>13 0 1 4 -1. + <_>13 2 1 2 2. + 0 + -5.3006567759439349e-004 + 1 + 0.5344640016555786 + <_> + + + + <_>5 1 12 5 -1. + <_>9 1 4 5 3. + 0 + 0.1486930996179581 + 0.5159608125686646 + 0.2561823129653931 + <_> + + <_> + + + + <_>6 0 1 4 -1. + <_>6 2 1 2 2. + 0 + -5.8816498494707048e-005 + 1 + 0.5123091936111450 + <_> + + + + <_>3 1 12 5 -1. + <_>7 1 4 5 3. + 0 + -1.6275369562208652e-003 + 0.6017646193504334 + 0.3109371960163117 + <_> + + <_> + + + + <_>9 12 3 8 -1. + <_>10 12 1 8 3. + 0 + -0.0128818098455668 + 0.2712287008762360 + 1 + <_> + + + + <_>7 13 6 1 -1. + <_>9 13 2 1 3. + 0 + 9.4982917653396726e-004 + 0.5442442297935486 + 0.4028888046741486 + <_> + + <_> + + + + <_>7 14 6 3 -1. + <_>7 15 6 1 3. + 0 + -0.0123159997165203 + 1 + 0.4736065864562988 + <_> + + + + <_>5 16 7 3 -1. + <_>5 17 7 1 3. + 0 + 9.0286601334810257e-003 + 0.7451434731483460 + 0.3487991988658905 + <_> + + <_> + + + + <_>0 12 20 6 -1. + <_>0 14 20 2 3. + 0 + -0.0868761166930199 + 0.2290333062410355 + 1 + <_> + + + + <_>4 18 14 2 -1. + <_>4 19 14 1 2. + 0 + -1.5107560102478601e-005 + 0.5517889857292175 + 0.4393149018287659 + <_> + + <_> + + + + <_>8 12 3 8 -1. + <_>9 12 1 8 3. + 0 + -0.0174576602876186 + 0.0901679024100304 + 1 + <_> + + + + <_>7 13 3 3 -1. + <_>7 14 3 1 3. + 0 + -2.5219470262527466e-003 + 0.6233540177345276 + 0.4789459109306335 + <_> + + <_> + + + + <_>5 5 12 10 -1. + <_>11 5 6 5 2. + <_>5 10 6 5 2. + 0 + 1.0656520025804639e-003 + 0.5489696264266968 + 1 + <_> + + + + <_>8 1 5 10 -1. + <_>8 6 5 5 2. + 0 + -4.2540300637483597e-003 + 0.5579808950424194 + 0.4375877976417542 + <_> + + <_> + + + + <_>5 4 9 12 -1. + <_>5 10 9 6 2. + 0 + -9.0349102392792702e-003 + 0.3579156100749970 + 1 + <_> + + + + <_>7 13 6 6 -1. + <_>7 15 6 2 3. + 0 + -1.5230999561026692e-003 + 0.5613660216331482 + 0.3939043879508972 + <_> + + <_> + + + + <_>8 4 5 16 -1. + <_>8 12 5 8 2. + 0 + 2.8441150207072496e-003 + 1 + 0.3901554942131043 + <_> + + + + <_>8 12 4 6 -1. + <_>8 15 4 3 2. + 0 + -3.2824429217725992e-003 + 0.4528619050979614 + 0.5441343188285828 + <_> + + <_> + + + + <_>7 13 2 2 -1. + <_>7 13 1 1 2. + <_>8 14 1 1 2. + 0 + 3.2161718991119415e-005 + 1 + 0.5803111791610718 + <_> + + + + <_>7 12 2 2 -1. + <_>7 12 1 1 2. + <_>8 13 1 1 2. + 0 + 3.0118400900391862e-005 + 0.3336850106716156 + 0.5504856109619141 + <_> + + <_> + + + + <_>18 0 2 14 -1. + <_>18 0 1 14 2. + 0 + -5.6150099262595177e-003 + 0.6124789118766785 + 1 + <_> + + + + <_>12 11 7 2 -1. + <_>12 12 7 1 2. + 0 + -0.0173892099410295 + 0.0872716307640076 + 0.5204588174819946 + <_> + + <_> + + + + <_>1 18 1 2 -1. + <_>1 19 1 1 2. + 0 + -4.4361080654198304e-005 + 0.3935329020023346 + 1 + <_> + + + + <_>2 18 1 2 -1. + <_>2 19 1 1 2. + 0 + 1.0354899859521538e-004 + 0.5918853878974915 + 0.4119614064693451 + <_> + + <_> + + + + <_>9 7 2 1 -1. + <_>9 7 1 1 2. + 0 + 1.5939630102366209e-003 + 0.4839623868465424 + 1 + <_> + + + + <_>9 6 2 3 -1. + <_>9 6 1 3 2. + 0 + 2.5440789759159088e-003 + 0.4787364900112152 + 0.6360663175582886 + <_> + + <_> + + + + <_>3 1 2 2 -1. + <_>4 1 1 2 2. + 0 + 1.5083180187502876e-005 + 0.4231117069721222 + 1 + <_> + + + + <_>3 0 3 2 -1. + <_>3 1 3 1 2. + 0 + -9.9282202427275479e-005 + 0.4274589121341705 + 0.6094048023223877 + <_> + + <_> + + + + <_>12 10 3 4 -1. + <_>12 12 3 2 2. + 0 + 5.5371708003804088e-004 + 1 + 0.4271987974643707 + <_> + + + + <_>7 7 8 2 -1. + <_>7 8 8 1 2. + 0 + 1.9186759600415826e-003 + 0.4497107863426209 + 0.5549122095108032 + <_> + + <_> + + + + <_>8 8 3 4 -1. + <_>8 10 3 2 2. + 0 + -5.0764222396537662e-004 + 1 + 0.5477195978164673 + <_> + + + + <_>7 12 6 3 -1. + <_>7 13 6 1 3. + 0 + 1.7236480489373207e-003 + 0.2882922887802124 + 0.5615127086639404 + 34.6770782470703120 + 12 + -1 + <_> + + + <_> + + <_> + + + + <_>0 2 10 3 -1. + <_>5 2 5 3 2. + 0 + 0.0130921695381403 + 0.3338870108127594 + 1 + <_> + + + + <_>0 1 20 6 -1. + <_>0 3 20 2 3. + 0 + 4.1446479735895991e-004 + 0.3099352121353149 + 0.6677492260932922 + <_> + + <_> + + + + <_>7 6 6 3 -1. + <_>9 6 2 3 3. + 0 + 0.0218357294797897 + 0.4369049072265625 + 1 + <_> + + + + <_>3 7 14 4 -1. + <_>3 9 14 2 2. + 0 + 0.0483239404857159 + 0.4301724135875702 + 0.6153885126113892 + <_> + + <_> + + + + <_>5 7 3 6 -1. + <_>5 9 3 2 3. + 0 + 1.6091950237751007e-003 + 0.3387326002120972 + 1 + <_> + + + + <_>8 8 3 12 -1. + <_>8 12 3 4 3. + 0 + 1.3469760306179523e-003 + 0.6248713731765747 + 0.3594130873680115 + <_> + + <_> + + + + <_>9 17 6 2 -1. + <_>12 17 3 1 2. + <_>9 18 3 1 2. + 0 + 1.7729059618432075e-004 + 0.3868424892425537 + 1 + <_> + + + + <_>10 17 4 3 -1. + <_>10 18 4 1 3. + 0 + 3.6743620876222849e-004 + 0.4409345090389252 + 0.5476474165916443 + <_> + + <_> + + + + <_>4 2 4 2 -1. + <_>4 3 4 1 2. + 0 + -1.2352119665592909e-003 + 0.3260171115398407 + 1 + <_> + + + + <_>7 3 6 14 -1. + <_>9 3 2 14 3. + 0 + 1.1705530341714621e-003 + 0.4111348986625671 + 0.6088163852691650 + <_> + + <_> + + + + <_>15 13 1 6 -1. + <_>15 16 1 3 2. + 0 + -2.9695429475395940e-005 + 1 + 0.4269422888755798 + <_> + + + + <_>13 14 2 6 -1. + <_>13 16 2 2 3. + 0 + 2.7050738572143018e-004 + 0.4306466877460480 + 0.5810514092445374 + <_> + + <_> + + + + <_>4 11 5 6 -1. + <_>4 14 5 3 2. + 0 + -7.9626210208516568e-005 + 1 + 0.3669143021106720 + <_> + + + + <_>4 17 4 2 -1. + <_>6 17 2 2 2. + 0 + 3.3152441028505564e-004 + 0.4610663950443268 + 0.6290590167045593 + <_> + + <_> + + + + <_>0 6 20 2 -1. + <_>0 6 10 2 2. + 0 + -0.0523058287799358 + 1 + 0.5328689813613892 + <_> + + + + <_>6 5 10 12 -1. + <_>11 5 5 6 2. + <_>6 11 5 6 2. + 0 + 0.0268804691731930 + 0.5213261246681213 + 0.3231219947338104 + <_> + + <_> + + + + <_>4 0 2 12 -1. + <_>4 0 1 6 2. + <_>5 6 1 6 2. + 0 + -2.4203000066336244e-004 + 1 + 0.3568570017814636 + <_> + + + + <_>4 1 6 2 -1. + <_>6 1 2 2 3. + 0 + -1.6424639616161585e-003 + 0.3440661132335663 + 0.5625604987144470 + <_> + + <_> + + + + <_>13 7 2 1 -1. + <_>13 7 1 1 2. + 0 + -2.6830288697965443e-004 + 1 + 0.4561173021793366 + <_> + + + + <_>5 5 15 6 -1. + <_>5 7 15 2 3. + 0 + -2.2649629972875118e-003 + 0.5321351885795593 + 0.3674154877662659 + <_> + + <_> + + + + <_>1 10 18 2 -1. + <_>1 10 9 1 2. + <_>10 11 9 1 2. + 0 + 0.0156272090971470 + 1 + 0.2029353976249695 + <_> + + + + <_>1 6 15 7 -1. + <_>6 6 5 7 3. + 0 + 0.1621132045984268 + 0.5563033223152161 + 0.2618849873542786 + <_> + + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + -3.7391691002994776e-003 + 0.6062194705009460 + 1 + <_> + + + + <_>9 14 3 3 -1. + <_>9 15 3 1 3. + 0 + -2.0878419745713472e-003 + 0.5950763821601868 + 0.4545117020606995 + <_> + + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + 2.3334210272878408e-003 + 1 + 0.6435524225234985 + <_> + + + + <_>8 13 3 2 -1. + <_>8 14 3 1 2. + 0 + 6.5116386394947767e-005 + 0.3520734012126923 + 0.5179778933525085 + <_> + + <_> + + + + <_>15 14 5 3 -1. + <_>15 15 5 1 3. + 0 + 7.4625718407332897e-003 + 0.5326688289642334 + 1 + <_> + + + + <_>0 14 20 1 -1. + <_>0 14 10 1 2. + 0 + -0.0220326893031597 + 0.3491981029510498 + 0.5429236888885498 + <_> + + <_> + + + + <_>0 14 6 3 -1. + <_>0 15 6 1 3. + 0 + -8.3081610500812531e-003 + 0.2084023058414459 + 1 + <_> + + + + <_>5 3 4 2 -1. + <_>5 4 4 1 2. + 0 + -4.3259368976578116e-004 + 0.3965272009372711 + 0.5425453782081604 + <_> + + <_> + + + + <_>0 6 20 1 -1. + <_>0 6 10 1 2. + 0 + -0.0322092287242413 + 1 + 0.5306411981582642 + <_> + + + + <_>6 3 10 14 -1. + <_>11 3 5 7 2. + <_>6 10 5 7 2. + 0 + -9.0424838708713651e-004 + 0.5450385808944702 + 0.4256696999073029 + <_> + + <_> + + + + <_>8 12 4 2 -1. + <_>8 13 4 1 2. + 0 + 2.2727500181645155e-003 + 1 + 0.5968611240386963 + <_> + + + + <_>6 3 8 6 -1. + <_>6 3 4 3 2. + <_>10 6 4 3 2. + 0 + 5.9820008464157581e-003 + 0.4758140146732330 + 0.3150944113731384 + <_> + + <_> + + + + <_>13 7 2 1 -1. + <_>13 7 1 1 2. + 0 + -5.8856618124991655e-004 + 1 + 0.4847748875617981 + <_> + + + + <_>6 3 10 14 -1. + <_>11 3 5 7 2. + <_>6 10 5 7 2. + 0 + -8.8227191008627415e-004 + 0.5426316261291504 + 0.4338341057300568 + <_> + + <_> + + + + <_>5 7 2 1 -1. + <_>6 7 1 1 2. + 0 + -7.4473457061685622e-005 + 1 + 0.4287509918212891 + <_> + + + + <_>4 3 10 14 -1. + <_>4 3 5 7 2. + <_>9 10 5 7 2. + 0 + 3.9148979703895748e-004 + 0.6345185041427612 + 0.4101851880550385 + <_> + + <_> + + + + <_>9 7 2 2 -1. + <_>9 7 1 2 2. + 0 + -3.6939629353582859e-003 + 1 + 0.4849104881286621 + <_> + + + + <_>0 3 20 1 -1. + <_>0 3 10 1 2. + 0 + -0.0112078497186303 + 0.4146336913108826 + 0.5471264123916626 + <_> + + <_> + + + + <_>2 1 10 3 -1. + <_>2 2 10 1 3. + 0 + -0.0103374095633626 + 0.2877183854579926 + 1 + <_> + + + + <_>9 7 2 2 -1. + <_>10 7 1 2 2. + 0 + 3.6883640568703413e-003 + 0.5101901888847351 + 0.7216951251029968 + <_> + + <_> + + + + <_>9 17 3 2 -1. + <_>10 17 1 2 3. + 0 + -3.8984280545264482e-003 + 1 + 0.5276182293891907 + <_> + + + + <_>9 7 3 6 -1. + <_>10 7 1 6 3. + 0 + -5.9986729174852371e-003 + 0.6618459820747376 + 0.4841631054878235 + <_> + + <_> + + + + <_>8 17 3 2 -1. + <_>9 17 1 2 3. + 0 + 4.5043681748211384e-003 + 1 + 0.1874157935380936 + <_> + + + + <_>8 7 3 6 -1. + <_>9 7 1 6 3. + 0 + 0.0177995301783085 + 0.4616934955120087 + 0.7088965773582459 + <_> + + <_> + + + + <_>16 3 4 6 -1. + <_>16 5 4 2 3. + 0 + -0.0184625703841448 + 0.3001979887485504 + 1 + <_> + + + + <_>15 6 2 12 -1. + <_>16 6 1 6 2. + <_>15 12 1 6 2. + 0 + 1.4931300029275008e-005 + 0.4561808109283447 + 0.5610787868499756 + <_> + + <_> + + + + <_>1 4 18 10 -1. + <_>1 4 9 5 2. + <_>10 9 9 5 2. + 0 + -0.0860212296247482 + 0.2341700941324234 + 1 + <_> + + + + <_>9 4 2 4 -1. + <_>9 6 2 2 2. + 0 + -6.0818758356617764e-005 + 0.5672286152839661 + 0.4199964106082916 + <_> + + <_> + + + + <_>12 5 3 2 -1. + <_>12 6 3 1 2. + 0 + 1.2670679716393352e-003 + 1 + 0.6207482218742371 + <_> + + + + <_>5 12 10 4 -1. + <_>5 14 10 2 2. + 0 + 1.3699879636988044e-003 + 0.5394958853721619 + 0.3823862969875336 + <_> + + <_> + + + + <_>5 5 3 2 -1. + <_>5 6 3 1 2. + 0 + 3.3162781037390232e-003 + 1 + 0.7061681151390076 + <_> + + + + <_>4 6 12 6 -1. + <_>8 6 4 6 3. + 0 + -1.4532039640471339e-003 + 0.3065513074398041 + 0.4827373027801514 + <_> + + <_> + + + + <_>14 4 6 6 -1. + <_>14 6 6 2 3. + 0 + -0.0714920610189438 + 1 + 0.5193122029304504 + <_> + + + + <_>16 0 4 6 -1. + <_>18 0 2 3 2. + <_>16 3 2 3 2. + 0 + 1.9857978913933039e-003 + 0.4642435014247894 + 0.5807694792747498 + <_> + + <_> + + + + <_>0 4 6 6 -1. + <_>0 6 6 2 3. + 0 + 6.2516499310731888e-003 + 1 + 0.2949813902378082 + <_> + + + + <_>0 0 4 6 -1. + <_>0 0 2 3 2. + <_>2 3 2 3 2. + 0 + 2.7005500160157681e-003 + 0.4585886895656586 + 0.6022353768348694 + <_> + + <_> + + + + <_>12 0 8 5 -1. + <_>12 0 4 5 2. + 0 + 0.0111303897574544 + 0.4357841014862061 + 1 + <_> + + + + <_>16 0 4 17 -1. + <_>16 0 2 17 2. + 0 + 0.0150928497314453 + 0.4561539888381958 + 0.6119061708450317 + <_> + + <_> + + + + <_>1 0 18 20 -1. + <_>7 0 6 20 3. + 0 + -0.0279433000832796 + 0.6537144184112549 + 1 + <_> + + + + <_>6 0 2 5 -1. + <_>7 0 1 5 2. + 0 + 4.4036991312168539e-005 + 0.3474723100662231 + 0.5336967706680298 + <_> + + <_> + + + + <_>0 6 20 1 -1. + <_>0 6 10 1 2. + 0 + -0.0122327702119946 + 0.3731676042079926 + 1 + <_> + + + + <_>8 7 6 4 -1. + <_>10 7 2 4 3. + 0 + -6.8591412855312228e-004 + 0.5717229247093201 + 0.4793379008769989 + <_> + + <_> + + + + <_>1 1 16 4 -1. + <_>1 1 8 2 2. + <_>9 3 8 2 2. + 0 + -3.8992990739643574e-003 + 0.4056436121463776 + 1 + <_> + + + + <_>7 2 4 2 -1. + <_>7 2 2 1 2. + <_>9 3 2 1 2. + 0 + 4.9113907152786851e-004 + 0.6174048185348511 + 0.4471754133701325 + <_> + + <_> + + + + <_>7 4 9 3 -1. + <_>7 5 9 1 3. + 0 + 8.2117747515439987e-003 + 1 + 0.6179698109626770 + <_> + + + + <_>10 4 5 12 -1. + <_>10 10 5 6 2. + 0 + -0.0455644801259041 + 0.2285494953393936 + 0.5249565839767456 + <_> + + <_> + + + + <_>3 12 2 3 -1. + <_>3 13 2 1 3. + 0 + -5.3631910122931004e-003 + 0.1784950047731400 + 1 + <_> + + + + <_>8 8 3 5 -1. + <_>9 8 1 5 3. + 0 + -0.0122749703004956 + 0.7261952757835388 + 0.4550398886203766 + <_> + + <_> + + + + <_>13 9 2 3 -1. + <_>13 9 1 3 2. + 0 + 5.4185991175472736e-003 + 0.5252990722656250 + 1 + <_> + + + + <_>15 11 2 2 -1. + <_>15 12 2 1 2. + 0 + 8.1846961984410882e-004 + 0.5445222258567810 + 0.3272218108177185 + <_> + + <_> + + + + <_>5 6 2 3 -1. + <_>5 7 2 1 3. + 0 + 4.1358140297234058e-003 + 1 + 0.7013831734657288 + <_> + + + + <_>2 11 6 2 -1. + <_>2 12 6 1 2. + 0 + 3.9578010910190642e-004 + 0.4965943992137909 + 0.3295598030090332 + <_> + + <_> + + + + <_>15 11 4 3 -1. + <_>15 12 4 1 3. + 0 + 4.6887691132724285e-003 + 0.5362641811370850 + 1 + <_> + + + + <_>16 0 4 17 -1. + <_>16 0 2 17 2. + 0 + -0.0182554405182600 + 0.6496108770370483 + 0.4757137000560761 + <_> + + <_> + + + + <_>1 11 4 3 -1. + <_>1 12 4 1 3. + 0 + -6.2736468389630318e-003 + 0.2343741059303284 + 1 + <_> + + + + <_>9 11 1 3 -1. + <_>9 12 1 1 3. + 0 + 2.4320168886333704e-003 + 0.4620118141174316 + 0.6898419260978699 + <_> + + <_> + + + + <_>10 9 6 7 -1. + <_>10 9 3 7 2. + 0 + -0.0496176294982433 + 0.2100719958543778 + 1 + <_> + + + + <_>8 15 4 2 -1. + <_>8 16 4 1 2. + 0 + 1.1701210169121623e-003 + 0.4621528983116150 + 0.5797135829925537 + <_> + + <_> + + + + <_>4 9 6 7 -1. + <_>7 9 3 7 2. + 0 + -0.0452372916042805 + 0.2118262052536011 + 1 + <_> + + + + <_>9 14 2 3 -1. + <_>9 15 2 1 3. + 0 + 4.7563421539962292e-003 + 0.4884614944458008 + 0.6872498989105225 + <_> + + <_> + + + + <_>0 2 20 2 -1. + <_>10 2 10 1 2. + <_>0 3 10 1 2. + 0 + -0.0148359695449471 + 1 + 0.5275105834007263 + <_> + + + + <_>6 7 8 2 -1. + <_>6 8 8 1 2. + 0 + 7.7436608262360096e-004 + 0.4172320961952210 + 0.5491139888763428 + <_> + + <_> + + + + <_>0 2 20 2 -1. + <_>0 2 10 1 2. + <_>10 3 10 1 2. + 0 + 0.0148359695449471 + 1 + 0.2124876976013184 + <_> + + + + <_>3 1 2 10 -1. + <_>3 1 1 5 2. + <_>4 6 1 5 2. + 0 + -8.0892542609944940e-004 + 0.5495215058326721 + 0.4207795858383179 + <_> + + <_> + + + + <_>13 4 1 10 -1. + <_>13 9 1 5 2. + 0 + 7.7517668250948191e-004 + 0.3321942090988159 + 1 + <_> + + + + <_>9 8 4 3 -1. + <_>9 9 4 1 3. + 0 + -6.7618978209793568e-003 + 0.2212958037853241 + 0.5232653021812439 + <_> + + <_> + + + + <_>2 11 16 4 -1. + <_>2 11 8 2 2. + <_>10 13 8 2 2. + 0 + -0.0401358604431152 + 0.1101796030998230 + 1 + <_> + + + + <_>5 1 3 5 -1. + <_>6 1 1 5 3. + 0 + -3.3651469275355339e-003 + 0.3810100853443146 + 0.5617291927337647 + <_> + + <_> + + + + <_>9 10 2 3 -1. + <_>9 11 2 1 3. + 0 + 7.4713007779791951e-004 + 1 + 0.5795056819915772 + <_> + + + + <_>9 11 2 2 -1. + <_>9 12 2 1 2. + 0 + -4.2727389372885227e-003 + 0.6392269134521484 + 0.4711438119411469 + <_> + + <_> + + + + <_>0 10 20 2 -1. + <_>0 11 20 1 2. + 0 + 3.6202510818839073e-003 + 1 + 0.3409883975982666 + <_> + + + + <_>1 7 6 4 -1. + <_>1 7 3 2 2. + <_>4 9 3 2 2. + 0 + 4.7307618660852313e-004 + 0.3659302890300751 + 0.5388171076774597 + <_> + + <_> + + + + <_>12 0 8 8 -1. + <_>16 0 4 4 2. + <_>12 4 4 4 2. + 0 + 0.0330949090421200 + 1 + 0.7170385718345642 + <_> + + + + <_>14 1 6 4 -1. + <_>16 1 2 4 3. + 0 + -0.0115441195666790 + 0.6386818289756775 + 0.4681304097175598 + <_> + + <_> + + + + <_>6 3 2 14 -1. + <_>6 10 2 7 2. + 0 + -7.4234469793736935e-003 + 0.3263700902462006 + 1 + <_> + + + + <_>6 1 7 12 -1. + <_>6 7 7 6 2. + 0 + -4.2252950370311737e-003 + 0.5767819285392761 + 0.4346418082714081 + <_> + + <_> + + + + <_>5 0 15 5 -1. + <_>10 0 5 5 3. + 0 + 0.0181331094354391 + 0.4697827994823456 + 1 + <_> + + + + <_>15 0 4 10 -1. + <_>15 0 2 10 2. + 0 + 7.0903049781918526e-003 + 0.4437389075756073 + 0.6061668992042542 + <_> + + <_> + + + + <_>1 0 18 3 -1. + <_>7 0 6 3 3. + 0 + -0.0132729401811957 + 0.6558511257171631 + 1 + <_> + + + + <_>0 0 17 2 -1. + <_>0 1 17 1 2. + 0 + 1.4632199599873275e-004 + 0.3376353979110718 + 0.5091655254364014 + <_> + + <_> + + + + <_>10 0 3 3 -1. + <_>11 0 1 3 3. + 0 + -3.5790191031992435e-003 + 0.2947883903980255 + 1 + <_> + + + + <_>10 0 3 12 -1. + <_>11 0 1 12 3. + 0 + -4.6997101162560284e-004 + 0.5556982159614563 + 0.4665456116199493 + <_> + + <_> + + + + <_>1 3 4 16 -1. + <_>1 3 2 8 2. + <_>3 11 2 8 2. + 0 + -0.0481794402003288 + 0.7338355779647827 + 1 + <_> + + + + <_>7 0 3 3 -1. + <_>8 0 1 3 3. + 0 + -9.2581362696364522e-004 + 0.3543871939182282 + 0.5285149812698364 + <_> + + <_> + + + + <_>9 13 2 6 -1. + <_>9 16 2 3 2. + 0 + -0.0147807300090790 + 0.1944441944360733 + 1 + <_> + + + + <_>9 0 6 13 -1. + <_>11 0 2 13 3. + 0 + -0.1002745032310486 + 0.0990492925047874 + 0.5139853954315186 + <_> + + <_> + + + + <_>7 7 3 2 -1. + <_>8 7 1 2 3. + 0 + -9.3848101096227765e-004 + 0.5827109813690186 + 1 + <_> + + + + <_>8 2 1 12 -1. + <_>8 6 1 4 3. + 0 + -2.8861360624432564e-003 + 0.3441427946090698 + 0.5148838758468628 + <_> + + <_> + + + + <_>4 10 12 6 -1. + <_>10 10 6 3 2. + <_>4 13 6 3 2. + 0 + -0.0436827614903450 + 1 + 0.5207998156547546 + <_> + + + + <_>13 5 2 3 -1. + <_>13 6 2 1 3. + 0 + 2.6115700602531433e-003 + 0.4835503101348877 + 0.6322219967842102 + <_> + + <_> + + + + <_>4 10 12 6 -1. + <_>4 10 6 3 2. + <_>10 13 6 3 2. + 0 + 0.0436827614903450 + 1 + 0.1364538073539734 + <_> + + + + <_>5 5 2 3 -1. + <_>5 6 2 1 3. + 0 + 1.7179530113935471e-003 + 0.4537320137023926 + 0.6066750884056091 + <_> + + <_> + + + + <_>8 6 6 7 -1. + <_>10 6 2 7 3. + 0 + -0.0339649096131325 + 1 + 0.4968374967575073 + <_> + + + + <_>9 6 2 4 -1. + <_>9 6 1 4 2. + 0 + -1.0993590112775564e-003 + 0.5831680893898010 + 0.4688239991664887 + <_> + + <_> + + + + <_>6 6 6 7 -1. + <_>8 6 2 7 3. + 0 + 0.0543010793626308 + 1 + 0.7568289041519165 + <_> + + + + <_>9 6 2 4 -1. + <_>10 6 1 4 2. + 0 + 1.0993590112775564e-003 + 0.4330148100852966 + 0.5768468976020813 + <_> + + <_> + + + + <_>12 9 2 3 -1. + <_>12 9 1 3 2. + 0 + -1.4954120160837192e-005 + 1 + 0.4443281888961792 + <_> + + + + <_>0 6 20 1 -1. + <_>0 6 10 1 2. + 0 + 0.0314158685505390 + 0.5274472832679749 + 0.3037855923175812 + <_> + + <_> + + + + <_>5 7 10 2 -1. + <_>10 7 5 2 2. + 0 + 0.0108318496495485 + 1 + 0.3581720888614655 + <_> + + + + <_>1 16 4 3 -1. + <_>1 17 4 1 3. + 0 + 8.6545711383223534e-004 + 0.5937584042549133 + 0.4294629991054535 + <_> + + <_> + + + + <_>12 4 3 3 -1. + <_>12 5 3 1 3. + 0 + 2.2743160370737314e-003 + 1 + 0.5954576730728149 + <_> + + + + <_>10 3 5 3 -1. + <_>10 4 5 1 3. + 0 + 3.9340821094810963e-003 + 0.4792222976684570 + 0.5856133103370667 + <_> + + <_> + + + + <_>3 9 14 8 -1. + <_>3 9 7 4 2. + <_>10 13 7 4 2. + 0 + 8.1451907753944397e-003 + 1 + 0.3573477864265442 + <_> + + + + <_>6 8 8 10 -1. + <_>6 8 4 5 2. + <_>10 13 4 5 2. + 0 + -5.2763288840651512e-003 + 0.4026022851467133 + 0.5764743089675903 + <_> + + <_> + + + + <_>12 4 3 3 -1. + <_>12 5 3 1 3. + 0 + -8.3787851035594940e-003 + 1 + 0.4981333017349243 + <_> + + + + <_>10 3 5 3 -1. + <_>10 4 5 1 3. + 0 + 1.5621910570189357e-003 + 0.4736588001251221 + 0.5583608150482178 + <_> + + <_> + + + + <_>5 4 3 3 -1. + <_>5 5 3 1 3. + 0 + 3.2318739686161280e-003 + 1 + 0.6167436838150024 + <_> + + + + <_>5 3 5 3 -1. + <_>5 4 5 1 3. + 0 + 6.6804019734263420e-003 + 0.4131424129009247 + 0.6280695199966431 + <_> + + <_> + + + + <_>13 16 2 3 -1. + <_>13 17 2 1 3. + 0 + -3.3396480139344931e-003 + 0.3446358144283295 + 1 + <_> + + + + <_>0 5 20 6 -1. + <_>0 7 20 2 3. + 0 + -0.2093348056077957 + 0.1038658022880554 + 0.5204489231109619 + <_> + + <_> + + + + <_>3 14 3 3 -1. + <_>3 15 3 1 3. + 0 + 6.3805822283029556e-003 + 1 + 0.2167402058839798 + <_> + + + + <_>7 15 5 3 -1. + <_>7 16 5 1 3. + 0 + -6.0137799009680748e-003 + 0.6738399267196655 + 0.4896650910377502 + <_> + + <_> + + + + <_>12 9 2 3 -1. + <_>12 9 1 3 2. + 0 + -8.1756077706813812e-003 + 1 + 0.5177915096282959 + <_> + + + + <_>15 13 2 6 -1. + <_>15 13 1 6 2. + 0 + 6.3951779156923294e-004 + 0.4819645881652832 + 0.5464438199996948 + <_> + + <_> + + + + <_>6 9 2 3 -1. + <_>7 9 1 3 2. + 0 + 1.0127760469913483e-003 + 1 + 0.3423596024513245 + <_> + + + + <_>3 13 2 6 -1. + <_>4 13 1 6 2. + 0 + 4.9784599104896188e-004 + 0.4488461017608643 + 0.5912671089172363 + <_> + + <_> + + + + <_>11 4 2 4 -1. + <_>11 4 1 4 2. + 0 + 1.3596490316558629e-004 + 1 + 0.5568863153457642 + <_> + + + + <_>13 4 2 5 -1. + <_>13 4 1 5 2. + 0 + 0.0135716600343585 + 0.5161067843437195 + 0.1713000982999802 + <_> + + <_> + + + + <_>7 4 2 4 -1. + <_>8 4 1 4 2. + 0 + 3.0259079721872695e-005 + 1 + 0.4916203916072846 + <_> + + + + <_>5 4 2 5 -1. + <_>6 4 1 5 2. + 0 + -3.2625840976834297e-003 + 0.6404662728309631 + 0.2859084904193878 + <_> + + <_> + + + + <_>19 6 1 2 -1. + <_>19 7 1 1 2. + 0 + -1.9217010412830859e-004 + 1 + 0.5459282994270325 + <_> + + + + <_>12 7 8 13 -1. + <_>12 7 4 13 2. + 0 + 0.0219938792288303 + 0.4715713858604431 + 0.5690075159072876 + <_> + + <_> + + + + <_>0 6 1 2 -1. + <_>0 7 1 1 2. + 0 + 7.8907777788117528e-004 + 1 + 0.3279826939105988 + <_> + + + + <_>6 15 4 3 -1. + <_>6 16 4 1 3. + 0 + 5.0893891602754593e-004 + 0.4302007853984833 + 0.5696045160293579 + <_> + + <_> + + + + <_>11 8 2 2 -1. + <_>11 9 2 1 2. + 0 + 1.1662710312521085e-004 + 1 + 0.5387235283851624 + <_> + + + + <_>11 7 2 4 -1. + <_>11 7 1 4 2. + 0 + 8.0604078248143196e-003 + 0.5021423101425171 + 0.5965322256088257 + <_> + + <_> + + + + <_>4 13 2 3 -1. + <_>4 14 2 1 3. + 0 + 9.5925969071686268e-004 + 1 + 0.3473494052886963 + <_> + + + + <_>0 17 18 3 -1. + <_>6 17 6 3 3. + 0 + -0.0195261295884848 + 0.6475545167922974 + 0.4643782079219818 + 36.7265014648437500 + 13 + -1 + <_> + + + <_> + + <_> + + + + <_>1 0 18 5 -1. + <_>7 0 6 5 3. + 0 + 0.0412424392998219 + 0.3393315076828003 + 1 + <_> + + + + <_>5 7 3 4 -1. + <_>5 9 3 2 2. + 0 + 0.0156267099082470 + 0.5104100108146668 + 0.7772815227508545 + <_> + + <_> + + + + <_>10 6 2 2 -1. + <_>10 6 1 2 2. + 0 + 2.9947189614176750e-004 + 0.3664673864841461 + 1 + <_> + + + + <_>6 4 14 4 -1. + <_>13 4 7 2 2. + <_>6 6 7 2 2. + 0 + -1.0037609608843923e-003 + 0.5405650734901428 + 0.3926205039024353 + <_> + + <_> + + + + <_>5 16 6 4 -1. + <_>5 16 3 2 2. + <_>8 18 3 2 2. + 0 + 6.8128242855891585e-004 + 0.4251519143581390 + 1 + <_> + + + + <_>7 15 2 4 -1. + <_>7 17 2 2 2. + 0 + 1.3098999625071883e-004 + 0.4135144948959351 + 0.6925746202468872 + <_> + + <_> + + + + <_>8 5 5 14 -1. + <_>8 12 5 7 2. + 0 + 3.1696720980107784e-003 + 1 + 0.3455873131752014 + <_> + + + + <_>9 9 2 2 -1. + <_>9 10 2 1 2. + 0 + -2.0587369799613953e-003 + 0.2234193980693817 + 0.5286118984222412 + <_> + + <_> + + + + <_>7 5 3 7 -1. + <_>8 5 1 7 3. + 0 + -4.6395038953050971e-004 + 1 + 0.4206520020961762 + <_> + + + + <_>0 0 3 9 -1. + <_>0 3 3 3 3. + 0 + 3.5089480224996805e-003 + 0.6502981781959534 + 0.4117597937583923 + <_> + + <_> + + + + <_>8 6 8 8 -1. + <_>12 6 4 4 2. + <_>8 10 4 4 2. + 0 + -2.3975980002433062e-003 + 1 + 0.3673301041126251 + <_> + + + + <_>4 8 13 2 -1. + <_>4 9 13 1 2. + 0 + 1.0901279747486115e-003 + 0.2906238138675690 + 0.5445111989974976 + <_> + + <_> + + + + <_>4 3 6 1 -1. + <_>6 3 2 1 3. + 0 + -1.6524370585102588e-004 + 0.4233515858650208 + 1 + <_> + + + + <_>9 1 2 6 -1. + <_>9 3 2 2 3. + 0 + -4.1602319106459618e-004 + 0.3886361122131348 + 0.6269165873527527 + <_> + + <_> + + + + <_>10 5 6 4 -1. + <_>12 5 2 4 3. + 0 + -2.3739910102449358e-004 + 0.5524451136589050 + 1 + <_> + + + + <_>9 5 2 12 -1. + <_>9 9 2 4 3. + 0 + 0.0247397609055042 + 0.4960095882415772 + 0.5373491048812866 + <_> + + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + -0.0153428399935365 + 0.6849405169487000 + 1 + <_> + + + + <_>8 12 4 3 -1. + <_>8 13 4 1 3. + 0 + 0.0115404697135091 + 0.4037235081195831 + 0.6786940097808838 + <_> + + <_> + + + + <_>10 3 6 7 -1. + <_>12 3 2 7 3. + 0 + 6.4230621792376041e-003 + 1 + 0.3814676105976105 + <_> + + + + <_>3 10 16 6 -1. + <_>3 12 16 2 3. + 0 + 0.0129778096452355 + 0.5527058839797974 + 0.3744955956935883 + <_> + + <_> + + + + <_>5 5 3 10 -1. + <_>5 10 3 5 2. + 0 + 1.1063399724662304e-003 + 0.3520928919315338 + 1 + <_> + + + + <_>6 10 3 6 -1. + <_>6 13 3 3 2. + 0 + 1.3743690215051174e-003 + 0.5641903281211853 + 0.3075025975704193 + <_> + + <_> + + + + <_>17 2 2 12 -1. + <_>17 2 1 12 2. + 0 + 0.0162337794899940 + 0.4888828098773956 + 1 + <_> + + + + <_>16 6 2 14 -1. + <_>16 13 2 7 2. + 0 + -8.1519351806491613e-004 + 0.5456321239471436 + 0.4743550121784210 + <_> + + <_> + + + + <_>3 11 12 9 -1. + <_>3 14 12 3 3. + 0 + -0.0907824933528900 + 0.2925248146057129 + 1 + <_> + + + + <_>0 2 4 12 -1. + <_>2 2 2 12 2. + 0 + 0.0116652101278305 + 0.4688454866409302 + 0.6230347752571106 + <_> + + <_> + + + + <_>18 0 2 18 -1. + <_>18 0 1 18 2. + 0 + -0.0232864096760750 + 0.6895843148231506 + 1 + <_> + + + + <_>16 12 3 2 -1. + <_>16 13 3 1 2. + 0 + 2.1559339947998524e-003 + 0.5355802178382874 + 0.3423466086387634 + <_> + + <_> + + + + <_>0 2 2 15 -1. + <_>1 2 1 15 2. + 0 + -4.3167220428586006e-003 + 0.5937076210975647 + 1 + <_> + + + + <_>1 10 2 4 -1. + <_>1 12 2 2 2. + 0 + 1.5610599657520652e-003 + 0.4708659946918488 + 0.2736997008323669 + <_> + + <_> + + + + <_>11 1 2 18 -1. + <_>11 1 1 18 2. + 0 + 0.0140766398981214 + 0.5287156105041504 + 1 + <_> + + + + <_>3 2 14 2 -1. + <_>10 2 7 1 2. + <_>3 3 7 1 2. + 0 + 7.1018589660525322e-003 + 0.5336192846298218 + 0.3224813938140869 + <_> + + <_> + + + + <_>7 1 2 18 -1. + <_>8 1 1 18 2. + 0 + -4.8221647739410400e-003 + 0.2983910143375397 + 1 + <_> + + + + <_>6 1 8 12 -1. + <_>6 7 8 6 2. + 0 + -5.3852899000048637e-003 + 0.5623999238014221 + 0.4295912086963654 + <_> + + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + 7.3483278974890709e-003 + 1 + 0.6813961267471314 + <_> + + + + <_>7 14 6 3 -1. + <_>7 15 6 1 3. + 0 + -3.5707519855350256e-003 + 0.5857968926429749 + 0.4603429138660431 + <_> + + <_> + + + + <_>0 13 5 2 -1. + <_>0 14 5 1 2. + 0 + 2.3340100888162851e-003 + 1 + 0.2744851112365723 + <_> + + + + <_>9 0 2 6 -1. + <_>9 0 1 3 2. + <_>10 3 1 3 2. + 0 + 4.7432780265808105e-003 + 0.5047526955604553 + 0.2362741976976395 + <_> + + <_> + + + + <_>9 0 2 6 -1. + <_>10 0 1 3 2. + <_>9 3 1 3 2. + 0 + 6.5055489540100098e-003 + 0.5242248177528381 + 1 + <_> + + + + <_>9 7 3 6 -1. + <_>10 7 1 6 3. + 0 + 0.0125892497599125 + 0.4823690950870514 + 0.6752536892890930 + <_> + + <_> + + + + <_>9 0 2 6 -1. + <_>9 0 1 3 2. + <_>10 3 1 3 2. + 0 + -6.3358368352055550e-003 + 0.1734634935855866 + 1 + <_> + + + + <_>8 7 3 6 -1. + <_>9 7 1 6 3. + 0 + -5.7639651931822300e-003 + 0.6354380846023560 + 0.4587475061416626 + <_> + + <_> + + + + <_>9 6 2 6 -1. + <_>9 6 1 6 2. + 0 + 1.3599749654531479e-003 + 0.4580380916595459 + 1 + <_> + + + + <_>9 4 4 3 -1. + <_>9 4 2 3 2. + 0 + 0.0284042600542307 + 0.5176380872726440 + 0.1204385012388229 + <_> + + <_> + + + + <_>0 4 4 3 -1. + <_>0 5 4 1 3. + 0 + -9.2958156019449234e-003 + 0.2337957024574280 + 1 + <_> + + + + <_>8 7 4 2 -1. + <_>8 8 4 1 2. + 0 + -1.1800320353358984e-003 + 0.3902814090251923 + 0.5652930140495300 + <_> + + <_> + + + + <_>10 6 6 3 -1. + <_>12 6 2 3 3. + 0 + -2.0948140881955624e-003 + 0.5512028932571411 + 1 + <_> + + + + <_>9 6 3 12 -1. + <_>9 10 3 4 3. + 0 + 4.1679958812892437e-003 + 0.5455976128578186 + 0.4798949062824249 + <_> + + <_> + + + + <_>5 4 2 3 -1. + <_>5 5 2 1 3. + 0 + 5.4458891972899437e-003 + 1 + 0.6127086877822876 + <_> + + + + <_>5 6 1 3 -1. + <_>5 7 1 1 3. + 0 + -1.2766510481014848e-003 + 0.5317131876945496 + 0.3850932121276856 + <_> + + <_> + + + + <_>9 17 3 2 -1. + <_>10 17 1 2 3. + 0 + 5.9404270723462105e-004 + 0.5446437001228333 + 1 + <_> + + + + <_>0 7 20 2 -1. + <_>0 8 20 1 2. + 0 + 0.0423096083104610 + 0.5234643816947937 + 0.2213044017553330 + <_> + + <_> + + + + <_>4 3 6 7 -1. + <_>6 3 2 7 3. + 0 + 5.6189671158790588e-003 + 0.4916197955608368 + 1 + <_> + + + + <_>5 10 6 10 -1. + <_>5 10 3 5 2. + <_>8 15 3 5 2. + 0 + 7.2401198558509350e-003 + 0.1471475958824158 + 0.4852893948554993 + <_> + + <_> + + + + <_>9 17 3 2 -1. + <_>10 17 1 2 3. + 0 + -4.5610670931637287e-003 + 0.2773773968219757 + 1 + <_> + + + + <_>9 10 2 2 -1. + <_>9 11 2 1 2. + 0 + 4.5506159949582070e-005 + 0.4626461863517761 + 0.5768079161643982 + <_> + + <_> + + + + <_>8 17 3 2 -1. + <_>9 17 1 2 3. + 0 + -6.1903791502118111e-003 + 0.1644289940595627 + 1 + <_> + + + + <_>5 6 1 3 -1. + <_>5 7 1 1 3. + 0 + 8.1186462193727493e-004 + 0.4778591096401215 + 0.6261864900588989 + <_> + + <_> + + + + <_>0 1 20 2 -1. + <_>10 1 10 1 2. + <_>0 2 10 1 2. + 0 + 0.0137798096984625 + 0.5257307887077332 + 1 + <_> + + + + <_>14 2 6 9 -1. + <_>14 5 6 3 3. + 0 + 1.1290319962427020e-003 + 0.5498048067092896 + 0.3983106911182404 + <_> + + <_> + + + + <_>5 3 3 2 -1. + <_>5 4 3 1 2. + 0 + -1.0610350000206381e-004 + 0.4033519029617310 + 1 + <_> + + + + <_>5 4 4 2 -1. + <_>7 4 2 2 2. + 0 + 1.6695790691301227e-004 + 0.4149340093135834 + 0.5795341134071350 + <_> + + <_> + + + + <_>14 2 6 9 -1. + <_>14 5 6 3 3. + 0 + 1.1290319962427020e-003 + 1 + 0.3934114873409271 + <_> + + + + <_>0 12 20 6 -1. + <_>0 14 20 2 3. + 0 + -0.1201934963464737 + 0.0734004825353622 + 0.5202586054801941 + <_> + + <_> + + + + <_>2 2 16 4 -1. + <_>2 2 8 2 2. + <_>10 4 8 2 2. + 0 + -0.0152307404205203 + 0.3749505877494812 + 1 + <_> + + + + <_>7 12 5 3 -1. + <_>7 13 5 1 3. + 0 + 3.5759829916059971e-003 + 0.5078150033950806 + 0.6606066226959229 + <_> + + <_> + + + + <_>14 9 6 10 -1. + <_>14 9 3 10 2. + 0 + 0.0134794600307941 + 0.4547711014747620 + 1 + <_> + + + + <_>16 6 3 2 -1. + <_>16 7 3 1 2. + 0 + -2.1162950433790684e-003 + 0.3311006128787994 + 0.5384259223937988 + <_> + + <_> + + + + <_>0 9 6 10 -1. + <_>3 9 3 10 2. + 0 + -0.0178777091205120 + 0.6513252854347229 + 1 + <_> + + + + <_>0 16 5 2 -1. + <_>0 17 5 1 2. + 0 + 1.0931970318779349e-003 + 0.5264765024185181 + 0.3456991016864777 + <_> + + <_> + + + + <_>9 12 2 3 -1. + <_>9 13 2 1 3. + 0 + -3.0553159303963184e-003 + 0.6268613934516907 + 1 + <_> + + + + <_>9 7 2 12 -1. + <_>9 11 2 4 3. + 0 + 3.6365049891173840e-003 + 0.5399212837219238 + 0.4345397055149078 + <_> + + <_> + + + + <_>3 2 6 2 -1. + <_>5 2 2 2 3. + 0 + 9.7896481747739017e-005 + 0.3835605978965759 + 1 + <_> + + + + <_>4 1 1 2 -1. + <_>4 2 1 1 2. + 0 + -3.2714448752813041e-004 + 0.3337667882442474 + 0.5539165735244751 + <_> + + <_> + + + + <_>11 15 1 2 -1. + <_>11 16 1 1 2. + 0 + 4.3425030889920890e-004 + 1 + 0.5788270235061646 + <_> + + + + <_>3 1 16 2 -1. + <_>11 1 8 1 2. + <_>3 2 8 1 2. + 0 + 0.0140055799856782 + 0.5275077819824219 + 0.2701125144958496 + <_> + + <_> + + + + <_>3 6 2 2 -1. + <_>3 6 1 1 2. + <_>4 7 1 1 2. + 0 + -9.2654931358993053e-004 + 0.5852280259132385 + 1 + <_> + + + + <_>5 11 10 6 -1. + <_>5 11 5 3 2. + <_>10 14 5 3 2. + 0 + 3.9504268206655979e-003 + 0.4728336930274963 + 0.3313918113708496 + <_> + + <_> + + + + <_>10 11 4 6 -1. + <_>10 14 4 3 2. + 0 + -5.8086868375539780e-004 + 1 + 0.4258810877799988 + <_> + + + + <_>14 9 6 11 -1. + <_>16 9 2 11 3. + 0 + -0.0120180202648044 + 0.5609787106513977 + 0.4895192086696625 + <_> + + <_> + + + + <_>0 9 6 11 -1. + <_>2 9 2 11 3. + 0 + -0.1452154070138931 + 0.0438944809138775 + 1 + <_> + + + + <_>2 11 16 6 -1. + <_>2 11 8 3 2. + <_>10 14 8 3 2. + 0 + -6.6049019806087017e-003 + 0.4229170978069305 + 0.5616292953491211 + <_> + + <_> + + + + <_>12 0 8 10 -1. + <_>16 0 4 5 2. + <_>12 5 4 5 2. + 0 + -0.0349097512662411 + 1 + 0.4788128137588501 + <_> + + + + <_>14 2 6 4 -1. + <_>16 2 2 4 3. + 0 + 3.7478420417755842e-003 + 0.4800282120704651 + 0.5801389217376709 + <_> + + <_> + + + + <_>0 0 8 10 -1. + <_>0 0 4 5 2. + <_>4 5 4 5 2. + 0 + 0.0330380313098431 + 1 + 0.7078176140785217 + <_> + + + + <_>0 2 6 4 -1. + <_>2 2 2 4 3. + 0 + 3.6872599739581347e-003 + 0.4449624121189117 + 0.5957731008529663 + <_> + + <_> + + + + <_>4 9 15 2 -1. + <_>9 9 5 2 3. + 0 + -4.5311939902603626e-003 + 0.4177047014236450 + 1 + <_> + + + + <_>12 3 4 8 -1. + <_>14 3 2 4 2. + <_>12 7 2 4 2. + 0 + 4.1058510541915894e-003 + 0.5372948050498962 + 0.3736926913261414 + <_> + + <_> + + + + <_>9 2 2 9 -1. + <_>10 2 1 9 2. + 0 + -8.7599847465753555e-003 + 0.6658807992935181 + 1 + <_> + + + + <_>0 2 20 1 -1. + <_>10 2 10 1 2. + 0 + -0.0230033099651337 + 0.2647922039031982 + 0.5101817846298218 + <_> + + <_> + + + + <_>16 1 4 5 -1. + <_>16 1 2 5 2. + 0 + 5.3664818406105042e-003 + 0.4548634886741638 + 1 + <_> + + + + <_>16 0 4 6 -1. + <_>16 3 4 3 2. + 0 + 0.0389717705547810 + 0.5157061815261841 + 0.3436439037322998 + <_> + + <_> + + + + <_>4 3 6 4 -1. + <_>6 3 2 4 3. + 0 + -0.0277671907097101 + 0.2354391068220139 + 1 + <_> + + + + <_>0 0 18 5 -1. + <_>6 0 6 5 3. + 0 + -9.8894089460372925e-003 + 0.6887741088867188 + 0.5111051797866821 + <_> + + <_> + + + + <_>6 2 12 14 -1. + <_>12 2 6 7 2. + <_>6 9 6 7 2. + 0 + -3.2073140610009432e-003 + 0.5438867807388306 + 1 + <_> + + + + <_>11 8 3 5 -1. + <_>12 8 1 5 3. + 0 + -6.7484978353604674e-004 + 0.5451148748397827 + 0.4831353127956390 + <_> + + <_> + + + + <_>5 12 2 2 -1. + <_>5 13 2 1 2. + 0 + -5.1947520114481449e-003 + 0.2113419026136398 + 1 + <_> + + + + <_>5 10 4 3 -1. + <_>7 10 2 3 2. + 0 + -2.6169899501837790e-004 + 0.5273681879043579 + 0.3992587029933929 + <_> + + <_> + + + + <_>4 9 15 2 -1. + <_>9 9 5 2 3. + 0 + 2.2421479225158691e-003 + 0.4688260853290558 + 1 + <_> + + + + <_>10 7 6 2 -1. + <_>12 7 2 2 3. + 0 + -1.2139769969508052e-003 + 0.5504235029220581 + 0.4384871125221252 + <_> + + <_> + + + + <_>1 9 15 2 -1. + <_>6 9 5 2 3. + 0 + -2.9469770379364491e-003 + 0.3892847001552582 + 1 + <_> + + + + <_>5 0 2 10 -1. + <_>5 0 1 5 2. + <_>6 5 1 5 2. + 0 + -3.9291830034926534e-004 + 0.6001722812652588 + 0.4561662971973419 + <_> + + <_> + + + + <_>0 0 20 14 -1. + <_>0 7 20 7 2. + 0 + 0.6255072951316834 + 1 + 0.0681256130337715 + <_> + + + + <_>12 7 8 4 -1. + <_>12 7 4 4 2. + 0 + 9.7744520753622055e-003 + 0.4813025891780853 + 0.5620657205581665 + <_> + + <_> + + + + <_>0 7 8 4 -1. + <_>4 7 4 4 2. + 0 + 0.0943782478570938 + 1 + 0.0666322931647301 + <_> + + + + <_>8 1 3 3 -1. + <_>9 1 1 3 3. + 0 + -1.9560910295695066e-003 + 0.3588232994079590 + 0.5295407176017761 + <_> + + <_> + + + + <_>9 7 3 4 -1. + <_>10 7 1 4 3. + 0 + 9.0652769431471825e-003 + 0.4822688102722168 + 1 + <_> + + + + <_>9 9 3 1 -1. + <_>10 9 1 1 3. + 0 + 4.2138071148656309e-004 + 0.4670332968235016 + 0.5683112740516663 + <_> + + <_> + + + + <_>8 9 3 2 -1. + <_>8 10 3 1 2. + 0 + -4.4220191193744540e-004 + 1 + 0.5360795259475708 + <_> + + + + <_>8 4 2 8 -1. + <_>8 4 1 4 2. + <_>9 8 1 4 2. + 0 + -4.7313501127064228e-003 + 0.6137245893478394 + 0.3188089132308960 + <_> + + <_> + + + + <_>5 8 12 3 -1. + <_>5 9 12 1 3. + 0 + 1.5395509544759989e-003 + 0.4487720131874085 + 1 + <_> + + + + <_>11 14 1 3 -1. + <_>11 15 1 1 3. + 0 + 2.4315000046044588e-003 + 0.4894166886806488 + 0.6716653704643250 + <_> + + <_> + + + + <_>6 10 3 6 -1. + <_>6 12 3 2 3. + 0 + -0.0155816199257970 + 0.3336741924285889 + 1 + <_> + + + + <_>4 17 8 3 -1. + <_>4 18 8 1 3. + 0 + 1.0816920548677444e-003 + 0.4718219935894013 + 0.5960627198219299 + <_> + + <_> + + + + <_>17 6 2 3 -1. + <_>17 7 2 1 3. + 0 + -2.2197659127414227e-003 + 0.3588554859161377 + 1 + <_> + + + + <_>9 12 2 2 -1. + <_>10 12 1 1 2. + <_>9 13 1 1 2. + 0 + -9.3048671260476112e-004 + 0.6218712925910950 + 0.4817300140857697 + <_> + + <_> + + + + <_>9 13 2 4 -1. + <_>9 13 1 2 2. + <_>10 15 1 2 2. + 0 + -4.7418707981705666e-003 + 0.2550027072429657 + 1 + <_> + + + + <_>9 11 2 3 -1. + <_>9 12 2 1 3. + 0 + -6.2950369901955128e-003 + 0.6728078722953796 + 0.5051063895225525 + <_> + + <_> + + + + <_>5 5 12 10 -1. + <_>11 5 6 5 2. + <_>5 10 6 5 2. + 0 + 3.5216049291193485e-003 + 0.5401909947395325 + 1 + <_> + + + + <_>6 3 12 12 -1. + <_>12 3 6 6 2. + <_>6 9 6 6 2. + 0 + -2.4289379362016916e-003 + 0.5419461727142334 + 0.4347142875194550 + <_> + + <_> + + + + <_>5 7 2 2 -1. + <_>5 7 1 1 2. + <_>6 8 1 1 2. + 0 + -2.5261470582336187e-003 + 0.6970624923706055 + 1 + <_> + + + + <_>4 3 3 2 -1. + <_>5 3 1 2 3. + 0 + -1.4817339833825827e-003 + 0.3263416886329651 + 0.4917873144149780 + <_> + + <_> + + + + <_>6 2 12 14 -1. + <_>12 2 6 7 2. + <_>6 9 6 7 2. + 0 + -0.2247453033924103 + 7.2937291115522385e-003 + 1 + <_> + + + + <_>5 2 12 3 -1. + <_>9 2 4 3 3. + 0 + 2.8342509176582098e-003 + 0.4579229950904846 + 0.5379881262779236 + <_> + + <_> + + + + <_>1 1 18 17 -1. + <_>7 1 6 17 3. + 0 + -0.0208216104656458 + 0.6024088859558106 + 1 + <_> + + + + <_>0 9 10 1 -1. + <_>5 9 5 1 2. + 0 + 1.4896340144332498e-004 + 0.3336144089698792 + 0.4962815940380096 + <_> + + <_> + + + + <_>16 8 4 3 -1. + <_>16 9 4 1 3. + 0 + -3.3524499740451574e-003 + 0.3558751046657562 + 1 + <_> + + + + <_>7 13 6 6 -1. + <_>7 16 6 3 2. + 0 + -0.0372798815369606 + 0.1698562949895859 + 0.5208985805511475 + <_> + + <_> + + + + <_>6 14 1 6 -1. + <_>6 16 1 2 3. + 0 + 1.3896770542487502e-004 + 1 + 0.5590686202049255 + <_> + + + + <_>6 17 4 2 -1. + <_>6 18 4 1 2. + 0 + -3.1912620761431754e-004 + 0.5848733782768250 + 0.3795836865901947 + <_> + + <_> + + + + <_>10 18 6 2 -1. + <_>13 18 3 1 2. + <_>10 19 3 1 2. + 0 + 5.4003461264073849e-004 + 1 + 0.5670288205146790 + <_> + + + + <_>16 8 1 3 -1. + <_>16 9 1 1 3. + 0 + 3.8956850767135620e-003 + 0.5182694792747498 + 0.3327709138393402 + <_> + + <_> + + + + <_>8 13 4 3 -1. + <_>8 14 4 1 3. + 0 + 1.6084529925137758e-003 + 1 + 0.5410485863685608 + <_> + + + + <_>9 15 1 2 -1. + <_>9 16 1 1 2. + 0 + -5.7474587811157107e-004 + 0.6022642254829407 + 0.3644644021987915 + <_> + + <_> + + + + <_>13 0 3 12 -1. + <_>14 0 1 12 3. + 0 + 0.0134350396692753 + 1 + 0.3441281914710999 + <_> + + + + <_>15 11 1 3 -1. + <_>15 12 1 1 3. + 0 + 2.1368139423429966e-003 + 0.5292434096336365 + 0.2747075855731964 + <_> + + <_> + + + + <_>8 15 3 3 -1. + <_>8 16 3 1 3. + 0 + 0.0141576295718551 + 1 + 0.8027868270874023 + <_> + + + + <_>4 0 3 12 -1. + <_>5 0 1 12 3. + 0 + 5.3884391672909260e-003 + 0.5222315192222595 + 0.3586727976799011 + <_> + + <_> + + + + <_>9 7 3 3 -1. + <_>10 7 1 3 3. + 0 + 8.8013410568237305e-003 + 0.4900386929512024 + 1 + <_> + + + + <_>9 9 3 1 -1. + <_>10 9 1 1 3. + 0 + 3.8858849438838661e-004 + 0.4681056141853333 + 0.5721952915191650 + <_> + + <_> + + + + <_>2 2 12 14 -1. + <_>2 2 6 7 2. + <_>8 9 6 7 2. + 0 + -2.2143588867038488e-003 + 0.5388805866241455 + 1 + <_> + + + + <_>4 2 12 3 -1. + <_>8 2 4 3 3. + 0 + -8.4642972797155380e-003 + 0.6675537824630737 + 0.3448441922664642 + <_> + + <_> + + + + <_>18 18 2 2 -1. + <_>18 18 1 2 2. + 0 + 0.0150443902239203 + 1 + 0.9239614009857178 + <_> + + + + <_>17 2 3 8 -1. + <_>18 2 1 8 3. + 0 + 7.6346402056515217e-003 + 0.4884896874427795 + 0.6306052803993225 + <_> + + <_> + + + + <_>0 18 2 2 -1. + <_>1 18 1 2 2. + 0 + 3.3895121305249631e-004 + 1 + 0.3997431099414825 + <_> + + + + <_>6 11 2 6 -1. + <_>6 14 2 3 2. + 0 + 2.1157610171940178e-004 + 0.5663982033729553 + 0.3972980976104736 + <_> + + <_> + + + + <_>13 10 5 6 -1. + <_>13 12 5 2 3. + 0 + -0.0275149494409561 + 1 + 0.5201063752174377 + <_> + + + + <_>5 8 15 3 -1. + <_>5 9 15 1 3. + 0 + 0.0516030602157116 + 0.5140730142593384 + 0.1245130971074104 + <_> + + <_> + + + + <_>2 10 5 6 -1. + <_>2 12 5 2 3. + 0 + 3.7510651163756847e-003 + 1 + 0.3802095055580139 + <_> + + + + <_>0 8 15 3 -1. + <_>0 9 15 1 3. + 0 + -2.1457639522850513e-003 + 0.3309448063373566 + 0.5474538803100586 + <_> + + <_> + + + + <_>16 2 3 1 -1. + <_>17 2 1 1 3. + 0 + -5.8178009930998087e-004 + 1 + 0.4892601966857910 + <_> + + + + <_>17 4 3 2 -1. + <_>18 4 1 2 3. + 0 + -9.3638541875407100e-004 + 0.5937399268150330 + 0.4664669036865234 + <_> + + <_> + + + + <_>0 8 8 12 -1. + <_>0 8 4 6 2. + <_>4 14 4 6 2. + 0 + 0.0416674911975861 + 1 + 0.7021353244781494 + <_> + + + + <_>1 7 8 6 -1. + <_>1 7 4 3 2. + <_>5 10 4 3 2. + 0 + -6.7763780243694782e-003 + 0.3222751021385193 + 0.5068395137786865 + <_> + + <_> + + + + <_>14 1 6 2 -1. + <_>16 1 2 2 3. + 0 + -2.9170580673962831e-003 + 1 + 0.4717701077461243 + <_> + + + + <_>15 0 4 4 -1. + <_>17 0 2 2 2. + <_>15 2 2 2 2. + 0 + 3.2789530814625323e-004 + 0.4509383141994476 + 0.5651162862777710 + 38.2360382080078130 + 14 + -1 + <_> + + + <_> + + <_> + + + + <_>1 1 4 11 -1. + <_>3 1 2 11 2. + 0 + 0.0117298001423478 + 0.3805224895477295 + 1 + <_> + + + + <_>5 5 1 8 -1. + <_>5 9 1 4 2. + 0 + 1.1712179984897375e-003 + 0.3140017986297607 + 0.6858146190643311 + <_> + + <_> + + + + <_>7 7 6 1 -1. + <_>9 7 2 1 3. + 0 + 9.3555096536874771e-003 + 1 + 0.6834673285484314 + <_> + + + + <_>4 7 12 2 -1. + <_>8 7 4 2 3. + 0 + 1.6570610459893942e-003 + 0.2992472946643829 + 0.5475677847862244 + <_> + + <_> + + + + <_>8 4 4 4 -1. + <_>8 6 4 2 2. + 0 + -1.3387809740379453e-003 + 1 + 0.2941406965255737 + <_> + + + + <_>2 4 9 1 -1. + <_>5 4 3 1 3. + 0 + 1.7580550047568977e-004 + 0.3896977901458740 + 0.5872970819473267 + <_> + + <_> + + + + <_>9 12 2 8 -1. + <_>9 16 2 4 2. + 0 + -2.9473248869180679e-003 + 0.3576571941375732 + 1 + <_> + + + + <_>3 8 14 12 -1. + <_>3 14 14 6 2. + 0 + 8.3220899105072021e-003 + 0.5232400894165039 + 0.3231087923049927 + <_> + + <_> + + + + <_>6 13 7 3 -1. + <_>6 14 7 1 3. + 0 + 7.4366689659655094e-003 + 1 + 0.6715673208236694 + <_> + + + + <_>5 9 6 3 -1. + <_>7 9 2 3 3. + 0 + -2.1322889369912446e-004 + 0.5470541715621948 + 0.3863396048545837 + <_> + + <_> + + + + <_>12 1 6 3 -1. + <_>12 2 6 1 3. + 0 + -7.8024631366133690e-003 + 0.2771460115909576 + 1 + <_> + + + + <_>8 12 6 2 -1. + <_>8 13 6 1 2. + 0 + 5.6611228501424193e-004 + 0.4689136147499085 + 0.5851963758468628 + <_> + + <_> + + + + <_>0 2 18 2 -1. + <_>0 2 9 1 2. + <_>9 3 9 1 2. + 0 + -9.2346500605344772e-003 + 0.2704397141933441 + 1 + <_> + + + + <_>6 10 3 6 -1. + <_>6 13 3 3 2. + 0 + -1.4676499631605111e-005 + 0.5622550249099731 + 0.3579317033290863 + <_> + + <_> + + + + <_>14 0 6 6 -1. + <_>14 0 3 6 2. + 0 + 9.7007937729358673e-003 + 0.4173871874809265 + 1 + <_> + + + + <_>15 0 5 8 -1. + <_>15 4 5 4 2. + 0 + -3.5320650786161423e-003 + 0.4195013046264648 + 0.5549468994140625 + <_> + + <_> + + + + <_>7 16 6 4 -1. + <_>9 16 2 4 3. + 0 + 0.0216164104640484 + 1 + 0.2857390940189362 + <_> + + + + <_>2 11 14 4 -1. + <_>2 11 7 2 2. + <_>9 13 7 2 2. + 0 + 3.4567608963698149e-003 + 0.6024532914161682 + 0.4377507865428925 + <_> + + <_> + + + + <_>14 10 6 10 -1. + <_>14 10 3 10 2. + 0 + 0.0229143202304840 + 0.4689350128173828 + 1 + <_> + + + + <_>9 8 10 12 -1. + <_>14 8 5 6 2. + <_>9 14 5 6 2. + 0 + 3.4328910987824202e-003 + 0.4664604961872101 + 0.5762562155723572 + <_> + + <_> + + + + <_>0 10 6 10 -1. + <_>3 10 3 10 2. + 0 + -8.6510833352804184e-003 + 0.6381739974021912 + 1 + <_> + + + + <_>1 8 10 12 -1. + <_>1 8 5 6 2. + <_>6 14 5 6 2. + 0 + 1.4510039472952485e-003 + 0.3711487948894501 + 0.5530750751495361 + <_> + + <_> + + + + <_>9 3 6 1 -1. + <_>11 3 2 1 3. + 0 + 7.8191719949245453e-003 + 0.5264362096786499 + 1 + <_> + + + + <_>7 4 6 3 -1. + <_>9 4 2 3 3. + 0 + 2.0798550394829363e-004 + 0.3730512857437134 + 0.5445731282234192 + <_> + + <_> + + + + <_>5 3 6 1 -1. + <_>7 3 2 1 3. + 0 + -3.9962218143045902e-003 + 0.2438170015811920 + 1 + <_> + + + + <_>4 5 6 3 -1. + <_>6 5 2 3 3. + 0 + -1.5010139577498194e-005 + 0.5324671268463135 + 0.3682988882064819 + <_> + + <_> + + + + <_>9 16 3 3 -1. + <_>9 17 3 1 3. + 0 + -4.2428788729012012e-003 + 0.6481474041938782 + 1 + <_> + + + + <_>8 14 6 3 -1. + <_>8 15 6 1 3. + 0 + 9.1374982148408890e-003 + 0.4896158874034882 + 0.6558843255043030 + <_> + + <_> + + + + <_>6 0 8 12 -1. + <_>6 0 4 6 2. + <_>10 6 4 6 2. + 0 + 8.8254585862159729e-003 + 1 + 0.3613870143890381 + <_> + + + + <_>4 12 2 3 -1. + <_>4 13 2 1 3. + 0 + 9.4092212384566665e-004 + 0.5502895712852478 + 0.3632518053054810 + <_> + + <_> + + + + <_>12 16 6 3 -1. + <_>12 17 6 1 3. + 0 + -0.0125033501535654 + 0.2261132001876831 + 1 + <_> + + + + <_>7 12 7 2 -1. + <_>7 13 7 1 2. + 0 + 8.6759645491838455e-003 + 0.4987890124320984 + 0.6847196221351624 + <_> + + <_> + + + + <_>2 16 6 3 -1. + <_>2 17 6 1 3. + 0 + -0.0104167601093650 + 0.2446299046278000 + 1 + <_> + + + + <_>0 7 16 6 -1. + <_>0 10 16 3 2. + 0 + 2.7432460337877274e-003 + 0.3511525094509125 + 0.5399826765060425 + <_> + + <_> + + + + <_>9 7 3 3 -1. + <_>10 7 1 3 3. + 0 + -4.2385691776871681e-003 + 0.6823673248291016 + 1 + <_> + + + + <_>9 7 3 5 -1. + <_>10 7 1 5 3. + 0 + 0.0183258708566427 + 0.4891580045223236 + 0.7135618925094605 + <_> + + <_> + + + + <_>0 5 20 10 -1. + <_>0 5 10 5 2. + <_>10 10 10 5 2. + 0 + -0.0243345405906439 + 0.3522521853446960 + 1 + <_> + + + + <_>3 1 4 2 -1. + <_>5 1 2 2 2. + 0 + 4.6469361404888332e-004 + 0.4049868881702423 + 0.5515825748443604 + <_> + + <_> + + + + <_>7 6 8 10 -1. + <_>11 6 4 5 2. + <_>7 11 4 5 2. + 0 + 3.4260009415447712e-003 + 1 + 0.4126769900321960 + <_> + + + + <_>17 6 3 2 -1. + <_>17 7 3 1 2. + 0 + -2.5827318895608187e-003 + 0.2899428904056549 + 0.5386431813240051 + <_> + + <_> + + + + <_>5 6 8 10 -1. + <_>5 6 4 5 2. + <_>9 11 4 5 2. + 0 + 1.0545699624344707e-003 + 1 + 0.3771344125270844 + <_> + + + + <_>5 12 10 6 -1. + <_>5 14 10 2 3. + 0 + -9.1257691383361816e-004 + 0.5827386975288391 + 0.4267556965351105 + <_> + + <_> + + + + <_>9 7 3 3 -1. + <_>10 7 1 3 3. + 0 + 2.6589010376483202e-003 + 0.4688124954700470 + 1 + <_> + + + + <_>10 3 2 6 -1. + <_>11 3 1 3 2. + <_>10 6 1 3 2. + 0 + 4.8598358407616615e-003 + 0.4853922128677368 + 0.6163644790649414 + <_> + + <_> + + + + <_>0 4 3 3 -1. + <_>0 5 3 1 3. + 0 + 8.0638676881790161e-003 + 1 + 0.1749195009469986 + <_> + + + + <_>3 16 8 4 -1. + <_>3 16 4 2 2. + <_>7 18 4 2 2. + 0 + -7.5898370705544949e-003 + 0.6826189756393433 + 0.4894070029258728 + <_> + + <_> + + + + <_>8 13 5 2 -1. + <_>8 14 5 1 2. + 0 + 3.6368070868775249e-004 + 0.4614596068859100 + 1 + <_> + + + + <_>8 7 4 12 -1. + <_>8 11 4 4 3. + 0 + 0.0625949501991272 + 0.5183017253875732 + 0.2686696052551270 + <_> + + <_> + + + + <_>5 9 2 2 -1. + <_>6 9 1 2 2. + 0 + -4.9753207713365555e-003 + 0.1758466958999634 + 1 + <_> + + + + <_>9 15 2 3 -1. + <_>9 16 2 1 3. + 0 + -2.0880119409412146e-003 + 0.6369382143020630 + 0.4930044114589691 + <_> + + <_> + + + + <_>13 9 2 3 -1. + <_>13 9 1 3 2. + 0 + 9.5644511748105288e-004 + 1 + 0.4139398932456970 + <_> + + + + <_>14 0 6 17 -1. + <_>16 0 2 17 3. + 0 + -0.0317214615643024 + 0.6045557260513306 + 0.4816364049911499 + <_> + + <_> + + + + <_>5 10 2 2 -1. + <_>6 10 1 2 2. + 0 + 1.2898689601570368e-003 + 0.5450810790061951 + 1 + <_> + + + + <_>2 9 9 1 -1. + <_>5 9 3 1 3. + 0 + 9.8405163735151291e-003 + 0.2924000918865204 + 0.6699606180191040 + <_> + + <_> + + + + <_>9 11 2 3 -1. + <_>9 12 2 1 3. + 0 + 1.2237089686095715e-003 + 1 + 0.6282836794853210 + <_> + + + + <_>7 11 6 3 -1. + <_>7 12 6 1 3. + 0 + -8.4232585504651070e-003 + 0.5986570119857788 + 0.4852580130100250 + <_> + + <_> + + + + <_>0 6 3 2 -1. + <_>0 7 3 1 2. + 0 + -7.2726322105154395e-004 + 0.3340049088001251 + 1 + <_> + + + + <_>7 0 6 1 -1. + <_>9 0 2 1 3. + 0 + 4.6842931769788265e-003 + 0.5168923735618591 + 0.2679480016231537 + <_> + + <_> + + + + <_>9 16 3 3 -1. + <_>9 17 3 1 3. + 0 + -1.0379579616710544e-003 + 0.5925791859626770 + 1 + <_> + + + + <_>2 13 17 6 -1. + <_>2 16 17 3 2. + 0 + 9.1342730447649956e-003 + 0.5437728166580200 + 0.4346800148487091 + <_> + + <_> + + + + <_>1 3 3 7 -1. + <_>2 3 1 7 3. + 0 + 1.4971119817346334e-003 + 0.4129500985145569 + 1 + <_> + + + + <_>1 1 6 4 -1. + <_>3 1 2 4 3. + 0 + 1.5762320253998041e-003 + 0.4522874057292938 + 0.6556292176246643 + <_> + + <_> + + + + <_>14 1 6 5 -1. + <_>14 1 3 5 2. + 0 + 8.7496247142553329e-003 + 0.4532034099102020 + 1 + <_> + + + + <_>13 2 3 2 -1. + <_>13 3 3 1 2. + 0 + -8.5103599121794105e-004 + 0.3785983920097351 + 0.5416975021362305 + <_> + + <_> + + + + <_>0 1 6 5 -1. + <_>3 1 3 5 2. + 0 + -0.0173255708068609 + 0.6884248256683350 + 1 + <_> + + + + <_>2 3 2 6 -1. + <_>2 5 2 2 3. + 0 + -8.3266440778970718e-003 + 0.3091326057910919 + 0.5243654847145081 + <_> + + <_> + + + + <_>9 10 3 2 -1. + <_>9 11 3 1 2. + 0 + 1.5157909729168750e-005 + 0.4765793979167938 + 1 + <_> + + + + <_>8 13 4 3 -1. + <_>8 14 4 1 3. + 0 + 1.8041470320895314e-003 + 0.4725385904312134 + 0.5716555118560791 + <_> + + <_> + + + + <_>6 3 3 1 -1. + <_>7 3 1 1 3. + 0 + 3.0691560823470354e-003 + 1 + 0.2143359929323196 + <_> + + + + <_>8 2 3 12 -1. + <_>8 6 3 4 3. + 0 + -5.2225510444259271e-005 + 0.5653210282325745 + 0.4385111033916473 + <_> + + <_> + + + + <_>11 12 1 2 -1. + <_>11 13 1 1 2. + 0 + 1.0072169970953837e-004 + 1 + 0.5924776196479797 + <_> + + + + <_>11 12 2 2 -1. + <_>12 12 1 1 2. + <_>11 13 1 1 2. + 0 + 1.3573700562119484e-004 + 0.4573448896408081 + 0.5769382715225220 + <_> + + <_> + + + + <_>5 5 2 2 -1. + <_>5 6 2 1 2. + 0 + 9.2137878527864814e-004 + 1 + 0.5992609262466431 + <_> + + + + <_>5 4 1 3 -1. + <_>5 5 1 1 3. + 0 + 3.0316581251099706e-004 + 0.3610081076622009 + 0.5049325823783875 + <_> + + <_> + + + + <_>3 11 16 4 -1. + <_>11 11 8 2 2. + <_>3 13 8 2 2. + 0 + 0.0395824797451496 + 1 + 0.1538489013910294 + <_> + + + + <_>0 10 20 3 -1. + <_>0 11 20 1 3. + 0 + 0.0475196801126003 + 0.5216140747070313 + 0.1428391039371491 + <_> + + <_> + + + + <_>1 11 16 4 -1. + <_>1 11 8 2 2. + <_>9 13 8 2 2. + 0 + 0.0188717599958181 + 1 + 0.2825506925582886 + <_> + + + + <_>4 2 4 2 -1. + <_>4 3 4 1 2. + 0 + -3.9876459049992263e-004 + 0.4035016894340515 + 0.5437793135643005 + <_> + + <_> + + + + <_>12 6 2 2 -1. + <_>13 6 1 1 2. + <_>12 7 1 1 2. + 0 + 4.6556600136682391e-004 + 0.4668996930122376 + 1 + <_> + + + + <_>12 11 6 6 -1. + <_>12 13 6 2 3. + 0 + 6.7090610973536968e-003 + 0.5331354737281799 + 0.4136571884155273 + <_> + + <_> + + + + <_>6 6 2 2 -1. + <_>6 6 1 1 2. + <_>7 7 1 1 2. + 0 + -1.8931160448119044e-003 + 0.7155163288116455 + 1 + <_> + + + + <_>6 4 4 16 -1. + <_>8 4 2 16 2. + 0 + -0.0130569497123361 + 0.3117899894714356 + 0.5208439826965332 + <_> + + <_> + + + + <_>11 18 3 2 -1. + <_>11 19 3 1 2. + 0 + -1.9484119547996670e-004 + 1 + 0.4637658894062042 + <_> + + + + <_>9 17 6 2 -1. + <_>12 17 3 1 2. + <_>9 18 3 1 2. + 0 + 1.5093220099515747e-005 + 0.4561653137207031 + 0.5445234179496765 + <_> + + <_> + + + + <_>2 13 5 2 -1. + <_>2 14 5 1 2. + 0 + -7.1617960202274844e-006 + 1 + 0.4193108081817627 + <_> + + + + <_>3 15 2 2 -1. + <_>3 16 2 1 2. + 0 + 3.0164679628796875e-004 + 0.5966237783432007 + 0.4100500047206879 + <_> + + <_> + + + + <_>9 7 3 3 -1. + <_>10 7 1 3 3. + 0 + 4.4195181690156460e-003 + 0.4845055937767029 + 1 + <_> + + + + <_>9 6 2 6 -1. + <_>9 6 1 6 2. + 0 + -7.3984181508421898e-003 + 0.6206846237182617 + 0.4931209087371826 + <_> + + <_> + + + + <_>1 14 7 6 -1. + <_>1 16 7 2 3. + 0 + -7.8031201846897602e-003 + 1 + 0.5282462835311890 + <_> + + + + <_>8 1 2 11 -1. + <_>9 1 1 11 2. + 0 + -0.0107314297929406 + 0.9104834198951721 + 0.3455922007560730 + <_> + + <_> + + + + <_>9 7 2 4 -1. + <_>9 7 1 4 2. + 0 + 1.4246780192479491e-003 + 0.4708554148674011 + 1 + <_> + + + + <_>11 10 2 1 -1. + <_>11 10 1 1 2. + 0 + -8.2717568147927523e-005 + 0.5651623010635376 + 0.4731023907661438 + <_> + + <_> + + + + <_>0 3 3 9 -1. + <_>1 3 1 9 3. + 0 + 4.4803409837186337e-003 + 1 + 0.6175886988639832 + <_> + + + + <_>0 3 3 6 -1. + <_>0 5 3 2 3. + 0 + 3.0789140146225691e-003 + 0.5139533281326294 + 0.3423087894916534 + <_> + + <_> + + + + <_>11 15 2 2 -1. + <_>12 15 1 1 2. + <_>11 16 1 1 2. + 0 + -1.1310289846733212e-003 + 1 + 0.4918282032012940 + <_> + + + + <_>11 14 2 2 -1. + <_>12 14 1 1 2. + <_>11 15 1 1 2. + 0 + -1.0410690447315574e-003 + 0.5942087173461914 + 0.4923042953014374 + <_> + + <_> + + + + <_>7 15 2 2 -1. + <_>7 15 1 1 2. + <_>8 16 1 1 2. + 0 + 1.1648540385067463e-003 + 1 + 0.6405271887779236 + <_> + + + + <_>7 14 2 2 -1. + <_>7 14 1 1 2. + <_>8 15 1 1 2. + 0 + 9.0057362103834748e-004 + 0.4504396915435791 + 0.6192076802253723 + <_> + + <_> + + + + <_>8 13 4 6 -1. + <_>10 13 2 3 2. + <_>8 16 2 3 2. + 0 + 6.8781538866460323e-003 + 0.5374813079833984 + 1 + <_> + + + + <_>2 14 16 4 -1. + <_>10 14 8 2 2. + <_>2 16 8 2 2. + 0 + -0.0352839007973671 + 0.2247101068496704 + 0.5217170715332031 + <_> + + <_> + + + + <_>9 8 2 2 -1. + <_>9 9 2 1 2. + 0 + -1.3320200378075242e-003 + 0.2554703056812286 + 1 + <_> + + + + <_>7 7 5 3 -1. + <_>7 8 5 1 3. + 0 + -2.3177571129053831e-003 + 0.3792515993118286 + 0.5243226885795593 + <_> + + <_> + + + + <_>7 5 6 2 -1. + <_>9 5 2 2 3. + 0 + 2.1332940377760679e-004 + 0.3860337138175964 + 1 + <_> + + + + <_>9 1 6 18 -1. + <_>11 1 2 18 3. + 0 + 0.0134679004549980 + 0.5380687713623047 + 0.4178363978862763 + <_> + + <_> + + + + <_>8 6 3 4 -1. + <_>9 6 1 4 3. + 0 + -1.2829169863834977e-003 + 0.6133623123168945 + 1 + <_> + + + + <_>8 5 2 4 -1. + <_>8 5 1 2 2. + <_>9 7 1 2 2. + 0 + 5.1571638323366642e-004 + 0.4028537869453430 + 0.5536851882934570 + <_> + + <_> + + + + <_>9 13 2 6 -1. + <_>10 13 1 3 2. + <_>9 16 1 3 2. + 0 + 3.9254198782145977e-003 + 0.5279921293258667 + 1 + <_> + + + + <_>11 0 3 18 -1. + <_>12 0 1 18 3. + 0 + -0.0337805896997452 + 0.2334675043821335 + 0.5175911784172058 + <_> + + <_> + + + + <_>6 0 3 18 -1. + <_>7 0 1 18 3. + 0 + -0.0378537215292454 + 0.1074853017926216 + 1 + <_> + + + + <_>5 15 4 2 -1. + <_>7 15 2 2 2. + 0 + -4.0752900531515479e-004 + 0.5345929861068726 + 0.4198938012123108 + <_> + + <_> + + + + <_>1 9 18 1 -1. + <_>7 9 6 1 3. + 0 + -3.1193809118121862e-003 + 0.3855825066566467 + 1 + <_> + + + + <_>0 0 20 3 -1. + <_>0 1 20 1 3. + 0 + -0.0157149694859982 + 0.3335190117359161 + 0.5263202190399170 + <_> + + <_> + + + + <_>9 6 2 4 -1. + <_>10 6 1 4 2. + 0 + -7.8525702701881528e-004 + 0.5860397219657898 + 1 + <_> + + + + <_>6 10 6 2 -1. + <_>8 10 2 2 3. + 0 + -2.8750501223839819e-004 + 0.5437784790992737 + 0.3716104924678803 + <_> + + <_> + + + + <_>0 7 20 1 -1. + <_>0 7 10 1 2. + 0 + 0.0280168596655130 + 1 + 0.3330754935741425 + <_> + + + + <_>11 3 5 4 -1. + <_>11 5 5 2 2. + 0 + -1.9018839811906219e-003 + 0.5366597771644592 + 0.4693793952465057 + <_> + + <_> + + + + <_>5 7 10 1 -1. + <_>10 7 5 1 2. + 0 + 0.0206475593149662 + 1 + 0.1006956025958061 + <_> + + + + <_>8 10 3 3 -1. + <_>8 11 3 1 3. + 0 + 4.3002571910619736e-003 + 0.4816035926342011 + 0.6215677261352539 + <_> + + <_> + + + + <_>2 0 16 8 -1. + <_>10 0 8 4 2. + <_>2 4 8 4 2. + 0 + 0.0134591404348612 + 0.5461953878402710 + 1 + <_> + + + + <_>11 0 9 10 -1. + <_>11 5 9 5 2. + 0 + -0.0103200403973460 + 0.4578453004360199 + 0.5419309735298157 + <_> + + <_> + + + + <_>0 2 8 18 -1. + <_>4 2 4 18 2. + 0 + 0.3199074864387512 + 1 + 0.2008046954870224 + <_> + + + + <_>0 0 2 6 -1. + <_>0 2 2 2 3. + 0 + 9.2198798665776849e-004 + 0.5193281173706055 + 0.3912194073200226 + <_> + + <_> + + + + <_>6 0 9 2 -1. + <_>6 1 9 1 2. + 0 + 4.1852539288811386e-004 + 0.4299744069576263 + 1 + <_> + + + + <_>4 1 12 2 -1. + <_>4 2 12 1 2. + 0 + 3.5891108564101160e-004 + 0.4344502985477448 + 0.5531973838806152 + <_> + + <_> + + + + <_>2 1 16 14 -1. + <_>2 8 16 7 2. + 0 + -0.2099243998527527 + 0.1075721010565758 + 1 + <_> + + + + <_>5 1 8 12 -1. + <_>5 7 8 6 2. + 0 + -4.9328152090311050e-003 + 0.5762796998023987 + 0.4574643969535828 + <_> + + <_> + + + + <_>9 11 2 2 -1. + <_>9 12 2 1 2. + 0 + 2.3409130517393351e-003 + 1 + 0.7476807832717896 + <_> + + + + <_>9 10 5 6 -1. + <_>9 12 5 2 3. + 0 + 4.7120270319283009e-003 + 0.5261765122413635 + 0.4505550861358643 + <_> + + <_> + + + + <_>3 0 13 8 -1. + <_>3 4 13 4 2. + 0 + 0.0287131909281015 + 0.4407103061676025 + 1 + <_> + + + + <_>6 7 5 8 -1. + <_>6 11 5 4 2. + 0 + -2.6156550738960505e-003 + 0.4244270920753479 + 0.6892976760864258 + <_> + + <_> + + + + <_>9 5 2 3 -1. + <_>9 6 2 1 3. + 0 + -0.0135589698329568 + 0.1252267956733704 + 1 + <_> + + + + <_>6 8 8 3 -1. + <_>6 9 8 1 3. + 0 + -3.0331799644045532e-004 + 0.4077791869640350 + 0.5442817807197571 + <_> + + <_> + + + + <_>2 2 7 6 -1. + <_>2 5 7 3 2. + 0 + -5.5601762142032385e-004 + 0.5378003716468811 + 1 + <_> + + + + <_>2 1 14 4 -1. + <_>2 1 7 2 2. + <_>9 3 7 2 2. + 0 + 2.4025330785661936e-003 + 0.3166579902172089 + 0.5285738110542297 + <_> + + <_> + + + + <_>11 14 1 3 -1. + <_>11 15 1 1 3. + 0 + -3.4089901018887758e-003 + 1 + 0.4905214905738831 + <_> + + + + <_>6 15 8 2 -1. + <_>6 16 8 1 2. + 0 + 8.0019602319225669e-004 + 0.4522736072540283 + 0.5580614209175110 + <_> + + <_> + + + + <_>8 14 1 3 -1. + <_>8 15 1 1 3. + 0 + 2.1901070140302181e-003 + 1 + 0.6612681746482849 + <_> + + + + <_>8 11 2 8 -1. + <_>8 15 2 4 2. + 0 + 3.3745369873940945e-003 + 0.5107765197753906 + 0.3386929929256439 + <_> + + <_> + + + + <_>6 15 8 2 -1. + <_>6 16 8 1 2. + 0 + 8.0019602319225669e-004 + 1 + 0.5707560181617737 + <_> + + + + <_>7 16 8 3 -1. + <_>7 17 8 1 3. + 0 + 0.0173460692167282 + 0.5016021132469177 + 0.6306459903717041 + <_> + + <_> + + + + <_>0 16 2 2 -1. + <_>0 17 2 1 2. + 0 + -1.9568449351936579e-003 + 0.3017806112766266 + 1 + <_> + + + + <_>1 16 8 4 -1. + <_>1 16 4 2 2. + <_>5 18 4 2 2. + 0 + -0.0112290196120739 + 0.6293851137161255 + 0.4520488977432251 + <_> + + <_> + + + + <_>2 9 16 3 -1. + <_>2 10 16 1 3. + 0 + -2.6608388870954514e-003 + 0.3344007134437561 + 1 + <_> + + + + <_>13 11 2 4 -1. + <_>13 11 1 4 2. + 0 + -0.0116151003167033 + 0.2825379073619843 + 0.5150970816612244 + <_> + + <_> + + + + <_>0 13 16 6 -1. + <_>0 15 16 2 3. + 0 + -0.0952486023306847 + 0.1398265063762665 + 1 + <_> + + + + <_>5 11 2 4 -1. + <_>6 11 1 4 2. + 0 + 7.3701781220734119e-003 + 0.5293998718261719 + 0.2331728041172028 + <_> + + <_> + + + + <_>18 2 2 18 -1. + <_>19 2 1 9 2. + <_>18 11 1 9 2. + 0 + -0.0149539001286030 + 1 + 0.4940465986728668 + <_> + + + + <_>19 7 1 9 -1. + <_>19 10 1 3 3. + 0 + 5.7038792874664068e-004 + 0.5466570854187012 + 0.4626767933368683 + <_> + + <_> + + + + <_>0 2 2 18 -1. + <_>0 2 1 9 2. + <_>1 11 1 9 2. + 0 + 5.8516198769211769e-003 + 1 + 0.6270040869712830 + <_> + + + + <_>0 7 1 9 -1. + <_>0 10 1 3 3. + 0 + 2.1150549582671374e-004 + 0.5508140921592712 + 0.4061872959136963 + <_> + + <_> + + + + <_>14 12 2 2 -1. + <_>14 13 2 1 2. + 0 + -6.9679190346505493e-006 + 1 + 0.4096567928791046 + <_> + + + + <_>11 14 2 3 -1. + <_>11 15 2 1 3. + 0 + -7.9677387839183211e-004 + 0.5615556836128235 + 0.4666886031627655 + <_> + + <_> + + + + <_>7 8 6 2 -1. + <_>7 9 6 1 2. + 0 + 0.0194594804197550 + 1 + 0.2311480939388275 + <_> + + + + <_>7 12 4 6 -1. + <_>7 12 2 3 2. + <_>9 15 2 3 2. + 0 + -0.0111608300358057 + 0.3087011873722076 + 0.5514662265777588 + <_> + + <_> + + + + <_>8 13 5 3 -1. + <_>8 14 5 1 3. + 0 + 0.0140561498701572 + 1 + 0.7005056142807007 + <_> + + + + <_>12 14 2 2 -1. + <_>13 14 1 1 2. + <_>12 15 1 1 2. + 0 + -3.2958350493572652e-004 + 0.5797485709190369 + 0.4691650867462158 + <_> + + <_> + + + + <_>7 13 6 3 -1. + <_>7 14 6 1 3. + 0 + -5.4636420682072639e-003 + 0.5928595066070557 + 1 + <_> + + + + <_>7 13 5 2 -1. + <_>7 14 5 1 2. + 0 + 5.8881669247057289e-005 + 0.3741397857666016 + 0.5170168876647949 + <_> + + <_> + + + + <_>2 10 16 4 -1. + <_>10 10 8 2 2. + <_>2 12 8 2 2. + 0 + 6.6343429498374462e-003 + 0.5414987802505493 + 1 + <_> + + + + <_>7 0 6 6 -1. + <_>9 0 2 6 3. + 0 + 0.0452634096145630 + 0.5180327296257019 + 0.1529684066772461 + <_> + + <_> + + + + <_>7 1 6 3 -1. + <_>7 2 6 1 3. + 0 + -8.0646127462387085e-003 + 0.2515468001365662 + 1 + <_> + + + + <_>0 12 6 2 -1. + <_>0 13 6 1 2. + 0 + 4.7389548853971064e-004 + 0.5121998786926270 + 0.3725948929786682 + <_> + + <_> + + + + <_>6 3 11 2 -1. + <_>6 4 11 1 2. + 0 + 1.4877359717502259e-005 + 1 + 0.5532435774803162 + <_> + + + + <_>12 0 8 6 -1. + <_>16 0 4 3 2. + <_>12 3 4 3 2. + 0 + 0.0243211593478918 + 0.4960766136646271 + 0.5983315110206604 + <_> + + <_> + + + + <_>8 12 1 2 -1. + <_>8 13 1 1 2. + 0 + 6.9931396865285933e-005 + 0.4163953065872192 + 1 + <_> + + + + <_>8 8 1 12 -1. + <_>8 12 1 4 3. + 0 + 2.6287760119885206e-003 + 0.5880144834518433 + 0.3399662971496582 + <_> + + <_> + + + + <_>11 11 2 2 -1. + <_>12 11 1 1 2. + <_>11 12 1 1 2. + 0 + 3.8190539926290512e-003 + 1 + 0.7846621274948120 + <_> + + + + <_>12 7 3 13 -1. + <_>13 7 1 13 3. + 0 + -0.0259891506284475 + 0.3288114070892334 + 0.5155087709426880 + <_> + + <_> + + + + <_>7 11 2 2 -1. + <_>7 11 1 1 2. + <_>8 12 1 1 2. + 0 + 1.2062400346621871e-003 + 0.4596059918403626 + 1 + <_> + + + + <_>3 13 1 3 -1. + <_>3 14 1 1 3. + 0 + -1.5557400183752179e-003 + 0.3126986920833588 + 0.7183399200439453 + <_> + + <_> + + + + <_>10 18 3 2 -1. + <_>11 18 1 2 3. + 0 + -2.2691930644214153e-003 + 1 + 0.5274006128311157 + <_> + + + + <_>11 11 2 1 -1. + <_>11 11 1 1 2. + 0 + 2.3287249496206641e-004 + 0.4878666102886200 + 0.5615152716636658 + <_> + + <_> + + + + <_>1 10 5 9 -1. + <_>1 13 5 3 3. + 0 + -5.5999699980020523e-003 + 1 + 0.5160812139511108 + <_> + + + + <_>4 8 6 4 -1. + <_>6 8 2 4 3. + 0 + -0.0104961898177862 + 0.5701614022254944 + 0.3204850852489471 + <_> + + <_> + + + + <_>13 12 1 4 -1. + <_>13 14 1 2 2. + 0 + -1.4814930182183161e-005 + 0.5538837909698486 + 1 + <_> + + + + <_>11 3 4 14 -1. + <_>13 3 2 7 2. + <_>11 10 2 7 2. + 0 + -6.4287078566849232e-004 + 0.5349429249763489 + 0.4472151100635529 + <_> + + <_> + + + + <_>6 12 1 4 -1. + <_>6 14 1 2 2. + 0 + -1.8891949730459601e-004 + 0.5012837052345276 + 1 + <_> + + + + <_>5 3 4 14 -1. + <_>5 3 2 7 2. + <_>7 10 2 7 2. + 0 + -9.0413521975278854e-003 + 0.2562935948371887 + 0.4503383040428162 + <_> + + <_> + + + + <_>10 18 3 2 -1. + <_>11 18 1 2 3. + 0 + 7.9534705728292465e-003 + 1 + 0.2630499899387360 + <_> + + + + <_>9 12 3 3 -1. + <_>9 13 3 1 3. + 0 + -2.7908999472856522e-003 + 0.5756508708000183 + 0.4854863882064819 + <_> + + <_> + + + + <_>2 2 12 6 -1. + <_>2 2 6 3 2. + <_>8 5 6 3 2. + 0 + 3.2857100013643503e-003 + 1 + 0.4084751904010773 + <_> + + + + <_>6 6 6 2 -1. + <_>9 6 3 2 2. + 0 + 7.7063008211553097e-004 + 0.4073356091976166 + 0.5920240879058838 + 44.6829681396484380 + 15 + -1 + <_> + + + <_> + + <_> + + + + <_>1 0 18 12 -1. + <_>7 0 6 12 3. + 0 + 0.0630219429731369 + 0.3419382870197296 + 1 + <_> + + + + <_>5 7 6 4 -1. + <_>5 7 3 2 2. + <_>8 9 3 2 2. + 0 + -2.8374609537422657e-003 + 0.6829563975334168 + 0.4404523074626923 + <_> + + <_> + + + + <_>5 7 10 4 -1. + <_>5 9 10 2 2. + 0 + 0.0464619509875774 + 0.4391745030879974 + 1 + <_> + + + + <_>7 7 6 4 -1. + <_>9 7 2 4 3. + 0 + 0.0291525404900312 + 0.4601063132286072 + 0.6357936859130859 + <_> + + <_> + + + + <_>9 5 2 2 -1. + <_>9 6 2 1 2. + 0 + -1.4000290320836939e-005 + 1 + 0.3730010092258453 + <_> + + + + <_>9 9 2 2 -1. + <_>9 10 2 1 2. + 0 + -1.2757079675793648e-003 + 0.3093824088573456 + 0.5901370048522949 + <_> + + <_> + + + + <_>6 17 8 3 -1. + <_>6 18 8 1 3. + 0 + 1.3596529606729746e-003 + 0.4337565004825592 + 1 + <_> + + + + <_>9 17 6 2 -1. + <_>12 17 3 1 2. + <_>9 18 3 1 2. + 0 + 1.7991929780691862e-004 + 0.4217503964900971 + 0.5846847891807556 + <_> + + <_> + + + + <_>4 12 2 2 -1. + <_>4 13 2 1 2. + 0 + -1.4166639630275313e-005 + 1 + 0.4084691107273102 + <_> + + + + <_>3 12 9 2 -1. + <_>3 13 9 1 2. + 0 + 6.0252390539972112e-005 + 0.5087286829948425 + 0.7277184128761292 + <_> + + <_> + + + + <_>8 3 6 1 -1. + <_>10 3 2 1 3. + 0 + 6.4320368692278862e-003 + 1 + 0.2967903017997742 + <_> + + + + <_>9 3 4 6 -1. + <_>11 3 2 3 2. + <_>9 6 2 3 2. + 0 + 4.6682319953106344e-004 + 0.4110462963581085 + 0.5581219792366028 + <_> + + <_> + + + + <_>0 3 6 5 -1. + <_>3 3 3 5 2. + 0 + 5.7436279021203518e-003 + 0.4287309944629669 + 1 + <_> + + + + <_>2 0 2 18 -1. + <_>2 6 2 6 3. + 0 + 3.2019240316003561e-003 + 0.4266195893287659 + 0.6444045901298523 + <_> + + <_> + + + + <_>14 2 4 9 -1. + <_>14 5 4 3 3. + 0 + -5.7637941790744662e-004 + 1 + 0.4084824919700623 + <_> + + + + <_>10 18 3 2 -1. + <_>11 18 1 2 3. + 0 + -3.7901920732110739e-003 + 0.3181920945644379 + 0.5230693221092224 + <_> + + <_> + + + + <_>2 2 4 9 -1. + <_>2 5 4 3 3. + 0 + 4.8914109356701374e-003 + 1 + 0.3548356890678406 + <_> + + + + <_>7 18 3 2 -1. + <_>8 18 1 2 3. + 0 + 4.6459292061626911e-003 + 0.5610597729682922 + 0.2693848907947540 + <_> + + <_> + + + + <_>10 14 3 3 -1. + <_>10 15 3 1 3. + 0 + -6.8799369037151337e-003 + 0.6235408186912537 + 1 + <_> + + + + <_>10 12 2 6 -1. + <_>10 15 2 3 2. + 0 + -0.0181474704295397 + 0.2861981987953186 + 0.5226848125457764 + <_> + + <_> + + + + <_>7 5 3 6 -1. + <_>7 7 3 2 3. + 0 + 1.1409220314817503e-004 + 1 + 0.3257833123207092 + <_> + + + + <_>3 3 6 2 -1. + <_>3 4 6 1 2. + 0 + -5.4334272863343358e-004 + 0.3882969021797180 + 0.5341166257858276 + <_> + + <_> + + + + <_>8 4 7 3 -1. + <_>8 5 7 1 3. + 0 + -2.7602489572018385e-003 + 0.6353965997695923 + 1 + <_> + + + + <_>13 6 2 3 -1. + <_>13 7 2 1 3. + 0 + -1.9730569329112768e-003 + 0.5880761146545410 + 0.4593090116977692 + <_> + + <_> + + + + <_>8 8 2 12 -1. + <_>8 12 2 4 3. + 0 + 2.4565239436924458e-003 + 1 + 0.3134010136127472 + <_> + + + + <_>5 4 8 14 -1. + <_>5 4 4 7 2. + <_>9 11 4 7 2. + 0 + 1.9392010290175676e-004 + 0.5277131795883179 + 0.3604106903076172 + <_> + + <_> + + + + <_>0 1 20 8 -1. + <_>10 1 10 4 2. + <_>0 5 10 4 2. + 0 + 0.0786430165171623 + 0.5290341973304749 + 1 + <_> + + + + <_>4 0 12 2 -1. + <_>4 1 12 1 2. + 0 + 6.5276869572699070e-003 + 0.4654479920864105 + 0.6044905185699463 + <_> + + <_> + + + + <_>0 1 20 8 -1. + <_>0 1 10 4 2. + <_>10 5 10 4 2. + 0 + -0.0787167996168137 + 0.2541126906871796 + 1 + <_> + + + + <_>4 0 12 2 -1. + <_>4 1 12 1 2. + 0 + 5.7298499159514904e-003 + 0.4366919100284576 + 0.5822886228561401 + <_> + + <_> + + + + <_>9 5 6 3 -1. + <_>9 5 3 3 2. + 0 + 6.2386557692661881e-004 + 1 + 0.5472692251205444 + <_> + + + + <_>8 13 10 6 -1. + <_>8 15 10 2 3. + 0 + -0.0852672308683395 + 0.1461607962846756 + 0.5181810855865479 + <_> + + <_> + + + + <_>5 5 6 3 -1. + <_>8 5 3 3 2. + 0 + 0.0409811101853848 + 1 + 0.1270135045051575 + <_> + + + + <_>6 3 6 1 -1. + <_>8 3 2 1 3. + 0 + 7.7135749161243439e-003 + 0.4832684993743897 + 0.2223578989505768 + <_> + + <_> + + + + <_>11 18 9 2 -1. + <_>14 18 3 2 3. + 0 + -6.8663940764963627e-003 + 0.5918928980827332 + 1 + <_> + + + + <_>13 11 6 7 -1. + <_>13 11 3 7 2. + 0 + 0.0145596396178007 + 0.4761506915092468 + 0.5727223753929138 + <_> + + <_> + + + + <_>4 6 12 10 -1. + <_>4 6 6 5 2. + <_>10 11 6 5 2. + 0 + -0.0100643103942275 + 0.3636730909347534 + 1 + <_> + + + + <_>8 17 3 3 -1. + <_>9 17 1 3 3. + 0 + 3.6274080630391836e-003 + 0.5271731019020081 + 0.2740525007247925 + <_> + + <_> + + + + <_>11 18 9 2 -1. + <_>14 18 3 2 3. + 0 + -2.3421540390700102e-003 + 0.5497784018516541 + 1 + <_> + + + + <_>13 11 6 8 -1. + <_>13 11 3 8 2. + 0 + -0.0246864091604948 + 0.6059895157814026 + 0.4960314035415649 + <_> + + <_> + + + + <_>4 16 2 2 -1. + <_>4 17 2 1 2. + 0 + 1.9456120207905769e-004 + 1 + 0.3769465088844299 + <_> + + + + <_>7 15 4 4 -1. + <_>7 17 4 2 2. + 0 + 3.1714211218059063e-004 + 0.4062362015247345 + 0.5668215155601502 + <_> + + <_> + + + + <_>12 4 3 3 -1. + <_>12 5 3 1 3. + 0 + 2.0793990697711706e-003 + 0.4618656933307648 + 1 + <_> + + + + <_>13 6 2 3 -1. + <_>13 7 2 1 3. + 0 + 1.7982709687203169e-003 + 0.4867505133152008 + 0.6518449783325195 + <_> + + <_> + + + + <_>5 11 6 1 -1. + <_>7 11 2 1 3. + 0 + -2.2287059982772917e-004 + 0.5677595734596252 + 1 + <_> + + + + <_>7 10 3 1 -1. + <_>8 10 1 1 3. + 0 + 3.2623921288177371e-004 + 0.3710733950138092 + 0.5676605105400085 + <_> + + <_> + + + + <_>0 12 20 4 -1. + <_>0 14 20 2 2. + 0 + -0.0667926818132401 + 0.2511521875858307 + 1 + <_> + + + + <_>10 2 3 2 -1. + <_>10 3 3 1 2. + 0 + -1.4869889710098505e-003 + 0.3886750936508179 + 0.5262253880500794 + <_> + + <_> + + + + <_>5 4 3 3 -1. + <_>5 5 3 1 3. + 0 + -5.0454870797693729e-003 + 0.6557472944259644 + 1 + <_> + + + + <_>5 5 4 3 -1. + <_>5 6 4 1 3. + 0 + -4.8297587782144547e-003 + 0.5934106111526489 + 0.4285922050476074 + <_> + + <_> + + + + <_>8 8 4 3 -1. + <_>8 9 4 1 3. + 0 + -1.0722599690780044e-003 + 1 + 0.5426058769226074 + <_> + + + + <_>10 4 2 12 -1. + <_>10 8 2 4 3. + 0 + 8.7901195511221886e-003 + 0.5351303219795227 + 0.4834277927875519 + <_> + + <_> + + + + <_>0 3 4 3 -1. + <_>0 4 4 1 3. + 0 + -7.1750381030142307e-003 + 0.2067168951034546 + 1 + <_> + + + + <_>1 3 2 3 -1. + <_>1 4 2 1 3. + 0 + 1.1251230025663972e-003 + 0.5112252235412598 + 0.3468714058399200 + <_> + + <_> + + + + <_>16 1 4 11 -1. + <_>16 1 2 11 2. + 0 + 0.0106347100809217 + 0.4479008018970490 + 1 + <_> + + + + <_>18 2 2 16 -1. + <_>19 2 1 8 2. + <_>18 10 1 8 2. + 0 + -0.0117632197216153 + 0.6253901720046997 + 0.4968987107276917 + <_> + + <_> + + + + <_>1 8 6 12 -1. + <_>3 8 2 12 3. + 0 + 0.0923240631818771 + 1 + 0.2031303942203522 + <_> + + + + <_>7 2 6 2 -1. + <_>7 2 3 1 2. + <_>10 3 3 1 2. + 0 + 1.8991080578416586e-003 + 0.5618721842765808 + 0.4046572148799896 + <_> + + <_> + + + + <_>12 4 8 2 -1. + <_>16 4 4 1 2. + <_>12 5 4 1 2. + 0 + -0.0105103403329849 + 1 + 0.4943264126777649 + <_> + + + + <_>10 6 6 2 -1. + <_>12 6 2 2 3. + 0 + -7.4531312566250563e-004 + 0.5613427758216858 + 0.3845331966876984 + <_> + + <_> + + + + <_>0 4 8 2 -1. + <_>0 4 4 1 2. + <_>4 5 4 1 2. + 0 + 8.0041000619530678e-003 + 1 + 0.7759842276573181 + <_> + + + + <_>1 3 3 5 -1. + <_>2 3 1 5 3. + 0 + 5.8110528625547886e-003 + 0.4624733030796051 + 0.6286277174949646 + <_> + + <_> + + + + <_>16 3 4 6 -1. + <_>16 5 4 2 3. + 0 + -0.0279185809195042 + 0.2409314066171646 + 1 + <_> + + + + <_>8 6 4 3 -1. + <_>8 7 4 1 3. + 0 + 2.1739399526268244e-003 + 0.5345504879951477 + 0.3507958054542542 + <_> + + <_> + + + + <_>8 14 1 3 -1. + <_>8 15 1 1 3. + 0 + -4.0639587678015232e-003 + 0.6647101044654846 + 1 + <_> + + + + <_>4 11 1 2 -1. + <_>4 12 1 1 2. + 0 + 6.0017139185220003e-004 + 0.4998509883880615 + 0.3022165000438690 + <_> + + <_> + + + + <_>8 14 6 3 -1. + <_>8 15 6 1 3. + 0 + 1.9214770291000605e-003 + 1 + 0.5919150710105896 + <_> + + + + <_>7 15 7 3 -1. + <_>7 16 7 1 3. + 0 + -0.0138608301058412 + 0.6351767778396606 + 0.4993310868740082 + <_> + + <_> + + + + <_>9 12 2 8 -1. + <_>9 16 2 4 2. + 0 + 0.0230068508535624 + 1 + 0.1902336031198502 + <_> + + + + <_>4 6 6 2 -1. + <_>6 6 2 2 3. + 0 + -1.3857929734513164e-003 + 0.5253369212150574 + 0.3985860049724579 + <_> + + <_> + + + + <_>12 7 4 2 -1. + <_>12 8 4 1 2. + 0 + 1.2637410545721650e-003 + 0.4666104018688202 + 1 + <_> + + + + <_>5 3 13 10 -1. + <_>5 8 13 5 2. + 0 + -0.0146752102300525 + 0.3823164999485016 + 0.5326632857322693 + <_> + + <_> + + + + <_>4 7 4 2 -1. + <_>4 8 4 1 2. + 0 + -2.9535070061683655e-003 + 0.7063655853271484 + 1 + <_> + + + + <_>0 8 16 2 -1. + <_>0 8 8 1 2. + <_>8 9 8 1 2. + 0 + -1.7189770005643368e-003 + 0.3813462853431702 + 0.5246735215187073 + <_> + + <_> + + + + <_>11 8 2 5 -1. + <_>11 8 1 5 2. + 0 + -4.2484089499339461e-004 + 1 + 0.4791638851165772 + <_> + + + + <_>10 0 6 13 -1. + <_>10 0 3 13 2. + 0 + -8.5248658433556557e-004 + 0.4491218030452728 + 0.5370901226997376 + <_> + + <_> + + + + <_>1 6 4 2 -1. + <_>1 7 4 1 2. + 0 + 8.9034568518400192e-003 + 1 + 0.2076473981142044 + <_> + + + + <_>4 3 2 1 -1. + <_>5 3 1 1 2. + 0 + 1.4895649655954912e-005 + 0.4447635114192963 + 0.5667163133621216 + <_> + + <_> + + + + <_>11 8 2 5 -1. + <_>11 8 1 5 2. + 0 + -4.7091601300053298e-004 + 0.5465071201324463 + 1 + <_> + + + + <_>12 10 4 8 -1. + <_>12 10 2 8 2. + 0 + 4.3084810022264719e-004 + 0.5493261814117432 + 0.4580708146095276 + <_> + + <_> + + + + <_>7 8 2 5 -1. + <_>8 8 1 5 2. + 0 + -6.3893961487337947e-004 + 0.5501571893692017 + 1 + <_> + + + + <_>4 10 4 8 -1. + <_>6 10 2 8 2. + 0 + -7.3733746830839664e-005 + 0.5085790753364563 + 0.3305698037147522 + <_> + + <_> + + + + <_>6 7 9 12 -1. + <_>9 7 3 12 3. + 0 + -8.8991485536098480e-003 + 0.4276469051837921 + 1 + <_> + + + + <_>11 13 2 3 -1. + <_>11 13 1 3 2. + 0 + -0.0102533502504230 + 0.1123218014836311 + 0.5152723193168640 + <_> + + <_> + + + + <_>7 10 6 10 -1. + <_>10 10 3 10 2. + 0 + -0.0596374906599522 + 0.7386772036552429 + 1 + <_> + + + + <_>8 11 4 8 -1. + <_>8 11 2 4 2. + <_>10 15 2 4 2. + 0 + 0.0217071995139122 + 0.4996291995048523 + 0.1339413970708847 + <_> + + <_> + + + + <_>16 1 4 11 -1. + <_>16 1 2 11 2. + 0 + 9.9107045680284500e-003 + 0.4679012000560761 + 1 + <_> + + + + <_>18 2 2 4 -1. + <_>18 2 1 4 2. + 0 + -0.0109983002766967 + 0.6928656101226807 + 0.5012068152427673 + <_> + + <_> + + + + <_>5 6 6 2 -1. + <_>5 6 3 1 2. + <_>8 7 3 1 2. + 0 + 7.4608891736716032e-004 + 1 + 0.5833582282066345 + <_> + + + + <_>5 4 1 3 -1. + <_>5 5 1 1 3. + 0 + 2.9539171373471618e-004 + 0.3826391100883484 + 0.5566350817680359 + <_> + + <_> + + + + <_>11 1 4 14 -1. + <_>11 1 2 14 2. + 0 + 0.0500541292130947 + 1 + 0.3002721071243286 + <_> + + + + <_>4 2 12 3 -1. + <_>8 2 4 3 3. + 0 + -7.2330660186707973e-003 + 0.5908042788505554 + 0.5000870823860169 + <_> + + <_> + + + + <_>5 1 4 14 -1. + <_>7 1 2 14 2. + 0 + -2.6863380335271358e-003 + 0.3975034952163696 + 1 + <_> + + + + <_>7 3 6 2 -1. + <_>9 3 2 2 3. + 0 + -1.0195849463343620e-003 + 0.3697685897350311 + 0.5756192803382874 + <_> + + <_> + + + + <_>2 0 18 4 -1. + <_>8 0 6 4 3. + 0 + -0.0202049203217030 + 0.6375268101692200 + 1 + <_> + + + + <_>9 5 2 10 -1. + <_>9 10 2 5 2. + 0 + 2.1340379025787115e-003 + 0.5363265872001648 + 0.4433170855045319 + <_> + + <_> + + + + <_>8 6 3 4 -1. + <_>9 6 1 4 3. + 0 + -1.8348889425396919e-003 + 0.5828999280929565 + 1 + <_> + + + + <_>5 5 9 11 -1. + <_>8 5 3 11 3. + 0 + -5.9489468112587929e-003 + 0.2680670917034149 + 0.4642885923385620 + <_> + + <_> + + + + <_>10 6 3 5 -1. + <_>11 6 1 5 3. + 0 + -2.3030120064504445e-004 + 0.5475320219993591 + 1 + <_> + + + + <_>8 9 6 5 -1. + <_>8 9 3 5 2. + 0 + 5.0581009127199650e-003 + 0.5320833921432495 + 0.4646492898464203 + <_> + + <_> + + + + <_>7 6 3 5 -1. + <_>8 6 1 5 3. + 0 + -5.1950011402368546e-004 + 0.5232744812965393 + 1 + <_> + + + + <_>6 10 6 3 -1. + <_>9 10 3 3 2. + 0 + -6.8620947422459722e-004 + 0.4935086071491242 + 0.3103117942810059 + <_> + + <_> + + + + <_>10 0 3 7 -1. + <_>11 0 1 7 3. + 0 + -7.4936267919838428e-003 + 0.2883046865463257 + 1 + <_> + + + + <_>0 3 20 12 -1. + <_>0 9 20 6 2. + 0 + -0.0156829301267862 + 0.3640313148498535 + 0.5368754863739014 + <_> + + <_> + + + + <_>9 7 2 2 -1. + <_>10 7 1 2 2. + 0 + -3.2649750355631113e-003 + 0.6468631029129028 + 1 + <_> + + + + <_>5 9 4 1 -1. + <_>7 9 2 1 2. + 0 + 3.8463930832222104e-004 + 0.5259659886360169 + 0.3831427991390228 + <_> + + <_> + + + + <_>13 13 3 2 -1. + <_>13 14 3 1 2. + 0 + 4.4492390006780624e-003 + 1 + 0.2086818963289261 + <_> + + + + <_>16 9 4 6 -1. + <_>16 9 2 6 2. + 0 + 0.0231183208525181 + 0.4978533089160919 + 0.5961257219314575 + <_> + + <_> + + + + <_>7 15 6 3 -1. + <_>7 16 6 1 3. + 0 + 2.0835159812122583e-003 + 1 + 0.5746421813964844 + <_> + + + + <_>6 16 7 3 -1. + <_>6 17 7 1 3. + 0 + 1.1513150529935956e-003 + 0.3586845099925995 + 0.5363473892211914 + <_> + + <_> + + + + <_>11 14 9 6 -1. + <_>11 16 9 2 3. + 0 + 0.0361047089099884 + 1 + 0.2833136916160584 + <_> + + + + <_>19 14 1 3 -1. + <_>19 15 1 1 3. + 0 + 3.6256198654882610e-004 + 0.5477722287178040 + 0.4110532104969025 + <_> + + <_> + + + + <_>0 9 6 6 -1. + <_>3 9 3 6 2. + 0 + -3.4635469783097506e-003 + 0.5990386009216309 + 1 + <_> + + + + <_>0 19 9 1 -1. + <_>3 19 3 1 3. + 0 + -2.8796829283237457e-003 + 0.5725253224372864 + 0.4149512052536011 + <_> + + <_> + + + + <_>11 14 9 6 -1. + <_>11 16 9 2 3. + 0 + -8.1119500100612640e-003 + 1 + 0.5396351814270020 + <_> + + + + <_>12 12 6 6 -1. + <_>12 14 6 2 3. + 0 + 4.5932079665362835e-003 + 0.5379704236984253 + 0.3891302943229675 + <_> + + <_> + + + + <_>1 14 8 6 -1. + <_>1 16 8 2 3. + 0 + 7.0014740340411663e-003 + 1 + 0.3714671134948731 + <_> + + + + <_>8 1 3 2 -1. + <_>9 1 1 2 3. + 0 + 8.0169539432972670e-004 + 0.5529567003250122 + 0.3755804896354675 + <_> + + <_> + + + + <_>18 2 2 4 -1. + <_>18 2 1 4 2. + 0 + -8.6652329191565514e-003 + 1 + 0.5025773048400879 + <_> + + + + <_>14 0 6 3 -1. + <_>16 0 2 3 3. + 0 + -2.7315050829201937e-003 + 0.5850322246551514 + 0.4617573916912079 + <_> + + <_> + + + + <_>0 2 2 4 -1. + <_>1 2 1 4 2. + 0 + 1.3301590224727988e-003 + 1 + 0.5937700867652893 + <_> + + + + <_>0 0 6 3 -1. + <_>2 0 2 3 3. + 0 + -4.2648240923881531e-003 + 0.5645368099212647 + 0.3937624990940094 + <_> + + <_> + + + + <_>9 0 3 2 -1. + <_>10 0 1 2 3. + 0 + 6.3251499086618423e-003 + 0.5182105898857117 + 1 + <_> + + + + <_>12 1 2 2 -1. + <_>12 1 1 2 2. + 0 + -3.0753740575164557e-003 + 0.3007416129112244 + 0.5196403861045837 + <_> + + <_> + + + + <_>8 0 3 2 -1. + <_>9 0 1 2 3. + 0 + -7.3622138006612659e-004 + 0.3697580099105835 + 1 + <_> + + + + <_>6 1 2 2 -1. + <_>7 1 1 2 2. + 0 + 3.0082479497650638e-005 + 0.4327593147754669 + 0.5715808868408203 + <_> + + <_> + + + + <_>10 8 2 3 -1. + <_>10 9 2 1 3. + 0 + -3.8722730241715908e-003 + 0.3473713099956513 + 1 + <_> + + + + <_>13 15 6 2 -1. + <_>13 16 6 1 2. + 0 + 6.2879058532416821e-004 + 0.5438259243965149 + 0.4453906118869782 + <_> + + <_> + + + + <_>8 12 2 2 -1. + <_>8 12 1 1 2. + <_>9 13 1 1 2. + 0 + 1.3411579420790076e-003 + 1 + 0.6511713862419128 + <_> + + + + <_>8 15 3 5 -1. + <_>9 15 1 5 3. + 0 + -8.3681922405958176e-003 + 0.1443295031785965 + 0.4888199865818024 + <_> + + <_> + + + + <_>8 6 4 12 -1. + <_>8 12 4 6 2. + 0 + 9.3305751215666533e-004 + 1 + 0.3951109051704407 + <_> + + + + <_>7 6 7 8 -1. + <_>7 10 7 4 2. + 0 + -1.0746510233730078e-003 + 0.3910265862941742 + 0.5349503755569458 + <_> + + <_> + + + + <_>0 11 8 2 -1. + <_>0 12 8 1 2. + 0 + -0.0186100509017706 + 0.1275743991136551 + 1 + <_> + + + + <_>8 11 2 2 -1. + <_>8 11 1 1 2. + <_>9 12 1 1 2. + 0 + 1.3651419430971146e-003 + 0.5038288831710815 + 0.6951304078102112 + <_> + + <_> + + + + <_>7 7 12 1 -1. + <_>11 7 4 1 3. + 0 + 7.3744421824812889e-003 + 0.5253443121910095 + 1 + <_> + + + + <_>10 8 3 2 -1. + <_>11 8 1 2 3. + 0 + 8.4163323044776917e-003 + 0.5011243820190430 + 0.7311332821846008 + <_> + + <_> + + + + <_>1 7 12 1 -1. + <_>5 7 4 1 3. + 0 + 5.1413988694548607e-003 + 0.4953536093235016 + 1 + <_> + + + + <_>6 5 8 2 -1. + <_>6 5 4 1 2. + <_>10 6 4 1 2. + 0 + 4.5847031287848949e-003 + 0.2535555958747864 + 0.6462442874908447 + <_> + + <_> + + + + <_>9 10 3 10 -1. + <_>10 10 1 10 3. + 0 + 0.0285652391612530 + 1 + 0.2330722063779831 + <_> + + + + <_>16 0 2 4 -1. + <_>16 0 1 4 2. + 0 + 4.3958800961263478e-004 + 0.4702244102954865 + 0.5544549226760864 + <_> + + <_> + + + + <_>8 10 3 10 -1. + <_>9 10 1 10 3. + 0 + 0.0314594581723213 + 1 + 0.0336896888911724 + <_> + + + + <_>9 10 2 3 -1. + <_>9 11 2 1 3. + 0 + 5.6011630222201347e-003 + 0.4787121117115021 + 0.6338351964950562 + <_> + + <_> + + + + <_>8 9 4 2 -1. + <_>10 9 2 1 2. + <_>8 10 2 1 2. + 0 + 7.1835669223219156e-004 + 0.5431486964225769 + 1 + <_> + + + + <_>12 14 7 6 -1. + <_>12 16 7 2 3. + 0 + -5.5303089320659637e-003 + 0.4105832874774933 + 0.5403990745544434 + <_> + + <_> + + + + <_>6 1 3 1 -1. + <_>7 1 1 1 3. + 0 + 1.4129279879853129e-003 + 1 + 0.3105539977550507 + <_> + + + + <_>2 0 2 4 -1. + <_>3 0 1 4 2. + 0 + 2.5530709535814822e-004 + 0.4254471957683563 + 0.5447154045104981 + <_> + + <_> + + + + <_>11 11 2 2 -1. + <_>12 11 1 1 2. + <_>11 12 1 1 2. + 0 + 3.1966410460881889e-004 + 1 + 0.6118361949920654 + <_> + + + + <_>12 12 6 6 -1. + <_>12 14 6 2 3. + 0 + 5.0411392003297806e-003 + 0.5290042161941528 + 0.4224787056446075 + <_> + + <_> + + + + <_>1 0 6 10 -1. + <_>1 0 3 5 2. + <_>4 5 3 5 2. + 0 + 7.7617880888283253e-003 + 0.4315345883369446 + 1 + <_> + + + + <_>3 0 2 9 -1. + <_>3 3 2 3 3. + 0 + 2.9374631121754646e-003 + 0.6629263162612915 + 0.3028964996337891 + <_> + + <_> + + + + <_>14 13 3 2 -1. + <_>14 14 3 1 2. + 0 + -1.6497720498591661e-003 + 1 + 0.5491852760314941 + <_> + + + + <_>15 2 3 2 -1. + <_>15 3 3 1 2. + 0 + -5.8834417723119259e-003 + 0.3188554048538208 + 0.5184289216995239 + <_> + + <_> + + + + <_>2 13 5 2 -1. + <_>2 14 5 1 2. + 0 + 8.7459187489002943e-004 + 1 + 0.3328830897808075 + <_> + + + + <_>3 4 12 10 -1. + <_>3 4 6 5 2. + <_>9 9 6 5 2. + 0 + -0.0153087796643376 + 0.3923608064651489 + 0.5235139131546021 + <_> + + <_> + + + + <_>5 1 14 6 -1. + <_>5 3 14 2 3. + 0 + 0.0322924517095089 + 1 + 0.5977646708488464 + <_> + + + + <_>15 3 3 2 -1. + <_>15 4 3 1 2. + 0 + -4.3842519517056644e-004 + 0.4541687965393066 + 0.5369428992271423 + <_> + + <_> + + + + <_>7 11 2 2 -1. + <_>7 11 1 1 2. + <_>8 12 1 1 2. + 0 + 1.5429529594257474e-003 + 1 + 0.6318141222000122 + <_> + + + + <_>2 14 6 6 -1. + <_>2 16 6 2 3. + 0 + -2.4733028840273619e-003 + 0.3490633070468903 + 0.4759024977684021 + <_> + + <_> + + + + <_>6 13 8 3 -1. + <_>6 14 8 1 3. + 0 + 2.0994939841330051e-003 + 1 + 0.5887197852134705 + <_> + + + + <_>1 19 18 1 -1. + <_>7 19 6 1 3. + 0 + -5.7541108690202236e-003 + 0.5961331725120544 + 0.4841983020305634 + <_> + + <_> + + + + <_>8 12 1 6 -1. + <_>8 15 1 3 2. + 0 + -0.0102331303060055 + 0.1705404072999954 + 1 + <_> + + + + <_>0 0 14 15 -1. + <_>0 5 14 5 3. + 0 + 0.2255450934171677 + 0.4779379963874817 + 0.0978796631097794 + <_> + + <_> + + + + <_>3 0 16 8 -1. + <_>3 4 16 4 2. + 0 + 0.0296665597707033 + 1 + 0.5822224020957947 + <_> + + + + <_>6 1 8 12 -1. + <_>6 7 8 6 2. + 0 + -2.8518449980765581e-003 + 0.5459626913070679 + 0.4610066115856171 + <_> + + <_> + + + + <_>5 3 3 3 -1. + <_>6 3 1 3 3. + 0 + 9.7465328872203827e-004 + 1 + 0.3670322895050049 + <_> + + + + <_>5 1 3 4 -1. + <_>6 1 1 4 3. + 0 + 1.4044740055396687e-005 + 0.4302386045455933 + 0.5691710710525513 + <_> + + <_> + + + + <_>15 14 4 6 -1. + <_>17 14 2 3 2. + <_>15 17 2 3 2. + 0 + -0.0175794307142496 + 0.6917321085929871 + 1 + <_> + + + + <_>12 11 6 8 -1. + <_>15 11 3 4 2. + <_>12 15 3 4 2. + 0 + -0.0523816794157028 + 0.7110040187835693 + 0.5060154795646668 + <_> + + <_> + + + + <_>8 7 2 4 -1. + <_>9 7 1 4 2. + 0 + -0.0112421102821827 + 0.8769189119338989 + 1 + <_> + + + + <_>6 11 3 1 -1. + <_>7 11 1 1 3. + 0 + -3.6728400737047195e-003 + 0.6519191861152649 + 0.4546068906784058 + <_> + + <_> + + + + <_>12 3 2 14 -1. + <_>12 3 1 14 2. + 0 + 3.5082760732620955e-003 + 0.5329865813255310 + 1 + <_> + + + + <_>12 11 6 2 -1. + <_>15 11 3 1 2. + <_>12 12 3 1 2. + 0 + 6.1679710634052753e-003 + 0.5220459103584290 + 0.2953518927097321 + <_> + + <_> + + + + <_>0 2 5 2 -1. + <_>0 3 5 1 2. + 0 + -9.7009900491684675e-004 + 1 + 0.5048633217811585 + <_> + + + + <_>0 0 15 1 -1. + <_>5 0 5 1 3. + 0 + -0.0109570100903511 + 0.5837358236312866 + 0.3020085990428925 + <_> + + <_> + + + + <_>12 11 6 2 -1. + <_>15 11 3 1 2. + <_>12 12 3 1 2. + 0 + -8.3272513002157211e-003 + 0.3158063888549805 + 1 + <_> + + + + <_>10 5 2 2 -1. + <_>10 5 1 2 2. + 0 + 2.9798380637657829e-005 + 0.4386389851570129 + 0.5443211197853088 + <_> + + <_> + + + + <_>9 7 2 2 -1. + <_>10 7 1 2 2. + 0 + 2.8244039276614785e-004 + 1 + 0.5625395774841309 + <_> + + + + <_>9 0 2 10 -1. + <_>9 0 1 5 2. + <_>10 5 1 5 2. + 0 + -8.1364117795601487e-004 + 0.5281198024749756 + 0.3401407897472382 + <_> + + <_> + + + + <_>18 14 2 2 -1. + <_>18 15 2 1 2. + 0 + 1.8008040497079492e-003 + 1 + 0.3471659123897553 + <_> + + + + <_>13 11 4 9 -1. + <_>13 14 4 3 3. + 0 + -6.9944779388606548e-003 + 0.4481697082519531 + 0.5385770201683044 + <_> + + <_> + + + + <_>8 13 2 2 -1. + <_>8 13 1 1 2. + <_>9 14 1 1 2. + 0 + 4.5625398342963308e-005 + 0.4492512941360474 + 1 + <_> + + + + <_>7 8 4 3 -1. + <_>7 9 4 1 3. + 0 + -7.3189922841265798e-004 + 0.4167312085628510 + 0.6021102070808411 + <_> + + <_> + + + + <_>8 9 4 2 -1. + <_>8 10 4 1 2. + 0 + -2.9980219551362097e-004 + 0.4148428142070770 + 1 + <_> + + + + <_>13 12 4 2 -1. + <_>13 13 4 1 2. + 0 + -2.9060940505587496e-005 + 0.5592089891433716 + 0.4073210954666138 + <_> + + <_> + + + + <_>6 14 2 2 -1. + <_>6 14 1 1 2. + <_>7 15 1 1 2. + 0 + -5.9742690064013004e-004 + 0.6088914275169373 + 1 + <_> + + + + <_>0 14 2 2 -1. + <_>0 15 2 1 2. + 0 + 1.4831830048933625e-004 + 0.5298305153846741 + 0.3761950135231018 + <_> + + <_> + + + + <_>7 13 6 3 -1. + <_>7 14 6 1 3. + 0 + -2.9441029764711857e-003 + 1 + 0.4716084897518158 + <_> + + + + <_>7 9 10 6 -1. + <_>7 11 10 2 3. + 0 + 0.1374121010303497 + 0.5101336836814880 + 0.0467468015849590 + <_> + + <_> + + + + <_>2 9 12 4 -1. + <_>6 9 4 4 3. + 0 + -0.0884141772985458 + 0.1181868985295296 + 1 + <_> + + + + <_>7 9 6 11 -1. + <_>10 9 3 11 2. + 0 + 0.0706102773547173 + 0.5119063258171082 + 0.7778441905975342 + <_> + + <_> + + + + <_>9 7 2 3 -1. + <_>9 8 2 1 3. + 0 + -7.7188978902995586e-003 + 0.1874134987592697 + 1 + <_> + + + + <_>9 14 4 3 -1. + <_>9 15 4 1 3. + 0 + 0.0151153998449445 + 0.4980027973651886 + 0.7005817890167236 + <_> + + <_> + + + + <_>2 3 3 17 -1. + <_>3 3 1 17 3. + 0 + 1.0671879863366485e-003 + 0.4482238888740540 + 1 + <_> + + + + <_>0 11 6 3 -1. + <_>0 12 6 1 3. + 0 + 7.0487911580130458e-004 + 0.6265752911567688 + 0.4402655065059662 + 47.7634506225585940 + 16 + -1 + <_> + + + <_> + + <_> + + + + <_>4 3 11 9 -1. + <_>4 6 11 3 3. + 0 + -0.0986907333135605 + 1 + 0.3999474942684174 + <_> + + + + <_>0 2 6 11 -1. + <_>3 2 3 11 2. + 0 + 0.0623734183609486 + 0.5247784852981567 + 0.8193575739860535 + <_> + + <_> + + + + <_>13 0 4 5 -1. + <_>13 0 2 5 2. + 0 + 1.9496519817039371e-003 + 0.3529816865921021 + 1 + <_> + + + + <_>9 7 6 4 -1. + <_>12 7 3 2 2. + <_>9 9 3 2 2. + 0 + -8.9139147894456983e-004 + 0.5852727890014648 + 0.3245978057384491 + <_> + + <_> + + + + <_>5 7 8 2 -1. + <_>9 7 4 2 2. + 0 + -5.5150408297777176e-004 + 0.3892816901206970 + 1 + <_> + + + + <_>1 8 15 1 -1. + <_>6 8 5 1 3. + 0 + -1.1721949558705091e-003 + 0.4335052073001862 + 0.6520624160766602 + <_> + + <_> + + + + <_>4 12 12 2 -1. + <_>8 12 4 2 3. + 0 + -7.4480642797425389e-004 + 1 + 0.4041135013103485 + <_> + + + + <_>13 0 4 10 -1. + <_>15 0 2 5 2. + <_>13 5 2 5 2. + 0 + -2.6264840271323919e-003 + 0.5624982118606567 + 0.3967525064945221 + <_> + + <_> + + + + <_>9 9 2 2 -1. + <_>9 10 2 1 2. + 0 + -3.9712688885629177e-004 + 0.3856112062931061 + 1 + <_> + + + + <_>3 9 6 2 -1. + <_>6 9 3 2 2. + 0 + 3.5984949208796024e-003 + 0.5997889041900635 + 0.4241614043712616 + <_> + + <_> + + + + <_>8 17 4 3 -1. + <_>8 18 4 1 3. + 0 + 5.3080618381500244e-003 + 1 + 0.6660168766975403 + <_> + + + + <_>8 3 9 2 -1. + <_>11 3 3 2 3. + 0 + 9.6319877775385976e-004 + 0.4481379091739655 + 0.5583487749099731 + <_> + + <_> + + + + <_>3 3 9 2 -1. + <_>6 3 3 2 3. + 0 + 5.0776469288393855e-004 + 0.3535459041595459 + 1 + <_> + + + + <_>5 0 9 14 -1. + <_>8 0 3 14 3. + 0 + 3.6223160568624735e-003 + 0.3409807085990906 + 0.5420687794685364 + <_> + + <_> + + + + <_>7 3 7 10 -1. + <_>7 8 7 5 2. + 0 + -0.0620614103972912 + 0.1934083998203278 + 1 + <_> + + + + <_>4 8 13 3 -1. + <_>4 9 13 1 3. + 0 + 6.4387189922854304e-004 + 0.4083626866340637 + 0.5490221977233887 + <_> + + <_> + + + + <_>3 12 14 4 -1. + <_>3 12 7 2 2. + <_>10 14 7 2 2. + 0 + 0.0262399092316628 + 1 + 0.2285708039999008 + <_> + + + + <_>8 12 4 2 -1. + <_>8 13 4 1 2. + 0 + 8.1940297968685627e-004 + 0.4648667871952057 + 0.6017355918884277 + <_> + + <_> + + + + <_>6 10 9 8 -1. + <_>6 14 9 4 2. + 0 + 2.3833119485061616e-004 + 1 + 0.3598038852214813 + <_> + + + + <_>9 12 2 8 -1. + <_>9 16 2 4 2. + 0 + -1.5869759954512119e-003 + 0.4259651005268097 + 0.5476434826850891 + <_> + + <_> + + + + <_>8 12 3 3 -1. + <_>8 13 3 1 3. + 0 + -6.7263417877256870e-003 + 0.6507238149642944 + 1 + <_> + + + + <_>5 5 4 10 -1. + <_>7 5 2 10 2. + 0 + 0.0110061103478074 + 0.5149409770965576 + 0.3362984955310822 + <_> + + <_> + + + + <_>14 15 3 3 -1. + <_>14 16 3 1 3. + 0 + 7.1445819921791553e-003 + 1 + 0.2672930061817169 + <_> + + + + <_>4 6 13 3 -1. + <_>4 7 13 1 3. + 0 + -4.7233798541128635e-003 + 0.5652182102203369 + 0.4298144876956940 + <_> + + <_> + + + + <_>3 15 3 3 -1. + <_>3 16 3 1 3. + 0 + 9.8437406122684479e-003 + 1 + 0.1151885986328125 + <_> + + + + <_>3 9 4 2 -1. + <_>3 9 2 1 2. + <_>5 10 2 1 2. + 0 + 1.5124640412977897e-005 + 0.4373598098754883 + 0.5612128973007202 + <_> + + <_> + + + + <_>0 11 20 4 -1. + <_>10 11 10 2 2. + <_>0 13 10 2 2. + 0 + 0.0399088710546494 + 0.5204648971557617 + 1 + <_> + + + + <_>8 15 4 3 -1. + <_>8 16 4 1 3. + 0 + 5.3903679363429546e-003 + 0.4813467860221863 + 0.6361209154129028 + <_> + + <_> + + + + <_>0 11 20 4 -1. + <_>0 11 10 2 2. + <_>10 13 10 2 2. + 0 + -0.0399088710546494 + 0.1506870985031128 + 1 + <_> + + + + <_>8 15 4 3 -1. + <_>8 16 4 1 3. + 0 + 5.3903679363429546e-003 + 0.4581694900989533 + 0.6200240850448608 + <_> + + <_> + + + + <_>10 13 1 6 -1. + <_>10 16 1 3 2. + 0 + 6.7005190066993237e-003 + 1 + 0.3432235121726990 + <_> + + + + <_>2 1 18 2 -1. + <_>11 1 9 1 2. + <_>2 2 9 1 2. + 0 + -0.0126237897202373 + 0.3088226914405823 + 0.5226737856864929 + <_> + + <_> + + + + <_>8 14 3 3 -1. + <_>8 15 3 1 3. + 0 + 0.0118066100403667 + 1 + 0.7187939286231995 + <_> + + + + <_>4 1 6 1 -1. + <_>6 1 2 1 3. + 0 + -3.4257229417562485e-003 + 0.3120814859867096 + 0.5065844058990479 + <_> + + <_> + + + + <_>11 13 1 3 -1. + <_>11 14 1 1 3. + 0 + 3.9385299896821380e-004 + 0.4754584133625031 + 1 + <_> + + + + <_>13 5 2 12 -1. + <_>13 11 2 6 2. + 0 + 0.0343881882727146 + 0.5261657834053040 + 0.3350174129009247 + <_> + + <_> + + + + <_>1 14 18 6 -1. + <_>1 16 18 2 3. + 0 + -0.0750099867582321 + 0.1713480949401856 + 1 + <_> + + + + <_>8 13 1 3 -1. + <_>8 14 1 1 3. + 0 + 4.9022492021322250e-004 + 0.4725801944732666 + 0.5956469178199768 + <_> + + <_> + + + + <_>7 13 6 3 -1. + <_>7 14 6 1 3. + 0 + -8.5525289177894592e-003 + 0.6558222770690918 + 1 + <_> + + + + <_>9 10 3 2 -1. + <_>9 11 3 1 2. + 0 + 1.3135520566720515e-004 + 0.4835400879383087 + 0.5586913824081421 + <_> + + <_> + + + + <_>5 1 3 3 -1. + <_>6 1 1 3 3. + 0 + 4.7948658466339111e-003 + 1 + 0.2645705938339233 + <_> + + + + <_>5 5 6 5 -1. + <_>8 5 3 5 2. + 0 + 2.0124691072851419e-003 + 0.3657945096492767 + 0.5124772191047669 + <_> + + <_> + + + + <_>7 5 6 14 -1. + <_>7 12 6 7 2. + 0 + -0.1178547963500023 + 0.2385654002428055 + 1 + <_> + + + + <_>7 16 6 2 -1. + <_>9 16 2 2 3. + 0 + 1.5575019642710686e-003 + 0.5490474104881287 + 0.4274747967720032 + <_> + + <_> + + + + <_>0 2 2 12 -1. + <_>1 2 1 12 2. + 0 + -0.0155737595632672 + 0.6938900947570801 + 1 + <_> + + + + <_>1 0 5 3 -1. + <_>1 1 5 1 3. + 0 + -2.1854790393263102e-003 + 0.3645988106727600 + 0.5092526078224182 + <_> + + <_> + + + + <_>12 4 3 3 -1. + <_>12 5 3 1 3. + 0 + 2.9272339306771755e-003 + 0.4685808122158051 + 1 + <_> + + + + <_>12 6 3 3 -1. + <_>12 7 3 1 3. + 0 + 6.4663668163120747e-003 + 0.4973410069942474 + 0.7726097106933594 + <_> + + <_> + + + + <_>5 4 3 3 -1. + <_>5 5 3 1 3. + 0 + -7.6140360906720161e-003 + 0.6877465844154358 + 1 + <_> + + + + <_>5 6 3 3 -1. + <_>5 7 3 1 3. + 0 + 4.1512572206556797e-003 + 0.4788525104522705 + 0.6921657919883728 + <_> + + <_> + + + + <_>8 12 4 8 -1. + <_>10 12 2 4 2. + <_>8 16 2 4 2. + 0 + 2.7711640577763319e-003 + 0.5481839776039124 + 1 + <_> + + + + <_>2 17 18 2 -1. + <_>11 17 9 1 2. + <_>2 18 9 1 2. + 0 + -0.0128361098468304 + 0.3800162971019745 + 0.5204492807388306 + <_> + + <_> + + + + <_>9 3 2 2 -1. + <_>9 4 2 1 2. + 0 + -2.4380050599575043e-003 + 0.2582435011863709 + 1 + <_> + + + + <_>8 5 4 6 -1. + <_>8 7 4 2 3. + 0 + 2.1713329479098320e-003 + 0.4961163103580475 + 0.3215202987194061 + <_> + + <_> + + + + <_>9 0 8 6 -1. + <_>9 2 8 2 3. + 0 + 6.2800728483125567e-004 + 1 + 0.5460423827171326 + <_> + + + + <_>1 0 18 4 -1. + <_>7 0 6 4 3. + 0 + -9.7982389852404594e-003 + 0.6046543717384338 + 0.4939922094345093 + <_> + + <_> + + + + <_>0 0 4 8 -1. + <_>2 0 2 8 2. + 0 + 7.3543828912079334e-003 + 1 + 0.5291094183921814 + <_> + + + + <_>0 4 6 9 -1. + <_>2 4 2 9 3. + 0 + -0.0146650401875377 + 0.5446122884750366 + 0.3567362129688263 + <_> + + <_> + + + + <_>1 4 18 2 -1. + <_>7 4 6 2 3. + 0 + 0.0302445106208324 + 0.5518329143524170 + 1 + <_> + + + + <_>8 16 12 4 -1. + <_>14 16 6 2 2. + <_>8 18 6 2 2. + 0 + -0.0566602088510990 + 0.6930978894233704 + 0.5093387961387634 + <_> + + <_> + + + + <_>0 0 18 2 -1. + <_>0 0 9 1 2. + <_>9 1 9 1 2. + 0 + -5.6967479176819324e-003 + 0.3201526105403900 + 1 + <_> + + + + <_>3 0 3 18 -1. + <_>4 0 1 18 3. + 0 + 0.0308067705482244 + 0.4989246129989624 + 0.2277054041624069 + <_> + + <_> + + + + <_>14 9 4 7 -1. + <_>14 9 2 7 2. + 0 + 2.2748769260942936e-003 + 0.4810931086540222 + 1 + <_> + + + + <_>15 14 2 2 -1. + <_>15 15 2 1 2. + 0 + 2.0436900667846203e-003 + 0.5283867120742798 + 0.3255924880504608 + <_> + + <_> + + + + <_>2 9 4 7 -1. + <_>4 9 2 7 2. + 0 + -8.6277956143021584e-003 + 0.6266536116600037 + 1 + <_> + + + + <_>3 14 2 2 -1. + <_>3 15 2 1 2. + 0 + 6.5113382879644632e-004 + 0.5097137093544006 + 0.3191910088062286 + <_> + + <_> + + + + <_>11 0 6 6 -1. + <_>11 2 6 2 3. + 0 + 8.8188261725008488e-004 + 0.4549585878849030 + 1 + <_> + + + + <_>14 0 2 6 -1. + <_>15 0 1 3 2. + <_>14 3 1 3 2. + 0 + -0.0145949097350240 + 0.2645038962364197 + 0.5153868198394775 + <_> + + <_> + + + + <_>7 11 2 2 -1. + <_>7 11 1 1 2. + <_>8 12 1 1 2. + 0 + -1.2304580304771662e-003 + 0.6197584867477417 + 1 + <_> + + + + <_>7 10 2 2 -1. + <_>8 10 1 2 2. + 0 + -2.1867299801670015e-004 + 0.5469198822975159 + 0.4206855893135071 + <_> + + <_> + + + + <_>9 14 2 6 -1. + <_>9 17 2 3 2. + 0 + -1.0909959673881531e-003 + 0.4140760004520416 + 1 + <_> + + + + <_>12 18 4 2 -1. + <_>12 19 4 1 2. + 0 + 3.5210378700867295e-004 + 0.5476608872413635 + 0.4155021011829376 + <_> + + <_> + + + + <_>8 17 4 3 -1. + <_>8 18 4 1 3. + 0 + -7.2563779540359974e-003 + 0.7160469293594360 + 1 + <_> + + + + <_>2 18 8 2 -1. + <_>2 19 8 1 2. + 0 + 1.4701850013807416e-003 + 0.5240808129310608 + 0.3729662895202637 + <_> + + <_> + + + + <_>2 9 16 3 -1. + <_>2 10 16 1 3. + 0 + 1.1472719779703766e-004 + 0.4033798873424530 + 1 + <_> + + + + <_>9 9 2 2 -1. + <_>9 10 2 1 2. + 0 + 3.0506469774991274e-003 + 0.5263985991477966 + 0.3560093045234680 + <_> + + <_> + + + + <_>5 14 2 4 -1. + <_>5 14 1 2 2. + <_>6 16 1 2 2. + 0 + 2.6269949739798903e-004 + 0.4569799900054932 + 1 + <_> + + + + <_>8 9 4 2 -1. + <_>8 9 2 1 2. + <_>10 10 2 1 2. + 0 + -3.6365550477057695e-003 + 0.3042570948600769 + 0.5868253707885742 + <_> + + <_> + + + + <_>9 5 2 5 -1. + <_>9 5 1 5 2. + 0 + -8.4893293678760529e-003 + 1 + 0.4914157092571259 + <_> + + + + <_>9 9 3 2 -1. + <_>10 9 1 2 3. + 0 + 5.8107408694922924e-003 + 0.4918529987335205 + 0.6266962885856628 + <_> + + <_> + + + + <_>8 9 3 2 -1. + <_>9 9 1 2 3. + 0 + 7.5583951547741890e-004 + 1 + 0.5633236169815064 + <_> + + + + <_>8 8 3 6 -1. + <_>9 8 1 6 3. + 0 + -2.2017690353095531e-003 + 0.5553916096687317 + 0.3827646076679230 + <_> + + <_> + + + + <_>8 12 4 8 -1. + <_>10 12 2 4 2. + <_>8 16 2 4 2. + 0 + 2.7908938936889172e-003 + 0.5498697757720947 + 1 + <_> + + + + <_>2 17 16 2 -1. + <_>10 17 8 1 2. + <_>2 18 8 1 2. + 0 + -1.8228569533675909e-003 + 0.4382283091545105 + 0.5424032807350159 + <_> + + <_> + + + + <_>8 12 3 8 -1. + <_>9 12 1 8 3. + 0 + -7.2495508939027786e-003 + 0.2888121902942658 + 1 + <_> + + + + <_>3 10 1 3 -1. + <_>3 11 1 1 3. + 0 + -6.8744522286579013e-004 + 0.3472655117511749 + 0.5076370835304260 + <_> + + <_> + + + + <_>9 14 10 6 -1. + <_>14 14 5 3 2. + <_>9 17 5 3 2. + 0 + 2.5174440816044807e-003 + 0.4661205112934113 + 1 + <_> + + + + <_>14 13 3 6 -1. + <_>14 15 3 2 3. + 0 + -0.0101513797417283 + 0.3744775056838989 + 0.5294001102447510 + <_> + + <_> + + + + <_>1 19 18 1 -1. + <_>7 19 6 1 3. + 0 + -4.1399952024221420e-003 + 1 + 0.4660485088825226 + <_> + + + + <_>2 10 15 2 -1. + <_>7 10 5 2 3. + 0 + -4.7078551724553108e-003 + 0.4175061881542206 + 0.6916306018829346 + <_> + + <_> + + + + <_>4 17 16 3 -1. + <_>4 18 16 1 3. + 0 + 0.0419810414314270 + 1 + 0.2018215060234070 + <_> + + + + <_>8 6 4 9 -1. + <_>8 9 4 3 3. + 0 + -0.0142729999497533 + 0.7511197924613953 + 0.5032083988189697 + <_> + + <_> + + + + <_>9 16 2 4 -1. + <_>9 16 1 2 2. + <_>10 18 1 2 2. + 0 + 4.0869521908462048e-003 + 1 + 0.2504513859748840 + <_> + + + + <_>5 5 10 8 -1. + <_>5 9 10 4 2. + 0 + 1.7606799956411123e-003 + 0.3301401138305664 + 0.5218337178230286 + <_> + + <_> + + + + <_>13 1 4 2 -1. + <_>13 1 2 2 2. + 0 + 1.2550549581646919e-004 + 0.4614442884922028 + 1 + <_> + + + + <_>14 0 3 6 -1. + <_>14 2 3 2 3. + 0 + -2.9503209516406059e-003 + 0.4619950056076050 + 0.5247030258178711 + <_> + + <_> + + + + <_>6 7 2 2 -1. + <_>6 7 1 1 2. + <_>7 8 1 1 2. + 0 + -1.1312420247122645e-003 + 0.6314368247985840 + 1 + <_> + + + + <_>7 1 6 1 -1. + <_>9 1 2 1 3. + 0 + -1.6983180539682508e-003 + 0.3401306867599487 + 0.5055527091026306 + <_> + + <_> + + + + <_>9 11 3 3 -1. + <_>9 12 3 1 3. + 0 + -0.0114578204229474 + 1 + 0.4939996004104614 + <_> + + + + <_>12 9 3 3 -1. + <_>13 9 1 3 3. + 0 + -8.4962565451860428e-003 + 0.2965450882911682 + 0.5194367766380310 + <_> + + <_> + + + + <_>8 11 3 3 -1. + <_>8 12 3 1 3. + 0 + 0.0119190895929933 + 1 + 0.7886998057365418 + <_> + + + + <_>5 9 3 3 -1. + <_>6 9 1 3 3. + 0 + 6.4416420646011829e-003 + 0.5106986761093140 + 0.2967146039009094 + <_> + + <_> + + + + <_>10 11 1 3 -1. + <_>10 12 1 1 3. + 0 + -8.7857811013236642e-004 + 0.5714371204376221 + 1 + <_> + + + + <_>7 9 6 4 -1. + <_>10 9 3 2 2. + <_>7 11 3 2 2. + 0 + -2.0312711130827665e-003 + 0.4481200873851776 + 0.5384911894798279 + <_> + + <_> + + + + <_>4 7 2 2 -1. + <_>4 7 1 1 2. + <_>5 8 1 1 2. + 0 + -1.5262430533766747e-003 + 0.6193568706512451 + 1 + <_> + + + + <_>5 7 3 1 -1. + <_>6 7 1 1 3. + 0 + 4.2860880494117737e-003 + 0.4339885115623474 + 0.7697299122810364 + <_> + + <_> + + + + <_>18 3 2 3 -1. + <_>18 4 2 1 3. + 0 + 3.5010920837521553e-003 + 1 + 0.3171389102935791 + <_> + + + + <_>13 1 4 2 -1. + <_>13 1 2 2 2. + 0 + 0.0125876702368259 + 0.5246698856353760 + 0.4241208136081696 + <_> + + <_> + + + + <_>3 1 4 2 -1. + <_>5 1 2 2 2. + 0 + 2.6207490009255707e-004 + 0.4231899976730347 + 1 + <_> + + + + <_>3 0 5 2 -1. + <_>3 1 5 1 2. + 0 + 4.4701730075757951e-005 + 0.4174138903617859 + 0.5919603705406189 + <_> + + <_> + + + + <_>14 7 6 4 -1. + <_>17 7 3 2 2. + <_>14 9 3 2 2. + 0 + 7.8084698179736733e-004 + 0.4277389049530029 + 1 + <_> + + + + <_>4 8 16 2 -1. + <_>4 9 16 1 2. + 0 + 8.8851212058216333e-004 + 0.3720161020755768 + 0.5226818919181824 + <_> + + <_> + + + + <_>2 11 5 6 -1. + <_>2 13 5 2 3. + 0 + 2.3369069676846266e-003 + 0.5478066802024841 + 1 + <_> + + + + <_>5 16 2 4 -1. + <_>5 16 1 2 2. + <_>6 18 1 2 2. + 0 + 1.6688359901309013e-003 + 0.3628678917884827 + 0.6150004863739014 + <_> + + <_> + + + + <_>15 6 2 12 -1. + <_>16 6 1 6 2. + <_>15 12 1 6 2. + 0 + 3.0844469438306987e-004 + 0.4747075140476227 + 1 + <_> + + + + <_>13 3 6 16 -1. + <_>15 3 2 16 3. + 0 + 3.4617560449987650e-003 + 0.4580138027667999 + 0.5585681796073914 + <_> + + <_> + + + + <_>4 5 12 12 -1. + <_>4 5 6 6 2. + <_>10 11 6 6 2. + 0 + 0.0189613103866577 + 0.5298801064491272 + 1 + <_> + + + + <_>5 1 10 13 -1. + <_>10 1 5 13 2. + 0 + 0.1734731048345566 + 0.3698385059833527 + 0.8498619794845581 + <_> + + <_> + + + + <_>11 5 2 2 -1. + <_>12 5 1 1 2. + <_>11 6 1 1 2. + 0 + 2.0020549709443003e-004 + 1 + 0.5565661787986755 + <_> + + + + <_>13 5 1 3 -1. + <_>13 6 1 1 3. + 0 + 1.0967060225084424e-003 + 0.4795713126659393 + 0.6286259889602661 + <_> + + <_> + + + + <_>7 4 2 4 -1. + <_>7 4 1 2 2. + <_>8 6 1 2 2. + 0 + 1.5107099898159504e-004 + 0.4052405953407288 + 1 + <_> + + + + <_>7 5 6 4 -1. + <_>10 5 3 4 2. + 0 + -3.4463501069694757e-003 + 0.6173015236854553 + 0.4414263963699341 + <_> + + <_> + + + + <_>12 4 4 6 -1. + <_>14 4 2 3 2. + <_>12 7 2 3 2. + 0 + 8.5176620632410049e-003 + 1 + 0.3570570945739746 + <_> + + + + <_>12 11 7 6 -1. + <_>12 13 7 2 3. + 0 + -0.0358121097087860 + 0.3151328861713409 + 0.5252702832221985 + <_> + + <_> + + + + <_>5 6 6 6 -1. + <_>7 6 2 6 3. + 0 + -0.0211554002016783 + 0.6124721169471741 + 1 + <_> + + + + <_>9 8 2 2 -1. + <_>9 9 2 1 2. + 0 + 8.9890940580517054e-004 + 0.5169975757598877 + 0.3596271872520447 + <_> + + <_> + + + + <_>15 6 2 2 -1. + <_>16 6 1 1 2. + <_>15 7 1 1 2. + 0 + -1.5613760333508253e-003 + 1 + 0.4914987981319428 + <_> + + + + <_>14 7 4 4 -1. + <_>16 7 2 2 2. + <_>14 9 2 2 2. + 0 + 6.7120860330760479e-004 + 0.4546211063861847 + 0.5395811796188355 + <_> + + <_> + + + + <_>5 5 6 2 -1. + <_>7 5 2 2 3. + 0 + -0.0215970296412706 + 0.1903133988380432 + 1 + <_> + + + + <_>1 19 18 1 -1. + <_>7 19 6 1 3. + 0 + -0.0249472297728062 + 0.6974077224731445 + 0.4967716038227081 + <_> + + <_> + + + + <_>12 3 3 3 -1. + <_>12 4 3 1 3. + 0 + 1.8725979607552290e-003 + 0.4748947918415070 + 1 + <_> + + + + <_>16 0 2 3 -1. + <_>16 1 2 1 3. + 0 + 6.3912719488143921e-003 + 0.5180178284645081 + 0.2924321889877319 + <_> + + <_> + + + + <_>5 3 3 3 -1. + <_>5 4 3 1 3. + 0 + -9.1552399098873138e-003 + 0.7665870189666748 + 1 + <_> + + + + <_>2 0 2 3 -1. + <_>2 1 2 1 3. + 0 + 2.1715660113841295e-003 + 0.5215551257133484 + 0.3365719020366669 + <_> + + <_> + + + + <_>15 6 2 2 -1. + <_>16 6 1 1 2. + <_>15 7 1 1 2. + 0 + 1.2330369791015983e-003 + 1 + 0.6260957717895508 + <_> + + + + <_>10 13 1 6 -1. + <_>10 16 1 3 2. + 0 + -4.0785901364870369e-004 + 0.4533509910106659 + 0.5386489033699036 + <_> + + <_> + + + + <_>0 7 10 2 -1. + <_>0 7 5 1 2. + <_>5 8 5 1 2. + 0 + 4.6437609125860035e-004 + 0.4103496074676514 + 1 + <_> + + + + <_>3 10 6 2 -1. + <_>3 11 6 1 2. + 0 + -1.1600199650274590e-004 + 0.5830391049385071 + 0.4304105937480927 + <_> + + <_> + + + + <_>12 18 4 2 -1. + <_>12 19 4 1 2. + 0 + -0.0127187203615904 + 0.2132582962512970 + 1 + <_> + + + + <_>12 18 2 2 -1. + <_>13 18 1 1 2. + <_>12 19 1 1 2. + 0 + 8.9431880041956902e-005 + 0.4872891008853912 + 0.5458915233612061 + <_> + + <_> + + + + <_>6 19 2 1 -1. + <_>7 19 1 1 2. + 0 + -3.3913689549081028e-004 + 0.3974364995956421 + 1 + <_> + + + + <_>0 4 2 16 -1. + <_>0 4 1 8 2. + <_>1 12 1 8 2. + 0 + -0.0180263407528400 + 0.7568550705909729 + 0.5045611858367920 + <_> + + <_> + + + + <_>16 1 4 9 -1. + <_>16 4 4 3 3. + 0 + 6.9179181009531021e-003 + 1 + 0.3966299891471863 + <_> + + + + <_>10 2 1 2 -1. + <_>10 3 1 1 2. + 0 + -1.1839679791592062e-004 + 0.4198082983493805 + 0.5435804128646851 + <_> + + <_> + + + + <_>4 14 4 6 -1. + <_>4 14 2 3 2. + <_>6 17 2 3 2. + 0 + -3.9474181830883026e-003 + 0.6369457840919495 + 1 + <_> + + + + <_>4 15 1 4 -1. + <_>4 17 1 2 2. + 0 + 6.0050919273635373e-005 + 0.5269566774368286 + 0.3812243044376373 + <_> + + <_> + + + + <_>0 2 20 4 -1. + <_>10 2 10 2 2. + <_>0 4 10 2 2. + 0 + 9.1423643752932549e-003 + 1 + 0.4156762957572937 + <_> + + + + <_>14 5 2 8 -1. + <_>14 9 2 4 2. + 0 + 2.1305440168362111e-004 + 0.3523533046245575 + 0.5349454283714294 + <_> + + <_> + + + + <_>5 12 4 5 -1. + <_>7 12 2 5 2. + 0 + -2.0855850016232580e-004 + 1 + 0.4403322041034699 + <_> + + + + <_>0 13 9 6 -1. + <_>0 15 9 2 3. + 0 + 1.3130389852449298e-003 + 0.6058161258697510 + 0.4468218982219696 + <_> + + <_> + + + + <_>9 14 11 3 -1. + <_>9 15 11 1 3. + 0 + -2.9134768992662430e-003 + 1 + 0.4825705885887146 + <_> + + + + <_>7 14 7 3 -1. + <_>7 15 7 1 3. + 0 + 2.9645769391208887e-003 + 0.4835998117923737 + 0.6039277911186218 + <_> + + <_> + + + + <_>3 6 2 2 -1. + <_>3 6 1 1 2. + <_>4 7 1 1 2. + 0 + 1.7772549763321877e-003 + 1 + 0.6871827244758606 + <_> + + + + <_>6 7 2 7 -1. + <_>7 7 1 7 2. + 0 + -7.7136349864304066e-003 + 0.2842220962047577 + 0.5145428180694580 + <_> + + <_> + + + + <_>14 5 1 3 -1. + <_>14 6 1 1 3. + 0 + 5.1027478184551001e-004 + 1 + 0.6024426221847534 + <_> + + + + <_>13 4 4 3 -1. + <_>13 5 4 1 3. + 0 + 1.7460630042478442e-003 + 0.4756610095500946 + 0.5721154212951660 + <_> + + <_> + + + + <_>2 7 4 4 -1. + <_>2 7 2 2 2. + <_>4 9 2 2 2. + 0 + 3.8068278809078038e-004 + 1 + 0.4931069016456604 + <_> + + + + <_>2 9 13 6 -1. + <_>2 12 13 3 2. + 0 + 2.8228890150785446e-003 + 0.3311698138713837 + 0.6227598190307617 + <_> + + <_> + + + + <_>10 1 3 4 -1. + <_>11 1 1 4 3. + 0 + -5.3000478073954582e-003 + 1 + 0.5232092738151550 + <_> + + + + <_>9 8 5 2 -1. + <_>9 9 5 1 2. + 0 + 4.4951299059903249e-005 + 0.3995231986045837 + 0.5314797759056091 + <_> + + <_> + + + + <_>0 14 11 3 -1. + <_>0 15 11 1 3. + 0 + 3.2752458937466145e-003 + 0.4481619894504547 + 1 + <_> + + + + <_>8 11 2 8 -1. + <_>8 15 2 4 2. + 0 + -2.8162579983472824e-003 + 0.3907971978187561 + 0.6671640872955322 + <_> + + <_> + + + + <_>5 11 10 6 -1. + <_>5 14 10 3 2. + 0 + 1.4112279750406742e-003 + 0.5357010960578919 + 1 + <_> + + + + <_>5 13 15 5 -1. + <_>10 13 5 5 3. + 0 + 8.3062034100294113e-003 + 0.4770965874195099 + 0.5570099949836731 + <_> + + <_> + + + + <_>8 10 1 10 -1. + <_>8 15 1 5 2. + 0 + 2.2164839319884777e-003 + 0.4947124123573303 + 1 + <_> + + + + <_>4 14 6 2 -1. + <_>6 14 2 2 3. + 0 + -4.9868631176650524e-003 + 0.5241307020187378 + 0.2512654960155487 + <_> + + <_> + + + + <_>7 14 7 3 -1. + <_>7 15 7 1 3. + 0 + -3.6664260551333427e-003 + 1 + 0.4619553983211517 + <_> + + + + <_>7 16 9 3 -1. + <_>7 17 9 1 3. + 0 + -0.0105812298133969 + 0.6301718950271606 + 0.4973031878471375 + <_> + + <_> + + + + <_>8 7 3 3 -1. + <_>8 8 3 1 3. + 0 + 7.3366491124033928e-003 + 1 + 0.2870970070362091 + <_> + + + + <_>3 5 1 6 -1. + <_>3 8 1 3 2. + 0 + -3.9318940252996981e-004 + 0.4252805113792419 + 0.5579246878623962 + <_> + + <_> + + + + <_>6 5 11 2 -1. + <_>6 6 11 1 2. + 0 + -8.1375334411859512e-003 + 0.5747315883636475 + 1 + <_> + + + + <_>9 0 3 2 -1. + <_>10 0 1 2 3. + 0 + 2.4809150490909815e-003 + 0.5203374028205872 + 0.3903566896915436 + <_> + + <_> + + + + <_>5 5 1 3 -1. + <_>5 6 1 1 3. + 0 + 8.8749779388308525e-004 + 1 + 0.5534321069717407 + <_> + + + + <_>8 7 3 2 -1. + <_>9 7 1 2 3. + 0 + -4.2194919660687447e-004 + 0.5338044166564941 + 0.3925840854644775 + <_> + + <_> + + + + <_>5 2 10 6 -1. + <_>10 2 5 3 2. + <_>5 5 5 3 2. + 0 + -7.9790111631155014e-003 + 0.4144316017627716 + 1 + <_> + + + + <_>8 4 6 4 -1. + <_>8 4 3 4 2. + 0 + 1.1439629597589374e-003 + 0.4701372981071472 + 0.5281736254692078 + <_> + + <_> + + + + <_>8 16 3 4 -1. + <_>9 16 1 4 3. + 0 + 7.5542130507528782e-003 + 1 + 0.2527256011962891 + <_> + + + + <_>9 13 2 6 -1. + <_>9 13 1 3 2. + <_>10 16 1 3 2. + 0 + 1.0288399644196033e-003 + 0.5605146288871765 + 0.4297856092453003 + <_> + + <_> + + + + <_>9 8 3 1 -1. + <_>10 8 1 1 3. + 0 + -1.7234670231118798e-003 + 1 + 0.4839682877063751 + <_> + + + + <_>2 5 18 15 -1. + <_>2 10 18 5 3. + 0 + 0.5758669972419739 + 0.5110502839088440 + 0.0804893299937248 + 44.2512817382812500 + 17 + -1 + <_> + + + <_> + + <_> + + + + <_>1 3 6 2 -1. + <_>4 3 3 2 2. + 0 + 6.6640521399676800e-003 + 0.3828920125961304 + 1 + <_> + + + + <_>7 6 6 2 -1. + <_>9 6 2 2 3. + 0 + 8.9905522763729095e-003 + 0.4858429133892059 + 0.7354959249496460 + <_> + + <_> + + + + <_>8 17 4 3 -1. + <_>8 18 4 1 3. + 0 + 5.7154200039803982e-003 + 1 + 0.6723223924636841 + <_> + + + + <_>10 13 2 3 -1. + <_>10 14 2 1 3. + 0 + 1.1257929727435112e-003 + 0.4429577887058258 + 0.6070777773857117 + <_> + + <_> + + + + <_>0 10 20 4 -1. + <_>0 12 20 2 2. + 0 + -9.1789010912179947e-004 + 1 + 0.3076345026493073 + <_> + + + + <_>5 7 6 4 -1. + <_>5 7 3 2 2. + <_>8 9 3 2 2. + 0 + -1.0492859873920679e-003 + 0.5593643784523010 + 0.3651022911071777 + <_> + + <_> + + + + <_>11 12 1 2 -1. + <_>11 13 1 1 2. + 0 + 3.5453929740469903e-005 + 0.4277968108654022 + 1 + <_> + + + + <_>10 10 2 3 -1. + <_>10 11 2 1 3. + 0 + 2.9015709878876805e-004 + 0.4583545029163361 + 0.5284683108329773 + <_> + + <_> + + + + <_>9 5 2 2 -1. + <_>9 6 2 1 2. + 0 + 1.6071660502348095e-004 + 1 + 0.3798192143440247 + <_> + + + + <_>4 4 1 10 -1. + <_>4 9 1 5 2. + 0 + -5.2961107576265931e-004 + 0.3850437104701996 + 0.5939688086509705 + <_> + + <_> + + + + <_>11 18 4 2 -1. + <_>11 18 2 2 2. + 0 + 2.6682569296099246e-004 + 0.4123024940490723 + 1 + <_> + + + + <_>12 18 3 2 -1. + <_>12 19 3 1 2. + 0 + -1.3492540165316314e-004 + 0.5760599970817566 + 0.4237645864486694 + <_> + + <_> + + + + <_>0 6 16 6 -1. + <_>0 6 8 3 2. + <_>8 9 8 3 2. + 0 + -0.0108416797593236 + 0.3929921090602875 + 1 + <_> + + + + <_>7 6 4 12 -1. + <_>7 12 4 6 2. + 0 + 0.0120778298005462 + 0.5761923193931580 + 0.2780444920063019 + <_> + + <_> + + + + <_>11 18 4 2 -1. + <_>11 18 2 2 2. + 0 + 2.2128869313746691e-003 + 0.4794507026672363 + 1 + <_> + + + + <_>12 18 3 2 -1. + <_>12 19 3 1 2. + 0 + -0.0152661902830005 + 0.0740558803081512 + 0.5153577923774719 + <_> + + <_> + + + + <_>8 12 1 2 -1. + <_>8 13 1 1 2. + 0 + 6.7929533543065190e-005 + 1 + 0.5858737826347351 + <_> + + + + <_>8 13 1 3 -1. + <_>8 14 1 1 3. + 0 + 1.7633590323384851e-004 + 0.3567610979080200 + 0.5598962903022766 + <_> + + <_> + + + + <_>11 18 4 2 -1. + <_>11 18 2 2 2. + 0 + 8.1311381654813886e-004 + 1 + 0.5346850752830505 + <_> + + + + <_>14 12 4 6 -1. + <_>14 12 2 6 2. + 0 + 3.2630451023578644e-003 + 0.4782536923885346 + 0.5456753969192505 + <_> + + <_> + + + + <_>6 0 3 4 -1. + <_>7 0 1 4 3. + 0 + -3.9503918960690498e-003 + 0.2831811904907227 + 1 + <_> + + + + <_>4 0 2 8 -1. + <_>4 0 1 4 2. + <_>5 4 1 4 2. + 0 + -3.9864578866399825e-004 + 0.5485215783119202 + 0.4159697890281677 + <_> + + <_> + + + + <_>11 17 9 3 -1. + <_>14 17 3 3 3. + 0 + -0.0114325201138854 + 0.5639101266860962 + 1 + <_> + + + + <_>16 2 4 5 -1. + <_>16 2 2 5 2. + 0 + 5.3339172154664993e-003 + 0.4596984088420868 + 0.5931242704391480 + <_> + + <_> + + + + <_>0 2 5 9 -1. + <_>0 5 5 3 3. + 0 + 8.3193257451057434e-003 + 1 + 0.3230620026588440 + <_> + + + + <_>7 2 3 2 -1. + <_>8 2 1 2 3. + 0 + -4.2479918920435011e-004 + 0.3795293867588043 + 0.5408611297607422 + <_> + + <_> + + + + <_>11 17 9 3 -1. + <_>14 17 3 3 3. + 0 + -0.1118943020701408 + 0.1132297962903976 + 1 + <_> + + + + <_>16 2 4 5 -1. + <_>16 2 2 5 2. + 0 + -7.5553781352937222e-003 + 0.6339370012283325 + 0.4838770925998688 + <_> + + <_> + + + + <_>0 17 9 3 -1. + <_>3 17 3 3 3. + 0 + -7.0337029173970222e-003 + 0.5665255188941956 + 1 + <_> + + + + <_>0 2 4 5 -1. + <_>2 2 2 5 2. + 0 + -0.0148336803540587 + 0.6751418113708496 + 0.4140945076942444 + <_> + + <_> + + + + <_>5 11 10 9 -1. + <_>5 14 10 3 3. + 0 + 8.7506724521517754e-003 + 1 + 0.3561258912086487 + <_> + + + + <_>9 6 3 3 -1. + <_>9 7 3 1 3. + 0 + 1.6645010327920318e-003 + 0.5347279906272888 + 0.3649779856204987 + <_> + + <_> + + + + <_>3 17 5 3 -1. + <_>3 18 5 1 3. + 0 + 9.4900820404291153e-003 + 1 + 0.2754656076431274 + <_> + + + + <_>7 5 4 7 -1. + <_>9 5 2 7 2. + 0 + 1.1133110383525491e-003 + 0.4225992858409882 + 0.5629178881645203 + <_> + + <_> + + + + <_>9 8 2 5 -1. + <_>9 8 1 5 2. + 0 + 9.4940755516290665e-003 + 0.4906036853790283 + 1 + <_> + + + + <_>2 2 18 2 -1. + <_>2 3 18 1 2. + 0 + -1.5396620146930218e-003 + 0.4007051885128021 + 0.5380709171295166 + <_> + + <_> + + + + <_>2 8 15 6 -1. + <_>7 8 5 6 3. + 0 + 0.1343495994806290 + 1 + 0.2214671969413757 + <_> + + + + <_>9 8 2 5 -1. + <_>10 8 1 5 2. + 0 + -9.4940755516290665e-003 + 0.7353156208992004 + 0.5005033016204834 + <_> + + <_> + + + + <_>12 10 4 6 -1. + <_>12 12 4 2 3. + 0 + 0.0200117900967598 + 1 + 0.3327906131744385 + <_> + + + + <_>14 3 6 2 -1. + <_>14 4 6 1 2. + 0 + -1.8875009845942259e-003 + 0.3915289044380188 + 0.5401849746704102 + <_> + + <_> + + + + <_>5 5 2 3 -1. + <_>5 6 2 1 3. + 0 + 7.1842782199382782e-003 + 1 + 0.7176604866981506 + <_> + + + + <_>4 6 3 3 -1. + <_>4 7 3 1 3. + 0 + 1.6976969782263041e-003 + 0.4526978135108948 + 0.6076912879943848 + <_> + + <_> + + + + <_>14 12 3 3 -1. + <_>14 13 3 1 3. + 0 + 4.9219978973269463e-003 + 1 + 0.2569833993911743 + <_> + + + + <_>6 12 11 3 -1. + <_>6 13 11 1 3. + 0 + 0.0118031995370984 + 0.4999637901782990 + 0.5958228111267090 + <_> + + <_> + + + + <_>1 2 3 6 -1. + <_>1 4 3 2 3. + 0 + -9.7703449428081512e-003 + 0.3459093868732452 + 1 + <_> + + + + <_>1 0 4 7 -1. + <_>3 0 2 7 2. + 0 + 2.1174899302423000e-003 + 0.4515126943588257 + 0.5829715728759766 + <_> + + <_> + + + + <_>9 8 3 4 -1. + <_>10 8 1 4 3. + 0 + 9.4801411032676697e-003 + 0.4807392060756683 + 1 + <_> + + + + <_>10 9 2 2 -1. + <_>10 10 2 1 2. + 0 + -2.6078789960592985e-003 + 0.3462216854095459 + 0.5201594829559326 + <_> + + <_> + + + + <_>8 8 3 4 -1. + <_>9 8 1 4 3. + 0 + -5.7252747938036919e-003 + 0.6599853038787842 + 1 + <_> + + + + <_>4 4 10 10 -1. + <_>4 9 10 5 2. + 0 + -8.2325618714094162e-003 + 0.2821828126907349 + 0.5125284790992737 + <_> + + <_> + + + + <_>9 10 3 2 -1. + <_>10 10 1 2 3. + 0 + 8.9571950957179070e-004 + 0.4883818924427033 + 1 + <_> + + + + <_>9 10 3 2 -1. + <_>9 11 3 1 2. + 0 + -1.5021569561213255e-004 + 0.4829918146133423 + 0.5428717136383057 + <_> + + <_> + + + + <_>8 10 3 2 -1. + <_>9 10 1 2 3. + 0 + 4.8489659093320370e-004 + 0.4434598982334137 + 1 + <_> + + + + <_>2 4 14 12 -1. + <_>2 4 7 6 2. + <_>9 10 7 6 2. + 0 + -0.0961926504969597 + 0.2256636023521423 + 0.5956227779388428 + <_> + + <_> + + + + <_>10 12 1 6 -1. + <_>10 15 1 3 2. + 0 + -1.1053519556298852e-003 + 0.4527224004268646 + 1 + <_> + + + + <_>7 3 8 16 -1. + <_>11 3 4 8 2. + <_>7 11 4 8 2. + 0 + -0.1021504029631615 + 0.2844349145889282 + 0.5186452865600586 + <_> + + <_> + + + + <_>5 6 8 10 -1. + <_>5 6 4 5 2. + <_>9 11 4 5 2. + 0 + 3.0147889629006386e-003 + 1 + 0.3808999061584473 + <_> + + + + <_>6 2 8 8 -1. + <_>6 2 4 4 2. + <_>10 6 4 4 2. + 0 + 7.6131648384034634e-003 + 0.5718699097633362 + 0.4262563884258270 + <_> + + <_> + + + + <_>10 5 4 2 -1. + <_>12 5 2 1 2. + <_>10 6 2 1 2. + 0 + 1.5197630273178220e-003 + 1 + 0.5942718982696533 + <_> + + + + <_>12 4 3 3 -1. + <_>12 5 3 1 3. + 0 + -0.0141972796991467 + 0.7731103897094727 + 0.4997653961181641 + <_> + + <_> + + + + <_>4 19 12 1 -1. + <_>8 19 4 1 3. + 0 + -0.0138188796117902 + 0.6681138277053833 + 1 + <_> + + + + <_>8 2 3 1 -1. + <_>9 2 1 1 3. + 0 + -5.0701329018920660e-004 + 0.3305608034133911 + 0.4749974906444550 + <_> + + <_> + + + + <_>13 17 4 3 -1. + <_>13 18 4 1 3. + 0 + -9.3537531793117523e-003 + 0.2860932946205139 + 1 + <_> + + + + <_>7 14 6 3 -1. + <_>7 15 6 1 3. + 0 + -9.4771059229969978e-003 + 0.6188883185386658 + 0.4842100143432617 + <_> + + <_> + + + + <_>9 14 2 3 -1. + <_>9 15 2 1 3. + 0 + 1.6923650400713086e-003 + 1 + 0.6070249080657959 + <_> + + + + <_>7 15 6 3 -1. + <_>7 16 6 1 3. + 0 + 5.8652542065829039e-004 + 0.3782689869403839 + 0.5368196964263916 + <_> + + <_> + + + + <_>10 18 3 2 -1. + <_>11 18 1 2 3. + 0 + -2.5826620403677225e-003 + 0.3690209984779358 + 1 + <_> + + + + <_>14 12 2 3 -1. + <_>14 13 2 1 3. + 0 + -2.7307639829814434e-003 + 0.3857114911079407 + 0.5318108797073364 + <_> + + <_> + + + + <_>4 10 4 6 -1. + <_>4 12 4 2 3. + 0 + 0.0218715704977512 + 1 + 0.2327008992433548 + <_> + + + + <_>4 13 3 2 -1. + <_>4 14 3 1 2. + 0 + -1.5010299648565706e-005 + 0.5560722947120667 + 0.4301410019397736 + <_> + + <_> + + + + <_>9 16 2 3 -1. + <_>9 17 2 1 3. + 0 + 5.3583700209856033e-003 + 1 + 0.6767637729644775 + <_> + + + + <_>10 18 3 2 -1. + <_>11 18 1 2 3. + 0 + 5.0057549960911274e-003 + 0.5194904208183289 + 0.3612853884696960 + <_> + + <_> + + + + <_>7 18 3 2 -1. + <_>8 18 1 2 3. + 0 + -1.9030070398002863e-003 + 0.3237845003604889 + 1 + <_> + + + + <_>1 10 4 2 -1. + <_>1 11 4 1 2. + 0 + -7.8506693243980408e-003 + 0.1194851994514465 + 0.4991723895072937 + <_> + + <_> + + + + <_>12 4 6 3 -1. + <_>12 5 6 1 3. + 0 + -2.7093670796602964e-003 + 1 + 0.4854960143566132 + <_> + + + + <_>14 4 1 3 -1. + <_>14 5 1 1 3. + 0 + 1.4138079714030027e-003 + 0.4872322976589203 + 0.5903577804565430 + <_> + + <_> + + + + <_>2 4 6 3 -1. + <_>2 5 6 1 3. + 0 + 9.0300198644399643e-003 + 1 + 0.6547315716743469 + <_> + + + + <_>5 4 1 3 -1. + <_>5 5 1 1 3. + 0 + -9.7925681620836258e-004 + 0.5849273204803467 + 0.4554230868816376 + <_> + + <_> + + + + <_>14 12 3 3 -1. + <_>14 13 3 1 3. + 0 + 1.3984439428895712e-003 + 1 + 0.4064626097679138 + <_> + + + + <_>15 12 2 3 -1. + <_>15 13 2 1 3. + 0 + 8.3372107474133372e-004 + 0.5399543046951294 + 0.4152809977531433 + <_> + + <_> + + + + <_>3 16 4 3 -1. + <_>3 17 4 1 3. + 0 + 0.0105510596185923 + 1 + 0.1796680986881256 + <_> + + + + <_>8 0 4 2 -1. + <_>8 1 4 1 2. + 0 + 8.8344102550763637e-005 + 0.4251863062381744 + 0.5413522720336914 + <_> + + <_> + + + + <_>0 0 20 1 -1. + <_>0 0 10 1 2. + 0 + -0.0410223081707954 + 1 + 0.5228124856948853 + <_> + + + + <_>9 7 3 4 -1. + <_>10 7 1 4 3. + 0 + 7.5065628625452518e-003 + 0.4853743016719818 + 0.6093444228172302 + <_> + + <_> + + + + <_>0 0 20 1 -1. + <_>10 0 10 1 2. + 0 + 0.0410223081707954 + 1 + 0.2205024063587189 + <_> + + + + <_>8 7 3 4 -1. + <_>9 7 1 4 3. + 0 + -5.3961377125233412e-004 + 0.5692731738090515 + 0.4468756914138794 + <_> + + <_> + + + + <_>1 6 19 3 -1. + <_>1 7 19 1 3. + 0 + -0.0686960369348526 + 0.1483314037322998 + 1 + <_> + + + + <_>12 7 4 2 -1. + <_>12 8 4 1 2. + 0 + -1.8447940237820148e-003 + 0.6211283802986145 + 0.4966601133346558 + <_> + + <_> + + + + <_>7 8 3 3 -1. + <_>7 9 3 1 3. + 0 + -6.0959919355809689e-003 + 0.2294671982526779 + 1 + <_> + + + + <_>7 7 3 3 -1. + <_>8 7 1 3 3. + 0 + -4.2068301700055599e-003 + 0.6407091021537781 + 0.4748562872409821 + <_> + + <_> + + + + <_>2 9 16 3 -1. + <_>2 10 16 1 3. + 0 + -7.1332789957523346e-004 + 1 + 0.5354936122894287 + <_> + + + + <_>9 4 2 12 -1. + <_>9 8 2 4 3. + 0 + 0.1175677999854088 + 0.5136978030204773 + 0.0105957398191094 + <_> + + <_> + + + + <_>7 3 2 5 -1. + <_>8 3 1 5 2. + 0 + 5.9354289987822995e-005 + 0.3711803853511810 + 1 + <_> + + + + <_>9 7 2 3 -1. + <_>9 8 2 1 3. + 0 + -6.3173691742122173e-003 + 0.1712073981761932 + 0.5061758160591126 + <_> + + <_> + + + + <_>9 14 4 3 -1. + <_>9 15 4 1 3. + 0 + 0.0149414995685220 + 1 + 0.6729118824005127 + <_> + + + + <_>7 8 6 4 -1. + <_>10 8 3 2 2. + <_>7 10 3 2 2. + 0 + -2.0789399277418852e-003 + 0.4410645961761475 + 0.5444027781486511 + <_> + + <_> + + + + <_>9 7 2 2 -1. + <_>10 7 1 2 2. + 0 + -7.0736219640821218e-004 + 0.5568910837173462 + 1 + <_> + + + + <_>5 5 6 6 -1. + <_>7 5 2 6 3. + 0 + -3.1247111037373543e-003 + 0.5023869276046753 + 0.3562405109405518 + <_> + + <_> + + + + <_>9 1 3 6 -1. + <_>10 1 1 6 3. + 0 + -7.8919378574937582e-004 + 1 + 0.5456786155700684 + <_> + + + + <_>4 5 12 2 -1. + <_>8 5 4 2 3. + 0 + 0.0101795801892877 + 0.5545138716697693 + 0.4622310996055603 + <_> + + <_> + + + + <_>4 2 6 4 -1. + <_>6 2 2 4 3. + 0 + -2.7506109327077866e-003 + 1 + 0.4942536056041718 + <_> + + + + <_>4 7 8 2 -1. + <_>4 8 8 1 2. + 0 + 0.0106013296172023 + 0.2961233854293823 + 0.5964338779449463 + <_> + + <_> + + + + <_>3 6 14 6 -1. + <_>10 6 7 3 2. + <_>3 9 7 3 2. + 0 + 5.1466780714690685e-003 + 0.5495228767395020 + 1 + <_> + + + + <_>3 6 14 3 -1. + <_>3 6 7 3 2. + 0 + 0.0763211473822594 + 0.5173959136009216 + 0.2940216958522797 + <_> + + <_> + + + + <_>0 5 2 2 -1. + <_>0 6 2 1 2. + 0 + -1.5027689514681697e-003 + 0.3106299936771393 + 1 + <_> + + + + <_>8 13 4 3 -1. + <_>8 14 4 1 3. + 0 + 0.0122666703537107 + 0.4651150107383728 + 0.6846613883972168 + <_> + + <_> + + + + <_>13 0 3 20 -1. + <_>14 0 1 20 3. + 0 + -0.0311185792088509 + 1 + 0.5226057171821594 + <_> + + + + <_>10 8 10 3 -1. + <_>10 9 10 1 3. + 0 + 0.0289055891335011 + 0.5182244181632996 + 0.2705428004264832 + <_> + + <_> + + + + <_>4 0 3 20 -1. + <_>5 0 1 20 3. + 0 + 0.0475983805954456 + 1 + 0.1109512001276016 + <_> + + + + <_>0 8 10 3 -1. + <_>0 9 10 1 3. + 0 + 0.0308085493743420 + 0.4938625097274780 + 0.1404110938310623 + <_> + + <_> + + + + <_>12 5 3 4 -1. + <_>13 5 1 4 3. + 0 + -2.1277810446918011e-004 + 1 + 0.4392356872558594 + <_> + + + + <_>6 7 12 4 -1. + <_>10 7 4 4 3. + 0 + 0.0789699628949165 + 0.5216552019119263 + 0.2294113934040070 + <_> + + <_> + + + + <_>1 14 6 6 -1. + <_>1 14 3 3 2. + <_>4 17 3 3 2. + 0 + -0.0102579500526190 + 0.6176652908325195 + 1 + <_> + + + + <_>1 17 6 2 -1. + <_>1 18 6 1 2. + 0 + 1.2604889925569296e-003 + 0.5236222743988037 + 0.3328965902328491 + <_> + + <_> + + + + <_>14 8 6 12 -1. + <_>17 8 3 6 2. + <_>14 14 3 6 2. + 0 + -0.0334904603660107 + 1 + 0.4866186976432800 + <_> + + + + <_>18 5 2 2 -1. + <_>18 6 2 1 2. + 0 + -5.9202767442911863e-004 + 0.4116407036781311 + 0.5395640134811401 + <_> + + <_> + + + + <_>3 16 4 2 -1. + <_>3 16 2 1 2. + <_>5 17 2 1 2. + 0 + 3.0320750738610514e-005 + 1 + 0.5610736012458801 + <_> + + + + <_>2 16 6 2 -1. + <_>4 16 2 2 3. + 0 + -5.4369680583477020e-004 + 0.5621389150619507 + 0.3461203873157501 + <_> + + <_> + + + + <_>14 8 6 12 -1. + <_>17 8 3 6 2. + <_>14 14 3 6 2. + 0 + -0.0334904603660107 + 1 + 0.4896762073040009 + <_> + + + + <_>18 5 2 2 -1. + <_>18 6 2 1 2. + 0 + -5.9202767442911863e-004 + 0.4305404126644135 + 0.5340713858604431 + <_> + + <_> + + + + <_>5 16 9 2 -1. + <_>8 16 3 2 3. + 0 + 2.0550889894366264e-003 + 0.5544999837875366 + 1 + <_> + + + + <_>3 14 6 6 -1. + <_>3 14 3 3 2. + <_>6 17 3 3 2. + 0 + -4.4353571720421314e-003 + 0.6038540005683899 + 0.3746592998504639 + <_> + + <_> + + + + <_>14 8 6 12 -1. + <_>17 8 3 6 2. + <_>14 14 3 6 2. + 0 + -0.0841704234480858 + 1 + 0.5007348060607910 + <_> + + + + <_>11 7 2 12 -1. + <_>11 11 2 4 3. + 0 + 6.7419027909636497e-003 + 0.5298097133636475 + 0.4716145098209381 + <_> + + <_> + + + + <_>0 8 6 12 -1. + <_>0 8 3 6 2. + <_>3 14 3 6 2. + 0 + 0.0102781504392624 + 1 + 0.6269375085830689 + <_> + + + + <_>7 7 2 12 -1. + <_>7 11 2 4 3. + 0 + 5.8800862170755863e-003 + 0.5154827833175659 + 0.3813040852546692 + <_> + + <_> + + + + <_>14 12 1 2 -1. + <_>14 13 1 1 2. + 0 + -6.9679190346505493e-006 + 1 + 0.4440239965915680 + <_> + + + + <_>12 13 8 1 -1. + <_>12 13 4 1 2. + 0 + 8.2419527461752295e-004 + 0.4697534143924713 + 0.5485504269599915 + <_> + + <_> + + + + <_>0 3 16 6 -1. + <_>0 6 16 3 2. + 0 + -5.5268318392336369e-003 + 0.5513604879379273 + 1 + <_> + + + + <_>1 4 8 2 -1. + <_>1 4 4 1 2. + <_>5 5 4 1 2. + 0 + 9.6128671430051327e-004 + 0.3618639111518860 + 0.5838456749916077 + <_> + + <_> + + + + <_>14 12 1 2 -1. + <_>14 13 1 1 2. + 0 + 2.4810510221868753e-003 + 1 + 0.2523222863674164 + <_> + + + + <_>15 12 2 3 -1. + <_>15 13 2 1 3. + 0 + -1.0480589699000120e-003 + 0.4117257893085480 + 0.5392996072769165 + <_> + + <_> + + + + <_>8 16 3 3 -1. + <_>8 17 3 1 3. + 0 + -6.1287907883524895e-003 + 0.6726329922676086 + 1 + <_> + + + + <_>5 12 1 2 -1. + <_>5 13 1 1 2. + 0 + 1.1682329932227731e-004 + 0.5041192770004273 + 0.3607729077339172 + <_> + + <_> + + + + <_>13 4 3 15 -1. + <_>14 4 1 15 3. + 0 + -0.0399094782769680 + 0.1563739031553268 + 1 + <_> + + + + <_>17 3 2 6 -1. + <_>18 3 1 3 2. + <_>17 6 1 3 2. + 0 + 1.5859459526836872e-003 + 0.4891980886459351 + 0.5779845118522644 + <_> + + <_> + + + + <_>4 4 3 15 -1. + <_>5 4 1 15 3. + 0 + -0.0226902291178703 + 0.2186879068613052 + 1 + <_> + + + + <_>1 3 2 6 -1. + <_>1 3 1 3 2. + <_>2 6 1 3 2. + 0 + 2.0916070789098740e-003 + 0.4771577119827271 + 0.6099231243133545 + <_> + + <_> + + + + <_>7 15 12 4 -1. + <_>7 17 12 2 2. + 0 + -0.0247154198586941 + 0.3463996946811676 + 1 + <_> + + + + <_>1 0 19 3 -1. + <_>1 1 19 1 3. + 0 + -0.0134194502606988 + 0.3630692958831787 + 0.5252196192741394 + <_> + + <_> + + + + <_>3 17 10 2 -1. + <_>3 17 5 1 2. + <_>8 18 5 1 2. + 0 + -6.0629472136497498e-003 + 0.6666321754455566 + 1 + <_> + + + + <_>2 5 10 15 -1. + <_>2 10 10 5 3. + 0 + -2.0921030081808567e-003 + 0.3399547040462494 + 0.5035697817802429 + <_> + + <_> + + + + <_>13 8 3 4 -1. + <_>13 10 3 2 2. + 0 + 0.0259618591517210 + 0.5036802887916565 + 1 + <_> + + + + <_>19 13 1 2 -1. + <_>19 14 1 1 2. + 0 + 1.7908669542521238e-004 + 0.5418530702590942 + 0.4318976998329163 + <_> + + <_> + + + + <_>4 8 3 4 -1. + <_>4 10 3 2 2. + 0 + -3.1546850223094225e-003 + 0.7221025228500366 + 1 + <_> + + + + <_>0 13 1 2 -1. + <_>0 14 1 1 2. + 0 + -1.1397759662941098e-003 + 0.3320972919464111 + 0.5024433732032776 + <_> + + <_> + + + + <_>12 7 2 12 -1. + <_>12 13 2 6 2. + 0 + -0.0478402115404606 + 0.1938765048980713 + 1 + <_> + + + + <_>14 7 2 2 -1. + <_>15 7 1 1 2. + <_>14 8 1 1 2. + 0 + 4.1577088995836675e-004 + 0.4802188873291016 + 0.5730714797973633 + <_> + + <_> + + + + <_>5 3 8 2 -1. + <_>5 4 8 1 2. + 0 + -4.4247039477340877e-004 + 0.4262515008449554 + 1 + <_> + + + + <_>0 2 2 6 -1. + <_>0 4 2 2 3. + 0 + 1.4479350065812469e-003 + 0.5719171166419983 + 0.4064153134822846 + <_> + + <_> + + + + <_>18 2 2 12 -1. + <_>19 2 1 6 2. + <_>18 8 1 6 2. + 0 + 0.0157015100121498 + 0.4995726048946381 + 1 + <_> + + + + <_>18 1 1 2 -1. + <_>18 2 1 1 2. + 0 + 2.7805729769170284e-004 + 0.5289286971092224 + 0.4581728875637054 + <_> + + <_> + + + + <_>0 2 2 12 -1. + <_>0 2 1 6 2. + <_>1 8 1 6 2. + 0 + -2.9010509606450796e-003 + 0.6012148261070252 + 1 + <_> + + + + <_>1 1 1 2 -1. + <_>1 2 1 1 2. + 0 + 2.0830519497394562e-004 + 0.5057976841926575 + 0.3599432110786438 + <_> + + <_> + + + + <_>16 4 4 14 -1. + <_>18 4 2 7 2. + <_>16 11 2 7 2. + 0 + -0.0515300296247005 + 1 + 0.4991796910762787 + <_> + + + + <_>10 14 1 6 -1. + <_>10 17 1 3 2. + 0 + 1.7163449956569821e-004 + 0.4675469994544983 + 0.5374773144721985 + <_> + + <_> + + + + <_>0 4 4 14 -1. + <_>0 4 2 7 2. + <_>2 11 2 7 2. + 0 + 0.0236142799258232 + 1 + 0.6586478948593140 + <_> + + + + <_>9 14 1 6 -1. + <_>9 17 1 3 2. + 0 + -5.6427798699587584e-004 + 0.3853296041488648 + 0.5196040272712708 + <_> + + <_> + + + + <_>9 14 4 3 -1. + <_>9 15 4 1 3. + 0 + 6.6903959959745407e-003 + 1 + 0.6004235744476318 + <_> + + + + <_>4 7 12 2 -1. + <_>8 7 4 2 3. + 0 + -4.8789530992507935e-003 + 0.3293227851390839 + 0.5245236754417419 + <_> + + <_> + + + + <_>0 8 4 3 -1. + <_>0 9 4 1 3. + 0 + -6.8537332117557526e-003 + 0.2565914094448090 + 1 + <_> + + + + <_>4 7 2 2 -1. + <_>4 7 1 1 2. + <_>5 8 1 1 2. + 0 + 9.9893810693174601e-004 + 0.4615494012832642 + 0.5942432284355164 + <_> + + <_> + + + + <_>13 7 2 1 -1. + <_>13 7 1 1 2. + 0 + -1.3354700058698654e-004 + 0.5487375855445862 + 1 + <_> + + + + <_>11 4 4 5 -1. + <_>11 4 2 5 2. + 0 + 1.0165109997615218e-003 + 0.4578359127044678 + 0.5426927804946899 + <_> + + <_> + + + + <_>4 8 3 3 -1. + <_>5 8 1 3 3. + 0 + 9.1216771397739649e-004 + 1 + 0.3939461112022400 + <_> + + + + <_>0 3 8 1 -1. + <_>4 3 4 1 2. + 0 + 1.0080259526148438e-003 + 0.4049789905548096 + 0.5520703792572022 + <_> + + <_> + + + + <_>13 7 2 1 -1. + <_>13 7 1 1 2. + 0 + -1.3102490629535168e-004 + 1 + 0.4879088997840881 + <_> + + + + <_>14 7 3 2 -1. + <_>15 7 1 2 3. + 0 + 5.5228749988600612e-004 + 0.4844943881034851 + 0.5512825846672058 + <_> + + <_> + + + + <_>5 7 2 1 -1. + <_>6 7 1 1 2. + 0 + -1.2130969844292849e-004 + 1 + 0.4367971122264862 + <_> + + + + <_>3 7 3 2 -1. + <_>4 7 1 2 3. + 0 + -1.5112989785848185e-005 + 0.6425955295562744 + 0.4881826937198639 + <_> + + <_> + + + + <_>18 5 2 2 -1. + <_>18 6 2 1 2. + 0 + -4.0125829400494695e-004 + 1 + 0.5372099280357361 + <_> + + + + <_>12 14 2 2 -1. + <_>13 14 1 1 2. + <_>12 15 1 1 2. + 0 + -6.5766851184889674e-004 + 0.5834553241729736 + 0.4869078099727631 + <_> + + <_> + + + + <_>0 5 2 2 -1. + <_>0 6 2 1 2. + 0 + 6.2220421386882663e-004 + 1 + 0.3824636936187744 + <_> + + + + <_>6 14 2 2 -1. + <_>6 14 1 1 2. + <_>7 15 1 1 2. + 0 + 1.4663359615951777e-003 + 0.4813488125801086 + 0.6966739296913147 + <_> + + <_> + + + + <_>7 12 6 5 -1. + <_>9 12 2 5 3. + 0 + -0.0495477095246315 + 0.0539276599884033 + 1 + <_> + + + + <_>12 17 5 2 -1. + <_>12 18 5 1 2. + 0 + 1.3017569435760379e-003 + 0.5337455868721008 + 0.4160748124122620 + <_> + + <_> + + + + <_>1 11 6 3 -1. + <_>4 11 3 3 2. + 0 + -4.4914530590176582e-003 + 0.5997437238693237 + 1 + <_> + + + + <_>1 9 6 3 -1. + <_>4 9 3 3 2. + 0 + 1.6592369647696614e-003 + 0.3727185130119324 + 0.5115634202957153 + <_> + + <_> + + + + <_>12 7 2 12 -1. + <_>12 13 2 6 2. + 0 + 6.4695458859205246e-003 + 0.5252035260200501 + 1 + <_> + + + + <_>8 7 5 3 -1. + <_>8 8 5 1 3. + 0 + 4.9810269847512245e-003 + 0.5256717801094055 + 0.3934406042098999 + <_> + + <_> + + + + <_>6 7 2 12 -1. + <_>6 13 2 6 2. + 0 + -0.0385369807481766 + 0.2061924934387207 + 1 + <_> + + + + <_>1 2 9 18 -1. + <_>4 2 3 18 3. + 0 + -0.2827565073966980 + 0.0618832111358643 + 0.4925057888031006 + <_> + + <_> + + + + <_>12 17 5 2 -1. + <_>12 18 5 1 2. + 0 + -9.0301828458905220e-003 + 0.3157590031623840 + 1 + <_> + + + + <_>4 7 12 2 -1. + <_>4 7 6 2 2. + 0 + -0.0438662692904472 + 0.2033682018518448 + 0.5164769887924194 + <_> + + <_> + + + + <_>6 7 6 1 -1. + <_>8 7 2 1 3. + 0 + -4.5701069757342339e-003 + 0.6611183285713196 + 1 + <_> + + + + <_>7 3 3 2 -1. + <_>8 3 1 2 3. + 0 + -2.3362410720437765e-003 + 0.2807789146900177 + 0.4962876141071320 + <_> + + <_> + + + + <_>9 4 3 1 -1. + <_>10 4 1 1 3. + 0 + 5.3960331715643406e-003 + 0.5146387815475464 + 1 + <_> + + + + <_>11 11 3 1 -1. + <_>12 11 1 1 3. + 0 + -2.6297608856111765e-003 + 0.6284487843513489 + 0.4955588877201080 + <_> + + <_> + + + + <_>8 4 3 1 -1. + <_>9 4 1 1 3. + 0 + -3.8577478844672441e-003 + 0.1486748009920120 + 1 + <_> + + + + <_>6 11 3 1 -1. + <_>7 11 1 1 3. + 0 + 1.3963800156489015e-003 + 0.4701338112354279 + 0.6320971846580505 + <_> + + <_> + + + + <_>12 13 6 6 -1. + <_>12 15 6 2 3. + 0 + -8.8699469342827797e-003 + 1 + 0.5286818146705627 + <_> + + + + <_>14 13 1 6 -1. + <_>14 15 1 2 3. + 0 + -7.0626288652420044e-004 + 0.4648370146751404 + 0.5333210229873657 + <_> + + <_> + + + + <_>2 13 6 6 -1. + <_>2 15 6 2 3. + 0 + 4.2645810171961784e-003 + 0.5084878206253052 + 1 + <_> + + + + <_>1 5 18 1 -1. + <_>7 5 6 1 3. + 0 + 0.0615721009671688 + 0.3629625141620636 + 0.8757156729698181 + <_> + + <_> + + + + <_>4 7 12 2 -1. + <_>10 7 6 1 2. + <_>4 8 6 1 2. + 0 + -4.5381980016827583e-003 + 1 + 0.4856696128845215 + <_> + + + + <_>6 1 8 10 -1. + <_>10 1 4 5 2. + <_>6 6 4 5 2. + 0 + -4.0877899155020714e-003 + 0.4584116041660309 + 0.5420240759849548 + <_> + + <_> + + + + <_>3 13 4 3 -1. + <_>3 14 4 1 3. + 0 + 6.4308601431548595e-003 + 1 + 0.2707302868366242 + <_> + + + + <_>6 13 4 3 -1. + <_>6 14 4 1 3. + 0 + 7.0455260574817657e-003 + 0.5057486891746521 + 0.7026523947715759 + <_> + + <_> + + + + <_>9 14 4 3 -1. + <_>9 15 4 1 3. + 0 + -2.3246440105140209e-003 + 1 + 0.4827278852462769 + <_> + + + + <_>12 9 2 3 -1. + <_>12 10 2 1 3. + 0 + 6.0276601288933307e-005 + 0.4247249066829681 + 0.5508763194084168 + <_> + + <_> + + + + <_>7 14 4 3 -1. + <_>7 15 4 1 3. + 0 + 0.0180845595896244 + 1 + 0.8104801177978516 + <_> + + + + <_>9 0 2 1 -1. + <_>10 0 1 1 2. + 0 + 8.4693520329892635e-004 + 0.5154619216918945 + 0.3514379858970642 + <_> + + <_> + + + + <_>5 0 10 5 -1. + <_>5 0 5 5 2. + 0 + -0.0269310399889946 + 1 + 0.4886888861656189 + <_> + + + + <_>6 6 8 7 -1. + <_>6 6 4 7 2. + 0 + -4.2346641421318054e-003 + 0.4622378051280975 + 0.5382478237152100 + <_> + + <_> + + + + <_>5 0 10 5 -1. + <_>10 0 5 5 2. + 0 + 0.0269471108913422 + 1 + 0.6366596221923828 + <_> + + + + <_>6 6 8 7 -1. + <_>10 6 4 7 2. + 0 + 4.6446882188320160e-003 + 0.5368506908416748 + 0.3765429854393005 + <_> + + <_> + + + + <_>5 9 10 8 -1. + <_>10 9 5 4 2. + <_>5 13 5 4 2. + 0 + -6.9577661342918873e-003 + 0.4234687089920044 + 1 + <_> + + + + <_>10 0 4 10 -1. + <_>12 0 2 5 2. + <_>10 5 2 5 2. + 0 + 8.7609712500125170e-004 + 0.4672406017780304 + 0.5350683927536011 + <_> + + <_> + + + + <_>1 4 8 3 -1. + <_>1 5 8 1 3. + 0 + 1.6103329835459590e-003 + 1 + 0.5732762813568115 + <_> + + + + <_>4 4 8 3 -1. + <_>4 5 8 1 3. + 0 + -1.2848590267822146e-003 + 0.5481799244880676 + 0.3784593045711517 + <_> + + <_> + + + + <_>9 7 4 3 -1. + <_>9 8 4 1 3. + 0 + 0.0102435396984220 + 0.5155907273292542 + 1 + <_> + + + + <_>12 8 3 12 -1. + <_>12 14 3 6 2. + 0 + 2.6889349101111293e-004 + 0.5353189706802368 + 0.4387153983116150 + <_> + + <_> + + + + <_>7 7 4 3 -1. + <_>7 8 4 1 3. + 0 + 3.7903659977018833e-003 + 0.5032002925872803 + 1 + <_> + + + + <_>5 8 3 12 -1. + <_>5 14 3 6 2. + 0 + -0.0293696802109480 + 0.5873538851737976 + 0.2215445041656494 + <_> + + <_> + + + + <_>10 0 7 6 -1. + <_>10 2 7 2 3. + 0 + 6.0743088833987713e-003 + 1 + 0.5417029857635498 + <_> + + + + <_>2 1 18 1 -1. + <_>8 1 6 1 3. + 0 + -0.0127107203006744 + 0.6056511998176575 + 0.4985181987285614 + <_> + + <_> + + + + <_>5 0 3 8 -1. + <_>6 0 1 8 3. + 0 + -5.9445449151098728e-003 + 0.3352069854736328 + 1 + <_> + + + + <_>4 7 4 2 -1. + <_>4 8 4 1 2. + 0 + -2.8927479870617390e-003 + 0.6929240822792053 + 0.4778220057487488 + 53.7555694580078130 + 18 + -1 + diff --git a/plugins/libzm_plugin_face_haar/data/plugins.conf b/plugins/libzm_plugin_face_haar/data/plugins.conf new file mode 100644 index 000000000..4e34f1d92 --- /dev/null +++ b/plugins/libzm_plugin_face_haar/data/plugins.conf @@ -0,0 +1,14 @@ +[libzm_plugin_face_haar] + +cascade = /usr/share/zm/haarcascades/haarcascade_frontalface_alt2.xml +scale = 1.15 +flag = 1 +min-nbrs = 5 +min-obj-width = 4.5 +min-obj-height = 5.5 +min-alarm-score = 0.4 +max-alarm-score = 99 +image-scale-factor = 0.5 +det-cause = Face Detected +log-prefix = FACEDET PLUGIN + diff --git a/plugins/libzm_plugin_face_haar/debug/face_detector_plugin.os b/plugins/libzm_plugin_face_haar/debug/face_detector_plugin.os new file mode 100644 index 000000000..7eba72d03 Binary files /dev/null and b/plugins/libzm_plugin_face_haar/debug/face_detector_plugin.os differ diff --git a/plugins/libzm_plugin_face_haar/libzm_plugin_face_haar.so b/plugins/libzm_plugin_face_haar/libzm_plugin_face_haar.so new file mode 100755 index 000000000..66586e084 Binary files /dev/null and b/plugins/libzm_plugin_face_haar/libzm_plugin_face_haar.so differ diff --git a/plugins/libzm_plugin_face_haar/release/face_detector_plugin.os b/plugins/libzm_plugin_face_haar/release/face_detector_plugin.os new file mode 100644 index 000000000..1e0473cd0 Binary files /dev/null and b/plugins/libzm_plugin_face_haar/release/face_detector_plugin.os differ diff --git a/plugins/libzm_plugin_face_haar/src/face_detector_plugin.cpp b/plugins/libzm_plugin_face_haar/src/face_detector_plugin.cpp new file mode 100644 index 000000000..48d94bf22 --- /dev/null +++ b/plugins/libzm_plugin_face_haar/src/face_detector_plugin.cpp @@ -0,0 +1,400 @@ +#include "face_detector_plugin.h" + + + +//! Retrieve the engine version we're going to expect +extern "C" int getEngineVersion() +{ + return ZM_ENGINE_VERSION; +} + +//! Tells us to register our functionality to an engine kernel +extern "C" void registerPlugin(PluginManager &PlM, string sPluginName) +{ + PlM.getImageAnalyser().addDetector( + auto_ptr(new FaceDetectorPlugin(sPluginName)) + ); +} + + + + +FaceDetectorPlugin::FaceDetectorPlugin() + : Detector(), + m_fScaleFactor(DEFAULT_HAAR_SCALE_FACTOR), + m_nMinNeighbors(DEFAULT_HAAR_MIN_NEIGHBORS), + m_nFlag(DEFAULT_HAAR_FLAG), + m_fMinObjWidth(DEFAULT_DETECTOR_MIN_OBJECT_SIZE_WIDTH), + m_fMinObjHeight(DEFAULT_DETECTOR_MIN_OBJECT_SIZE_HEIGHT), + m_cascade(NULL), + m_sHaarCascadePath(DEFAULT_HAAR_FACE_CASCADE_PATH) +{ + m_sDetectionCause = DETECTED_CAUSE; + m_sLogPrefix = LOG_PREFIX; + + //openlog(m_sLogPrefix.c_str(), LOG_PID|LOG_CONS, LOG_USER); + m_pStorage = cvCreateMemStorage(0); + //_loadHaarCascade(m_sHaarCascadePath); + log(LOG_NOTICE, "Face Detector Plugin\'s Object has been created."); +} + + + + +FaceDetectorPlugin::FaceDetectorPlugin(string sPluginName) + : Detector(sPluginName), + m_fScaleFactor(DEFAULT_HAAR_SCALE_FACTOR), + m_nMinNeighbors(DEFAULT_HAAR_MIN_NEIGHBORS), + m_nFlag(DEFAULT_HAAR_FLAG), + m_fMinObjWidth(DEFAULT_DETECTOR_MIN_OBJECT_SIZE_WIDTH), + m_fMinObjHeight(DEFAULT_DETECTOR_MIN_OBJECT_SIZE_HEIGHT), + m_cascade(NULL), + m_sHaarCascadePath(DEFAULT_HAAR_FACE_CASCADE_PATH) +{ + m_sDetectionCause = DETECTED_CAUSE; + m_sLogPrefix = LOG_PREFIX; + + //openlog(m_sLogPrefix.c_str(), LOG_PID|LOG_CONS, LOG_USER); + m_pStorage = cvCreateMemStorage(0); + //_loadHaarCascade(m_sHaarCascadePath); + log(LOG_NOTICE, "Face Detector Plugin\'s Object has been created."); +} + + + +/*! \fn FaceDetectorPlugin::loadConfig(string sConfigFileName) + * \param sConfigFileName is path to configuration to load parameters from + */ +void FaceDetectorPlugin::loadConfig(string sConfigFileName) +{ + options_description config_file("Configuration file options."); + variables_map vm; + config_file.add_options() + // Haar face detector options + ((m_sConfigSectionName + string(".cascade")).c_str(), + value()->default_value(DEFAULT_HAAR_FACE_CASCADE_PATH)) + ((m_sConfigSectionName + string(".scale")).c_str(), + value()->default_value(DEFAULT_HAAR_SCALE_FACTOR)) + ((m_sConfigSectionName + string(".flag")).c_str(), + value()->default_value(DEFAULT_HAAR_FLAG)) + ((m_sConfigSectionName + string(".min-nbrs")).c_str(), + value()->default_value(DEFAULT_HAAR_MIN_NEIGHBORS)) + ((m_sConfigSectionName + string(".min-obj-width")).c_str(), + value()->default_value(DEFAULT_DETECTOR_MIN_OBJECT_SIZE_WIDTH)) + ((m_sConfigSectionName + string(".min-obj-height")).c_str(), + value()->default_value(DEFAULT_DETECTOR_MIN_OBJECT_SIZE_HEIGHT)) + ((m_sConfigSectionName + string(".min-alarm-score")).c_str(), + value()->default_value(DEFAULT_MIN_ALARM_SCORE)) + ((m_sConfigSectionName + string(".max-alarm-score")).c_str(), + value()->default_value(DEFAULT_MAX_ALARM_SCORE)) + ((m_sConfigSectionName + string(".image-scale-factor")).c_str(), + value()->default_value(DEFAULT_IMAGE_SCALE_FACTOR)) + ((m_sConfigSectionName + string(".det-cause")).c_str(), + value()->default_value(DETECTED_CAUSE)) + ((m_sConfigSectionName + string(".log-prefix")).c_str(), + value()->default_value(LOG_PREFIX)) + ; + ifstream ifs(sConfigFileName.c_str()); + store(parse_config_file(ifs, config_file, true), vm); + notify(vm); + + m_fScaleFactor = vm[(m_sConfigSectionName + string(".scale")).c_str()].as(); + m_nMinNeighbors = vm[(m_sConfigSectionName + string(".min-nbrs")).c_str()].as(); + m_nFlag = vm[(m_sConfigSectionName + string(".flag")).c_str()].as(); + m_fMinObjWidth = vm[(m_sConfigSectionName + string(".min-obj-width")).c_str()].as(); + m_fMinObjHeight = vm[(m_sConfigSectionName + string(".min-obj-height")).c_str()].as(); + m_fMinAlarmScore = vm[(m_sConfigSectionName + string(".min-alarm-score")).c_str()].as(); + m_fMaxAlarmScore = vm[(m_sConfigSectionName + string(".max-alarm-score")).c_str()].as(); + m_fImageScaleFactor = vm[(m_sConfigSectionName + string(".image-scale-factor")).c_str()].as(); + + m_sDetectionCause = vm[(m_sConfigSectionName + string(".det-cause")).c_str()].as(); + m_sLogPrefix = vm[(m_sConfigSectionName + string(".log-prefix")).c_str()].as(); + +// if (m_sHaarCascadePath != vm[(m_sConfigSectionName + string(".cascade")).c_str()].as()) +// { + m_sHaarCascadePath = vm[(m_sConfigSectionName + string(".cascade")).c_str()].as(); + _loadHaarCascade(m_sHaarCascadePath); +// } + zmLoadConfig(); + log(LOG_NOTICE, "Face Detector Plugin\'s Object is configured."); +} + + + +FaceDetectorPlugin::~FaceDetectorPlugin() +{ + cvReleaseMemStorage(&m_pStorage); + cvReleaseHaarClassifierCascade(&m_cascade); +} + + +/*! \fn FaceDetectorPlugin::FaceDetectorPlugin(const FaceDetectorPlugin& source) + * \param source is the object for copying + */ +FaceDetectorPlugin::FaceDetectorPlugin(const FaceDetectorPlugin& source) + : Detector(source), + m_fScaleFactor(source.m_fScaleFactor), + m_nMinNeighbors(source.m_nMinNeighbors), + m_nFlag(source.m_nFlag), + m_fMinObjWidth(source.m_fMinObjWidth), + m_fMinObjHeight(source.m_fMinObjHeight), + m_cascade(NULL), + m_sHaarCascadePath(source.m_sHaarCascadePath) +{ + m_pStorage = cvCreateMemStorage(0); + if (m_sHaarCascadePath != string()) + _loadHaarCascade(m_sHaarCascadePath); +} + + + +/*! \fn FaceDetectorPlugin:: operator=(const FaceDetectorPlugin& source) + * \param source is the object for copying + */ +FaceDetectorPlugin & FaceDetectorPlugin:: operator=(const FaceDetectorPlugin& source) +{ + Detector::operator=(source); + m_fScaleFactor = source.m_fScaleFactor; + m_nMinNeighbors = source.m_nMinNeighbors; + m_nFlag = source.m_nFlag; + m_fMinObjWidth = source.m_fMinObjWidth; + m_fMinObjHeight = source.m_fMinObjHeight; + m_cascade = NULL; + m_sHaarCascadePath = source.m_sHaarCascadePath; + + m_pStorage = cvCreateMemStorage(0); + + if (m_sHaarCascadePath != string()) + _loadHaarCascade(m_sHaarCascadePath); + + return *this; +} + + + +/*! \fn FaceDetectorPlugin::_loadHaarCascade(string sConfigPath) + * \param sConfigPath is path to xml Haar classifier cascade. + */ +void FaceDetectorPlugin::_loadHaarCascade(string sConfigPath) +{ + m_sHaarCascadePath = sConfigPath; + if (m_cascade != NULL) + cvReleaseHaarClassifierCascade(&m_cascade); + + m_cascade = (CvHaarClassifierCascade*)cvLoad(sConfigPath.c_str()); + if (m_cascade == NULL) + throw invalid_argument((string("Couldn't load xml data: ") + sConfigPath + ".").c_str()); +} + + + + +/*! \fn FaceDetectorPlugin::_opencvHaarDetect(const CvMat* pMatImage) + * \param pMatImage is an image to perform face detection (in the form of OpenCv' CvMat) + */ +vector FaceDetectorPlugin::_opencvHaarDetect(const CvMat* pMatImage) +{ + CvSize minObjSize = cvSize((int) pMatImage->width * m_fMinObjWidth / 100.0, (int) pMatImage->height * m_fMinObjHeight / 100.0); + //char szMessage[50]; + //sprintf(szMessage, "IMAGE SIZE IS %d x %d \nMIN OBJ SIZE IS %d x %d", pMatImage->width, pMatImage->height, minObjSize.width, minObjSize.height); + //log(LOG_WARNING, szMessage); + + CvSeq* haarObjects = cvHaarDetectObjects(pMatImage, + m_cascade, + m_pStorage, + m_fScaleFactor, + m_nMinNeighbors, + m_nFlag, + minObjSize); + vector objects; + for (int i = 0; i < haarObjects->total; i++) + { + CvRect* pHaarRect = (CvRect*)cvGetSeqElem(haarObjects, i); + objects.push_back(*pHaarRect); + } + return objects; +} + + +/*! \fn FaceDetectorPlugin::checkZone(Zone *zone, const Image *zmImage) + * \param zone is a zone where faces will be detected + * \param zmImage is an image to perform face detection (in the form of ZM' Image) + * \return true if there were objects detected in given image and + * false otherwise + */ +bool FaceDetectorPlugin::checkZone(Zone *zone, const Image *zmImage) +{ + //log(LOG_DEBUG, "Entering checkZone."); + double score; + Polygon zone_polygon = Polygon(zone->GetPolygon()); // Polygon of interest of the processed zone. + //char szMessage[50]; + //sprintf(szMessage, "Polygon of the zone has %d vertices.", zone_polygon.getNumCoords()); + //log(LOG_WARNING, szMessage); + + //zone->ResetStats(); + + /* + log(LOG_WARNING, "precheck"); + if ( !zone->CheckOverloadCount() ) + { + log(LOG_WARNING, "CheckOverloadCount() return false, we'll return false."); + return(false); + } + */ + //zmLoadConfig(); + // An image for highlighting detected objects. + Image *pMaskImage = new Image(zmImage->Width(), zmImage->Height(), ZM_COLOUR_GRAY8, ZM_SUBPIX_ORDER_NONE ); + pMaskImage->Fill(BLACK); + + //log(LOG_WARNING, "FILLBLACK."); + // An temporary image in the form of ZM for making from it CvMat. + // If don't use temp image, after rgb->bgr it will change. + Image *tempZmImage = new Image(*zmImage); + CvMat* cvInputImage = NULL; + CvMat* pScaledImage = NULL; + + bool bDoResizing = (m_fImageScaleFactor != 1.0); // resize image or not + + if (tempZmImage->Colours() == ZM_COLOUR_GRAY8) + { + // if image is not colored, create an one-channel CvMat. + cvInputImage = cvCreateMat(tempZmImage->Height(), tempZmImage->Width(), CV_8UC1); + unsigned char *buffer = (unsigned char*)tempZmImage->Buffer(); + cvSetData(cvInputImage, buffer, tempZmImage->Width()); + } + // NEXTIME XXX TODO: manage also 32 bit images! + else + { + // otherwise create a three-channel CvMat and then convert colors from RGB to BGR. + cvInputImage = cvCreateMat(tempZmImage->Height(), tempZmImage->Width(), CV_8UC3); + unsigned char *buffer = (unsigned char*)tempZmImage->Buffer(); + cvSetData(cvInputImage, buffer, tempZmImage->Width() * 3); + cvCvtColor(cvInputImage, cvInputImage, CV_RGB2BGR); + } + + if (bDoResizing) + { + int nNewWidth = int (m_fImageScaleFactor * zmImage->Width()); + int nNewHeight = int (m_fImageScaleFactor * tempZmImage->Height()); + int nImageElemType = cvGetElemType(cvInputImage); + pScaledImage = cvCreateMat(nNewHeight, nNewWidth, nImageElemType); + cvResize(cvInputImage, pScaledImage, CV_INTER_LINEAR); + } + + + //Process image + + vector foundObjects; + if (bDoResizing) + foundObjects = _opencvHaarDetect(pScaledImage); + else + foundObjects = _opencvHaarDetect(cvInputImage); + + if (foundObjects.size() > 0) + log(LOG_INFO, "OBJECTS WERE DETECTED"); + + score = 0; + for (vector::iterator it = foundObjects.begin(); it < foundObjects.end(); it++) + { + // Process found objects. + + // Scale object's coordinates back if image has been scaled. + int x1 = int(it->x/m_fImageScaleFactor), x2 = int((it->x + it->width)/m_fImageScaleFactor), y1 = int(it->y/m_fImageScaleFactor), y2 = int((it->y + it->height)/m_fImageScaleFactor); + + // Check if object's rectangle is inside zone's polygon of interest. + Coord rectVertCoords[4] = {Coord(x1, y1), Coord(x1, y2), Coord(x2, y1), Coord(x2, y2)}; + int nNumVertInside = 0; + for (int i = 0; i < 4; i++) + { + nNumVertInside += zone_polygon.isInside(rectVertCoords[i]); + } + if (nNumVertInside < 3) + // if at least three rectangle coordinates are inside polygon, consider rectangle as belonging to the zone + // otherwise process next object + continue; + + // Fill a box with object in the mask + Box *faceBox = new Box(x1, y1, x2, y2); + pMaskImage->Fill(WHITE, faceBox); + // Calculate score as portion of object area in the image + score += (100.0*(it->width)*(it->height)/m_fImageScaleFactor/m_fImageScaleFactor)/zone_polygon.Area(); + delete faceBox; + } + + + if (score == 0) + { + //log(LOG_DEBUG, "No objects found. Exit."); + delete pMaskImage; + delete tempZmImage; + + if (cvInputImage) + cvReleaseMat(&cvInputImage); + if (pScaledImage) + cvReleaseMat(&pScaledImage); + + return( false ); + } + + + + if ( m_fMinAlarmScore && ( score < m_fMinAlarmScore) ) + { + delete pMaskImage; + delete tempZmImage; + + if (cvInputImage) + cvReleaseMat(&cvInputImage); + if (pScaledImage) + cvReleaseMat(&pScaledImage); + + return( false ); + } + if ( m_fMaxAlarmScore && (score > m_fMaxAlarmScore) ) + { + zone->SetOverloadCount(zone->GetOverloadFrames()); + delete pMaskImage; + delete tempZmImage; + + if (cvInputImage) + cvReleaseMat(&cvInputImage); + if (pScaledImage) + cvReleaseMat(&pScaledImage); + + return( false ); + } + + + zone->SetScore(max(1, (int)score)); + + //Get mask by highlighting contours of objects and overlaying them with previous contours. + Rgb alarm_colour = RGB_GREEN; + Image *hlZmImage = pMaskImage->HighlightEdges(alarm_colour, ZM_COLOUR_RGB24, + ZM_SUBPIX_ORDER_RGB, &zone_polygon.Extent()); + + if (zone->Alarmed()) + { + // if there were previous detection and they have already set up alarm image + // then overlay it with current mask + Image* pPrevZoneMask = new Image(*(zone->AlarmImage())); + pPrevZoneMask->Overlay(*hlZmImage); + zone->SetAlarmImage(pPrevZoneMask); + delete pPrevZoneMask; + } + else + zone->SetAlarmImage(hlZmImage); + + delete pMaskImage; + delete hlZmImage; + delete tempZmImage; + + if (cvInputImage) + cvReleaseMat(&cvInputImage); + if (pScaledImage) + cvReleaseMat(&pScaledImage); + + //log(LOG_DEBUG, "Leaving checkZone."); + return true; +} + + diff --git a/plugins/libzm_plugin_face_haar/src/face_detector_plugin.h b/plugins/libzm_plugin_face_haar/src/face_detector_plugin.h new file mode 100644 index 000000000..ccb9b9f04 --- /dev/null +++ b/plugins/libzm_plugin_face_haar/src/face_detector_plugin.h @@ -0,0 +1,102 @@ +#ifndef HAAR_DETECTOR_PLUGIN_H +#define HAAR_DETECTOR_PLUGIN_H + + +#include +#include +#include +#include + + +#include +#include +#include +#include + +#include "zm_plugin_manager.h" +#include "zm_detector.h" +#include "zm_rgb.h" + + + +#define DETECTED_CAUSE "Face Detected" +#define LOG_PREFIX "ZM FACEDET PLUGIN" + + +#define DEFAULT_HAAR_SCALE_FACTOR 1.1 +#define DEFAULT_HAAR_MIN_NEIGHBORS 3 +#define DEFAULT_HAAR_FLAG CV_HAAR_DO_CANNY_PRUNING +#define DEFAULT_DETECTOR_MIN_OBJECT_SIZE_WIDTH 5.0 +#define DEFAULT_DETECTOR_MIN_OBJECT_SIZE_HEIGHT 6.0 +#define DEFAULT_HAAR_FACE_CASCADE_PATH "/usr/local/share/opencv/haarcascades/haarcascade_frontalface_alt2.xml" + + + + +using namespace std; +using namespace boost::program_options; + + +//! Face detector plugin class. +/*! The class derived from Detector. + * This class provides face detection based on OpenCV's implementation of Haar cascade classifier detector. + */ +class FaceDetectorPlugin : public Detector { + public: + + //! Default Constructor. + FaceDetectorPlugin(); + + //! Constructor. + FaceDetectorPlugin(string sConfigSectionName); + + //! Destructor. + virtual ~FaceDetectorPlugin(); + + //! Copy constructor. + FaceDetectorPlugin(const FaceDetectorPlugin& source); + + //! Overloaded operator=. + FaceDetectorPlugin& operator=(const FaceDetectorPlugin& source); + + void loadConfig(string sConfigFileName); + +protected: + + bool checkZone(Zone *zone, const Image *zmImage); + + //! Path to the xml file with cascade. + string m_sHaarCascadePath; + + //! Cascade of classifiers. + CvHaarClassifierCascade* m_cascade; + + //! Scale factor. + double m_fScaleFactor; + + //! Minimum number (minus 1) of neighbors rectangles that makes up an object. + size_t m_nMinNeighbors; + + //! Mode of operation. + int m_nFlag; + + //! Minimal object's sizes. + double m_fMinObjWidth; + double m_fMinObjHeight; + + //! Pointer to storage for calculations. + CvMemStorage* m_pStorage; + +private: + + //! Load xml Haar cascade file. + void _loadHaarCascade(string sConfigPath); + + //! Detect faces on OpenCV' CvMat image. + vector _opencvHaarDetect(const CvMat* pMatImage); +}; + + + +#endif //HAAR_DETECTOR_PLUGIN_H + diff --git a/scripts/Makefile.am b/scripts/Makefile.am new file mode 100644 index 000000000..bbdcb282e --- /dev/null +++ b/scripts/Makefile.am @@ -0,0 +1,75 @@ +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 \ + zmtrigger.pl \ + zmx10.pl \ + zmwatch.pl \ + zmpkg.pl \ + zmupdate.pl \ + zmvideo.pl \ + zmcontrol.pl \ + zmtrack.pl + +SUBDIRS = \ + . \ + ZoneMinder + +EXTRA_DIST = \ + zmdc.pl.in \ + zmaudit.pl.in \ + zmfilter.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 \ + 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/PelcoD.pm \ + ZoneMinder/lib/ZoneMinder/Control/AxisV2.pm \ + ZoneMinder/lib/ZoneMinder/Control/PanasonicIP.pm \ + ZoneMinder/lib/ZoneMinder/Control/Visca.pm \ + ZoneMinder/lib/ZoneMinder/Control/Ncs370.pm \ + ZoneMinder/lib/ZoneMinder/Control/mjpgStreamer.pm \ + 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 diff --git a/scripts/Makefile.in b/scripts/Makefile.in new file mode 100644 index 000000000..e6931d899 --- /dev/null +++ b/scripts/Makefile.in @@ -0,0 +1,778 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = scripts +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/zm.in $(srcdir)/zmaudit.pl.in \ + $(srcdir)/zmcontrol.pl.in $(srcdir)/zmdbbackup.in \ + $(srcdir)/zmdbrestore.in $(srcdir)/zmdc.pl.in \ + $(srcdir)/zmeventdump.in $(srcdir)/zmfilter.pl.in \ + $(srcdir)/zmlogrotate.conf.in $(srcdir)/zmpkg.pl.in \ + $(srcdir)/zmtrack.pl.in $(srcdir)/zmtrigger.pl.in \ + $(srcdir)/zmupdate.pl.in $(srcdir)/zmvideo.pl.in \ + $(srcdir)/zmwatch.pl.in $(srcdir)/zmx10.pl.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = zm zmaudit.pl zmcontrol.pl zmdc.pl zmfilter.pl \ + zmpkg.pl zmtrack.pl zmtrigger.pl zmupdate.pl zmvideo.pl \ + zmwatch.pl zmx10.pl zmdbbackup zmdbrestore zmeventdump \ + zmlogrotate.conf +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(bindir)" +SCRIPTS = $(bin_SCRIPTS) +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +bin_SCRIPTS = \ + zmdc.pl \ + zmaudit.pl \ + zmfilter.pl \ + zmtrigger.pl \ + zmx10.pl \ + zmwatch.pl \ + zmpkg.pl \ + zmupdate.pl \ + zmvideo.pl \ + zmcontrol.pl \ + zmtrack.pl + +SUBDIRS = \ + . \ + ZoneMinder + +EXTRA_DIST = \ + zmdc.pl.in \ + zmaudit.pl.in \ + zmfilter.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 \ + 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/PelcoD.pm \ + ZoneMinder/lib/ZoneMinder/Control/AxisV2.pm \ + ZoneMinder/lib/ZoneMinder/Control/PanasonicIP.pm \ + ZoneMinder/lib/ZoneMinder/Control/Visca.pm \ + ZoneMinder/lib/ZoneMinder/Control/Ncs370.pm \ + ZoneMinder/lib/ZoneMinder/Control/mjpgStreamer.pm \ + 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 + +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu scripts/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +zm: $(top_builddir)/config.status $(srcdir)/zm.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +zmaudit.pl: $(top_builddir)/config.status $(srcdir)/zmaudit.pl.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +zmcontrol.pl: $(top_builddir)/config.status $(srcdir)/zmcontrol.pl.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +zmdc.pl: $(top_builddir)/config.status $(srcdir)/zmdc.pl.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +zmfilter.pl: $(top_builddir)/config.status $(srcdir)/zmfilter.pl.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +zmpkg.pl: $(top_builddir)/config.status $(srcdir)/zmpkg.pl.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +zmtrack.pl: $(top_builddir)/config.status $(srcdir)/zmtrack.pl.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +zmtrigger.pl: $(top_builddir)/config.status $(srcdir)/zmtrigger.pl.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +zmupdate.pl: $(top_builddir)/config.status $(srcdir)/zmupdate.pl.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +zmvideo.pl: $(top_builddir)/config.status $(srcdir)/zmvideo.pl.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +zmwatch.pl: $(top_builddir)/config.status $(srcdir)/zmwatch.pl.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +zmx10.pl: $(top_builddir)/config.status $(srcdir)/zmx10.pl.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +zmdbbackup: $(top_builddir)/config.status $(srcdir)/zmdbbackup.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +zmdbrestore: $(top_builddir)/config.status $(srcdir)/zmdbrestore.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +zmeventdump: $(top_builddir)/config.status $(srcdir)/zmeventdump.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +zmlogrotate.conf: $(top_builddir)/config.status $(srcdir)/zmlogrotate.conf.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-binSCRIPTS: $(bin_SCRIPTS) + @$(NORMAL_INSTALL) + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(SCRIPTS) all-local +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-binSCRIPTS + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-binSCRIPTS + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am all-local check check-am clean clean-generic ctags \ + ctags-recursive distclean distclean-generic distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-binSCRIPTS install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-binSCRIPTS + + +# 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 ) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/scripts/ZoneMinder/Changes b/scripts/ZoneMinder/Changes new file mode 100644 index 000000000..cc20050e5 --- /dev/null +++ b/scripts/ZoneMinder/Changes @@ -0,0 +1,6 @@ +Revision history for Perl extension ZoneMinder. + +0.01 Thu Dec 15 17:22:29 2005 + - original version; created by h2xs 1.23 with options + -XA -b 5.6.0 -n ZoneMinder + diff --git a/scripts/ZoneMinder/MANIFEST b/scripts/ZoneMinder/MANIFEST new file mode 100644 index 000000000..f1bd05da8 --- /dev/null +++ b/scripts/ZoneMinder/MANIFEST @@ -0,0 +1,7 @@ +Changes +Makefile.PL +MANIFEST +README +t/ZoneMinder.t +lib/ZoneMinder.pm +META.yml Module meta-data (added by MakeMaker) diff --git a/scripts/ZoneMinder/META.yml b/scripts/ZoneMinder/META.yml new file mode 100644 index 000000000..7d062554d --- /dev/null +++ b/scripts/ZoneMinder/META.yml @@ -0,0 +1,10 @@ +# http://module-build.sourceforge.net/META-spec.html +#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# +name: ZoneMinder +version: 1.23.2 +version_from: lib/ZoneMinder/Base.pm +installdirs: site +requires: + +distribution_type: module +generated_by: ExtUtils::MakeMaker version 6.17 diff --git a/scripts/ZoneMinder/MYMETA.yml b/scripts/ZoneMinder/MYMETA.yml new file mode 100644 index 000000000..8d77ebdf2 --- /dev/null +++ b/scripts/ZoneMinder/MYMETA.yml @@ -0,0 +1,22 @@ +--- +abstract: 'Container module for common ZoneMinder modules' +author: + - 'Philip Coombes ' +build_requires: + ExtUtils::MakeMaker: 0 +configure_requires: + ExtUtils::MakeMaker: 0 +distribution_type: module +dynamic_config: 0 +generated_by: 'ExtUtils::MakeMaker version 6.57_05' +license: unknown +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 +name: ZoneMinder +no_index: + directory: + - t + - inc +requires: {} +version: 1.25.0 diff --git a/scripts/ZoneMinder/Makefile.PL b/scripts/ZoneMinder/Makefile.PL new file mode 100644 index 000000000..c7a7434c8 --- /dev/null +++ b/scripts/ZoneMinder/Makefile.PL @@ -0,0 +1,41 @@ +use 5.006; +use ExtUtils::MakeMaker; +# See lib/ExtUtils/MakeMaker.pm for details of how to influence +# the contents of the Makefile that is written. +WriteMakefile( + NAME => 'ZoneMinder', + VERSION_FROM => 'lib/ZoneMinder/Base.pm', # finds $VERSION + PREREQ_PM => {}, # e.g., Module::Name => 1.1 + PM => { + 'lib/ZoneMinder.pm' => '$(INST_LIBDIR)/ZoneMinder.pm', + 'lib/ZoneMinder/Base.pm' => '$(INST_LIBDIR)/ZoneMinder/Base.pm', + 'lib/ZoneMinder/Config.pm' => '$(INST_LIBDIR)/ZoneMinder/Config.pm', + 'lib/ZoneMinder/General.pm' => '$(INST_LIBDIR)/ZoneMinder/General.pm', + 'lib/ZoneMinder/Database.pm' => '$(INST_LIBDIR)/ZoneMinder/Database.pm', + 'lib/ZoneMinder/Logger.pm' => '$(INST_LIBDIR)/ZoneMinder/Logger.pm', + 'lib/ZoneMinder/Memory.pm' => '$(INST_LIBDIR)/ZoneMinder/Memory.pm', + 'lib/ZoneMinder/Memory/Shared.pm' => '$(INST_LIBDIR)/ZoneMinder/Memory/Shared.pm', + 'lib/ZoneMinder/Memory/Mapped.pm' => '$(INST_LIBDIR)/ZoneMinder/Memory/Mapped.pm', + 'lib/ZoneMinder/ConfigAdmin.pm' => '$(INST_LIBDIR)/ZoneMinder/ConfigAdmin.pm', + 'lib/ZoneMinder/ConfigData.pm' => '$(INST_LIBDIR)/ZoneMinder/ConfigData.pm', + 'lib/ZoneMinder/Control.pm' => '$(INST_LIBDIR)/ZoneMinder/Control.pm', + 'lib/ZoneMinder/Control/PelcoD.pm' => '$(INST_LIBDIR)/ZoneMinder/Control/PelcoD.pm', + 'lib/ZoneMinder/Control/AxisV2.pm' => '$(INST_LIBDIR)/ZoneMinder/Control/AxisV2.pm', + 'lib/ZoneMinder/Control/PanasonicIP.pm' => '$(INST_LIBDIR)/ZoneMinder/Control/PanasonicIP.pm', + 'lib/ZoneMinder/Control/Visca.pm' => '$(INST_LIBDIR)/ZoneMinder/Control/Visca.pm', + 'lib/ZoneMinder/Control/Ncs370.pm' => '$(INST_LIBDIR)/ZoneMinder/Control/Ncs370.pm', + 'lib/ZoneMinder/Control/mjpgStreamer.pm' => '$(INST_LIBDIR)/ZoneMinder/Control/mjpgStreamer.pm', + 'lib/ZoneMinder/Trigger/Channel.pm' => '$(INST_LIBDIR)/ZoneMinder/Trigger/Channel.pm', + 'lib/ZoneMinder/Trigger/Channel/Handle.pm' => '$(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Handle.pm', + 'lib/ZoneMinder/Trigger/Channel/Spawning.pm' => '$(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Spawning.pm', + 'lib/ZoneMinder/Trigger/Channel/Inet.pm' => '$(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Inet.pm', + 'lib/ZoneMinder/Trigger/Channel/Unix.pm' => '$(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Unix.pm', + 'lib/ZoneMinder/Trigger/Channel/File.pm' => '$(INST_LIBDIR)/ZoneMinder/Trigger/Channel/File.pm', + 'lib/ZoneMinder/Trigger/Channel/Serial.pm' => '$(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Serial.pm', + 'lib/ZoneMinder/Trigger/Connection.pm' => '$(INST_LIBDIR)/ZoneMinder/Trigger/Connection.pm', + 'lib/ZoneMinder/Trigger/Connection/Example.pm' => '$(INST_LIBDIR)/ZoneMinder/Trigger/Connection/Example.pm', + }, + ($] >= 5.005 ? ## Add these new keywords supported since 5.005 + (ABSTRACT_FROM => 'lib/ZoneMinder.pm', # retrieve abstract from module + AUTHOR => 'Philip Coombes ') : ()), +); diff --git a/scripts/ZoneMinder/Makefile.old b/scripts/ZoneMinder/Makefile.old new file mode 100644 index 000000000..63b65fd11 --- /dev/null +++ b/scripts/ZoneMinder/Makefile.old @@ -0,0 +1,965 @@ +# This Makefile is for the ZoneMinder extension to perl. +# +# It was generated automatically by MakeMaker version +# 6.57_05 (Revision: 65705) from the contents of +# Makefile.PL. Don't edit this file, edit Makefile.PL instead. +# +# ANY CHANGES MADE HERE WILL BE LOST! +# +# MakeMaker ARGV: () +# + +# MakeMaker Parameters: + +# ABSTRACT_FROM => q[lib/ZoneMinder.pm] +# AUTHOR => [q[Philip Coombes ]] +# BUILD_REQUIRES => { } +# NAME => q[ZoneMinder] +# PM => { lib/ZoneMinder/Trigger/Connection.pm=>q[$(INST_LIBDIR)/ZoneMinder/Trigger/Connection.pm], lib/ZoneMinder/Control/Ncs370.pm=>q[$(INST_LIBDIR)/ZoneMinder/Control/Ncs370.pm], lib/ZoneMinder/Trigger/Channel/Serial.pm=>q[$(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Serial.pm], lib/ZoneMinder/Memory/Shared.pm=>q[$(INST_LIBDIR)/ZoneMinder/Memory/Shared.pm], lib/ZoneMinder.pm=>q[$(INST_LIBDIR)/ZoneMinder.pm], lib/ZoneMinder/Config.pm=>q[$(INST_LIBDIR)/ZoneMinder/Config.pm], lib/ZoneMinder/Control/mjpgStreamer.pm=>q[$(INST_LIBDIR)/ZoneMinder/Control/mjpgStreamer.pm], lib/ZoneMinder/Trigger/Channel/Unix.pm=>q[$(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Unix.pm], lib/ZoneMinder/Control/PanasonicIP.pm=>q[$(INST_LIBDIR)/ZoneMinder/Control/PanasonicIP.pm], lib/ZoneMinder/Base.pm=>q[$(INST_LIBDIR)/ZoneMinder/Base.pm], lib/ZoneMinder/Control/AxisV2.pm=>q[$(INST_LIBDIR)/ZoneMinder/Control/AxisV2.pm], lib/ZoneMinder/Memory/Mapped.pm=>q[$(INST_LIBDIR)/ZoneMinder/Memory/Mapped.pm], lib/ZoneMinder/Trigger/Channel.pm=>q[$(INST_LIBDIR)/ZoneMinder/Trigger/Channel.pm], lib/ZoneMinder/Memory.pm=>q[$(INST_LIBDIR)/ZoneMinder/Memory.pm], lib/ZoneMinder/Trigger/Channel/File.pm=>q[$(INST_LIBDIR)/ZoneMinder/Trigger/Channel/File.pm], lib/ZoneMinder/Database.pm=>q[$(INST_LIBDIR)/ZoneMinder/Database.pm], lib/ZoneMinder/ConfigData.pm=>q[$(INST_LIBDIR)/ZoneMinder/ConfigData.pm], lib/ZoneMinder/Control/PelcoD.pm=>q[$(INST_LIBDIR)/ZoneMinder/Control/PelcoD.pm], lib/ZoneMinder/Control/Visca.pm=>q[$(INST_LIBDIR)/ZoneMinder/Control/Visca.pm], lib/ZoneMinder/Trigger/Channel/Inet.pm=>q[$(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Inet.pm], lib/ZoneMinder/Logger.pm=>q[$(INST_LIBDIR)/ZoneMinder/Logger.pm], lib/ZoneMinder/Trigger/Connection/Example.pm=>q[$(INST_LIBDIR)/ZoneMinder/Trigger/Connection/Example.pm], lib/ZoneMinder/Trigger/Channel/Spawning.pm=>q[$(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Spawning.pm], lib/ZoneMinder/Control.pm=>q[$(INST_LIBDIR)/ZoneMinder/Control.pm], lib/ZoneMinder/General.pm=>q[$(INST_LIBDIR)/ZoneMinder/General.pm], lib/ZoneMinder/Trigger/Channel/Handle.pm=>q[$(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Handle.pm], lib/ZoneMinder/ConfigAdmin.pm=>q[$(INST_LIBDIR)/ZoneMinder/ConfigAdmin.pm] } +# PREREQ_PM => { } +# VERSION_FROM => q[lib/ZoneMinder/Base.pm] + +# --- MakeMaker post_initialize section: + + +# --- MakeMaker const_config section: + +# These definitions are from config.sh (via /usr/lib/perl/5.14/Config.pm). +# They may have been overridden via Makefile.PL or on the command line. +AR = ar +CC = cc +CCCDLFLAGS = -fPIC +CCDLFLAGS = -Wl,-E +DLEXT = so +DLSRC = dl_dlopen.xs +EXE_EXT = +FULL_AR = /usr/bin/ar +LD = cc +LDDLFLAGS = -shared -L/usr/local/lib -fstack-protector +LDFLAGS = -fstack-protector -L/usr/local/lib +LIBC = +LIB_EXT = .a +OBJ_EXT = .o +OSNAME = linux +OSVERS = 2.6.32-5-amd64 +RANLIB = : +SITELIBEXP = /usr/local/share/perl/5.14.2 +SITEARCHEXP = /usr/local/lib/perl/5.14.2 +SO = so +VENDORARCHEXP = /usr/lib/perl5 +VENDORLIBEXP = /usr/share/perl5 + + +# --- MakeMaker constants section: +AR_STATIC_ARGS = cr +DIRFILESEP = / +DFSEP = $(DIRFILESEP) +NAME = ZoneMinder +NAME_SYM = ZoneMinder +VERSION = 1.25.0 +VERSION_MACRO = VERSION +VERSION_SYM = 1_25_0 +DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\" +XS_VERSION = 1.25.0 +XS_VERSION_MACRO = XS_VERSION +XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\" +INST_ARCHLIB = blib/arch +INST_SCRIPT = blib/script +INST_BIN = blib/bin +INST_LIB = blib/lib +INST_MAN1DIR = blib/man1 +INST_MAN3DIR = blib/man3 +MAN1EXT = 1p +MAN3EXT = 3pm +INSTALLDIRS = site +DESTDIR = +PREFIX = /usr +PERLPREFIX = $(PREFIX) +SITEPREFIX = $(PREFIX)/local +VENDORPREFIX = $(PREFIX) +INSTALLPRIVLIB = $(PERLPREFIX)/share/perl/5.14 +DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB) +INSTALLSITELIB = $(SITEPREFIX)/share/perl/5.14.2 +DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB) +INSTALLVENDORLIB = $(VENDORPREFIX)/share/perl5 +DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB) +INSTALLARCHLIB = $(PERLPREFIX)/lib/perl/5.14 +DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB) +INSTALLSITEARCH = $(SITEPREFIX)/lib/perl/5.14.2 +DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH) +INSTALLVENDORARCH = $(VENDORPREFIX)/lib/perl5 +DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH) +INSTALLBIN = $(PERLPREFIX)/bin +DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN) +INSTALLSITEBIN = $(SITEPREFIX)/bin +DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN) +INSTALLVENDORBIN = $(VENDORPREFIX)/bin +DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN) +INSTALLSCRIPT = $(PERLPREFIX)/bin +DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT) +INSTALLSITESCRIPT = $(SITEPREFIX)/bin +DESTINSTALLSITESCRIPT = $(DESTDIR)$(INSTALLSITESCRIPT) +INSTALLVENDORSCRIPT = $(VENDORPREFIX)/bin +DESTINSTALLVENDORSCRIPT = $(DESTDIR)$(INSTALLVENDORSCRIPT) +INSTALLMAN1DIR = $(PERLPREFIX)/share/man/man1 +DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR) +INSTALLSITEMAN1DIR = $(SITEPREFIX)/man/man1 +DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR) +INSTALLVENDORMAN1DIR = $(VENDORPREFIX)/share/man/man1 +DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR) +INSTALLMAN3DIR = $(PERLPREFIX)/share/man/man3 +DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR) +INSTALLSITEMAN3DIR = $(SITEPREFIX)/man/man3 +DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR) +INSTALLVENDORMAN3DIR = $(VENDORPREFIX)/share/man/man3 +DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR) +PERL_LIB = /usr/share/perl/5.14 +PERL_ARCHLIB = /usr/lib/perl/5.14 +LIBPERL_A = libperl.a +FIRST_MAKEFILE = Makefile +MAKEFILE_OLD = Makefile.old +MAKE_APERL_FILE = Makefile.aperl +PERLMAINCC = $(CC) +PERL_INC = /usr/lib/perl/5.14/CORE +PERL = /usr/bin/perl +FULLPERL = /usr/bin/perl +ABSPERL = $(PERL) +PERLRUN = $(PERL) +FULLPERLRUN = $(FULLPERL) +ABSPERLRUN = $(ABSPERL) +PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" +FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" +ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" +PERL_CORE = 0 +PERM_DIR = 755 +PERM_RW = 644 +PERM_RWX = 755 + +MAKEMAKER = /usr/share/perl/5.14/ExtUtils/MakeMaker.pm +MM_VERSION = 6.57_05 +MM_REVISION = 65705 + +# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle). +# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle) +# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar) +# DLBASE = Basename part of dynamic library. May be just equal BASEEXT. +MAKE = make +FULLEXT = ZoneMinder +BASEEXT = ZoneMinder +PARENT_NAME = +DLBASE = $(BASEEXT) +VERSION_FROM = lib/ZoneMinder/Base.pm +OBJECT = +LDFROM = $(OBJECT) +LINKTYPE = dynamic +BOOTDEP = + +# Handy lists of source code files: +XS_FILES = +C_FILES = +O_FILES = +H_FILES = +MAN1PODS = +MAN3PODS = lib/ZoneMinder.pm \ + lib/ZoneMinder/Base.pm \ + lib/ZoneMinder/Config.pm \ + lib/ZoneMinder/ConfigAdmin.pm \ + lib/ZoneMinder/ConfigData.pm \ + lib/ZoneMinder/Control.pm \ + lib/ZoneMinder/Control/AxisV2.pm \ + lib/ZoneMinder/Control/Ncs370.pm \ + lib/ZoneMinder/Control/PanasonicIP.pm \ + lib/ZoneMinder/Control/PelcoD.pm \ + lib/ZoneMinder/Control/Visca.pm \ + lib/ZoneMinder/Control/mjpgStreamer.pm \ + lib/ZoneMinder/Database.pm \ + lib/ZoneMinder/General.pm \ + lib/ZoneMinder/Logger.pm \ + lib/ZoneMinder/Memory.pm \ + lib/ZoneMinder/Trigger/Channel.pm \ + lib/ZoneMinder/Trigger/Channel/File.pm \ + lib/ZoneMinder/Trigger/Channel/Handle.pm \ + lib/ZoneMinder/Trigger/Channel/Inet.pm \ + lib/ZoneMinder/Trigger/Channel/Serial.pm \ + lib/ZoneMinder/Trigger/Channel/Spawning.pm \ + lib/ZoneMinder/Trigger/Channel/Unix.pm \ + lib/ZoneMinder/Trigger/Connection.pm \ + lib/ZoneMinder/Trigger/Connection/Example.pm + +# Where is the Config information that we are using/depend on +CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h + +# Where to build things +INST_LIBDIR = $(INST_LIB) +INST_ARCHLIBDIR = $(INST_ARCHLIB) + +INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT) +INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT) + +INST_STATIC = +INST_DYNAMIC = +INST_BOOT = + +# Extra linker info +EXPORT_LIST = +PERL_ARCHIVE = +PERL_ARCHIVE_AFTER = + + +TO_INST_PM = lib/ZoneMinder.pm \ + lib/ZoneMinder/Base.pm \ + lib/ZoneMinder/Config.pm \ + lib/ZoneMinder/ConfigAdmin.pm \ + lib/ZoneMinder/ConfigData.pm \ + lib/ZoneMinder/Control.pm \ + lib/ZoneMinder/Control/AxisV2.pm \ + lib/ZoneMinder/Control/Ncs370.pm \ + lib/ZoneMinder/Control/PanasonicIP.pm \ + lib/ZoneMinder/Control/PelcoD.pm \ + lib/ZoneMinder/Control/Visca.pm \ + lib/ZoneMinder/Control/mjpgStreamer.pm \ + lib/ZoneMinder/Database.pm \ + lib/ZoneMinder/General.pm \ + lib/ZoneMinder/Logger.pm \ + lib/ZoneMinder/Memory.pm \ + lib/ZoneMinder/Memory/Mapped.pm \ + lib/ZoneMinder/Memory/Shared.pm \ + lib/ZoneMinder/Trigger/Channel.pm \ + lib/ZoneMinder/Trigger/Channel/File.pm \ + lib/ZoneMinder/Trigger/Channel/Handle.pm \ + lib/ZoneMinder/Trigger/Channel/Inet.pm \ + lib/ZoneMinder/Trigger/Channel/Serial.pm \ + lib/ZoneMinder/Trigger/Channel/Spawning.pm \ + lib/ZoneMinder/Trigger/Channel/Unix.pm \ + lib/ZoneMinder/Trigger/Connection.pm \ + lib/ZoneMinder/Trigger/Connection/Example.pm + +PM_TO_BLIB = lib/ZoneMinder/Trigger/Connection.pm \ + $(INST_LIBDIR)/ZoneMinder/Trigger/Connection.pm \ + lib/ZoneMinder/Control/Ncs370.pm \ + $(INST_LIBDIR)/ZoneMinder/Control/Ncs370.pm \ + lib/ZoneMinder/Trigger/Channel/Serial.pm \ + $(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Serial.pm \ + lib/ZoneMinder/Memory/Shared.pm \ + $(INST_LIBDIR)/ZoneMinder/Memory/Shared.pm \ + lib/ZoneMinder.pm \ + $(INST_LIBDIR)/ZoneMinder.pm \ + lib/ZoneMinder/Config.pm \ + $(INST_LIBDIR)/ZoneMinder/Config.pm \ + lib/ZoneMinder/Control/mjpgStreamer.pm \ + $(INST_LIBDIR)/ZoneMinder/Control/mjpgStreamer.pm \ + lib/ZoneMinder/Trigger/Channel/Unix.pm \ + $(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Unix.pm \ + lib/ZoneMinder/Control/PanasonicIP.pm \ + $(INST_LIBDIR)/ZoneMinder/Control/PanasonicIP.pm \ + lib/ZoneMinder/Base.pm \ + $(INST_LIBDIR)/ZoneMinder/Base.pm \ + lib/ZoneMinder/Control/AxisV2.pm \ + $(INST_LIBDIR)/ZoneMinder/Control/AxisV2.pm \ + lib/ZoneMinder/Memory/Mapped.pm \ + $(INST_LIBDIR)/ZoneMinder/Memory/Mapped.pm \ + lib/ZoneMinder/Trigger/Channel.pm \ + $(INST_LIBDIR)/ZoneMinder/Trigger/Channel.pm \ + lib/ZoneMinder/Memory.pm \ + $(INST_LIBDIR)/ZoneMinder/Memory.pm \ + lib/ZoneMinder/Trigger/Channel/File.pm \ + $(INST_LIBDIR)/ZoneMinder/Trigger/Channel/File.pm \ + lib/ZoneMinder/Database.pm \ + $(INST_LIBDIR)/ZoneMinder/Database.pm \ + lib/ZoneMinder/ConfigData.pm \ + $(INST_LIBDIR)/ZoneMinder/ConfigData.pm \ + lib/ZoneMinder/Control/PelcoD.pm \ + $(INST_LIBDIR)/ZoneMinder/Control/PelcoD.pm \ + lib/ZoneMinder/Control/Visca.pm \ + $(INST_LIBDIR)/ZoneMinder/Control/Visca.pm \ + lib/ZoneMinder/Trigger/Channel/Inet.pm \ + $(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Inet.pm \ + lib/ZoneMinder/Logger.pm \ + $(INST_LIBDIR)/ZoneMinder/Logger.pm \ + lib/ZoneMinder/Trigger/Connection/Example.pm \ + $(INST_LIBDIR)/ZoneMinder/Trigger/Connection/Example.pm \ + lib/ZoneMinder/Trigger/Channel/Spawning.pm \ + $(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Spawning.pm \ + lib/ZoneMinder/Control.pm \ + $(INST_LIBDIR)/ZoneMinder/Control.pm \ + lib/ZoneMinder/General.pm \ + $(INST_LIBDIR)/ZoneMinder/General.pm \ + lib/ZoneMinder/Trigger/Channel/Handle.pm \ + $(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Handle.pm \ + lib/ZoneMinder/ConfigAdmin.pm \ + $(INST_LIBDIR)/ZoneMinder/ConfigAdmin.pm + + +# --- MakeMaker platform_constants section: +MM_Unix_VERSION = 6.57_05 +PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc + + +# --- MakeMaker tool_autosplit section: +# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto +AUTOSPLITFILE = $(ABSPERLRUN) -e 'use AutoSplit; autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1)' -- + + + +# --- MakeMaker tool_xsubpp section: + + +# --- MakeMaker tools_other section: +SHELL = /bin/sh +CHMOD = chmod +CP = cp +MV = mv +NOOP = $(TRUE) +NOECHO = @ +RM_F = rm -f +RM_RF = rm -rf +TEST_F = test -f +TOUCH = touch +UMASK_NULL = umask 0 +DEV_NULL = > /dev/null 2>&1 +MKPATH = $(ABSPERLRUN) -MExtUtils::Command -e 'mkpath' -- +EQUALIZE_TIMESTAMP = $(ABSPERLRUN) -MExtUtils::Command -e 'eqtime' -- +FALSE = false +TRUE = true +ECHO = echo +ECHO_N = echo -n +UNINST = 0 +VERBINST = 0 +MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install([ from_to => {@ARGV}, verbose => '\''$(VERBINST)'\'', uninstall_shadows => '\''$(UNINST)'\'', dir_mode => '\''$(PERM_DIR)'\'' ]);' -- +DOC_INSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'perllocal_install' -- +UNINSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'uninstall' -- +WARN_IF_OLD_PACKLIST = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'warn_if_old_packlist' -- +MACROSTART = +MACROEND = +USEMAKEFILE = -f +FIXIN = $(ABSPERLRUN) -MExtUtils::MY -e 'MY->fixin(shift)' -- + + +# --- MakeMaker makemakerdflt section: +makemakerdflt : all + $(NOECHO) $(NOOP) + + +# --- MakeMaker dist section: +TAR = tar +TARFLAGS = cvf +ZIP = zip +ZIPFLAGS = -r +COMPRESS = gzip --best +SUFFIX = .gz +SHAR = shar +PREOP = $(NOECHO) $(NOOP) +POSTOP = $(NOECHO) $(NOOP) +TO_UNIX = $(NOECHO) $(NOOP) +CI = ci -u +RCS_LABEL = rcs -Nv$(VERSION_SYM): -q +DIST_CP = best +DIST_DEFAULT = tardist +DISTNAME = ZoneMinder +DISTVNAME = ZoneMinder-1.25.0 + + +# --- MakeMaker macro section: + + +# --- MakeMaker depend section: + + +# --- MakeMaker cflags section: + + +# --- MakeMaker const_loadlibs section: + + +# --- MakeMaker const_cccmd section: + + +# --- MakeMaker post_constants section: + + +# --- MakeMaker pasthru section: + +PASTHRU = LIBPERL_A="$(LIBPERL_A)"\ + LINKTYPE="$(LINKTYPE)"\ + LD="$(LD)"\ + PREFIX="$(PREFIX)" + + +# --- MakeMaker special_targets section: +.SUFFIXES : .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT) + +.PHONY: all config static dynamic test linkext manifest blibdirs clean realclean disttest distdir + + + +# --- MakeMaker c_o section: + + +# --- MakeMaker xs_c section: + + +# --- MakeMaker xs_o section: + + +# --- MakeMaker top_targets section: +all :: pure_all manifypods + $(NOECHO) $(NOOP) + + +pure_all :: config pm_to_blib subdirs linkext + $(NOECHO) $(NOOP) + +subdirs :: $(MYEXTLIB) + $(NOECHO) $(NOOP) + +config :: $(FIRST_MAKEFILE) blibdirs + $(NOECHO) $(NOOP) + +help : + perldoc ExtUtils::MakeMaker + + +# --- MakeMaker blibdirs section: +blibdirs : $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists + $(NOECHO) $(NOOP) + +# Backwards compat with 6.18 through 6.25 +blibdirs.ts : blibdirs + $(NOECHO) $(NOOP) + +$(INST_LIBDIR)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_LIBDIR) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_LIBDIR) + $(NOECHO) $(TOUCH) $(INST_LIBDIR)$(DFSEP).exists + +$(INST_ARCHLIB)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_ARCHLIB) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHLIB) + $(NOECHO) $(TOUCH) $(INST_ARCHLIB)$(DFSEP).exists + +$(INST_AUTODIR)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_AUTODIR) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_AUTODIR) + $(NOECHO) $(TOUCH) $(INST_AUTODIR)$(DFSEP).exists + +$(INST_ARCHAUTODIR)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHAUTODIR) + $(NOECHO) $(TOUCH) $(INST_ARCHAUTODIR)$(DFSEP).exists + +$(INST_BIN)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_BIN) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_BIN) + $(NOECHO) $(TOUCH) $(INST_BIN)$(DFSEP).exists + +$(INST_SCRIPT)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_SCRIPT) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_SCRIPT) + $(NOECHO) $(TOUCH) $(INST_SCRIPT)$(DFSEP).exists + +$(INST_MAN1DIR)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_MAN1DIR) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN1DIR) + $(NOECHO) $(TOUCH) $(INST_MAN1DIR)$(DFSEP).exists + +$(INST_MAN3DIR)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_MAN3DIR) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN3DIR) + $(NOECHO) $(TOUCH) $(INST_MAN3DIR)$(DFSEP).exists + + + +# --- MakeMaker linkext section: + +linkext :: $(LINKTYPE) + $(NOECHO) $(NOOP) + + +# --- MakeMaker dlsyms section: + + +# --- MakeMaker dynamic section: + +dynamic :: $(FIRST_MAKEFILE) $(INST_DYNAMIC) $(INST_BOOT) + $(NOECHO) $(NOOP) + + +# --- MakeMaker dynamic_bs section: + +BOOTSTRAP = + + +# --- MakeMaker dynamic_lib section: + + +# --- MakeMaker static section: + +## $(INST_PM) has been moved to the all: target. +## It remains here for awhile to allow for old usage: "make static" +static :: $(FIRST_MAKEFILE) $(INST_STATIC) + $(NOECHO) $(NOOP) + + +# --- MakeMaker static_lib section: + + +# --- MakeMaker manifypods section: + +POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--" +POD2MAN = $(POD2MAN_EXE) + + +manifypods : pure_all \ + lib/ZoneMinder/Trigger/Connection.pm \ + lib/ZoneMinder/Control/Ncs370.pm \ + lib/ZoneMinder/Trigger/Channel/Serial.pm \ + lib/ZoneMinder.pm \ + lib/ZoneMinder/Config.pm \ + lib/ZoneMinder/Control/mjpgStreamer.pm \ + lib/ZoneMinder/Control/PanasonicIP.pm \ + lib/ZoneMinder/Base.pm \ + lib/ZoneMinder/Trigger/Channel/Unix.pm \ + lib/ZoneMinder/Control/AxisV2.pm \ + lib/ZoneMinder/Trigger/Channel.pm \ + lib/ZoneMinder/Memory.pm \ + lib/ZoneMinder/Trigger/Channel/File.pm \ + lib/ZoneMinder/Database.pm \ + lib/ZoneMinder/ConfigData.pm \ + lib/ZoneMinder/Control/PelcoD.pm \ + lib/ZoneMinder/Control/Visca.pm \ + lib/ZoneMinder/Trigger/Channel/Inet.pm \ + lib/ZoneMinder/Logger.pm \ + lib/ZoneMinder/Trigger/Connection/Example.pm \ + lib/ZoneMinder/Trigger/Channel/Spawning.pm \ + lib/ZoneMinder/Control.pm \ + lib/ZoneMinder/General.pm \ + lib/ZoneMinder/Trigger/Channel/Handle.pm \ + lib/ZoneMinder/ConfigAdmin.pm + $(NOECHO) $(POD2MAN) --section=$(MAN3EXT) --perm_rw=$(PERM_RW) \ + lib/ZoneMinder/Trigger/Connection.pm $(INST_MAN3DIR)/ZoneMinder::Trigger::Connection.$(MAN3EXT) \ + lib/ZoneMinder/Control/Ncs370.pm $(INST_MAN3DIR)/ZoneMinder::Control::Ncs370.$(MAN3EXT) \ + lib/ZoneMinder/Trigger/Channel/Serial.pm $(INST_MAN3DIR)/ZoneMinder::Trigger::Channel::Serial.$(MAN3EXT) \ + lib/ZoneMinder.pm $(INST_MAN3DIR)/ZoneMinder.$(MAN3EXT) \ + lib/ZoneMinder/Config.pm $(INST_MAN3DIR)/ZoneMinder::Config.$(MAN3EXT) \ + lib/ZoneMinder/Control/mjpgStreamer.pm $(INST_MAN3DIR)/ZoneMinder::Control::mjpgStreamer.$(MAN3EXT) \ + lib/ZoneMinder/Control/PanasonicIP.pm $(INST_MAN3DIR)/ZoneMinder::Control::PanasonicIP.$(MAN3EXT) \ + lib/ZoneMinder/Base.pm $(INST_MAN3DIR)/ZoneMinder::Base.$(MAN3EXT) \ + lib/ZoneMinder/Trigger/Channel/Unix.pm $(INST_MAN3DIR)/ZoneMinder::Trigger::Channel::Unix.$(MAN3EXT) \ + lib/ZoneMinder/Control/AxisV2.pm $(INST_MAN3DIR)/ZoneMinder::Control::AxisV2.$(MAN3EXT) \ + lib/ZoneMinder/Trigger/Channel.pm $(INST_MAN3DIR)/ZoneMinder::Trigger::Channel.$(MAN3EXT) \ + lib/ZoneMinder/Memory.pm $(INST_MAN3DIR)/ZoneMinder::Memory.$(MAN3EXT) \ + lib/ZoneMinder/Trigger/Channel/File.pm $(INST_MAN3DIR)/ZoneMinder::Trigger::Channel::File.$(MAN3EXT) \ + lib/ZoneMinder/Database.pm $(INST_MAN3DIR)/ZoneMinder::Database.$(MAN3EXT) \ + lib/ZoneMinder/ConfigData.pm $(INST_MAN3DIR)/ZoneMinder::ConfigData.$(MAN3EXT) \ + lib/ZoneMinder/Control/PelcoD.pm $(INST_MAN3DIR)/ZoneMinder::Control::PelcoD.$(MAN3EXT) \ + lib/ZoneMinder/Control/Visca.pm $(INST_MAN3DIR)/ZoneMinder::Control::Visca.$(MAN3EXT) \ + lib/ZoneMinder/Trigger/Channel/Inet.pm $(INST_MAN3DIR)/ZoneMinder::Trigger::Channel::Inet.$(MAN3EXT) \ + lib/ZoneMinder/Logger.pm $(INST_MAN3DIR)/ZoneMinder::Logger.$(MAN3EXT) \ + lib/ZoneMinder/Trigger/Connection/Example.pm $(INST_MAN3DIR)/ZoneMinder::Trigger::Connection::Example.$(MAN3EXT) \ + lib/ZoneMinder/Trigger/Channel/Spawning.pm $(INST_MAN3DIR)/ZoneMinder::Trigger::Channel::Spawning.$(MAN3EXT) \ + lib/ZoneMinder/Control.pm $(INST_MAN3DIR)/ZoneMinder::Control.$(MAN3EXT) \ + lib/ZoneMinder/General.pm $(INST_MAN3DIR)/ZoneMinder::General.$(MAN3EXT) \ + lib/ZoneMinder/Trigger/Channel/Handle.pm $(INST_MAN3DIR)/ZoneMinder::Trigger::Channel::Handle.$(MAN3EXT) \ + lib/ZoneMinder/ConfigAdmin.pm $(INST_MAN3DIR)/ZoneMinder::ConfigAdmin.$(MAN3EXT) + + + + +# --- MakeMaker processPL section: + + +# --- MakeMaker installbin section: + + +# --- MakeMaker subdirs section: + +# none + +# --- MakeMaker clean_subdirs section: +clean_subdirs : + $(NOECHO) $(NOOP) + + +# --- MakeMaker clean section: + +# Delete temporary files but do not touch installed files. We don't delete +# the Makefile here so a later make realclean still has a makefile to use. + +clean :: clean_subdirs + - $(RM_F) \ + *$(LIB_EXT) core \ + core.[0-9] $(INST_ARCHAUTODIR)/extralibs.all \ + core.[0-9][0-9] $(BASEEXT).bso \ + pm_to_blib.ts core.[0-9][0-9][0-9][0-9] \ + MYMETA.yml $(BASEEXT).x \ + $(BOOTSTRAP) perl$(EXE_EXT) \ + tmon.out *$(OBJ_EXT) \ + pm_to_blib $(INST_ARCHAUTODIR)/extralibs.ld \ + blibdirs.ts core.[0-9][0-9][0-9][0-9][0-9] \ + *perl.core core.*perl.*.? \ + $(MAKE_APERL_FILE) perl \ + $(BASEEXT).def core.[0-9][0-9][0-9] \ + mon.out lib$(BASEEXT).def \ + perlmain.c perl.exe \ + so_locations $(BASEEXT).exp + - $(RM_RF) \ + blib + - $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL) + + +# --- MakeMaker realclean_subdirs section: +realclean_subdirs : + $(NOECHO) $(NOOP) + + +# --- MakeMaker realclean section: +# Delete temporary files (via clean) and also delete dist files +realclean purge :: clean realclean_subdirs + - $(RM_F) \ + $(MAKEFILE_OLD) $(FIRST_MAKEFILE) + - $(RM_RF) \ + $(DISTVNAME) + + +# --- MakeMaker metafile section: +metafile : create_distdir + $(NOECHO) $(ECHO) Generating META.yml + $(NOECHO) $(ECHO) '--- #YAML:1.0' > META_new.yml + $(NOECHO) $(ECHO) 'name: ZoneMinder' >> META_new.yml + $(NOECHO) $(ECHO) 'version: 1.25.0' >> META_new.yml + $(NOECHO) $(ECHO) 'abstract: Container module for common ZoneMinder modules' >> META_new.yml + $(NOECHO) $(ECHO) 'author:' >> META_new.yml + $(NOECHO) $(ECHO) ' - Philip Coombes ' >> META_new.yml + $(NOECHO) $(ECHO) 'license: unknown' >> META_new.yml + $(NOECHO) $(ECHO) 'distribution_type: module' >> META_new.yml + $(NOECHO) $(ECHO) 'configure_requires:' >> META_new.yml + $(NOECHO) $(ECHO) ' ExtUtils::MakeMaker: 0' >> META_new.yml + $(NOECHO) $(ECHO) 'build_requires:' >> META_new.yml + $(NOECHO) $(ECHO) ' ExtUtils::MakeMaker: 0' >> META_new.yml + $(NOECHO) $(ECHO) 'requires: {}' >> META_new.yml + $(NOECHO) $(ECHO) 'no_index:' >> META_new.yml + $(NOECHO) $(ECHO) ' directory:' >> META_new.yml + $(NOECHO) $(ECHO) ' - t' >> META_new.yml + $(NOECHO) $(ECHO) ' - inc' >> META_new.yml + $(NOECHO) $(ECHO) 'generated_by: ExtUtils::MakeMaker version 6.57_05' >> META_new.yml + $(NOECHO) $(ECHO) 'meta-spec:' >> META_new.yml + $(NOECHO) $(ECHO) ' url: http://module-build.sourceforge.net/META-spec-v1.4.html' >> META_new.yml + $(NOECHO) $(ECHO) ' version: 1.4' >> META_new.yml + -$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml + + +# --- MakeMaker signature section: +signature : + cpansign -s + + +# --- MakeMaker dist_basics section: +distclean :: realclean distcheck + $(NOECHO) $(NOOP) + +distcheck : + $(PERLRUN) "-MExtUtils::Manifest=fullcheck" -e fullcheck + +skipcheck : + $(PERLRUN) "-MExtUtils::Manifest=skipcheck" -e skipcheck + +manifest : + $(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest + +veryclean : realclean + $(RM_F) *~ */*~ *.orig */*.orig *.bak */*.bak *.old */*.old + + + +# --- MakeMaker dist_core section: + +dist : $(DIST_DEFAULT) $(FIRST_MAKEFILE) + $(NOECHO) $(ABSPERLRUN) -l -e 'print '\''Warning: Makefile possibly out of date with $(VERSION_FROM)'\''' \ + -e ' if -e '\''$(VERSION_FROM)'\'' and -M '\''$(VERSION_FROM)'\'' < -M '\''$(FIRST_MAKEFILE)'\'';' -- + +tardist : $(DISTVNAME).tar$(SUFFIX) + $(NOECHO) $(NOOP) + +uutardist : $(DISTVNAME).tar$(SUFFIX) + uuencode $(DISTVNAME).tar$(SUFFIX) $(DISTVNAME).tar$(SUFFIX) > $(DISTVNAME).tar$(SUFFIX)_uu + +$(DISTVNAME).tar$(SUFFIX) : distdir + $(PREOP) + $(TO_UNIX) + $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME) + $(RM_RF) $(DISTVNAME) + $(COMPRESS) $(DISTVNAME).tar + $(POSTOP) + +zipdist : $(DISTVNAME).zip + $(NOECHO) $(NOOP) + +$(DISTVNAME).zip : distdir + $(PREOP) + $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME) + $(RM_RF) $(DISTVNAME) + $(POSTOP) + +shdist : distdir + $(PREOP) + $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar + $(RM_RF) $(DISTVNAME) + $(POSTOP) + + +# --- MakeMaker distdir section: +create_distdir : + $(RM_RF) $(DISTVNAME) + $(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \ + -e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');" + +distdir : create_distdir distmeta + $(NOECHO) $(NOOP) + + + +# --- MakeMaker dist_test section: +disttest : distdir + cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL + cd $(DISTVNAME) && $(MAKE) $(PASTHRU) + cd $(DISTVNAME) && $(MAKE) test $(PASTHRU) + + + +# --- MakeMaker dist_ci section: + +ci : + $(PERLRUN) "-MExtUtils::Manifest=maniread" \ + -e "@all = keys %{ maniread() };" \ + -e "print(qq{Executing $(CI) @all\n}); system(qq{$(CI) @all});" \ + -e "print(qq{Executing $(RCS_LABEL) ...\n}); system(qq{$(RCS_LABEL) @all});" + + +# --- MakeMaker distmeta section: +distmeta : create_distdir metafile + $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{META.yml} => q{Module meta-data (added by MakeMaker)}}) } ' \ + -e ' or print "Could not add META.yml to MANIFEST: $${'\''@'\''}\n"' -- + + + +# --- MakeMaker distsignature section: +distsignature : create_distdir + $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) } ' \ + -e ' or print "Could not add SIGNATURE to MANIFEST: $${'\''@'\''}\n"' -- + $(NOECHO) cd $(DISTVNAME) && $(TOUCH) SIGNATURE + cd $(DISTVNAME) && cpansign -s + + + +# --- MakeMaker install section: + +install :: pure_install doc_install + $(NOECHO) $(NOOP) + +install_perl :: pure_perl_install doc_perl_install + $(NOECHO) $(NOOP) + +install_site :: pure_site_install doc_site_install + $(NOECHO) $(NOOP) + +install_vendor :: pure_vendor_install doc_vendor_install + $(NOECHO) $(NOOP) + +pure_install :: pure_$(INSTALLDIRS)_install + $(NOECHO) $(NOOP) + +doc_install :: doc_$(INSTALLDIRS)_install + $(NOECHO) $(NOOP) + +pure__install : pure_site_install + $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site + +doc__install : doc_site_install + $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site + +pure_perl_install :: all + $(NOECHO) umask 022; $(MOD_INSTALL) \ + $(INST_LIB) $(DESTINSTALLPRIVLIB) \ + $(INST_ARCHLIB) $(DESTINSTALLARCHLIB) \ + $(INST_BIN) $(DESTINSTALLBIN) \ + $(INST_SCRIPT) $(DESTINSTALLSCRIPT) \ + $(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) \ + $(INST_MAN3DIR) $(DESTINSTALLMAN3DIR) + $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ + $(SITEARCHEXP)/auto/$(FULLEXT) + + +pure_site_install :: all + $(NOECHO) umask 02; $(MOD_INSTALL) \ + read $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist \ + write $(DESTINSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \ + $(INST_LIB) $(DESTINSTALLSITELIB) \ + $(INST_ARCHLIB) $(DESTINSTALLSITEARCH) \ + $(INST_BIN) $(DESTINSTALLSITEBIN) \ + $(INST_SCRIPT) $(DESTINSTALLSITESCRIPT) \ + $(INST_MAN1DIR) $(DESTINSTALLSITEMAN1DIR) \ + $(INST_MAN3DIR) $(DESTINSTALLSITEMAN3DIR) + $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ + $(PERL_ARCHLIB)/auto/$(FULLEXT) + +pure_vendor_install :: all + $(NOECHO) umask 022; $(MOD_INSTALL) \ + $(INST_LIB) $(DESTINSTALLVENDORLIB) \ + $(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) \ + $(INST_BIN) $(DESTINSTALLVENDORBIN) \ + $(INST_SCRIPT) $(DESTINSTALLVENDORSCRIPT) \ + $(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \ + $(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR) + +doc_perl_install :: all + +doc_site_install :: all + $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLSITEARCH)/perllocal.pod + -$(NOECHO) umask 02; $(MKPATH) $(DESTINSTALLSITEARCH) + -$(NOECHO) umask 02; $(DOC_INSTALL) \ + "Module" "$(NAME)" \ + "installed into" "$(INSTALLSITELIB)" \ + LINKTYPE "$(LINKTYPE)" \ + VERSION "$(VERSION)" \ + EXE_FILES "$(EXE_FILES)" \ + >> $(DESTINSTALLSITEARCH)/perllocal.pod + +doc_vendor_install :: all + + +uninstall :: uninstall_from_$(INSTALLDIRS)dirs + $(NOECHO) $(NOOP) + +uninstall_from_perldirs :: + +uninstall_from_sitedirs :: + $(NOECHO) $(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist + +uninstall_from_vendordirs :: + + + +# --- MakeMaker force section: +# Phony target to force checking subdirectories. +FORCE : + $(NOECHO) $(NOOP) + + +# --- MakeMaker perldepend section: + + +# --- MakeMaker makefile section: +# We take a very conservative approach here, but it's worth it. +# We move Makefile to Makefile.old here to avoid gnu make looping. +$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP) + $(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?" + $(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..." + -$(NOECHO) $(RM_F) $(MAKEFILE_OLD) + -$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) + - $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL) + $(PERLRUN) Makefile.PL + $(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <==" + $(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <==" + $(FALSE) + + + +# --- MakeMaker staticmake section: + +# --- MakeMaker makeaperl section --- +MAP_TARGET = perl +FULLPERL = /usr/bin/perl + +$(MAP_TARGET) :: static $(MAKE_APERL_FILE) + $(MAKE) $(USEMAKEFILE) $(MAKE_APERL_FILE) $@ + +$(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib + $(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET) + $(NOECHO) $(PERLRUNINST) \ + Makefile.PL DIR= \ + MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \ + MAKEAPERL=1 NORECURS=1 CCCDLFLAGS= + + +# --- MakeMaker test section: + +TEST_VERBOSE=0 +TEST_TYPE=test_$(LINKTYPE) +TEST_FILE = test.pl +TEST_FILES = t/*.t +TESTDB_SW = -d + +testdb :: testdb_$(LINKTYPE) + +test :: $(TEST_TYPE) subdirs-test + +subdirs-test :: + $(NOECHO) $(NOOP) + + +test_dynamic :: pure_all + PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) + +testdb_dynamic :: pure_all + PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE) + +test_ : test_dynamic + +test_static :: test_dynamic +testdb_static :: testdb_dynamic + + +# --- MakeMaker ppd section: +# Creates a PPD (Perl Package Description) for a binary distribution. +ppd : + $(NOECHO) $(ECHO) '' > $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' Container module for common ZoneMinder modules' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' Philip Coombes <philip.coombes@zoneminder.com>' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) '' >> $(DISTNAME).ppd + + +# --- MakeMaker pm_to_blib section: + +pm_to_blib : $(FIRST_MAKEFILE) $(TO_INST_PM) + $(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', q[$(PM_FILTER)], '\''$(PERM_DIR)'\'')' -- \ + lib/ZoneMinder/Trigger/Connection.pm $(INST_LIBDIR)/ZoneMinder/Trigger/Connection.pm \ + lib/ZoneMinder/Control/Ncs370.pm $(INST_LIBDIR)/ZoneMinder/Control/Ncs370.pm \ + lib/ZoneMinder/Trigger/Channel/Serial.pm $(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Serial.pm \ + lib/ZoneMinder/Memory/Shared.pm $(INST_LIBDIR)/ZoneMinder/Memory/Shared.pm \ + lib/ZoneMinder.pm $(INST_LIBDIR)/ZoneMinder.pm \ + lib/ZoneMinder/Config.pm $(INST_LIBDIR)/ZoneMinder/Config.pm \ + lib/ZoneMinder/Control/mjpgStreamer.pm $(INST_LIBDIR)/ZoneMinder/Control/mjpgStreamer.pm \ + lib/ZoneMinder/Trigger/Channel/Unix.pm $(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Unix.pm \ + lib/ZoneMinder/Control/PanasonicIP.pm $(INST_LIBDIR)/ZoneMinder/Control/PanasonicIP.pm \ + lib/ZoneMinder/Base.pm $(INST_LIBDIR)/ZoneMinder/Base.pm \ + lib/ZoneMinder/Control/AxisV2.pm $(INST_LIBDIR)/ZoneMinder/Control/AxisV2.pm \ + lib/ZoneMinder/Memory/Mapped.pm $(INST_LIBDIR)/ZoneMinder/Memory/Mapped.pm \ + lib/ZoneMinder/Trigger/Channel.pm $(INST_LIBDIR)/ZoneMinder/Trigger/Channel.pm \ + lib/ZoneMinder/Memory.pm $(INST_LIBDIR)/ZoneMinder/Memory.pm \ + lib/ZoneMinder/Trigger/Channel/File.pm $(INST_LIBDIR)/ZoneMinder/Trigger/Channel/File.pm \ + lib/ZoneMinder/Database.pm $(INST_LIBDIR)/ZoneMinder/Database.pm \ + lib/ZoneMinder/ConfigData.pm $(INST_LIBDIR)/ZoneMinder/ConfigData.pm \ + lib/ZoneMinder/Control/PelcoD.pm $(INST_LIBDIR)/ZoneMinder/Control/PelcoD.pm \ + lib/ZoneMinder/Control/Visca.pm $(INST_LIBDIR)/ZoneMinder/Control/Visca.pm \ + lib/ZoneMinder/Trigger/Channel/Inet.pm $(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Inet.pm \ + lib/ZoneMinder/Logger.pm $(INST_LIBDIR)/ZoneMinder/Logger.pm \ + lib/ZoneMinder/Trigger/Connection/Example.pm $(INST_LIBDIR)/ZoneMinder/Trigger/Connection/Example.pm \ + lib/ZoneMinder/Trigger/Channel/Spawning.pm $(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Spawning.pm \ + lib/ZoneMinder/Control.pm $(INST_LIBDIR)/ZoneMinder/Control.pm \ + lib/ZoneMinder/General.pm $(INST_LIBDIR)/ZoneMinder/General.pm \ + lib/ZoneMinder/Trigger/Channel/Handle.pm $(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Handle.pm \ + lib/ZoneMinder/ConfigAdmin.pm $(INST_LIBDIR)/ZoneMinder/ConfigAdmin.pm + $(NOECHO) $(TOUCH) pm_to_blib + + +# --- MakeMaker selfdocument section: + + +# --- MakeMaker postamble section: + + +# End. diff --git a/scripts/ZoneMinder/README b/scripts/ZoneMinder/README new file mode 100644 index 000000000..fd005204c --- /dev/null +++ b/scripts/ZoneMinder/README @@ -0,0 +1,40 @@ +ZoneMinder version 0.01 +======================= + +The README is used to introduce the module and provide instructions on +how to install the module, any machine dependencies it may have (for +example C compilers and installed libraries) and any other information +that should be provided before the module is installed. + +A README file is required for CPAN modules since CPAN extracts the +README file from a module distribution so that people browsing the +archive can use it get an idea of the modules uses. It is usually a +good idea to provide version information here so that people can +decide whether fixes for the module are worth downloading. + +INSTALLATION + +To install this module type the following: + + perl Makefile.PL + make + make test + make install + +DEPENDENCIES + +This module requires these other modules and libraries: + + blah blah blah + +COPYRIGHT AND LICENCE + +Put the correct copyright and licence information here. + +Copyright (C) 2005 by Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + diff --git a/scripts/ZoneMinder/blib/arch/.exists b/scripts/ZoneMinder/blib/arch/.exists new file mode 100644 index 000000000..e69de29bb diff --git a/scripts/ZoneMinder/blib/arch/auto/ZoneMinder/.exists b/scripts/ZoneMinder/blib/arch/auto/ZoneMinder/.exists new file mode 100644 index 000000000..e69de29bb diff --git a/scripts/ZoneMinder/blib/bin/.exists b/scripts/ZoneMinder/blib/bin/.exists new file mode 100644 index 000000000..e69de29bb diff --git a/scripts/ZoneMinder/blib/lib/.exists b/scripts/ZoneMinder/blib/lib/.exists new file mode 100644 index 000000000..e69de29bb diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder.pm new file mode 100644 index 000000000..41c972650 --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder.pm @@ -0,0 +1,130 @@ +# ========================================================================== +# +# ZoneMinder Common Module, $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. +# +# ========================================================================== +# +# This module contains the common definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder; + +use 5.006; +use strict; +use warnings; + +require Exporter; +use ZoneMinder::Base qw(:all); +use ZoneMinder::Config qw(:all); +use ZoneMinder::Logger qw(:all); +use ZoneMinder::General qw(:all); +use ZoneMinder::Database qw(:all); +use ZoneMinder::Memory qw(:all); + +our @ISA = qw(Exporter ZoneMinder::Base ZoneMinder::Config ZoneMinder::Logger ZoneMinder::General ZoneMinder::Database ZoneMinder::Memory); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'base' => [ + @ZoneMinder::Base::EXPORT_OK + ], + 'config' => [ + @ZoneMinder::Config::EXPORT_OK + ], + 'debug' => [ + @ZoneMinder::Logger::EXPORT_OK + ], + 'general' => [ + @ZoneMinder::General::EXPORT_OK + ], + 'database' => [ + @ZoneMinder::Database::EXPORT_OK + ], + 'memory' => [ + @ZoneMinder::Memory::EXPORT_OK + ], +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = @{ $EXPORT_TAGS{'all'} }; + +our @EXPORT = ( @EXPORT_OK ); + +our $VERSION = $ZoneMinder::Base::VERSION; + +1; +__END__ + +=head1 NAME + +ZoneMinder - Container module for common ZoneMinder modules + +=head1 SYNOPSIS + + use ZoneMinder; + +=head1 DESCRIPTION + +This module is a convenience container module that uses the +ZoneMinder::Base, ZoneMinder::Common, ZoneMinder::Logger, +ZoneMinder::Database and ZoneMinder::Memory modules. It also +exports by default all symbols provided by the 'all' tag of +each of the modules. + +Thus 'use'ing this module is equivalent to the following + + use ZoneMinder::Base qw(:all); + use ZoneMinder::Config qw(:all); + use ZoneMinder::Logger qw(:all); + use ZoneMinder::Database qw(:all); + use ZoneMinder::Memory qw(:all); + +but is somewhat easier. + +=head2 EXPORT + +All symbols exported by the 'all' tag of each of the included +modules. + +=head1 SEE ALSO + +ZoneMinder::Base, ZoneMinder::Common, ZoneMinder::Logger, +ZoneMinder::Database, ZoneMinder::Memory + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2005 by Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Base.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Base.pm new file mode 100644 index 000000000..095ddc37b --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Base.pm @@ -0,0 +1,86 @@ +# ========================================================================== +# +# ZoneMinder Base Module, $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. +# +# ========================================================================== +# +# This module contains the common definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::Base; + +use 5.006; +use strict; +use warnings; + +require Exporter; + +our @ISA = qw(Exporter); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( 'all' => [ qw() ] ); + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = qw(); + +our $VERSION = "1.25.0"; + +1; +__END__ + +=head1 NAME + +ZoneMinder::Base - Base perl module for ZoneMinder + +=head1 SYNOPSIS + + use ZoneMinder::Base; + +=head1 DESCRIPTION + +This module is the base module for the rest of the ZoneMinder modules. It is included by each of the other modules but serves no purpose other than to propagate the perl module version amongst the other modules. You will never need to use this module directly but if you write new ZoneMinder modules they should include it. + +=head2 EXPORT + +None by default. + +=head1 SEE ALSO + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Config.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Config.pm new file mode 100644 index 000000000..e447f86f9 --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Config.pm @@ -0,0 +1,145 @@ +# ========================================================================== +# +# ZoneMinder Config Module, $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. +# +# ========================================================================== +# +# This module contains the common definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::Config; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our @EXPORT_CONFIG; # Get populated by BEGIN + +our %EXPORT_TAGS = ( + 'constants' => [ qw( + ZM_PID + ) ] +); +push( @{$EXPORT_TAGS{config}}, @EXPORT_CONFIG ); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; + +use constant ZM_PID => "/var/run/zm/zm.pid"; # Path to the ZoneMinder run pid file +use constant ZM_CONFIG => "/etc/zm/zm.conf"; # Path to the ZoneMinder config file + +use Carp; + +# Load the config from the database into the symbol table +BEGIN +{ + no strict 'refs'; + + my $config_file = ZM_CONFIG; + ( my $local_config_file = $config_file ) =~ s|^.*/|./|; + if ( -s $local_config_file && -r $local_config_file ) + { + print( STDERR "Warning, overriding installed $local_config_file file with local copy\n" ); + $config_file = $local_config_file; + } + open( CONFIG, "<".$config_file ) or croak( "Can't open config file '$config_file': $!" ); + foreach my $str ( ) + { + next if ( $str =~ /^\s*$/ ); + next if ( $str =~ /^\s*#/ ); + my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*(.+?)\s*$/; + $name =~ tr/a-z/A-Z/; + *{$name} = sub { $value }; + push( @EXPORT_CONFIG, $name ); + } + close( CONFIG ); + + use DBI; + my $dbh = DBI->connect( "DBI:mysql:database=".&ZM_DB_NAME.";host=".&ZM_DB_HOST, &ZM_DB_USER, &ZM_DB_PASS ); + my $sql = "select * from Config"; + my $sth = $dbh->prepare_cached( $sql ) or croak( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or croak( "Can't execute: ".$sth->errstr() ); + while( my $config = $sth->fetchrow_hashref() ) + { + *{$config->{Name}} = sub { $config->{Value} }; + push( @EXPORT_CONFIG, $config->{Name} ); + } + $sth->finish(); + $dbh->disconnect(); +} + +1; +__END__ + +=head1 NAME + +ZoneMinder::Config - ZoneMinder configuration module. + +=head1 SYNOPSIS + + use ZoneMinder::Config qw(:all); + +=head1 DESCRIPTION + +The ZoneMinder::Config module is used to import the ZoneMinder configuration from the database. It will do this at compile time in a BEGIN block and require access to the zm.conf file either in the current directory or in its defined location in order to determine database access details, configuration from this file will also be included. If the :all or :config tags are used then this configuration is exported into the namespace of the calling program or module. + +Once the configuration has been imported then configuration variables are defined as constants and can be accessed directory by name, e.g. + + $lang = ZM_LANG_DEFAULT; + +=head2 EXPORT + +None by default. +The :constants tag will export the ZM_PID constant which details the location of the zm.pid file +The :config tag will export all configuration from the database as well as any from the zm.conf file +The :all tag will export all above symbols. + +=head1 SEE ALSO + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/ConfigAdmin.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/ConfigAdmin.pm new file mode 100644 index 000000000..8ee1ec82b --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/ConfigAdmin.pm @@ -0,0 +1,213 @@ +# ========================================================================== +# +# ZoneMinder Config Admin Module, $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. +# +# ========================================================================== +# +# This module contains the debug definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::ConfigAdmin; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'functions' => [ qw( + loadConfigFromDB + saveConfigToDB + ) ] +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'functions'} } ); + +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Configuration Administration +# +# ========================================================================== + +use ZoneMinder::Config qw(:all); +use ZoneMinder::ConfigData qw(:all); + +use Carp; + +sub loadConfigFromDB +{ + print( "Loading config from DB\n" ); + my $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS ); + + if ( !$dbh ) + { + print( "Error: unable to load options from database: $DBI::errstr\n" ); + return( 0 ); + } + my $sql = "select * from Config"; + my $sth = $dbh->prepare_cached( $sql ) or croak( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or croak( "Can't execute: ".$sth->errstr() ); + my $option_count = 0; + while( my $config = $sth->fetchrow_hashref() ) + { + my ( $name, $value ) = ( $config->{Name}, $config->{Value} ); + #print( "Name = '$name'\n" ); + my $option = $options_hash{$name}; + if ( !$option ) + { + warn( "No option '$name' found, removing" ); + next; + } + #next if ( $option->{category} eq 'hidden' ); + if ( defined($value) ) + { + if ( $option->{type} == $types{boolean} ) + { + $option->{value} = $value?"yes":"no"; + } + else + { + $option->{value} = $value; + } + } + $option_count++;; + } + $sth->finish(); + $dbh->disconnect(); + return( $option_count ); +} + +sub saveConfigToDB +{ + print( "Saving config to DB\n" ); + my $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS ); + + if ( !$dbh ) + { + print( "Error: unable to save options to database: $DBI::errstr\n" ); + return( 0 ); + } + my $sql = "delete from Config"; + my $res = $dbh->do( $sql ) or croak( "Can't do '$sql': ".$dbh->errstr() ); + + $sql = "replace into Config set Id = ?, Name = ?, Value = ?, Type = ?, DefaultValue = ?, Hint = ?, Pattern = ?, Format = ?, Prompt = ?, Help = ?, Category = ?, Readonly = ?, Requires = ?"; + my $sth = $dbh->prepare_cached( $sql ) or croak( "Can't prepare '$sql': ".$dbh->errstr() ); + foreach my $option ( @options ) + { + #next if ( $option->{category} eq 'hidden' ); + #print( $option->{name}."\n" ) if ( !$option->{category} ); + $option->{db_type} = $option->{type}->{db_type}; + $option->{db_hint} = $option->{type}->{hint}; + $option->{db_pattern} = $option->{type}->{pattern}; + $option->{db_format} = $option->{type}->{format}; + if ( $option->{db_type} eq "boolean" ) + { + $option->{db_value} = ($option->{value} eq "yes")?"1":"0"; + } + else + { + $option->{db_value} = $option->{value}; + } + if ( my $requires = $option->{requires} ) + { + $option->{db_requires} = join( ";", map { my $value = $_->{value}; $value = ($value eq "yes")?1:0 if ( $options_hash{$_->{name}}->{db_type} eq "boolean" ); ( "$_->{name}=$value" ) } @$requires ); + } + else + { + } + my $res = $sth->execute( $option->{id}, $option->{name}, $option->{db_value}, $option->{db_type}, $option->{default}, $option->{db_hint}, $option->{db_pattern}, $option->{db_format}, $option->{description}, $option->{help}, $option->{category}, $option->{readonly}?1:0, $option->{db_requires} ) or croak( "Can't execute: ".$sth->errstr() ); + } + $sth->finish(); + $dbh->disconnect(); +} + +1; +__END__ + +=head1 NAME + +ZoneMinder::ConfigAdmin - ZoneMinder Configuration Administration module + +=head1 SYNOPSIS + + use ZoneMinder::ConfigAdmin; + use ZoneMinder::ConfigAdmin qw(:all); + + loadConfigFromDB(); + saveConfigToDB(); + +=head1 DESCRIPTION + +The ZoneMinder:ConfigAdmin module contains the master definition of the ZoneMinder configuration options as well as helper methods. This module is intended for specialist confguration management and would not normally be used by end users. + +The configuration held in this module, which was previously in zmconfig.pl, includes the name, default value, description, help text, type and category for each option, as well as a number of additional fields in a small number of cases. + +=head1 METHODS + +=over 4 + +=item loadConfigFromDB (); + +Loads existing configuration from the database (if any) and merges it with the definitions held in this module. This results in the merging of any new configuration and the removal of any deprecated configuration while preserving the existing values of every else. + +=item saveConfigToDB (); + +Saves configuration held in memory to the database. The act of loading and saving configuration is a convenient way to ensure that the configuration held in the database corresponds with the most recent definitions and that all components are using the same set of configuration. + +=head2 EXPORT + +None by default. +The :data tag will export the various configuration data structures +The :functions tag will export the helper functions. +The :all tag will export all above symbols. + + +=head1 SEE ALSO + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/ConfigData.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/ConfigData.pm new file mode 100644 index 000000000..e108d8687 --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/ConfigData.pm @@ -0,0 +1,2056 @@ +# ========================================================================== +# +# ZoneMinder Config Data Module, $Date: 2011-01-20 18:49:42 +0000 (Thu, 20 Jan 2011) $, $Revision: 3230 $ +# 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. +# +# ========================================================================== +# +# This module contains the debug definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::ConfigData; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'data' => [ qw( + %types + @options + %options_hash + ) ] +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'data'} } ); + +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Configuration Data +# +# ========================================================================== + +use Carp; + +our $configInitialised = 0; + +sub INIT +{ + initialiseConfig(); +} + +# Types +our %types = +( + string => { db_type=>"string", hint=>"string", pattern=>qr|^(.+)$|, format=>q( $1 ) }, + alphanum => { db_type=>"string", hint=>"alphanumeric", pattern=>qr|^([a-zA-Z0-9-_]+)$|, format=>q( $1 ) }, + text => { db_type=>"text", hint=>"free text", pattern=>qr|^(.+)$|, format=>q( $1 ) }, + boolean => { db_type=>"boolean", hint=>"yes|no", pattern=>qr|^([yn])|i, check=>q( $1 ), format=>q( ($1 =~ /^y/) ? "yes" : "no" ) }, + integer => { db_type=>"integer", hint=>"integer", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + decimal => { db_type=>"decimal", hint=>"decimal", pattern=>qr|^(\d+(?:\.\d+)?)$|, format=>q( $1 ) }, + hexadecimal => { db_type=>"hexadecimal", hint=>"hexadecimal", pattern=>qr|^(?:0x)?([0-9a-f]{1,8})$|, format=>q( "0x".$1 ) }, + tristate => { db_type=>"string", hint=>"auto|yes|no", pattern=>qr|^([ayn])|i, check=>q( $1 ), format=>q( ($1 =~ /^y/) ? "yes" : ($1 =~ /^n/ ? "no" : "auto" ) ) }, + abs_path => { db_type=>"string", hint=>"/absolute/path/to/somewhere", pattern=>qr|^((?:/[^/]*)+?)/?$|, format=>q( $1 ) }, + rel_path => { db_type=>"string", hint=>"relative/path/to/somewhere", pattern=>qr|^((?:[^/].*)?)/?$|, format=>q( $1 ) }, + directory => { db_type=>"string", hint=>"directory", pattern=>qr|^([a-zA-Z0-9-_.]+)$|, format=>q( $1 ) }, + file => { db_type=>"string", hint=>"filename", pattern=>qr|^([a-zA-Z0-9-_.]+)$|, format=>q( $1 ) }, + hostname => { db_type=>"string", hint=>"host.your.domain", pattern=>qr|^([a-zA-Z0-9_.-]+)$|, format=>q( $1 ) }, + url => { db_type=>"string", hint=>"http://host.your.domain/", pattern=>qr|^(?:http://)?(.+)$|, format=>q( "http://".$1 ) }, + email => { db_type=>"string", hint=>"your.name\@your.domain", pattern=>qr|^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$|, format=>q( $1\@$2 ) }, +); + +our @options = +( + { + name => "ZM_LANG_DEFAULT", + default => "en_gb", + description => "Default language used by web interface", + help => "ZoneMinder allows the web interface to use languages other than English if the appropriate language file has been created and is present. This option allows you to change the default language that is used from the shipped language, British English, to another language", + type => $types{string}, + category => "system", + }, + { + name => "ZM_OPT_USE_AUTH", + default => "no", + description => "Authenticate user logins to ZoneMinder", + help => "ZoneMinder can run in two modes. The simplest is an entirely unauthenticated mode where anyone can access ZoneMinder and perform all tasks. This is most suitable for installations where the web server access is limited in other ways. The other mode enables user accounts with varying sets of permissions. Users must login or authenticate to access ZoneMinder and are limited by their defined permissions.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_AUTH_TYPE", + default => "builtin", + description => "What is used to authenticate ZoneMinder users", + help => "ZoneMinder can use two methods to authenticate users when running in authenticated mode. The first is a builtin method where ZoneMinder provides facilities for users to log in and maintains track of their identity. The second method allows interworking with other methods such as http basic authentication which passes an independently authentication 'remote' user via http. In this case ZoneMinder would use the supplied user without additional authentication provided such a user is configured ion ZoneMinder.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" } ], + type => { db_type=>"string", hint=>"builtin|remote", pattern=>qr|^([br])|i, format=>q( $1 =~ /^b/ ? "builtin" : "remote" ) }, + category => "system", + }, + { + name => "ZM_AUTH_RELAY", + default => "hashed", + description => "Method used to relay authentication information", + help => "When ZoneMinder is running in authenticated mode it can pass user details between the web pages and the back end processes. There are two methods for doing this. This first is to use a time limited hashed string which contains no direct username or password details, the second method is to pass the username and passwords around in plaintext. This method is not recommend except where you do not have the md5 libraries available on your system or you have a completely isolated system with no external access. You can also switch off authentication relaying if your system is isolated in other ways.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" } ], + type => { db_type=>"string", hint=>"hashed|plain|none", pattern=>qr|^([hpn])|i, format=>q( ($1 =~ /^h/) ? "hashed" : ($1 =~ /^p/ ? "plain" : "none" ) ) }, + category => "system", + }, + { + name => "ZM_AUTH_HASH_SECRET", + default => "...Change me to something unique...", + description => "Secret for encoding hashed authentication information", + help => "When ZoneMinder is running in hashed authenticated mode it is necessary to generate hashed strings containing encrypted sensitive information such as usernames and password. Although these string are reasonably secure the addition of a random secret increases security substantially.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" }, { name=>"ZM_AUTH_RELAY", value=>"hashed" } ], + type => $types{string}, + category => "system", + }, + { + name => "ZM_AUTH_HASH_IPS", + default => "yes", + description => "Include IP addresses in the authentication hash", + help => "When ZoneMinder is running in hashed authenticated mode it can optionally include the requesting IP address in the resultant hash. This adds an extra level of security as only requests from that address may use that authentication key. However in some circumstances, such as access over mobile networks, the requesting address can change for each request which will cause most requests to fail. This option allows you to control whether IP addresses are included in the authentication hash on your system. If you experience intermitent problems with authentication, switching this option off may help.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" }, { name=>"ZM_AUTH_RELAY", value=>"hashed" } ], + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_AUTH_HASH_LOGINS", + default => "no", + description => "Allow login by authentication hash", + help => "The normal process for logging into ZoneMinder is via the login screen with username and password. In some circumstances it may be desirable to allow access directly to one or more pages, for instance from a third party application. If this option is enabled then adding an 'auth' parameter to any request will include a shortcut login bypassing the login screen, if not already logged in. As authentication hashes are time and, optionally, IP limited this can allow short-term access to ZoneMinder screens from other web pages etc. In order to use this the calling application will hae to generate the authentication hash itself and ensure it is valid. If you use this option you should ensure that you have modified the ZM_AUTH_HASH_SECRET to somethign unique to your system.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" }, { name=>"ZM_AUTH_RELAY", value=>"hashed" } ], + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_DIR_EVENTS", + default => "events", + description => "Directory where events are stored", + help => "This is the path to the events directory where all the event images and other miscellaneous files are stored. It is normally given as a subdirectory of the web directory you have specified earlier however if disk space is tight it can reside on another partition in which case you should create a link from that area to the path you give here.", + type => $types{directory}, + category => "paths", + }, + { + name => "ZM_USE_DEEP_STORAGE", + default => "yes", + description => "Use a deep filesystem hierarchy for events", + help => "Traditionally ZoneMinder stores all events for a monitor in one directory for that monitor. This is simple and efficient except when you have very large amounts of events. Some filesystems are unable to store more than 32k files in one directory and even without this limitation, large numbers of files in a directory can slow creation and deletion of files. This option allows you to select an alternate method of storing events by year/month/day/hour/min/second which has the effect of separating events out into more directories, resulting in less per directory, and also making it easier to manually navigate to any events that may have happened at a particular time or date.", + type => $types{boolean}, + category => "paths", + }, + { + name => "ZM_DIR_IMAGES", + default => "images", + description => "Directory where the images that the ZoneMinder client generates are stored", + help => "ZoneMinder generates a myriad of images, mosty of which are associated with events. For those that aren't this is where they go.", + type => $types{directory}, + category => "paths", + }, + { + name => "ZM_DIR_SOUNDS", + default => "sounds", + description => "Directory to the sounds that the ZoneMinder client can use", + help => "ZoneMinder can optionally play a sound file when an alarm is detected. This indicates where (relative to the web root) to look for this file.", + type => $types{directory}, + category => "paths", + }, + { + name => "ZM_PATH_ZMS", + default => "/cgi-bin/nph-zms", + description => "Web path to zms streaming server", + help => "The ZoneMinder streaming server is required to send streamed images to your browser. It will be installed into the cgi-bin path given at configuration time. This option determines what the web path to the server is rather than the local path on your machine. Ordinarily the streaming server runs in parser-header mode however if you experience problems with streaming you can change this to non-parsed-header (nph) mode by changing 'zms' to 'nph-zms'.", + type => $types{rel_path}, + category => "paths", + }, + { + name => "ZM_COLOUR_JPEG_FILES", + default => "yes", + description => "Colourise greyscale JPEG files", + help => "Cameras that capture in greyscale can write their captured images to jpeg files with a corresponding greyscale colour space. This saves a small amount of disk space over colour ones. However some tools such as ffmpeg either fail to work with this colour space or have to convert it beforehand. Setting this option to yes uses up a little more space but makes creation of MPEG files much faster.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_ADD_JPEG_COMMENTS", + default => "no", + description => "Add jpeg timestamp annotations as file header comments", + help => "JPEG files may have a number of extra fields added to the file header. The comment field may have any kind of text added. This options allows you to have the same text that is used to annotate the image additionally included as a file header comment. If you archive event images to other locations this may help you locate images for particular events or times if you use software that can read comment headers.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_JPEG_FILE_QUALITY", + default => "70", + description => "Set the JPEG quality setting for the saved event files (1-100)", + help => "When ZoneMinder detects an event it will save the images associated with that event to files. These files are in the JPEG format and can be viewed or streamed later. This option specifies what image quality should be used to save these files. A higher number means better quality but less compression so will take up more disk space and take longer to view over a slow connection. By contrast a low number means smaller, quicker to view, files but at the price of lower quality images. This setting applies to all images written except if the capture image has caused an alarm and the alarm file quality option is set at a higher value when that is used instead.", + type => $types{integer}, + category => "images", + }, + { + name => "ZM_JPEG_ALARM_FILE_QUALITY", + default => "0", + description => "Set the JPEG quality setting for the saved event files during an alarm (1-100)", + help => "This value is equivalent to the regular jpeg file quality setting above except that it only applies to images saved while in an alarm state and then only if this value is set to a higher quality setting than the ordinary file setting. If set to a lower value then it is ignored. Thus leaving it at the default of 0 effectively means to use the regular file quality setting for all saved images. This is to prevent acccidentally saving important images at a worse quality setting.", + type => $types{integer}, + category => "images", + }, + # Deprecated, now stream quality + { + name => "ZM_JPEG_IMAGE_QUALITY", + default => "70", + description => "Set the JPEG quality setting for the streamed 'live' images (1-100)", + help => "When viewing a 'live' stream for a monitor ZoneMinder will grab an image from the buffer and encode it into JPEG format before sending it. This option specifies what image quality should be used to encode these images. A higher number means better quality but less compression so will take longer to view over a slow connection. By contrast a low number means quicker to view images but at the price of lower quality images. This option does not apply when viewing events or still images as these are usually just read from disk and so will be encoded at the quality specified by the previous options.", + type => $types{integer}, + category => "hidden", + }, + { + name => "ZM_JPEG_STREAM_QUALITY", + default => "70", + description => "Set the JPEG quality setting for the streamed 'live' images (1-100)", + help => "When viewing a 'live' stream for a monitor ZoneMinder will grab an image from the buffer and encode it into JPEG format before sending it. This option specifies what image quality should be used to encode these images. A higher number means better quality but less compression so will take longer to view over a slow connection. By contrast a low number means quicker to view images but at the price of lower quality images. This option does not apply when viewing events or still images as these are usually just read from disk and so will be encoded at the quality specified by the previous options.", + type => $types{integer}, + category => "images", + }, + { + name => "ZM_MPEG_TIMED_FRAMES", + default => "yes", + description => "Tag video frames with a timestamp for more realistic streaming", + help => "When using streamed MPEG based video, either for live monitor streams or events, ZoneMinder can send the streams in two ways. If this option is selected then the timestamp for each frame, taken from it's capture time, is included in the stream. This means that where the frame rate varies, for instance around an alarm, the stream will still maintain it's 'real' timing. If this option is not selected then an approximate frame rate is calculated and that is used to schedule frames instead. This option should be selected unless you encounter problems with your preferred streaming method.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_MPEG_LIVE_FORMAT", + default => "swf", + description => "What format 'live' video streams are played in", + help => "When using MPEG mode ZoneMinder can output live video. However what formats are handled by the browser varies greatly between machines. This option allows you to specify a video format using a file extension format, so you would just enter the extension of the file type you would like and the rest is determined from that. The default of 'asf' works well under Windows with Windows Media Player but I'm currently not sure what, if anything, works on a Linux platform. If you find out please let me know! If this option is left blank then live streams will revert to being in motion jpeg format", + type => $types{string}, + category => "images", + }, + { + name => "ZM_MPEG_REPLAY_FORMAT", + default => "swf", + description => "What format 'replay' video streams are played in", + help => "When using MPEG mode ZoneMinder can replay events in encoded video format. However what formats are handled by the browser varies greatly between machines. This option allows you to specify a video format using a file extension format, so you would just enter the extension of the file type you would like and the rest is determined from that. The default of 'asf' works well under Windows with Windows Media Player and 'mpg', or 'avi' etc should work under Linux. If you know any more then please let me know! If this option is left blank then live streams will revert to being in motion jpeg format", + type => $types{string}, + category => "images", + }, + { + name => "ZM_RAND_STREAM", + default => "yes", + description => "Add a random string to prevent caching of streams", + help => "Some browsers can cache the streams used by ZoneMinder. In order to prevent his a harmless random string can be appended to the url to make each invocation of the stream appear unique.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_OPT_CAMBOZOLA", + default => "no", + description => "Is the (optional) cambozola java streaming client installed", + help => "Cambozola is a handy low fat cheese flavoured Java applet that ZoneMinder uses to view image streams on browsers such as Internet Explorer that don't natively support this format. If you use this browser it is highly recommended to install this from http://www.charliemouse.com/code/cambozola/ however if it is not installed still images at a lower refresh rate can still be viewed.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_PATH_CAMBOZOLA", + default => "cambozola.jar", + description => "Web path to (optional) cambozola java streaming client", + help => "Cambozola is a handy low fat cheese flavoured Java applet that ZoneMinder uses to view image streams on browsers such as Internet Explorer that don't natively support this format. If you use this browser it is highly recommended to install this from http://www.charliemouse.com/code/cambozola/ however if it is not installed still images at a lower refresh rate can still be viewed. Leave this as 'cambozola.jar' if cambozola is installed in the same directory as the ZoneMinder web client files.", + requires => [ { name=>"ZM_OPT_CAMBOZOLA", value=>"yes" } ], + type => $types{rel_path}, + category => "images", + }, + { + name => "ZM_RELOAD_CAMBOZOLA", + default => "0", + description => "After how many seconds should Cambozola be reloaded in live view", + help => "Cambozola allows for the viewing of streaming MJPEG however it caches the entire stream into cache space on the computer, setting this to a number > 0 will cause it to automatically reload after that many seconds to avoid filling up a hard drive.", + type => $types{integer}, + category => "images", + }, + { + name => "ZM_TIMESTAMP_ON_CAPTURE", + default => "yes", + description => "Timestamp images as soon as they are captured", + help => "ZoneMinder can add a timestamp to images in two ways. The default method, when this option is set, is that each image is timestamped immediately when captured and so the image held in memory is marked right away. The second method does not timestamp the images until they are either saved as part of an event or accessed over the web. The timestamp used in both methods will contain the same time as this is preserved along with the image. The first method ensures that an image is timestamped regardless of any other circumstances but will result in all images being timestamped even those never saved or viewed. The second method necessitates that saved images are copied before being saved otherwise two timestamps perhaps at different scales may be applied. This has the (perhaps) desirable side effect that the timestamp is always applied at the same resolution so an image that has scaling applied will still have a legible and correctly scaled timestamp.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_CPU_EXTENSIONS", + default => "yes", + description => "Use advanced CPU extensions to increase performance", + help => "When advanced processor extensions such as SSE2 or SSSE3 are available, ZoneMinder can use them, which should increase performance and reduce system load. Enabling this option on processors that do not support the advanced processors extensions used by ZoneMinder is harmless and will have no effect.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_FAST_IMAGE_BLENDS", + default => "yes", + description => "Use a fast algorithm to blend the reference image", + help => "To detect alarms ZoneMinder needs to blend the captured image with the stored reference image to update it for comparison with the next image. The reference blend percentage specified for the monitor controls how much the new image affects the reference image. There are two methods that are available for this. If this option is set then fast calculation which does not use any multiplication or division is used. This calculation is extremely fast, however it limits the possible blend percentages to 50%, 25%, 12.5%, 6.25%, 3.25% and 1.5%. Any other blend percentage will be rounded to the nearest possible one. The alternative is to switch this option off and use standard blending instead, which is slower.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_OPT_ADAPTIVE_SKIP", + default => "yes", + description => "Should frame analysis try and be efficient in skipping frames", + help => "In previous versions of ZoneMinder the analysis daemon would attempt to keep up with the capture daemon by processing the last captured frame on each pass. This would sometimes have the undesirable side-effect of missing a chunk of the initial activity that caused the alarm because the pre-alarm frames would all have to be written to disk and the database before processing the next frame, leading to some delay between the first and second event frames. Setting this option enables a newer adaptive algorithm where the analysis daemon attempts to process as many captured frames as possible, only skipping frames when in danger of the capture daemon overwriting yet to be processed frames. This skip is variable depending on the size of the ring buffer and the amount of space left in it. Enabling this option will give you much better coverage of the beginning of alarms whilst biasing out any skipped frames towards the middle or end of the event. However you should be aware that this will have the effect of making the analysis daemon run somewhat behind the capture daemon during events and for particularly fast rates of capture it is possible for the adaptive algorithm to be overwhelmed and not have time to react to a rapid build up of pending frames and thus for a buffer overrun condition to occur.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_BLEND_ALARMED_IMAGES", + default => "yes", + description => "Blend alarmed images to update the reference image", + help => "To detect alarms ZoneMinder compares an image with a reference image which is formed from a composite of the previous images. This option determines whether images that cause events are included in this process. Doing so may increase the precision of the alarmed region but can cause problems if wholescale lighting changes cause alarms as this would not get fed back into the image and an alarm may persist indefinately. A better way to achive the same effect in most cases is to lower substantially the reference blend percentage in specific monitors.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_MAX_SUSPEND_TIME", + default => "30", + description => "Maximum time that a monitor may have motion detection suspended", + help => "ZoneMinder allows monitors to have motion detection to be suspended, for instance while panning a camera. Ordinarily this relies on the operator resuming motion detection afterwards as failure to do so can leave a monitor in a permanently suspended state. This setting allows you to set a maximum time which a camera may be suspended for before it automatically resumes motion detection. This time can be extended by subsequent suspend indications after the first so continuous camera movement will also occur while the monitor is suspended.", + type => $types{integer}, + category => "config", + }, + # Deprecated, really no longer necessary + { + name => "ZM_OPT_REMOTE_CAMERAS", + default => "no", + description => "Are you going to use remote/networked cameras", + help => "ZoneMinder can work with both local cameras, ie. those attached physically to your computer and remote or network cameras. If you will be using networked cameras select this option.", + type => $types{boolean}, + category => "hidden", + }, + # Deprecated, now set on a per monitor basis using the Method field + { + name => "ZM_NETCAM_REGEXPS", + default => "yes", + description => "Use regular expression matching with network cameras", + help => "Traditionally ZoneMinder has used complex regular regular expressions to handle the multitude of formats that network cameras produce. In versions from 1.21.1 the default is to use a simpler and faster built in pattern matching methodology. This works well with most networks cameras but if you have problems you can try the older, but more flexible, regular expression based method by selecting this option. Note, to use this method you must have libpcre installed on your system.", + requires => [ { name => "ZM_OPT_REMOTE_CAMERAS", value => "yes" } ], + type => $types{boolean}, + category => "hidden", + }, + { + name => "ZM_HTTP_VERSION", + default => "1.1", + description => "The version of HTTP that ZoneMinder will use to connect", + help => "ZoneMinder can communicate with network cameras using either of the HTTP/1.1 or HTTP/1.0 standard. A server will normally fall back to the version it supports iwht no problem so this should usually by left at the default. However it can be changed to HTTP/1.0 if necessary to resolve particular issues.", + type => { db_type=>"string", hint=>"1.1|1.0", pattern=>qr|^(1\.[01])$|, format=>q( $1?$1:"" ) }, + category => "network", + }, + { + name => "ZM_HTTP_UA", + default => "ZoneMinder", + description => "The user agent that ZoneMinder uses to identify itself", + help => "When ZoneMinder communicates with remote cameras it will identify itself using this string and it's version number. This is normally sufficient, however if a particular cameras expects only to communicate with certain browsers then this can be changed to a different string identifying ZoneMinder as Internet Explorer or Netscape etc.", + type => $types{string}, + category => "network", + }, + { + name => "ZM_HTTP_TIMEOUT", + default => "2500", + description => "How long ZoneMinder waits before giving up on images (milliseconds)", + help => "When retrieving remote images ZoneMinder will wait for this length of time before deciding that an image is not going to arrive and taking steps to retry. This timeout is in milliseconds (1000 per second) and will apply to each part of an image if it is not sent in one whole chunk.", + type => $types{integer}, + category => "network", + }, + { + name => "ZM_MIN_RTP_PORT", + default => "40200", + description => "Minimum port that ZoneMinder will listen for RTP traffic on", + help => "When ZoneMinder communicates with MPEG4 capable cameras using RTP with the unicast method it must open ports for the camera to connect back to for control and streaming purposes. This setting specifies the minimum port number that ZoneMinder will use. Ordinarily two adjacent ports are used for each camera, one for control packets and one for data packets. This port should be set to an even number, you may also need to open up a hole in your firewall to allow cameras to connect back if you wish to use unicasting.", + type => $types{integer}, + category => "network", + }, + { + name => "ZM_MAX_RTP_PORT", + default => "40499", + description => "Maximum port that ZoneMinder will listen for RTP traffic on", + help => "When ZoneMinder communicates with MPEG4 capable cameras using RTP with the unicast method it must open ports for the camera to connect back to for control and streaming purposes. This setting specifies the maximum port number that ZoneMinder will use. Ordinarily two adjacent ports are used for each camera, one for control packets and one for data packets. This port should be set to an even number, you may also need to open up a hole in your firewall to allow cameras to connect back if you wish to use unicasting. You should also ensure that you have opened up at least two ports for each monitor that will be connecting to unicasting network cameras.", + type => $types{integer}, + category => "network", + }, + { + name => "ZM_OPT_FFMPEG", + default => "yes", + description => "Is the ffmpeg video encoder/decoder installed", + help => "ZoneMinder can optionally encode a series of video images into an MPEG encoded movie file for viewing, downloading or storage. This option allows you to specify whether you have the ffmpeg tools installed. Note that creating MPEG files can be fairly CPU and disk intensive and is not a required option as events can still be reviewed as video streams without it.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_PATH_FFMPEG", + default => "/usr/bin/ffmpeg", + description => "Path to (optional) ffmpeg mpeg encoder", + help => "This path should point to where ffmpeg has been installed.", + requires => [ { name=>"ZM_OPT_FFMPEG", value=>"yes" } ], + type => $types{abs_path}, + category => "images", + }, + { + name => "ZM_FFMPEG_INPUT_OPTIONS", + default => "", + description => "Additional input options to ffmpeg", + help => "Ffmpeg can take many options on the command line to control the quality of video produced. This option allows you to specify your own set that apply to the input to ffmpeg (options that are given before the -i option). Check the ffmpeg documentation for a full list of options which may be used here.", + requires => [ { name=>"ZM_OPT_FFMPEG", value=>"yes" } ], + type => $types{string}, + category => "images", + }, + { + name => "ZM_FFMPEG_OUTPUT_OPTIONS", + default => "-r 25", + description => "Additional output options to ffmpeg", + help => "Ffmpeg can take many options on the command line to control the quality of video produced. This option allows you to specify your own set that apply to the output from ffmpeg (options that are given after the -i option). Check the ffmpeg documentation for a full list of options which may be used here. The most common one will often be to force an output frame rate supported by the video encoder.", + requires => [ { name=>"ZM_OPT_FFMPEG", value=>"yes" } ], + type => $types{string}, + category => "images", + }, + { + name => "ZM_FFMPEG_FORMATS", + default => "mpg mpeg wmv asf avi* mov swf 3gp**", + description => "Formats to allow for ffmpeg video generation", + help => "Ffmpeg can generate video in many different formats. This option allows you to list the ones you want to be able to select. As new formats are supported by ffmpeg you can add them here and be able to use them immediately. Adding a '*' after a format indicates that this will be the default format used for web video, adding '**' defines the default format for phone video.", + requires => [ { name=>"ZM_OPT_FFMPEG", value=>"yes" } ], + type => $types{string}, + category => "images", + }, + { + name => "ZM_LOG_LEVEL_SYSLOG", + default => "0", + description => "Save logging output to the system log", + help => "ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output that goes to the system log. ZoneMinder binaries have always logged to the system log but now scripts and web logging is also included. To preserve the previous behaviour you should ensure this value is set to Info or Warning. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance. If you want debug you will also need to set a level and component below", + type => { db_type=>"integer", hint=>"None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_LEVEL_FILE", + default => "-5", + description => "Save logging output to component files", + help => "ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output that goes to individual log files written by specific components. This is how logging worked previously and although useful for tracking down issues in specific components it also resulted in many disparate log files. To preserve this behaviour you should ensure this value is set to Info or Warning. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance though file output has less impact than the other options. If you want debug you will also need to set a level and component below", + type => { db_type=>"integer", hint=>"None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_LEVEL_WEBLOG", + default => "-5", + description => "Save logging output to the weblog", + help => "ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output from the web interface that goes to the httpd error log. Note that only web logging from PHP and JavaScript files is included and so this option is really only useful for investigating specific issues with those components. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance. If you want debug you will also need to set a level and component below", + type => { db_type=>"integer", hint=>"None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_LEVEL_DATABASE", + default => "0", + description => "Save logging output to the database", + help => "ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output that is written to the database. This is a new option which can make viewing logging output easier and more intuitive and also makes it easier to get an overall impression of how the system is performing. If you have a large or very busy system then it is possible that use of this option may slow your system down if the table becomes very large. Ensure you use the LOG_DATABASE_LIMIT option to keep the table to a manageable size. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance. If you want debug you will also need to set a level and component below", + type => { db_type=>"integer", hint=>"None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_DATABASE_LIMIT", + default => "7 day", + description => "Maximum number of log entries to retain", + help => "If you are using database logging then it is possible to quickly build up a large number of entries in the Logs table. This option allows you to specify how many of these entries are kept. If you set this option to a number greater than zero then that number is used to determine the maximum number of rows, less than or equal to zero indicates no limit and is not recommended. You can also set this value to time values such as ' day' which will limit the log entries to those newer than that time. You can specify 'hour', 'day', 'week', 'month' and 'year', note that the values should be singular (no 's' at the end). The Logs table is pruned periodically so it is possible for more than the expected number of rows to be present briefly in the meantime.", + type => $types{string}, + category => "logging", + }, + { + name => "ZM_LOG_DEBUG", + default => "no", + description => "Switch debugging on", + help => "ZoneMinder components usually support debug logging available to help with diagnosing problems. Binary components have several levels of debug whereas more other components have only one. Normally this is disabled to minimise performance penalties and avoid filling logs too quickly. This option lets you switch on other options that allow you to configure additional debug information to be output. Components will pick up this instruction when they are restarted.", + type => $types{boolean}, + category => "logging", + }, + { + name => "ZM_LOG_DEBUG_TARGET", + default => "", + description => "What components should have extra debug enabled", + help => "There are three scopes of debug available. Leaving this option blank means that all components will use extra debug (not recommended). Setting this option to '_', e.g. _zmc, will limit extra debug to that component only. Setting this option to '__', e.g. '_zmc_m1' will limit extra debug to that instance of the component only. This is ordinarily what you probably want to do. To debug scripts use their names without the .pl extension, e.g. '_zmvideo' and to debug issues with the web interface use '_web'. You can specify multiple targets by separating them with '|' characters.", + requires => [ { name => "ZM_LOG_DEBUG", value => "yes" } ], + type => $types{string}, + category => "logging", + }, + { + name => "ZM_LOG_DEBUG_LEVEL", + default => 1, + description => "What level of extra debug should be enabled", + help => "There are 9 levels of debug available, with higher numbers being more debug and level 0 being no debug. However not all levels are used by all components. Also if there is debug at a high level it is usually likely to be output at such a volume that it may obstruct normal operation. For this reason you should set the level carefully and cautiously until the degree of debug you wish to see is present. Scripts and the web interface only have one level so this is an on/off type option for them.", + requires => [ { name => "ZM_LOG_DEBUG", value => "yes" } ], + type => { db_type=>"integer", hint=>"1|2|3|4|5|6|7|8|9", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_DEBUG_FILE", + default => "/tmp/zm/zm_debug.log+", + description => "Where extra debug is output to", + help => "This option allows you to specify a different target for debug output. All components have a default log file which will norally be in /tmp or /var/log and this is where debug will be written to if this value is empty. Adding a path here will temporarily redirect debug, and other logging output, to this file. This option is a simple filename and you are debugging several components then they will all try and write to the same file with undesirable consequences. Appending a '+' to the filename will cause the file to be created with a '.' suffix containing your process id. In this way debug from each run of a component is kept separate. This is the recommended setting as it will also prevent subsequent runs from overwriting the same log. You should ensure that permissions are set up to allow writing to the file and directory specified here.", + requires => [ { name => "ZM_LOG_DEBUG", value => "yes" } ], + type => $types{string}, + category => "logging", + }, + { + name => "ZM_LOG_CHECK_PERIOD", + default => "900", + description => "Time period used when calculating overall system health", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to indicate what period of historical events are used in this calculation. This value is expressed in seconds and is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALERT_WAR_COUNT", + default => "1", + description => "Number of warnings indicating system alert state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many warnings must have occurred within the defined time period to generate an overall system alert state. A value of zero means warnings are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALERT_ERR_COUNT", + default => "1", + description => "Number of errors indicating system alert state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many errors must have occurred within the defined time period to generate an overall system alert state. A value of zero means errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALERT_FAT_COUNT", + default => "0", + description => "Number of fatal error indicating system alert state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many fatal errors (including panics) must have occurred within the defined time period to generate an overall system alert state. A value of zero means fatal errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALARM_WAR_COUNT", + default => "100", + description => "Number of warnings indicating system alarm state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many warnings must have occurred within the defined time period to generate an overall system alarm state. A value of zero means warnings are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALARM_ERR_COUNT", + default => "10", + description => "Number of errors indicating system alarm state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many errors must have occurred within the defined time period to generate an overall system alarm state. A value of zero means errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALARM_FAT_COUNT", + default => "1", + description => "Number of fatal error indicating system alarm state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many fatal errors (including panics) must have occurred within the defined time period to generate an overall system alarm state. A value of zero means fatal errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_RECORD_EVENT_STATS", + default => "yes", + description => "Record event statistical information, switch off if too slow", + help => "This version of ZoneMinder records detailed information about events in the Stats table. This can help in profiling what the optimum settings are for Zones though this is tricky at present. However in future releases this will be done more easily and intuitively, especially with a large sample of events. The default option of 'yes' allows this information to be collected now in readiness for this but if you are concerned about performance you can switch this off in which case no Stats information will be saved.", + type => $types{boolean}, + category => "logging", + }, + { + name => "ZM_RECORD_DIAG_IMAGES", + default => "no", + description => "Record intermediate alarm diagnostic images, can be very slow", + help => "In addition to recording event statistics you can also record the intermediate diagnostic images that display the results of the various checks and processing that occur when trying to determine if an alarm event has taken place. There are several of these images generated for each frame and zone for each alarm or alert frame so this can have a massive impact on performance. Only switch this setting on for debug or analysis purposes and remember to switch it off again once no longer required.", + type => $types{boolean}, + category => "logging", + }, + { + name => "ZM_DUMP_CORES", + default => "no", + description => "Create core files on unexpected process failure.", + help => "When an unrecoverable error occurs in a ZoneMinder binary process is has traditionally been trapped and the details written to logs to aid in remote analysis. However in some cases it is easier to diagnose the error if a core file, which is a memory dump of the process at the time of the error, is created. This can be interactively analysed in the debugger and may reveal more or better information than that available from the logs. This option is recommended for advanced users only otherwise leave at the default. Note using this option to trigger core files will mean that there will be no indication in the binary logs that a process has died, they will just stop, however the zmdc log will still contain an entry. Also note that you may have to explicitly enable core file creation on your system via the 'ulimit -c' command or other means otherwise no file will be created regardless of the value of this option.", + type => $types{boolean}, + category => "logging", + }, + { + name => "ZM_PATH_MAP", + default => "/dev/shm", + description => "Path to the mapped memory files that that ZoneMinder can use", + help => "ZoneMinder has historically used IPC shared memory for shared data between processes. This has it's advantages and limitations. This version of ZoneMinder can use an alternate method, mapped memory, instead with can be enabled with the --enable--mmap directive to configure. This requires less system configuration and is generally more flexible. However it requires each shared data segment to map onto a filesystem file. This option indicates where those mapped files go. You should ensure that this location has sufficient space for these files and for the best performance it should be a tmpfs file system or ramdisk otherwise disk access may render this method slower than the regular shared memory one.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_PATH_SOCKS", + default => "/tmp/zm", + description => "Path to the various Unix domain socket files that ZoneMinder uses", + help => "ZoneMinder generally uses Unix domain sockets where possible. This reduces the need for port assignments and prevents external applications from possibly compromising the daemons. However each Unix socket requires a .sock file to be created. This option indicates where those socket files go.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_PATH_LOGS", + default => "/var/log/zm", + description => "Path to the various logs that the ZoneMinder daemons generate", + help => "There are various daemons that are used by ZoneMinder to perform various tasks. Most generate helpful log files and this is where they go. They can be deleted if not required for debugging.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_PATH_SWAP", + default => "/tmp/zm", + description => "Path to location for temporary swap images used in streaming", + help => "Buffered playback requires temporary swap images to be stored for each instance of the streaming daemons. This option determines where these images will be stored. The images will actually be stored in sub directories beneath this location and will be automatically cleaned up after a period of time.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_WEB_TITLE_PREFIX", + default => "ZM", + description => "The title prefix displayed on each window", + help => "If you have more than one installation of ZoneMinder it can be helpful to display different titles for each one. Changing this option allows you to customise the window titles to include further information to aid identification.", + type => $types{string}, + category => "web", + }, + { + name => "ZM_WEB_RESIZE_CONSOLE", + default => "yes", + description => "Should the console window resize itself to fit", + help => "Traditionally the main ZoneMinder web console window has resized itself to shrink to a size small enough to list only the monitors that are actually present. This is intended to make the window more unobtrusize but may not be to everyones tastes, especially if opened in a tab in browsers which support this kind if layout. Switch this option off to have the console window size left to the users preference", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_WEB_POPUP_ON_ALARM", + default => "yes", + description => "Should the monitor window jump to the top if an alarm occurs", + help => "When viewing a live monitor stream you can specify whether you want the window to pop to the front if an alarm occurs when the window is minimised or behind another window. This is most useful if your monitors are over doors for example when they can pop up if someone comes to the doorway.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_OPT_X10", + default => "no", + description => "Support interfacing with X10 devices", + help => "If you have an X10 Home Automation setup in your home you can use ZoneMinder to initiate or react to X10 signals if your computer has the appropriate interface controller. This option indicates whether X10 options will be available in the browser client.", + type => $types{boolean}, + category => "x10", + }, + { + name => "ZM_X10_DEVICE", + default => "/dev/ttyS0", + description => "What device is your X10 controller connected on", + requires => [ { name => "ZM_OPT_X10", value => "yes" } ], + help => "If you have an X10 controller device (e.g. XM10U) connected to your computer this option details which port it is conected on, the default of /dev/ttyS0 maps to serial or com port 1.", + type => $types{abs_path}, + category => "x10", + }, + { + name => "ZM_X10_HOUSE_CODE", + default => "A", + description => "What X10 house code should be used", + requires => [ { name => "ZM_OPT_X10", value => "yes" } ], + help => "X10 devices are grouped together by identifying them as all belonging to one House Code. This option details what that is. It should be a single letter between A and P.", + type => { db_type=>"string", hint=>"A-P", pattern=>qr|^([A-P])|i, format=>q( uc($1) ) }, + category => "x10", + }, + { + name => "ZM_X10_DB_RELOAD_INTERVAL", + default => "60", + description => "How often (in seconds) the X10 daemon reloads the monitors from the database", + requires => [ { name => "ZM_OPT_X10", value => "yes" } ], + help => "The zmx10 daemon periodically checks the database to find out what X10 events trigger, or result from, alarms. This option determines how frequently this check occurs, unless you change this area frequently this can be a fairly large value.", + type => $types{integer}, + category => "x10", + }, + { + name => "ZM_WEB_SOUND_ON_ALARM", + default => "no", + description => "Should the monitor window play a sound if an alarm occurs", + help => "When viewing a live monitor stream you can specify whether you want the window to play a sound to alert you if an alarm occurs.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_WEB_ALARM_SOUND", + default => "", + description => "The sound to play on alarm, put this in the sounds directory", + help => "You can specify a sound file to play if an alarm occurs whilst you are watching a live monitor stream. So long as your browser understands the format it does not need to be any particular type. This file should be placed in the sounds directory defined earlier.", + type => $types{file}, + requires => [ { name => "ZM_WEB_SOUND_ON_ALARM", value => "yes" } ], + category => "web", + }, + { + name => "ZM_WEB_COMPACT_MONTAGE", + default => "no", + description => "Compact the montage view by removing extra detail", + help => "The montage view shows the output of all of your active monitors in one window. This include a small menu and status information for each one. This can increase the web traffic and make the window larger than may be desired. Setting this option on removes all this extraneous information and just displays the images.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_OPT_FAST_DELETE", + default => "yes", + description => "Delete only event database records for speed", + help => "Normally an event created as the result of an alarm consists of entries in one or more database tables plus the various files associated with it. When deleting events in the browser it can take a long time to remove all of this if your are trying to do a lot of events at once. It is recommended that you set this option which means that the browser client only deletes the key entries in the events table, which means the events will no longer appear in the listing, and leaves the zmaudit daemon to clear up the rest later.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_STRICT_VIDEO_CONFIG", + default => "yes", + description => "Allow errors in setting video config to be fatal", + help => "With some video devices errors can be reported in setting the various video attributes when in fact the operation was successful. Switching this option off will still allow these errors to be reported but will not cause them to kill the video capture daemon. Note however that doing this will cause all errors to be ignored including those which are genuine and which may cause the video capture to not function correctly. Use this option with caution.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_SIGNAL_CHECK_POINTS", + default => "10", + description => "How many points in a captured image to check for signal loss", + help => "For locally attached video cameras ZoneMinder can check for signal loss by looking at a number of random points on each captured image. If all of these points are set to the same fixed colour then the camera is assumed to have lost signal. When this happens any open events are closed and a short one frame signal loss event is generated, as is another when the signal returns. This option defines how many points on each image to check. Note that this is a maximum, any points found to not have the check colour will abort any further checks so in most cases on a couple of points will actually be checked. Network and file based cameras are never checked.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_V4L_MULTI_BUFFER", + default => "yes", + description => "Use more than one buffer for Video 4 Linux devices", + help => "Performance when using Video 4 Linux devices is usually best if multiple buffers are used allowing the next image to be captured while the previous one is being processed. If you have multiple devices on a card sharing one input that requires switching then this approach can sometimes cause frames from one source to be mixed up with frames from another. Switching this option off prevents multi buffering resulting in slower but more stable image capture. This option is ignored for non-local cameras or if only one input is present on a capture chip. This option addresses a similar problem to the ZM_CAPTURES_PER_FRAME option and you should normally change the value of only one of the options at a time.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_CAPTURES_PER_FRAME", + default => "1", + description => "How many images are captured per returned frame, for shared local cameras", + help => "If you are using cameras attached to a video capture card which forces multiple inputs to share one capture chip, it can sometimes produce images with interlaced frames reversed resulting in poor image quality and a distinctive comb edge appearance. Increasing this setting allows you to force additional image captures before one is selected as the captured frame. This allows the capture hardware to 'settle down' and produce better quality images at the price of lesser capture rates. This option has no effect on (a) network cameras, or (b) where multiple inputs do not share a capture chip. This option addresses a similar problem to the ZM_V4L_MULTI_BUFFER option and you should normally change the value of only one of the options at a time.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_FILTER_RELOAD_DELAY", + default => "300", + description => "How often (in seconds) filters are reloaded in zmfilter", + help => "ZoneMinder allows you to save filters to the database which allow events that match certain criteria to be emailed, deleted or uploaded to a remote machine etc. The zmfilter daemon loads these and does the actual operation. This option determines how often the filters are reloaded from the database to get the latest versions or new filters. If you don't change filters very often this value can be set to a large value.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_FILTER_EXECUTE_INTERVAL", + default => "60", + description => "How often (in seconds) to run automatic saved filters", + help => "ZoneMinder allows you to save filters to the database which allow events that match certain criteria to be emailed, deleted or uploaded to a remote machine etc. The zmfilter daemon loads these and does the actual operation. This option determines how often the filters are executed on the saved event in the database. If you want a rapid response to new events this should be a smaller value, however this may increase the overall load on the system and affect performance of other elements.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_OPT_UPLOAD", + default => "no", + description => "Should ZoneMinder support uploading events from filters", + help => "In ZoneMinder you can create event filters that specify whether events that match certain criteria should be uploaded to a remote server for archiving. This option specifies whether this functionality should be available", + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_UPLOAD_ARCH_FORMAT", + default => "tar", + description => "What format the uploaded events should be created in.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + help => "Uploaded events may be stored in either .tar or .zip format, this option specifies which. Note that to use this you will need to have the Archive::Tar and/or Archive::Zip perl modules installed.", + type => { db_type=>"string", hint=>"tar|zip", pattern=>qr|^([tz])|i, format=>q( $1 =~ /^t/ ? "tar" : "zip" ) }, + category => "upload", + }, + { + name => "ZM_UPLOAD_ARCH_COMPRESS", + default => "no", + description => "Should archive files be compressed", + help => "When the archive files are created they can be compressed. However in general since the images are compressed already this saves only a minimal amount of space versus utilising more CPU in their creation. Only enable if you have CPU to waste and are limited in disk space on your remote server or bandwidth.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_UPLOAD_ARCH_ANALYSE", + default => "no", + description => "Include the analysis files in the archive", + help => "When the archive files are created they can contain either just the captured frames or both the captured frames and, for frames that caused an alarm, the analysed image with the changed area highlighted. This option controls files are included. Only include analysed frames if you have a high bandwidth connection to the remote server or if you need help in figuring out what caused an alarm in the first place as archives with these files in can be considerably larger.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_UPLOAD_PROTOCOL", + default => "ftp", + description => "What protocol to use to upload events", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + help => "ZoneMinder can upload events to a remote server using either FTP or SFTP. Regular FTP is widely supported but not necessarily very secure whereas SFTP (Secure FTP) runs over an ssh connection and so is encrypted and uses regular ssh ports. Note that to use this you will need to have the appropriate perl module, either Net::FTP or Net::SFTP installed depending on your choice.", + type => { db_type=>"string", hint=>"ftp|sftp", pattern=>qr|^([tz])|i, format=>q( $1 =~ /^f/ ? "ftp" : "sftp" ) }, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_HOST", + default => "", + description => "The remote server to upload to", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the name, or ip address, of the server to use.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{hostname}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_HOST", + default => "", + description => "The remote server to upload events to", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the name, or ip address, of the server to use.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{hostname}, + category => "upload", + }, + { + name => "ZM_UPLOAD_PORT", + default => "", + description => "The port on the remote upload server, if not the default (SFTP only)", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. If you are using the SFTP protocol then this option allows you to specify a particular port to use for connection. If this option is left blank then the default, port 22, is used. This option is ignored for FTP uploads.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{integer}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_USER", + default => "", + description => "Your ftp username", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the username that ZoneMinder should use to log in for ftp transfer.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{alphanum}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_USER", + default => "", + description => "Remote server username", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the username that ZoneMinder should use to log in for transfer.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{alphanum}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_PASS", + default => "", + description => "Your ftp password", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the password that ZoneMinder should use to log in for ftp transfer.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{string}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_PASS", + default => "", + description => "Remote server password", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the password that ZoneMinder should use to log in for transfer. If you are using certicate based logins for SFTP servers you can leave this option blank.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{string}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_LOC_DIR", + default => "/tmp/zm", + description => "The local directory in which to create upload files", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the local directory that ZoneMinder should use for temporary upload files. These are files that are created from events, uploaded and then deleted.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{abs_path}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_LOC_DIR", + default => "/tmp/zm", + description => "The local directory in which to create upload files", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the local directory that ZoneMinder should use for temporary upload files. These are files that are created from events, uploaded and then deleted.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{abs_path}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_REM_DIR", + default => "", + description => "The remote directory to upload to", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the remote directory that ZoneMinder should use to upload event files to.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{rel_path}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_REM_DIR", + default => "", + description => "The remote directory to upload to", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the remote directory that ZoneMinder should use to upload event files to.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{rel_path}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_TIMEOUT", + default => "120", + description => "How long to allow the transfer to take for each file", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the maximum ftp inactivity timeout (in seconds) that should be tolerated before ZoneMinder determines that the transfer has failed and closes down the connection.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{integer}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_TIMEOUT", + default => "120", + description => "How long to allow the transfer to take for each file", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the maximum inactivity timeout (in seconds) that should be tolerated before ZoneMinder determines that the transfer has failed and closes down the connection.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{integer}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_PASSIVE", + default => "yes", + description => "Use passive ftp when uploading", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates that ftp transfers should be done in passive mode. This uses a single connection for all ftp activity and, whilst slower than active transfers, is more robust and likely to work from behind filewalls. This option is ignored for SFTP transfers.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + help => "If your computer is behind a firewall or proxy you may need to set FTP to passive mode. In fact for simple transfers it makes little sense to do otherwise anyway but you can set this to 'No' if you wish.", + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_DEBUG", + default => "no", + description => "Switch ftp debugging on", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. If you are having (or expecting) troubles with uploading events then setting this to 'yes' permits additional information to be included in the zmfilter log file.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{boolean}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_DEBUG", + default => "no", + description => "Switch upload debugging on", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. If you are having (or expecting) troubles with uploading events then setting this to 'yes' permits additional information to be generated by the underlying transfer modules and included in the logs.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_OPT_EMAIL", + default => "no", + description => "Should ZoneMinder email you details of events that match corresponding filters", + help => "In ZoneMinder you can create event filters that specify whether events that match certain criteria should have their details emailed to you at a designated email address. This will allow you to be notified of events as soon as they occur and also to quickly view the events directly. This option specifies whether this functionality should be available. The email created with this option can be any size and is intended to be sent to a regular email reader rather than a mobile device.", + type => $types{boolean}, + category => "mail", + }, + { + name => "ZM_EMAIL_ADDRESS", + default => "", + description => "The email address to send matching event details to", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" } ], + help => "This option is used to define the email address that any events that match the appropriate filters will be sent to.", + type => $types{email}, + category => "mail", + }, + { + name => "ZM_EMAIL_TEXT", + default => 'subject = "ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)" +body = " +Hello, + +An alarm has been detected on your installation of the ZoneMinder. + +The details are as follows :- + + Monitor : %MN% + Event Id : %EI% + Length : %EL% + Frames : %EF% (%EFA%) + Scores : t%EST% m%ESM% a%ESA% + +This alarm was matched by the %FN% filter and can be viewed at %EPS% + +ZoneMinder"', + description => "The text of the email used to send matching event details", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" } ], + help => "This option is used to define the content of the email that is sent for any events that match the appropriate filters.", + type => $types{text}, + category => "hidden", + }, + { + name => "ZM_EMAIL_SUBJECT", + default => "ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)", + description => "The subject of the email used to send matching event details", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" } ], + help => "This option is used to define the subject of the email that is sent for any events that match the appropriate filters.", + type => $types{string}, + category => "mail", + }, + { + name => "ZM_EMAIL_BODY", + default => " +Hello, + +An alarm has been detected on your installation of the ZoneMinder. + +The details are as follows :- + + Monitor : %MN% + Event Id : %EI% + Length : %EL% + Frames : %EF% (%EFA%) + Scores : t%EST% m%ESM% a%ESA% + +This alarm was matched by the %FN% filter and can be viewed at %EPS% + +ZoneMinder", + description => "The body of the email used to send matching event details", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" } ], + help => "This option is used to define the content of the email that is sent for any events that match the appropriate filters.", + type => $types{text}, + category => "mail", + }, + { + name => "ZM_OPT_MESSAGE", + default => "no", + description => "Should ZoneMinder message you with details of events that match corresponding filters", + help => "In ZoneMinder you can create event filters that specify whether events that match certain criteria should have their details sent to you at a designated short message email address. This will allow you to be notified of events as soon as they occur. This option specifies whether this functionality should be available. The email created by this option will be brief and is intended to be sent to an SMS gateway or a minimal mail reader such as a mobile device or phone rather than a regular email reader.", + type => $types{boolean}, + category => "mail", + }, + { + name => "ZM_MESSAGE_ADDRESS", + default => "", + description => "The email address to send matching event details to", + requires => [ { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "This option is used to define the short message email address that any events that match the appropriate filters will be sent to.", + type => $types{email}, + category => "mail", + }, + { + name => "ZM_MESSAGE_TEXT", + default => 'subject = "ZoneMinder: Alarm - %MN%-%EI%" +body = "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score."', + description => "The text of the message used to send matching event details", + requires => [ { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "This option is used to define the content of the message that is sent for any events that match the appropriate filters.", + type => $types{text}, + category => "hidden", + }, + { + name => "ZM_MESSAGE_SUBJECT", + default => "ZoneMinder: Alarm - %MN%-%EI%", + description => "The subject of the message used to send matching event details", + requires => [ { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "This option is used to define the subject of the message that is sent for any events that match the appropriate filters.", + type => $types{string}, + category => "mail", + }, + { + name => "ZM_MESSAGE_BODY", + default => "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.", + description => "The body of the message used to send matching event details", + requires => [ { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "This option is used to define the content of the message that is sent for any events that match the appropriate filters.", + type => $types{text}, + category => "mail", + }, + { + name => "ZM_NEW_MAIL_MODULES", + default => "no", + description => "Use a newer perl method to send emails", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" }, { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "Traditionally ZoneMinder has used the MIME::Entity perl module to construct and send notification emails and messages. Some people have reported problems with this module not being present at all or flexible enough for their needs. If you are one of those people this option allows you to select a new mailing method using MIME::Lite and Net::SMTP instead. This method was contributed by Ross Melin and should work for everyone but has not been extensively tested so currently is not selected by default.", + type => $types{boolean}, + category => "mail", + }, + { + name => "ZM_EMAIL_HOST", + default => "localhost", + description => "The host address of your SMTP mail server", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" }, { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "If you have chosen SMTP as the method by which to send notification emails or messages then this option allows you to choose which SMTP server to use to send them. The default of localhost may work if you have the sendmail, exim or a similar daemon running however you may wish to enter your ISP's SMTP mail server here.", + type => $types{hostname}, + category => "mail", + }, + { + name => "ZM_FROM_EMAIL", + default => "", + description => "The email address you wish your event notifications to originate from", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" }, { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "The emails or messages that will be sent to you informing you of events can appear to come from a designated email address to help you with mail filtering etc. An address of something like ZoneMinder\@your.domain is recommended.", + type => $types{email}, + category => "mail", + }, + { + name => "ZM_URL", + default => "", + description => "The URL of your ZoneMinder installation", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" }, { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "The emails or messages that will be sent to you informing you of events can include a link to the events themselves for easy viewing. If you intend to use this feature then set this option to the url of your installation as it would appear from where you read your email, e.g. http://host.your.domain/zm.php.", + type => $types{url}, + category => "mail", + }, + { + name => "ZM_MAX_RESTART_DELAY", + default => "600", + description => "Maximum delay (in seconds) for daemon restart attempts.", + help => "The zmdc (zm daemon control) process controls when processeses are started or stopped and will attempt to restart any that fail. If a daemon fails frequently then a delay is introduced between each restart attempt. If the daemon stills fails then this delay is increased to prevent extra load being placed on the system by continual restarts. This option controls what this maximum delay is.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_WATCH_CHECK_INTERVAL", + default => "10", + description => "How often to check the capture daemons have not locked up", + help => "The zmwatch daemon checks the image capture performance of the capture daemons to ensure that they have not locked up (rarely a sync error may occur which blocks indefinately). This option determines how often the daemons are checked.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_WATCH_MAX_DELAY", + default => "5", + description => "The maximum delay allowed since the last captured image", + help => "The zmwatch daemon checks the image capture performance of the capture daemons to ensure that they have not locked up (rarely a sync error may occur which blocks indefinately). This option determines the maximum delay to allow since the last captured frame. The daemon will be restarted if it has not captured any images after this period though the actual restart may take slightly longer in conjunction with the check interval value above.", + type => $types{decimal}, + category => "system", + }, + { + + name => "ZM_RUN_AUDIT", + default => "yes", + description => "Run zmaudit to check data consistency", + help => "The zmaudit daemon exists to check that the saved information in the database and on the filesystem match and are consistent with each other. If an error occurs or if you are using 'fast deletes' it may be that database records are deleted but files remain. In this case, and similar, zmaudit will remove redundant information to synchronise the two data stores. This option controls whether zmaudit is run in the background and performs these checks and fixes continuously. This is recommended for most systems however if you have a very large number of events the process of scanning the database and filesystem may take a long time and impact performance. In this case you may prefer to not have zmaudit running unconditionally and schedule occasional checks at other, more convenient, times.", + type => $types{boolean}, + category => "system", + }, + { + + name => "ZM_AUDIT_CHECK_INTERVAL", + default => "900", + description => "How often to check database and filesystem consistency", + help => "The zmaudit daemon exists to check that the saved information in the database and on the filesystem match and are consistent with each other. If an error occurs or if you are using 'fast deletes' it may be that database records are deleted but files remain. In this case, and similar, zmaudit will remove redundant information to synchronise the two data stores. The default check interval of 900 seconds (15 minutes) is fine for most systems however if you have a very large number of events the process of scanning the database and filesystem may take a long time and impact performance. In this case you may prefer to make this interval much larger to reduce the impact on your system. This option determines how often these checks are performed.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_FORCED_ALARM_SCORE", + default => "255", + description => "Score to give forced alarms", + help => "The 'zmu' utility can be used to force an alarm on a monitor rather than rely on the motion detection algorithms. This option determines what score to give these alarms to distinguish them from regular ones. It must be 255 or less.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_BULK_FRAME_INTERVAL", + default => "100", + description => "How often a bulk frame should be written to the database", + help => "Traditionally ZoneMinder writes an entry into the Frames database table for each frame that is captured and saved. This works well in motion detection scenarios but when in a DVR situation ('Record' or 'Mocord' mode) this results in a huge number of frame writes and a lot of database and disk bandwidth for very little additional information. Setting this to a non-zero value will enabled ZoneMinder to group these non-alarm frames into one 'bulk' frame entry which saves a lot of bandwidth and space. The only disadvantage of this is that timing information for individual frames is lost but in constant frame rate situations this is usually not significant. This setting is ignored in Modect mode and individual frames are still written if an alarm occurs in Mocord mode also.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_EVENT_CLOSE_MODE", + default => "idle", + description => "When continuous events are closed.", + help => "When a monitor is running in a continuous recording mode (Record or Mocord) events are usually closed after a fixed period of time (the section length). However in Mocord mode it is possible that motion detection may occur near the end of a section. This option controls what happens when an alarm occurs in Mocord mode. The 'time' setting means that the event will be closed at the end of the section regardless of alarm activity. The 'idle' setting means that the event will be closed at the end of the section if there is no alarm activity occuring at the time otherwise it will be closed once the alarm is over meaning the event may end up being longer than the normal section length. The 'alarm' setting means that if an alarm occurs during the event, the event will be closed once the alarm is over regardless of when this occurs. This has the effect of limiting the number of alarms to one per event and the events will be shorter than the section length if an alarm has occurred.", + type => $types{boolean}, + type => { db_type=>"string", hint=>"time|idle|alarm", pattern=>qr|^([tia])|i, format=>q( ($1 =~ /^t/) ? "time" : ($1 =~ /^i/ ? "idle" : "time" ) ) }, + category => "config", + }, + # Deprecated, superseded by event close mode + { + name => "ZM_FORCE_CLOSE_EVENTS", + default => "no", + description => "Close events at section ends.", + help => "When a monitor is running in a continuous recording mode (Record or Mocord) events are usually closed after a fixed period of time (the section length). However in Mocord mode it is possible that motion detection may occur near the end of a section and ordinarily this will prevent the event being closed until the motion has ceased. Switching this option on will force the event closed at the specified time regardless of any motion activity.", + type => $types{boolean}, + category => "hidden", + }, + { + name => "ZM_CREATE_ANALYSIS_IMAGES", + default => "yes", + description => "Create analysed alarm images with motion outlined", + help => "By default during an alarm ZoneMinder records both the raw captured image and one that has been analysed and had areas where motion was detected outlined. This can be very useful during zone configuration or in analysing why events occured. However it also incurs some overhead and in a stable system may no longer be necessary. This parameter allows you to switch the generation of these images off.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_WEIGHTED_ALARM_CENTRES", + default => "no", + description => "Use a weighted algorithm to calculate the centre of an alarm", + help => "ZoneMinder will always calculate the centre point of an alarm in a zone to give some indication of where on the screen it is. This can be used by the experimental motion tracking feature or your own custom extensions. In the alarmed or filtered pixels mode this is a simple midpoint between the extents of the detected pxiesl. However in the blob method this can instead be calculated using weighted pixel locations to give more accurate positioning for irregularly shaped blobs. This method, while more precise is also slower and so is turned off by default.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_EVENT_IMAGE_DIGITS", + default => "3", + description => "How many significant digits are used in event image numbering", + help => "As event images are captured they are stored to the filesystem with a numerical index. By default this index has three digits so the numbers start 001, 002 etc. This works works for most scenarios as events with more than 999 frames are rarely captured. However if you have extremely long events and use external applications then you may wish to increase this to ensure correct sorting of images in listings etc. Warning, increasing this value on a live system may render existing events unviewable as the event will have been saved with the previous scheme. Decreasing this value should have no ill effects.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_DEFAULT_ASPECT_RATIO", + default => "4:3", + description => "The default width:height aspect ratio used in monitors", + help => "When specifying the dimensions of monitors you can click a checkbox to ensure that the width stays in the correct ratio to the height, or vice versa. This setting allows you to indicate what the ratio of these settings should be. This should be specified in the format : and the default of 4:3 normally be acceptable but 11:9 is another common setting. If the checkbox is not clicked when specifying monitor dimensions this setting has no effect.", + type => $types{string}, + category => "config", + }, + { + name => "ZM_USER_SELF_EDIT", + default => "no", + description => "Allow unprivileged users to change their details", + help => "Ordinarily only users with system edit privilege are able to change users details. Switching this option on allows ordinary users to change their passwords and their language settings", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_OPT_FRAME_SERVER", + default => "no", + description => "Should analysis farm out the writing of images to disk", + #requires => [ { name => "ZM_OPT_ADAPTIVE_SKIP", value => "yes" } ], + help => "In some circumstances it is possible for a slow disk to take so long writing images to disk that it causes the analysis daemon to fall behind especially during high frame rate events. Setting this option to yes enables a frame server daemon (zmf) which will be sent the images from the analysis daemon and will do the actual writing of images itself freeing up the analysis daemon to get on with other things. Should this transmission fail or other permanent or transient error occur, this function will fall back to the analysis daemon.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_FRAME_SOCKET_SIZE", + default => "0", + description => "Specify the frame server socket buffer size if non-standard", + requires => [ { name => "ZM_OPT_FRAME_SERVER", value => "yes" } ], + help => "For large captured images it is possible for the writes from the analysis daemon to the frame server to fail as the amount to be written exceeds the default buffer size. While the images are then written by the analysis daemon so no data is lost, it defeats the object of the frame server daemon in the first place. You can use this option to indicate that a larger buffer size should be used. Note that you may have to change the existing maximum socket buffer size on your system via sysctl (or in /proc/sys/net/core/wmem_max) to allow this new size to be set. Alternatively you can change the default buffer size on your system in the same way in which case that will be used with no change necessary in this option", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_OPT_CONTROL", + default => "no", + description => "Support controllable (e.g. PTZ) cameras", + help => "ZoneMinder includes limited support for controllable cameras. A number of sample protocols are included and others can easily be added. If you wish to control your cameras via ZoneMinder then select this option otherwise if you only have static cameras or use other control methods then leave this option off.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_OPT_TRIGGERS", + default => "no", + description => "Interface external event triggers via socket or device files", + help => "ZoneMinder can interact with external systems which prompt or cancel alarms. This is done via the zmtrigger.pl script. This option indicates whether you want to use these external triggers. Most people will say no here.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_CHECK_FOR_UPDATES", + default => "yes", + description => "Check with zoneminder.com for updated versions", + help => "From ZoneMinder version 1.17.0 onwards new versions are expected to be more frequent. To save checking manually for each new version ZoneMinder can check with the zoneminder.com website to determine the most recent release. These checks are infrequent, about once per week, and no personal or system information is transmitted other than your current version number. If you do not wish these checks to take place or your ZoneMinder system has no internet access you can switch these check off with this configuration variable", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_UPDATE_CHECK_PROXY", + default => "", + description => "Proxy url if required to access zoneminder.com", + help => "If you use a proxy to access the internet then ZoneMinder needs to know so it can access zoneminder.com to check for updates. If you do use a proxy enter the full proxy url here in the form of http://:/", + type => $types{string}, + category => "system", + }, + { + name => "ZM_SHM_KEY", + default => "0x7a6d0000", + description => "Shared memory root key to use", + help => "ZoneMinder uses shared memory to speed up communication between modules. To identify the right area to use shared memory keys are used. This option controls what the base key is, each monitor will have it's Id or'ed with this to get the actual key used. You will not normally need to change this value unless it clashes with another instance of ZoneMinder on the same machine. Only the first four hex digits are used, the lower four will be masked out and ignored.", + type => $types{hexadecimal}, + category => "system", + }, + # Deprecated, really no longer necessary + { + name => "ZM_WEB_REFRESH_METHOD", + default => "javascript", + description => "What method windows should use to refresh themselves", + help => "Many windows in Javascript need to refresh themselves to keep their information current. This option determines what method they should use to do this. Choosing 'javascript' means that each window will have a short JavaScript statement in with a timer to prompt the refresh. This is the most compatible method. Choosing 'http' means the refresh instruction is put in the HTTP header. This is a cleaner method but refreshes are interrupted or cancelled when a link in the window is clicked meaning that the window will no longer refresh and this would have to be done manually.", + type => { db_type=>"string", hint=>"javascript|http", pattern=>qr|^([jh])|i, format=>q( $1 =~ /^j/ ? "javascript" : "http" ) }, + category => "hidden", + }, + { + name => "ZM_WEB_EVENT_SORT_FIELD", + default => "DateTime", + description => "Default field the event lists are sorted by", + help => "Events in lists can be initially ordered in any way you want. This option controls what field is used to sort them. You can modify this ordering from filters or by clicking on headings in the lists themselves. Bear in mind however that the 'Prev' and 'Next' links, when scrolling through events, relate to the ordering in the lists and so not always to time based ordering.", + type => { db_type=>"string", hint=>"Id|Name|Cause|MonitorName|DateTime|Length|Frames|AlarmFrames|TotScore|AvgScore|MaxScore", pattern=>qr|.|, format=>q( $1 ) }, + category => "web", + }, + { + name => "ZM_WEB_EVENT_SORT_ORDER", + default => "asc", + description => "Default order the event lists are sorted by", + help => "Events in lists can be initially ordered in any way you want. This option controls what order (ascending or descending) is used to sort them. You can modify this ordering from filters or by clicking on headings in the lists themselves. Bear in mind however that the 'Prev' and 'Next' links, when scrolling through events, relate to the ordering in the lists and so not always to time based ordering.", + type => { db_type=>"string", hint=>"asc|desc", pattern=>qr|^([ad])|i, format=>q( $1 =~ /^a/i ? "asc" : "desc" ) }, + category => "web", + }, + { + name => "ZM_WEB_EVENTS_PER_PAGE", + default => "25", + description => "How many events to list per page in paged mode", + help => "In the event list view you can either list all events or just a page at a time. This option controls how many events are listed per page in paged mode and how often to repeat the column headers in non-paged mode.", + type => $types{integer}, + category => "web", + }, + { + name => "ZM_WEB_LIST_THUMBS", + default => "no", + description => "Display mini-thumbnails of event images in event lists", + help => "Ordinarily the event lists just display text details of the events to save space and time. By switching this option on you can also display small thumbnails to help you identify events of interest. The size of these thumbnails is controlled by the following two options.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_WEB_LIST_THUMB_WIDTH", + default => "48", + description => "The width of the thumbnails that appear in the event lists", + help => "This options controls the width of the thumbnail images that appear in the event lists. It should be fairly small to fit in with the rest of the table. If you prefer you can specify a height instead in the next option but you should only use one of the width or height and the other option should be set to zero. If both width and height are specified then width will be used and height ignored.", + type => $types{integer}, + requires => [ { name => "ZM_WEB_LIST_THUMBS", value => "yes" } ], + category => "web", + }, + { + name => "ZM_WEB_LIST_THUMB_HEIGHT", + default => "0", + description => "The height of the thumbnails that appear in the event lists", + help => "This options controls the height of the thumbnail images that appear in the event lists. It should be fairly small to fit in with the rest of the table. If you prefer you can specify a width instead in the previous option but you should only use one of the width or height and the other option should be set to zero. If both width and height are specified then width will be used and height ignored.", + type => $types{integer}, + requires => [ { name => "ZM_WEB_LIST_THUMBS", value => "yes" } ], + category => "web", + }, + { + name => "ZM_WEB_USE_OBJECT_TAGS", + default => "yes", + description => "Wrap embed in object tags for media content", + help => "There are two methods of including media content in web pages. The most common way is use the EMBED tag which is able to give some indication of the type of content. However this is not a standard part of HTML. The official method is to use OBJECT tags which are able to give more information allowing the correct media viewers etc to be loaded. However these are less widely supported and content may be specifically tailored to a particular platform or player. This option controls whether media content is enclosed in EMBED tags only or whether, where appropriate, it is additionally wrapped in OBJECT tags. Currently OBJECT tags are only used in a limited number of circumstances but they may become more widespread in the future. It is suggested that you leave this option on unless you encounter problems playing some content.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_WEB_H_REFRESH_MAIN", + default => "300", + introduction => "There are now a number of options that are grouped into bandwidth categories, this allows you to configure the ZoneMinder client to work optimally over the various access methods you might to access the client.\n\nThe next few options control what happens when the client is running in 'high' bandwidth mode. You should set these options for when accessing the ZoneMinder client over a local network or high speed link. In most cases the default values will be suitable as a starting point.", + description => "How often (in seconds) the main console window should refresh itself", + help => "The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_REFRESH_CYCLE", + default => "10", + description => "How often (in seconds) the cycle watch window swaps to the next monitor", + help => "The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_REFRESH_IMAGE", + default => "5", + description => "How often (in seconds) the watched image is refreshed (if not streaming)", + help => "The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_REFRESH_STATUS", + default => "3", + description => "How often (in seconds) the status refreshes itself in the watch window", + help => "The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_REFRESH_EVENTS", + default => "30", + description => "How often (in seconds) the event listing is refreshed in the watch window", + help => "The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_CAN_STREAM", + default => "auto", + description => "Override the automatic detection of browser streaming capability", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_STREAM_METHOD", + default => "jpeg", + description => "Which method should be used to send video streams to your browser.", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_DEFAULT_SCALE", + default => "100", + description => "What the default scaling factor applied to 'live' or 'event' views is (%)", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_DEFAULT_RATE", + default => "100", + description => "What the default replay rate factor applied to 'event' views is (%)", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_VIDEO_BITRATE", + default => "150000", + description => "What the bitrate of the video encoded stream should be set to", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_VIDEO_MAXFPS", + default => "15", + description => "What the maximum frame rate for streamed video should be", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_SCALE_THUMBS", + default => "no", + description => "Scale thumbnails in events, bandwidth versus cpu in rescaling", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_EVENTS_VIEW", + default => "events", + description => "What the default view of multiple events should be.", + help => "Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.", + type => { db_type=>"string", hint=>"events|timeline", pattern=>qr|^([lt])|i, format=>q( $1 =~ /^e/ ? "events" : "timeline" ) }, + category => "highband", + }, + { + name => "ZM_WEB_H_SHOW_PROGRESS", + default => "yes", + description => "Show the progress of replay in event view.", + help => "When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.", + type => $types{boolean}, + category => "highband", + }, + { + name => "ZM_WEB_H_AJAX_TIMEOUT", + default => "3000", + description => "How long to wait for Ajax request responses (ms)", + help => "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 => "highband", + }, + { + name => "ZM_WEB_M_REFRESH_MAIN", + default => "300", + description => "How often (in seconds) the main console window should refresh itself", + help => "The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.", + type => $types{integer}, + introduction => "The next few options control what happens when the client is running in 'medium' bandwidth mode. You should set these options for when accessing the ZoneMinder client over a slower cable or DSL link. In most cases the default values will be suitable as a starting point.", + category => "medband", + }, + { + name => "ZM_WEB_M_REFRESH_CYCLE", + default => "20", + description => "How often (in seconds) the cycle watch window swaps to the next monitor", + help => "The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.", + type => $types{integer}, + category => "medband", + }, + { + name => "ZM_WEB_M_REFRESH_IMAGE", + default => "10", + description => "How often (in seconds) the watched image is refreshed (if not streaming)", + help => "The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.", + type => $types{integer}, + category => "medband", + }, + { + name => "ZM_WEB_M_REFRESH_STATUS", + default => "5", + description => "How often (in seconds) the status refreshes itself in the watch window", + help => "The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.", + type => $types{integer}, + category => "medband", + }, + { + name => "ZM_WEB_M_REFRESH_EVENTS", + default => "60", + description => "How often (in seconds) the event listing is refreshed in the watch window", + help => "The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.", + type => $types{integer}, + category => "medband", + }, + { + name => "ZM_WEB_M_CAN_STREAM", + default => "auto", + description => "Override the automatic detection of browser streaming capability", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_STREAM_METHOD", + default => "jpeg", + description => "Which method should be used to send video streams to your browser.", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_DEFAULT_SCALE", + default => "100", + description => "What the default scaling factor applied to 'live' or 'event' views is (%)", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_DEFAULT_RATE", + default => "100", + description => "What the default replay rate factor applied to 'event' views is (%)", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_VIDEO_BITRATE", + default => "75000", + description => "What the bitrate of the video encoded stream should be set to", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_VIDEO_MAXFPS", + default => "10", + description => "What the maximum frame rate for streamed video should be", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_SCALE_THUMBS", + default => "yes", + description => "Scale thumbnails in events, bandwidth versus cpu in rescaling", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_EVENTS_VIEW", + default => "events", + description => "What the default view of multiple events should be.", + help => "Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.", + type => { db_type=>"string", hint=>"events|timeline", pattern=>qr|^([lt])|i, format=>q( $1 =~ /^e/ ? "events" : "timeline" ) }, + category => "medband", + }, + { + name => "ZM_WEB_M_SHOW_PROGRESS", + default => "yes", + description => "Show the progress of replay in event view.", + help => "When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.", + type => $types{boolean}, + category => "medband", + }, + { + name => "ZM_WEB_M_AJAX_TIMEOUT", + default => "5000", + description => "How long to wait for Ajax request responses (ms)", + help => "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 => "medband", + }, + { + name => "ZM_WEB_L_REFRESH_MAIN", + default => "300", + description => "How often (in seconds) the main console window should refresh itself", + introduction => "The next few options control what happens when the client is running in 'low' bandwidth mode. You should set these options for when accessing the ZoneMinder client over a modem or slow link. In most cases the default values will be suitable as a starting point.", + help => "The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_REFRESH_CYCLE", + default => "30", + description => "How often (in seconds) the cycle watch window swaps to the next monitor", + help => "The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_REFRESH_IMAGE", + default => "15", + description => "How often (in seconds) the watched image is refreshed (if not streaming)", + help => "The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_REFRESH_STATUS", + default => "10", + description => "How often (in seconds) the status refreshes itself in the watch window", + help => "The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_REFRESH_EVENTS", + default => "180", + description => "How often (in seconds) the event listing is refreshed in the watch window", + help => "The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_CAN_STREAM", + default => "auto", + description => "Override the automatic detection of browser streaming capability", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_STREAM_METHOD", + default => "jpeg", + description => "Which method should be used to send video streams to your browser.", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_DEFAULT_SCALE", + default => "100", + description => "What the default scaling factor applied to 'live' or 'event' views is (%)", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_DEFAULT_RATE", + default => "100", + description => "What the default replay rate factor applied to 'event' views is (%)", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_VIDEO_BITRATE", + default => "25000", + description => "What the bitrate of the video encoded stream should be set to", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_VIDEO_MAXFPS", + default => "5", + description => "What the maximum frame rate for streamed video should be", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_SCALE_THUMBS", + default => "yes", + description => "Scale thumbnails in events, bandwidth versus cpu in rescaling", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_EVENTS_VIEW", + default => "events", + description => "What the default view of multiple events should be.", + help => "Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.", + type => { db_type=>"string", hint=>"events|timeline", pattern=>qr|^([lt])|i, format=>q( $1 =~ /^e/ ? "events" : "timeline" ) }, + category => "lowband", + }, + { + name => "ZM_WEB_L_SHOW_PROGRESS", + default => "no", + description => "Show the progress of replay in event view.", + help => "When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.", + type => $types{boolean}, + category => "lowband", + }, + { + name => "ZM_WEB_L_AJAX_TIMEOUT", + default => "10000", + description => "How long to wait for Ajax request responses (ms)", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_P_CAN_STREAM", + default => "auto", + description => "Override the automatic detection of browser streaming capability", + help => "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 => "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 => "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 => "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 => "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 => "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 => "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 => "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", + default => "", + description => "What the last version of ZoneMinder recorded from zoneminder.com is", + help => "", + type => $types{string}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_CURR_VERSION", + default => "1.25.0", + description => "What the effective current version of ZoneMinder is, might be different from actual if versions ignored", + help => "", + type => $types{string}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_DB_VERSION", + default => "1.25.0", + description => "What the version of the database is, from zmupdate", + help => "", + type => $types{string}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_LAST_CHECK", + default => "", + description => "When the last check for version from zoneminder.com was", + help => "", + type => $types{integer}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_NEXT_REMINDER", + default => "", + description => "When the earliest time to remind about versions will be", + help => "", + type => $types{string}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_DONATE_REMINDER_TIME", + default => 0, + description => "When the earliest time to remind about donations will be", + help => "", + type => $types{integer}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_SHOW_DONATE_REMINDER", + default => "yes", + description => "Remind about donations or not", + help => "", + type => $types{boolean}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_EYEZM_DEBUG", + default => "no", + description => "Switch additional debugging on for eyeZm Plugin", + help => "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 => "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 => "/var/log/zm/zm_xml.log", + description => "Default filename to use when logging eyeZm Output and EYEZM_LOG_TO_FILE is enabled", + help => "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 => "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 => "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 => "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 => "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 => "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 => "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", + }, + { + name => "ZM_PATH_PLUGINS", + default => "/usr/share/zm", + description => "Path to the plugin folder", + help => "3d-party plugins have to be placed here.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_PLUGIN_EXTENSION", + default => ".zmpl", + description => "Default extension of plugins to found.", + help => "Default extension of plugins to found.", + type => $types{rel_path}, + category => "paths", + }, + { + name => "ZM_PLUGINS_CONFIG_PATH", + default => "/usr/share/zm/plugins.conf", + description => "Path to the config file for plugins.", + help => "Path to the config file for plugins.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_LOAD_PLUGINS", + default => "no", + description => "Load and use 3d-party plugins", + help => "3d-party plugins will be loaded and used for analysing.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_TURNOFF_NATIVE_ANALYSIS", + default => "no", + description => "Turn native ZM\'s image analysis possibility off", + help => "Image analysis with ZM\'s motion detected function will be turned off. Only detection functions from loaded plugins will be used. Note, that if no plugins have be loaded, no detection will be done.", + type => $types{boolean}, + category => "config", + }, + +); + +our %options_hash = map { ( $_->{name}, $_ ) } @options; + +# This function should never need to be called explicitly, except if +# this module is 'require'd rather than 'use'd. See zmconfgen.pl. +sub initialiseConfig +{ + return if ( $configInitialised ); + + # Do some initial data munging to finish the data structures + # Create option ids + my $option_id = 0; + foreach my $option ( @options ) + { + if ( defined($option->{default}) ) + { + $option->{value} = $option->{default} + } + else + { + $option->{value} = ''; + } + #next if ( $option->{category} eq 'hidden' ); + $option->{id} = $option_id++; + } + $configInitialised = 1; +} + +1; +__END__ + +=head1 NAME + +ZoneMinder::ConfigData - ZoneMinder Configuration Data module + +=head1 SYNOPSIS + + use ZoneMinder::ConfigData; + use ZoneMinder::ConfigData qw(:all); + + loadConfigFromDB(); + saveConfigToDB(); + +=head1 DESCRIPTION + +The ZoneMinder:ConfigData module contains the master definition of the ZoneMinder configuration options as well as helper methods. This module is intended for specialist confguration management and would not normally be used by end users. + +The configuration held in this module, which was previously in zmconfig.pl, includes the name, default value, description, help text, type and category for each option, as well as a number of additional fields in a small number of cases. + +=head1 METHODS + +=over 4 + +=item loadConfigFromDB (); + +Loads existing configuration from the database (if any) and merges it with the definitions held in this module. This results in the merging of any new configuration and the removal of any deprecated configuration while preserving the existing values of every else. + +=item saveConfigToDB (); + +Saves configuration held in memory to the database. The act of loading and saving configuration is a convenient way to ensure that the configuration held in the database corresponds with the most recent definitions and that all components are using the same set of configuration. + +=head2 EXPORT + +None by default. +The :data tag will export the various configuration data structures +The :functions tag will export the helper functions. +The :all tag will export all above symbols. + + +=head1 SEE ALSO + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Control.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Control.pm new file mode 100644 index 000000000..2a646772d --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Control.pm @@ -0,0 +1,205 @@ +# ========================================================================== +# +# ZoneMinder Base Control Module, $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. +# +# ========================================================================== +# +# This module contains the base class definitions for the camera control +# protocol implementations +# +package ZoneMinder::Control; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Base connection class +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Database qw(:all); + +our $AUTOLOAD; + +sub new +{ + my $class = shift; + my $id = shift; + my $self = {}; + $self->{name} = "PelcoD"; + if ( !defined($id) ) + { + Fatal( "No monitor defined when invoking protocol ".$self->{name} ); + } + $self->{id} = $id; + bless( $self, $class ); + return $self; +} + +sub DESTROY +{ +} + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + croak( "Can't access $name member of object of class $class" ); +} + +sub getKey() +{ + my $self = shift; + return( $self->{id} ); +} + +sub open +{ + my $self = shift; + Fatal( "No open method defined for protocol ".$self->{name} ); +} + +sub close +{ + my $self = shift; + Fatal( "No close method defined for protocol ".$self->{name} ); +} + +sub loadMonitor +{ + my $self = shift; + if ( !$self->{Monitor} ) + { + if ( !($self->{Monitor} = zmDbGetMonitor( $self->{id} )) ) + { + Fatal( "Monitor id ".$self->{id}." not found or not controllable" ); + } + if ( defined($self->{Monitor}->{AutoStopTimeout}) ) + { + # Convert to microseconds. + $self->{Monitor}->{AutoStopTimeout} = int(1000000*$self->{Monitor}->{AutoStopTimeout}); + } + } +} + +sub getParam +{ + my $self = shift; + my $params = shift; + my $name = shift; + my $default = shift; + + if ( defined($params->{$name}) ) + { + return( $params->{$name} ); + } + elsif ( defined($default) ) + { + return( $default ); + } + Fatal( "Missing mandatory parameter '$name'" ); +} + +sub executeCommand +{ + my $self = shift; + my $params = shift; + + $self->loadMonitor(); + + my $command = $params->{command}; + delete $params->{command}; + + #if ( !defined($self->{$command}) ) + #{ + #Fatal( "Unsupported command '$command'" ); + #} + &{$self->{$command}}( $self, $params ); +} + +sub printMsg() +{ + my $self = shift; + Fatal( "No printMsg method defined for protocol ".$self->{name} ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Control/AxisV2.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Control/AxisV2.pm new file mode 100644 index 000000000..e5a5882b9 --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Control/AxisV2.pm @@ -0,0 +1,475 @@ +# ========================================================================== +# +# ZoneMinder Axis version 2 API Control Protocol Module, $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. +# +# ========================================================================== +# +# This module contains the implementation of the Axis V2 API camera control +# protocol +# +package ZoneMinder::Control::AxisV2; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Axis V2 Control Protocol +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Config qw(:all); + +use Time::HiRes qw( usleep ); + +sub new +{ + my $class = shift; + my $id = shift; + my $self = ZoneMinder::Control->new( $id ); + bless( $self, $class ); + srand( time() ); + return $self; +} + +our $AUTOLOAD; + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + Fatal( "Can't access $name member of object of class $class" ); +} + +sub open +{ + my $self = shift; + + $self->loadMonitor(); + + use LWP::UserAgent; + $self->{ua} = LWP::UserAgent->new; + $self->{ua}->agent( "ZoneMinder Control Agent/".ZM_VERSION ); + + $self->{state} = 'open'; +} + +sub close +{ + my $self = shift; + $self->{state} = 'closed'; +} + +sub printMsg +{ + my $self = shift; + my $msg = shift; + my $msg_len = length($msg); + + Debug( $msg."[".$msg_len."]" ); +} + +sub sendCmd +{ + my $self = shift; + my $cmd = shift; + + my $result = undef; + + printMsg( $cmd, "Tx" ); + + #print( "http://$address/$cmd\n" ); + my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/$cmd" ); + my $res = $self->{ua}->request($req); + + if ( $res->is_success ) + { + $result = !undef; + } + else + { + Error( "Error check failed: '".$res->status_line()."'" ); + } + + return( $result ); +} + +sub cameraReset +{ + my $self = shift; + Debug( "Camera Reset" ); + my $cmd = "/axis-cgi/admin/restart.cgi"; + $self->sendCmd( $cmd ); +} + +sub moveConUp +{ + my $self = shift; + Debug( "Move Up" ); + my $cmd = "/axis-cgi/com/ptz.cgi?move=up"; + $self->sendCmd( $cmd ); +} + +sub moveConDown +{ + my $self = shift; + Debug( "Move Down" ); + my $cmd = "/axis-cgi/com/ptz.cgi?move=down"; + $self->sendCmd( $cmd ); +} + +sub moveConLeft +{ + my $self = shift; + Debug( "Move Left" ); + my $cmd = "/axis-cgi/com/ptz.cgi?move=left"; + $self->sendCmd( $cmd ); +} + +sub moveConRight +{ + my $self = shift; + Debug( "Move Right" ); + my $cmd = "/axis-cgi/com/ptz.cgi?move=right"; + $self->sendCmd( $cmd ); +} + +sub moveConUpRight +{ + my $self = shift; + Debug( "Move Up/Right" ); + my $cmd = "/axis-cgi/com/ptz.cgi?move=upright"; + $self->sendCmd( $cmd ); +} + +sub moveConUpLeft +{ + my $self = shift; + Debug( "Move Up/Left" ); + my $cmd = "/axis-cgi/com/ptz.cgi?move=upleft"; + $self->sendCmd( $cmd ); +} + +sub moveConDownRight +{ + my $self = shift; + Debug( "Move Down/Right" ); + my $cmd = "/axis-cgi/com/ptz.cgi?move=downright"; + $self->sendCmd( $cmd ); +} + +sub moveConDownLeft +{ + my $self = shift; + Debug( "Move Down/Left" ); + my $cmd = "/axis-cgi/com/ptz.cgi?move=downleft"; + $self->sendCmd( $cmd ); +} + +sub moveMap +{ + my $self = shift; + my $params = shift; + my $xcoord = $self->getParam( $params, 'xcoord' ); + my $ycoord = $self->getParam( $params, 'ycoord' ); + Debug( "Move Map to $xcoord,$ycoord" ); + my $cmd = "/axis-cgi/com/ptz.cgi?center=$xcoord,$ycoord&imagewidth=".$self->{Monitor}->{Width}."&imageheight=".$self->{Monitor}->{Height}; + $self->sendCmd( $cmd ); +} + +sub moveRelUp +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'tiltstep' ); + Debug( "Step Up $step" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rtilt=$step"; + $self->sendCmd( $cmd ); +} + +sub moveRelDown +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'tiltstep' ); + Debug( "Step Down $step" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rtilt=-$step"; + $self->sendCmd( $cmd ); +} + +sub moveRelLeft +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'panstep' ); + Debug( "Step Left $step" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rpan=-$step"; + $self->sendCmd( $cmd ); +} + +sub moveRelRight +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'panstep' ); + Debug( "Step Right $step" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rpan=$step"; + $self->sendCmd( $cmd ); +} + +sub moveRelUpRight +{ + my $self = shift; + my $params = shift; + my $panstep = $self->getParam( $params, 'panstep' ); + my $tiltstep = $self->getParam( $params, 'tiltstep' ); + Debug( "Step Up/Right $tiltstep/$panstep" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rpan=$panstep&rtilt=$tiltstep"; + $self->sendCmd( $cmd ); +} + +sub moveRelUpLeft +{ + my $self = shift; + my $params = shift; + my $panstep = $self->getParam( $params, 'panstep' ); + my $tiltstep = $self->getParam( $params, 'tiltstep' ); + Debug( "Step Up/Left $tiltstep/$panstep" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rpan=-$panstep&rtilt=$tiltstep"; + $self->sendCmd( $cmd ); +} + +sub moveRelDownRight +{ + my $self = shift; + my $params = shift; + my $panstep = $self->getParam( $params, 'panstep' ); + my $tiltstep = $self->getParam( $params, 'tiltstep' ); + Debug( "Step Down/Right $tiltstep/$panstep" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rpan=$panstep&rtilt=-$tiltstep"; + $self->sendCmd( $cmd ); +} + +sub moveRelDownLeft +{ + my $self = shift; + my $params = shift; + my $panstep = $self->getParam( $params, 'panstep' ); + my $tiltstep = $self->getParam( $params, 'tiltstep' ); + Debug( "Step Down/Left $tiltstep/$panstep" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rpan=-$panstep&rtilt=-$tiltstep"; + $self->sendCmd( $cmd ); +} + +sub zoomRelTele +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Zoom Tele" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rzoom=$step"; + $self->sendCmd( $cmd ); +} + +sub zoomRelWide +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Zoom Wide" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rzoom=-$step"; + $self->sendCmd( $cmd ); +} + +sub focusRelNear +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Focus Near" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rfocus=-$step"; + $self->sendCmd( $cmd ); +} + +sub focusRelFar +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Focus Far" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rfocus=$step"; + $self->sendCmd( $cmd ); +} + +sub focusAuto +{ + my $self = shift; + Debug( "Focus Auto" ); + my $cmd = "/axis-cgi/com/ptz.cgi?autofocus=on"; + $self->sendCmd( $cmd ); +} + +sub focusMan +{ + my $self = shift; + Debug( "Focus Manual" ); + my $cmd = "/axis-cgi/com/ptz.cgi?autofocus=off"; + $self->sendCmd( $cmd ); +} + +sub irisRelOpen +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Iris Open" ); + my $cmd = "/axis-cgi/com/ptz.cgi?riris=$step"; + $self->sendCmd( $cmd ); +} + +sub irisRelClose +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Iris Close" ); + my $cmd = "/axis-cgi/com/ptz.cgi?riris=-$step"; + $self->sendCmd( $cmd ); +} + +sub irisAuto +{ + my $self = shift; + Debug( "Iris Auto" ); + my $cmd = "/axis-cgi/com/ptz.cgi?autoiris=on"; + $self->sendCmd( $cmd ); +} + +sub irisMan +{ + my $self = shift; + Debug( "Iris Manual" ); + my $cmd = "/axis-cgi/com/ptz.cgi?autoiris=off"; + $self->sendCmd( $cmd ); +} + +sub presetClear +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + Debug( "Clear Preset $preset" ); + my $cmd = "/axis-cgi/com/ptz.cgi?removeserverpresetno=$preset"; + $self->sendCmd( $cmd ); +} + +sub presetSet +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + Debug( "Set Preset $preset" ); + my $cmd = "/axis-cgi/com/ptz.cgi?setserverpresetno=$preset"; + $self->sendCmd( $cmd ); +} + +sub presetGoto +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + Debug( "Goto Preset $preset" ); + my $cmd = "/axis-cgi/com/ptz.cgi?gotoserverpresetno=$preset"; + $self->sendCmd( $cmd ); +} + +sub presetHome +{ + my $self = shift; + Debug( "Home Preset" ); + my $cmd = "/axis-cgi/com/ptz.cgi?move=home"; + $self->sendCmd( $cmd ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Control/Ncs370.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Control/Ncs370.pm new file mode 100644 index 000000000..358aecb2b --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Control/Ncs370.pm @@ -0,0 +1,241 @@ +# ========================================================================== +# +# ZoneMinder Neu-Fusion Control Protocol Module, $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. +# +# ========================================================================== +# +# This module contains the implementation of the Neu-Fusion NCS370 IP camera +# control protocol +# +package ZoneMinder::Control::Ncs370; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Ncs370 IP Control Protocol +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Config qw(:all); + +use Time::HiRes qw( usleep ); + +sub new +{ + my $class = shift; + my $id = shift; + my $self = ZoneMinder::Control->new( $id ); + bless( $self, $class ); + srand( time() ); + return $self; +} + +our $AUTOLOAD; + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + Fatal( "Can't access $name member of object of class $class" ); +} + +sub open +{ + my $self = shift; + + $self->loadMonitor(); + + use LWP::UserAgent; + $self->{ua} = LWP::UserAgent->new; + $self->{ua}->agent( "ZoneMinder Control Agent/".ZM_VERSION ); + + $self->{state} = 'open'; +} + +sub close +{ + my $self = shift; + $self->{state} = 'closed'; +} + +sub printMsg +{ + my $self = shift; + my $msg = shift; + my $msg_len = length($msg); + + Debug( $msg."[".$msg_len."]" ); +} + +sub sendCmd +{ + my $self = shift; + my $cmd = shift; + + my $result = undef; + + printMsg( $cmd, "Tx" ); + + my $req = HTTP::Request->new( POST=>"http://".$self->{Monitor}->{ControlAddress}."/PANTILTCONTROL.CGI" ); + my $res = $self->{ua}->request($req); + + if ( $res->is_success ) + { + $result = !undef; + } + else + { + Error( "Error check failed: '".$res->status_line()."'" ); + } + + return( $result ); +} + +sub moveConUp +{ + my $self = shift; + Debug( "Move Up" ); + my $cmd = "PanSingleMoveDegree=1\nTiltSingleMoveDegree=1\nPanTiltSingleMove=1"; + $self->sendCmd( $cmd ); +} + +sub moveConDown +{ + my $self = shift; + Debug( "Move Down" ); + my $cmd = "PanSingleMoveDegree=1\nTiltSingleMoveDegree=1\nPanTiltSingleMove=7"; + $self->sendCmd( $cmd ); +} + +sub moveConLeft +{ + my $self = shift; + Debug( "Move Left" ); + my $cmd = "PanSingleMoveDegree=1\nTiltSingleMoveDegree=1\nPanTiltSingleMove=3"; + $self->sendCmd( $cmd ); +} + +sub moveConRight +{ + my $self = shift; + Debug( "Move Right" ); + my $cmd = "PanSingleMoveDegree=1\nTiltSingleMoveDegree=1\nPanTiltSingleMove=5"; + $self->sendCmd( $cmd ); +} + +sub moveConUpRight +{ + moveConUp(); + moveConRight(); +} + +sub moveConUpLeft +{ + moveConUp(); + moveConLeft(); +} + +sub moveConDownRight +{ + moveConDown(); + moveConRight(); +} + +sub moveConDownLeft +{ + moveConDown(); + moveConLeft(); +} + +sub presetHome +{ + my $self = shift; + Debug( "Home Preset" ); + my $cmd = "PanSingleMoveDegree=1\nTiltSingleMoveDegree=1\nPanTiltSingleMove=4"; + $self->sendCmd( $cmd ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Control/PanasonicIP.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Control/PanasonicIP.pm new file mode 100644 index 000000000..643765e9f --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Control/PanasonicIP.pm @@ -0,0 +1,322 @@ +# ========================================================================== +# +# ZoneMinder Panasonic IP Control Protocol Module, $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. +# +# ========================================================================== +# +# This module contains the implementation of the Panasonic IP camera control +# protocol +# +package ZoneMinder::Control::PanasonicIP; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Panasonic IP Control Protocol +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Config qw(:all); + +use Time::HiRes qw( usleep ); + +sub new +{ + my $class = shift; + my $id = shift; + my $self = ZoneMinder::Control->new( $id ); + bless( $self, $class ); + srand( time() ); + return $self; +} + +our $AUTOLOAD; + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + Fatal( "Can't access $name member of object of class $class" ); +} + +sub open +{ + my $self = shift; + + $self->loadMonitor(); + + use LWP::UserAgent; + $self->{ua} = LWP::UserAgent->new; + $self->{ua}->agent( "ZoneMinder Control Agent/".ZM_VERSION ); + + $self->{state} = 'open'; +} + +sub close +{ + my $self = shift; + $self->{state} = 'closed'; +} + +sub printMsg +{ + my $self = shift; + my $msg = shift; + my $msg_len = length($msg); + + Debug( $msg."[".$msg_len."]" ); +} + +sub sendCmd +{ + my $self = shift; + my $cmd = shift; + + my $result = undef; + + printMsg( $cmd, "Tx" ); + + my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/$cmd" ); + my $res = $self->{ua}->request($req); + + if ( $res->is_success ) + { + $result = !undef; + } + else + { + Error( "Error check failed: '".$res->status_line()."'" ); + } + + return( $result ); +} + +sub cameraReset +{ + my $self = shift; + Debug( "Camera Reset" ); + my $cmd = "nphRestart?PAGE=Restart&Restart=OK"; + $self->sendCmd( $cmd ); +} + +sub moveConUp +{ + my $self = shift; + Debug( "Move Up" ); + my $cmd = "nphControlCamera?Direction=TiltUp"; + $self->sendCmd( $cmd ); +} + +sub moveConDown +{ + my $self = shift; + Debug( "Move Down" ); + my $cmd = "nphControlCamera?Direction=TiltDown"; + $self->sendCmd( $cmd ); +} + +sub moveConLeft +{ + my $self = shift; + Debug( "Move Left" ); + my $cmd = "nphControlCamera?Direction=PanLeft"; + $self->sendCmd( $cmd ); +} + +sub moveConRight +{ + my $self = shift; + Debug( "Move Right" ); + my $cmd = "nphControlCamera?Direction=PanRight"; + $self->sendCmd( $cmd ); +} + +sub moveMap +{ + my $self = shift; + my $params = shift; + my $xcoord = $self->getParam( $params, 'xcoord' ); + my $ycoord = $self->getParam( $params, 'ycoord' ); + Debug( "Move Map to $xcoord,$ycoord" ); + my $cmd = "nphControlCamera?Direction=Direct&NewPosition.x=$xcoord&NewPosition.y=$ycoord&Width=".$self->{Monitor}->{Width}."&Height=".$self->{Monitor}->{Height}; + $self->sendCmd( $cmd ); +} + +sub zoomConTele +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Zoom Tele" ); + my $cmd = "nphControlCamera?Direction=ZoomTele"; + $self->sendCmd( $cmd ); +} + +sub zoomConWide +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Zoom Wide" ); + my $cmd = "nphControlCamera?Direction=ZoomWide"; + $self->sendCmd( $cmd ); +} + +sub focusConNear +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Focus Near" ); + my $cmd = "nphControlCamera?Direction=FocusNear"; + $self->sendCmd( $cmd ); +} + +sub focusConFar +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Focus Far" ); + my $cmd = "nphControlCamera?Direction=FocusFar"; + $self->sendCmd( $cmd ); +} + +sub focusAuto +{ + my $self = shift; + Debug( "Focus Auto" ); + my $cmd = "nphControlCamera?Direction=FocusAuto"; + $self->sendCmd( $cmd ); +} + +sub focusMan +{ + my $self = shift; + Debug( "Focus Manual" ); + my $cmd = "/axis-cgi/com/ptz.cgi?autofocus=off"; + $self->sendCmd( $cmd ); +} + +sub presetClear +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + Debug( "Clear Preset $preset" ); + my $cmd = "nphPresetNameCheck?Data=$preset"; + $self->sendCmd( $cmd ); +} + +sub presetSet +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + Debug( "Set Preset $preset" ); + my $cmd = "nphPresetNameCheck?PresetName=$preset&Data=$preset"; + $self->sendCmd( $cmd ); +} + +sub presetGoto +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + Debug( "Goto Preset $preset" ); + my $cmd = "nphControlCamera?Direction=Preset&PresetOperation=Move&Data=$preset"; + $self->sendCmd( $cmd ); +} + +sub presetHome +{ + my $self = shift; + Debug( "Home Preset" ); + my $cmd = "nphControlCamera?Direction=HomePosition"; + $self->sendCmd( $cmd ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Control/PelcoD.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Control/PelcoD.pm new file mode 100644 index 000000000..6c507bd1a --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Control/PelcoD.pm @@ -0,0 +1,735 @@ +# ========================================================================== +# +# ZoneMinder Pelco-D Control Protocol Module, $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. +# +# ========================================================================== +# +# This module contains the implementation of the Pelco-D camera control +# protocol +# +package ZoneMinder::Control::PelcoD; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Pelco-D Control Protocol +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +use Time::HiRes qw( usleep ); + +use constant SYNC => 0xff; +use constant COMMAND_GAP => 100000; # In ms + +sub new +{ + my $class = shift; + my $id = shift; + my $self = ZoneMinder::Control->new( $id ); + bless( $self, $class ); + srand( time() ); + return $self; +} + +our $AUTOLOAD; + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + Fatal( "Can't access $name member of object of class $class" ); +} + +sub open +{ + my $self = shift; + + $self->loadMonitor(); + + use Device::SerialPort; + $self->{port} = new Device::SerialPort( $self->{Monitor}->{ControlDevice} ); + $self->{port}->baudrate(2400); + $self->{port}->databits(8); + $self->{port}->parity('none'); + $self->{port}->stopbits(1); + $self->{port}->handshake('none'); + + $self->{port}->read_const_time(50); + $self->{port}->read_char_time(10); + + $self->{state} = 'open'; +} + +sub close +{ + my $self = shift; + $self->{state} = 'closed'; + $self->{port}->close(); +} + +sub printMsg +{ + if ( logDebugging() ) + { + my $self = shift; + my $msg = shift; + my $prefix = shift || ""; + $prefix = $prefix.": " if ( $prefix ); + + my $line_length = 16; + my $msg_len = int(@$msg); + + my $msg_str = $prefix; + for ( my $i = 0; $i < $msg_len; $i++ ) + { + if ( ($i > 0) && ($i%$line_length == 0) && ($i != ($msg_len-1)) ) + { + $msg_str .= sprintf( "\n%*s", length($prefix), "" ); + } + $msg_str .= sprintf( "%02x ", $msg->[$i] ); + } + $msg_str .= "[".$msg_len."]"; + Debug( $msg_str ); + } +} + +sub sendCmd +{ + my $self = shift; + my $cmd = shift; + my $ack = shift || 0; + + my $result = undef; + + my $checksum = 0x00; + for ( my $i = 1; $i < int(@$cmd); $i++ ) + { + $checksum += $cmd->[$i]; + $checksum &= 0xff; + } + push( @$cmd, $checksum ); + + $self->printMsg( $cmd, "Tx" ); + my $id = $cmd->[0] & 0xf; + + my $tx_msg = pack( "C*", @$cmd ); + + #print( "Tx: ".length( $tx_msg )." bytes\n" ); + my $n_bytes = $self->{port}->write( $tx_msg ); + if ( !$n_bytes ) + { + Error( "Write failed: $!" ); + } + if ( $n_bytes != length($tx_msg) ) + { + Error( "Incomplete write, only ".$n_bytes." of ".length($tx_msg)." written: $!" ); + } + + if ( $ack ) + { + Debug( "Waiting for ack" ); + my $max_wait = 3; + my $now = time(); + while( 1 ) + { + my ( $count, $rx_msg ) = $self->{port}->read(4); + + if ( $count ) + { + #print( "Rx1: ".$count." bytes\n" ); + my @resp = unpack( "C*", $rx_msg ); + printMsg( \@resp, "Rx" ); + + if ( $resp[0] = 0x80 + ($id<<4) ) + { + if ( ($resp[1] & 0xf0) == 0x40 ) + { + my $socket = $resp[1] & 0x0f; + Debug( "Got ack for socket $socket" ); + $result = !undef; + } + else + { + Error( "Got bogus response" ); + } + last; + } + else + { + Error( "Got message for camera ".(($resp[0]-0x80)>>4) ); + } + } + if ( (time() - $now) > $max_wait ) + { + Warning( "Response timeout" ); + last; + } + } + } +} + +sub remoteReset +{ + my $self = shift; + Debug( "Remote Reset" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x0f, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub resetDefaults +{ + my $self = shift; + Debug( "Reset Defaults" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x29, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub cameraOff +{ + my $self = shift; + Debug( "Camera Off" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x08, 0x00, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub cameraOn +{ + my $self = shift; + Debug( "Camera On" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x88, 0x00, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub autoScan +{ + my $self = shift; + Debug( "Auto Scan" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x90, 0x00, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub manScan +{ + my $self = shift; + Debug( "Manual Scan" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x10, 0x00, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub stop +{ + my $self = shift; + Debug( "Stop" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x00, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub moveConUp +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'tiltspeed' ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Up" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x08, 0x00, $speed ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub moveConDown +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'tiltspeed' ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Down" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x10, 0x00, $speed ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveConLeft +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'panspeed' ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Left" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x04, $speed, 0x00 ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveConRight +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'panspeed' ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Right" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x02, $speed, 0x00 ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveConUpLeft +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x3f ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x3f ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Up/Left" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x0c, $panspeed, $tiltspeed ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveConUpRight +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x3f ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x3f ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Up/Right" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x0a, $panspeed, $tiltspeed ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveConDownLeft +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x3f ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x3f ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Down/Left" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x14, $panspeed, $tiltspeed ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveConDownRight +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x3f ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x3f ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Down/Right" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x12, $panspeed, $tiltspeed ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveStop +{ + my $self = shift; + Debug( "Move Stop" ); + $self->stop(); +} + +sub flip180 +{ + my $self = shift; + Debug( "Flip 180" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x07, 0x00, 0x21 ); + $self->sendCmd( \@msg ); +} + +sub zeroPan +{ + my $self = shift; + Debug( "Zero Pan" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x07, 0x00, 0x22 ); + $self->sendCmd( \@msg ); +} + +sub _setZoomSpeed +{ + my $self = shift; + my $speed = shift; + Debug( "Set Zoom Speed $speed" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x25, 0x00, $speed ); + $self->sendCmd( \@msg ); +} + +sub zoomStop +{ + my $self = shift; + Debug( "Zoom Stop" ); + $self->stop(); + $self->_setZoomSpeed( 0 ); +} + +sub zoomConTele +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'speed', 0x01 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Zoom Tele" ); + $self->_setZoomSpeed( $speed ); + usleep( COMMAND_GAP ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x20, 0x00, 0x00 ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->zoomStop(); + } +} + +sub zoomConWide +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'speed', 0x01 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Zoom Wide" ); + $self->_setZoomSpeed( $speed ); + usleep( COMMAND_GAP ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x40, 0x00, 0x00 ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->zoomStop(); + } +} + +sub _setFocusSpeed +{ + my $self = shift; + my $speed = shift; + Debug( "Set Focus Speed $speed" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x27, 0x00, $speed ); + $self->sendCmd( \@msg ); +} + +sub focusConNear +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'speed', 0x03 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Focus Near" ); + $self->_setFocusSpeed( $speed ); + usleep( COMMAND_GAP ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x01, 0x00, 0x00, 0x00 ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->_setFocusSpeed( 0 ); + } +} + +sub focusConFar +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'speed', 0x03 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Focus Far" ); + $self->_setFocusSpeed( $speed ); + usleep( COMMAND_GAP ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x80, 0x00, 0x00 ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->_setFocusSpeed( 0 ); + } +} + +sub focusStop +{ + my $self = shift; + Debug( "Focus Stop" ); + $self->stop(); + $self->_setFocusSpeed( 0 ); +} + +sub focusAuto +{ + my $self = shift; + Debug( "Focus Auto" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x2b, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub focusMan +{ + my $self = shift; + Debug( "Focus Man" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x2b, 0x00, 0x02 ); + $self->sendCmd( \@msg ); +} + +sub _setIrisSpeed +{ + my $self = shift; + my $speed = shift; + Debug( "Set Iris Speed $speed" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x27, 0x00, $speed ); + $self->sendCmd( \@msg ); +} + +sub irisConClose +{ + my $self = shift; + my $params = shift; + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Iris Close" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x04, 0x00, 0x00, 0x00 ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->_setIrisSpeed( 0 ); + } +} + +sub irisConOpen +{ + my $self = shift; + my $params = shift; + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Iris Open" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x02, 0x80, 0x00, 0x00 ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->_setIrisSpeed( 0 ); + } +} + +sub irisStop +{ + my $self = shift; + Debug( "Iris Stop" ); + $self->stop(); + $self->_setIrisSpeed( 0 ); +} + +sub irisAuto +{ + my $self = shift; + Debug( "Iris Auto" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x2d, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub irisMan +{ + my $self = shift; + Debug( "Iris Man" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x2d, 0x00, 0x02 ); + $self->sendCmd( \@msg ); +} + +sub writeScreen +{ + my $self = shift; + my $params = shift; + my $string = $self->getParam( $params, 'string' ); + Debug( "Writing '$string' to screen" ); + + my @chars = unpack( "C*", $string ); + for ( my $i = 0; $i < length($string); $i++ ) + { + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x15, $i, $chars[$i] ); + $self->sendCmd( \@msg ); + usleep( COMMAND_GAP ); + } +} + +sub clearScreen +{ + my $self = shift; + Debug( "Clear Screen" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x17, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub clearPreset +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset', 1 ); + Debug( "Clear Preset $preset" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x05, 0x00, $preset ); + $self->sendCmd( \@msg ); +} + +sub presetSet +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset', 1 ); + Debug( "Set Preset $preset" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x03, 0x00, $preset ); + $self->sendCmd( \@msg ); +} + +sub presetGoto +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset', 1 ); + Debug( "Goto Preset $preset" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x07, 0x00, $preset ); + $self->sendCmd( \@msg ); +} + +sub presetHome +{ + my $self = shift; + Debug( "Home Preset" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x07, 0x00, 0x22 ); + $self->sendCmd( \@msg ); +} + +sub reset +{ + my $self = shift; + Debug( "Reset" ); + $self->remoteReset(); + $self->resetDefaults(); +} + +sub wake +{ + my $self = shift; + Debug( "Wake" ); + $self->cameraOn(); +} + +sub sleep +{ + my $self = shift; + Debug( "Sleep" ); + $self->cameraOff(); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Control/Visca.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Control/Visca.pm new file mode 100644 index 000000000..37f30dc09 --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Control/Visca.pm @@ -0,0 +1,668 @@ +# ========================================================================== +# +# ZoneMinder Visca Control Protocol Module, $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. +# +# ========================================================================== +# +# This module contains the implementation of the Visca camera control +# protocol +# +package ZoneMinder::Control::Visca; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Visca Control Protocol +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +use Time::HiRes qw( usleep ); + +use constant SYNC => 0xff; +use constant COMMAND_GAP => 100000; # In ms + +sub new +{ + my $class = shift; + my $id = shift; + my $self = ZoneMinder::Control->new( $id ); + bless( $self, $class ); + srand( time() ); + return $self; +} + +our $AUTOLOAD; + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + Fatal( "Can't access $name member of object of class $class" ); +} + +sub open +{ + my $self = shift; + + $self->loadMonitor(); + + use Device::SerialPort; + $self->{port} = new Device::SerialPort( $self->{Monitor}->{ControlDevice} ); + $self->{port}->baudrate(9600); + $self->{port}->databits(8); + $self->{port}->parity('none'); + $self->{port}->stopbits(1); + $self->{port}->handshake('rts'); + $self->{port}->stty_echo(0); + + #$self->{port}->read_const_time(250); + $self->{port}->read_char_time(2); + + $self->{state} = 'open'; +} + +sub close +{ + my $self = shift; + $self->{state} = 'closed'; + $self->{port}->close(); +} + +sub printMsg +{ + if ( logDebugging() ) + { + my $self = shift; + my $msg = shift; + my $prefix = shift || ""; + $prefix = $prefix.": " if ( $prefix ); + + my $line_length = 16; + my $msg_len = int(@$msg); + + my $msg_str = $prefix; + for ( my $i = 0; $i < $msg_len; $i++ ) + { + if ( ($i > 0) && ($i%$line_length == 0) && ($i != ($msg_len-1)) ) + { + $msg_str .= sprintf( "\n%*s", length($prefix), "" ); + } + $msg_str .= sprintf( "%02x ", $msg->[$i] ); + } + $msg_str .= "[".$msg_len."]"; + Debug( $msg_str ); + } +} + +sub sendCmd +{ + my $self = shift; + my $cmd = shift; + my $ack = shift || 0; + my $cmp = shift || 0; + + my $result = undef; + + $self->printMsg( $cmd, "Tx" ); + my $id = $cmd->[0] & 0xf; + + my $tx_msg = pack( "C*", @$cmd ); + + #print( "Tx: ".length( $tx_msg )." bytes\n" ); + my $n_bytes = $self->{port}->write( $tx_msg ); + if ( !$n_bytes ) + { + Error( "Write failed: $!" ); + } + if ( $n_bytes != length($tx_msg) ) + { + Error( "Incomplete write, only ".$n_bytes." of ".length($tx_msg)." written: $!" ); + } + + if ( $ack ) + { + Debug( "Waiting for ack" ); + my $max_wait = 3; + my $now = time(); + while( 1 ) + { + my ( $count, $rx_msg ) = $self->{port}->read(4); + + if ( $count ) + { + #print( "Rx1: ".$count." bytes\n" ); + my @resp = unpack( "C*", $rx_msg ); + $self->printMsg( \@resp, "Rx" ); + + if ( $resp[0] = 0x80 + ($id<<4) ) + { + if ( ($resp[1] & 0xf0) == 0x40 ) + { + my $socket = $resp[1] & 0x0f; + Debug( "Got ack for socket $socket" ); + $result = !undef; + } + else + { + Error( "Got bogus response" ); + } + last; + } + else + { + Error( "Got message for camera ".(($resp[0]-0x80)>>4) ); + } + } + if ( (time() - $now) > $max_wait ) + { + last; + } + } + } + + if ( $cmp ) + { + Debug( "Waiting for command complete" ); + my $max_wait = 10; + my $now = time(); + while( 1 ) + { + #print( "Waiting\n" ); + my ( $count, $rx_msg ) = $self->{port}->read(16); + + if ( $count ) + { + #print( "Rx1: ".$count." bytes\n" ); + my @resp = unpack( "C*", $rx_msg ); + $self->printMsg( \@resp, "Rx" ); + + if ( $resp[0] = 0x80 + ($id<<4) ) + { + if ( ($resp[1] & 0xf0) == 0x50 ) + { + Debug( "Got command complete" ); + $result = !undef; + } + else + { + Error( "Got bogus response" ); + } + last; + } + else + { + Error( "Got message for camera ".(($resp[0]-0x80)>>4) ); + } + } + if ( (time() - $now) > $max_wait ) + { + last; + } + } + } + return( $result ); +} + +sub cameraOff +{ + my $self = shift; + Debug( "Camera Off\n" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x00, 0x0, SYNC ); + $self->sendCmd( \@msg ); +} + +sub cameraOn +{ + my $self = shift; + Debug( "Camera On\n" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x00, 0x2, SYNC ); + $self->sendCmd( \@msg ); +} + +sub stop +{ + my $self = shift; + Debug( "Stop\n" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x01, 0x00, 0x00, 0x03, 0x03, SYNC ); + $self->sendCmd( \@msg ); +} + +sub moveConUp +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'tiltspeed', 0x40 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Up" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x01, 0x00, $speed, 0x03, 0x01, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub moveConDown +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'tiltspeed', 0x40 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Down" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x01, 0x00, $speed, 0x03, 0x02, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub movConLeft +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'panspeed', 0x40 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Left" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x01, $speed, 0x00, 0x01, 0x03, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub moveConRight +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'panspeed', 0x40 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Right" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x01, $speed, 0x00, 0x02, 0x03, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub moveUpLeft +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x40 ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x40 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Up/Left" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x01, $panspeed, $tiltspeed, 0x01, 0x01, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub moveUpRight +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x40 ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x40 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Up/Right" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x01, $panspeed, $tiltspeed, 0x02, 0x01, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub moveDownLeft +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x40 ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x40 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Down/Left" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x01, $panspeed, $tiltspeed, 0x01, 0x02, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub moveDownRight +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x40 ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x40 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Down/Right" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x01, $panspeed, $tiltspeed, 0x02, 0x02, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub moveRelUp +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'tiltstep' ); + my $speed = $self->getParam( $params, 'tiltspeed', 0x40 ); + Debug( "Step Up" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x03, 0x00, $speed, 0x00, 0x00, 0x00, 0x00, ($step&0xf000)>>12, ($step&0x0f00)>>8, ($step&0x00f0)>>4, ($step&0x000f)>>0, SYNC ); + + $self->sendCmd( \@msg ); +} + +sub moveRelDown +{ + my $self = shift; + my $params = shift; + my $step = -$self->getParam( $params, 'tiltstep' ); + my $speed = $self->getParam( $params, 'tiltspeed', 0x40 ); + Debug( "Step Down" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x03, 0x00, $speed, 0x00, 0x00, 0x00, 0x00, ($step&0xf000)>>12, ($step&0x0f00)>>8, ($step&0x00f0)>>4, ($step&0x000f)>>0, SYNC ); + $self->sendCmd( \@msg ); +} + +sub moveRelLeft +{ + my $self = shift; + my $params = shift; + my $step = -$self->getParam( $params, 'panstep' ); + my $speed = $self->getParam( $params, 'panspeed', 0x40 ); + Debug( "Step Left" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x03, $speed, 0x00, ($step&0xf000)>>12, ($step&0x0f00)>>8, ($step&0x00f0)>>4, ($step&0x000f)>>0, 0x00, 0x00, 0x00, 0x00, SYNC ); + $self->sendCmd( \@msg ); +} + +sub moveRelRight +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'panstep' ); + my $speed = $self->getParam( $params, 'panspeed', 0x40 ); + Debug( "Step Right" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x03, $speed, 0x00, ($step&0xf000)>>12, ($step&0x0f00)>>8, ($step&0x00f0)>>4, ($step&0x000f)>>0, 0x00, 0x00, 0x00, 0x00, SYNC ); + $self->sendCmd( \@msg ); +} + +sub moveRelUpLeft +{ + my $self = shift; + my $params = shift; + my $panstep = -$self->getParam( $params, 'panstep' ); + my $tiltstep = $self->getParam( $params, 'tiltstep' ); + my $panspeed = $self->getParam( $params, 'panspeed', 0x40 ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x40 ); + Debug( "Step Up/Left" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x03, $panspeed, $tiltspeed, ($panstep&0xf000)>>12, ($panstep&0x0f00)>>8, ($panstep&0x00f0)>>4, ($panstep&0x000f)>>0, ($tiltstep&0xf000)>>12, ($tiltstep&0x0f00)>>8, ($tiltstep&0x00f0)>>4, ($tiltstep&0x000f)>>0, SYNC ); + $self->sendCmd( \@msg ); +} + +sub moveRelUpRight +{ + my $self = shift; + my $params = shift; + my $panstep = $self->getParam( $params, 'panstep' ); + my $tiltstep = $self->getParam( $params, 'tiltstep' ); + my $panspeed = $self->getParam( $params, 'panspeed', 0x40 ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x40 ); + Debug( "Step Up/Right" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x03, $panspeed, $tiltspeed, ($panstep&0xf000)>>12, ($panstep&0x0f00)>>8, ($panstep&0x00f0)>>4, ($panstep&0x000f)>>0, ($tiltstep&0xf000)>>12, ($tiltstep&0x0f00)>>8, ($tiltstep&0x00f0)>>4, ($tiltstep&0x000f)>>0, SYNC ); + $self->sendCmd( \@msg ); +} + +sub moveRelDownLeft +{ + my $self = shift; + my $params = shift; + my $panstep = -$self->getParam( $params, 'panstep' ); + my $tiltstep = -$self->getParam( $params, 'tiltstep' ); + my $panspeed = $self->getParam( $params, 'panspeed', 0x40 ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x40 ); + Debug( "Step Down/Left" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x03, $panspeed, $tiltspeed, ($panstep&0xf000)>>12, ($panstep&0x0f00)>>8, ($panstep&0x00f0)>>4, ($panstep&0x000f)>>0, ($tiltstep&0xf000)>>12, ($tiltstep&0x0f00)>>8, ($tiltstep&0x00f0)>>4, ($tiltstep&0x000f)>>0, SYNC ); + $self->sendCmd( \@msg ); +} + +sub moveRelDownRight +{ + my $self = shift; + my $params = shift; + my $panstep = $self->getParam( $params, 'panstep' ); + my $tiltstep = -$self->getParam( $params, 'tiltstep' ); + my $panspeed = $self->getParam( $params, 'panspeed', 0x40 ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x40 ); + Debug( "Step Down/Right" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x03, $panspeed, $tiltspeed, ($panstep&0xf000)>>12, ($panstep&0x0f00)>>8, ($panstep&0x00f0)>>4, ($panstep&0x000f)>>0, ($tiltstep&0xf000)>>12, ($tiltstep&0x0f00)>>8, ($tiltstep&0x00f0)>>4, ($tiltstep&0x000f)>>0, SYNC ); + $self->sendCmd( \@msg ); +} + +sub zoomConTele +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'speed', 0x06 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Zoom Tele" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x07, 0x20|$speed, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->zoomStop(); + } +} + +sub zoomWide +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'speed', 0x06 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Zoom Wide" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x07, 0x30|$speed, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->zoomStop(); + } +} + +sub zoomStop +{ + my $self = shift; + my $params = shift; + Debug( "Zoom Stop" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x07, 0x00, SYNC ); + $self->sendCmd( \@msg ); +} + +sub focusConNear +{ + my $self = shift; + my $params = shift; + Debug( "Focus Near" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x08, 0x03, SYNC ); + $self->sendCmd( \@msg ); +} + +sub focusConFar +{ + my $self = shift; + my $params = shift; + Debug( "Focus Far" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x08, 0x02, SYNC ); + $self->sendCmd( \@msg ); +} + +sub focusStop +{ + my $self = shift; + my $params = shift; + Debug( "Focus Stop" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x08, 0x00, SYNC ); + $self->sendCmd( \@msg ); +} + +sub focusAuto +{ + my $self = shift; + my $params = shift; + Debug( "Focus Auto" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x38, 0x02, SYNC ); + $self->sendCmd( \@msg ); +} + +sub focusMan +{ + my $self = shift; + my $params = shift; + Debug( "Focus Man" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x38, 0x03, SYNC ); + $self->sendCmd( \@msg ); +} + +sub presetClear +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset', 1 ); + Debug( "Clear Preset $preset" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x3f, 0x00, $preset, SYNC ); + $self->sendCmd( \@msg ); +} + +sub presetSet +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset', 1 ); + Debug( "Set Preset $preset" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x3f, 0x01, $preset, SYNC ); + $self->sendCmd( \@msg ); +} + +sub presetGoto +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset', 1 ); + Debug( "Goto Preset $preset" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x3f, 0x02, $preset, SYNC ); + $self->sendCmd( \@msg ); +} + +sub presetHome +{ + my $self = shift; + my $params = shift; + Debug( "Home Preset" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x04, SYNC ); + $self->sendCmd( \@msg ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Control/mjpgStreamer.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Control/mjpgStreamer.pm new file mode 100644 index 000000000..33a15cba1 --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Control/mjpgStreamer.pm @@ -0,0 +1,252 @@ +# ========================================================================== +# +# ZoneMinder mjpg STreamer Control Protocol Module, $Date: 2007-11-04 17:30:29 +0000 (Sun, 04 Nov 2007) $, $Revision: 2229 $ +# Copyright (C) 2003, 2004, 2005, 2006 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. +# +# ========================================================================== +# +# This module contains the implementation of the mjpg streamer camera control +# protocol +# +package ZoneMinder::Control::mjpgStreamer; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# mjpgSTreamer Control Protocol +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Config qw(:all); + +use Time::HiRes qw( usleep ); + +sub new +{ + my $class = shift; + my $id = shift; + my $self = ZoneMinder::Control->new( $id ); + Debug( "Camera New" ); + bless( $self, $class ); + srand( time() ); + return $self; +} + +our $AUTOLOAD; + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + Debug( "Camera AUTOLOAD" ); + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + Fatal( "Can't access $name member of object of class $class" ); +} + +sub open +{ + my $self = shift; + + $self->loadMonitor(); + Debug( "Camera open" ); + use LWP::UserAgent; + $self->{ua} = LWP::UserAgent->new; + $self->{ua}->agent( "ZoneMinder Control Agent/".ZM_VERSION ); + + $self->{state} = 'open'; +} + +sub close +{ + my $self = shift; + $self->{state} = 'closed'; +} + +sub printMsg +{ + my $self = shift; + my $msg = shift; + my $msg_len = length($msg); + + Debug( $msg."[".$msg_len."]" ); +} + +sub sendCmd +{ + my $self = shift; + my $cmd = shift; + + my $result = undef; + + printMsg( $cmd, "Tx" ); + + my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/$cmd" ); + my $res = $self->{ua}->request($req); + + if ( $res->is_success ) + { + $result = !undef; + } + else + { + Error( "Error check failed: '".$res->status_line()."'" ); + } + + return( $result ); +} + +sub Up +{ + my $self = shift; + $self->moveConUp(); +} + +sub Down +{ + my $self = shift; + $self->moveConDown(); +} + +sub Left +{ + my $self = shift; + $self->moveConLeft(); +} + +sub Right +{ + my $self = shift; + $self->moveConRight(); +} + + +sub reset +{ + my $self = shift; + $self->cameraReset(); +} + + + +sub cameraReset +{ + my $self = shift; + Debug( "Camera Reset" ); + my $cmd = "?action=command&command=reset_pan_tilt"; + $self->sendCmd( $cmd ); +} + +sub moveConUp +{ + my $self = shift; + Debug( "Move Up" ); + my $cmd = "?action=command&command=tilt_minus"; + $self->sendCmd( $cmd ); +} + +sub moveConDown +{ + my $self = shift; + Debug( "Move Down" ); + my $cmd = "?action=command&command=tilt_plus"; + $self->sendCmd( $cmd ); +} + +sub moveConLeft +{ + my $self = shift; + Debug( "Move Left" ); + my $cmd = "?action=command&command=pan_plus"; + $self->sendCmd( $cmd ); +} + +sub moveConRight +{ + my $self = shift; + Debug( "Move Right" ); + my $cmd = "?action=command&command=pan_minus"; + $self->sendCmd( $cmd ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2005 by Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Database.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Database.pm new file mode 100644 index 000000000..d0bae5dde --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Database.pm @@ -0,0 +1,238 @@ +# ========================================================================== +# +# ZoneMinder Database Module, $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. +# +# ========================================================================== +# +# This module contains the common definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::Database; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'functions' => [ qw( + zmDbConnect + zmDbDisconnect + zmDbGetMonitors + zmDbGetMonitor + zmDbGetMonitorAndControl + ) ] +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Database Access +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Config qw(:all); + +use Carp; + +our $dbh = undef; + +sub zmDbConnect( ;$ ) +{ + my $force = shift; + if ( $force ) + { + zmDbDisconnect(); + } + if ( !defined( $dbh ) ) + { + my ( $host, $port ) = ( ZM_DB_HOST =~ /^([^:]+)(?::(.+))?$/ ); + + if ( defined($port) ) + { + $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".$host.";port=".$port, ZM_DB_USER, ZM_DB_PASS ); + } + else + { + $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS ); + } + $dbh->trace( 0 ); + } + return( $dbh ); +} + +sub zmDbDisconnect() +{ + if ( defined( $dbh ) ) + { + $dbh->disconnect(); + $dbh = undef; + } +} + +use constant DB_MON_ALL => 0; # All monitors +use constant DB_MON_CAPT => 1; # All monitors that are capturing +use constant DB_MON_ACTIVE => 2; # All monitors that are active +use constant DB_MON_MOTION => 3; # All monitors that are doing motion detection +use constant DB_MON_RECORD => 4; # All monitors that are doing unconditional recording +use constant DB_MON_PASSIVE => 5; # All monitors that are in nodect state + +sub zmDbGetMonitors( ;$ ) +{ + zmDbConnect(); + + my $function = shift || DB_MON_ALL; + my $sql = "select * from Monitors"; + + if ( $function ) + { + if ( $function == DB_MON_CAPT ) + { + $sql .= " where Function >= 'Monitor'"; + } + elsif ( $function == DB_MON_ACTIVE ) + { + $sql .= " where Function > 'Monitor'"; + } + elsif ( $function == DB_MON_MOTION ) + { + $sql .= " where Function = 'Modect' or Function = 'Mocord'"; + } + elsif ( $function == DB_MON_RECORD ) + { + $sql .= " where Function = 'Record' or Function = 'Mocord'"; + } + elsif ( $function == DB_MON_PASSIVE ) + { + $sql .= " where Function = 'Nodect'"; + } + } + my $sth = $dbh->prepare_cached( $sql ) or croak( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or croak( "Can't execute '$sql': ".$sth->errstr() ); + + my @monitors; + while( my $monitor = $sth->fetchrow_hashref() ) + { + push( @monitors, $monitor ); + } + $sth->finish(); + return( \@monitors ); +} + +sub zmDbGetMonitor( $ ) +{ + zmDbConnect(); + + my $id = shift; + + return( undef ) if ( !defined($id) ); + + my $sql = "select * from Monitors where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or croak( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $id ) or croak( "Can't execute '$sql': ".$sth->errstr() ); + my $monitor = $sth->fetchrow_hashref(); + + return( $monitor ); +} + +sub zmDbGetMonitorAndControl( $ ) +{ + zmDbConnect(); + + my $id = shift; + + return( undef ) if ( !defined($id) ); + + my $sql = "select C.*,M.*,C.Protocol from Monitors as M inner join Controls as C on (M.ControlId = C.Id) where M.Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $id ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + my $monitor = $sth->fetchrow_hashref(); + + return( $monitor ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/General.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/General.pm new file mode 100644 index 000000000..5af7150a8 --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/General.pm @@ -0,0 +1,768 @@ +# ========================================================================== +# +# ZoneMinder General Utility Module, $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. +# +# ========================================================================== +# +# This module contains the common definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::General; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'functions' => [ qw( + executeShellCommand + getCmdFormat + runCommand + setFileOwner + getEventPath + createEventPath + createEvent + deleteEventFiles + makePath + jsonEncode + jsonDecode + ) ] +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# General Utility Functions +# +# ========================================================================== + +use ZoneMinder::Config qw(:all); +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Database qw(:all); + +use POSIX; + +# For running general shell commands +sub executeShellCommand( $ ) +{ + my $command = shift; + my $output = qx( $command ); + my $status = $? >> 8; + if ( $status || logDebugging() ) + { + Debug( "Command: $command\n" ); + chomp( $output ); + Debug( "Output: $output\n" ); + } + return( $status ); +} + +sub getCmdFormat() +{ + Debug( "Testing valid shell syntax\n" ); + + my ( $name ) = getpwuid( $> ); + if ( $name eq ZM_WEB_USER ) + { + Debug( "Running as '$name', su commands not needed\n" ); + return( "" ); + } + + my $null_command = "true"; + + my $prefix = "sudo -u ".ZM_WEB_USER." "; + my $suffix = ""; + my $command = $prefix.$null_command.$suffix; + Debug( "Testing \"$command\"\n" ); + $command .= " > /dev/null 2>&1"; + my $output = qx($command); + my $status = $? >> 8; + if ( !$status ) + { + Debug( "Test ok, using format \"$prefix$suffix\"\n" ); + return( $prefix, $suffix ); + } + else + { + chomp( $output ); + Debug( "Test failed, '$output'\n" ); + + $prefix = "su ".ZM_WEB_USER." --shell=/bin/sh --command='"; + $suffix = "'"; + $command = $prefix.$null_command.$suffix; + Debug( "Testing \"$command\"\n" ); + my $output = qx($command); + my $status = $? >> 8; + if ( !$status ) + { + Debug( "Test ok, using format \"$prefix$suffix\"\n" ); + return( $prefix, $suffix ); + } + else + { + chomp( $output ); + Debug( "Test failed, '$output'\n" ); + + $prefix = "su ".ZM_WEB_USER." -c '"; + $suffix = "'"; + $command = $prefix.$null_command.$suffix; + Debug( "Testing \"$command\"\n" ); + $output = qx($command); + $status = $? >> 8; + if ( !$status ) + { + Debug( "Test ok, using format \"$prefix$suffix\"\n" ); + return( $prefix, $suffix ); + } + else + { + chomp( $output ); + Debug( "Test failed, '$output'\n" ); + } + } + } + Error( "Unable to find valid 'su' syntax\n" ); + exit( -1 ); +} + +our $testedShellSyntax = 0; +our ( $cmdPrefix, $cmdSuffix ); + +# For running ZM daemons etc +sub runCommand( $ ) +{ + if ( !$testedShellSyntax ) + { + # Determine the appropriate syntax for the su command + ( $cmdPrefix, $cmdSuffix ) = getCmdFormat(); + $testedShellSyntax = !undef; + } + + my $command = shift; + $command = ZM_PATH_BIN."/".$command; + if ( $cmdPrefix ) + { + $command = $cmdPrefix.$command.$cmdSuffix; + } + Debug( "Command: $command\n" ); + my $output = qx($command); + my $status = $? >> 8; + chomp( $output ); + if ( $status || logDebugging() ) + { + if ( $status ) + { + Error( "Unable to run \"$command\", output is \"$output\"\n" ); + exit( -1 ); + } + else + { + Debug( "Output: $output\n" ); + } + } + return( $output ); +} + +sub getEventPath( $ ) +{ + my $event = shift; + + my $event_path = ""; + if ( ZM_USE_DEEP_STORAGE ) + { + $event_path = ZM_DIR_EVENTS.'/'.$event->{MonitorId}.'/'.strftime( "%y/%m/%d/%H/%M/%S", localtime($event->{Time}) ); + } + else + { + $event_path = ZM_DIR_EVENTS.'/'.$event->{MonitorId}.'/'.$event->{Id}; + } + $event_path = ZM_PATH_WEB.'/'.$event_path if ( index(ZM_DIR_EVENTS,'/') != 0 ); + return( $event_path ); +} + +sub createEventPath( $ ) +{ + # + # WARNING assumes running from events directory + # + my $event = shift; + my $eventRootPath = (ZM_DIR_EVENTS=~m|/|)?ZM_DIR_EVENTS:(ZM_PATH_WEB.'/'.ZM_DIR_EVENTS); + my $eventPath = $eventRootPath.'/'.$event->{MonitorId}; + + if ( ZM_USE_DEEP_STORAGE ) + { + my @startTime = localtime( $event->{StartTime} ); + + my @datetimeParts = (); + $datetimeParts[0] = sprintf( "%02d", $startTime[5]-100 ); + $datetimeParts[1] = sprintf( "%02d", $startTime[4]+1 ); + $datetimeParts[2] = sprintf( "%02d", $startTime[3] ); + $datetimeParts[3] = sprintf( "%02d", $startTime[2] ); + $datetimeParts[4] = sprintf( "%02d", $startTime[1] ); + $datetimeParts[5] = sprintf( "%02d", $startTime[0] ); + + my $datePath = join('/',@datetimeParts[0..2]); + my $timePath = join('/',@datetimeParts[3..5]); + + makePath( $datePath, $eventPath ); + $eventPath .= '/'.$datePath; + + # Create event id symlink + my $idFile = sprintf( "%s/.%d", $eventPath, $event->{Id} ); + symlink( $timePath, $idFile ) or Fatal( "Can't symlink $idFile -> $eventPath: $!" ); + + makePath( $timePath, $eventPath ); + $eventPath .= '/'.$timePath; + setFileOwner( $idFile ); # Must come after directory has been created + + # Create empty id tag file + $idFile = sprintf( "%s/.%d", $eventPath, $event->{Id} ); + open( ID_FP, ">$idFile" ) or Fatal( "Can't open $idFile: $!" ); + close( ID_FP ); + setFileOwner( $idFile ); + } + else + { + makePath( $event->{Id}, $eventPath ); + $eventPath .= '/'.$event->{Id}; + + my $idFile = sprintf( "%s/.%d", $eventPath, $event->{Id} ); + open( ID_FP, ">$idFile" ) or Fatal( "Can't open $idFile: $!" ); + close( ID_FP ); + setFileOwner( $idFile ); + } + return( $eventPath ); +} + +use Data::Dumper; + +our $_setFileOwner = undef; +our ( $_ownerUid, $_ownerGid ); + +sub _checkProcessOwner() +{ + if ( !defined($_setFileOwner) ) + { + my ( $processOwner ) = getpwuid( $> ); + if ( $processOwner ne ZM_WEB_USER ) + { + # Not running as web user, so should be root in whch case chown the temporary directory + ( my $ownerName, my $ownerPass, $_ownerUid, $_ownerGid ) = getpwnam( ZM_WEB_USER ) or Fatal( "Can't get user details for web user '".ZM_WEB_USER."': $!" ); + $_setFileOwner = 1; + } + else + { + $_setFileOwner = 0; + } + } + return( $_setFileOwner ); +} + +sub setFileOwner( $ ) +{ + my $file = shift; + + if ( _checkProcessOwner() ) + { + chown( $_ownerUid, $_ownerGid, $file ) or Fatal( "Can't change ownership of file '$file' to '".ZM_WEB_USER.":".ZM_WEB_GROUP."': $!" ); + } +} + +our $_hasImageInfo = undef; + +sub _checkForImageInfo() +{ + if ( !defined($_hasImageInfo) ) + { + my $result = eval + { + require Image::Info; + Image::Info->import(); + }; + $_hasImageInfo = $@?0:1; + } + return( $_hasImageInfo ); +} + +sub createEvent( $;$ ) +{ + my $event = shift; + + Debug( "Creating event" ); + #print( Dumper( $event )."\n" ); + + _checkForImageInfo(); + + my $dbh = zmDbConnect(); + + if ( $event->{monitor} ) + { + $event->{MonitorId} = $event->{monitor}->{Id}; + } + elsif ( $event->{MonitorId} ) + { + my $sql = "select * from Monitors where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare sql '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{MonitorId} ) or Fatal( "Can't execute sql '$sql': ".$sth->errstr() ); + $event->{monitor} = $sth->fetchrow_hashref() or Fatal( "Unable to create event, can't load monitor with id '".$event->{MonitorId}."'" ); + $sth->finish(); + } + else + { + Fatal( "Unable to create event, no monitor or monitor id supplied" ); + } + $event->{Name} = "New Event" unless( $event->{Name} ); + $event->{Frames} = int(@{$event->{frames}}); + $event->{TotScore} = $event->{MaxScore} = 0; + + my $lastTimestamp = 0.0; + foreach my $frame ( @{$event->{frames}} ) + { + if ( !$event->{Width} ) + { + if ( $_hasImageInfo ) + { + my $imageInfo = Image::Info::image_info( $frame->{imagePath} ); + if ( $imageInfo->{error} ) + { + Error( "Unable to extract image info from '".$frame->{imagePath}."': ".$imageInfo->{error} ); + } + else + { + ( $event->{Width}, $event->{Height} ) = Image::Info::dim( $imageInfo ); + } + } + } + $frame->{Type} = $frame->{Score}>0?'Alarm':'Normal' unless( $frame->{Type} ); + $frame->{Delta} = $lastTimestamp?($frame->{TimeStamp}-$lastTimestamp):0.0; + $event->{StartTime} = $frame->{TimeStamp} unless ( $event->{StartTime} ); + $event->{TotScore} += $frame->{Score}; + $event->{MaxScore} = $frame->{Score} if ( $frame->{Score} > $event->{MaxScore} ); + $event->{AlarmFrames}++ if ( $frame->{Type} eq 'Alarm' ); + $event->{EndTime} = $frame->{TimeStamp}; + $lastTimestamp = $frame->{TimeStamp}; + } + $event->{Width} = $event->{monitor}->{Width} unless( $event->{Width} ); + $event->{Height} = $event->{monitor}->{Height} unless( $event->{Height} ); + $event->{AvgScore} = $event->{TotScore}/int($event->{AlarmFrames}); + $event->{Length} = $event->{EndTime} - $event->{StartTime}; + + my %formats = ( + StartTime => 'from_unixtime(?)', + EndTime => 'from_unixtime(?)', + ); + + my ( @fields, @formats, @values ); + while ( my ( $field, $value ) = each( %$event ) ) + { + next unless $field =~ /^[A-Z]/; + push( @fields, $field ); + push( @formats, ($formats{$field} or '?') ); + push( @values, $event->{$field} ); + } + + my $sql = "insert into Events (".join(',',@fields).") values (".join(',',@formats).")"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare sql '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( @values ) or Fatal( "Can't execute sql '$sql': ".$sth->errstr() ); + $event->{Id} = $dbh->{mysql_insertid}; + Info( "Created event ".$event->{Id} ); + + if ( $event->{EndTime} ) + { + $event->{Name} = $event->{monitor}->{EventPrefix}.$event->{Id} if ( $event->{Name} eq 'New Event' ); + my $sql = "update Events set Name = ? where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare sql '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Name}, $event->{Id} ) or Fatal( "Can't execute sql '$sql': ".$sth->errstr() ); + } + + my $eventPath = createEventPath( $event ); + + my %frameFormats = ( + TimeStamp => 'from_unixtime(?)', + ); + my $frameId = 1; + foreach my $frame ( @{$event->{frames}} ) + { + $frame->{EventId} = $event->{Id}; + $frame->{FrameId} = $frameId++; + + my ( @fields, @formats, @values ); + while ( my ( $field, $value ) = each( %$frame ) ) + { + next unless $field =~ /^[A-Z]/; + push( @fields, $field ); + push( @formats, ($frameFormats{$field} or '?') ); + push( @values, $frame->{$field} ); + } + + my $sql = "insert into Frames (".join(',',@fields).") values (".join(',',@formats).")"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare sql '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( @values ) or Fatal( "Can't execute sql '$sql': ".$sth->errstr() ); + #$frame->{FrameId} = $dbh->{mysql_insertid}; + if ( $frame->{imagePath} ) + { + $frame->{capturePath} = sprintf( "%s/%0".ZM_EVENT_IMAGE_DIGITS."d-capture.jpg", $eventPath, $frame->{FrameId} ); + rename( $frame->{imagePath}, $frame->{capturePath} ) or Fatal( "Can't copy ".$frame->{imagePath}." to ".$frame->{capturePath}.": $!" ); + setFileOwner( $frame->{capturePath} ); + if ( 0 && ZM_CREATE_ANALYSIS_IMAGES ) + { + $frame->{analysePath} = sprintf( "%s/%0".ZM_EVENT_IMAGE_DIGITS."d-analyse.jpg", $eventPath, $frame->{FrameId} ); + link( $frame->{capturePath}, $frame->{analysePath} ) or Fatal( "Can't link ".$frame->{capturePath}." to ".$frame->{analysePath}.": $!" ); + setFileOwner( $frame->{analysePath} ); + } + } + } +} + +sub addEventImage( $$ ) +{ + my $event = shift; + my $frame = shift; + + # TBD +} + +sub updateEvent( $ ) +{ + my $event = shift; + + if ( !$event->{EventId} ) + { + Error( "Unable to update event, no event id supplied" ); + return( 0 ); + } + + my $dbh = zmDbConnect(); + + $event->{Name} = $event->{monitor}->{EventPrefix}.$event->{Id} if ( $event->{Name} eq 'New Event' ); + + my %formats = ( + StartTime => 'from_unixtime(?)', + EndTime => 'from_unixtime(?)', + ); + + my ( @values, @sets ); + while ( my ( $field, $value ) = each( %$event ) ) + { + next if ( $field eq 'Id' ); + push( @values, $event->{$field} ); + push( @sets, $field." = ".($formats{$field} or '?') ); + } + my $sql = "update Events set ".join(',',@sets)." where Id = ?"; + push( @values, $event->{Id} ); + + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare sql '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( @values ) or Fatal( "Can't execute sql '$sql': ".$sth->errstr() ); +} + +sub deleteEventFiles( $;$ ) +{ + # + # WARNING assumes running from events directory + # + my $event_id = shift; + my $monitor_id = shift; + $monitor_id = '*' if ( !defined($monitor_id) ); + + if ( ZM_USE_DEEP_STORAGE ) + { + my $link_path = $monitor_id."/*/*/*/.".$event_id; + #Debug( "LP1:$link_path" ); + my @links = glob($link_path); + #Debug( "L:".$links[0].": $!" ); + if ( @links ) + { + ( $link_path ) = ( $links[0] =~ /^(.*)$/ ); # De-taint + #Debug( "LP2:$link_path" ); + + ( my $day_path = $link_path ) =~ s/\.\d+//; + #Debug( "DP:$day_path" ); + my $event_path = $day_path.readlink( $link_path ); + ( $event_path ) = ( $event_path =~ /^(.*)$/ ); # De-taint + #Debug( "EP:$event_path" ); + my $command = "/bin/rm -rf ".$event_path; + #Debug( "C:$command" ); + executeShellCommand( $command ); + + unlink( $link_path ) or Error( "Unable to unlink '$link_path': $!" ); + my @path_parts = split( /\//, $event_path ); + for ( my $i = int(@path_parts)-2; $i >= 1; $i-- ) + { + my $delete_path = join( '/', @path_parts[0..$i] ); + #Debug( "DP$i:$delete_path" ); + my @has_files = glob( $delete_path."/*" ); + #Debug( "HF1:".$has_files[0] ) if ( @has_files ); + last if ( @has_files ); + @has_files = glob( $delete_path."/.[0-9]*" ); + #Debug( "HF2:".$has_files[0] ) if ( @has_files ); + last if ( @has_files ); + my $command = "/bin/rm -rf ".$delete_path; + executeShellCommand( $command ); + } + } + } + else + { + my $command = "/bin/rm -rf $monitor_id/$event_id"; + executeShellCommand( $command ); + } +} + +sub makePath( $;$ ) +{ + my $path = shift; + my $root = shift; + $root = (( $path =~ m|^/| )?'':'.' ) unless( $root ); + + Debug( "Creating path '$path' in $root'\n" ); + my @parts = split( '/', $path ); + my $fullPath = $root; + foreach my $dir ( @parts ) + { + $fullPath .= '/'.$dir; + if ( !-d $fullPath ) + { + if ( -e $fullPath ) + { + Fatal( "Can't create '$fullPath', already exists as non directory" ); + } + else + { + Debug( "Creating '$fullPath'\n" ); + mkdir( $fullPath, 0755 ) or Fatal( "Can't mkdir '$fullPath': $!" ); + setFileOwner( $fullPath ); + } + } + } + return( $fullPath ); +} + +our $testedJSON = 0; +our $hasJSONAny = 0; + +sub _testJSON +{ + return if ( $testedJSON ); + my $result = eval + { + require JSON::Any; + JSON::Any->import(); + }; + $testedJSON = 1; + $hasJSONAny = 1 if ( $result ); +} + +sub _getJSONType( $ ) +{ + my $value = shift; + return( 'null' ) unless( defined($value) ); + return( 'integer' ) if ( $value =~ /^\d+$/ ); + return( 'double' ) if ( $value =~ /^\d+$/ ); + return( 'hash' ) if ( ref($value) eq 'HASH' ); + return( 'array' ) if ( ref($value) eq 'ARRAY' ); + return( 'string' ); +} + +sub jsonEncode( $ ); + +sub jsonEncode( $ ) +{ + my $value = shift; + + _testJSON(); + if ( $hasJSONAny ) + { + my $string = eval { JSON::Any->objToJson( $value ) }; + Fatal( "Unable to encode object to JSON: $@" ) unless( $string ); + return( $string ); + } + + my $type = _getJSONType($value); + if ( $type eq 'integer' || $type eq 'double' ) + { + return( $value ); + } + elsif ( $type eq 'boolean' ) + { + return( $value?'true':'false' ); + } + elsif ( $type eq 'string' ) + { + $value =~ s|(["\\/])|\\$1|g; + $value =~ s|\r?\n|\n|g; + return( '"'.$value.'"' ); + } + elsif ( $type eq 'null' ) + { + return( 'null' ); + } + elsif ( $type eq 'array' ) + { + return( '['.join( ',', map { jsonEncode( $_ ) } @$value ).']' ); + } + elsif ( $type eq 'hash' ) + { + my $result = '{'; + while ( my ( $subKey=>$subValue ) = each( %$value ) ) + { + $result .= ',' if ( $result ne '{' ); + $result .= '"'.$subKey.'":'.jsonEncode( $subValue ); + } + return( $result.'}' ); + } + else + { + Fatal( "Unexpected type '$type'" ); + } +} + +sub jsonDecode( $ ) +{ + my $value = shift; + + _testJSON(); + if ( $hasJSONAny ) + { + my $object = eval { JSON::Any->jsonToObj( $value ) }; + Fatal( "Unable to decode JSON string '$value': $@" ) unless( $object ); + return( $object ); + } + + my $comment = 0; + my $unescape = 0; + my $out = ''; + my @chars = split( //, $value ); + for ( my $i = 0; $i < @chars; $i++ ) + { + if ( !$comment ) + { + if ( $chars[$i] eq ':' ) + { + $out .= '=>'; + } + else + { + $out .= $chars[$i]; + } + } + elsif ( !$unescape ) + { + if ( $chars[$i] eq '\\' ) + { + $unescape = 1; + } + else + { + $out .= $chars[$i]; + } + } + else + { + if ( $chars[$i] ne '/' ) + { + $out .= '\\'; + } + $out .= $chars[$i]; + $unescape = 0; + } + if ( $chars[$i] eq '"' ) + { + $comment = !$comment; + } + } + $out =~ s/=>true/=>1/g; + $out =~ s/=>false/=>0/g; + $out =~ s/=>null/=>undef/g; + $out =~ s/`/'/g; + $out =~ s/qx/qq/g; + ( $out ) = $out =~ m/^({.+})$/; # Detaint and check it's a valid object syntax + my $result = eval $out; + Fatal( $@ ) if ( $@ ); + return( $result ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Logger.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Logger.pm new file mode 100644 index 000000000..46095be2e --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Logger.pm @@ -0,0 +1,861 @@ +# ========================================================================== +# +# ZoneMinder Logger Module, $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. +# +# ========================================================================== +# +# This module contains the debug definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::Logger; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'constants' => [ qw( + DEBUG + INFO + WARNING + ERROR + FATAL + PANIC + NOLOG + ) ], + 'functions' => [ qw( + logInit + logReinit + logTerm + logSetSignal + logClearSignal + logDebugging + logLevel + logTermLevel + logDatabaseLevel + logFileLevel + logSyslogLevel + Mark + Dump + Debug + Info + Warning + Error + Fatal + Panic + ) ] +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Logger Facilities +# +# ========================================================================== + +use ZoneMinder::Config qw(:all); + +use DBI; +use Carp; +use POSIX; +use IO::Handle; +use Data::Dumper; +use Time::HiRes qw/gettimeofday/; +use Sys::Syslog; + +use constant { + DEBUG => 1, + INFO => 0, + WARNING => -1, + ERROR => -2, + FATAL => -3, + PANIC => -4, + NOLOG => -5 +}; + +our %codes = ( + &DEBUG => "DBG", + &INFO => "INF", + &WARNING => "WAR", + &ERROR => "ERR", + &FATAL => "FAT", + &PANIC => "PNC", + &NOLOG => "OFF" +); + +our %priorities = ( + &DEBUG => "debug", + &INFO => "info", + &WARNING => "warning", + &ERROR => "err", + &FATAL => "err", + &PANIC => "err" +); + +our $logger; + +sub new +{ + my $class = shift; + my $this = {}; + + $this->{initialised} = undef; + + #$this->{id} = "zmundef"; + ( $this->{id} ) = $0 =~ m|^(?:.*/)?([^/]+?)(?:\.[^/.]+)?$|; + $this->{idRoot} = $this->{id}; + $this->{idArgs} = ""; + + $this->{level} = INFO; + $this->{termLevel} = NOLOG; + $this->{databaseLevel} = NOLOG; + $this->{fileLevel} = NOLOG; + $this->{syslogLevel} = NOLOG; + $this->{effectiveLevel} = INFO; + + $this->{autoFlush} = 1; + $this->{hasTerm} = -t STDERR; + + ( $this->{fileName} = $0 ) =~ s|^.*/||; + $this->{logPath} = ZM_PATH_LOGS; + $this->{logFile} = $this->{logPath}."/".$this->{id}.".log"; + + $this->{trace} = 0; + + bless( $this, $class ); + return $this; +} + +sub BEGIN +{ + # Fake the config variables that are used in case they are not defined yet + # Only really necessary to support upgrade from previous version + if ( !eval('defined(ZM_LOG_DEBUG)') ) + { + no strict 'subs'; + no strict 'refs'; + my %dbgConfig = ( + ZM_LOG_LEVEL_DATABASE => 0, + ZM_LOG_LEVEL_FILE => 0, + ZM_LOG_LEVEL_SYSLOG => 0, + ZM_LOG_DEBUG => 0, + ZM_LOG_DEBUG_TARGET => "", + ZM_LOG_DEBUG_LEVEL => 1, + ZM_LOG_DEBUG_FILE => "" + ); + while ( my ( $name, $value ) = each( %dbgConfig ) ) + { + *{$name} = sub { $value }; + } + use strict 'subs'; + use strict 'refs'; + } +} + +sub DESTROY +{ + my $this = shift; + $this->terminate(); +} + +sub initialise( @ ) +{ + my $this = shift; + my %options = @_; + + $this->{id} = $options{id} if ( defined($options{id}) ); + + $this->{logPath} = $options{logPath} if ( defined($options{logPath}) ); + + my $tempLogFile; + $tempLogFile = $this->{logPath}."/".$this->{id}.".log"; + $tempLogFile = $options{logFile} if ( defined($options{logFile}) ); + if ( my $logFile = $this->getTargettedEnv('LOG_FILE') ) + { + $tempLogFile = $logFile; + } + + my $tempLevel = INFO; + my $tempTermLevel = $this->{termLevel}; + my $tempDatabaseLevel = $this->{databaseLevel}; + my $tempFileLevel = $this->{fileLevel}; + my $tempSyslogLevel = $this->{syslogLevel}; + + $tempTermLevel = $options{termLevel} if ( defined($options{termLevel}) ); + if ( defined($options{databaseLevel}) ) + { + $tempDatabaseLevel = $options{databaseLevel}; + } + else + { + $tempDatabaseLevel = ZM_LOG_LEVEL_DATABASE; + } + if ( defined($options{fileLevel}) ) + { + $tempFileLevel = $options{fileLevel}; + } + else + { + $tempFileLevel = ZM_LOG_LEVEL_FILE; + } + if ( defined($options{syslogLevel}) ) + { + $tempSyslogLevel = $options{syslogLevel}; + } + else + { + $tempSyslogLevel = ZM_LOG_LEVEL_SYSLOG; + } + + if ( defined($ENV{'LOG_PRINT'}) ) + { + $tempTermLevel = $ENV{'LOG_PRINT'}? DEBUG : NOLOG; + } + + my $level; + $tempLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL')) ); + + $tempTermLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_TERM')) ); + $tempDatabaseLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_DATABASE')) ); + $tempFileLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_FILE')) ); + $tempSyslogLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_SYSLOG')) ); + + if ( ZM_LOG_DEBUG ) + { + foreach my $target ( split( /\|/, ZM_LOG_DEBUG_TARGET ) ) + { + if ( $target eq $this->{id} || $target eq "_".$this->{id} || $target eq $this->{idRoot} || $target eq "_".$this->{idRoot} || $target eq "" ) + { + if ( ZM_LOG_DEBUG_LEVEL > NOLOG ) + { + $tempLevel = $this->limit( ZM_LOG_DEBUG_LEVEL ); + if ( ZM_LOG_DEBUG_FILE ne "" ) + { + $tempLogFile = ZM_LOG_DEBUG_FILE; + $tempFileLevel = $tempLevel; + } + } + } + } + } + + $this->logFile( $tempLogFile ); + + $this->termLevel( $tempTermLevel ); + $this->databaseLevel( $tempDatabaseLevel ); + $this->fileLevel( $tempFileLevel ); + $this->syslogLevel( $tempSyslogLevel ); + + $this->level( $tempLevel ); + + $this->{trace} = $options{trace} if ( defined($options{trace}) ); + + $this->{autoFlush} = $ENV{'LOG_FLUSH'}?1:0 if ( defined($ENV{'LOG_FLUSH'}) ); + + $this->{initialised} = !undef; + + Debug( "LogOpts: level=".$codes{$this->{level}}."/".$codes{$this->{effectiveLevel}}.", screen=".$codes{$this->{termLevel}}.", database=".$codes{$this->{databaseLevel}}.", logfile=".$codes{$this->{fileLevel}}."->".$this->{logFile}.", syslog=".$codes{$this->{syslogLevel}} ); +} + +sub terminate() +{ + my $this = shift; + return unless ( $this->{initialised} ); + $this->syslogLevel( NOLOG ); + $this->fileLevel( NOLOG ); + $this->databaseLevel( NOLOG ); + $this->termLevel( NOLOG ); +} + +sub reinitialise() +{ + my $this = shift; + + return unless ( $this->{initialised} ); + + # Bit of a nasty hack to reopen connections to log files and the DB + my $syslogLevel = $this->syslogLevel(); + $this->syslogLevel( NOLOG ); + my $logfileLevel = $this->fileLevel(); + $this->fileLevel( NOLOG ); + my $databaseLevel = $this->databaseLevel(); + $this->databaseLevel( NOLOG ); + my $screenLevel = $this->termLevel(); + $this->termLevel( NOLOG ); + + $this->syslogLevel( $syslogLevel ) if ( $syslogLevel > NOLOG ); + $this->fileLevel( $logfileLevel ) if ( $logfileLevel > NOLOG ); + $this->databaseLevel( $databaseLevel ) if ( $databaseLevel > NOLOG ); + $this->databaseLevel( $databaseLevel ) if ( $databaseLevel > NOLOG ); +} + +sub limit( $ ) +{ + my $this = shift; + my $level = shift; + return( DEBUG ) if ( $level > DEBUG ); + return( NOLOG ) if ( $level < NOLOG ); + return( $level ); +} + +sub getTargettedEnv( $ ) +{ + my $this = shift; + my $name = shift; + my $envName = $name."_".$this->{id}; + my $value; + $value = $ENV{$envName} if ( defined($ENV{$envName}) ); + if ( !defined($value) && $this->{id} ne $this->{idRoot} ) + { + $envName = $name."_".$this->{idRoot}; + $value = $ENV{$envName} if ( defined($ENV{$envName}) ); + } + if ( !defined($value) ) + { + $value = $ENV{$name} if ( defined($ENV{$name}) ); + } + if ( defined($value) ) + { + ( $value ) = $value =~ m/(.*)/; + } + return( $value ); +} + +sub fetch() +{ + if ( !$logger ) + { + $logger = ZoneMinder::Logger->new(); + $logger->initialise( 'syslogLevel'=>INFO, 'databaseLevel'=>INFO ); + } + return( $logger ); +} + +sub id( ;$ ) +{ + my $this = shift; + my $id = shift; + if ( defined($id) && $this->{id} ne $id ) + { + # Remove whitespace + $id =~ s/\S//g; + # Replace non-alphanum with underscore + $id =~ s/[^a-zA-Z_]/_/g; + + if ( $this->{id} ne $id ) + { + $this->{id} = $this->{idRoot} = $id; + if ( $id =~ /^([^_]+)_(.+)$/ ) + { + $this->{idRoot} = $1; + $this->{idArgs} = $2; + } + } + } + return( $this->{id} ); +} + +sub level( ;$ ) +{ + my $this = shift; + my $level = shift; + if ( defined($level) ) + { + $this->{level} = $this->limit( $level ); + $this->{effectiveLevel} = NOLOG; + $this->{effectiveLevel} = $this->{termLevel} if ( $this->{termLevel} > $this->{effectiveLevel} ); + $this->{effectiveLevel} = $this->{databaseLevel} if ( $this->{databaseLevel} > $this->{effectiveLevel} ); + $this->{effectiveLevel} = $this->{fileLevel} if ( $this->{fileLevel} > $this->{effectiveLevel} ); + $this->{effectiveLevel} = $this->{syslogLevel} if ( $this->{syslogLevel} > $this->{level} ); + $this->{effectiveLevel} = $this->{level} if ( $this->{effectiveLevel} > $this->{level} ); + } + return( $this->{level} ); +} + +sub debugOn() +{ + my $this = shift; + return( $this->{effectiveLevel} >= DEBUG ); +} + +sub trace( ;$ ) +{ + my $this = shift; + $this->{trace} = $_[0] if ( @_ ); + return( $this->{trace} ); +} + +sub termLevel( ;$ ) +{ + my $this = shift; + my $termLevel = shift; + if ( defined($termLevel) ) + { + $termLevel = NOLOG if ( !$this->{hasTerm} ); + $termLevel = $this->limit( $termLevel ); + if ( $this->{termLevel} != $termLevel ) + { + $this->{termLevel} = $termLevel; + } + } + return( $this->{termLevel} ); +} + +sub databaseLevel( ;$ ) +{ + my $this = shift; + my $databaseLevel = shift; + if ( defined($databaseLevel) ) + { + $databaseLevel = $this->limit( $databaseLevel ); + if ( $this->{databaseLevel} != $databaseLevel ) + { + if ( $databaseLevel > NOLOG && $this->{databaseLevel} <= NOLOG ) + { + if ( !$this->{dbh} ) + { + my ( $host, $port ) = ( ZM_DB_HOST =~ /^([^:]+)(?::(.+))?$/ ); + + if ( defined($port) ) + { + $this->{dbh} = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".$host.";port=".$port, ZM_DB_USER, ZM_DB_PASS ); + } + else + { + $this->{dbh} = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS ); + } + if ( !$this->{dbh} ) + { + $databaseLevel = NOLOG; + Error( "Unable to write log entries to DB, can't connect to database '".ZM_DB_NAME."' on host '".ZM_DB_HOST."'" ); + } + else + { + $this->{dbh}->{AutoCommit} = 1; + Fatal( "Can't set AutoCommit on in database connection" ) unless( $this->{dbh}->{AutoCommit} ); + $this->{dbh}->{mysql_auto_reconnect} = 1; + Fatal( "Can't set mysql_auto_reconnect on in database connection" ) unless( $this->{dbh}->{mysql_auto_reconnect} ); + $this->{dbh}->trace( 0 ); + } + } + } + elsif ( $databaseLevel <= NOLOG && $this->{databaseLevel} > NOLOG ) + { + if ( $this->{dbh} ) + { + $this->{dbh}->disconnect(); + undef($this->{dbh}); + } + } + $this->{databaseLevel} = $databaseLevel; + } + } + return( $this->{databaseLevel} ); +} + +sub fileLevel( ;$ ) +{ + my $this = shift; + my $fileLevel = shift; + if ( defined($fileLevel) ) + { + $fileLevel = $this->limit($fileLevel); + if ( $this->{fileLevel} != $fileLevel ) + { + $this->closeFile() if ( $this->{fileLevel} > NOLOG ); + $this->{fileLevel} = $fileLevel; + $this->openFile() if ( $this->{fileLevel} > NOLOG ); + } + } + return( $this->{fileLevel} ); +} + +sub syslogLevel( ;$ ) +{ + my $this = shift; + my $syslogLevel = shift; + if ( defined($syslogLevel) ) + { + $syslogLevel = $this->limit($syslogLevel); + if ( $this->{syslogLevel} != $syslogLevel ) + { + $this->closeSyslog() if ( $syslogLevel <= NOLOG && $this->{syslogLevel} > NOLOG ); + $this->openSyslog() if ( $syslogLevel > NOLOG && $this->{syslogLevel} <= NOLOG ); + $this->{syslogLevel} = $syslogLevel; + } + } + return( $this->{syslogLevel} ); +} + +sub openSyslog() +{ + my $this = shift; + openlog( $this->{id}, "pid", "local1" ); +} + +sub closeSyslog() +{ + my $this = shift; + #closelog(); +} + +sub logFile( $ ) +{ + my $this = shift; + my $logFile = shift; + if ( $logFile =~ /^(.+)\+$/ ) + { + $this->{logFile} = $1.'.'.$$; + } + else + { + $this->{logFile} = $logFile; + } +} + +sub openFile() +{ + my $this = shift; + if ( open( LOGFILE, ">>".$this->{logFile} ) ) + { + LOGFILE->autoflush() if ( $this->{autoFlush} ); + + my $webUid = (getpwnam( ZM_WEB_USER ))[2]; + my $webGid = (getgrnam( ZM_WEB_GROUP ))[2]; + if ( $> == 0 ) + { + chown( $webUid, $webGid, $this->{logFile} ) or Fatal( "Can't change permissions on log file '".$this->{logFile}."': $!" ) + } + } + else + { + $this->fileLevel( NOLOG ); + Error( "Can't open log file '".$this->{logFile}."': $!" ); + } +} + +sub closeFile() +{ + my $this = shift; + close( LOGFILE ) if ( fileno(LOGFILE) ); +} + +sub logPrint( $;$ ) +{ + my $this = shift; + my $level = shift; + my $string = shift; + + if ( $level <= $this->{effectiveLevel} ) + { + $string =~ s/[\r\n]+$//g; + + my $code = $codes{$level}; + + my ($seconds, $microseconds) = gettimeofday(); + my $message = sprintf( "%s.%06d %s[%d].%s [%s]", strftime( "%x %H:%M:%S", localtime( $seconds ) ), $microseconds, $this->{id}, $$, $code, $string ); + if ( $this->{trace} ) + { + $message = Carp::shortmess( $message ); + } + else + { + $message = $message."\n"; + } + syslog( $priorities{$level}, $code." [%s]", $string ) if ( $level <= $this->{syslogLevel} ); + print( LOGFILE $message ) if ( $level <= $this->{fileLevel} ); + if ( $level <= $this->{databaseLevel} ) + { + my $sql = "insert into Logs ( TimeKey, Component, Pid, Level, Code, Message, File, Line ) values ( ?, ?, ?, ?, ?, ?, ?, NULL )"; + $this->{sth} = $this->{dbh}->prepare_cached( $sql ); + if ( !$this->{sth} ) + { + $this->{databaseLevel} = NOLOG; + Fatal( "Can't prepare log entry '$sql': ".$this->{dbh}->errstr() ); + } + my $res = $this->{sth}->execute( $seconds+($microseconds/1000000.0), $this->{id}, $$, $level, $code, $string, $this->{fileName} ); + if ( !$res ) + { + $this->{databaseLevel} = NOLOG; + Fatal( "Can't execute log entry '$sql': ".$this->{sth}->errstr() ); + } + } + print( STDERR $message ) if ( $level <= $this->{termLevel} ); + } +} + +sub logInit( ;@ ) +{ + my %options = @_ ? @_ : (); + $logger = ZoneMinder::Logger->new() if ( !$logger ); + $logger->initialise( %options ); +} + +sub logReinit() +{ + fetch()->reinitialise(); +} + +sub logTerm +{ + return unless ( $logger ); + $logger->terminate(); + $logger = undef; +} + +sub logHupHandler() +{ + my $savedErrno = $!; + return unless( $logger ); + fetch()->reinitialise(); + logSetSignal(); + $! = $savedErrno; +} + +sub logSetSignal() +{ + $SIG{HUP} = \&logHupHandler; +} + +sub logClearSignal() +{ + $SIG{HUP} = 'DEFAULT'; +} + +sub logLevel( ;$ ) +{ + return( fetch()->level( @_ ) ); +} + +sub logDebugging() +{ + return( fetch()->debugOn() ); +} + +sub logTermLevel( ;$ ) +{ + return( fetch()->termLevel( @_ ) ); +} + +sub logDatabaseLevel( ;$ ) +{ + return( fetch()->databaseLevel( @_ ) ); +} + +sub logFileLevel( ;$ ) +{ + return( fetch()->fileLevel( @_ ) ); +} + +sub logSyslogLevel( ;$ ) +{ + return( fetch()->syslogLevel( @_ ) ); +} + +sub Mark( ;$$ ) +{ + my $level = shift; + $level = DEBUG unless( defined($level) ); + my $tag = "Mark"; + fetch()->logPrint( $level, $tag ); +} + +sub Dump( \$;$ ) +{ + my $var = shift; + my $label = shift; + $label = "VAR" unless( defined($label) ); + fetch()->logPrint( DEBUG, Data::Dumper->Dump( [ $var ], [ $label ] ) ); +} + +sub Debug( @ ) +{ + fetch()->logPrint( DEBUG, @_ ); +} + +sub Info( @ ) +{ + fetch()->logPrint( INFO, @_ ); +} + +sub Warning( @ ) +{ + fetch()->logPrint( WARNING, @_ ); +} + +sub Error( @ ) +{ + fetch()->logPrint( ERROR, @_ ); +} + +sub Fatal( @ ) +{ + fetch()->logPrint( FATAL, @_ ); + exit( -1 ); +} + +sub Panic( @ ) +{ + fetch()->logPrint( PANIC, @_ ); + confess( $_[0] ); +} + +1; +__END__ + +=head1 NAME + +ZoneMinder::Logger - ZoneMinder Logger module + +=head1 SYNOPSIS + + use ZoneMinder::Logger; + use ZoneMinder::Logger qw(:all); + + logInit( "myproc", DEBUG ); + + Debug( "This is what is happening" ); + Info( "Something interesting is happening" ); + Warning( "Something might be going wrong." ); + Error( "Something has gone wrong!!" ); + Fatal( "Something has gone badly wrong, gotta stop!!" ); + Panic( "Something fundamental has gone wrong, die with stack trace ); + +=head1 DESCRIPTION + +The ZoneMinder:Logger module contains the common debug and error reporting routines used by the ZoneMinder scripts. + +To use debug in your scripts you need to include this module, and call logInit. Thereafter you can sprinkle Debug or Error calls etc throughout the code safe in the knowledge that they will be reported to your error log, and possibly the syslogger, in a meaningful and consistent format. + +Debug is discussed in terms of levels where 1 and above (currently only 1 for scripts) is considered debug, 0 is considered as informational, -1 is a warning, -2 is an error and -3 is a fatal error or panic. Where levels are mentioned below as thresholds the value given and anything with a lower level (ie. more serious) will be included. + +=head1 METHODS + +=over 4 + +=item logInit ( $id, %options ); + +Initialises the debug and prepares the logging for forthcoming operations. If not called explicitly it will be called by the first debug call in your script, but with default (and probably meaningless) options. The only compulsory arguments are $id which must be a string that will identify debug coming from this script in mixed logs. Other options may be provided as below, + + Option Default Description + --------- --------- ----------- + level INFO The initial debug level which defines which statements are output and which are ignored + trace 0 Whether to use the Carp::shortmess format in debug statements to identify where the debug was emitted from + termLevel NOLOG At what level debug is written to terminal standard error, 0 is no, 1 is yes, 2 is write only if terminal + databaseLevel INFO At what level debug is written to the Log table in the database; + fileLevel NOLOG At what level debug is written to a log file of the format of .log in the standard log directory. + syslogLevel INFO At what level debug is written to syslog. + +To disable any of these action entirely set to NOLOG + +=item logTerm (); + +Used to end the debug session and close any logs etc. Not usually necessary. + +=item $id = logId ( [$id] ); + +=item $level = logLevel ( [$level] ); + +=item $trace = logTrace ( [$trace] ); + +=item $level = logLevel ( [$level] ); + +=item $termLevel = logTermLevel ( [$termLevel] ); + +=item $databaseLevel = logDatabaseLevel ( [$databaseLevel] ); + +=item $fileLevel = logFileLevel ( [$fileLevel] ); + +=item $syslogLevel = logSyslogLevel ( [$syslogLevel] ); + +These methods can be used to get and set the current settings as defined in logInit. + +=item Debug( $string ); + +This method will output a debug message if the current debug level permits it, otherwise does nothing. This message will be tagged with the DBG string in the logs. + +=item Info( $string ); + +This method will output an informational message if the current debug level permits it, otherwise does nothing. This message will be tagged with the INF string in the logs. + +=item Warning( $string ); + +This method will output a warning message if the current debug level permits it, otherwise does nothing. This message will be tagged with the WAR string in the logs. + +=item Error( $string ); + +This method will output an error message if the current debug level permits it, otherwise does nothing. This message will be tagged with the ERR string in the logs. + +=item Fatal( $string ); + +This method will output a fatal error message and then die if the current debug level permits it, otherwise does nothing. This message will be tagged with the FAT string in the logs. + +=item Panic( $string ); + +This method will output a panic error message and then die with a stack trace if the current debug level permits it, otherwise does nothing. This message will be tagged with the PNC string in the logs. + +=head2 EXPORT + +None by default. +The :constants tag will export the debug constants which define the various levels of debug +The :variables tag will export variables containing the current debug id and level +The :functions tag will export the debug functions. This or :all is what you would normally use. +The :all tag will export all above symbols. + + +=head1 SEE ALSO + +Carp +Sys::Syslog + +The ZoneMinder README file Troubleshooting section for an extended discussion on the use and configuration of syslog with ZoneMinder. + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Memory.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Memory.pm new file mode 100644 index 000000000..86037713d --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Memory.pm @@ -0,0 +1,873 @@ +# ========================================================================== +# +# ZoneMinder Memory Access Module, $Date: 2008-02-25 10:13:13 +0000 (Mon, 25 Feb 2008) $, $Revision: 2323 $ +# 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. +# +# ========================================================================== +# +# This module contains the common definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::Memory; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'constants' => [ qw( + STATE_IDLE + STATE_PREALARM + STATE_ALARM + STATE_ALERT + STATE_TAPE + ACTION_GET + ACTION_SET + ACTION_RELOAD + ACTION_SUSPEND + ACTION_RESUME + TRIGGER_CANCEL + TRIGGER_ON + TRIGGER_OFF + ) ], + 'functions' => [ qw( + zmMemVerify + zmMemInvalidate + zmMemRead + zmMemWrite + zmMemTidy + zmGetMonitorState + zmGetAlarmLocation + zmIsAlarmed + zmInAlarm + zmHasAlarmed + zmGetLastEvent + zmGetLastWriteTime + zmGetLastReadTime + zmMonitorEnable + zmMonitorDisable + zmMonitorSuspend + zmMonitorResume + zmTriggerEventOn + zmTriggerEventOff + zmTriggerEventCancel + zmTriggerShowtext + ) ], +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Shared Memory Facilities +# +# ========================================================================== + +use ZoneMinder::Config qw(:all); +use ZoneMinder::Logger qw(:all); + +use constant STATE_IDLE => 0; +use constant STATE_PREALARM => 1; +use constant STATE_ALARM => 2; +use constant STATE_ALERT => 3; +use constant STATE_TAPE => 4; + +use constant ACTION_GET => 1; +use constant ACTION_SET => 2; +use constant ACTION_RELOAD => 4; +use constant ACTION_SUSPEND => 16; +use constant ACTION_RESUME => 32; + +use constant TRIGGER_CANCEL => 0; +use constant TRIGGER_ON => 1; +use constant TRIGGER_OFF => 2; + +use Storable qw( freeze thaw ); + +if ( "yes" eq 'yes' ) # 'yes' if memory is mmapped +{ + require ZoneMinder::Memory::Mapped; + ZoneMinder::Memory::Mapped->import(); +} +else +{ + require ZoneMinder::Memory::Shared; + ZoneMinder::Memory::Shared->import(); +} + +# Native architecture +our $arch = int(3.2*length(~0)); +our $native = $arch/8; +our $mem_seq = 0; + +our $mem_data = +{ + "shared_data" => { "type"=>"SharedData", "seq"=>$mem_seq++, "contents"=> { + "size" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "last_write_index" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "last_read_index" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "state" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "last_event" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "action" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "brightness" => { "type"=>"int32", "seq"=>$mem_seq++ }, + "hue" => { "type"=>"int32", "seq"=>$mem_seq++ }, + "colour" => { "type"=>"int32", "seq"=>$mem_seq++ }, + "contrast" => { "type"=>"int32", "seq"=>$mem_seq++ }, + "alarm_x" => { "type"=>"int32", "seq"=>$mem_seq++ }, + "alarm_y" => { "type"=>"int32", "seq"=>$mem_seq++ }, + "valid" => { "type"=>"uint8", "seq"=>$mem_seq++ }, + "active" => { "type"=>"uint8", "seq"=>$mem_seq++ }, + "signal" => { "type"=>"uint8", "seq"=>$mem_seq++ }, + "format" => { "type"=>"uint8", "seq"=>$mem_seq++ }, + "imagesize" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "epadding1" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "epadding2" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "last_write_time" => { "type"=>"time_t64", "seq"=>$mem_seq++ }, + "last_read_time" => { "type"=>"time_t64", "seq"=>$mem_seq++ }, + "control_state" => { "type"=>"uint8[256]", "seq"=>$mem_seq++ }, + } + }, + "trigger_data" => { "type"=>"TriggerData", "seq"=>$mem_seq++, "contents"=> { + "size" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "trigger_state" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "trigger_score" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "padding" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "trigger_cause" => { "type"=>"int8[32]", "seq"=>$mem_seq++ }, + "trigger_text" => { "type"=>"int8[256]", "seq"=>$mem_seq++ }, + "trigger_showtext" => { "type"=>"int8[256]", "seq"=>$mem_seq++ }, + } + }, + "end" => { "seq"=>$mem_seq++, "size"=> 0 } +}; + +our $mem_size = 0; +our $mem_verified = {}; + +sub zmMemInit +{ + my $offset = 0; + + foreach my $section_data ( sort { $a->{seq} <=> $b->{seq} } values( %$mem_data ) ) + { + $section_data->{offset} = $offset; + $section_data->{align} = 0; + + if ( $section_data->{align} > 1 ) + { + my $rem = $offset % $section_data->{align}; + if ( $rem > 0 ) + { + $offset += ($section_data->{align} - $rem); + } + } + foreach my $member_data ( sort { $a->{seq} <=> $b->{seq} } values( %{$section_data->{contents}} ) ) + { + if ( $member_data->{type} eq "long" || $member_data->{type} eq "ulong" || $member_data->{type} eq "size_t") + { + $member_data->{size} = $member_data->{align} = $native; + } + elsif( $member_data->{type} eq "int64" || $member_data->{type} eq "uint64" || $member_data->{type} eq "time_t64") + { + $member_data->{size} = $member_data->{align} = 8; + } + elsif ( $member_data->{type} eq "int32" || $member_data->{type} eq "uint32" || $member_data->{type} eq "bool4" ) + { + $member_data->{size} = $member_data->{align} = 4; + } + elsif ($member_data->{type} eq "int16" || $member_data->{type} eq "uint16") + { + $member_data->{size} = $member_data->{align} = 2; + } + elsif ( $member_data->{type} eq "int8" || $member_data->{type} eq "uint8" || $member_data->{type} eq "bool1" ) + { + $member_data->{size} = $member_data->{align} = 1; + } + elsif ( $member_data->{type} =~ /^u?int8\[(\d+)\]$/ ) + { + $member_data->{size} = $1; + $member_data->{align} = 1; + } + else + { + Fatal( "Unexpected type '".$member_data->{type}."' found in shared data definition." ); + } + + if ( $member_data->{align} > 1 && ($offset%$member_data->{align}) > 0 ) + { + $offset += ($member_data->{align} - ($offset%$member_data->{align})); + } + $member_data->{offset} = $offset; + $offset += $member_data->{size} + } + $section_data->{size} = $offset - $section_data->{offset}; + } + + $mem_size = $offset; +} + +&zmMemInit(); + +sub zmMemVerify( $ ) +{ + my $monitor = shift; + if ( !zmMemAttach( $monitor, $mem_size ) ) + { + return( undef ); + } + + my $mem_key = zmMemKey( $monitor ); + if ( !defined($mem_verified->{$mem_key}) ) + { + my $sd_size = zmMemRead( $monitor, "shared_data:size", 1 ); + if ( $sd_size != $mem_data->{shared_data}->{size} ) + { + if ( $sd_size ) + { + Error( "Shared data size conflict in shared_data for monitor ".$monitor->{Name}.", expected ".$mem_data->{shared_data}->{size}.", got ".$sd_size ); + } + else + { + Debug( "Shared data size conflict in shared_data for monitor ".$monitor->{Name}.", expected ".$mem_data->{shared_data}->{size}.", got ".$sd_size ); + } + return( undef ); + } + my $td_size = zmMemRead( $monitor, "trigger_data:size", 1 ); + if ( $td_size != $mem_data->{trigger_data}->{size} ) + { + if ( $td_size ) + { + Error( "Shared data size conflict in trigger_data for monitor ".$monitor->{Name}.", expected ".$mem_data->{triggger_data}->{size}.", got ".$td_size ); + } + else + { + Debug( "Shared data size conflict in trigger_data for monitor ".$monitor->{Name}.", expected ".$mem_data->{triggger_data}->{size}.", got ".$td_size ); + } + return( undef ); + } + $mem_verified->{$mem_key} = !undef; + } + return( !undef ); +} + +sub zmMemRead( $$;$ ) +{ + my $monitor = shift; + my $fields = shift; + my $nocheck = shift; + + if ( !($nocheck || zmMemVerify( $monitor )) ) + { + return( undef ); + } + + if ( !ref($fields) ) + { + $fields = [ $fields ]; + } + my @values; + foreach my $field ( @$fields ) + { + my ( $section, $element ) = split( /[\/:.]/, $field ); + Fatal( "Invalid shared data selector '$field'" ) if ( !$section || !$element ); + + my $offset = $mem_data->{$section}->{contents}->{$element}->{offset}; + my $type = $mem_data->{$section}->{contents}->{$element}->{type}; + my $size = $mem_data->{$section}->{contents}->{$element}->{size}; + + my $data = zmMemGet( $monitor, $offset, $size ); + if ( !defined($data) ) + { + Error( "Unable to read '$field' from memory for monitor ".$monitor->{Id} ); + zmMemInvalidate( $monitor ); + return( undef ); + } + my $value; + if ( $type eq "long" ) + { + ( $value ) = unpack( "l!", $data ); + } + elsif ( $type eq "ulong" || $type eq "size_t" ) + { + ( $value ) = unpack( "L!", $data ); + } + elsif ( $type eq "int64" || $type eq "time_t64" ) + { + # The "q" type is only available on 64bit platforms, so use native. + ( $value ) = unpack( "l!", $data ); + } + elsif ( $type eq "uint64" ) + { + # The "q" type is only available on 64bit platforms, so use native. + ( $value ) = unpack( "L!", $data ); + } + elsif ( $type eq "int32" ) + { + ( $value ) = unpack( "l", $data ); + } + elsif ( $type eq "uint32" || $type eq "bool4" ) + { + ( $value ) = unpack( "L", $data ); + } + elsif ( $type eq "int16" ) + { + ( $value ) = unpack( "s", $data ); + } + elsif ( $type eq "uint16" ) + { + ( $value ) = unpack( "S", $data ); + } + elsif ( $type eq "int8" ) + { + ( $value ) = unpack( "c", $data ); + } + elsif ( $type eq "uint8" || $type eq "bool1" ) + { + ( $value ) = unpack( "C", $data ); + } + elsif ( $type =~ /^int8\[\d+\]$/ ) + { + ( $value ) = unpack( "Z".$size, $data ); + } + elsif ( $type =~ /^uint8\[\d+\]$/ ) + { + ( $value ) = unpack( "C".$size, $data ); + } + else + { + Fatal( "Unexpected type '".$type."' found for '".$field."'" ); + } + push( @values, $value ); + } + if ( wantarray() ) + { + return( @values ) + } + return( $values[0] ); +} + +sub zmMemInvalidate( $ ) +{ + my $monitor = shift; + my $mem_key = zmMemKey($monitor); + if ( $mem_key ) + { + delete $mem_verified->{$mem_key}; + zmMemDetach( $monitor ); + } +} + +sub zmMemTidy() +{ + zmMemClean(); +} + +sub zmMemWrite( $$;$ ) +{ + my $monitor = shift; + my $field_values = shift; + my $nocheck = shift; + + if ( !($nocheck || zmMemVerify( $monitor )) ) + { + return( undef ); + } + + while ( my ( $field, $value ) = each( %$field_values ) ) + { + my ( $section, $element ) = split( /[\/:.]/, $field ); + Fatal( "Invalid shared data selector '$field'" ) if ( !$section || !$element ); + + my $offset = $mem_data->{$section}->{contents}->{$element}->{offset}; + my $type = $mem_data->{$section}->{contents}->{$element}->{type}; + my $size = $mem_data->{$section}->{contents}->{$element}->{size}; + + my $data; + if ( $type eq "long" ) + { + $data = pack( "l!", $value ); + } + elsif ( $type eq "ulong" || $type eq "size_t" ) + { + $data = pack( "L!", $value ); + } + elsif ( $type eq "int64" || $type eq "time_t64" ) + { + # The "q" type is only available on 64bit platforms, so use native. + $data = pack( "l!", $value ); + } + elsif ( $type eq "uint64" ) + { + # The "q" type is only available on 64bit platforms, so use native. + $data = pack( "L!", $value ); + } + elsif ( $type eq "int32" ) + { + $data = pack( "l", $value ); + } + elsif ( $type eq "uint32" || $type eq "bool4" ) + { + $data = pack( "L", $value ); + } + elsif ( $type eq "int16" ) + { + $data = pack( "s", $value ); + } + elsif ( $type eq "uint16" ) + { + $data = pack( "S", $value ); + } + elsif ( $type eq "int8" ) + { + $data = pack( "c", $value ); + } + elsif ( $type eq "uint8" || $type eq "bool1" ) + { + $data = pack( "C", $value ); + } + elsif ( $type =~ /^int8\[\d+\]$/ ) + { + $data = pack( "Z".$size, $value ); + } + elsif ( $type =~ /^uint8\[\d+\]$/ ) + { + $data = pack( "C".$size, $value ); + } + else + { + Fatal( "Unexpected type '".$type."' found for '".$field."'" ); + } + + if ( !zmMemPut( $monitor, $offset, $size, $data ) ) + { + Error( "Unable to write '$value' to '$field' in memory for monitor ".$monitor->{Id} ); + zmMemInvalidate( $monitor ); + return( undef ); + } + } + return( !undef ); +} + +sub zmGetMonitorState( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "shared_data:state" ) ); +} + +sub zmGetAlarmLocation( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, [ "shared_data:alarm_x", "shared_data:alarm_y" ] ) ); +} + +sub zmSetControlState( $$ ) +{ + my $monitor = shift; + my $control_state = shift; + + zmMemWrite( $monitor, { "shared_data:control_state" => $control_state } ); +} + +sub zmGetControlState( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "shared_data:control_state" ) ); +} + +sub zmSaveControlState( $$ ) +{ + my $monitor = shift; + my $control_state = shift; + + zmSetControlState( $monitor, freeze( $control_state ) ); +} + +sub zmRestoreControlState( $ ) +{ + my $monitor = shift; + + return( thaw( zmGetControlState( $monitor ) ) ); +} + +sub zmIsAlarmed( $ ) +{ + my $monitor = shift; + + my $state = zmGetMonitorState( $monitor ); + + return( $state == STATE_ALARM ); +} + +sub zmInAlarm( $ ) +{ + my $monitor = shift; + + my $state = zmGetMonitorState( $monitor ); + + return( $state == STATE_ALARM || $state == STATE_ALERT ); +} + +sub zmHasAlarmed( $$ ) +{ + my $monitor = shift; + my $last_event_id = shift; + + my ( $state, $last_event ) = zmMemRead( $monitor, [ "shared_data:state", "shared_data:last_event" ] ); + + if ( $state == STATE_ALARM || $state == STATE_ALERT ) + { + return( $last_event ); + } + elsif( $last_event != $last_event_id ) + { + return( $last_event ); + } + return( undef ); +} + +sub zmGetLastEvent( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "shared_data:last_event" ) ); +} + +sub zmGetLastWriteTime( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "shared_data:last_write_time" ) ); +} + +sub zmGetLastReadTime( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "shared_data:last_read_time" ) ); +} + +sub zmGetMonitorActions( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "shared_data:action" ) ); +} + +sub zmMonitorEnable( $ ) +{ + my $monitor = shift; + + my $action = zmMemRead( $monitor, "shared_data:action" ); + $action |= ACTION_SUSPEND; + zmMemWrite( $monitor, { "shared_data:action" => $action } ); +} + +sub zmMonitorDisable( $ ) +{ + my $monitor = shift; + + my $action = zmMemRead( $monitor, "shared_data:action" ); + $action |= ACTION_RESUME; + zmMemWrite( $monitor, { "shared_data:action" => $action } ); +} + +sub zmMonitorSuspend( $ ) +{ + my $monitor = shift; + + my $action = zmMemRead( $monitor, "shared_data:action" ); + $action |= ACTION_SUSPEND; + zmMemWrite( $monitor, { "shared_data:action" => $action } ); +} + +sub zmMonitorResume( $ ) +{ + my $monitor = shift; + + my $action = zmMemRead( $monitor, "shared_data:action" ); + $action |= ACTION_RESUME; + zmMemWrite( $monitor, { "shared_data:action" => $action } ); +} + +sub zmGetTriggerState( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "trigger_data:trigger_state" ) ); +} + +sub zmTriggerEventOn( $$$;$$ ) +{ + my $monitor = shift; + my $score = shift; + my $cause = shift; + my $text = shift; + my $showtext = shift; + + my $values = { + "trigger_data:trigger_score" => $score, + "trigger_data:trigger_cause" => $cause, + }; + $values->{"trigger_data:trigger_text"} = $text if ( defined($text) ); + $values->{"trigger_data:trigger_showtext"} = $showtext if ( defined($showtext) ); + $values->{"trigger_data:trigger_state"} = TRIGGER_ON; # Write state last so event not read incomplete + + zmMemWrite( $monitor, $values ); +} + +sub zmTriggerEventOff( $ ) +{ + my $monitor = shift; + + my $values = { + "trigger_data:trigger_state" => TRIGGER_OFF, + "trigger_data:trigger_score" => 0, + "trigger_data:trigger_cause" => "", + "trigger_data:trigger_text" => "", + "trigger_data:trigger_showtext" => "", + }; + + zmMemWrite( $monitor, $values ); +} + +sub zmTriggerEventCancel( $ ) +{ + my $monitor = shift; + + my $values = { + "trigger_data:trigger_state" => TRIGGER_CANCEL, + "trigger_data:trigger_score" => 0, + "trigger_data:trigger_cause" => "", + "trigger_data:trigger_text" => "", + "trigger_data:trigger_showtext" => "", + }; + + zmMemWrite( $monitor, $values ); +} + +sub zmTriggerShowtext( $$ ) +{ + my $monitor = shift; + my $showtext = shift; + + my $values = { + "trigger_data:trigger_showtext" => $showtext, + }; + + zmMemWrite( $monitor, $values ); +} + +1; +__END__ + +=head1 NAME + +ZoneMinder::MappedMem - ZoneMinder Mapped Memory access module + +=head1 SYNOPSIS + + use ZoneMinder::MappedMem; + use ZoneMinder::MappedMem qw(:all); + + if ( zmMemVerify( $monitor ) ) + { + $state = zmGetMonitorState( $monitor ); + if ( $state == STATE_ALARM ) + { + ... + } + } + + ( $lri, $lwi ) = zmMemRead( $monitor, [ "shared_data:last_read_index", "shared_data:last_write_index" ] ); + zmMemWrite( $monitor, { "trigger_data:trigger_showtext" => "Some Text" } ); + +=head1 DESCRIPTION + +The ZoneMinder:MappedMem module contains methods for accessing and writing to mapped memory as well as helper methods for common operations. + +The core elements of ZoneMinder used mapped memory to allow multiple access to resources. Although ZoneMinder scripts have used this information before, up until now it was difficult to access and prone to errors. This module introduces a common API for mapped memory access (both reading and writing) making it a lot easier to customise scripts or even create your own. + +All the methods listed below require a 'monitor' parameter. This must be a reference to a hash with at least the 'Id' field set to the monitor id of the mapped memory you wish to access. Using database methods to select the monitor details will also return this kind of data. Some of the mapped memory methods will add and amend new fields to this hash. + +=over 4 + +=head1 METHODS + +=item zmMemVerify ( $monitor ); + +Verify that the mapped memory of the monitor given exists and is valid. It will return an undefined value if it is not valid. You should generally call this method first before using any of the other methods, but most of the remaining methods will also do so if the memory has not already been verified. + +=item zmMemInvalidate ( $monitor ); + +Following an error, reset the mapped memory ids and attempt to reverify on the next operation. This is mostly used when a mapped memory segment has gone away and been recreated with a different id. + +=item zmMemRead ( $monitor, $readspec ); + +This method is used to read data from mapped memory attached to the given monitor. The mapped memory will be verified if it has not already been. The 'readspec' must either be a string of the form "
:" or a reference to an array of strings of the same format. In the first case a single value is returned, in the latter case a list of values is return. Errors will cause undefined to be returned. The allowable sections and field names are described below. + +=item zmMemWrite ( $monitor, $writespec ); + +This method is used to write data to mapped memory attached to the given monitor. The mapped memory will be verified if it has not already been. The 'writespec' must be a reference to a hash with keys of the form "
:" and values as the data to be written. Errors will cause undefined to be returned, otherwise a non-undefined value will be returned. The allowable sections and field names are described below. + +=item $state = zmGetMonitorState ( $monitor ); + +Return the current state of the given monitor. This is an integer value and can be compared with the STATE constants given below. + +=item $event_id = zmGetLastEvent ( $monitor ); + +Return the event id of the last event that the monitor generated, or 0 if no event has been generated by the current monitor process. + +=item zmIsAlarmed ( $monitor ); + +Return 1 if the monitor given is currently in an alarm state, 0 otherwise. + +=item zmInAlarm ( $monitor ); + +Return 1 if the monitor given is currently in an alarm or alerted state, 0 otherwise. + +=item zmHasAlarmed ( $monitor ); + +Return 1 if the given monitor is in an alarm state, or has been in an alarm state since the last call to this method. + +=item ( $x, $y ) = zmGetAlarmLocation ( $monitor ); + +Return an x,y pair indicating the image co-ordinates of the centre of the last motion event generated by the given monitor. If no event has been generated by the current monitor process, or the alarm was not motion related, returns -1,-1. + +=item zmGetLastWriteTime ( $monitor ); + +Returns the time (in utc seconds) since the last image was captured by the given monitor and written to shared memory, or 0 otherwise. + +=item zmGetLastReadTime ( $monitor ); + +Returns the time (in utc seconds) since the last image was read from shared memory by the analysis daemon of the given monitor, or 0 otherwise or if the monitor is in monitor only mode. + +=item zmMonitorSuspend ( $monitor ); + +Suspend the given monitor from generating events caused by motion. This method can be used to prevent camera actions such as panning or zooming from causing events. If configured to do so, the monitor may automatically resume after a defined period. + +=item zmMonitorResume ( $monitor ); + +Allow the given monitor to resume generating events caused by motion. + +=item zmTriggerEventOn ( $monitor, $score, $cause [, $text, $showtext ] ); + +Trigger the given monitor to generate an event. You must supply an event score and a cause string indicating the reason for the event. You may also supply a text string containing further details about the event and a showtext string which may be included in the timestamp annotation on any images captured during the event, if configured to do so. + +=item zmTriggerEventOff ( $monitor ); + +Trigger the given monitor to not generate any events. This method does not cancel zmTriggerEventOn, but is exclusive to it. This method is intended to allow external triggers to prevent normal events being generated by monitors in the same way as zmMonitorSuspend but applies to all events and not just motion, and is intended for longer timescales than are appropriate for suspension. + +=item zmTriggerEventCancel ( $monitor ); + +Cancel any previous trigger on or off requests. This stops a triggered alarm if it exists from a previous 'on' and allows events to be generated once more following a previous 'off'. + +=item zmTriggerShowtext ( $monitor, $showtest ); + +Indicate that the given text should be displayed in the timestamp annotation on any images captured, if the format of the annotation string defined for the monitor permits. + +=head1 DATA + +The data fields in mapped memory that may be accessed are as follows. There are two main sections, shared_data which is general data and trigger_data which is used for event triggering. Whilst reading from these fields is harmless, extreme care must be taken when writing to mapped memory, especially in the shared_data section as this is normally written to only by monitor capture and analysis processes. + + shared_data The general mapped memory section + size The size, in bytes, of this section + valid Flag indicating whether this section has been initialised + active Flag indicating whether this monitor is active (enabled/disabled) + signal Flag indicating whether this monitor is reciving a valid signal + state The current monitor state, see the STATE constants below + last_write_index The last index, in the image buffer, that an image has been saved to + last_read_index The last index, in the image buffer, that an image has been analysed from + last_write_time The time (in utc seconds) when the last image was captured + last_read_time The time (in utc seconds) when the last image was analysed + last_event The id of the last event generated by the monitor analysis process, 0 if none + action The monitor actions bitmask, see the ACTION constants below + brightness Read/write location for the current monitor brightness + hue Read/write location for the current monitor hue + colour Read/write location for the current monitor colour + contrast Read/write location for the current monitor contrast + alarm_x Image x co-ordinate (from left) of the centre of the last motion event, -1 if none + alarm_y Image y co-ordinate (from top) of the centre of the last motion event, -1 if none + + trigger_data The triggered event mapped memory section + size The size, in bytes of this section + trigger_state The current trigger state, see the TRIGGER constants below + trigger_score The current triggered event score + trigger_cause The current triggered event cause string + trigger_text The current triggered event descriptive text string + trigger_showtext The triggered text that will be displayed on captured image timestamps + +=head1 CONSTANTS + +The following constants are used by the methods above, but can also be used by user scripts if required. + +=item STATE_IDLE STATE_PREALARM STATE_ALARM STATE_ALERT STATE_TAPE + +These constants define the state of the monitor with respect to alarms and events. They are used in the shared_data:state field. + +=item ACTION_GET ACTION_SET ACTION_RELOAD ACTION_SUSPEND ACTION_RESUME + +These constants defines the various values that can exist in the shared_data:action field. This is a bitmask which when non-zero defines an action that an executing monitor process should take. ACTION_GET requires that the current values of brightness, contrast, colour and hue are taken from the camera and written to the equivalent mapped memory fields. ACTION_SET implies the reverse, that the values in mapped memory should be written to the camera. ACTION_RELOAD signal that the monitor process should reload itself from the database in case any settings have changed there. ACTION_SUSPEND signals that a monitor should stop exaiming images for motion, though other alarms may still occur. ACTION_RESUME sigansl that a monitor should resume motion detectiom. + +=item TRIGGER_CANCEL TRIGGER_ON TRIGGER_OFF + +These constants are used in the definition of external triggers. TRIGGER_CANCEL is used to indicated that any previous trigger settings should be cancelled, TRIGGER_ON signals that an alarm should be created (or continued)) as a result of the current trigger and TRIGGER_OFF signals that the trigger should prevent any alarms from being generated. See the trigger methods above for further details. + +=head1 EXPORT + +None by default. +The :constants tag will export the mapped memory constants which mostly define enumerations for the variables held in memory +The :functions tag will export the mapped memory access functions. +The :all tag will export all above symbols. + + +=head1 SEE ALSO + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Memory/Mapped.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Memory/Mapped.pm new file mode 100644 index 000000000..b8745d835 --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Memory/Mapped.pm @@ -0,0 +1,169 @@ +# ========================================================================== +# +# ZoneMinder Mapped Memory Access Module, $Date: 2008-02-25 10:13:13 +0000 (Mon, 25 Feb 2008) $, $Revision: 2323 $ +# 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. +# +# ========================================================================== +# +# This module contains the definitions and functions used when accessing mapped memory +# +package ZoneMinder::Memory::Mapped; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'functions' => [ qw( + zmMemKey + zmMemAttach + zmMemDetach + zmMemGet + zmMemPut + zmMemClean + ) ], +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = @EXPORT_OK; + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Mapped Memory Facilities +# +# ========================================================================== + +use ZoneMinder::Config qw(:all); +use ZoneMinder::Logger qw(:all); + +use Sys::Mmap; + +sub zmMemKey( $ ) +{ + my $monitor = shift; + return( defined($monitor->{MMapAddr})?$monitor->{MMapAddr}:undef ); +} + +sub zmMemAttach( $$ ) +{ + my $monitor = shift; + my $size = shift; + if ( !defined($monitor->{MMapAddr}) ) + { + my $mmap_file = ZM_PATH_MAP."/zm.mmap.".$monitor->{Id}; + if ( !open( MMAP, "+<".$mmap_file ) ) + { + Error( sprintf( "Can't open memory map file '%s': $!\n", $mmap_file ) ); + return( undef ); + } + my $mmap = undef; + my $mmap_addr = mmap( $mmap, $size, PROT_READ|PROT_WRITE, MAP_SHARED, \*MMAP ); + if ( !$mmap_addr || !$mmap ) + { + Error( sprintf( "Can't mmap to file '%s': $!\n", $mmap_file ) ); + return( undef ); + } + $monitor->{MMapHandle} = \*MMAP; + $monitor->{MMapAddr} = $mmap_addr; + $monitor->{MMap} = \$mmap; + } + return( !undef ); +} + +sub zmMemDetach( $ ) +{ + my $monitor = shift; + + if ( $monitor->{MMap} ) + { + munmap( ${$monitor->{MMap}} ); + delete $monitor->{MMap}; + } + if ( $monitor->{MMapAddr} ) + { + delete $monitor->{MMapAddr}; + } + if ( $monitor->{MMapHandle} ) + { + close( $monitor->{MMapHandle} ); + delete $monitor->{MMapHandle}; + } +} + +sub zmMemGet( $$$ ) +{ + my $monitor = shift; + my $offset = shift; + my $size = shift; + + my $mmap = $monitor->{MMap}; + if ( !$mmap || !$$mmap ) + { + Error( sprintf( "Can't read from mapped memory for monitor '%d', gone away?", $monitor->{Id} ) ); + return( undef ); + } + my $data = substr( $$mmap, $offset, $size ); + return( $data ); +} + +sub zmMemPut( $$$$ ) +{ + my $monitor = shift; + my $offset = shift; + my $size = shift; + my $data = shift; + + my $mmap = $monitor->{MMap}; + if ( !$mmap || !$$mmap ) + { + Error( sprintf( "Can't write mapped memory for monitor '%d', gone away?", $monitor->{Id} ) ); + return( undef ); + } + substr( $$mmap, $offset, $size ) = $data; + return( !undef ); +} + +sub zmMemClean +{ + Debug( "Removing memory map files\n" ); + my $mapPath = ZM_PATH_MAP."/zm.mmap.*"; + foreach my $mapFile( glob( $mapPath ) ) + { + ( $mapFile ) = $mapFile =~ /^(.+)$/; + Debug( "Removing memory map file '$mapFile'\n" ); + unlink( $mapFile ); + } +} + +1; +__END__ diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Memory/Shared.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Memory/Shared.pm new file mode 100644 index 000000000..c04e4f413 --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Memory/Shared.pm @@ -0,0 +1,161 @@ +# ========================================================================== +# +# ZoneMinder Shared Memory Access Module, $Date: 2007-08-29 19:11:09 +0100 (Wed, 29 Aug 2007) $, $Revision: 2175 $ +# 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. +# +# ========================================================================== +# +# This module contains the common definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::Memory::Shared; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'functions' => [ qw( + zmMemKey + zmMemAttach + zmMemDetach + zmMemGet + zmMemPut + zmMemClean + ) ], +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = @EXPORT_OK; + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Shared Memory Facilities +# +# ========================================================================== + +use ZoneMinder::Config qw(:all); +use ZoneMinder::Logger qw(:all); + +sub zmMemKey( $ ) +{ + my $monitor = shift; + return( defined($monitor->{ShmKey})?$monitor->{ShmKey}:undef ); +} + +sub zmMemAttach( $$ ) +{ + my $monitor = shift; + my $size = shift; + if ( !defined($monitor->{ShmId}) ) + { + my $shm_key = (hex(ZM_SHM_KEY)&0xffff0000)|$monitor->{Id}; + my $shm_id = shmget( $shm_key, $size, 0 ); + if ( !defined($shm_id) ) + { + Error( sprintf( "Can't get shared memory id '%x', %d: $!\n", $shm_key, $monitor->{Id} ) ); + return( undef ); + } + $monitor->{ShmKey} = $shm_key; + $monitor->{ShmId} = $shm_id; + } + return( !undef ); +} + +sub zmMemDetach( $ ) +{ + my $monitor = shift; + + delete $monitor->{ShmId}; +} + +sub zmMemGet( $$$ ) +{ + my $monitor = shift; + my $offset = shift; + my $size = shift; + + my $shm_key = $monitor->{ShmKey}; + my $shm_id = $monitor->{ShmId}; + + my $data; + if ( !shmread( $shm_id, $data, $offset, $size ) ) + { + Error( sprintf( "Can't read from shared memory '%x/%d': $!", $shm_key, $shm_id ) ); + return( undef ); + } + return( $data ); +} + +sub zmMemPut( $$$$ ) +{ + my $monitor = shift; + my $offset = shift; + my $size = shift; + my $data = shift; + + my $shm_key = $monitor->{ShmKey}; + my $shm_id = $monitor->{ShmId}; + + if ( !shmwrite( $shm_id, $data, $offset, $size ) ) + { + Error( sprintf( "Can't write to shared memory '%x/%d': $!", $shm_key, $shm_id ) ); + return( undef ); + } + return( !undef ); +} + +sub zmMemClean +{ + Debug( "Removing shared memory\n" ); + # Find ZoneMinder shared memory + my $command = "ipcs -m | grep '^".substr( sprintf( "0x%x", hex(ZM_SHM_KEY) ), 0, -2 )."'"; + Debug( "Checking for shared memory with '$command'\n" ); + open( CMD, "$command |" ) or Fatal( "Can't execute '$command': $!" ); + while( ) + { + chomp; + my ( $key, $id ) = split( /\s+/ ); + if ( $id =~ /^(\d+)/ ) + { + $id = $1; + $command = "ipcrm shm $id"; + Debug( "Removing shared memory with '$command'\n" ); + qx( $command ); + } + } + close( CMD ); +} + +1; +__END__ diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel.pm new file mode 100644 index 000000000..0344e6d94 --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel.pm @@ -0,0 +1,166 @@ +# ========================================================================== +# +# ZoneMinder Trigger Channel Module, $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. +# +# ========================================================================== +# +# This module contains the base class definition of the trigger channel +# class tree +# +package ZoneMinder::Trigger::Channel; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Database Access +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +use Carp; + +our $AUTOLOAD; + +sub new +{ + my $class = shift; + my $self = {}; + $self->{readable} = !undef; + $self->{writeable} = !undef; + $self->{selectable} = undef; + $self->{state} = 'closed'; + bless( $self, $class ); + return $self; +} + +sub clone +{ + my $self = shift; + my $clone = { %$self }; + bless $clone, ref $self; +} + +sub open() +{ + my $self = shift; + my $class = ref($self) or croak( "Can't get class for non object $self" ); + croak( "Abstract base class method called for object of class $class" ); +} + +sub close() +{ + my $self = shift; + my $class = ref($self) or croak( "Can't get class for non object $self" ); + croak( "Abstract base class method called for object of class $class" ); +} + +sub getState() +{ + my $self = shift; + return( $self->{state} ); +} + +sub isOpen() +{ + my $self = shift; + return( $self->{state} eq "open" ); +} + +sub isConnected() +{ + my $self = shift; + return( $self->{state} eq "connected" ); +} + +sub DESTROY +{ +} + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( !exists($self->{$name}) ) + { + croak( "Can't access $name member of object of class $class" ); + } + return( $self->{$name} ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel/File.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel/File.pm new file mode 100644 index 000000000..234dae3d7 --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel/File.pm @@ -0,0 +1,121 @@ +# ========================================================================== +# +# ZoneMinder Trigger Channel Handle Module, $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. +# +# ========================================================================== +# +# This module contains the class definition of the simple file based trigger +# channel class +# +package ZoneMinder::Trigger::Channel::File; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Trigger::Channel::Handle; + +our @ISA = qw(ZoneMinder::Trigger::Channel::Handle); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Simple file based trigger channel +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +use Carp; +use Fcntl; + +sub new +{ + my $class = shift; + my %params = @_; + my $self = ZoneMinder::Trigger::Channel::Handle->new; + $self->{path} = $params{path}; + bless( $self, $class ); + return $self; +} + +sub open() +{ + my $self = shift; + local *sfh; + #sysopen( *sfh, $conn->{path}, O_NONBLOCK|O_RDONLY ) or croak( "Can't sysopen: $!" ); + #open( *sfh, "<".$conn->{path} ) or croak( "Can't open: $!" ); + open( *sfh, "+<".$self->{path} ) or croak( "Can't open: $!" ); + $self->{state} = 'open'; + $self->{handle} = *sfh; +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel/Handle.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel/Handle.pm new file mode 100644 index 000000000..356bb5aea --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel/Handle.pm @@ -0,0 +1,154 @@ +# ========================================================================== +# +# ZoneMinder Trigger Channel Handle Module, $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. +# +# ========================================================================== +# +# This module contains the class definition of the handle based trigger channel +# class +# +package ZoneMinder::Trigger::Channel::Handle; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Trigger::Channel; + +our @ISA = qw(ZoneMinder::Trigger::Channel); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Base class for handle based trigger channels +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use POSIX; + +sub new +{ + my $class = shift; + my $port = shift; + my $self = ZoneMinder::Trigger::Channel->new(); + $self->{handle} = undef; + bless( $self, $class ); + return $self; +} + +sub spawns +{ + return( undef ); +} + +sub close() +{ + my $self = shift; + close( $self->{handle} ); + $self->{state} = 'closed'; + $self->{handle} = undef; +} + +sub read() +{ + my $self = shift; + my $buffer; + my $nbytes = sysread( $self->{handle}, $buffer, POSIX::BUFSIZ ); + if ( !$nbytes ) + { + return( undef ); + } + Debug( "Read '$buffer' ($nbytes bytes)\n" ); + return( $buffer ); +} + +sub write() +{ + my $self = shift; + my $buffer = shift; + my $nbytes = syswrite( $self->{handle}, $buffer ); + if ( !defined( $nbytes) || $nbytes < length($buffer) ) + { + Error( "Unable to write buffer '".$buffer.", expected ".length($buffer)." bytes, sent ".$nbytes.": $!\n" ); + return( undef ); + } + Debug( "Wrote '$buffer' ($nbytes bytes)\n" ); + return( !undef ); +} + +sub fileno() +{ + my $self = shift; + return( defined($self->{handle})?fileno($self->{handle}):-1 ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel/Inet.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel/Inet.pm new file mode 100644 index 000000000..68df0980f --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel/Inet.pm @@ -0,0 +1,142 @@ +# ========================================================================== +# +# ZoneMinder Trigger Channel Handle Module, $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. +# +# ========================================================================== +# +# This module contains the class definition of the tcp socket based trigger +# channel class +# +package ZoneMinder::Trigger::Channel::Inet; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Trigger::Channel::Spawning; + +our @ISA = qw(ZoneMinder::Trigger::Channel::Spawning); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Internet (TCP) based trigger channel +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +use Carp; +use Socket; + +sub new +{ + my $class = shift; + my %params = @_; + my $self = ZoneMinder::Trigger::Channel::Spawning->new(); + $self->{selectable} = !undef; + $self->{port} = $params{port}; + bless( $self, $class ); + return $self; +} + +sub open() +{ + my $self = shift; + local *sfh; + my $saddr = sockaddr_in( $self->{port}, INADDR_ANY ); + socket( *sfh, PF_INET, SOCK_STREAM, getprotobyname('tcp') ) or croak( "Can't open socket: $!" ); + setsockopt( *sfh, SOL_SOCKET, SO_REUSEADDR, 1 ); + bind( *sfh, $saddr ) or croak( "Can't bind: $!" ); + listen( *sfh, SOMAXCONN ) or croak( "Can't listen: $!" ); + $self->{state} = 'open'; + $self->{handle} = *sfh; +} + +sub _spawn( $ ) +{ + my $self = shift; + my $new_handle = shift; + my $clone = $self->clone(); + $clone->{handle} = $new_handle; + $clone->{state} = 'connected'; + return( $clone ); +} + +sub accept() +{ + my $self = shift; + local *cfh; + my $paddr = accept( *cfh, $self->{handle} ); + return( $self->_spawn( *cfh ) ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel/Serial.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel/Serial.pm new file mode 100644 index 000000000..7e4ad4730 --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel/Serial.pm @@ -0,0 +1,160 @@ +# ========================================================================== +# +# ZoneMinder Trigger Channel Handle Module, $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. +# +# ========================================================================== +# +# This module contains the class definition of the serial port trigger channel +# class +# +package ZoneMinder::Trigger::Channel::Serial; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Trigger::Channel; + +our @ISA = qw(ZoneMinder::Trigger::Channel); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Serial access trigger channel +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use Device::SerialPort; + +sub new +{ + my $class = shift; + my %params = @_; + my $self = ZoneMinder::Trigger::Channel->new; + $self->{path} = $params{path}; + bless( $self, $class ); + return $self; +} + +sub open() +{ + my $self = shift; + my $device = new Device::SerialPort( $self->{path} ); + $device->baudrate(9600); + $device->databits(8); + $device->parity('none'); + $device->stopbits(1); + $device->handshake('none'); + + $device->read_const_time(50); + $device->read_char_time(10); + + $self->{device} = $device; + $self->{state} = 'open'; + $self->{state} = 'connected'; +} + +sub close() +{ + my $self = shift; + $self->{device}->close(); + $self->{state} = 'closed'; +} + +sub read() +{ + my $self = shift; + my $buffer = $self->{device}->lookfor(); + if ( !$buffer || !length($buffer) ) + { + return( undef ); + } + Debug( "Read '$buffer' (".length($buffer)." bytes)\n" ); + return( $buffer ); +} + +sub write() +{ + my $self = shift; + my $buffer = shift; + my $nbytes = $self->{device}->write( $buffer ); + $self->{device}->write_drain(); + if ( !defined( $nbytes) || $nbytes < length($buffer) ) + { + Error( "Unable to write buffer '".$buffer.", expected ".length($buffer)." bytes, sent ".$nbytes.": $!\n" ); + return( undef ); + } + Debug( "Wrote '$buffer' ($nbytes bytes)\n" ); + return( !undef ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel/Spawning.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel/Spawning.pm new file mode 100644 index 000000000..ff726ac38 --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel/Spawning.pm @@ -0,0 +1,112 @@ +# ========================================================================== +# +# ZoneMinder Trigger Channel Handle Module, $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. +# +# ========================================================================== +# +# This module contains the class definition of the handle based trigger channel +# classes that spawn new connections when connected. +# +package ZoneMinder::Trigger::Channel::Spawning; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Trigger::Channel::Handle; + +our @ISA = qw(ZoneMinder::Trigger::Channel::Handle); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Base class for handle based triggers that spawn new connections +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +sub new +{ + my $class = shift; + my $port = shift; + my $self = ZoneMinder::Trigger::Channel::Handle->new(); + $self->{spawns} = !undef; + bless( $self, $class ); + return $self; +} + +sub spawns +{ + return( !undef ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel/Unix.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel/Unix.pm new file mode 100644 index 000000000..a671ccd66 --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Channel/Unix.pm @@ -0,0 +1,141 @@ +# ========================================================================== +# +# ZoneMinder Trigger Channel Handle Module, $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. +# +# ========================================================================== +# +# This module contains the class definition of the unix socket based trigger +# channel class +# +package ZoneMinder::Trigger::Channel::Unix; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Trigger::Channel::Spawning; + +our @ISA = qw(ZoneMinder::Trigger::Channel::Spawning); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Unix socket based trigger channel +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +use Carp; +use Socket; + +sub new +{ + my $class = shift; + my %params = @_; + my $self = ZoneMinder::Trigger::Channel->new; + $self->{selectable} = !undef; + $self->{path} = $params{path}; + bless( $self, $class ); + return $self; +} + +sub open() +{ + my $self = shift; + local *sfh; + unlink( $self->{path} ); + my $saddr = sockaddr_un( $self->{path} ); + socket( *sfh, PF_UNIX, SOCK_STREAM, 0 ) or croak( "Can't open socket: $!" ); + bind( *sfh, $saddr ) or croak( "Can't bind: $!" ); + listen( *sfh, SOMAXCONN ) or croak( "Can't listen: $!" ); + $self->{handle} = *sfh; +} + +sub _spawn( $ ) +{ + my $self = shift; + my $new_handle = shift; + my $clone = $self->clone(); + $clone->{handle} = $new_handle; + $clone->{state} = 'connected'; + return( $clone ); +} + +sub accept() +{ + my $self = shift; + local *cfh; + my $paddr = accept( *cfh, $self->{handle} ); + return( $self->_spawn( *cfh ) ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Connection.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Connection.pm new file mode 100644 index 000000000..41b332d46 --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Connection.pm @@ -0,0 +1,239 @@ +# ========================================================================== +# +# ZoneMinder Trigger Connection Module, $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. +# +# ========================================================================== +# +# This module contains the base class definition of the trigger connection +# class tree +# +package ZoneMinder::Trigger::Connection; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Base connection class +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +use Carp; + +our $AUTOLOAD; + +sub new +{ + my $class = shift; + my %params = @_; + my $self = {}; + $self->{name} = $params{name}; + $self->{channel} = $params{channel}; + $self->{input} = $params{mode} =~ /r/i; + $self->{output} = $params{mode} =~ /w/i; + bless( $self, $class ); + return $self; +} + +sub clone +{ + my $self = shift; + my $clone = { %$self }; + bless $clone, ref $self; + return( $clone ); +} + +sub spawns +{ + my $self = shift; + return( $self->{channel}->spawns() ); +} + +sub _spawn( $ ) +{ + my $self = shift; + my $new_channel = shift; + my $clone = $self->clone(); + $clone->{channel} = $new_channel; + return( $clone ); +} + +sub accept() +{ + my $self = shift; + my $new_channel = $self->{channel}->accept(); + return( $self->_spawn( $new_channel ) ); +} + +sub open() +{ + my $self = shift; + return( $self->{channel}->open() ); +} + +sub close() +{ + my $self = shift; + return( $self->{channel}->close() ); +} + +sub fileno() +{ + my $self = shift; + return( $self->{channel}->fileno() ); +} + +sub isOpen() +{ + my $self = shift; + return( $self->{channel}->isOpen() ); +} + +sub isConnected() +{ + my $self = shift; + return( $self->{channel}->isConnected() ); +} + +sub canRead() +{ + my $self = shift; + return( $self->{input} && $self->isConnected() ); +} + +sub canWrite() +{ + my $self = shift; + return( $self->{output} && $self->isConnected() ); +} + +sub getMessages +{ + my $self = shift; + my $buffer = $self->{channel}->read(); + + return( undef ) if ( !defined($buffer) ); + + my @messages = split( /\r?\n/, $buffer ); + return( \@messages ); +} + +sub putMessages +{ + my $self = shift; + my $messages = shift; + + if ( @$messages ) + { + my $buffer = join( "\n", @$messages ); + $buffer .= "\n"; + if ( !$self->{channel}->write( $buffer ) ) + { + Error( "Unable to write buffer '".$buffer." to connection ".$self->{name}." (".$self->fileno().")\n" ); + } + } + return( undef ); +} + +sub timedActions +{ +} + +sub DESTROY +{ +} + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + elsif ( defined($self->{channel}) ) + { + if ( exists($self->{channel}->{$name}) ) + { + return( $self->{channel}->{$name} ); + } + } + croak( "Can't access $name member of object of class $class" ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Connection/Example.pm b/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Connection/Example.pm new file mode 100644 index 000000000..3bed2b351 --- /dev/null +++ b/scripts/ZoneMinder/blib/lib/ZoneMinder/Trigger/Connection/Example.pm @@ -0,0 +1,134 @@ +# ========================================================================== +# +# ZoneMinder Trigger Channel Handle Module, $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. +# +# ========================================================================== +# +# This module contains an example overriden trigger connection class +# +package ZoneMinder::Trigger::Connection::Example; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Trigger::Connection; + +our @ISA = qw(ZoneMinder::Trigger::Connection); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Example overridden connection class +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +sub new +{ + my $class = shift; + my $path = shift; + my $self = ZoneMinder::Trigger::Connection->new( @_ ); + bless( $self, $class ); + return $self; +} + +sub getMessages +{ + my $self = shift; + my $buffer = $self->{channel}->read(); + + return( undef ) if ( !defined($buffer) ); + + Debug( "Handling buffer '$buffer'\n" ); + my @messages = grep { s/-/|/g; 1; } split( /\r?\n/, $buffer ); + return( \@messages ); +} + +sub putMessages +{ + my $self = shift; + my $messages = shift; + + if ( @$messages ) + { + my $buffer = join( "\n", grep{ s/\|/-/; 1; } @$messages ); + $buffer .= "\n"; + if ( !$self->{channel}->write( $buffer ) ) + { + Error( "Unable to write buffer '".$buffer." to connection ".$self->{name}." (".$self->fileno().")\n" ); + } + } + return( undef ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/blib/lib/auto/ZoneMinder/.exists b/scripts/ZoneMinder/blib/lib/auto/ZoneMinder/.exists new file mode 100644 index 000000000..e69de29bb diff --git a/scripts/ZoneMinder/blib/man1/.exists b/scripts/ZoneMinder/blib/man1/.exists new file mode 100644 index 000000000..e69de29bb diff --git a/scripts/ZoneMinder/blib/man3/.exists b/scripts/ZoneMinder/blib/man3/.exists new file mode 100644 index 000000000..e69de29bb diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder.3pm new file mode 100644 index 000000000..166dbf786 --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder.3pm @@ -0,0 +1,177 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder 3pm" +.TH ZoneMinder 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder \- Container module for common ZoneMinder modules +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 1 +\& use ZoneMinder; +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +This module is a convenience container module that uses the +ZoneMinder::Base, ZoneMinder::Common, ZoneMinder::Logger, +ZoneMinder::Database and ZoneMinder::Memory modules. It also +exports by default all symbols provided by the 'all' tag of +each of the modules. +.PP +Thus 'use'ing this module is equivalent to the following +.PP +.Vb 5 +\& use ZoneMinder::Base qw(:all); +\& use ZoneMinder::Config qw(:all); +\& use ZoneMinder::Logger qw(:all); +\& use ZoneMinder::Database qw(:all); +\& use ZoneMinder::Memory qw(:all); +.Ve +.PP +but is somewhat easier. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +All symbols exported by the 'all' tag of each of the included +modules. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +ZoneMinder::Base, ZoneMinder::Common, ZoneMinder::Logger, +ZoneMinder::Database, ZoneMinder::Memory +.PP +http://www.zoneminder.com +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2005 by Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Base.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Base.3pm new file mode 100644 index 000000000..060aca327 --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Base.3pm @@ -0,0 +1,157 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Base 3pm" +.TH ZoneMinder::Base 3pm "2012-09-11" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Base \- Base perl module for ZoneMinder +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 1 +\& use ZoneMinder::Base; +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +This module is the base module for the rest of the ZoneMinder modules. It is included by each of the other modules but serves no purpose other than to propagate the perl module version amongst the other modules. You will never need to use this module directly but if you write new ZoneMinder modules they should include it. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +http://www.zoneminder.com +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Config.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Config.3pm new file mode 100644 index 000000000..cafbc873f --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Config.3pm @@ -0,0 +1,166 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Config 3pm" +.TH ZoneMinder::Config 3pm "2012-09-11" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Config \- ZoneMinder configuration module. +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 1 +\& use ZoneMinder::Config qw(:all); +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +The ZoneMinder::Config module is used to import the ZoneMinder configuration from the database. It will do this at compile time in a \s-1BEGIN\s0 block and require access to the zm.conf file either in the current directory or in its defined location in order to determine database access details, configuration from this file will also be included. If the :all or :config tags are used then this configuration is exported into the namespace of the calling program or module. +.PP +Once the configuration has been imported then configuration variables are defined as constants and can be accessed directory by name, e.g. +.PP +.Vb 1 +\& $lang = ZM_LANG_DEFAULT; +.Ve +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +The :constants tag will export the \s-1ZM_PID\s0 constant which details the location of the zm.pid file +The :config tag will export all configuration from the database as well as any from the zm.conf file +The :all tag will export all above symbols. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +http://www.zoneminder.com +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::ConfigAdmin.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::ConfigAdmin.3pm new file mode 100644 index 000000000..9a29077ac --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::ConfigAdmin.3pm @@ -0,0 +1,180 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::ConfigAdmin 3pm" +.TH ZoneMinder::ConfigAdmin 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::ConfigAdmin \- ZoneMinder Configuration Administration module +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::ConfigAdmin; +\& use ZoneMinder::ConfigAdmin qw(:all); +\& +\& loadConfigFromDB(); +\& saveConfigToDB(); +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +The ZoneMinder:ConfigAdmin module contains the master definition of the ZoneMinder configuration options as well as helper methods. This module is intended for specialist confguration management and would not normally be used by end users. +.PP +The configuration held in this module, which was previously in zmconfig.pl, includes the name, default value, description, help text, type and category for each option, as well as a number of additional fields in a small number of cases. +.SH "METHODS" +.IX Header "METHODS" +.IP "loadConfigFromDB ();" 4 +.IX Item "loadConfigFromDB ();" +Loads existing configuration from the database (if any) and merges it with the definitions held in this module. This results in the merging of any new configuration and the removal of any deprecated configuration while preserving the existing values of every else. +.IP "saveConfigToDB ();" 4 +.IX Item "saveConfigToDB ();" +Saves configuration held in memory to the database. The act of loading and saving configuration is a convenient way to ensure that the configuration held in the database corresponds with the most recent definitions and that all components are using the same set of configuration. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +The :data tag will export the various configuration data structures +The :functions tag will export the helper functions. +The :all tag will export all above symbols. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +http://www.zoneminder.com +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. +.SH "POD ERRORS" +.IX Header "POD ERRORS" +Hey! \fBThe above document had some coding errors, which are explained below:\fR +.IP "Around line 188:" 4 +.IX Item "Around line 188:" +You forgot a '=back' before '=head2' diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::ConfigData.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::ConfigData.3pm new file mode 100644 index 000000000..38c7e4c2d --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::ConfigData.3pm @@ -0,0 +1,180 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::ConfigData 3pm" +.TH ZoneMinder::ConfigData 3pm "2012-09-11" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::ConfigData \- ZoneMinder Configuration Data module +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::ConfigData; +\& use ZoneMinder::ConfigData qw(:all); +\& +\& loadConfigFromDB(); +\& saveConfigToDB(); +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +The ZoneMinder:ConfigData module contains the master definition of the ZoneMinder configuration options as well as helper methods. This module is intended for specialist confguration management and would not normally be used by end users. +.PP +The configuration held in this module, which was previously in zmconfig.pl, includes the name, default value, description, help text, type and category for each option, as well as a number of additional fields in a small number of cases. +.SH "METHODS" +.IX Header "METHODS" +.IP "loadConfigFromDB ();" 4 +.IX Item "loadConfigFromDB ();" +Loads existing configuration from the database (if any) and merges it with the definitions held in this module. This results in the merging of any new configuration and the removal of any deprecated configuration while preserving the existing values of every else. +.IP "saveConfigToDB ();" 4 +.IX Item "saveConfigToDB ();" +Saves configuration held in memory to the database. The act of loading and saving configuration is a convenient way to ensure that the configuration held in the database corresponds with the most recent definitions and that all components are using the same set of configuration. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +The :data tag will export the various configuration data structures +The :functions tag will export the helper functions. +The :all tag will export all above symbols. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +http://www.zoneminder.com +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. +.SH "POD ERRORS" +.IX Header "POD ERRORS" +Hey! \fBThe above document had some coding errors, which are explained below:\fR +.IP "Around line 2031:" 4 +.IX Item "Around line 2031:" +You forgot a '=back' before '=head2' diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Control.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Control.3pm new file mode 100644 index 000000000..d94097341 --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Control.3pm @@ -0,0 +1,169 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Control 3pm" +.TH ZoneMinder::Control 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Database \- Perl extension for blah blah blah +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Database; +\& blah blah blah +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +.PP +Blah blah blah. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in \s-1UNIX\s0), or any relevant external documentation such as RFCs or +standards. +.PP +If you have a mailing list set up for your module, mention it here. +.PP +If you have a web site set up for your module, mention it here. +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Control::AxisV2.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Control::AxisV2.3pm new file mode 100644 index 000000000..a4d4e2970 --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Control::AxisV2.3pm @@ -0,0 +1,169 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Control::AxisV2 3pm" +.TH ZoneMinder::Control::AxisV2 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Database \- Perl extension for blah blah blah +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Database; +\& blah blah blah +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +.PP +Blah blah blah. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in \s-1UNIX\s0), or any relevant external documentation such as RFCs or +standards. +.PP +If you have a mailing list set up for your module, mention it here. +.PP +If you have a web site set up for your module, mention it here. +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Control::Ncs370.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Control::Ncs370.3pm new file mode 100644 index 000000000..9d7f662c8 --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Control::Ncs370.3pm @@ -0,0 +1,169 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Control::Ncs370 3pm" +.TH ZoneMinder::Control::Ncs370 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Database \- Perl extension for blah blah blah +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Database; +\& blah blah blah +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +.PP +Blah blah blah. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in \s-1UNIX\s0), or any relevant external documentation such as RFCs or +standards. +.PP +If you have a mailing list set up for your module, mention it here. +.PP +If you have a web site set up for your module, mention it here. +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Control::PanasonicIP.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Control::PanasonicIP.3pm new file mode 100644 index 000000000..1e87ff0b2 --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Control::PanasonicIP.3pm @@ -0,0 +1,169 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Control::PanasonicIP 3pm" +.TH ZoneMinder::Control::PanasonicIP 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Database \- Perl extension for blah blah blah +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Database; +\& blah blah blah +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +.PP +Blah blah blah. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in \s-1UNIX\s0), or any relevant external documentation such as RFCs or +standards. +.PP +If you have a mailing list set up for your module, mention it here. +.PP +If you have a web site set up for your module, mention it here. +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Control::PelcoD.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Control::PelcoD.3pm new file mode 100644 index 000000000..29378242f --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Control::PelcoD.3pm @@ -0,0 +1,169 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Control::PelcoD 3pm" +.TH ZoneMinder::Control::PelcoD 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Database \- Perl extension for blah blah blah +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Database; +\& blah blah blah +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +.PP +Blah blah blah. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in \s-1UNIX\s0), or any relevant external documentation such as RFCs or +standards. +.PP +If you have a mailing list set up for your module, mention it here. +.PP +If you have a web site set up for your module, mention it here. +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Control::Visca.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Control::Visca.3pm new file mode 100644 index 000000000..3a1950937 --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Control::Visca.3pm @@ -0,0 +1,169 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Control::Visca 3pm" +.TH ZoneMinder::Control::Visca 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Database \- Perl extension for blah blah blah +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Database; +\& blah blah blah +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +.PP +Blah blah blah. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in \s-1UNIX\s0), or any relevant external documentation such as RFCs or +standards. +.PP +If you have a mailing list set up for your module, mention it here. +.PP +If you have a web site set up for your module, mention it here. +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Control::mjpgStreamer.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Control::mjpgStreamer.3pm new file mode 100644 index 000000000..87abf286e --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Control::mjpgStreamer.3pm @@ -0,0 +1,169 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Control::mjpgStreamer 3pm" +.TH ZoneMinder::Control::mjpgStreamer 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Database \- Perl extension for blah blah blah +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Database; +\& blah blah blah +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +.PP +Blah blah blah. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in \s-1UNIX\s0), or any relevant external documentation such as RFCs or +standards. +.PP +If you have a mailing list set up for your module, mention it here. +.PP +If you have a web site set up for your module, mention it here. +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2005 by Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Database.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Database.3pm new file mode 100644 index 000000000..72c7b141a --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Database.3pm @@ -0,0 +1,169 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Database 3pm" +.TH ZoneMinder::Database 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Database \- Perl extension for blah blah blah +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Database; +\& blah blah blah +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +.PP +Blah blah blah. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in \s-1UNIX\s0), or any relevant external documentation such as RFCs or +standards. +.PP +If you have a mailing list set up for your module, mention it here. +.PP +If you have a web site set up for your module, mention it here. +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::General.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::General.3pm new file mode 100644 index 000000000..8040b6b33 --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::General.3pm @@ -0,0 +1,169 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::General 3pm" +.TH ZoneMinder::General 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Database \- Perl extension for blah blah blah +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Database; +\& blah blah blah +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +.PP +Blah blah blah. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in \s-1UNIX\s0), or any relevant external documentation such as RFCs or +standards. +.PP +If you have a mailing list set up for your module, mention it here. +.PP +If you have a web site set up for your module, mention it here. +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Logger.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Logger.3pm new file mode 100644 index 000000000..48aec4433 --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Logger.3pm @@ -0,0 +1,259 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Logger 3pm" +.TH ZoneMinder::Logger 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Logger \- ZoneMinder Logger module +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Logger; +\& use ZoneMinder::Logger qw(:all); +\& +\& logInit( "myproc", DEBUG ); +\& +\& Debug( "This is what is happening" ); +\& Info( "Something interesting is happening" ); +\& Warning( "Something might be going wrong." ); +\& Error( "Something has gone wrong!!" ); +\& Fatal( "Something has gone badly wrong, gotta stop!!" ); +\& Panic( "Something fundamental has gone wrong, die with stack trace ); +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +The ZoneMinder:Logger module contains the common debug and error reporting routines used by the ZoneMinder scripts. +.PP +To use debug in your scripts you need to include this module, and call logInit. Thereafter you can sprinkle Debug or Error calls etc throughout the code safe in the knowledge that they will be reported to your error log, and possibly the syslogger, in a meaningful and consistent format. +.PP +Debug is discussed in terms of levels where 1 and above (currently only 1 for scripts) is considered debug, 0 is considered as informational, \-1 is a warning, \-2 is an error and \-3 is a fatal error or panic. Where levels are mentioned below as thresholds the value given and anything with a lower level (ie. more serious) will be included. +.SH "METHODS" +.IX Header "METHODS" +.ie n .IP "logInit ( $id, %options );" 4 +.el .IP "logInit ( \f(CW$id\fR, \f(CW%options\fR );" 4 +.IX Item "logInit ( $id, %options );" +Initialises the debug and prepares the logging for forthcoming operations. If not called explicitly it will be called by the first debug call in your script, but with default (and probably meaningless) options. The only compulsory arguments are \f(CW$id\fR which must be a string that will identify debug coming from this script in mixed logs. Other options may be provided as below, +.Sp +.Vb 8 +\& Option Default Description +\& \-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\- +\& level INFO The initial debug level which defines which statements are output and which are ignored +\& trace 0 Whether to use the Carp::shortmess format in debug statements to identify where the debug was emitted from +\& termLevel NOLOG At what level debug is written to terminal standard error, 0 is no, 1 is yes, 2 is write only if terminal +\& databaseLevel INFO At what level debug is written to the Log table in the database; +\& fileLevel NOLOG At what level debug is written to a log file of the format of .log in the standard log directory. +\& syslogLevel INFO At what level debug is written to syslog. +.Ve +.Sp +To disable any of these action entirely set to \s-1NOLOG\s0 +.IP "logTerm ();" 4 +.IX Item "logTerm ();" +Used to end the debug session and close any logs etc. Not usually necessary. +.ie n .IP "$id = logId ( [$id] );" 4 +.el .IP "\f(CW$id\fR = logId ( [$id] );" 4 +.IX Item "$id = logId ( [$id] );" +.PD 0 +.ie n .IP "$level = logLevel ( [$level] );" 4 +.el .IP "\f(CW$level\fR = logLevel ( [$level] );" 4 +.IX Item "$level = logLevel ( [$level] );" +.ie n .IP "$trace = logTrace ( [$trace] );" 4 +.el .IP "\f(CW$trace\fR = logTrace ( [$trace] );" 4 +.IX Item "$trace = logTrace ( [$trace] );" +.ie n .IP "$level = logLevel ( [$level] );" 4 +.el .IP "\f(CW$level\fR = logLevel ( [$level] );" 4 +.IX Item "$level = logLevel ( [$level] );" +.ie n .IP "$termLevel = logTermLevel ( [$termLevel] );" 4 +.el .IP "\f(CW$termLevel\fR = logTermLevel ( [$termLevel] );" 4 +.IX Item "$termLevel = logTermLevel ( [$termLevel] );" +.ie n .IP "$databaseLevel = logDatabaseLevel ( [$databaseLevel] );" 4 +.el .IP "\f(CW$databaseLevel\fR = logDatabaseLevel ( [$databaseLevel] );" 4 +.IX Item "$databaseLevel = logDatabaseLevel ( [$databaseLevel] );" +.ie n .IP "$fileLevel = logFileLevel ( [$fileLevel] );" 4 +.el .IP "\f(CW$fileLevel\fR = logFileLevel ( [$fileLevel] );" 4 +.IX Item "$fileLevel = logFileLevel ( [$fileLevel] );" +.ie n .IP "$syslogLevel = logSyslogLevel ( [$syslogLevel] );" 4 +.el .IP "\f(CW$syslogLevel\fR = logSyslogLevel ( [$syslogLevel] );" 4 +.IX Item "$syslogLevel = logSyslogLevel ( [$syslogLevel] );" +.PD +These methods can be used to get and set the current settings as defined in logInit. +.ie n .IP "Debug( $string );" 4 +.el .IP "Debug( \f(CW$string\fR );" 4 +.IX Item "Debug( $string );" +This method will output a debug message if the current debug level permits it, otherwise does nothing. This message will be tagged with the \s-1DBG\s0 string in the logs. +.ie n .IP "Info( $string );" 4 +.el .IP "Info( \f(CW$string\fR );" 4 +.IX Item "Info( $string );" +This method will output an informational message if the current debug level permits it, otherwise does nothing. This message will be tagged with the \s-1INF\s0 string in the logs. +.ie n .IP "Warning( $string );" 4 +.el .IP "Warning( \f(CW$string\fR );" 4 +.IX Item "Warning( $string );" +This method will output a warning message if the current debug level permits it, otherwise does nothing. This message will be tagged with the \s-1WAR\s0 string in the logs. +.ie n .IP "Error( $string );" 4 +.el .IP "Error( \f(CW$string\fR );" 4 +.IX Item "Error( $string );" +This method will output an error message if the current debug level permits it, otherwise does nothing. This message will be tagged with the \s-1ERR\s0 string in the logs. +.ie n .IP "Fatal( $string );" 4 +.el .IP "Fatal( \f(CW$string\fR );" 4 +.IX Item "Fatal( $string );" +This method will output a fatal error message and then die if the current debug level permits it, otherwise does nothing. This message will be tagged with the \s-1FAT\s0 string in the logs. +.ie n .IP "Panic( $string );" 4 +.el .IP "Panic( \f(CW$string\fR );" 4 +.IX Item "Panic( $string );" +This method will output a panic error message and then die with a stack trace if the current debug level permits it, otherwise does nothing. This message will be tagged with the \s-1PNC\s0 string in the logs. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +The :constants tag will export the debug constants which define the various levels of debug +The :variables tag will export variables containing the current debug id and level +The :functions tag will export the debug functions. This or :all is what you would normally use. +The :all tag will export all above symbols. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Carp +Sys::Syslog +.PP +The ZoneMinder \s-1README\s0 file Troubleshooting section for an extended discussion on the use and configuration of syslog with ZoneMinder. +.PP +http://www.zoneminder.com +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. +.SH "POD ERRORS" +.IX Header "POD ERRORS" +Hey! \fBThe above document had some coding errors, which are explained below:\fR +.IP "Around line 830:" 4 +.IX Item "Around line 830:" +You forgot a '=back' before '=head2' diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Memory.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Memory.3pm new file mode 100644 index 000000000..048b11fcd --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Memory.3pm @@ -0,0 +1,313 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Memory 3pm" +.TH ZoneMinder::Memory 3pm "2012-09-11" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::MappedMem \- ZoneMinder Mapped Memory access module +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::MappedMem; +\& use ZoneMinder::MappedMem qw(:all); +\& +\& if ( zmMemVerify( $monitor ) ) +\& { +\& $state = zmGetMonitorState( $monitor ); +\& if ( $state == STATE_ALARM ) +\& { +\& ... +\& } +\& } +\& +\& ( $lri, $lwi ) = zmMemRead( $monitor, [ "shared_data:last_read_index", "shared_data:last_write_index" ] ); +\& zmMemWrite( $monitor, { "trigger_data:trigger_showtext" => "Some Text" } ); +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +The ZoneMinder:MappedMem module contains methods for accessing and writing to mapped memory as well as helper methods for common operations. +.PP +The core elements of ZoneMinder used mapped memory to allow multiple access to resources. Although ZoneMinder scripts have used this information before, up until now it was difficult to access and prone to errors. This module introduces a common \s-1API\s0 for mapped memory access (both reading and writing) making it a lot easier to customise scripts or even create your own. +.PP +All the methods listed below require a 'monitor' parameter. This must be a reference to a hash with at least the 'Id' field set to the monitor id of the mapped memory you wish to access. Using database methods to select the monitor details will also return this kind of data. Some of the mapped memory methods will add and amend new fields to this hash. +.SH "METHODS" +.IX Header "METHODS" +.ie n .IP "zmMemVerify ( $monitor );" 4 +.el .IP "zmMemVerify ( \f(CW$monitor\fR );" 4 +.IX Item "zmMemVerify ( $monitor );" +Verify that the mapped memory of the monitor given exists and is valid. It will return an undefined value if it is not valid. You should generally call this method first before using any of the other methods, but most of the remaining methods will also do so if the memory has not already been verified. +.ie n .IP "zmMemInvalidate ( $monitor );" 4 +.el .IP "zmMemInvalidate ( \f(CW$monitor\fR );" 4 +.IX Item "zmMemInvalidate ( $monitor );" +Following an error, reset the mapped memory ids and attempt to reverify on the next operation. This is mostly used when a mapped memory segment has gone away and been recreated with a different id. +.ie n .IP "zmMemRead ( $monitor, $readspec );" 4 +.el .IP "zmMemRead ( \f(CW$monitor\fR, \f(CW$readspec\fR );" 4 +.IX Item "zmMemRead ( $monitor, $readspec );" +This method is used to read data from mapped memory attached to the given monitor. The mapped memory will be verified if it has not already been. The 'readspec' must either be a string of the form \*(L"
:\*(R" or a reference to an array of strings of the same format. In the first case a single value is returned, in the latter case a list of values is return. Errors will cause undefined to be returned. The allowable sections and field names are described below. +.ie n .IP "zmMemWrite ( $monitor, $writespec );" 4 +.el .IP "zmMemWrite ( \f(CW$monitor\fR, \f(CW$writespec\fR );" 4 +.IX Item "zmMemWrite ( $monitor, $writespec );" +This method is used to write data to mapped memory attached to the given monitor. The mapped memory will be verified if it has not already been. The 'writespec' must be a reference to a hash with keys of the form \*(L"
:\*(R" and values as the data to be written. Errors will cause undefined to be returned, otherwise a non-undefined value will be returned. The allowable sections and field names are described below. +.ie n .IP "$state = zmGetMonitorState ( $monitor );" 4 +.el .IP "\f(CW$state\fR = zmGetMonitorState ( \f(CW$monitor\fR );" 4 +.IX Item "$state = zmGetMonitorState ( $monitor );" +Return the current state of the given monitor. This is an integer value and can be compared with the \s-1STATE\s0 constants given below. +.ie n .IP "$event_id = zmGetLastEvent ( $monitor );" 4 +.el .IP "\f(CW$event_id\fR = zmGetLastEvent ( \f(CW$monitor\fR );" 4 +.IX Item "$event_id = zmGetLastEvent ( $monitor );" +Return the event id of the last event that the monitor generated, or 0 if no event has been generated by the current monitor process. +.ie n .IP "zmIsAlarmed ( $monitor );" 4 +.el .IP "zmIsAlarmed ( \f(CW$monitor\fR );" 4 +.IX Item "zmIsAlarmed ( $monitor );" +Return 1 if the monitor given is currently in an alarm state, 0 otherwise. +.ie n .IP "zmInAlarm ( $monitor );" 4 +.el .IP "zmInAlarm ( \f(CW$monitor\fR );" 4 +.IX Item "zmInAlarm ( $monitor );" +Return 1 if the monitor given is currently in an alarm or alerted state, 0 otherwise. +.ie n .IP "zmHasAlarmed ( $monitor );" 4 +.el .IP "zmHasAlarmed ( \f(CW$monitor\fR );" 4 +.IX Item "zmHasAlarmed ( $monitor );" +Return 1 if the given monitor is in an alarm state, or has been in an alarm state since the last call to this method. +.ie n .IP "( $x, $y ) = zmGetAlarmLocation ( $monitor );" 4 +.el .IP "( \f(CW$x\fR, \f(CW$y\fR ) = zmGetAlarmLocation ( \f(CW$monitor\fR );" 4 +.IX Item "( $x, $y ) = zmGetAlarmLocation ( $monitor );" +Return an x,y pair indicating the image co-ordinates of the centre of the last motion event generated by the given monitor. If no event has been generated by the current monitor process, or the alarm was not motion related, returns \-1,\-1. +.ie n .IP "zmGetLastWriteTime ( $monitor );" 4 +.el .IP "zmGetLastWriteTime ( \f(CW$monitor\fR );" 4 +.IX Item "zmGetLastWriteTime ( $monitor );" +Returns the time (in utc seconds) since the last image was captured by the given monitor and written to shared memory, or 0 otherwise. +.ie n .IP "zmGetLastReadTime ( $monitor );" 4 +.el .IP "zmGetLastReadTime ( \f(CW$monitor\fR );" 4 +.IX Item "zmGetLastReadTime ( $monitor );" +Returns the time (in utc seconds) since the last image was read from shared memory by the analysis daemon of the given monitor, or 0 otherwise or if the monitor is in monitor only mode. +.ie n .IP "zmMonitorSuspend ( $monitor );" 4 +.el .IP "zmMonitorSuspend ( \f(CW$monitor\fR );" 4 +.IX Item "zmMonitorSuspend ( $monitor );" +Suspend the given monitor from generating events caused by motion. This method can be used to prevent camera actions such as panning or zooming from causing events. If configured to do so, the monitor may automatically resume after a defined period. +.ie n .IP "zmMonitorResume ( $monitor );" 4 +.el .IP "zmMonitorResume ( \f(CW$monitor\fR );" 4 +.IX Item "zmMonitorResume ( $monitor );" +Allow the given monitor to resume generating events caused by motion. +.ie n .IP "zmTriggerEventOn ( $monitor, $score, $cause [, $text, $showtext ] );" 4 +.el .IP "zmTriggerEventOn ( \f(CW$monitor\fR, \f(CW$score\fR, \f(CW$cause\fR [, \f(CW$text\fR, \f(CW$showtext\fR ] );" 4 +.IX Item "zmTriggerEventOn ( $monitor, $score, $cause [, $text, $showtext ] );" +Trigger the given monitor to generate an event. You must supply an event score and a cause string indicating the reason for the event. You may also supply a text string containing further details about the event and a showtext string which may be included in the timestamp annotation on any images captured during the event, if configured to do so. +.ie n .IP "zmTriggerEventOff ( $monitor );" 4 +.el .IP "zmTriggerEventOff ( \f(CW$monitor\fR );" 4 +.IX Item "zmTriggerEventOff ( $monitor );" +Trigger the given monitor to not generate any events. This method does not cancel zmTriggerEventOn, but is exclusive to it. This method is intended to allow external triggers to prevent normal events being generated by monitors in the same way as zmMonitorSuspend but applies to all events and not just motion, and is intended for longer timescales than are appropriate for suspension. +.ie n .IP "zmTriggerEventCancel ( $monitor );" 4 +.el .IP "zmTriggerEventCancel ( \f(CW$monitor\fR );" 4 +.IX Item "zmTriggerEventCancel ( $monitor );" +Cancel any previous trigger on or off requests. This stops a triggered alarm if it exists from a previous 'on' and allows events to be generated once more following a previous 'off'. +.ie n .IP "zmTriggerShowtext ( $monitor, $showtest );" 4 +.el .IP "zmTriggerShowtext ( \f(CW$monitor\fR, \f(CW$showtest\fR );" 4 +.IX Item "zmTriggerShowtext ( $monitor, $showtest );" +Indicate that the given text should be displayed in the timestamp annotation on any images captured, if the format of the annotation string defined for the monitor permits. +.SH "DATA" +.IX Header "DATA" +The data fields in mapped memory that may be accessed are as follows. There are two main sections, shared_data which is general data and trigger_data which is used for event triggering. Whilst reading from these fields is harmless, extreme care must be taken when writing to mapped memory, especially in the shared_data section as this is normally written to only by monitor capture and analysis processes. +.PP +.Vb 10 +\& shared_data The general mapped memory section +\& size The size, in bytes, of this section +\& valid Flag indicating whether this section has been initialised +\& active Flag indicating whether this monitor is active (enabled/disabled) +\& signal Flag indicating whether this monitor is reciving a valid signal +\& state The current monitor state, see the STATE constants below +\& last_write_index The last index, in the image buffer, that an image has been saved to +\& last_read_index The last index, in the image buffer, that an image has been analysed from +\& last_write_time The time (in utc seconds) when the last image was captured +\& last_read_time The time (in utc seconds) when the last image was analysed +\& last_event The id of the last event generated by the monitor analysis process, 0 if none +\& action The monitor actions bitmask, see the ACTION constants below +\& brightness Read/write location for the current monitor brightness +\& hue Read/write location for the current monitor hue +\& colour Read/write location for the current monitor colour +\& contrast Read/write location for the current monitor contrast +\& alarm_x Image x co\-ordinate (from left) of the centre of the last motion event, \-1 if none +\& alarm_y Image y co\-ordinate (from top) of the centre of the last motion event, \-1 if none +\& +\& trigger_data The triggered event mapped memory section +\& size The size, in bytes of this section +\& trigger_state The current trigger state, see the TRIGGER constants below +\& trigger_score The current triggered event score +\& trigger_cause The current triggered event cause string +\& trigger_text The current triggered event descriptive text string +\& trigger_showtext The triggered text that will be displayed on captured image timestamps +.Ve +.SH "CONSTANTS" +.IX Header "CONSTANTS" +The following constants are used by the methods above, but can also be used by user scripts if required. +.IP "\s-1STATE_IDLE\s0 \s-1STATE_PREALARM\s0 \s-1STATE_ALARM\s0 \s-1STATE_ALERT\s0 \s-1STATE_TAPE\s0" 4 +.IX Item "STATE_IDLE STATE_PREALARM STATE_ALARM STATE_ALERT STATE_TAPE" +These constants define the state of the monitor with respect to alarms and events. They are used in the shared_data:state field. +.IP "\s-1ACTION_GET\s0 \s-1ACTION_SET\s0 \s-1ACTION_RELOAD\s0 \s-1ACTION_SUSPEND\s0 \s-1ACTION_RESUME\s0" 4 +.IX Item "ACTION_GET ACTION_SET ACTION_RELOAD ACTION_SUSPEND ACTION_RESUME" +These constants defines the various values that can exist in the shared_data:action field. This is a bitmask which when non-zero defines an action that an executing monitor process should take. \s-1ACTION_GET\s0 requires that the current values of brightness, contrast, colour and hue are taken from the camera and written to the equivalent mapped memory fields. \s-1ACTION_SET\s0 implies the reverse, that the values in mapped memory should be written to the camera. \s-1ACTION_RELOAD\s0 signal that the monitor process should reload itself from the database in case any settings have changed there. \s-1ACTION_SUSPEND\s0 signals that a monitor should stop exaiming images for motion, though other alarms may still occur. \s-1ACTION_RESUME\s0 sigansl that a monitor should resume motion detectiom. +.IP "\s-1TRIGGER_CANCEL\s0 \s-1TRIGGER_ON\s0 \s-1TRIGGER_OFF\s0" 4 +.IX Item "TRIGGER_CANCEL TRIGGER_ON TRIGGER_OFF" +These constants are used in the definition of external triggers. \s-1TRIGGER_CANCEL\s0 is used to indicated that any previous trigger settings should be cancelled, \s-1TRIGGER_ON\s0 signals that an alarm should be created (or continued)) as a result of the current trigger and \s-1TRIGGER_OFF\s0 signals that the trigger should prevent any alarms from being generated. See the trigger methods above for further details. +.SH "EXPORT" +.IX Header "EXPORT" +None by default. +The :constants tag will export the mapped memory constants which mostly define enumerations for the variables held in memory +The :functions tag will export the mapped memory access functions. +The :all tag will export all above symbols. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +http://www.zoneminder.com +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. +.SH "POD ERRORS" +.IX Header "POD ERRORS" +Hey! \fBThe above document had some coding errors, which are explained below:\fR +.IP "Around line 727:" 4 +.IX Item "Around line 727:" +You forgot a '=back' before '=head1' +.IP "Around line 729:" 4 +.IX Item "Around line 729:" +\&'=item' outside of any '=over' +.IP "Around line 801:" 4 +.IX Item "Around line 801:" +You forgot a '=back' before '=head1' +.IP "Around line 836:" 4 +.IX Item "Around line 836:" +\&'=item' outside of any '=over' +.IP "Around line 848:" 4 +.IX Item "Around line 848:" +You forgot a '=back' before '=head1' diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel.3pm new file mode 100644 index 000000000..02f6655b1 --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel.3pm @@ -0,0 +1,169 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Trigger::Channel 3pm" +.TH ZoneMinder::Trigger::Channel 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Database \- Perl extension for blah blah blah +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Database; +\& blah blah blah +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +.PP +Blah blah blah. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in \s-1UNIX\s0), or any relevant external documentation such as RFCs or +standards. +.PP +If you have a mailing list set up for your module, mention it here. +.PP +If you have a web site set up for your module, mention it here. +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel::File.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel::File.3pm new file mode 100644 index 000000000..21489277f --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel::File.3pm @@ -0,0 +1,169 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Trigger::Channel::File 3pm" +.TH ZoneMinder::Trigger::Channel::File 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Database \- Perl extension for blah blah blah +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Database; +\& blah blah blah +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +.PP +Blah blah blah. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in \s-1UNIX\s0), or any relevant external documentation such as RFCs or +standards. +.PP +If you have a mailing list set up for your module, mention it here. +.PP +If you have a web site set up for your module, mention it here. +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel::Handle.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel::Handle.3pm new file mode 100644 index 000000000..b951b38cc --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel::Handle.3pm @@ -0,0 +1,169 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Trigger::Channel::Handle 3pm" +.TH ZoneMinder::Trigger::Channel::Handle 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Database \- Perl extension for blah blah blah +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Database; +\& blah blah blah +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +.PP +Blah blah blah. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in \s-1UNIX\s0), or any relevant external documentation such as RFCs or +standards. +.PP +If you have a mailing list set up for your module, mention it here. +.PP +If you have a web site set up for your module, mention it here. +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel::Inet.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel::Inet.3pm new file mode 100644 index 000000000..8b0507d3a --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel::Inet.3pm @@ -0,0 +1,169 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Trigger::Channel::Inet 3pm" +.TH ZoneMinder::Trigger::Channel::Inet 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Database \- Perl extension for blah blah blah +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Database; +\& blah blah blah +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +.PP +Blah blah blah. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in \s-1UNIX\s0), or any relevant external documentation such as RFCs or +standards. +.PP +If you have a mailing list set up for your module, mention it here. +.PP +If you have a web site set up for your module, mention it here. +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel::Serial.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel::Serial.3pm new file mode 100644 index 000000000..cdbfb2c1f --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel::Serial.3pm @@ -0,0 +1,169 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Trigger::Channel::Serial 3pm" +.TH ZoneMinder::Trigger::Channel::Serial 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Database \- Perl extension for blah blah blah +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Database; +\& blah blah blah +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +.PP +Blah blah blah. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in \s-1UNIX\s0), or any relevant external documentation such as RFCs or +standards. +.PP +If you have a mailing list set up for your module, mention it here. +.PP +If you have a web site set up for your module, mention it here. +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel::Spawning.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel::Spawning.3pm new file mode 100644 index 000000000..413e5262b --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel::Spawning.3pm @@ -0,0 +1,169 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Trigger::Channel::Spawning 3pm" +.TH ZoneMinder::Trigger::Channel::Spawning 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Database \- Perl extension for blah blah blah +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Database; +\& blah blah blah +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +.PP +Blah blah blah. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in \s-1UNIX\s0), or any relevant external documentation such as RFCs or +standards. +.PP +If you have a mailing list set up for your module, mention it here. +.PP +If you have a web site set up for your module, mention it here. +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel::Unix.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel::Unix.3pm new file mode 100644 index 000000000..de4bb999a --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Channel::Unix.3pm @@ -0,0 +1,169 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Trigger::Channel::Unix 3pm" +.TH ZoneMinder::Trigger::Channel::Unix 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Database \- Perl extension for blah blah blah +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Database; +\& blah blah blah +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +.PP +Blah blah blah. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in \s-1UNIX\s0), or any relevant external documentation such as RFCs or +standards. +.PP +If you have a mailing list set up for your module, mention it here. +.PP +If you have a web site set up for your module, mention it here. +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Connection.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Connection.3pm new file mode 100644 index 000000000..019306786 --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Connection.3pm @@ -0,0 +1,169 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Trigger::Connection 3pm" +.TH ZoneMinder::Trigger::Connection 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Database \- Perl extension for blah blah blah +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Database; +\& blah blah blah +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +.PP +Blah blah blah. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in \s-1UNIX\s0), or any relevant external documentation such as RFCs or +standards. +.PP +If you have a mailing list set up for your module, mention it here. +.PP +If you have a web site set up for your module, mention it here. +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Connection::Example.3pm b/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Connection::Example.3pm new file mode 100644 index 000000000..49aaf4a4d --- /dev/null +++ b/scripts/ZoneMinder/blib/man3/ZoneMinder::Trigger::Connection::Example.3pm @@ -0,0 +1,169 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ZoneMinder::Trigger::Connection::Example 3pm" +.TH ZoneMinder::Trigger::Connection::Example 3pm "2012-07-17" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ZoneMinder::Database \- Perl extension for blah blah blah +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 2 +\& use ZoneMinder::Database; +\& blah blah blah +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. +.PP +Blah blah blah. +.SS "\s-1EXPORT\s0" +.IX Subsection "EXPORT" +None by default. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in \s-1UNIX\s0), or any relevant external documentation such as RFCs or +standards. +.PP +If you have a mailing list set up for your module, mention it here. +.PP +If you have a web site set up for your module, mention it here. +.SH "AUTHOR" +.IX Header "AUTHOR" +Philip Coombes, +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2001\-2008 Philip Coombes +.PP +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. diff --git a/scripts/ZoneMinder/blib/script/.exists b/scripts/ZoneMinder/blib/script/.exists new file mode 100644 index 000000000..e69de29bb diff --git a/scripts/ZoneMinder/lib/ZoneMinder.pm b/scripts/ZoneMinder/lib/ZoneMinder.pm new file mode 100644 index 000000000..41c972650 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder.pm @@ -0,0 +1,130 @@ +# ========================================================================== +# +# ZoneMinder Common Module, $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. +# +# ========================================================================== +# +# This module contains the common definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder; + +use 5.006; +use strict; +use warnings; + +require Exporter; +use ZoneMinder::Base qw(:all); +use ZoneMinder::Config qw(:all); +use ZoneMinder::Logger qw(:all); +use ZoneMinder::General qw(:all); +use ZoneMinder::Database qw(:all); +use ZoneMinder::Memory qw(:all); + +our @ISA = qw(Exporter ZoneMinder::Base ZoneMinder::Config ZoneMinder::Logger ZoneMinder::General ZoneMinder::Database ZoneMinder::Memory); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'base' => [ + @ZoneMinder::Base::EXPORT_OK + ], + 'config' => [ + @ZoneMinder::Config::EXPORT_OK + ], + 'debug' => [ + @ZoneMinder::Logger::EXPORT_OK + ], + 'general' => [ + @ZoneMinder::General::EXPORT_OK + ], + 'database' => [ + @ZoneMinder::Database::EXPORT_OK + ], + 'memory' => [ + @ZoneMinder::Memory::EXPORT_OK + ], +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = @{ $EXPORT_TAGS{'all'} }; + +our @EXPORT = ( @EXPORT_OK ); + +our $VERSION = $ZoneMinder::Base::VERSION; + +1; +__END__ + +=head1 NAME + +ZoneMinder - Container module for common ZoneMinder modules + +=head1 SYNOPSIS + + use ZoneMinder; + +=head1 DESCRIPTION + +This module is a convenience container module that uses the +ZoneMinder::Base, ZoneMinder::Common, ZoneMinder::Logger, +ZoneMinder::Database and ZoneMinder::Memory modules. It also +exports by default all symbols provided by the 'all' tag of +each of the modules. + +Thus 'use'ing this module is equivalent to the following + + use ZoneMinder::Base qw(:all); + use ZoneMinder::Config qw(:all); + use ZoneMinder::Logger qw(:all); + use ZoneMinder::Database qw(:all); + use ZoneMinder::Memory qw(:all); + +but is somewhat easier. + +=head2 EXPORT + +All symbols exported by the 'all' tag of each of the included +modules. + +=head1 SEE ALSO + +ZoneMinder::Base, ZoneMinder::Common, ZoneMinder::Logger, +ZoneMinder::Database, ZoneMinder::Memory + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2005 by Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Base.pm b/scripts/ZoneMinder/lib/ZoneMinder/Base.pm new file mode 100644 index 000000000..095ddc37b --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Base.pm @@ -0,0 +1,86 @@ +# ========================================================================== +# +# ZoneMinder Base Module, $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. +# +# ========================================================================== +# +# This module contains the common definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::Base; + +use 5.006; +use strict; +use warnings; + +require Exporter; + +our @ISA = qw(Exporter); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( 'all' => [ qw() ] ); + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = qw(); + +our $VERSION = "1.25.0"; + +1; +__END__ + +=head1 NAME + +ZoneMinder::Base - Base perl module for ZoneMinder + +=head1 SYNOPSIS + + use ZoneMinder::Base; + +=head1 DESCRIPTION + +This module is the base module for the rest of the ZoneMinder modules. It is included by each of the other modules but serves no purpose other than to propagate the perl module version amongst the other modules. You will never need to use this module directly but if you write new ZoneMinder modules they should include it. + +=head2 EXPORT + +None by default. + +=head1 SEE ALSO + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Base.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/Base.pm.in new file mode 100644 index 000000000..37119f725 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Base.pm.in @@ -0,0 +1,86 @@ +# ========================================================================== +# +# ZoneMinder Base Module, $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. +# +# ========================================================================== +# +# This module contains the common definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::Base; + +use 5.006; +use strict; +use warnings; + +require Exporter; + +our @ISA = qw(Exporter); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( 'all' => [ qw() ] ); + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = qw(); + +our $VERSION = "@VERSION@"; + +1; +__END__ + +=head1 NAME + +ZoneMinder::Base - Base perl module for ZoneMinder + +=head1 SYNOPSIS + + use ZoneMinder::Base; + +=head1 DESCRIPTION + +This module is the base module for the rest of the ZoneMinder modules. It is included by each of the other modules but serves no purpose other than to propagate the perl module version amongst the other modules. You will never need to use this module directly but if you write new ZoneMinder modules they should include it. + +=head2 EXPORT + +None by default. + +=head1 SEE ALSO + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Config.pm b/scripts/ZoneMinder/lib/ZoneMinder/Config.pm new file mode 100644 index 000000000..e447f86f9 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Config.pm @@ -0,0 +1,145 @@ +# ========================================================================== +# +# ZoneMinder Config Module, $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. +# +# ========================================================================== +# +# This module contains the common definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::Config; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our @EXPORT_CONFIG; # Get populated by BEGIN + +our %EXPORT_TAGS = ( + 'constants' => [ qw( + ZM_PID + ) ] +); +push( @{$EXPORT_TAGS{config}}, @EXPORT_CONFIG ); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; + +use constant ZM_PID => "/var/run/zm/zm.pid"; # Path to the ZoneMinder run pid file +use constant ZM_CONFIG => "/etc/zm/zm.conf"; # Path to the ZoneMinder config file + +use Carp; + +# Load the config from the database into the symbol table +BEGIN +{ + no strict 'refs'; + + my $config_file = ZM_CONFIG; + ( my $local_config_file = $config_file ) =~ s|^.*/|./|; + if ( -s $local_config_file && -r $local_config_file ) + { + print( STDERR "Warning, overriding installed $local_config_file file with local copy\n" ); + $config_file = $local_config_file; + } + open( CONFIG, "<".$config_file ) or croak( "Can't open config file '$config_file': $!" ); + foreach my $str ( ) + { + next if ( $str =~ /^\s*$/ ); + next if ( $str =~ /^\s*#/ ); + my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*(.+?)\s*$/; + $name =~ tr/a-z/A-Z/; + *{$name} = sub { $value }; + push( @EXPORT_CONFIG, $name ); + } + close( CONFIG ); + + use DBI; + my $dbh = DBI->connect( "DBI:mysql:database=".&ZM_DB_NAME.";host=".&ZM_DB_HOST, &ZM_DB_USER, &ZM_DB_PASS ); + my $sql = "select * from Config"; + my $sth = $dbh->prepare_cached( $sql ) or croak( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or croak( "Can't execute: ".$sth->errstr() ); + while( my $config = $sth->fetchrow_hashref() ) + { + *{$config->{Name}} = sub { $config->{Value} }; + push( @EXPORT_CONFIG, $config->{Name} ); + } + $sth->finish(); + $dbh->disconnect(); +} + +1; +__END__ + +=head1 NAME + +ZoneMinder::Config - ZoneMinder configuration module. + +=head1 SYNOPSIS + + use ZoneMinder::Config qw(:all); + +=head1 DESCRIPTION + +The ZoneMinder::Config module is used to import the ZoneMinder configuration from the database. It will do this at compile time in a BEGIN block and require access to the zm.conf file either in the current directory or in its defined location in order to determine database access details, configuration from this file will also be included. If the :all or :config tags are used then this configuration is exported into the namespace of the calling program or module. + +Once the configuration has been imported then configuration variables are defined as constants and can be accessed directory by name, e.g. + + $lang = ZM_LANG_DEFAULT; + +=head2 EXPORT + +None by default. +The :constants tag will export the ZM_PID constant which details the location of the zm.pid file +The :config tag will export all configuration from the database as well as any from the zm.conf file +The :all tag will export all above symbols. + +=head1 SEE ALSO + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in new file mode 100644 index 000000000..fbd9ea374 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in @@ -0,0 +1,145 @@ +# ========================================================================== +# +# ZoneMinder Config Module, $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. +# +# ========================================================================== +# +# This module contains the common definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::Config; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our @EXPORT_CONFIG; # Get populated by BEGIN + +our %EXPORT_TAGS = ( + 'constants' => [ qw( + ZM_PID + ) ] +); +push( @{$EXPORT_TAGS{config}}, @EXPORT_CONFIG ); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; + +use constant ZM_PID => "@ZM_PID@"; # Path to the ZoneMinder run pid file +use constant ZM_CONFIG => "@ZM_CONFIG@"; # Path to the ZoneMinder config file + +use Carp; + +# Load the config from the database into the symbol table +BEGIN +{ + no strict 'refs'; + + my $config_file = ZM_CONFIG; + ( my $local_config_file = $config_file ) =~ s|^.*/|./|; + if ( -s $local_config_file && -r $local_config_file ) + { + print( STDERR "Warning, overriding installed $local_config_file file with local copy\n" ); + $config_file = $local_config_file; + } + open( CONFIG, "<".$config_file ) or croak( "Can't open config file '$config_file': $!" ); + foreach my $str ( ) + { + next if ( $str =~ /^\s*$/ ); + next if ( $str =~ /^\s*#/ ); + my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*(.+?)\s*$/; + $name =~ tr/a-z/A-Z/; + *{$name} = sub { $value }; + push( @EXPORT_CONFIG, $name ); + } + close( CONFIG ); + + use DBI; + my $dbh = DBI->connect( "DBI:mysql:database=".&ZM_DB_NAME.";host=".&ZM_DB_HOST, &ZM_DB_USER, &ZM_DB_PASS ); + my $sql = "select * from Config"; + my $sth = $dbh->prepare_cached( $sql ) or croak( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or croak( "Can't execute: ".$sth->errstr() ); + while( my $config = $sth->fetchrow_hashref() ) + { + *{$config->{Name}} = sub { $config->{Value} }; + push( @EXPORT_CONFIG, $config->{Name} ); + } + $sth->finish(); + $dbh->disconnect(); +} + +1; +__END__ + +=head1 NAME + +ZoneMinder::Config - ZoneMinder configuration module. + +=head1 SYNOPSIS + + use ZoneMinder::Config qw(:all); + +=head1 DESCRIPTION + +The ZoneMinder::Config module is used to import the ZoneMinder configuration from the database. It will do this at compile time in a BEGIN block and require access to the zm.conf file either in the current directory or in its defined location in order to determine database access details, configuration from this file will also be included. If the :all or :config tags are used then this configuration is exported into the namespace of the calling program or module. + +Once the configuration has been imported then configuration variables are defined as constants and can be accessed directory by name, e.g. + + $lang = ZM_LANG_DEFAULT; + +=head2 EXPORT + +None by default. +The :constants tag will export the ZM_PID constant which details the location of the zm.pid file +The :config tag will export all configuration from the database as well as any from the zm.conf file +The :all tag will export all above symbols. + +=head1 SEE ALSO + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/ConfigAdmin.pm b/scripts/ZoneMinder/lib/ZoneMinder/ConfigAdmin.pm new file mode 100644 index 000000000..8ee1ec82b --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/ConfigAdmin.pm @@ -0,0 +1,213 @@ +# ========================================================================== +# +# ZoneMinder Config Admin Module, $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. +# +# ========================================================================== +# +# This module contains the debug definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::ConfigAdmin; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'functions' => [ qw( + loadConfigFromDB + saveConfigToDB + ) ] +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'functions'} } ); + +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Configuration Administration +# +# ========================================================================== + +use ZoneMinder::Config qw(:all); +use ZoneMinder::ConfigData qw(:all); + +use Carp; + +sub loadConfigFromDB +{ + print( "Loading config from DB\n" ); + my $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS ); + + if ( !$dbh ) + { + print( "Error: unable to load options from database: $DBI::errstr\n" ); + return( 0 ); + } + my $sql = "select * from Config"; + my $sth = $dbh->prepare_cached( $sql ) or croak( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or croak( "Can't execute: ".$sth->errstr() ); + my $option_count = 0; + while( my $config = $sth->fetchrow_hashref() ) + { + my ( $name, $value ) = ( $config->{Name}, $config->{Value} ); + #print( "Name = '$name'\n" ); + my $option = $options_hash{$name}; + if ( !$option ) + { + warn( "No option '$name' found, removing" ); + next; + } + #next if ( $option->{category} eq 'hidden' ); + if ( defined($value) ) + { + if ( $option->{type} == $types{boolean} ) + { + $option->{value} = $value?"yes":"no"; + } + else + { + $option->{value} = $value; + } + } + $option_count++;; + } + $sth->finish(); + $dbh->disconnect(); + return( $option_count ); +} + +sub saveConfigToDB +{ + print( "Saving config to DB\n" ); + my $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS ); + + if ( !$dbh ) + { + print( "Error: unable to save options to database: $DBI::errstr\n" ); + return( 0 ); + } + my $sql = "delete from Config"; + my $res = $dbh->do( $sql ) or croak( "Can't do '$sql': ".$dbh->errstr() ); + + $sql = "replace into Config set Id = ?, Name = ?, Value = ?, Type = ?, DefaultValue = ?, Hint = ?, Pattern = ?, Format = ?, Prompt = ?, Help = ?, Category = ?, Readonly = ?, Requires = ?"; + my $sth = $dbh->prepare_cached( $sql ) or croak( "Can't prepare '$sql': ".$dbh->errstr() ); + foreach my $option ( @options ) + { + #next if ( $option->{category} eq 'hidden' ); + #print( $option->{name}."\n" ) if ( !$option->{category} ); + $option->{db_type} = $option->{type}->{db_type}; + $option->{db_hint} = $option->{type}->{hint}; + $option->{db_pattern} = $option->{type}->{pattern}; + $option->{db_format} = $option->{type}->{format}; + if ( $option->{db_type} eq "boolean" ) + { + $option->{db_value} = ($option->{value} eq "yes")?"1":"0"; + } + else + { + $option->{db_value} = $option->{value}; + } + if ( my $requires = $option->{requires} ) + { + $option->{db_requires} = join( ";", map { my $value = $_->{value}; $value = ($value eq "yes")?1:0 if ( $options_hash{$_->{name}}->{db_type} eq "boolean" ); ( "$_->{name}=$value" ) } @$requires ); + } + else + { + } + my $res = $sth->execute( $option->{id}, $option->{name}, $option->{db_value}, $option->{db_type}, $option->{default}, $option->{db_hint}, $option->{db_pattern}, $option->{db_format}, $option->{description}, $option->{help}, $option->{category}, $option->{readonly}?1:0, $option->{db_requires} ) or croak( "Can't execute: ".$sth->errstr() ); + } + $sth->finish(); + $dbh->disconnect(); +} + +1; +__END__ + +=head1 NAME + +ZoneMinder::ConfigAdmin - ZoneMinder Configuration Administration module + +=head1 SYNOPSIS + + use ZoneMinder::ConfigAdmin; + use ZoneMinder::ConfigAdmin qw(:all); + + loadConfigFromDB(); + saveConfigToDB(); + +=head1 DESCRIPTION + +The ZoneMinder:ConfigAdmin module contains the master definition of the ZoneMinder configuration options as well as helper methods. This module is intended for specialist confguration management and would not normally be used by end users. + +The configuration held in this module, which was previously in zmconfig.pl, includes the name, default value, description, help text, type and category for each option, as well as a number of additional fields in a small number of cases. + +=head1 METHODS + +=over 4 + +=item loadConfigFromDB (); + +Loads existing configuration from the database (if any) and merges it with the definitions held in this module. This results in the merging of any new configuration and the removal of any deprecated configuration while preserving the existing values of every else. + +=item saveConfigToDB (); + +Saves configuration held in memory to the database. The act of loading and saving configuration is a convenient way to ensure that the configuration held in the database corresponds with the most recent definitions and that all components are using the same set of configuration. + +=head2 EXPORT + +None by default. +The :data tag will export the various configuration data structures +The :functions tag will export the helper functions. +The :all tag will export all above symbols. + + +=head1 SEE ALSO + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm new file mode 100644 index 000000000..e108d8687 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm @@ -0,0 +1,2056 @@ +# ========================================================================== +# +# ZoneMinder Config Data Module, $Date: 2011-01-20 18:49:42 +0000 (Thu, 20 Jan 2011) $, $Revision: 3230 $ +# 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. +# +# ========================================================================== +# +# This module contains the debug definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::ConfigData; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'data' => [ qw( + %types + @options + %options_hash + ) ] +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'data'} } ); + +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Configuration Data +# +# ========================================================================== + +use Carp; + +our $configInitialised = 0; + +sub INIT +{ + initialiseConfig(); +} + +# Types +our %types = +( + string => { db_type=>"string", hint=>"string", pattern=>qr|^(.+)$|, format=>q( $1 ) }, + alphanum => { db_type=>"string", hint=>"alphanumeric", pattern=>qr|^([a-zA-Z0-9-_]+)$|, format=>q( $1 ) }, + text => { db_type=>"text", hint=>"free text", pattern=>qr|^(.+)$|, format=>q( $1 ) }, + boolean => { db_type=>"boolean", hint=>"yes|no", pattern=>qr|^([yn])|i, check=>q( $1 ), format=>q( ($1 =~ /^y/) ? "yes" : "no" ) }, + integer => { db_type=>"integer", hint=>"integer", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + decimal => { db_type=>"decimal", hint=>"decimal", pattern=>qr|^(\d+(?:\.\d+)?)$|, format=>q( $1 ) }, + hexadecimal => { db_type=>"hexadecimal", hint=>"hexadecimal", pattern=>qr|^(?:0x)?([0-9a-f]{1,8})$|, format=>q( "0x".$1 ) }, + tristate => { db_type=>"string", hint=>"auto|yes|no", pattern=>qr|^([ayn])|i, check=>q( $1 ), format=>q( ($1 =~ /^y/) ? "yes" : ($1 =~ /^n/ ? "no" : "auto" ) ) }, + abs_path => { db_type=>"string", hint=>"/absolute/path/to/somewhere", pattern=>qr|^((?:/[^/]*)+?)/?$|, format=>q( $1 ) }, + rel_path => { db_type=>"string", hint=>"relative/path/to/somewhere", pattern=>qr|^((?:[^/].*)?)/?$|, format=>q( $1 ) }, + directory => { db_type=>"string", hint=>"directory", pattern=>qr|^([a-zA-Z0-9-_.]+)$|, format=>q( $1 ) }, + file => { db_type=>"string", hint=>"filename", pattern=>qr|^([a-zA-Z0-9-_.]+)$|, format=>q( $1 ) }, + hostname => { db_type=>"string", hint=>"host.your.domain", pattern=>qr|^([a-zA-Z0-9_.-]+)$|, format=>q( $1 ) }, + url => { db_type=>"string", hint=>"http://host.your.domain/", pattern=>qr|^(?:http://)?(.+)$|, format=>q( "http://".$1 ) }, + email => { db_type=>"string", hint=>"your.name\@your.domain", pattern=>qr|^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$|, format=>q( $1\@$2 ) }, +); + +our @options = +( + { + name => "ZM_LANG_DEFAULT", + default => "en_gb", + description => "Default language used by web interface", + help => "ZoneMinder allows the web interface to use languages other than English if the appropriate language file has been created and is present. This option allows you to change the default language that is used from the shipped language, British English, to another language", + type => $types{string}, + category => "system", + }, + { + name => "ZM_OPT_USE_AUTH", + default => "no", + description => "Authenticate user logins to ZoneMinder", + help => "ZoneMinder can run in two modes. The simplest is an entirely unauthenticated mode where anyone can access ZoneMinder and perform all tasks. This is most suitable for installations where the web server access is limited in other ways. The other mode enables user accounts with varying sets of permissions. Users must login or authenticate to access ZoneMinder and are limited by their defined permissions.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_AUTH_TYPE", + default => "builtin", + description => "What is used to authenticate ZoneMinder users", + help => "ZoneMinder can use two methods to authenticate users when running in authenticated mode. The first is a builtin method where ZoneMinder provides facilities for users to log in and maintains track of their identity. The second method allows interworking with other methods such as http basic authentication which passes an independently authentication 'remote' user via http. In this case ZoneMinder would use the supplied user without additional authentication provided such a user is configured ion ZoneMinder.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" } ], + type => { db_type=>"string", hint=>"builtin|remote", pattern=>qr|^([br])|i, format=>q( $1 =~ /^b/ ? "builtin" : "remote" ) }, + category => "system", + }, + { + name => "ZM_AUTH_RELAY", + default => "hashed", + description => "Method used to relay authentication information", + help => "When ZoneMinder is running in authenticated mode it can pass user details between the web pages and the back end processes. There are two methods for doing this. This first is to use a time limited hashed string which contains no direct username or password details, the second method is to pass the username and passwords around in plaintext. This method is not recommend except where you do not have the md5 libraries available on your system or you have a completely isolated system with no external access. You can also switch off authentication relaying if your system is isolated in other ways.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" } ], + type => { db_type=>"string", hint=>"hashed|plain|none", pattern=>qr|^([hpn])|i, format=>q( ($1 =~ /^h/) ? "hashed" : ($1 =~ /^p/ ? "plain" : "none" ) ) }, + category => "system", + }, + { + name => "ZM_AUTH_HASH_SECRET", + default => "...Change me to something unique...", + description => "Secret for encoding hashed authentication information", + help => "When ZoneMinder is running in hashed authenticated mode it is necessary to generate hashed strings containing encrypted sensitive information such as usernames and password. Although these string are reasonably secure the addition of a random secret increases security substantially.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" }, { name=>"ZM_AUTH_RELAY", value=>"hashed" } ], + type => $types{string}, + category => "system", + }, + { + name => "ZM_AUTH_HASH_IPS", + default => "yes", + description => "Include IP addresses in the authentication hash", + help => "When ZoneMinder is running in hashed authenticated mode it can optionally include the requesting IP address in the resultant hash. This adds an extra level of security as only requests from that address may use that authentication key. However in some circumstances, such as access over mobile networks, the requesting address can change for each request which will cause most requests to fail. This option allows you to control whether IP addresses are included in the authentication hash on your system. If you experience intermitent problems with authentication, switching this option off may help.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" }, { name=>"ZM_AUTH_RELAY", value=>"hashed" } ], + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_AUTH_HASH_LOGINS", + default => "no", + description => "Allow login by authentication hash", + help => "The normal process for logging into ZoneMinder is via the login screen with username and password. In some circumstances it may be desirable to allow access directly to one or more pages, for instance from a third party application. If this option is enabled then adding an 'auth' parameter to any request will include a shortcut login bypassing the login screen, if not already logged in. As authentication hashes are time and, optionally, IP limited this can allow short-term access to ZoneMinder screens from other web pages etc. In order to use this the calling application will hae to generate the authentication hash itself and ensure it is valid. If you use this option you should ensure that you have modified the ZM_AUTH_HASH_SECRET to somethign unique to your system.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" }, { name=>"ZM_AUTH_RELAY", value=>"hashed" } ], + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_DIR_EVENTS", + default => "events", + description => "Directory where events are stored", + help => "This is the path to the events directory where all the event images and other miscellaneous files are stored. It is normally given as a subdirectory of the web directory you have specified earlier however if disk space is tight it can reside on another partition in which case you should create a link from that area to the path you give here.", + type => $types{directory}, + category => "paths", + }, + { + name => "ZM_USE_DEEP_STORAGE", + default => "yes", + description => "Use a deep filesystem hierarchy for events", + help => "Traditionally ZoneMinder stores all events for a monitor in one directory for that monitor. This is simple and efficient except when you have very large amounts of events. Some filesystems are unable to store more than 32k files in one directory and even without this limitation, large numbers of files in a directory can slow creation and deletion of files. This option allows you to select an alternate method of storing events by year/month/day/hour/min/second which has the effect of separating events out into more directories, resulting in less per directory, and also making it easier to manually navigate to any events that may have happened at a particular time or date.", + type => $types{boolean}, + category => "paths", + }, + { + name => "ZM_DIR_IMAGES", + default => "images", + description => "Directory where the images that the ZoneMinder client generates are stored", + help => "ZoneMinder generates a myriad of images, mosty of which are associated with events. For those that aren't this is where they go.", + type => $types{directory}, + category => "paths", + }, + { + name => "ZM_DIR_SOUNDS", + default => "sounds", + description => "Directory to the sounds that the ZoneMinder client can use", + help => "ZoneMinder can optionally play a sound file when an alarm is detected. This indicates where (relative to the web root) to look for this file.", + type => $types{directory}, + category => "paths", + }, + { + name => "ZM_PATH_ZMS", + default => "/cgi-bin/nph-zms", + description => "Web path to zms streaming server", + help => "The ZoneMinder streaming server is required to send streamed images to your browser. It will be installed into the cgi-bin path given at configuration time. This option determines what the web path to the server is rather than the local path on your machine. Ordinarily the streaming server runs in parser-header mode however if you experience problems with streaming you can change this to non-parsed-header (nph) mode by changing 'zms' to 'nph-zms'.", + type => $types{rel_path}, + category => "paths", + }, + { + name => "ZM_COLOUR_JPEG_FILES", + default => "yes", + description => "Colourise greyscale JPEG files", + help => "Cameras that capture in greyscale can write their captured images to jpeg files with a corresponding greyscale colour space. This saves a small amount of disk space over colour ones. However some tools such as ffmpeg either fail to work with this colour space or have to convert it beforehand. Setting this option to yes uses up a little more space but makes creation of MPEG files much faster.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_ADD_JPEG_COMMENTS", + default => "no", + description => "Add jpeg timestamp annotations as file header comments", + help => "JPEG files may have a number of extra fields added to the file header. The comment field may have any kind of text added. This options allows you to have the same text that is used to annotate the image additionally included as a file header comment. If you archive event images to other locations this may help you locate images for particular events or times if you use software that can read comment headers.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_JPEG_FILE_QUALITY", + default => "70", + description => "Set the JPEG quality setting for the saved event files (1-100)", + help => "When ZoneMinder detects an event it will save the images associated with that event to files. These files are in the JPEG format and can be viewed or streamed later. This option specifies what image quality should be used to save these files. A higher number means better quality but less compression so will take up more disk space and take longer to view over a slow connection. By contrast a low number means smaller, quicker to view, files but at the price of lower quality images. This setting applies to all images written except if the capture image has caused an alarm and the alarm file quality option is set at a higher value when that is used instead.", + type => $types{integer}, + category => "images", + }, + { + name => "ZM_JPEG_ALARM_FILE_QUALITY", + default => "0", + description => "Set the JPEG quality setting for the saved event files during an alarm (1-100)", + help => "This value is equivalent to the regular jpeg file quality setting above except that it only applies to images saved while in an alarm state and then only if this value is set to a higher quality setting than the ordinary file setting. If set to a lower value then it is ignored. Thus leaving it at the default of 0 effectively means to use the regular file quality setting for all saved images. This is to prevent acccidentally saving important images at a worse quality setting.", + type => $types{integer}, + category => "images", + }, + # Deprecated, now stream quality + { + name => "ZM_JPEG_IMAGE_QUALITY", + default => "70", + description => "Set the JPEG quality setting for the streamed 'live' images (1-100)", + help => "When viewing a 'live' stream for a monitor ZoneMinder will grab an image from the buffer and encode it into JPEG format before sending it. This option specifies what image quality should be used to encode these images. A higher number means better quality but less compression so will take longer to view over a slow connection. By contrast a low number means quicker to view images but at the price of lower quality images. This option does not apply when viewing events or still images as these are usually just read from disk and so will be encoded at the quality specified by the previous options.", + type => $types{integer}, + category => "hidden", + }, + { + name => "ZM_JPEG_STREAM_QUALITY", + default => "70", + description => "Set the JPEG quality setting for the streamed 'live' images (1-100)", + help => "When viewing a 'live' stream for a monitor ZoneMinder will grab an image from the buffer and encode it into JPEG format before sending it. This option specifies what image quality should be used to encode these images. A higher number means better quality but less compression so will take longer to view over a slow connection. By contrast a low number means quicker to view images but at the price of lower quality images. This option does not apply when viewing events or still images as these are usually just read from disk and so will be encoded at the quality specified by the previous options.", + type => $types{integer}, + category => "images", + }, + { + name => "ZM_MPEG_TIMED_FRAMES", + default => "yes", + description => "Tag video frames with a timestamp for more realistic streaming", + help => "When using streamed MPEG based video, either for live monitor streams or events, ZoneMinder can send the streams in two ways. If this option is selected then the timestamp for each frame, taken from it's capture time, is included in the stream. This means that where the frame rate varies, for instance around an alarm, the stream will still maintain it's 'real' timing. If this option is not selected then an approximate frame rate is calculated and that is used to schedule frames instead. This option should be selected unless you encounter problems with your preferred streaming method.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_MPEG_LIVE_FORMAT", + default => "swf", + description => "What format 'live' video streams are played in", + help => "When using MPEG mode ZoneMinder can output live video. However what formats are handled by the browser varies greatly between machines. This option allows you to specify a video format using a file extension format, so you would just enter the extension of the file type you would like and the rest is determined from that. The default of 'asf' works well under Windows with Windows Media Player but I'm currently not sure what, if anything, works on a Linux platform. If you find out please let me know! If this option is left blank then live streams will revert to being in motion jpeg format", + type => $types{string}, + category => "images", + }, + { + name => "ZM_MPEG_REPLAY_FORMAT", + default => "swf", + description => "What format 'replay' video streams are played in", + help => "When using MPEG mode ZoneMinder can replay events in encoded video format. However what formats are handled by the browser varies greatly between machines. This option allows you to specify a video format using a file extension format, so you would just enter the extension of the file type you would like and the rest is determined from that. The default of 'asf' works well under Windows with Windows Media Player and 'mpg', or 'avi' etc should work under Linux. If you know any more then please let me know! If this option is left blank then live streams will revert to being in motion jpeg format", + type => $types{string}, + category => "images", + }, + { + name => "ZM_RAND_STREAM", + default => "yes", + description => "Add a random string to prevent caching of streams", + help => "Some browsers can cache the streams used by ZoneMinder. In order to prevent his a harmless random string can be appended to the url to make each invocation of the stream appear unique.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_OPT_CAMBOZOLA", + default => "no", + description => "Is the (optional) cambozola java streaming client installed", + help => "Cambozola is a handy low fat cheese flavoured Java applet that ZoneMinder uses to view image streams on browsers such as Internet Explorer that don't natively support this format. If you use this browser it is highly recommended to install this from http://www.charliemouse.com/code/cambozola/ however if it is not installed still images at a lower refresh rate can still be viewed.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_PATH_CAMBOZOLA", + default => "cambozola.jar", + description => "Web path to (optional) cambozola java streaming client", + help => "Cambozola is a handy low fat cheese flavoured Java applet that ZoneMinder uses to view image streams on browsers such as Internet Explorer that don't natively support this format. If you use this browser it is highly recommended to install this from http://www.charliemouse.com/code/cambozola/ however if it is not installed still images at a lower refresh rate can still be viewed. Leave this as 'cambozola.jar' if cambozola is installed in the same directory as the ZoneMinder web client files.", + requires => [ { name=>"ZM_OPT_CAMBOZOLA", value=>"yes" } ], + type => $types{rel_path}, + category => "images", + }, + { + name => "ZM_RELOAD_CAMBOZOLA", + default => "0", + description => "After how many seconds should Cambozola be reloaded in live view", + help => "Cambozola allows for the viewing of streaming MJPEG however it caches the entire stream into cache space on the computer, setting this to a number > 0 will cause it to automatically reload after that many seconds to avoid filling up a hard drive.", + type => $types{integer}, + category => "images", + }, + { + name => "ZM_TIMESTAMP_ON_CAPTURE", + default => "yes", + description => "Timestamp images as soon as they are captured", + help => "ZoneMinder can add a timestamp to images in two ways. The default method, when this option is set, is that each image is timestamped immediately when captured and so the image held in memory is marked right away. The second method does not timestamp the images until they are either saved as part of an event or accessed over the web. The timestamp used in both methods will contain the same time as this is preserved along with the image. The first method ensures that an image is timestamped regardless of any other circumstances but will result in all images being timestamped even those never saved or viewed. The second method necessitates that saved images are copied before being saved otherwise two timestamps perhaps at different scales may be applied. This has the (perhaps) desirable side effect that the timestamp is always applied at the same resolution so an image that has scaling applied will still have a legible and correctly scaled timestamp.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_CPU_EXTENSIONS", + default => "yes", + description => "Use advanced CPU extensions to increase performance", + help => "When advanced processor extensions such as SSE2 or SSSE3 are available, ZoneMinder can use them, which should increase performance and reduce system load. Enabling this option on processors that do not support the advanced processors extensions used by ZoneMinder is harmless and will have no effect.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_FAST_IMAGE_BLENDS", + default => "yes", + description => "Use a fast algorithm to blend the reference image", + help => "To detect alarms ZoneMinder needs to blend the captured image with the stored reference image to update it for comparison with the next image. The reference blend percentage specified for the monitor controls how much the new image affects the reference image. There are two methods that are available for this. If this option is set then fast calculation which does not use any multiplication or division is used. This calculation is extremely fast, however it limits the possible blend percentages to 50%, 25%, 12.5%, 6.25%, 3.25% and 1.5%. Any other blend percentage will be rounded to the nearest possible one. The alternative is to switch this option off and use standard blending instead, which is slower.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_OPT_ADAPTIVE_SKIP", + default => "yes", + description => "Should frame analysis try and be efficient in skipping frames", + help => "In previous versions of ZoneMinder the analysis daemon would attempt to keep up with the capture daemon by processing the last captured frame on each pass. This would sometimes have the undesirable side-effect of missing a chunk of the initial activity that caused the alarm because the pre-alarm frames would all have to be written to disk and the database before processing the next frame, leading to some delay between the first and second event frames. Setting this option enables a newer adaptive algorithm where the analysis daemon attempts to process as many captured frames as possible, only skipping frames when in danger of the capture daemon overwriting yet to be processed frames. This skip is variable depending on the size of the ring buffer and the amount of space left in it. Enabling this option will give you much better coverage of the beginning of alarms whilst biasing out any skipped frames towards the middle or end of the event. However you should be aware that this will have the effect of making the analysis daemon run somewhat behind the capture daemon during events and for particularly fast rates of capture it is possible for the adaptive algorithm to be overwhelmed and not have time to react to a rapid build up of pending frames and thus for a buffer overrun condition to occur.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_BLEND_ALARMED_IMAGES", + default => "yes", + description => "Blend alarmed images to update the reference image", + help => "To detect alarms ZoneMinder compares an image with a reference image which is formed from a composite of the previous images. This option determines whether images that cause events are included in this process. Doing so may increase the precision of the alarmed region but can cause problems if wholescale lighting changes cause alarms as this would not get fed back into the image and an alarm may persist indefinately. A better way to achive the same effect in most cases is to lower substantially the reference blend percentage in specific monitors.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_MAX_SUSPEND_TIME", + default => "30", + description => "Maximum time that a monitor may have motion detection suspended", + help => "ZoneMinder allows monitors to have motion detection to be suspended, for instance while panning a camera. Ordinarily this relies on the operator resuming motion detection afterwards as failure to do so can leave a monitor in a permanently suspended state. This setting allows you to set a maximum time which a camera may be suspended for before it automatically resumes motion detection. This time can be extended by subsequent suspend indications after the first so continuous camera movement will also occur while the monitor is suspended.", + type => $types{integer}, + category => "config", + }, + # Deprecated, really no longer necessary + { + name => "ZM_OPT_REMOTE_CAMERAS", + default => "no", + description => "Are you going to use remote/networked cameras", + help => "ZoneMinder can work with both local cameras, ie. those attached physically to your computer and remote or network cameras. If you will be using networked cameras select this option.", + type => $types{boolean}, + category => "hidden", + }, + # Deprecated, now set on a per monitor basis using the Method field + { + name => "ZM_NETCAM_REGEXPS", + default => "yes", + description => "Use regular expression matching with network cameras", + help => "Traditionally ZoneMinder has used complex regular regular expressions to handle the multitude of formats that network cameras produce. In versions from 1.21.1 the default is to use a simpler and faster built in pattern matching methodology. This works well with most networks cameras but if you have problems you can try the older, but more flexible, regular expression based method by selecting this option. Note, to use this method you must have libpcre installed on your system.", + requires => [ { name => "ZM_OPT_REMOTE_CAMERAS", value => "yes" } ], + type => $types{boolean}, + category => "hidden", + }, + { + name => "ZM_HTTP_VERSION", + default => "1.1", + description => "The version of HTTP that ZoneMinder will use to connect", + help => "ZoneMinder can communicate with network cameras using either of the HTTP/1.1 or HTTP/1.0 standard. A server will normally fall back to the version it supports iwht no problem so this should usually by left at the default. However it can be changed to HTTP/1.0 if necessary to resolve particular issues.", + type => { db_type=>"string", hint=>"1.1|1.0", pattern=>qr|^(1\.[01])$|, format=>q( $1?$1:"" ) }, + category => "network", + }, + { + name => "ZM_HTTP_UA", + default => "ZoneMinder", + description => "The user agent that ZoneMinder uses to identify itself", + help => "When ZoneMinder communicates with remote cameras it will identify itself using this string and it's version number. This is normally sufficient, however if a particular cameras expects only to communicate with certain browsers then this can be changed to a different string identifying ZoneMinder as Internet Explorer or Netscape etc.", + type => $types{string}, + category => "network", + }, + { + name => "ZM_HTTP_TIMEOUT", + default => "2500", + description => "How long ZoneMinder waits before giving up on images (milliseconds)", + help => "When retrieving remote images ZoneMinder will wait for this length of time before deciding that an image is not going to arrive and taking steps to retry. This timeout is in milliseconds (1000 per second) and will apply to each part of an image if it is not sent in one whole chunk.", + type => $types{integer}, + category => "network", + }, + { + name => "ZM_MIN_RTP_PORT", + default => "40200", + description => "Minimum port that ZoneMinder will listen for RTP traffic on", + help => "When ZoneMinder communicates with MPEG4 capable cameras using RTP with the unicast method it must open ports for the camera to connect back to for control and streaming purposes. This setting specifies the minimum port number that ZoneMinder will use. Ordinarily two adjacent ports are used for each camera, one for control packets and one for data packets. This port should be set to an even number, you may also need to open up a hole in your firewall to allow cameras to connect back if you wish to use unicasting.", + type => $types{integer}, + category => "network", + }, + { + name => "ZM_MAX_RTP_PORT", + default => "40499", + description => "Maximum port that ZoneMinder will listen for RTP traffic on", + help => "When ZoneMinder communicates with MPEG4 capable cameras using RTP with the unicast method it must open ports for the camera to connect back to for control and streaming purposes. This setting specifies the maximum port number that ZoneMinder will use. Ordinarily two adjacent ports are used for each camera, one for control packets and one for data packets. This port should be set to an even number, you may also need to open up a hole in your firewall to allow cameras to connect back if you wish to use unicasting. You should also ensure that you have opened up at least two ports for each monitor that will be connecting to unicasting network cameras.", + type => $types{integer}, + category => "network", + }, + { + name => "ZM_OPT_FFMPEG", + default => "yes", + description => "Is the ffmpeg video encoder/decoder installed", + help => "ZoneMinder can optionally encode a series of video images into an MPEG encoded movie file for viewing, downloading or storage. This option allows you to specify whether you have the ffmpeg tools installed. Note that creating MPEG files can be fairly CPU and disk intensive and is not a required option as events can still be reviewed as video streams without it.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_PATH_FFMPEG", + default => "/usr/bin/ffmpeg", + description => "Path to (optional) ffmpeg mpeg encoder", + help => "This path should point to where ffmpeg has been installed.", + requires => [ { name=>"ZM_OPT_FFMPEG", value=>"yes" } ], + type => $types{abs_path}, + category => "images", + }, + { + name => "ZM_FFMPEG_INPUT_OPTIONS", + default => "", + description => "Additional input options to ffmpeg", + help => "Ffmpeg can take many options on the command line to control the quality of video produced. This option allows you to specify your own set that apply to the input to ffmpeg (options that are given before the -i option). Check the ffmpeg documentation for a full list of options which may be used here.", + requires => [ { name=>"ZM_OPT_FFMPEG", value=>"yes" } ], + type => $types{string}, + category => "images", + }, + { + name => "ZM_FFMPEG_OUTPUT_OPTIONS", + default => "-r 25", + description => "Additional output options to ffmpeg", + help => "Ffmpeg can take many options on the command line to control the quality of video produced. This option allows you to specify your own set that apply to the output from ffmpeg (options that are given after the -i option). Check the ffmpeg documentation for a full list of options which may be used here. The most common one will often be to force an output frame rate supported by the video encoder.", + requires => [ { name=>"ZM_OPT_FFMPEG", value=>"yes" } ], + type => $types{string}, + category => "images", + }, + { + name => "ZM_FFMPEG_FORMATS", + default => "mpg mpeg wmv asf avi* mov swf 3gp**", + description => "Formats to allow for ffmpeg video generation", + help => "Ffmpeg can generate video in many different formats. This option allows you to list the ones you want to be able to select. As new formats are supported by ffmpeg you can add them here and be able to use them immediately. Adding a '*' after a format indicates that this will be the default format used for web video, adding '**' defines the default format for phone video.", + requires => [ { name=>"ZM_OPT_FFMPEG", value=>"yes" } ], + type => $types{string}, + category => "images", + }, + { + name => "ZM_LOG_LEVEL_SYSLOG", + default => "0", + description => "Save logging output to the system log", + help => "ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output that goes to the system log. ZoneMinder binaries have always logged to the system log but now scripts and web logging is also included. To preserve the previous behaviour you should ensure this value is set to Info or Warning. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance. If you want debug you will also need to set a level and component below", + type => { db_type=>"integer", hint=>"None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_LEVEL_FILE", + default => "-5", + description => "Save logging output to component files", + help => "ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output that goes to individual log files written by specific components. This is how logging worked previously and although useful for tracking down issues in specific components it also resulted in many disparate log files. To preserve this behaviour you should ensure this value is set to Info or Warning. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance though file output has less impact than the other options. If you want debug you will also need to set a level and component below", + type => { db_type=>"integer", hint=>"None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_LEVEL_WEBLOG", + default => "-5", + description => "Save logging output to the weblog", + help => "ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output from the web interface that goes to the httpd error log. Note that only web logging from PHP and JavaScript files is included and so this option is really only useful for investigating specific issues with those components. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance. If you want debug you will also need to set a level and component below", + type => { db_type=>"integer", hint=>"None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_LEVEL_DATABASE", + default => "0", + description => "Save logging output to the database", + help => "ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output that is written to the database. This is a new option which can make viewing logging output easier and more intuitive and also makes it easier to get an overall impression of how the system is performing. If you have a large or very busy system then it is possible that use of this option may slow your system down if the table becomes very large. Ensure you use the LOG_DATABASE_LIMIT option to keep the table to a manageable size. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance. If you want debug you will also need to set a level and component below", + type => { db_type=>"integer", hint=>"None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_DATABASE_LIMIT", + default => "7 day", + description => "Maximum number of log entries to retain", + help => "If you are using database logging then it is possible to quickly build up a large number of entries in the Logs table. This option allows you to specify how many of these entries are kept. If you set this option to a number greater than zero then that number is used to determine the maximum number of rows, less than or equal to zero indicates no limit and is not recommended. You can also set this value to time values such as ' day' which will limit the log entries to those newer than that time. You can specify 'hour', 'day', 'week', 'month' and 'year', note that the values should be singular (no 's' at the end). The Logs table is pruned periodically so it is possible for more than the expected number of rows to be present briefly in the meantime.", + type => $types{string}, + category => "logging", + }, + { + name => "ZM_LOG_DEBUG", + default => "no", + description => "Switch debugging on", + help => "ZoneMinder components usually support debug logging available to help with diagnosing problems. Binary components have several levels of debug whereas more other components have only one. Normally this is disabled to minimise performance penalties and avoid filling logs too quickly. This option lets you switch on other options that allow you to configure additional debug information to be output. Components will pick up this instruction when they are restarted.", + type => $types{boolean}, + category => "logging", + }, + { + name => "ZM_LOG_DEBUG_TARGET", + default => "", + description => "What components should have extra debug enabled", + help => "There are three scopes of debug available. Leaving this option blank means that all components will use extra debug (not recommended). Setting this option to '_', e.g. _zmc, will limit extra debug to that component only. Setting this option to '__', e.g. '_zmc_m1' will limit extra debug to that instance of the component only. This is ordinarily what you probably want to do. To debug scripts use their names without the .pl extension, e.g. '_zmvideo' and to debug issues with the web interface use '_web'. You can specify multiple targets by separating them with '|' characters.", + requires => [ { name => "ZM_LOG_DEBUG", value => "yes" } ], + type => $types{string}, + category => "logging", + }, + { + name => "ZM_LOG_DEBUG_LEVEL", + default => 1, + description => "What level of extra debug should be enabled", + help => "There are 9 levels of debug available, with higher numbers being more debug and level 0 being no debug. However not all levels are used by all components. Also if there is debug at a high level it is usually likely to be output at such a volume that it may obstruct normal operation. For this reason you should set the level carefully and cautiously until the degree of debug you wish to see is present. Scripts and the web interface only have one level so this is an on/off type option for them.", + requires => [ { name => "ZM_LOG_DEBUG", value => "yes" } ], + type => { db_type=>"integer", hint=>"1|2|3|4|5|6|7|8|9", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_DEBUG_FILE", + default => "/tmp/zm/zm_debug.log+", + description => "Where extra debug is output to", + help => "This option allows you to specify a different target for debug output. All components have a default log file which will norally be in /tmp or /var/log and this is where debug will be written to if this value is empty. Adding a path here will temporarily redirect debug, and other logging output, to this file. This option is a simple filename and you are debugging several components then they will all try and write to the same file with undesirable consequences. Appending a '+' to the filename will cause the file to be created with a '.' suffix containing your process id. In this way debug from each run of a component is kept separate. This is the recommended setting as it will also prevent subsequent runs from overwriting the same log. You should ensure that permissions are set up to allow writing to the file and directory specified here.", + requires => [ { name => "ZM_LOG_DEBUG", value => "yes" } ], + type => $types{string}, + category => "logging", + }, + { + name => "ZM_LOG_CHECK_PERIOD", + default => "900", + description => "Time period used when calculating overall system health", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to indicate what period of historical events are used in this calculation. This value is expressed in seconds and is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALERT_WAR_COUNT", + default => "1", + description => "Number of warnings indicating system alert state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many warnings must have occurred within the defined time period to generate an overall system alert state. A value of zero means warnings are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALERT_ERR_COUNT", + default => "1", + description => "Number of errors indicating system alert state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many errors must have occurred within the defined time period to generate an overall system alert state. A value of zero means errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALERT_FAT_COUNT", + default => "0", + description => "Number of fatal error indicating system alert state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many fatal errors (including panics) must have occurred within the defined time period to generate an overall system alert state. A value of zero means fatal errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALARM_WAR_COUNT", + default => "100", + description => "Number of warnings indicating system alarm state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many warnings must have occurred within the defined time period to generate an overall system alarm state. A value of zero means warnings are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALARM_ERR_COUNT", + default => "10", + description => "Number of errors indicating system alarm state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many errors must have occurred within the defined time period to generate an overall system alarm state. A value of zero means errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALARM_FAT_COUNT", + default => "1", + description => "Number of fatal error indicating system alarm state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many fatal errors (including panics) must have occurred within the defined time period to generate an overall system alarm state. A value of zero means fatal errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_RECORD_EVENT_STATS", + default => "yes", + description => "Record event statistical information, switch off if too slow", + help => "This version of ZoneMinder records detailed information about events in the Stats table. This can help in profiling what the optimum settings are for Zones though this is tricky at present. However in future releases this will be done more easily and intuitively, especially with a large sample of events. The default option of 'yes' allows this information to be collected now in readiness for this but if you are concerned about performance you can switch this off in which case no Stats information will be saved.", + type => $types{boolean}, + category => "logging", + }, + { + name => "ZM_RECORD_DIAG_IMAGES", + default => "no", + description => "Record intermediate alarm diagnostic images, can be very slow", + help => "In addition to recording event statistics you can also record the intermediate diagnostic images that display the results of the various checks and processing that occur when trying to determine if an alarm event has taken place. There are several of these images generated for each frame and zone for each alarm or alert frame so this can have a massive impact on performance. Only switch this setting on for debug or analysis purposes and remember to switch it off again once no longer required.", + type => $types{boolean}, + category => "logging", + }, + { + name => "ZM_DUMP_CORES", + default => "no", + description => "Create core files on unexpected process failure.", + help => "When an unrecoverable error occurs in a ZoneMinder binary process is has traditionally been trapped and the details written to logs to aid in remote analysis. However in some cases it is easier to diagnose the error if a core file, which is a memory dump of the process at the time of the error, is created. This can be interactively analysed in the debugger and may reveal more or better information than that available from the logs. This option is recommended for advanced users only otherwise leave at the default. Note using this option to trigger core files will mean that there will be no indication in the binary logs that a process has died, they will just stop, however the zmdc log will still contain an entry. Also note that you may have to explicitly enable core file creation on your system via the 'ulimit -c' command or other means otherwise no file will be created regardless of the value of this option.", + type => $types{boolean}, + category => "logging", + }, + { + name => "ZM_PATH_MAP", + default => "/dev/shm", + description => "Path to the mapped memory files that that ZoneMinder can use", + help => "ZoneMinder has historically used IPC shared memory for shared data between processes. This has it's advantages and limitations. This version of ZoneMinder can use an alternate method, mapped memory, instead with can be enabled with the --enable--mmap directive to configure. This requires less system configuration and is generally more flexible. However it requires each shared data segment to map onto a filesystem file. This option indicates where those mapped files go. You should ensure that this location has sufficient space for these files and for the best performance it should be a tmpfs file system or ramdisk otherwise disk access may render this method slower than the regular shared memory one.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_PATH_SOCKS", + default => "/tmp/zm", + description => "Path to the various Unix domain socket files that ZoneMinder uses", + help => "ZoneMinder generally uses Unix domain sockets where possible. This reduces the need for port assignments and prevents external applications from possibly compromising the daemons. However each Unix socket requires a .sock file to be created. This option indicates where those socket files go.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_PATH_LOGS", + default => "/var/log/zm", + description => "Path to the various logs that the ZoneMinder daemons generate", + help => "There are various daemons that are used by ZoneMinder to perform various tasks. Most generate helpful log files and this is where they go. They can be deleted if not required for debugging.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_PATH_SWAP", + default => "/tmp/zm", + description => "Path to location for temporary swap images used in streaming", + help => "Buffered playback requires temporary swap images to be stored for each instance of the streaming daemons. This option determines where these images will be stored. The images will actually be stored in sub directories beneath this location and will be automatically cleaned up after a period of time.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_WEB_TITLE_PREFIX", + default => "ZM", + description => "The title prefix displayed on each window", + help => "If you have more than one installation of ZoneMinder it can be helpful to display different titles for each one. Changing this option allows you to customise the window titles to include further information to aid identification.", + type => $types{string}, + category => "web", + }, + { + name => "ZM_WEB_RESIZE_CONSOLE", + default => "yes", + description => "Should the console window resize itself to fit", + help => "Traditionally the main ZoneMinder web console window has resized itself to shrink to a size small enough to list only the monitors that are actually present. This is intended to make the window more unobtrusize but may not be to everyones tastes, especially if opened in a tab in browsers which support this kind if layout. Switch this option off to have the console window size left to the users preference", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_WEB_POPUP_ON_ALARM", + default => "yes", + description => "Should the monitor window jump to the top if an alarm occurs", + help => "When viewing a live monitor stream you can specify whether you want the window to pop to the front if an alarm occurs when the window is minimised or behind another window. This is most useful if your monitors are over doors for example when they can pop up if someone comes to the doorway.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_OPT_X10", + default => "no", + description => "Support interfacing with X10 devices", + help => "If you have an X10 Home Automation setup in your home you can use ZoneMinder to initiate or react to X10 signals if your computer has the appropriate interface controller. This option indicates whether X10 options will be available in the browser client.", + type => $types{boolean}, + category => "x10", + }, + { + name => "ZM_X10_DEVICE", + default => "/dev/ttyS0", + description => "What device is your X10 controller connected on", + requires => [ { name => "ZM_OPT_X10", value => "yes" } ], + help => "If you have an X10 controller device (e.g. XM10U) connected to your computer this option details which port it is conected on, the default of /dev/ttyS0 maps to serial or com port 1.", + type => $types{abs_path}, + category => "x10", + }, + { + name => "ZM_X10_HOUSE_CODE", + default => "A", + description => "What X10 house code should be used", + requires => [ { name => "ZM_OPT_X10", value => "yes" } ], + help => "X10 devices are grouped together by identifying them as all belonging to one House Code. This option details what that is. It should be a single letter between A and P.", + type => { db_type=>"string", hint=>"A-P", pattern=>qr|^([A-P])|i, format=>q( uc($1) ) }, + category => "x10", + }, + { + name => "ZM_X10_DB_RELOAD_INTERVAL", + default => "60", + description => "How often (in seconds) the X10 daemon reloads the monitors from the database", + requires => [ { name => "ZM_OPT_X10", value => "yes" } ], + help => "The zmx10 daemon periodically checks the database to find out what X10 events trigger, or result from, alarms. This option determines how frequently this check occurs, unless you change this area frequently this can be a fairly large value.", + type => $types{integer}, + category => "x10", + }, + { + name => "ZM_WEB_SOUND_ON_ALARM", + default => "no", + description => "Should the monitor window play a sound if an alarm occurs", + help => "When viewing a live monitor stream you can specify whether you want the window to play a sound to alert you if an alarm occurs.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_WEB_ALARM_SOUND", + default => "", + description => "The sound to play on alarm, put this in the sounds directory", + help => "You can specify a sound file to play if an alarm occurs whilst you are watching a live monitor stream. So long as your browser understands the format it does not need to be any particular type. This file should be placed in the sounds directory defined earlier.", + type => $types{file}, + requires => [ { name => "ZM_WEB_SOUND_ON_ALARM", value => "yes" } ], + category => "web", + }, + { + name => "ZM_WEB_COMPACT_MONTAGE", + default => "no", + description => "Compact the montage view by removing extra detail", + help => "The montage view shows the output of all of your active monitors in one window. This include a small menu and status information for each one. This can increase the web traffic and make the window larger than may be desired. Setting this option on removes all this extraneous information and just displays the images.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_OPT_FAST_DELETE", + default => "yes", + description => "Delete only event database records for speed", + help => "Normally an event created as the result of an alarm consists of entries in one or more database tables plus the various files associated with it. When deleting events in the browser it can take a long time to remove all of this if your are trying to do a lot of events at once. It is recommended that you set this option which means that the browser client only deletes the key entries in the events table, which means the events will no longer appear in the listing, and leaves the zmaudit daemon to clear up the rest later.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_STRICT_VIDEO_CONFIG", + default => "yes", + description => "Allow errors in setting video config to be fatal", + help => "With some video devices errors can be reported in setting the various video attributes when in fact the operation was successful. Switching this option off will still allow these errors to be reported but will not cause them to kill the video capture daemon. Note however that doing this will cause all errors to be ignored including those which are genuine and which may cause the video capture to not function correctly. Use this option with caution.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_SIGNAL_CHECK_POINTS", + default => "10", + description => "How many points in a captured image to check for signal loss", + help => "For locally attached video cameras ZoneMinder can check for signal loss by looking at a number of random points on each captured image. If all of these points are set to the same fixed colour then the camera is assumed to have lost signal. When this happens any open events are closed and a short one frame signal loss event is generated, as is another when the signal returns. This option defines how many points on each image to check. Note that this is a maximum, any points found to not have the check colour will abort any further checks so in most cases on a couple of points will actually be checked. Network and file based cameras are never checked.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_V4L_MULTI_BUFFER", + default => "yes", + description => "Use more than one buffer for Video 4 Linux devices", + help => "Performance when using Video 4 Linux devices is usually best if multiple buffers are used allowing the next image to be captured while the previous one is being processed. If you have multiple devices on a card sharing one input that requires switching then this approach can sometimes cause frames from one source to be mixed up with frames from another. Switching this option off prevents multi buffering resulting in slower but more stable image capture. This option is ignored for non-local cameras or if only one input is present on a capture chip. This option addresses a similar problem to the ZM_CAPTURES_PER_FRAME option and you should normally change the value of only one of the options at a time.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_CAPTURES_PER_FRAME", + default => "1", + description => "How many images are captured per returned frame, for shared local cameras", + help => "If you are using cameras attached to a video capture card which forces multiple inputs to share one capture chip, it can sometimes produce images with interlaced frames reversed resulting in poor image quality and a distinctive comb edge appearance. Increasing this setting allows you to force additional image captures before one is selected as the captured frame. This allows the capture hardware to 'settle down' and produce better quality images at the price of lesser capture rates. This option has no effect on (a) network cameras, or (b) where multiple inputs do not share a capture chip. This option addresses a similar problem to the ZM_V4L_MULTI_BUFFER option and you should normally change the value of only one of the options at a time.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_FILTER_RELOAD_DELAY", + default => "300", + description => "How often (in seconds) filters are reloaded in zmfilter", + help => "ZoneMinder allows you to save filters to the database which allow events that match certain criteria to be emailed, deleted or uploaded to a remote machine etc. The zmfilter daemon loads these and does the actual operation. This option determines how often the filters are reloaded from the database to get the latest versions or new filters. If you don't change filters very often this value can be set to a large value.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_FILTER_EXECUTE_INTERVAL", + default => "60", + description => "How often (in seconds) to run automatic saved filters", + help => "ZoneMinder allows you to save filters to the database which allow events that match certain criteria to be emailed, deleted or uploaded to a remote machine etc. The zmfilter daemon loads these and does the actual operation. This option determines how often the filters are executed on the saved event in the database. If you want a rapid response to new events this should be a smaller value, however this may increase the overall load on the system and affect performance of other elements.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_OPT_UPLOAD", + default => "no", + description => "Should ZoneMinder support uploading events from filters", + help => "In ZoneMinder you can create event filters that specify whether events that match certain criteria should be uploaded to a remote server for archiving. This option specifies whether this functionality should be available", + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_UPLOAD_ARCH_FORMAT", + default => "tar", + description => "What format the uploaded events should be created in.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + help => "Uploaded events may be stored in either .tar or .zip format, this option specifies which. Note that to use this you will need to have the Archive::Tar and/or Archive::Zip perl modules installed.", + type => { db_type=>"string", hint=>"tar|zip", pattern=>qr|^([tz])|i, format=>q( $1 =~ /^t/ ? "tar" : "zip" ) }, + category => "upload", + }, + { + name => "ZM_UPLOAD_ARCH_COMPRESS", + default => "no", + description => "Should archive files be compressed", + help => "When the archive files are created they can be compressed. However in general since the images are compressed already this saves only a minimal amount of space versus utilising more CPU in their creation. Only enable if you have CPU to waste and are limited in disk space on your remote server or bandwidth.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_UPLOAD_ARCH_ANALYSE", + default => "no", + description => "Include the analysis files in the archive", + help => "When the archive files are created they can contain either just the captured frames or both the captured frames and, for frames that caused an alarm, the analysed image with the changed area highlighted. This option controls files are included. Only include analysed frames if you have a high bandwidth connection to the remote server or if you need help in figuring out what caused an alarm in the first place as archives with these files in can be considerably larger.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_UPLOAD_PROTOCOL", + default => "ftp", + description => "What protocol to use to upload events", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + help => "ZoneMinder can upload events to a remote server using either FTP or SFTP. Regular FTP is widely supported but not necessarily very secure whereas SFTP (Secure FTP) runs over an ssh connection and so is encrypted and uses regular ssh ports. Note that to use this you will need to have the appropriate perl module, either Net::FTP or Net::SFTP installed depending on your choice.", + type => { db_type=>"string", hint=>"ftp|sftp", pattern=>qr|^([tz])|i, format=>q( $1 =~ /^f/ ? "ftp" : "sftp" ) }, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_HOST", + default => "", + description => "The remote server to upload to", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the name, or ip address, of the server to use.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{hostname}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_HOST", + default => "", + description => "The remote server to upload events to", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the name, or ip address, of the server to use.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{hostname}, + category => "upload", + }, + { + name => "ZM_UPLOAD_PORT", + default => "", + description => "The port on the remote upload server, if not the default (SFTP only)", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. If you are using the SFTP protocol then this option allows you to specify a particular port to use for connection. If this option is left blank then the default, port 22, is used. This option is ignored for FTP uploads.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{integer}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_USER", + default => "", + description => "Your ftp username", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the username that ZoneMinder should use to log in for ftp transfer.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{alphanum}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_USER", + default => "", + description => "Remote server username", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the username that ZoneMinder should use to log in for transfer.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{alphanum}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_PASS", + default => "", + description => "Your ftp password", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the password that ZoneMinder should use to log in for ftp transfer.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{string}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_PASS", + default => "", + description => "Remote server password", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the password that ZoneMinder should use to log in for transfer. If you are using certicate based logins for SFTP servers you can leave this option blank.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{string}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_LOC_DIR", + default => "/tmp/zm", + description => "The local directory in which to create upload files", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the local directory that ZoneMinder should use for temporary upload files. These are files that are created from events, uploaded and then deleted.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{abs_path}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_LOC_DIR", + default => "/tmp/zm", + description => "The local directory in which to create upload files", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the local directory that ZoneMinder should use for temporary upload files. These are files that are created from events, uploaded and then deleted.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{abs_path}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_REM_DIR", + default => "", + description => "The remote directory to upload to", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the remote directory that ZoneMinder should use to upload event files to.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{rel_path}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_REM_DIR", + default => "", + description => "The remote directory to upload to", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the remote directory that ZoneMinder should use to upload event files to.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{rel_path}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_TIMEOUT", + default => "120", + description => "How long to allow the transfer to take for each file", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the maximum ftp inactivity timeout (in seconds) that should be tolerated before ZoneMinder determines that the transfer has failed and closes down the connection.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{integer}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_TIMEOUT", + default => "120", + description => "How long to allow the transfer to take for each file", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the maximum inactivity timeout (in seconds) that should be tolerated before ZoneMinder determines that the transfer has failed and closes down the connection.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{integer}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_PASSIVE", + default => "yes", + description => "Use passive ftp when uploading", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates that ftp transfers should be done in passive mode. This uses a single connection for all ftp activity and, whilst slower than active transfers, is more robust and likely to work from behind filewalls. This option is ignored for SFTP transfers.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + help => "If your computer is behind a firewall or proxy you may need to set FTP to passive mode. In fact for simple transfers it makes little sense to do otherwise anyway but you can set this to 'No' if you wish.", + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_DEBUG", + default => "no", + description => "Switch ftp debugging on", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. If you are having (or expecting) troubles with uploading events then setting this to 'yes' permits additional information to be included in the zmfilter log file.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{boolean}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_DEBUG", + default => "no", + description => "Switch upload debugging on", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. If you are having (or expecting) troubles with uploading events then setting this to 'yes' permits additional information to be generated by the underlying transfer modules and included in the logs.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_OPT_EMAIL", + default => "no", + description => "Should ZoneMinder email you details of events that match corresponding filters", + help => "In ZoneMinder you can create event filters that specify whether events that match certain criteria should have their details emailed to you at a designated email address. This will allow you to be notified of events as soon as they occur and also to quickly view the events directly. This option specifies whether this functionality should be available. The email created with this option can be any size and is intended to be sent to a regular email reader rather than a mobile device.", + type => $types{boolean}, + category => "mail", + }, + { + name => "ZM_EMAIL_ADDRESS", + default => "", + description => "The email address to send matching event details to", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" } ], + help => "This option is used to define the email address that any events that match the appropriate filters will be sent to.", + type => $types{email}, + category => "mail", + }, + { + name => "ZM_EMAIL_TEXT", + default => 'subject = "ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)" +body = " +Hello, + +An alarm has been detected on your installation of the ZoneMinder. + +The details are as follows :- + + Monitor : %MN% + Event Id : %EI% + Length : %EL% + Frames : %EF% (%EFA%) + Scores : t%EST% m%ESM% a%ESA% + +This alarm was matched by the %FN% filter and can be viewed at %EPS% + +ZoneMinder"', + description => "The text of the email used to send matching event details", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" } ], + help => "This option is used to define the content of the email that is sent for any events that match the appropriate filters.", + type => $types{text}, + category => "hidden", + }, + { + name => "ZM_EMAIL_SUBJECT", + default => "ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)", + description => "The subject of the email used to send matching event details", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" } ], + help => "This option is used to define the subject of the email that is sent for any events that match the appropriate filters.", + type => $types{string}, + category => "mail", + }, + { + name => "ZM_EMAIL_BODY", + default => " +Hello, + +An alarm has been detected on your installation of the ZoneMinder. + +The details are as follows :- + + Monitor : %MN% + Event Id : %EI% + Length : %EL% + Frames : %EF% (%EFA%) + Scores : t%EST% m%ESM% a%ESA% + +This alarm was matched by the %FN% filter and can be viewed at %EPS% + +ZoneMinder", + description => "The body of the email used to send matching event details", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" } ], + help => "This option is used to define the content of the email that is sent for any events that match the appropriate filters.", + type => $types{text}, + category => "mail", + }, + { + name => "ZM_OPT_MESSAGE", + default => "no", + description => "Should ZoneMinder message you with details of events that match corresponding filters", + help => "In ZoneMinder you can create event filters that specify whether events that match certain criteria should have their details sent to you at a designated short message email address. This will allow you to be notified of events as soon as they occur. This option specifies whether this functionality should be available. The email created by this option will be brief and is intended to be sent to an SMS gateway or a minimal mail reader such as a mobile device or phone rather than a regular email reader.", + type => $types{boolean}, + category => "mail", + }, + { + name => "ZM_MESSAGE_ADDRESS", + default => "", + description => "The email address to send matching event details to", + requires => [ { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "This option is used to define the short message email address that any events that match the appropriate filters will be sent to.", + type => $types{email}, + category => "mail", + }, + { + name => "ZM_MESSAGE_TEXT", + default => 'subject = "ZoneMinder: Alarm - %MN%-%EI%" +body = "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score."', + description => "The text of the message used to send matching event details", + requires => [ { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "This option is used to define the content of the message that is sent for any events that match the appropriate filters.", + type => $types{text}, + category => "hidden", + }, + { + name => "ZM_MESSAGE_SUBJECT", + default => "ZoneMinder: Alarm - %MN%-%EI%", + description => "The subject of the message used to send matching event details", + requires => [ { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "This option is used to define the subject of the message that is sent for any events that match the appropriate filters.", + type => $types{string}, + category => "mail", + }, + { + name => "ZM_MESSAGE_BODY", + default => "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.", + description => "The body of the message used to send matching event details", + requires => [ { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "This option is used to define the content of the message that is sent for any events that match the appropriate filters.", + type => $types{text}, + category => "mail", + }, + { + name => "ZM_NEW_MAIL_MODULES", + default => "no", + description => "Use a newer perl method to send emails", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" }, { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "Traditionally ZoneMinder has used the MIME::Entity perl module to construct and send notification emails and messages. Some people have reported problems with this module not being present at all or flexible enough for their needs. If you are one of those people this option allows you to select a new mailing method using MIME::Lite and Net::SMTP instead. This method was contributed by Ross Melin and should work for everyone but has not been extensively tested so currently is not selected by default.", + type => $types{boolean}, + category => "mail", + }, + { + name => "ZM_EMAIL_HOST", + default => "localhost", + description => "The host address of your SMTP mail server", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" }, { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "If you have chosen SMTP as the method by which to send notification emails or messages then this option allows you to choose which SMTP server to use to send them. The default of localhost may work if you have the sendmail, exim or a similar daemon running however you may wish to enter your ISP's SMTP mail server here.", + type => $types{hostname}, + category => "mail", + }, + { + name => "ZM_FROM_EMAIL", + default => "", + description => "The email address you wish your event notifications to originate from", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" }, { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "The emails or messages that will be sent to you informing you of events can appear to come from a designated email address to help you with mail filtering etc. An address of something like ZoneMinder\@your.domain is recommended.", + type => $types{email}, + category => "mail", + }, + { + name => "ZM_URL", + default => "", + description => "The URL of your ZoneMinder installation", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" }, { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "The emails or messages that will be sent to you informing you of events can include a link to the events themselves for easy viewing. If you intend to use this feature then set this option to the url of your installation as it would appear from where you read your email, e.g. http://host.your.domain/zm.php.", + type => $types{url}, + category => "mail", + }, + { + name => "ZM_MAX_RESTART_DELAY", + default => "600", + description => "Maximum delay (in seconds) for daemon restart attempts.", + help => "The zmdc (zm daemon control) process controls when processeses are started or stopped and will attempt to restart any that fail. If a daemon fails frequently then a delay is introduced between each restart attempt. If the daemon stills fails then this delay is increased to prevent extra load being placed on the system by continual restarts. This option controls what this maximum delay is.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_WATCH_CHECK_INTERVAL", + default => "10", + description => "How often to check the capture daemons have not locked up", + help => "The zmwatch daemon checks the image capture performance of the capture daemons to ensure that they have not locked up (rarely a sync error may occur which blocks indefinately). This option determines how often the daemons are checked.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_WATCH_MAX_DELAY", + default => "5", + description => "The maximum delay allowed since the last captured image", + help => "The zmwatch daemon checks the image capture performance of the capture daemons to ensure that they have not locked up (rarely a sync error may occur which blocks indefinately). This option determines the maximum delay to allow since the last captured frame. The daemon will be restarted if it has not captured any images after this period though the actual restart may take slightly longer in conjunction with the check interval value above.", + type => $types{decimal}, + category => "system", + }, + { + + name => "ZM_RUN_AUDIT", + default => "yes", + description => "Run zmaudit to check data consistency", + help => "The zmaudit daemon exists to check that the saved information in the database and on the filesystem match and are consistent with each other. If an error occurs or if you are using 'fast deletes' it may be that database records are deleted but files remain. In this case, and similar, zmaudit will remove redundant information to synchronise the two data stores. This option controls whether zmaudit is run in the background and performs these checks and fixes continuously. This is recommended for most systems however if you have a very large number of events the process of scanning the database and filesystem may take a long time and impact performance. In this case you may prefer to not have zmaudit running unconditionally and schedule occasional checks at other, more convenient, times.", + type => $types{boolean}, + category => "system", + }, + { + + name => "ZM_AUDIT_CHECK_INTERVAL", + default => "900", + description => "How often to check database and filesystem consistency", + help => "The zmaudit daemon exists to check that the saved information in the database and on the filesystem match and are consistent with each other. If an error occurs or if you are using 'fast deletes' it may be that database records are deleted but files remain. In this case, and similar, zmaudit will remove redundant information to synchronise the two data stores. The default check interval of 900 seconds (15 minutes) is fine for most systems however if you have a very large number of events the process of scanning the database and filesystem may take a long time and impact performance. In this case you may prefer to make this interval much larger to reduce the impact on your system. This option determines how often these checks are performed.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_FORCED_ALARM_SCORE", + default => "255", + description => "Score to give forced alarms", + help => "The 'zmu' utility can be used to force an alarm on a monitor rather than rely on the motion detection algorithms. This option determines what score to give these alarms to distinguish them from regular ones. It must be 255 or less.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_BULK_FRAME_INTERVAL", + default => "100", + description => "How often a bulk frame should be written to the database", + help => "Traditionally ZoneMinder writes an entry into the Frames database table for each frame that is captured and saved. This works well in motion detection scenarios but when in a DVR situation ('Record' or 'Mocord' mode) this results in a huge number of frame writes and a lot of database and disk bandwidth for very little additional information. Setting this to a non-zero value will enabled ZoneMinder to group these non-alarm frames into one 'bulk' frame entry which saves a lot of bandwidth and space. The only disadvantage of this is that timing information for individual frames is lost but in constant frame rate situations this is usually not significant. This setting is ignored in Modect mode and individual frames are still written if an alarm occurs in Mocord mode also.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_EVENT_CLOSE_MODE", + default => "idle", + description => "When continuous events are closed.", + help => "When a monitor is running in a continuous recording mode (Record or Mocord) events are usually closed after a fixed period of time (the section length). However in Mocord mode it is possible that motion detection may occur near the end of a section. This option controls what happens when an alarm occurs in Mocord mode. The 'time' setting means that the event will be closed at the end of the section regardless of alarm activity. The 'idle' setting means that the event will be closed at the end of the section if there is no alarm activity occuring at the time otherwise it will be closed once the alarm is over meaning the event may end up being longer than the normal section length. The 'alarm' setting means that if an alarm occurs during the event, the event will be closed once the alarm is over regardless of when this occurs. This has the effect of limiting the number of alarms to one per event and the events will be shorter than the section length if an alarm has occurred.", + type => $types{boolean}, + type => { db_type=>"string", hint=>"time|idle|alarm", pattern=>qr|^([tia])|i, format=>q( ($1 =~ /^t/) ? "time" : ($1 =~ /^i/ ? "idle" : "time" ) ) }, + category => "config", + }, + # Deprecated, superseded by event close mode + { + name => "ZM_FORCE_CLOSE_EVENTS", + default => "no", + description => "Close events at section ends.", + help => "When a monitor is running in a continuous recording mode (Record or Mocord) events are usually closed after a fixed period of time (the section length). However in Mocord mode it is possible that motion detection may occur near the end of a section and ordinarily this will prevent the event being closed until the motion has ceased. Switching this option on will force the event closed at the specified time regardless of any motion activity.", + type => $types{boolean}, + category => "hidden", + }, + { + name => "ZM_CREATE_ANALYSIS_IMAGES", + default => "yes", + description => "Create analysed alarm images with motion outlined", + help => "By default during an alarm ZoneMinder records both the raw captured image and one that has been analysed and had areas where motion was detected outlined. This can be very useful during zone configuration or in analysing why events occured. However it also incurs some overhead and in a stable system may no longer be necessary. This parameter allows you to switch the generation of these images off.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_WEIGHTED_ALARM_CENTRES", + default => "no", + description => "Use a weighted algorithm to calculate the centre of an alarm", + help => "ZoneMinder will always calculate the centre point of an alarm in a zone to give some indication of where on the screen it is. This can be used by the experimental motion tracking feature or your own custom extensions. In the alarmed or filtered pixels mode this is a simple midpoint between the extents of the detected pxiesl. However in the blob method this can instead be calculated using weighted pixel locations to give more accurate positioning for irregularly shaped blobs. This method, while more precise is also slower and so is turned off by default.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_EVENT_IMAGE_DIGITS", + default => "3", + description => "How many significant digits are used in event image numbering", + help => "As event images are captured they are stored to the filesystem with a numerical index. By default this index has three digits so the numbers start 001, 002 etc. This works works for most scenarios as events with more than 999 frames are rarely captured. However if you have extremely long events and use external applications then you may wish to increase this to ensure correct sorting of images in listings etc. Warning, increasing this value on a live system may render existing events unviewable as the event will have been saved with the previous scheme. Decreasing this value should have no ill effects.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_DEFAULT_ASPECT_RATIO", + default => "4:3", + description => "The default width:height aspect ratio used in monitors", + help => "When specifying the dimensions of monitors you can click a checkbox to ensure that the width stays in the correct ratio to the height, or vice versa. This setting allows you to indicate what the ratio of these settings should be. This should be specified in the format : and the default of 4:3 normally be acceptable but 11:9 is another common setting. If the checkbox is not clicked when specifying monitor dimensions this setting has no effect.", + type => $types{string}, + category => "config", + }, + { + name => "ZM_USER_SELF_EDIT", + default => "no", + description => "Allow unprivileged users to change their details", + help => "Ordinarily only users with system edit privilege are able to change users details. Switching this option on allows ordinary users to change their passwords and their language settings", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_OPT_FRAME_SERVER", + default => "no", + description => "Should analysis farm out the writing of images to disk", + #requires => [ { name => "ZM_OPT_ADAPTIVE_SKIP", value => "yes" } ], + help => "In some circumstances it is possible for a slow disk to take so long writing images to disk that it causes the analysis daemon to fall behind especially during high frame rate events. Setting this option to yes enables a frame server daemon (zmf) which will be sent the images from the analysis daemon and will do the actual writing of images itself freeing up the analysis daemon to get on with other things. Should this transmission fail or other permanent or transient error occur, this function will fall back to the analysis daemon.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_FRAME_SOCKET_SIZE", + default => "0", + description => "Specify the frame server socket buffer size if non-standard", + requires => [ { name => "ZM_OPT_FRAME_SERVER", value => "yes" } ], + help => "For large captured images it is possible for the writes from the analysis daemon to the frame server to fail as the amount to be written exceeds the default buffer size. While the images are then written by the analysis daemon so no data is lost, it defeats the object of the frame server daemon in the first place. You can use this option to indicate that a larger buffer size should be used. Note that you may have to change the existing maximum socket buffer size on your system via sysctl (or in /proc/sys/net/core/wmem_max) to allow this new size to be set. Alternatively you can change the default buffer size on your system in the same way in which case that will be used with no change necessary in this option", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_OPT_CONTROL", + default => "no", + description => "Support controllable (e.g. PTZ) cameras", + help => "ZoneMinder includes limited support for controllable cameras. A number of sample protocols are included and others can easily be added. If you wish to control your cameras via ZoneMinder then select this option otherwise if you only have static cameras or use other control methods then leave this option off.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_OPT_TRIGGERS", + default => "no", + description => "Interface external event triggers via socket or device files", + help => "ZoneMinder can interact with external systems which prompt or cancel alarms. This is done via the zmtrigger.pl script. This option indicates whether you want to use these external triggers. Most people will say no here.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_CHECK_FOR_UPDATES", + default => "yes", + description => "Check with zoneminder.com for updated versions", + help => "From ZoneMinder version 1.17.0 onwards new versions are expected to be more frequent. To save checking manually for each new version ZoneMinder can check with the zoneminder.com website to determine the most recent release. These checks are infrequent, about once per week, and no personal or system information is transmitted other than your current version number. If you do not wish these checks to take place or your ZoneMinder system has no internet access you can switch these check off with this configuration variable", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_UPDATE_CHECK_PROXY", + default => "", + description => "Proxy url if required to access zoneminder.com", + help => "If you use a proxy to access the internet then ZoneMinder needs to know so it can access zoneminder.com to check for updates. If you do use a proxy enter the full proxy url here in the form of http://:/", + type => $types{string}, + category => "system", + }, + { + name => "ZM_SHM_KEY", + default => "0x7a6d0000", + description => "Shared memory root key to use", + help => "ZoneMinder uses shared memory to speed up communication between modules. To identify the right area to use shared memory keys are used. This option controls what the base key is, each monitor will have it's Id or'ed with this to get the actual key used. You will not normally need to change this value unless it clashes with another instance of ZoneMinder on the same machine. Only the first four hex digits are used, the lower four will be masked out and ignored.", + type => $types{hexadecimal}, + category => "system", + }, + # Deprecated, really no longer necessary + { + name => "ZM_WEB_REFRESH_METHOD", + default => "javascript", + description => "What method windows should use to refresh themselves", + help => "Many windows in Javascript need to refresh themselves to keep their information current. This option determines what method they should use to do this. Choosing 'javascript' means that each window will have a short JavaScript statement in with a timer to prompt the refresh. This is the most compatible method. Choosing 'http' means the refresh instruction is put in the HTTP header. This is a cleaner method but refreshes are interrupted or cancelled when a link in the window is clicked meaning that the window will no longer refresh and this would have to be done manually.", + type => { db_type=>"string", hint=>"javascript|http", pattern=>qr|^([jh])|i, format=>q( $1 =~ /^j/ ? "javascript" : "http" ) }, + category => "hidden", + }, + { + name => "ZM_WEB_EVENT_SORT_FIELD", + default => "DateTime", + description => "Default field the event lists are sorted by", + help => "Events in lists can be initially ordered in any way you want. This option controls what field is used to sort them. You can modify this ordering from filters or by clicking on headings in the lists themselves. Bear in mind however that the 'Prev' and 'Next' links, when scrolling through events, relate to the ordering in the lists and so not always to time based ordering.", + type => { db_type=>"string", hint=>"Id|Name|Cause|MonitorName|DateTime|Length|Frames|AlarmFrames|TotScore|AvgScore|MaxScore", pattern=>qr|.|, format=>q( $1 ) }, + category => "web", + }, + { + name => "ZM_WEB_EVENT_SORT_ORDER", + default => "asc", + description => "Default order the event lists are sorted by", + help => "Events in lists can be initially ordered in any way you want. This option controls what order (ascending or descending) is used to sort them. You can modify this ordering from filters or by clicking on headings in the lists themselves. Bear in mind however that the 'Prev' and 'Next' links, when scrolling through events, relate to the ordering in the lists and so not always to time based ordering.", + type => { db_type=>"string", hint=>"asc|desc", pattern=>qr|^([ad])|i, format=>q( $1 =~ /^a/i ? "asc" : "desc" ) }, + category => "web", + }, + { + name => "ZM_WEB_EVENTS_PER_PAGE", + default => "25", + description => "How many events to list per page in paged mode", + help => "In the event list view you can either list all events or just a page at a time. This option controls how many events are listed per page in paged mode and how often to repeat the column headers in non-paged mode.", + type => $types{integer}, + category => "web", + }, + { + name => "ZM_WEB_LIST_THUMBS", + default => "no", + description => "Display mini-thumbnails of event images in event lists", + help => "Ordinarily the event lists just display text details of the events to save space and time. By switching this option on you can also display small thumbnails to help you identify events of interest. The size of these thumbnails is controlled by the following two options.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_WEB_LIST_THUMB_WIDTH", + default => "48", + description => "The width of the thumbnails that appear in the event lists", + help => "This options controls the width of the thumbnail images that appear in the event lists. It should be fairly small to fit in with the rest of the table. If you prefer you can specify a height instead in the next option but you should only use one of the width or height and the other option should be set to zero. If both width and height are specified then width will be used and height ignored.", + type => $types{integer}, + requires => [ { name => "ZM_WEB_LIST_THUMBS", value => "yes" } ], + category => "web", + }, + { + name => "ZM_WEB_LIST_THUMB_HEIGHT", + default => "0", + description => "The height of the thumbnails that appear in the event lists", + help => "This options controls the height of the thumbnail images that appear in the event lists. It should be fairly small to fit in with the rest of the table. If you prefer you can specify a width instead in the previous option but you should only use one of the width or height and the other option should be set to zero. If both width and height are specified then width will be used and height ignored.", + type => $types{integer}, + requires => [ { name => "ZM_WEB_LIST_THUMBS", value => "yes" } ], + category => "web", + }, + { + name => "ZM_WEB_USE_OBJECT_TAGS", + default => "yes", + description => "Wrap embed in object tags for media content", + help => "There are two methods of including media content in web pages. The most common way is use the EMBED tag which is able to give some indication of the type of content. However this is not a standard part of HTML. The official method is to use OBJECT tags which are able to give more information allowing the correct media viewers etc to be loaded. However these are less widely supported and content may be specifically tailored to a particular platform or player. This option controls whether media content is enclosed in EMBED tags only or whether, where appropriate, it is additionally wrapped in OBJECT tags. Currently OBJECT tags are only used in a limited number of circumstances but they may become more widespread in the future. It is suggested that you leave this option on unless you encounter problems playing some content.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_WEB_H_REFRESH_MAIN", + default => "300", + introduction => "There are now a number of options that are grouped into bandwidth categories, this allows you to configure the ZoneMinder client to work optimally over the various access methods you might to access the client.\n\nThe next few options control what happens when the client is running in 'high' bandwidth mode. You should set these options for when accessing the ZoneMinder client over a local network or high speed link. In most cases the default values will be suitable as a starting point.", + description => "How often (in seconds) the main console window should refresh itself", + help => "The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_REFRESH_CYCLE", + default => "10", + description => "How often (in seconds) the cycle watch window swaps to the next monitor", + help => "The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_REFRESH_IMAGE", + default => "5", + description => "How often (in seconds) the watched image is refreshed (if not streaming)", + help => "The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_REFRESH_STATUS", + default => "3", + description => "How often (in seconds) the status refreshes itself in the watch window", + help => "The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_REFRESH_EVENTS", + default => "30", + description => "How often (in seconds) the event listing is refreshed in the watch window", + help => "The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_CAN_STREAM", + default => "auto", + description => "Override the automatic detection of browser streaming capability", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_STREAM_METHOD", + default => "jpeg", + description => "Which method should be used to send video streams to your browser.", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_DEFAULT_SCALE", + default => "100", + description => "What the default scaling factor applied to 'live' or 'event' views is (%)", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_DEFAULT_RATE", + default => "100", + description => "What the default replay rate factor applied to 'event' views is (%)", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_VIDEO_BITRATE", + default => "150000", + description => "What the bitrate of the video encoded stream should be set to", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_VIDEO_MAXFPS", + default => "15", + description => "What the maximum frame rate for streamed video should be", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_SCALE_THUMBS", + default => "no", + description => "Scale thumbnails in events, bandwidth versus cpu in rescaling", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_EVENTS_VIEW", + default => "events", + description => "What the default view of multiple events should be.", + help => "Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.", + type => { db_type=>"string", hint=>"events|timeline", pattern=>qr|^([lt])|i, format=>q( $1 =~ /^e/ ? "events" : "timeline" ) }, + category => "highband", + }, + { + name => "ZM_WEB_H_SHOW_PROGRESS", + default => "yes", + description => "Show the progress of replay in event view.", + help => "When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.", + type => $types{boolean}, + category => "highband", + }, + { + name => "ZM_WEB_H_AJAX_TIMEOUT", + default => "3000", + description => "How long to wait for Ajax request responses (ms)", + help => "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 => "highband", + }, + { + name => "ZM_WEB_M_REFRESH_MAIN", + default => "300", + description => "How often (in seconds) the main console window should refresh itself", + help => "The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.", + type => $types{integer}, + introduction => "The next few options control what happens when the client is running in 'medium' bandwidth mode. You should set these options for when accessing the ZoneMinder client over a slower cable or DSL link. In most cases the default values will be suitable as a starting point.", + category => "medband", + }, + { + name => "ZM_WEB_M_REFRESH_CYCLE", + default => "20", + description => "How often (in seconds) the cycle watch window swaps to the next monitor", + help => "The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.", + type => $types{integer}, + category => "medband", + }, + { + name => "ZM_WEB_M_REFRESH_IMAGE", + default => "10", + description => "How often (in seconds) the watched image is refreshed (if not streaming)", + help => "The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.", + type => $types{integer}, + category => "medband", + }, + { + name => "ZM_WEB_M_REFRESH_STATUS", + default => "5", + description => "How often (in seconds) the status refreshes itself in the watch window", + help => "The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.", + type => $types{integer}, + category => "medband", + }, + { + name => "ZM_WEB_M_REFRESH_EVENTS", + default => "60", + description => "How often (in seconds) the event listing is refreshed in the watch window", + help => "The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.", + type => $types{integer}, + category => "medband", + }, + { + name => "ZM_WEB_M_CAN_STREAM", + default => "auto", + description => "Override the automatic detection of browser streaming capability", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_STREAM_METHOD", + default => "jpeg", + description => "Which method should be used to send video streams to your browser.", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_DEFAULT_SCALE", + default => "100", + description => "What the default scaling factor applied to 'live' or 'event' views is (%)", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_DEFAULT_RATE", + default => "100", + description => "What the default replay rate factor applied to 'event' views is (%)", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_VIDEO_BITRATE", + default => "75000", + description => "What the bitrate of the video encoded stream should be set to", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_VIDEO_MAXFPS", + default => "10", + description => "What the maximum frame rate for streamed video should be", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_SCALE_THUMBS", + default => "yes", + description => "Scale thumbnails in events, bandwidth versus cpu in rescaling", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_EVENTS_VIEW", + default => "events", + description => "What the default view of multiple events should be.", + help => "Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.", + type => { db_type=>"string", hint=>"events|timeline", pattern=>qr|^([lt])|i, format=>q( $1 =~ /^e/ ? "events" : "timeline" ) }, + category => "medband", + }, + { + name => "ZM_WEB_M_SHOW_PROGRESS", + default => "yes", + description => "Show the progress of replay in event view.", + help => "When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.", + type => $types{boolean}, + category => "medband", + }, + { + name => "ZM_WEB_M_AJAX_TIMEOUT", + default => "5000", + description => "How long to wait for Ajax request responses (ms)", + help => "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 => "medband", + }, + { + name => "ZM_WEB_L_REFRESH_MAIN", + default => "300", + description => "How often (in seconds) the main console window should refresh itself", + introduction => "The next few options control what happens when the client is running in 'low' bandwidth mode. You should set these options for when accessing the ZoneMinder client over a modem or slow link. In most cases the default values will be suitable as a starting point.", + help => "The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_REFRESH_CYCLE", + default => "30", + description => "How often (in seconds) the cycle watch window swaps to the next monitor", + help => "The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_REFRESH_IMAGE", + default => "15", + description => "How often (in seconds) the watched image is refreshed (if not streaming)", + help => "The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_REFRESH_STATUS", + default => "10", + description => "How often (in seconds) the status refreshes itself in the watch window", + help => "The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_REFRESH_EVENTS", + default => "180", + description => "How often (in seconds) the event listing is refreshed in the watch window", + help => "The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_CAN_STREAM", + default => "auto", + description => "Override the automatic detection of browser streaming capability", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_STREAM_METHOD", + default => "jpeg", + description => "Which method should be used to send video streams to your browser.", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_DEFAULT_SCALE", + default => "100", + description => "What the default scaling factor applied to 'live' or 'event' views is (%)", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_DEFAULT_RATE", + default => "100", + description => "What the default replay rate factor applied to 'event' views is (%)", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_VIDEO_BITRATE", + default => "25000", + description => "What the bitrate of the video encoded stream should be set to", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_VIDEO_MAXFPS", + default => "5", + description => "What the maximum frame rate for streamed video should be", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_SCALE_THUMBS", + default => "yes", + description => "Scale thumbnails in events, bandwidth versus cpu in rescaling", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_EVENTS_VIEW", + default => "events", + description => "What the default view of multiple events should be.", + help => "Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.", + type => { db_type=>"string", hint=>"events|timeline", pattern=>qr|^([lt])|i, format=>q( $1 =~ /^e/ ? "events" : "timeline" ) }, + category => "lowband", + }, + { + name => "ZM_WEB_L_SHOW_PROGRESS", + default => "no", + description => "Show the progress of replay in event view.", + help => "When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.", + type => $types{boolean}, + category => "lowband", + }, + { + name => "ZM_WEB_L_AJAX_TIMEOUT", + default => "10000", + description => "How long to wait for Ajax request responses (ms)", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_P_CAN_STREAM", + default => "auto", + description => "Override the automatic detection of browser streaming capability", + help => "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 => "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 => "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 => "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 => "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 => "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 => "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 => "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", + default => "", + description => "What the last version of ZoneMinder recorded from zoneminder.com is", + help => "", + type => $types{string}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_CURR_VERSION", + default => "1.25.0", + description => "What the effective current version of ZoneMinder is, might be different from actual if versions ignored", + help => "", + type => $types{string}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_DB_VERSION", + default => "1.25.0", + description => "What the version of the database is, from zmupdate", + help => "", + type => $types{string}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_LAST_CHECK", + default => "", + description => "When the last check for version from zoneminder.com was", + help => "", + type => $types{integer}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_NEXT_REMINDER", + default => "", + description => "When the earliest time to remind about versions will be", + help => "", + type => $types{string}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_DONATE_REMINDER_TIME", + default => 0, + description => "When the earliest time to remind about donations will be", + help => "", + type => $types{integer}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_SHOW_DONATE_REMINDER", + default => "yes", + description => "Remind about donations or not", + help => "", + type => $types{boolean}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_EYEZM_DEBUG", + default => "no", + description => "Switch additional debugging on for eyeZm Plugin", + help => "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 => "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 => "/var/log/zm/zm_xml.log", + description => "Default filename to use when logging eyeZm Output and EYEZM_LOG_TO_FILE is enabled", + help => "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 => "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 => "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 => "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 => "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 => "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 => "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", + }, + { + name => "ZM_PATH_PLUGINS", + default => "/usr/share/zm", + description => "Path to the plugin folder", + help => "3d-party plugins have to be placed here.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_PLUGIN_EXTENSION", + default => ".zmpl", + description => "Default extension of plugins to found.", + help => "Default extension of plugins to found.", + type => $types{rel_path}, + category => "paths", + }, + { + name => "ZM_PLUGINS_CONFIG_PATH", + default => "/usr/share/zm/plugins.conf", + description => "Path to the config file for plugins.", + help => "Path to the config file for plugins.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_LOAD_PLUGINS", + default => "no", + description => "Load and use 3d-party plugins", + help => "3d-party plugins will be loaded and used for analysing.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_TURNOFF_NATIVE_ANALYSIS", + default => "no", + description => "Turn native ZM\'s image analysis possibility off", + help => "Image analysis with ZM\'s motion detected function will be turned off. Only detection functions from loaded plugins will be used. Note, that if no plugins have be loaded, no detection will be done.", + type => $types{boolean}, + category => "config", + }, + +); + +our %options_hash = map { ( $_->{name}, $_ ) } @options; + +# This function should never need to be called explicitly, except if +# this module is 'require'd rather than 'use'd. See zmconfgen.pl. +sub initialiseConfig +{ + return if ( $configInitialised ); + + # Do some initial data munging to finish the data structures + # Create option ids + my $option_id = 0; + foreach my $option ( @options ) + { + if ( defined($option->{default}) ) + { + $option->{value} = $option->{default} + } + else + { + $option->{value} = ''; + } + #next if ( $option->{category} eq 'hidden' ); + $option->{id} = $option_id++; + } + $configInitialised = 1; +} + +1; +__END__ + +=head1 NAME + +ZoneMinder::ConfigData - ZoneMinder Configuration Data module + +=head1 SYNOPSIS + + use ZoneMinder::ConfigData; + use ZoneMinder::ConfigData qw(:all); + + loadConfigFromDB(); + saveConfigToDB(); + +=head1 DESCRIPTION + +The ZoneMinder:ConfigData module contains the master definition of the ZoneMinder configuration options as well as helper methods. This module is intended for specialist confguration management and would not normally be used by end users. + +The configuration held in this module, which was previously in zmconfig.pl, includes the name, default value, description, help text, type and category for each option, as well as a number of additional fields in a small number of cases. + +=head1 METHODS + +=over 4 + +=item loadConfigFromDB (); + +Loads existing configuration from the database (if any) and merges it with the definitions held in this module. This results in the merging of any new configuration and the removal of any deprecated configuration while preserving the existing values of every else. + +=item saveConfigToDB (); + +Saves configuration held in memory to the database. The act of loading and saving configuration is a convenient way to ensure that the configuration held in the database corresponds with the most recent definitions and that all components are using the same set of configuration. + +=head2 EXPORT + +None by default. +The :data tag will export the various configuration data structures +The :functions tag will export the helper functions. +The :all tag will export all above symbols. + + +=head1 SEE ALSO + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in new file mode 100644 index 000000000..c835626c6 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in @@ -0,0 +1,2056 @@ +# ========================================================================== +# +# ZoneMinder Config Data Module, $Date: 2011-01-20 18:49:42 +0000 (Thu, 20 Jan 2011) $, $Revision: 3230 $ +# 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. +# +# ========================================================================== +# +# This module contains the debug definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::ConfigData; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'data' => [ qw( + %types + @options + %options_hash + ) ] +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'data'} } ); + +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Configuration Data +# +# ========================================================================== + +use Carp; + +our $configInitialised = 0; + +sub INIT +{ + initialiseConfig(); +} + +# Types +our %types = +( + string => { db_type=>"string", hint=>"string", pattern=>qr|^(.+)$|, format=>q( $1 ) }, + alphanum => { db_type=>"string", hint=>"alphanumeric", pattern=>qr|^([a-zA-Z0-9-_]+)$|, format=>q( $1 ) }, + text => { db_type=>"text", hint=>"free text", pattern=>qr|^(.+)$|, format=>q( $1 ) }, + boolean => { db_type=>"boolean", hint=>"yes|no", pattern=>qr|^([yn])|i, check=>q( $1 ), format=>q( ($1 =~ /^y/) ? "yes" : "no" ) }, + integer => { db_type=>"integer", hint=>"integer", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + decimal => { db_type=>"decimal", hint=>"decimal", pattern=>qr|^(\d+(?:\.\d+)?)$|, format=>q( $1 ) }, + hexadecimal => { db_type=>"hexadecimal", hint=>"hexadecimal", pattern=>qr|^(?:0x)?([0-9a-f]{1,8})$|, format=>q( "0x".$1 ) }, + tristate => { db_type=>"string", hint=>"auto|yes|no", pattern=>qr|^([ayn])|i, check=>q( $1 ), format=>q( ($1 =~ /^y/) ? "yes" : ($1 =~ /^n/ ? "no" : "auto" ) ) }, + abs_path => { db_type=>"string", hint=>"/absolute/path/to/somewhere", pattern=>qr|^((?:/[^/]*)+?)/?$|, format=>q( $1 ) }, + rel_path => { db_type=>"string", hint=>"relative/path/to/somewhere", pattern=>qr|^((?:[^/].*)?)/?$|, format=>q( $1 ) }, + directory => { db_type=>"string", hint=>"directory", pattern=>qr|^([a-zA-Z0-9-_.]+)$|, format=>q( $1 ) }, + file => { db_type=>"string", hint=>"filename", pattern=>qr|^([a-zA-Z0-9-_.]+)$|, format=>q( $1 ) }, + hostname => { db_type=>"string", hint=>"host.your.domain", pattern=>qr|^([a-zA-Z0-9_.-]+)$|, format=>q( $1 ) }, + url => { db_type=>"string", hint=>"http://host.your.domain/", pattern=>qr|^(?:http://)?(.+)$|, format=>q( "http://".$1 ) }, + email => { db_type=>"string", hint=>"your.name\@your.domain", pattern=>qr|^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$|, format=>q( $1\@$2 ) }, +); + +our @options = +( + { + name => "ZM_LANG_DEFAULT", + default => "en_gb", + description => "Default language used by web interface", + help => "ZoneMinder allows the web interface to use languages other than English if the appropriate language file has been created and is present. This option allows you to change the default language that is used from the shipped language, British English, to another language", + type => $types{string}, + category => "system", + }, + { + name => "ZM_OPT_USE_AUTH", + default => "no", + description => "Authenticate user logins to ZoneMinder", + help => "ZoneMinder can run in two modes. The simplest is an entirely unauthenticated mode where anyone can access ZoneMinder and perform all tasks. This is most suitable for installations where the web server access is limited in other ways. The other mode enables user accounts with varying sets of permissions. Users must login or authenticate to access ZoneMinder and are limited by their defined permissions.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_AUTH_TYPE", + default => "builtin", + description => "What is used to authenticate ZoneMinder users", + help => "ZoneMinder can use two methods to authenticate users when running in authenticated mode. The first is a builtin method where ZoneMinder provides facilities for users to log in and maintains track of their identity. The second method allows interworking with other methods such as http basic authentication which passes an independently authentication 'remote' user via http. In this case ZoneMinder would use the supplied user without additional authentication provided such a user is configured ion ZoneMinder.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" } ], + type => { db_type=>"string", hint=>"builtin|remote", pattern=>qr|^([br])|i, format=>q( $1 =~ /^b/ ? "builtin" : "remote" ) }, + category => "system", + }, + { + name => "ZM_AUTH_RELAY", + default => "hashed", + description => "Method used to relay authentication information", + help => "When ZoneMinder is running in authenticated mode it can pass user details between the web pages and the back end processes. There are two methods for doing this. This first is to use a time limited hashed string which contains no direct username or password details, the second method is to pass the username and passwords around in plaintext. This method is not recommend except where you do not have the md5 libraries available on your system or you have a completely isolated system with no external access. You can also switch off authentication relaying if your system is isolated in other ways.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" } ], + type => { db_type=>"string", hint=>"hashed|plain|none", pattern=>qr|^([hpn])|i, format=>q( ($1 =~ /^h/) ? "hashed" : ($1 =~ /^p/ ? "plain" : "none" ) ) }, + category => "system", + }, + { + name => "ZM_AUTH_HASH_SECRET", + default => "...Change me to something unique...", + description => "Secret for encoding hashed authentication information", + help => "When ZoneMinder is running in hashed authenticated mode it is necessary to generate hashed strings containing encrypted sensitive information such as usernames and password. Although these string are reasonably secure the addition of a random secret increases security substantially.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" }, { name=>"ZM_AUTH_RELAY", value=>"hashed" } ], + type => $types{string}, + category => "system", + }, + { + name => "ZM_AUTH_HASH_IPS", + default => "yes", + description => "Include IP addresses in the authentication hash", + help => "When ZoneMinder is running in hashed authenticated mode it can optionally include the requesting IP address in the resultant hash. This adds an extra level of security as only requests from that address may use that authentication key. However in some circumstances, such as access over mobile networks, the requesting address can change for each request which will cause most requests to fail. This option allows you to control whether IP addresses are included in the authentication hash on your system. If you experience intermitent problems with authentication, switching this option off may help.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" }, { name=>"ZM_AUTH_RELAY", value=>"hashed" } ], + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_AUTH_HASH_LOGINS", + default => "no", + description => "Allow login by authentication hash", + help => "The normal process for logging into ZoneMinder is via the login screen with username and password. In some circumstances it may be desirable to allow access directly to one or more pages, for instance from a third party application. If this option is enabled then adding an 'auth' parameter to any request will include a shortcut login bypassing the login screen, if not already logged in. As authentication hashes are time and, optionally, IP limited this can allow short-term access to ZoneMinder screens from other web pages etc. In order to use this the calling application will hae to generate the authentication hash itself and ensure it is valid. If you use this option you should ensure that you have modified the ZM_AUTH_HASH_SECRET to somethign unique to your system.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" }, { name=>"ZM_AUTH_RELAY", value=>"hashed" } ], + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_DIR_EVENTS", + default => "events", + description => "Directory where events are stored", + help => "This is the path to the events directory where all the event images and other miscellaneous files are stored. It is normally given as a subdirectory of the web directory you have specified earlier however if disk space is tight it can reside on another partition in which case you should create a link from that area to the path you give here.", + type => $types{directory}, + category => "paths", + }, + { + name => "ZM_USE_DEEP_STORAGE", + default => "yes", + description => "Use a deep filesystem hierarchy for events", + help => "Traditionally ZoneMinder stores all events for a monitor in one directory for that monitor. This is simple and efficient except when you have very large amounts of events. Some filesystems are unable to store more than 32k files in one directory and even without this limitation, large numbers of files in a directory can slow creation and deletion of files. This option allows you to select an alternate method of storing events by year/month/day/hour/min/second which has the effect of separating events out into more directories, resulting in less per directory, and also making it easier to manually navigate to any events that may have happened at a particular time or date.", + type => $types{boolean}, + category => "paths", + }, + { + name => "ZM_DIR_IMAGES", + default => "images", + description => "Directory where the images that the ZoneMinder client generates are stored", + help => "ZoneMinder generates a myriad of images, mosty of which are associated with events. For those that aren't this is where they go.", + type => $types{directory}, + category => "paths", + }, + { + name => "ZM_DIR_SOUNDS", + default => "sounds", + description => "Directory to the sounds that the ZoneMinder client can use", + help => "ZoneMinder can optionally play a sound file when an alarm is detected. This indicates where (relative to the web root) to look for this file.", + type => $types{directory}, + category => "paths", + }, + { + name => "ZM_PATH_ZMS", + default => "/cgi-bin/nph-zms", + description => "Web path to zms streaming server", + help => "The ZoneMinder streaming server is required to send streamed images to your browser. It will be installed into the cgi-bin path given at configuration time. This option determines what the web path to the server is rather than the local path on your machine. Ordinarily the streaming server runs in parser-header mode however if you experience problems with streaming you can change this to non-parsed-header (nph) mode by changing 'zms' to 'nph-zms'.", + type => $types{rel_path}, + category => "paths", + }, + { + name => "ZM_COLOUR_JPEG_FILES", + default => "yes", + description => "Colourise greyscale JPEG files", + help => "Cameras that capture in greyscale can write their captured images to jpeg files with a corresponding greyscale colour space. This saves a small amount of disk space over colour ones. However some tools such as ffmpeg either fail to work with this colour space or have to convert it beforehand. Setting this option to yes uses up a little more space but makes creation of MPEG files much faster.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_ADD_JPEG_COMMENTS", + default => "no", + description => "Add jpeg timestamp annotations as file header comments", + help => "JPEG files may have a number of extra fields added to the file header. The comment field may have any kind of text added. This options allows you to have the same text that is used to annotate the image additionally included as a file header comment. If you archive event images to other locations this may help you locate images for particular events or times if you use software that can read comment headers.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_JPEG_FILE_QUALITY", + default => "70", + description => "Set the JPEG quality setting for the saved event files (1-100)", + help => "When ZoneMinder detects an event it will save the images associated with that event to files. These files are in the JPEG format and can be viewed or streamed later. This option specifies what image quality should be used to save these files. A higher number means better quality but less compression so will take up more disk space and take longer to view over a slow connection. By contrast a low number means smaller, quicker to view, files but at the price of lower quality images. This setting applies to all images written except if the capture image has caused an alarm and the alarm file quality option is set at a higher value when that is used instead.", + type => $types{integer}, + category => "images", + }, + { + name => "ZM_JPEG_ALARM_FILE_QUALITY", + default => "0", + description => "Set the JPEG quality setting for the saved event files during an alarm (1-100)", + help => "This value is equivalent to the regular jpeg file quality setting above except that it only applies to images saved while in an alarm state and then only if this value is set to a higher quality setting than the ordinary file setting. If set to a lower value then it is ignored. Thus leaving it at the default of 0 effectively means to use the regular file quality setting for all saved images. This is to prevent acccidentally saving important images at a worse quality setting.", + type => $types{integer}, + category => "images", + }, + # Deprecated, now stream quality + { + name => "ZM_JPEG_IMAGE_QUALITY", + default => "70", + description => "Set the JPEG quality setting for the streamed 'live' images (1-100)", + help => "When viewing a 'live' stream for a monitor ZoneMinder will grab an image from the buffer and encode it into JPEG format before sending it. This option specifies what image quality should be used to encode these images. A higher number means better quality but less compression so will take longer to view over a slow connection. By contrast a low number means quicker to view images but at the price of lower quality images. This option does not apply when viewing events or still images as these are usually just read from disk and so will be encoded at the quality specified by the previous options.", + type => $types{integer}, + category => "hidden", + }, + { + name => "ZM_JPEG_STREAM_QUALITY", + default => "70", + description => "Set the JPEG quality setting for the streamed 'live' images (1-100)", + help => "When viewing a 'live' stream for a monitor ZoneMinder will grab an image from the buffer and encode it into JPEG format before sending it. This option specifies what image quality should be used to encode these images. A higher number means better quality but less compression so will take longer to view over a slow connection. By contrast a low number means quicker to view images but at the price of lower quality images. This option does not apply when viewing events or still images as these are usually just read from disk and so will be encoded at the quality specified by the previous options.", + type => $types{integer}, + category => "images", + }, + { + name => "ZM_MPEG_TIMED_FRAMES", + default => "yes", + description => "Tag video frames with a timestamp for more realistic streaming", + help => "When using streamed MPEG based video, either for live monitor streams or events, ZoneMinder can send the streams in two ways. If this option is selected then the timestamp for each frame, taken from it's capture time, is included in the stream. This means that where the frame rate varies, for instance around an alarm, the stream will still maintain it's 'real' timing. If this option is not selected then an approximate frame rate is calculated and that is used to schedule frames instead. This option should be selected unless you encounter problems with your preferred streaming method.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_MPEG_LIVE_FORMAT", + default => "swf", + description => "What format 'live' video streams are played in", + help => "When using MPEG mode ZoneMinder can output live video. However what formats are handled by the browser varies greatly between machines. This option allows you to specify a video format using a file extension format, so you would just enter the extension of the file type you would like and the rest is determined from that. The default of 'asf' works well under Windows with Windows Media Player but I'm currently not sure what, if anything, works on a Linux platform. If you find out please let me know! If this option is left blank then live streams will revert to being in motion jpeg format", + type => $types{string}, + category => "images", + }, + { + name => "ZM_MPEG_REPLAY_FORMAT", + default => "swf", + description => "What format 'replay' video streams are played in", + help => "When using MPEG mode ZoneMinder can replay events in encoded video format. However what formats are handled by the browser varies greatly between machines. This option allows you to specify a video format using a file extension format, so you would just enter the extension of the file type you would like and the rest is determined from that. The default of 'asf' works well under Windows with Windows Media Player and 'mpg', or 'avi' etc should work under Linux. If you know any more then please let me know! If this option is left blank then live streams will revert to being in motion jpeg format", + type => $types{string}, + category => "images", + }, + { + name => "ZM_RAND_STREAM", + default => "yes", + description => "Add a random string to prevent caching of streams", + help => "Some browsers can cache the streams used by ZoneMinder. In order to prevent his a harmless random string can be appended to the url to make each invocation of the stream appear unique.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_OPT_CAMBOZOLA", + default => "no", + description => "Is the (optional) cambozola java streaming client installed", + help => "Cambozola is a handy low fat cheese flavoured Java applet that ZoneMinder uses to view image streams on browsers such as Internet Explorer that don't natively support this format. If you use this browser it is highly recommended to install this from http://www.charliemouse.com/code/cambozola/ however if it is not installed still images at a lower refresh rate can still be viewed.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_PATH_CAMBOZOLA", + default => "cambozola.jar", + description => "Web path to (optional) cambozola java streaming client", + help => "Cambozola is a handy low fat cheese flavoured Java applet that ZoneMinder uses to view image streams on browsers such as Internet Explorer that don't natively support this format. If you use this browser it is highly recommended to install this from http://www.charliemouse.com/code/cambozola/ however if it is not installed still images at a lower refresh rate can still be viewed. Leave this as 'cambozola.jar' if cambozola is installed in the same directory as the ZoneMinder web client files.", + requires => [ { name=>"ZM_OPT_CAMBOZOLA", value=>"yes" } ], + type => $types{rel_path}, + category => "images", + }, + { + name => "ZM_RELOAD_CAMBOZOLA", + default => "0", + description => "After how many seconds should Cambozola be reloaded in live view", + help => "Cambozola allows for the viewing of streaming MJPEG however it caches the entire stream into cache space on the computer, setting this to a number > 0 will cause it to automatically reload after that many seconds to avoid filling up a hard drive.", + type => $types{integer}, + category => "images", + }, + { + name => "ZM_TIMESTAMP_ON_CAPTURE", + default => "yes", + description => "Timestamp images as soon as they are captured", + help => "ZoneMinder can add a timestamp to images in two ways. The default method, when this option is set, is that each image is timestamped immediately when captured and so the image held in memory is marked right away. The second method does not timestamp the images until they are either saved as part of an event or accessed over the web. The timestamp used in both methods will contain the same time as this is preserved along with the image. The first method ensures that an image is timestamped regardless of any other circumstances but will result in all images being timestamped even those never saved or viewed. The second method necessitates that saved images are copied before being saved otherwise two timestamps perhaps at different scales may be applied. This has the (perhaps) desirable side effect that the timestamp is always applied at the same resolution so an image that has scaling applied will still have a legible and correctly scaled timestamp.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_CPU_EXTENSIONS", + default => "yes", + description => "Use advanced CPU extensions to increase performance", + help => "When advanced processor extensions such as SSE2 or SSSE3 are available, ZoneMinder can use them, which should increase performance and reduce system load. Enabling this option on processors that do not support the advanced processors extensions used by ZoneMinder is harmless and will have no effect.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_FAST_IMAGE_BLENDS", + default => "yes", + description => "Use a fast algorithm to blend the reference image", + help => "To detect alarms ZoneMinder needs to blend the captured image with the stored reference image to update it for comparison with the next image. The reference blend percentage specified for the monitor controls how much the new image affects the reference image. There are two methods that are available for this. If this option is set then fast calculation which does not use any multiplication or division is used. This calculation is extremely fast, however it limits the possible blend percentages to 50%, 25%, 12.5%, 6.25%, 3.25% and 1.5%. Any other blend percentage will be rounded to the nearest possible one. The alternative is to switch this option off and use standard blending instead, which is slower.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_OPT_ADAPTIVE_SKIP", + default => "yes", + description => "Should frame analysis try and be efficient in skipping frames", + help => "In previous versions of ZoneMinder the analysis daemon would attempt to keep up with the capture daemon by processing the last captured frame on each pass. This would sometimes have the undesirable side-effect of missing a chunk of the initial activity that caused the alarm because the pre-alarm frames would all have to be written to disk and the database before processing the next frame, leading to some delay between the first and second event frames. Setting this option enables a newer adaptive algorithm where the analysis daemon attempts to process as many captured frames as possible, only skipping frames when in danger of the capture daemon overwriting yet to be processed frames. This skip is variable depending on the size of the ring buffer and the amount of space left in it. Enabling this option will give you much better coverage of the beginning of alarms whilst biasing out any skipped frames towards the middle or end of the event. However you should be aware that this will have the effect of making the analysis daemon run somewhat behind the capture daemon during events and for particularly fast rates of capture it is possible for the adaptive algorithm to be overwhelmed and not have time to react to a rapid build up of pending frames and thus for a buffer overrun condition to occur.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_BLEND_ALARMED_IMAGES", + default => "yes", + description => "Blend alarmed images to update the reference image", + help => "To detect alarms ZoneMinder compares an image with a reference image which is formed from a composite of the previous images. This option determines whether images that cause events are included in this process. Doing so may increase the precision of the alarmed region but can cause problems if wholescale lighting changes cause alarms as this would not get fed back into the image and an alarm may persist indefinately. A better way to achive the same effect in most cases is to lower substantially the reference blend percentage in specific monitors.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_MAX_SUSPEND_TIME", + default => "30", + description => "Maximum time that a monitor may have motion detection suspended", + help => "ZoneMinder allows monitors to have motion detection to be suspended, for instance while panning a camera. Ordinarily this relies on the operator resuming motion detection afterwards as failure to do so can leave a monitor in a permanently suspended state. This setting allows you to set a maximum time which a camera may be suspended for before it automatically resumes motion detection. This time can be extended by subsequent suspend indications after the first so continuous camera movement will also occur while the monitor is suspended.", + type => $types{integer}, + category => "config", + }, + # Deprecated, really no longer necessary + { + name => "ZM_OPT_REMOTE_CAMERAS", + default => "no", + description => "Are you going to use remote/networked cameras", + help => "ZoneMinder can work with both local cameras, ie. those attached physically to your computer and remote or network cameras. If you will be using networked cameras select this option.", + type => $types{boolean}, + category => "hidden", + }, + # Deprecated, now set on a per monitor basis using the Method field + { + name => "ZM_NETCAM_REGEXPS", + default => "yes", + description => "Use regular expression matching with network cameras", + help => "Traditionally ZoneMinder has used complex regular regular expressions to handle the multitude of formats that network cameras produce. In versions from 1.21.1 the default is to use a simpler and faster built in pattern matching methodology. This works well with most networks cameras but if you have problems you can try the older, but more flexible, regular expression based method by selecting this option. Note, to use this method you must have libpcre installed on your system.", + requires => [ { name => "ZM_OPT_REMOTE_CAMERAS", value => "yes" } ], + type => $types{boolean}, + category => "hidden", + }, + { + name => "ZM_HTTP_VERSION", + default => "1.1", + description => "The version of HTTP that ZoneMinder will use to connect", + help => "ZoneMinder can communicate with network cameras using either of the HTTP/1.1 or HTTP/1.0 standard. A server will normally fall back to the version it supports iwht no problem so this should usually by left at the default. However it can be changed to HTTP/1.0 if necessary to resolve particular issues.", + type => { db_type=>"string", hint=>"1.1|1.0", pattern=>qr|^(1\.[01])$|, format=>q( $1?$1:"" ) }, + category => "network", + }, + { + name => "ZM_HTTP_UA", + default => "ZoneMinder", + description => "The user agent that ZoneMinder uses to identify itself", + help => "When ZoneMinder communicates with remote cameras it will identify itself using this string and it's version number. This is normally sufficient, however if a particular cameras expects only to communicate with certain browsers then this can be changed to a different string identifying ZoneMinder as Internet Explorer or Netscape etc.", + type => $types{string}, + category => "network", + }, + { + name => "ZM_HTTP_TIMEOUT", + default => "2500", + description => "How long ZoneMinder waits before giving up on images (milliseconds)", + help => "When retrieving remote images ZoneMinder will wait for this length of time before deciding that an image is not going to arrive and taking steps to retry. This timeout is in milliseconds (1000 per second) and will apply to each part of an image if it is not sent in one whole chunk.", + type => $types{integer}, + category => "network", + }, + { + name => "ZM_MIN_RTP_PORT", + default => "40200", + description => "Minimum port that ZoneMinder will listen for RTP traffic on", + help => "When ZoneMinder communicates with MPEG4 capable cameras using RTP with the unicast method it must open ports for the camera to connect back to for control and streaming purposes. This setting specifies the minimum port number that ZoneMinder will use. Ordinarily two adjacent ports are used for each camera, one for control packets and one for data packets. This port should be set to an even number, you may also need to open up a hole in your firewall to allow cameras to connect back if you wish to use unicasting.", + type => $types{integer}, + category => "network", + }, + { + name => "ZM_MAX_RTP_PORT", + default => "40499", + description => "Maximum port that ZoneMinder will listen for RTP traffic on", + help => "When ZoneMinder communicates with MPEG4 capable cameras using RTP with the unicast method it must open ports for the camera to connect back to for control and streaming purposes. This setting specifies the maximum port number that ZoneMinder will use. Ordinarily two adjacent ports are used for each camera, one for control packets and one for data packets. This port should be set to an even number, you may also need to open up a hole in your firewall to allow cameras to connect back if you wish to use unicasting. You should also ensure that you have opened up at least two ports for each monitor that will be connecting to unicasting network cameras.", + type => $types{integer}, + category => "network", + }, + { + name => "ZM_OPT_FFMPEG", + default => "@OPT_FFMPEG@", + description => "Is the ffmpeg video encoder/decoder installed", + help => "ZoneMinder can optionally encode a series of video images into an MPEG encoded movie file for viewing, downloading or storage. This option allows you to specify whether you have the ffmpeg tools installed. Note that creating MPEG files can be fairly CPU and disk intensive and is not a required option as events can still be reviewed as video streams without it.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_PATH_FFMPEG", + default => "@PATH_FFMPEG@", + description => "Path to (optional) ffmpeg mpeg encoder", + help => "This path should point to where ffmpeg has been installed.", + requires => [ { name=>"ZM_OPT_FFMPEG", value=>"yes" } ], + type => $types{abs_path}, + category => "images", + }, + { + name => "ZM_FFMPEG_INPUT_OPTIONS", + default => "", + description => "Additional input options to ffmpeg", + help => "Ffmpeg can take many options on the command line to control the quality of video produced. This option allows you to specify your own set that apply to the input to ffmpeg (options that are given before the -i option). Check the ffmpeg documentation for a full list of options which may be used here.", + requires => [ { name=>"ZM_OPT_FFMPEG", value=>"yes" } ], + type => $types{string}, + category => "images", + }, + { + name => "ZM_FFMPEG_OUTPUT_OPTIONS", + default => "-r 25", + description => "Additional output options to ffmpeg", + help => "Ffmpeg can take many options on the command line to control the quality of video produced. This option allows you to specify your own set that apply to the output from ffmpeg (options that are given after the -i option). Check the ffmpeg documentation for a full list of options which may be used here. The most common one will often be to force an output frame rate supported by the video encoder.", + requires => [ { name=>"ZM_OPT_FFMPEG", value=>"yes" } ], + type => $types{string}, + category => "images", + }, + { + name => "ZM_FFMPEG_FORMATS", + default => "mpg mpeg wmv asf avi* mov swf 3gp**", + description => "Formats to allow for ffmpeg video generation", + help => "Ffmpeg can generate video in many different formats. This option allows you to list the ones you want to be able to select. As new formats are supported by ffmpeg you can add them here and be able to use them immediately. Adding a '*' after a format indicates that this will be the default format used for web video, adding '**' defines the default format for phone video.", + requires => [ { name=>"ZM_OPT_FFMPEG", value=>"yes" } ], + type => $types{string}, + category => "images", + }, + { + name => "ZM_LOG_LEVEL_SYSLOG", + default => "0", + description => "Save logging output to the system log", + help => "ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output that goes to the system log. ZoneMinder binaries have always logged to the system log but now scripts and web logging is also included. To preserve the previous behaviour you should ensure this value is set to Info or Warning. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance. If you want debug you will also need to set a level and component below", + type => { db_type=>"integer", hint=>"None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_LEVEL_FILE", + default => "-5", + description => "Save logging output to component files", + help => "ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output that goes to individual log files written by specific components. This is how logging worked previously and although useful for tracking down issues in specific components it also resulted in many disparate log files. To preserve this behaviour you should ensure this value is set to Info or Warning. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance though file output has less impact than the other options. If you want debug you will also need to set a level and component below", + type => { db_type=>"integer", hint=>"None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_LEVEL_WEBLOG", + default => "-5", + description => "Save logging output to the weblog", + help => "ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output from the web interface that goes to the httpd error log. Note that only web logging from PHP and JavaScript files is included and so this option is really only useful for investigating specific issues with those components. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance. If you want debug you will also need to set a level and component below", + type => { db_type=>"integer", hint=>"None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_LEVEL_DATABASE", + default => "0", + description => "Save logging output to the database", + help => "ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output that is written to the database. This is a new option which can make viewing logging output easier and more intuitive and also makes it easier to get an overall impression of how the system is performing. If you have a large or very busy system then it is possible that use of this option may slow your system down if the table becomes very large. Ensure you use the LOG_DATABASE_LIMIT option to keep the table to a manageable size. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance. If you want debug you will also need to set a level and component below", + type => { db_type=>"integer", hint=>"None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_DATABASE_LIMIT", + default => "7 day", + description => "Maximum number of log entries to retain", + help => "If you are using database logging then it is possible to quickly build up a large number of entries in the Logs table. This option allows you to specify how many of these entries are kept. If you set this option to a number greater than zero then that number is used to determine the maximum number of rows, less than or equal to zero indicates no limit and is not recommended. You can also set this value to time values such as ' day' which will limit the log entries to those newer than that time. You can specify 'hour', 'day', 'week', 'month' and 'year', note that the values should be singular (no 's' at the end). The Logs table is pruned periodically so it is possible for more than the expected number of rows to be present briefly in the meantime.", + type => $types{string}, + category => "logging", + }, + { + name => "ZM_LOG_DEBUG", + default => "no", + description => "Switch debugging on", + help => "ZoneMinder components usually support debug logging available to help with diagnosing problems. Binary components have several levels of debug whereas more other components have only one. Normally this is disabled to minimise performance penalties and avoid filling logs too quickly. This option lets you switch on other options that allow you to configure additional debug information to be output. Components will pick up this instruction when they are restarted.", + type => $types{boolean}, + category => "logging", + }, + { + name => "ZM_LOG_DEBUG_TARGET", + default => "", + description => "What components should have extra debug enabled", + help => "There are three scopes of debug available. Leaving this option blank means that all components will use extra debug (not recommended). Setting this option to '_', e.g. _zmc, will limit extra debug to that component only. Setting this option to '__', e.g. '_zmc_m1' will limit extra debug to that instance of the component only. This is ordinarily what you probably want to do. To debug scripts use their names without the .pl extension, e.g. '_zmvideo' and to debug issues with the web interface use '_web'. You can specify multiple targets by separating them with '|' characters.", + requires => [ { name => "ZM_LOG_DEBUG", value => "yes" } ], + type => $types{string}, + category => "logging", + }, + { + name => "ZM_LOG_DEBUG_LEVEL", + default => 1, + description => "What level of extra debug should be enabled", + help => "There are 9 levels of debug available, with higher numbers being more debug and level 0 being no debug. However not all levels are used by all components. Also if there is debug at a high level it is usually likely to be output at such a volume that it may obstruct normal operation. For this reason you should set the level carefully and cautiously until the degree of debug you wish to see is present. Scripts and the web interface only have one level so this is an on/off type option for them.", + requires => [ { name => "ZM_LOG_DEBUG", value => "yes" } ], + type => { db_type=>"integer", hint=>"1|2|3|4|5|6|7|8|9", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_DEBUG_FILE", + default => "@ZM_TMPDIR@/zm_debug.log+", + description => "Where extra debug is output to", + help => "This option allows you to specify a different target for debug output. All components have a default log file which will norally be in /tmp or /var/log and this is where debug will be written to if this value is empty. Adding a path here will temporarily redirect debug, and other logging output, to this file. This option is a simple filename and you are debugging several components then they will all try and write to the same file with undesirable consequences. Appending a '+' to the filename will cause the file to be created with a '.' suffix containing your process id. In this way debug from each run of a component is kept separate. This is the recommended setting as it will also prevent subsequent runs from overwriting the same log. You should ensure that permissions are set up to allow writing to the file and directory specified here.", + requires => [ { name => "ZM_LOG_DEBUG", value => "yes" } ], + type => $types{string}, + category => "logging", + }, + { + name => "ZM_LOG_CHECK_PERIOD", + default => "900", + description => "Time period used when calculating overall system health", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to indicate what period of historical events are used in this calculation. This value is expressed in seconds and is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALERT_WAR_COUNT", + default => "1", + description => "Number of warnings indicating system alert state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many warnings must have occurred within the defined time period to generate an overall system alert state. A value of zero means warnings are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALERT_ERR_COUNT", + default => "1", + description => "Number of errors indicating system alert state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many errors must have occurred within the defined time period to generate an overall system alert state. A value of zero means errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALERT_FAT_COUNT", + default => "0", + description => "Number of fatal error indicating system alert state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many fatal errors (including panics) must have occurred within the defined time period to generate an overall system alert state. A value of zero means fatal errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALARM_WAR_COUNT", + default => "100", + description => "Number of warnings indicating system alarm state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many warnings must have occurred within the defined time period to generate an overall system alarm state. A value of zero means warnings are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALARM_ERR_COUNT", + default => "10", + description => "Number of errors indicating system alarm state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many errors must have occurred within the defined time period to generate an overall system alarm state. A value of zero means errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALARM_FAT_COUNT", + default => "1", + description => "Number of fatal error indicating system alarm state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many fatal errors (including panics) must have occurred within the defined time period to generate an overall system alarm state. A value of zero means fatal errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_RECORD_EVENT_STATS", + default => "yes", + description => "Record event statistical information, switch off if too slow", + help => "This version of ZoneMinder records detailed information about events in the Stats table. This can help in profiling what the optimum settings are for Zones though this is tricky at present. However in future releases this will be done more easily and intuitively, especially with a large sample of events. The default option of 'yes' allows this information to be collected now in readiness for this but if you are concerned about performance you can switch this off in which case no Stats information will be saved.", + type => $types{boolean}, + category => "logging", + }, + { + name => "ZM_RECORD_DIAG_IMAGES", + default => "no", + description => "Record intermediate alarm diagnostic images, can be very slow", + help => "In addition to recording event statistics you can also record the intermediate diagnostic images that display the results of the various checks and processing that occur when trying to determine if an alarm event has taken place. There are several of these images generated for each frame and zone for each alarm or alert frame so this can have a massive impact on performance. Only switch this setting on for debug or analysis purposes and remember to switch it off again once no longer required.", + type => $types{boolean}, + category => "logging", + }, + { + name => "ZM_DUMP_CORES", + default => "no", + description => "Create core files on unexpected process failure.", + help => "When an unrecoverable error occurs in a ZoneMinder binary process is has traditionally been trapped and the details written to logs to aid in remote analysis. However in some cases it is easier to diagnose the error if a core file, which is a memory dump of the process at the time of the error, is created. This can be interactively analysed in the debugger and may reveal more or better information than that available from the logs. This option is recommended for advanced users only otherwise leave at the default. Note using this option to trigger core files will mean that there will be no indication in the binary logs that a process has died, they will just stop, however the zmdc log will still contain an entry. Also note that you may have to explicitly enable core file creation on your system via the 'ulimit -c' command or other means otherwise no file will be created regardless of the value of this option.", + type => $types{boolean}, + category => "logging", + }, + { + name => "ZM_PATH_MAP", + default => "/dev/shm", + description => "Path to the mapped memory files that that ZoneMinder can use", + help => "ZoneMinder has historically used IPC shared memory for shared data between processes. This has it's advantages and limitations. This version of ZoneMinder can use an alternate method, mapped memory, instead with can be enabled with the --enable--mmap directive to configure. This requires less system configuration and is generally more flexible. However it requires each shared data segment to map onto a filesystem file. This option indicates where those mapped files go. You should ensure that this location has sufficient space for these files and for the best performance it should be a tmpfs file system or ramdisk otherwise disk access may render this method slower than the regular shared memory one.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_PATH_SOCKS", + default => "@ZM_TMPDIR@", + description => "Path to the various Unix domain socket files that ZoneMinder uses", + help => "ZoneMinder generally uses Unix domain sockets where possible. This reduces the need for port assignments and prevents external applications from possibly compromising the daemons. However each Unix socket requires a .sock file to be created. This option indicates where those socket files go.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_PATH_LOGS", + default => "@ZM_LOGDIR@", + description => "Path to the various logs that the ZoneMinder daemons generate", + help => "There are various daemons that are used by ZoneMinder to perform various tasks. Most generate helpful log files and this is where they go. They can be deleted if not required for debugging.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_PATH_SWAP", + default => "@ZM_TMPDIR@", + description => "Path to location for temporary swap images used in streaming", + help => "Buffered playback requires temporary swap images to be stored for each instance of the streaming daemons. This option determines where these images will be stored. The images will actually be stored in sub directories beneath this location and will be automatically cleaned up after a period of time.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_WEB_TITLE_PREFIX", + default => "ZM", + description => "The title prefix displayed on each window", + help => "If you have more than one installation of ZoneMinder it can be helpful to display different titles for each one. Changing this option allows you to customise the window titles to include further information to aid identification.", + type => $types{string}, + category => "web", + }, + { + name => "ZM_WEB_RESIZE_CONSOLE", + default => "yes", + description => "Should the console window resize itself to fit", + help => "Traditionally the main ZoneMinder web console window has resized itself to shrink to a size small enough to list only the monitors that are actually present. This is intended to make the window more unobtrusize but may not be to everyones tastes, especially if opened in a tab in browsers which support this kind if layout. Switch this option off to have the console window size left to the users preference", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_WEB_POPUP_ON_ALARM", + default => "yes", + description => "Should the monitor window jump to the top if an alarm occurs", + help => "When viewing a live monitor stream you can specify whether you want the window to pop to the front if an alarm occurs when the window is minimised or behind another window. This is most useful if your monitors are over doors for example when they can pop up if someone comes to the doorway.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_OPT_X10", + default => "no", + description => "Support interfacing with X10 devices", + help => "If you have an X10 Home Automation setup in your home you can use ZoneMinder to initiate or react to X10 signals if your computer has the appropriate interface controller. This option indicates whether X10 options will be available in the browser client.", + type => $types{boolean}, + category => "x10", + }, + { + name => "ZM_X10_DEVICE", + default => "/dev/ttyS0", + description => "What device is your X10 controller connected on", + requires => [ { name => "ZM_OPT_X10", value => "yes" } ], + help => "If you have an X10 controller device (e.g. XM10U) connected to your computer this option details which port it is conected on, the default of /dev/ttyS0 maps to serial or com port 1.", + type => $types{abs_path}, + category => "x10", + }, + { + name => "ZM_X10_HOUSE_CODE", + default => "A", + description => "What X10 house code should be used", + requires => [ { name => "ZM_OPT_X10", value => "yes" } ], + help => "X10 devices are grouped together by identifying them as all belonging to one House Code. This option details what that is. It should be a single letter between A and P.", + type => { db_type=>"string", hint=>"A-P", pattern=>qr|^([A-P])|i, format=>q( uc($1) ) }, + category => "x10", + }, + { + name => "ZM_X10_DB_RELOAD_INTERVAL", + default => "60", + description => "How often (in seconds) the X10 daemon reloads the monitors from the database", + requires => [ { name => "ZM_OPT_X10", value => "yes" } ], + help => "The zmx10 daemon periodically checks the database to find out what X10 events trigger, or result from, alarms. This option determines how frequently this check occurs, unless you change this area frequently this can be a fairly large value.", + type => $types{integer}, + category => "x10", + }, + { + name => "ZM_WEB_SOUND_ON_ALARM", + default => "no", + description => "Should the monitor window play a sound if an alarm occurs", + help => "When viewing a live monitor stream you can specify whether you want the window to play a sound to alert you if an alarm occurs.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_WEB_ALARM_SOUND", + default => "", + description => "The sound to play on alarm, put this in the sounds directory", + help => "You can specify a sound file to play if an alarm occurs whilst you are watching a live monitor stream. So long as your browser understands the format it does not need to be any particular type. This file should be placed in the sounds directory defined earlier.", + type => $types{file}, + requires => [ { name => "ZM_WEB_SOUND_ON_ALARM", value => "yes" } ], + category => "web", + }, + { + name => "ZM_WEB_COMPACT_MONTAGE", + default => "no", + description => "Compact the montage view by removing extra detail", + help => "The montage view shows the output of all of your active monitors in one window. This include a small menu and status information for each one. This can increase the web traffic and make the window larger than may be desired. Setting this option on removes all this extraneous information and just displays the images.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_OPT_FAST_DELETE", + default => "yes", + description => "Delete only event database records for speed", + help => "Normally an event created as the result of an alarm consists of entries in one or more database tables plus the various files associated with it. When deleting events in the browser it can take a long time to remove all of this if your are trying to do a lot of events at once. It is recommended that you set this option which means that the browser client only deletes the key entries in the events table, which means the events will no longer appear in the listing, and leaves the zmaudit daemon to clear up the rest later.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_STRICT_VIDEO_CONFIG", + default => "yes", + description => "Allow errors in setting video config to be fatal", + help => "With some video devices errors can be reported in setting the various video attributes when in fact the operation was successful. Switching this option off will still allow these errors to be reported but will not cause them to kill the video capture daemon. Note however that doing this will cause all errors to be ignored including those which are genuine and which may cause the video capture to not function correctly. Use this option with caution.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_SIGNAL_CHECK_POINTS", + default => "10", + description => "How many points in a captured image to check for signal loss", + help => "For locally attached video cameras ZoneMinder can check for signal loss by looking at a number of random points on each captured image. If all of these points are set to the same fixed colour then the camera is assumed to have lost signal. When this happens any open events are closed and a short one frame signal loss event is generated, as is another when the signal returns. This option defines how many points on each image to check. Note that this is a maximum, any points found to not have the check colour will abort any further checks so in most cases on a couple of points will actually be checked. Network and file based cameras are never checked.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_V4L_MULTI_BUFFER", + default => "yes", + description => "Use more than one buffer for Video 4 Linux devices", + help => "Performance when using Video 4 Linux devices is usually best if multiple buffers are used allowing the next image to be captured while the previous one is being processed. If you have multiple devices on a card sharing one input that requires switching then this approach can sometimes cause frames from one source to be mixed up with frames from another. Switching this option off prevents multi buffering resulting in slower but more stable image capture. This option is ignored for non-local cameras or if only one input is present on a capture chip. This option addresses a similar problem to the ZM_CAPTURES_PER_FRAME option and you should normally change the value of only one of the options at a time.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_CAPTURES_PER_FRAME", + default => "1", + description => "How many images are captured per returned frame, for shared local cameras", + help => "If you are using cameras attached to a video capture card which forces multiple inputs to share one capture chip, it can sometimes produce images with interlaced frames reversed resulting in poor image quality and a distinctive comb edge appearance. Increasing this setting allows you to force additional image captures before one is selected as the captured frame. This allows the capture hardware to 'settle down' and produce better quality images at the price of lesser capture rates. This option has no effect on (a) network cameras, or (b) where multiple inputs do not share a capture chip. This option addresses a similar problem to the ZM_V4L_MULTI_BUFFER option and you should normally change the value of only one of the options at a time.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_FILTER_RELOAD_DELAY", + default => "300", + description => "How often (in seconds) filters are reloaded in zmfilter", + help => "ZoneMinder allows you to save filters to the database which allow events that match certain criteria to be emailed, deleted or uploaded to a remote machine etc. The zmfilter daemon loads these and does the actual operation. This option determines how often the filters are reloaded from the database to get the latest versions or new filters. If you don't change filters very often this value can be set to a large value.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_FILTER_EXECUTE_INTERVAL", + default => "60", + description => "How often (in seconds) to run automatic saved filters", + help => "ZoneMinder allows you to save filters to the database which allow events that match certain criteria to be emailed, deleted or uploaded to a remote machine etc. The zmfilter daemon loads these and does the actual operation. This option determines how often the filters are executed on the saved event in the database. If you want a rapid response to new events this should be a smaller value, however this may increase the overall load on the system and affect performance of other elements.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_OPT_UPLOAD", + default => "no", + description => "Should ZoneMinder support uploading events from filters", + help => "In ZoneMinder you can create event filters that specify whether events that match certain criteria should be uploaded to a remote server for archiving. This option specifies whether this functionality should be available", + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_UPLOAD_ARCH_FORMAT", + default => "tar", + description => "What format the uploaded events should be created in.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + help => "Uploaded events may be stored in either .tar or .zip format, this option specifies which. Note that to use this you will need to have the Archive::Tar and/or Archive::Zip perl modules installed.", + type => { db_type=>"string", hint=>"tar|zip", pattern=>qr|^([tz])|i, format=>q( $1 =~ /^t/ ? "tar" : "zip" ) }, + category => "upload", + }, + { + name => "ZM_UPLOAD_ARCH_COMPRESS", + default => "no", + description => "Should archive files be compressed", + help => "When the archive files are created they can be compressed. However in general since the images are compressed already this saves only a minimal amount of space versus utilising more CPU in their creation. Only enable if you have CPU to waste and are limited in disk space on your remote server or bandwidth.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_UPLOAD_ARCH_ANALYSE", + default => "no", + description => "Include the analysis files in the archive", + help => "When the archive files are created they can contain either just the captured frames or both the captured frames and, for frames that caused an alarm, the analysed image with the changed area highlighted. This option controls files are included. Only include analysed frames if you have a high bandwidth connection to the remote server or if you need help in figuring out what caused an alarm in the first place as archives with these files in can be considerably larger.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_UPLOAD_PROTOCOL", + default => "ftp", + description => "What protocol to use to upload events", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + help => "ZoneMinder can upload events to a remote server using either FTP or SFTP. Regular FTP is widely supported but not necessarily very secure whereas SFTP (Secure FTP) runs over an ssh connection and so is encrypted and uses regular ssh ports. Note that to use this you will need to have the appropriate perl module, either Net::FTP or Net::SFTP installed depending on your choice.", + type => { db_type=>"string", hint=>"ftp|sftp", pattern=>qr|^([tz])|i, format=>q( $1 =~ /^f/ ? "ftp" : "sftp" ) }, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_HOST", + default => "", + description => "The remote server to upload to", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the name, or ip address, of the server to use.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{hostname}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_HOST", + default => "", + description => "The remote server to upload events to", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the name, or ip address, of the server to use.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{hostname}, + category => "upload", + }, + { + name => "ZM_UPLOAD_PORT", + default => "", + description => "The port on the remote upload server, if not the default (SFTP only)", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. If you are using the SFTP protocol then this option allows you to specify a particular port to use for connection. If this option is left blank then the default, port 22, is used. This option is ignored for FTP uploads.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{integer}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_USER", + default => "", + description => "Your ftp username", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the username that ZoneMinder should use to log in for ftp transfer.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{alphanum}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_USER", + default => "", + description => "Remote server username", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the username that ZoneMinder should use to log in for transfer.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{alphanum}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_PASS", + default => "", + description => "Your ftp password", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the password that ZoneMinder should use to log in for ftp transfer.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{string}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_PASS", + default => "", + description => "Remote server password", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the password that ZoneMinder should use to log in for transfer. If you are using certicate based logins for SFTP servers you can leave this option blank.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{string}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_LOC_DIR", + default => "@ZM_TMPDIR@", + description => "The local directory in which to create upload files", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the local directory that ZoneMinder should use for temporary upload files. These are files that are created from events, uploaded and then deleted.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{abs_path}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_LOC_DIR", + default => "@ZM_TMPDIR@", + description => "The local directory in which to create upload files", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the local directory that ZoneMinder should use for temporary upload files. These are files that are created from events, uploaded and then deleted.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{abs_path}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_REM_DIR", + default => "", + description => "The remote directory to upload to", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the remote directory that ZoneMinder should use to upload event files to.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{rel_path}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_REM_DIR", + default => "", + description => "The remote directory to upload to", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the remote directory that ZoneMinder should use to upload event files to.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{rel_path}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_TIMEOUT", + default => "120", + description => "How long to allow the transfer to take for each file", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the maximum ftp inactivity timeout (in seconds) that should be tolerated before ZoneMinder determines that the transfer has failed and closes down the connection.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{integer}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_TIMEOUT", + default => "120", + description => "How long to allow the transfer to take for each file", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the maximum inactivity timeout (in seconds) that should be tolerated before ZoneMinder determines that the transfer has failed and closes down the connection.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{integer}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_PASSIVE", + default => "yes", + description => "Use passive ftp when uploading", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates that ftp transfers should be done in passive mode. This uses a single connection for all ftp activity and, whilst slower than active transfers, is more robust and likely to work from behind filewalls. This option is ignored for SFTP transfers.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + help => "If your computer is behind a firewall or proxy you may need to set FTP to passive mode. In fact for simple transfers it makes little sense to do otherwise anyway but you can set this to 'No' if you wish.", + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_DEBUG", + default => "no", + description => "Switch ftp debugging on", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. If you are having (or expecting) troubles with uploading events then setting this to 'yes' permits additional information to be included in the zmfilter log file.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{boolean}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_DEBUG", + default => "no", + description => "Switch upload debugging on", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. If you are having (or expecting) troubles with uploading events then setting this to 'yes' permits additional information to be generated by the underlying transfer modules and included in the logs.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_OPT_EMAIL", + default => "no", + description => "Should ZoneMinder email you details of events that match corresponding filters", + help => "In ZoneMinder you can create event filters that specify whether events that match certain criteria should have their details emailed to you at a designated email address. This will allow you to be notified of events as soon as they occur and also to quickly view the events directly. This option specifies whether this functionality should be available. The email created with this option can be any size and is intended to be sent to a regular email reader rather than a mobile device.", + type => $types{boolean}, + category => "mail", + }, + { + name => "ZM_EMAIL_ADDRESS", + default => "", + description => "The email address to send matching event details to", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" } ], + help => "This option is used to define the email address that any events that match the appropriate filters will be sent to.", + type => $types{email}, + category => "mail", + }, + { + name => "ZM_EMAIL_TEXT", + default => 'subject = "ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)" +body = " +Hello, + +An alarm has been detected on your installation of the ZoneMinder. + +The details are as follows :- + + Monitor : %MN% + Event Id : %EI% + Length : %EL% + Frames : %EF% (%EFA%) + Scores : t%EST% m%ESM% a%ESA% + +This alarm was matched by the %FN% filter and can be viewed at %EPS% + +ZoneMinder"', + description => "The text of the email used to send matching event details", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" } ], + help => "This option is used to define the content of the email that is sent for any events that match the appropriate filters.", + type => $types{text}, + category => "hidden", + }, + { + name => "ZM_EMAIL_SUBJECT", + default => "ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)", + description => "The subject of the email used to send matching event details", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" } ], + help => "This option is used to define the subject of the email that is sent for any events that match the appropriate filters.", + type => $types{string}, + category => "mail", + }, + { + name => "ZM_EMAIL_BODY", + default => " +Hello, + +An alarm has been detected on your installation of the ZoneMinder. + +The details are as follows :- + + Monitor : %MN% + Event Id : %EI% + Length : %EL% + Frames : %EF% (%EFA%) + Scores : t%EST% m%ESM% a%ESA% + +This alarm was matched by the %FN% filter and can be viewed at %EPS% + +ZoneMinder", + description => "The body of the email used to send matching event details", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" } ], + help => "This option is used to define the content of the email that is sent for any events that match the appropriate filters.", + type => $types{text}, + category => "mail", + }, + { + name => "ZM_OPT_MESSAGE", + default => "no", + description => "Should ZoneMinder message you with details of events that match corresponding filters", + help => "In ZoneMinder you can create event filters that specify whether events that match certain criteria should have their details sent to you at a designated short message email address. This will allow you to be notified of events as soon as they occur. This option specifies whether this functionality should be available. The email created by this option will be brief and is intended to be sent to an SMS gateway or a minimal mail reader such as a mobile device or phone rather than a regular email reader.", + type => $types{boolean}, + category => "mail", + }, + { + name => "ZM_MESSAGE_ADDRESS", + default => "", + description => "The email address to send matching event details to", + requires => [ { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "This option is used to define the short message email address that any events that match the appropriate filters will be sent to.", + type => $types{email}, + category => "mail", + }, + { + name => "ZM_MESSAGE_TEXT", + default => 'subject = "ZoneMinder: Alarm - %MN%-%EI%" +body = "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score."', + description => "The text of the message used to send matching event details", + requires => [ { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "This option is used to define the content of the message that is sent for any events that match the appropriate filters.", + type => $types{text}, + category => "hidden", + }, + { + name => "ZM_MESSAGE_SUBJECT", + default => "ZoneMinder: Alarm - %MN%-%EI%", + description => "The subject of the message used to send matching event details", + requires => [ { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "This option is used to define the subject of the message that is sent for any events that match the appropriate filters.", + type => $types{string}, + category => "mail", + }, + { + name => "ZM_MESSAGE_BODY", + default => "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.", + description => "The body of the message used to send matching event details", + requires => [ { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "This option is used to define the content of the message that is sent for any events that match the appropriate filters.", + type => $types{text}, + category => "mail", + }, + { + name => "ZM_NEW_MAIL_MODULES", + default => "no", + description => "Use a newer perl method to send emails", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" }, { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "Traditionally ZoneMinder has used the MIME::Entity perl module to construct and send notification emails and messages. Some people have reported problems with this module not being present at all or flexible enough for their needs. If you are one of those people this option allows you to select a new mailing method using MIME::Lite and Net::SMTP instead. This method was contributed by Ross Melin and should work for everyone but has not been extensively tested so currently is not selected by default.", + type => $types{boolean}, + category => "mail", + }, + { + name => "ZM_EMAIL_HOST", + default => "localhost", + description => "The host address of your SMTP mail server", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" }, { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "If you have chosen SMTP as the method by which to send notification emails or messages then this option allows you to choose which SMTP server to use to send them. The default of localhost may work if you have the sendmail, exim or a similar daemon running however you may wish to enter your ISP's SMTP mail server here.", + type => $types{hostname}, + category => "mail", + }, + { + name => "ZM_FROM_EMAIL", + default => "", + description => "The email address you wish your event notifications to originate from", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" }, { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "The emails or messages that will be sent to you informing you of events can appear to come from a designated email address to help you with mail filtering etc. An address of something like ZoneMinder\@your.domain is recommended.", + type => $types{email}, + category => "mail", + }, + { + name => "ZM_URL", + default => "", + description => "The URL of your ZoneMinder installation", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" }, { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "The emails or messages that will be sent to you informing you of events can include a link to the events themselves for easy viewing. If you intend to use this feature then set this option to the url of your installation as it would appear from where you read your email, e.g. http://host.your.domain/zm.php.", + type => $types{url}, + category => "mail", + }, + { + name => "ZM_MAX_RESTART_DELAY", + default => "600", + description => "Maximum delay (in seconds) for daemon restart attempts.", + help => "The zmdc (zm daemon control) process controls when processeses are started or stopped and will attempt to restart any that fail. If a daemon fails frequently then a delay is introduced between each restart attempt. If the daemon stills fails then this delay is increased to prevent extra load being placed on the system by continual restarts. This option controls what this maximum delay is.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_WATCH_CHECK_INTERVAL", + default => "10", + description => "How often to check the capture daemons have not locked up", + help => "The zmwatch daemon checks the image capture performance of the capture daemons to ensure that they have not locked up (rarely a sync error may occur which blocks indefinately). This option determines how often the daemons are checked.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_WATCH_MAX_DELAY", + default => "5", + description => "The maximum delay allowed since the last captured image", + help => "The zmwatch daemon checks the image capture performance of the capture daemons to ensure that they have not locked up (rarely a sync error may occur which blocks indefinately). This option determines the maximum delay to allow since the last captured frame. The daemon will be restarted if it has not captured any images after this period though the actual restart may take slightly longer in conjunction with the check interval value above.", + type => $types{decimal}, + category => "system", + }, + { + + name => "ZM_RUN_AUDIT", + default => "yes", + description => "Run zmaudit to check data consistency", + help => "The zmaudit daemon exists to check that the saved information in the database and on the filesystem match and are consistent with each other. If an error occurs or if you are using 'fast deletes' it may be that database records are deleted but files remain. In this case, and similar, zmaudit will remove redundant information to synchronise the two data stores. This option controls whether zmaudit is run in the background and performs these checks and fixes continuously. This is recommended for most systems however if you have a very large number of events the process of scanning the database and filesystem may take a long time and impact performance. In this case you may prefer to not have zmaudit running unconditionally and schedule occasional checks at other, more convenient, times.", + type => $types{boolean}, + category => "system", + }, + { + + name => "ZM_AUDIT_CHECK_INTERVAL", + default => "900", + description => "How often to check database and filesystem consistency", + help => "The zmaudit daemon exists to check that the saved information in the database and on the filesystem match and are consistent with each other. If an error occurs or if you are using 'fast deletes' it may be that database records are deleted but files remain. In this case, and similar, zmaudit will remove redundant information to synchronise the two data stores. The default check interval of 900 seconds (15 minutes) is fine for most systems however if you have a very large number of events the process of scanning the database and filesystem may take a long time and impact performance. In this case you may prefer to make this interval much larger to reduce the impact on your system. This option determines how often these checks are performed.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_FORCED_ALARM_SCORE", + default => "255", + description => "Score to give forced alarms", + help => "The 'zmu' utility can be used to force an alarm on a monitor rather than rely on the motion detection algorithms. This option determines what score to give these alarms to distinguish them from regular ones. It must be 255 or less.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_BULK_FRAME_INTERVAL", + default => "100", + description => "How often a bulk frame should be written to the database", + help => "Traditionally ZoneMinder writes an entry into the Frames database table for each frame that is captured and saved. This works well in motion detection scenarios but when in a DVR situation ('Record' or 'Mocord' mode) this results in a huge number of frame writes and a lot of database and disk bandwidth for very little additional information. Setting this to a non-zero value will enabled ZoneMinder to group these non-alarm frames into one 'bulk' frame entry which saves a lot of bandwidth and space. The only disadvantage of this is that timing information for individual frames is lost but in constant frame rate situations this is usually not significant. This setting is ignored in Modect mode and individual frames are still written if an alarm occurs in Mocord mode also.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_EVENT_CLOSE_MODE", + default => "idle", + description => "When continuous events are closed.", + help => "When a monitor is running in a continuous recording mode (Record or Mocord) events are usually closed after a fixed period of time (the section length). However in Mocord mode it is possible that motion detection may occur near the end of a section. This option controls what happens when an alarm occurs in Mocord mode. The 'time' setting means that the event will be closed at the end of the section regardless of alarm activity. The 'idle' setting means that the event will be closed at the end of the section if there is no alarm activity occuring at the time otherwise it will be closed once the alarm is over meaning the event may end up being longer than the normal section length. The 'alarm' setting means that if an alarm occurs during the event, the event will be closed once the alarm is over regardless of when this occurs. This has the effect of limiting the number of alarms to one per event and the events will be shorter than the section length if an alarm has occurred.", + type => $types{boolean}, + type => { db_type=>"string", hint=>"time|idle|alarm", pattern=>qr|^([tia])|i, format=>q( ($1 =~ /^t/) ? "time" : ($1 =~ /^i/ ? "idle" : "time" ) ) }, + category => "config", + }, + # Deprecated, superseded by event close mode + { + name => "ZM_FORCE_CLOSE_EVENTS", + default => "no", + description => "Close events at section ends.", + help => "When a monitor is running in a continuous recording mode (Record or Mocord) events are usually closed after a fixed period of time (the section length). However in Mocord mode it is possible that motion detection may occur near the end of a section and ordinarily this will prevent the event being closed until the motion has ceased. Switching this option on will force the event closed at the specified time regardless of any motion activity.", + type => $types{boolean}, + category => "hidden", + }, + { + name => "ZM_CREATE_ANALYSIS_IMAGES", + default => "yes", + description => "Create analysed alarm images with motion outlined", + help => "By default during an alarm ZoneMinder records both the raw captured image and one that has been analysed and had areas where motion was detected outlined. This can be very useful during zone configuration or in analysing why events occured. However it also incurs some overhead and in a stable system may no longer be necessary. This parameter allows you to switch the generation of these images off.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_WEIGHTED_ALARM_CENTRES", + default => "no", + description => "Use a weighted algorithm to calculate the centre of an alarm", + help => "ZoneMinder will always calculate the centre point of an alarm in a zone to give some indication of where on the screen it is. This can be used by the experimental motion tracking feature or your own custom extensions. In the alarmed or filtered pixels mode this is a simple midpoint between the extents of the detected pxiesl. However in the blob method this can instead be calculated using weighted pixel locations to give more accurate positioning for irregularly shaped blobs. This method, while more precise is also slower and so is turned off by default.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_EVENT_IMAGE_DIGITS", + default => "3", + description => "How many significant digits are used in event image numbering", + help => "As event images are captured they are stored to the filesystem with a numerical index. By default this index has three digits so the numbers start 001, 002 etc. This works works for most scenarios as events with more than 999 frames are rarely captured. However if you have extremely long events and use external applications then you may wish to increase this to ensure correct sorting of images in listings etc. Warning, increasing this value on a live system may render existing events unviewable as the event will have been saved with the previous scheme. Decreasing this value should have no ill effects.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_DEFAULT_ASPECT_RATIO", + default => "4:3", + description => "The default width:height aspect ratio used in monitors", + help => "When specifying the dimensions of monitors you can click a checkbox to ensure that the width stays in the correct ratio to the height, or vice versa. This setting allows you to indicate what the ratio of these settings should be. This should be specified in the format : and the default of 4:3 normally be acceptable but 11:9 is another common setting. If the checkbox is not clicked when specifying monitor dimensions this setting has no effect.", + type => $types{string}, + category => "config", + }, + { + name => "ZM_USER_SELF_EDIT", + default => "no", + description => "Allow unprivileged users to change their details", + help => "Ordinarily only users with system edit privilege are able to change users details. Switching this option on allows ordinary users to change their passwords and their language settings", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_OPT_FRAME_SERVER", + default => "no", + description => "Should analysis farm out the writing of images to disk", + #requires => [ { name => "ZM_OPT_ADAPTIVE_SKIP", value => "yes" } ], + help => "In some circumstances it is possible for a slow disk to take so long writing images to disk that it causes the analysis daemon to fall behind especially during high frame rate events. Setting this option to yes enables a frame server daemon (zmf) which will be sent the images from the analysis daemon and will do the actual writing of images itself freeing up the analysis daemon to get on with other things. Should this transmission fail or other permanent or transient error occur, this function will fall back to the analysis daemon.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_FRAME_SOCKET_SIZE", + default => "0", + description => "Specify the frame server socket buffer size if non-standard", + requires => [ { name => "ZM_OPT_FRAME_SERVER", value => "yes" } ], + help => "For large captured images it is possible for the writes from the analysis daemon to the frame server to fail as the amount to be written exceeds the default buffer size. While the images are then written by the analysis daemon so no data is lost, it defeats the object of the frame server daemon in the first place. You can use this option to indicate that a larger buffer size should be used. Note that you may have to change the existing maximum socket buffer size on your system via sysctl (or in /proc/sys/net/core/wmem_max) to allow this new size to be set. Alternatively you can change the default buffer size on your system in the same way in which case that will be used with no change necessary in this option", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_OPT_CONTROL", + default => "no", + description => "Support controllable (e.g. PTZ) cameras", + help => "ZoneMinder includes limited support for controllable cameras. A number of sample protocols are included and others can easily be added. If you wish to control your cameras via ZoneMinder then select this option otherwise if you only have static cameras or use other control methods then leave this option off.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_OPT_TRIGGERS", + default => "no", + description => "Interface external event triggers via socket or device files", + help => "ZoneMinder can interact with external systems which prompt or cancel alarms. This is done via the zmtrigger.pl script. This option indicates whether you want to use these external triggers. Most people will say no here.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_CHECK_FOR_UPDATES", + default => "yes", + description => "Check with zoneminder.com for updated versions", + help => "From ZoneMinder version 1.17.0 onwards new versions are expected to be more frequent. To save checking manually for each new version ZoneMinder can check with the zoneminder.com website to determine the most recent release. These checks are infrequent, about once per week, and no personal or system information is transmitted other than your current version number. If you do not wish these checks to take place or your ZoneMinder system has no internet access you can switch these check off with this configuration variable", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_UPDATE_CHECK_PROXY", + default => "", + description => "Proxy url if required to access zoneminder.com", + help => "If you use a proxy to access the internet then ZoneMinder needs to know so it can access zoneminder.com to check for updates. If you do use a proxy enter the full proxy url here in the form of http://:/", + type => $types{string}, + category => "system", + }, + { + name => "ZM_SHM_KEY", + default => "0x7a6d0000", + description => "Shared memory root key to use", + help => "ZoneMinder uses shared memory to speed up communication between modules. To identify the right area to use shared memory keys are used. This option controls what the base key is, each monitor will have it's Id or'ed with this to get the actual key used. You will not normally need to change this value unless it clashes with another instance of ZoneMinder on the same machine. Only the first four hex digits are used, the lower four will be masked out and ignored.", + type => $types{hexadecimal}, + category => "system", + }, + # Deprecated, really no longer necessary + { + name => "ZM_WEB_REFRESH_METHOD", + default => "javascript", + description => "What method windows should use to refresh themselves", + help => "Many windows in Javascript need to refresh themselves to keep their information current. This option determines what method they should use to do this. Choosing 'javascript' means that each window will have a short JavaScript statement in with a timer to prompt the refresh. This is the most compatible method. Choosing 'http' means the refresh instruction is put in the HTTP header. This is a cleaner method but refreshes are interrupted or cancelled when a link in the window is clicked meaning that the window will no longer refresh and this would have to be done manually.", + type => { db_type=>"string", hint=>"javascript|http", pattern=>qr|^([jh])|i, format=>q( $1 =~ /^j/ ? "javascript" : "http" ) }, + category => "hidden", + }, + { + name => "ZM_WEB_EVENT_SORT_FIELD", + default => "DateTime", + description => "Default field the event lists are sorted by", + help => "Events in lists can be initially ordered in any way you want. This option controls what field is used to sort them. You can modify this ordering from filters or by clicking on headings in the lists themselves. Bear in mind however that the 'Prev' and 'Next' links, when scrolling through events, relate to the ordering in the lists and so not always to time based ordering.", + type => { db_type=>"string", hint=>"Id|Name|Cause|MonitorName|DateTime|Length|Frames|AlarmFrames|TotScore|AvgScore|MaxScore", pattern=>qr|.|, format=>q( $1 ) }, + category => "web", + }, + { + name => "ZM_WEB_EVENT_SORT_ORDER", + default => "asc", + description => "Default order the event lists are sorted by", + help => "Events in lists can be initially ordered in any way you want. This option controls what order (ascending or descending) is used to sort them. You can modify this ordering from filters or by clicking on headings in the lists themselves. Bear in mind however that the 'Prev' and 'Next' links, when scrolling through events, relate to the ordering in the lists and so not always to time based ordering.", + type => { db_type=>"string", hint=>"asc|desc", pattern=>qr|^([ad])|i, format=>q( $1 =~ /^a/i ? "asc" : "desc" ) }, + category => "web", + }, + { + name => "ZM_WEB_EVENTS_PER_PAGE", + default => "25", + description => "How many events to list per page in paged mode", + help => "In the event list view you can either list all events or just a page at a time. This option controls how many events are listed per page in paged mode and how often to repeat the column headers in non-paged mode.", + type => $types{integer}, + category => "web", + }, + { + name => "ZM_WEB_LIST_THUMBS", + default => "no", + description => "Display mini-thumbnails of event images in event lists", + help => "Ordinarily the event lists just display text details of the events to save space and time. By switching this option on you can also display small thumbnails to help you identify events of interest. The size of these thumbnails is controlled by the following two options.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_WEB_LIST_THUMB_WIDTH", + default => "48", + description => "The width of the thumbnails that appear in the event lists", + help => "This options controls the width of the thumbnail images that appear in the event lists. It should be fairly small to fit in with the rest of the table. If you prefer you can specify a height instead in the next option but you should only use one of the width or height and the other option should be set to zero. If both width and height are specified then width will be used and height ignored.", + type => $types{integer}, + requires => [ { name => "ZM_WEB_LIST_THUMBS", value => "yes" } ], + category => "web", + }, + { + name => "ZM_WEB_LIST_THUMB_HEIGHT", + default => "0", + description => "The height of the thumbnails that appear in the event lists", + help => "This options controls the height of the thumbnail images that appear in the event lists. It should be fairly small to fit in with the rest of the table. If you prefer you can specify a width instead in the previous option but you should only use one of the width or height and the other option should be set to zero. If both width and height are specified then width will be used and height ignored.", + type => $types{integer}, + requires => [ { name => "ZM_WEB_LIST_THUMBS", value => "yes" } ], + category => "web", + }, + { + name => "ZM_WEB_USE_OBJECT_TAGS", + default => "yes", + description => "Wrap embed in object tags for media content", + help => "There are two methods of including media content in web pages. The most common way is use the EMBED tag which is able to give some indication of the type of content. However this is not a standard part of HTML. The official method is to use OBJECT tags which are able to give more information allowing the correct media viewers etc to be loaded. However these are less widely supported and content may be specifically tailored to a particular platform or player. This option controls whether media content is enclosed in EMBED tags only or whether, where appropriate, it is additionally wrapped in OBJECT tags. Currently OBJECT tags are only used in a limited number of circumstances but they may become more widespread in the future. It is suggested that you leave this option on unless you encounter problems playing some content.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_WEB_H_REFRESH_MAIN", + default => "300", + introduction => "There are now a number of options that are grouped into bandwidth categories, this allows you to configure the ZoneMinder client to work optimally over the various access methods you might to access the client.\n\nThe next few options control what happens when the client is running in 'high' bandwidth mode. You should set these options for when accessing the ZoneMinder client over a local network or high speed link. In most cases the default values will be suitable as a starting point.", + description => "How often (in seconds) the main console window should refresh itself", + help => "The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_REFRESH_CYCLE", + default => "10", + description => "How often (in seconds) the cycle watch window swaps to the next monitor", + help => "The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_REFRESH_IMAGE", + default => "5", + description => "How often (in seconds) the watched image is refreshed (if not streaming)", + help => "The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_REFRESH_STATUS", + default => "3", + description => "How often (in seconds) the status refreshes itself in the watch window", + help => "The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_REFRESH_EVENTS", + default => "30", + description => "How often (in seconds) the event listing is refreshed in the watch window", + help => "The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_CAN_STREAM", + default => "auto", + description => "Override the automatic detection of browser streaming capability", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_STREAM_METHOD", + default => "jpeg", + description => "Which method should be used to send video streams to your browser.", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_DEFAULT_SCALE", + default => "100", + description => "What the default scaling factor applied to 'live' or 'event' views is (%)", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_DEFAULT_RATE", + default => "100", + description => "What the default replay rate factor applied to 'event' views is (%)", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_VIDEO_BITRATE", + default => "150000", + description => "What the bitrate of the video encoded stream should be set to", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_VIDEO_MAXFPS", + default => "15", + description => "What the maximum frame rate for streamed video should be", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_SCALE_THUMBS", + default => "no", + description => "Scale thumbnails in events, bandwidth versus cpu in rescaling", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_EVENTS_VIEW", + default => "events", + description => "What the default view of multiple events should be.", + help => "Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.", + type => { db_type=>"string", hint=>"events|timeline", pattern=>qr|^([lt])|i, format=>q( $1 =~ /^e/ ? "events" : "timeline" ) }, + category => "highband", + }, + { + name => "ZM_WEB_H_SHOW_PROGRESS", + default => "yes", + description => "Show the progress of replay in event view.", + help => "When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.", + type => $types{boolean}, + category => "highband", + }, + { + name => "ZM_WEB_H_AJAX_TIMEOUT", + default => "3000", + description => "How long to wait for Ajax request responses (ms)", + help => "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 => "highband", + }, + { + name => "ZM_WEB_M_REFRESH_MAIN", + default => "300", + description => "How often (in seconds) the main console window should refresh itself", + help => "The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.", + type => $types{integer}, + introduction => "The next few options control what happens when the client is running in 'medium' bandwidth mode. You should set these options for when accessing the ZoneMinder client over a slower cable or DSL link. In most cases the default values will be suitable as a starting point.", + category => "medband", + }, + { + name => "ZM_WEB_M_REFRESH_CYCLE", + default => "20", + description => "How often (in seconds) the cycle watch window swaps to the next monitor", + help => "The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.", + type => $types{integer}, + category => "medband", + }, + { + name => "ZM_WEB_M_REFRESH_IMAGE", + default => "10", + description => "How often (in seconds) the watched image is refreshed (if not streaming)", + help => "The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.", + type => $types{integer}, + category => "medband", + }, + { + name => "ZM_WEB_M_REFRESH_STATUS", + default => "5", + description => "How often (in seconds) the status refreshes itself in the watch window", + help => "The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.", + type => $types{integer}, + category => "medband", + }, + { + name => "ZM_WEB_M_REFRESH_EVENTS", + default => "60", + description => "How often (in seconds) the event listing is refreshed in the watch window", + help => "The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.", + type => $types{integer}, + category => "medband", + }, + { + name => "ZM_WEB_M_CAN_STREAM", + default => "auto", + description => "Override the automatic detection of browser streaming capability", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_STREAM_METHOD", + default => "jpeg", + description => "Which method should be used to send video streams to your browser.", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_DEFAULT_SCALE", + default => "100", + description => "What the default scaling factor applied to 'live' or 'event' views is (%)", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_DEFAULT_RATE", + default => "100", + description => "What the default replay rate factor applied to 'event' views is (%)", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_VIDEO_BITRATE", + default => "75000", + description => "What the bitrate of the video encoded stream should be set to", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_VIDEO_MAXFPS", + default => "10", + description => "What the maximum frame rate for streamed video should be", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_SCALE_THUMBS", + default => "yes", + description => "Scale thumbnails in events, bandwidth versus cpu in rescaling", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_EVENTS_VIEW", + default => "events", + description => "What the default view of multiple events should be.", + help => "Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.", + type => { db_type=>"string", hint=>"events|timeline", pattern=>qr|^([lt])|i, format=>q( $1 =~ /^e/ ? "events" : "timeline" ) }, + category => "medband", + }, + { + name => "ZM_WEB_M_SHOW_PROGRESS", + default => "yes", + description => "Show the progress of replay in event view.", + help => "When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.", + type => $types{boolean}, + category => "medband", + }, + { + name => "ZM_WEB_M_AJAX_TIMEOUT", + default => "5000", + description => "How long to wait for Ajax request responses (ms)", + help => "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 => "medband", + }, + { + name => "ZM_WEB_L_REFRESH_MAIN", + default => "300", + description => "How often (in seconds) the main console window should refresh itself", + introduction => "The next few options control what happens when the client is running in 'low' bandwidth mode. You should set these options for when accessing the ZoneMinder client over a modem or slow link. In most cases the default values will be suitable as a starting point.", + help => "The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_REFRESH_CYCLE", + default => "30", + description => "How often (in seconds) the cycle watch window swaps to the next monitor", + help => "The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_REFRESH_IMAGE", + default => "15", + description => "How often (in seconds) the watched image is refreshed (if not streaming)", + help => "The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_REFRESH_STATUS", + default => "10", + description => "How often (in seconds) the status refreshes itself in the watch window", + help => "The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_REFRESH_EVENTS", + default => "180", + description => "How often (in seconds) the event listing is refreshed in the watch window", + help => "The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_CAN_STREAM", + default => "auto", + description => "Override the automatic detection of browser streaming capability", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_STREAM_METHOD", + default => "jpeg", + description => "Which method should be used to send video streams to your browser.", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_DEFAULT_SCALE", + default => "100", + description => "What the default scaling factor applied to 'live' or 'event' views is (%)", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_DEFAULT_RATE", + default => "100", + description => "What the default replay rate factor applied to 'event' views is (%)", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_VIDEO_BITRATE", + default => "25000", + description => "What the bitrate of the video encoded stream should be set to", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_VIDEO_MAXFPS", + default => "5", + description => "What the maximum frame rate for streamed video should be", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_SCALE_THUMBS", + default => "yes", + description => "Scale thumbnails in events, bandwidth versus cpu in rescaling", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_EVENTS_VIEW", + default => "events", + description => "What the default view of multiple events should be.", + help => "Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.", + type => { db_type=>"string", hint=>"events|timeline", pattern=>qr|^([lt])|i, format=>q( $1 =~ /^e/ ? "events" : "timeline" ) }, + category => "lowband", + }, + { + name => "ZM_WEB_L_SHOW_PROGRESS", + default => "no", + description => "Show the progress of replay in event view.", + help => "When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.", + type => $types{boolean}, + category => "lowband", + }, + { + name => "ZM_WEB_L_AJAX_TIMEOUT", + default => "10000", + description => "How long to wait for Ajax request responses (ms)", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_P_CAN_STREAM", + default => "auto", + description => "Override the automatic detection of browser streaming capability", + help => "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 => "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 => "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 => "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 => "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 => "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 => "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 => "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", + default => "", + description => "What the last version of ZoneMinder recorded from zoneminder.com is", + help => "", + type => $types{string}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_CURR_VERSION", + default => "@VERSION@", + description => "What the effective current version of ZoneMinder is, might be different from actual if versions ignored", + help => "", + type => $types{string}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_DB_VERSION", + default => "@VERSION@", + description => "What the version of the database is, from zmupdate", + help => "", + type => $types{string}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_LAST_CHECK", + default => "", + description => "When the last check for version from zoneminder.com was", + help => "", + type => $types{integer}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_NEXT_REMINDER", + default => "", + description => "When the earliest time to remind about versions will be", + help => "", + type => $types{string}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_DONATE_REMINDER_TIME", + default => 0, + description => "When the earliest time to remind about donations will be", + help => "", + type => $types{integer}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_SHOW_DONATE_REMINDER", + default => "yes", + description => "Remind about donations or not", + help => "", + type => $types{boolean}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_EYEZM_DEBUG", + default => "no", + description => "Switch additional debugging on for eyeZm Plugin", + help => "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 => "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 => "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 => "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 => "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 => "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 => "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 => "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 => "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", + }, + { + name => "ZM_PATH_PLUGINS", + default => "/usr/share/zm", + description => "Path to the plugin folder", + help => "3d-party plugins have to be placed here.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_PLUGIN_EXTENSION", + default => ".zmpl", + description => "Default extension of plugins to found.", + help => "Default extension of plugins to found.", + type => $types{rel_path}, + category => "paths", + }, + { + name => "ZM_PLUGINS_CONFIG_PATH", + default => "/usr/share/zm/plugins.conf", + description => "Path to the config file for plugins.", + help => "Path to the config file for plugins.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_LOAD_PLUGINS", + default => "no", + description => "Load and use 3d-party plugins", + help => "3d-party plugins will be loaded and used for analysing.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_TURNOFF_NATIVE_ANALYSIS", + default => "no", + description => "Turn native ZM\'s image analysis possibility off", + help => "Image analysis with ZM\'s motion detected function will be turned off. Only detection functions from loaded plugins will be used. Note, that if no plugins have be loaded, no detection will be done.", + type => $types{boolean}, + category => "config", + }, + +); + +our %options_hash = map { ( $_->{name}, $_ ) } @options; + +# This function should never need to be called explicitly, except if +# this module is 'require'd rather than 'use'd. See zmconfgen.pl. +sub initialiseConfig +{ + return if ( $configInitialised ); + + # Do some initial data munging to finish the data structures + # Create option ids + my $option_id = 0; + foreach my $option ( @options ) + { + if ( defined($option->{default}) ) + { + $option->{value} = $option->{default} + } + else + { + $option->{value} = ''; + } + #next if ( $option->{category} eq 'hidden' ); + $option->{id} = $option_id++; + } + $configInitialised = 1; +} + +1; +__END__ + +=head1 NAME + +ZoneMinder::ConfigData - ZoneMinder Configuration Data module + +=head1 SYNOPSIS + + use ZoneMinder::ConfigData; + use ZoneMinder::ConfigData qw(:all); + + loadConfigFromDB(); + saveConfigToDB(); + +=head1 DESCRIPTION + +The ZoneMinder:ConfigData module contains the master definition of the ZoneMinder configuration options as well as helper methods. This module is intended for specialist confguration management and would not normally be used by end users. + +The configuration held in this module, which was previously in zmconfig.pl, includes the name, default value, description, help text, type and category for each option, as well as a number of additional fields in a small number of cases. + +=head1 METHODS + +=over 4 + +=item loadConfigFromDB (); + +Loads existing configuration from the database (if any) and merges it with the definitions held in this module. This results in the merging of any new configuration and the removal of any deprecated configuration while preserving the existing values of every else. + +=item saveConfigToDB (); + +Saves configuration held in memory to the database. The act of loading and saving configuration is a convenient way to ensure that the configuration held in the database corresponds with the most recent definitions and that all components are using the same set of configuration. + +=head2 EXPORT + +None by default. +The :data tag will export the various configuration data structures +The :functions tag will export the helper functions. +The :all tag will export all above symbols. + + +=head1 SEE ALSO + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in.orig b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in.orig new file mode 100644 index 000000000..55c0ec302 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in.orig @@ -0,0 +1,2015 @@ +# ========================================================================== +# +# ZoneMinder Config Data Module, $Date: 2011-01-20 18:49:42 +0000 (Thu, 20 Jan 2011) $, $Revision: 3230 $ +# 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. +# +# ========================================================================== +# +# This module contains the debug definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::ConfigData; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'data' => [ qw( + %types + @options + %options_hash + ) ] +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'data'} } ); + +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Configuration Data +# +# ========================================================================== + +use Carp; + +our $configInitialised = 0; + +sub INIT +{ + initialiseConfig(); +} + +# Types +our %types = +( + string => { db_type=>"string", hint=>"string", pattern=>qr|^(.+)$|, format=>q( $1 ) }, + alphanum => { db_type=>"string", hint=>"alphanumeric", pattern=>qr|^([a-zA-Z0-9-_]+)$|, format=>q( $1 ) }, + text => { db_type=>"text", hint=>"free text", pattern=>qr|^(.+)$|, format=>q( $1 ) }, + boolean => { db_type=>"boolean", hint=>"yes|no", pattern=>qr|^([yn])|i, check=>q( $1 ), format=>q( ($1 =~ /^y/) ? "yes" : "no" ) }, + integer => { db_type=>"integer", hint=>"integer", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + decimal => { db_type=>"decimal", hint=>"decimal", pattern=>qr|^(\d+(?:\.\d+)?)$|, format=>q( $1 ) }, + hexadecimal => { db_type=>"hexadecimal", hint=>"hexadecimal", pattern=>qr|^(?:0x)?([0-9a-f]{1,8})$|, format=>q( "0x".$1 ) }, + tristate => { db_type=>"string", hint=>"auto|yes|no", pattern=>qr|^([ayn])|i, check=>q( $1 ), format=>q( ($1 =~ /^y/) ? "yes" : ($1 =~ /^n/ ? "no" : "auto" ) ) }, + abs_path => { db_type=>"string", hint=>"/absolute/path/to/somewhere", pattern=>qr|^((?:/[^/]*)+?)/?$|, format=>q( $1 ) }, + rel_path => { db_type=>"string", hint=>"relative/path/to/somewhere", pattern=>qr|^((?:[^/].*)?)/?$|, format=>q( $1 ) }, + directory => { db_type=>"string", hint=>"directory", pattern=>qr|^([a-zA-Z0-9-_.]+)$|, format=>q( $1 ) }, + file => { db_type=>"string", hint=>"filename", pattern=>qr|^([a-zA-Z0-9-_.]+)$|, format=>q( $1 ) }, + hostname => { db_type=>"string", hint=>"host.your.domain", pattern=>qr|^([a-zA-Z0-9_.-]+)$|, format=>q( $1 ) }, + url => { db_type=>"string", hint=>"http://host.your.domain/", pattern=>qr|^(?:http://)?(.+)$|, format=>q( "http://".$1 ) }, + email => { db_type=>"string", hint=>"your.name\@your.domain", pattern=>qr|^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$|, format=>q( $1\@$2 ) }, +); + +our @options = +( + { + name => "ZM_LANG_DEFAULT", + default => "en_gb", + description => "Default language used by web interface", + help => "ZoneMinder allows the web interface to use languages other than English if the appropriate language file has been created and is present. This option allows you to change the default language that is used from the shipped language, British English, to another language", + type => $types{string}, + category => "system", + }, + { + name => "ZM_OPT_USE_AUTH", + default => "no", + description => "Authenticate user logins to ZoneMinder", + help => "ZoneMinder can run in two modes. The simplest is an entirely unauthenticated mode where anyone can access ZoneMinder and perform all tasks. This is most suitable for installations where the web server access is limited in other ways. The other mode enables user accounts with varying sets of permissions. Users must login or authenticate to access ZoneMinder and are limited by their defined permissions.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_AUTH_TYPE", + default => "builtin", + description => "What is used to authenticate ZoneMinder users", + help => "ZoneMinder can use two methods to authenticate users when running in authenticated mode. The first is a builtin method where ZoneMinder provides facilities for users to log in and maintains track of their identity. The second method allows interworking with other methods such as http basic authentication which passes an independently authentication 'remote' user via http. In this case ZoneMinder would use the supplied user without additional authentication provided such a user is configured ion ZoneMinder.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" } ], + type => { db_type=>"string", hint=>"builtin|remote", pattern=>qr|^([br])|i, format=>q( $1 =~ /^b/ ? "builtin" : "remote" ) }, + category => "system", + }, + { + name => "ZM_AUTH_RELAY", + default => "hashed", + description => "Method used to relay authentication information", + help => "When ZoneMinder is running in authenticated mode it can pass user details between the web pages and the back end processes. There are two methods for doing this. This first is to use a time limited hashed string which contains no direct username or password details, the second method is to pass the username and passwords around in plaintext. This method is not recommend except where you do not have the md5 libraries available on your system or you have a completely isolated system with no external access. You can also switch off authentication relaying if your system is isolated in other ways.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" } ], + type => { db_type=>"string", hint=>"hashed|plain|none", pattern=>qr|^([hpn])|i, format=>q( ($1 =~ /^h/) ? "hashed" : ($1 =~ /^p/ ? "plain" : "none" ) ) }, + category => "system", + }, + { + name => "ZM_AUTH_HASH_SECRET", + default => "...Change me to something unique...", + description => "Secret for encoding hashed authentication information", + help => "When ZoneMinder is running in hashed authenticated mode it is necessary to generate hashed strings containing encrypted sensitive information such as usernames and password. Although these string are reasonably secure the addition of a random secret increases security substantially.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" }, { name=>"ZM_AUTH_RELAY", value=>"hashed" } ], + type => $types{string}, + category => "system", + }, + { + name => "ZM_AUTH_HASH_IPS", + default => "yes", + description => "Include IP addresses in the authentication hash", + help => "When ZoneMinder is running in hashed authenticated mode it can optionally include the requesting IP address in the resultant hash. This adds an extra level of security as only requests from that address may use that authentication key. However in some circumstances, such as access over mobile networks, the requesting address can change for each request which will cause most requests to fail. This option allows you to control whether IP addresses are included in the authentication hash on your system. If you experience intermitent problems with authentication, switching this option off may help.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" }, { name=>"ZM_AUTH_RELAY", value=>"hashed" } ], + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_AUTH_HASH_LOGINS", + default => "no", + description => "Allow login by authentication hash", + help => "The normal process for logging into ZoneMinder is via the login screen with username and password. In some circumstances it may be desirable to allow access directly to one or more pages, for instance from a third party application. If this option is enabled then adding an 'auth' parameter to any request will include a shortcut login bypassing the login screen, if not already logged in. As authentication hashes are time and, optionally, IP limited this can allow short-term access to ZoneMinder screens from other web pages etc. In order to use this the calling application will hae to generate the authentication hash itself and ensure it is valid. If you use this option you should ensure that you have modified the ZM_AUTH_HASH_SECRET to somethign unique to your system.", + requires => [ { name=>"ZM_OPT_USE_AUTH", value=>"yes" }, { name=>"ZM_AUTH_RELAY", value=>"hashed" } ], + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_DIR_EVENTS", + default => "events", + description => "Directory where events are stored", + help => "This is the path to the events directory where all the event images and other miscellaneous files are stored. It is normally given as a subdirectory of the web directory you have specified earlier however if disk space is tight it can reside on another partition in which case you should create a link from that area to the path you give here.", + type => $types{directory}, + category => "paths", + }, + { + name => "ZM_USE_DEEP_STORAGE", + default => "yes", + description => "Use a deep filesystem hierarchy for events", + help => "Traditionally ZoneMinder stores all events for a monitor in one directory for that monitor. This is simple and efficient except when you have very large amounts of events. Some filesystems are unable to store more than 32k files in one directory and even without this limitation, large numbers of files in a directory can slow creation and deletion of files. This option allows you to select an alternate method of storing events by year/month/day/hour/min/second which has the effect of separating events out into more directories, resulting in less per directory, and also making it easier to manually navigate to any events that may have happened at a particular time or date.", + type => $types{boolean}, + category => "paths", + }, + { + name => "ZM_DIR_IMAGES", + default => "images", + description => "Directory where the images that the ZoneMinder client generates are stored", + help => "ZoneMinder generates a myriad of images, mosty of which are associated with events. For those that aren't this is where they go.", + type => $types{directory}, + category => "paths", + }, + { + name => "ZM_DIR_SOUNDS", + default => "sounds", + description => "Directory to the sounds that the ZoneMinder client can use", + help => "ZoneMinder can optionally play a sound file when an alarm is detected. This indicates where (relative to the web root) to look for this file.", + type => $types{directory}, + category => "paths", + }, + { + name => "ZM_PATH_ZMS", + default => "/cgi-bin/nph-zms", + description => "Web path to zms streaming server", + help => "The ZoneMinder streaming server is required to send streamed images to your browser. It will be installed into the cgi-bin path given at configuration time. This option determines what the web path to the server is rather than the local path on your machine. Ordinarily the streaming server runs in parser-header mode however if you experience problems with streaming you can change this to non-parsed-header (nph) mode by changing 'zms' to 'nph-zms'.", + type => $types{rel_path}, + category => "paths", + }, + { + name => "ZM_COLOUR_JPEG_FILES", + default => "yes", + description => "Colourise greyscale JPEG files", + help => "Cameras that capture in greyscale can write their captured images to jpeg files with a corresponding greyscale colour space. This saves a small amount of disk space over colour ones. However some tools such as ffmpeg either fail to work with this colour space or have to convert it beforehand. Setting this option to yes uses up a little more space but makes creation of MPEG files much faster.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_ADD_JPEG_COMMENTS", + default => "no", + description => "Add jpeg timestamp annotations as file header comments", + help => "JPEG files may have a number of extra fields added to the file header. The comment field may have any kind of text added. This options allows you to have the same text that is used to annotate the image additionally included as a file header comment. If you archive event images to other locations this may help you locate images for particular events or times if you use software that can read comment headers.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_JPEG_FILE_QUALITY", + default => "70", + description => "Set the JPEG quality setting for the saved event files (1-100)", + help => "When ZoneMinder detects an event it will save the images associated with that event to files. These files are in the JPEG format and can be viewed or streamed later. This option specifies what image quality should be used to save these files. A higher number means better quality but less compression so will take up more disk space and take longer to view over a slow connection. By contrast a low number means smaller, quicker to view, files but at the price of lower quality images. This setting applies to all images written except if the capture image has caused an alarm and the alarm file quality option is set at a higher value when that is used instead.", + type => $types{integer}, + category => "images", + }, + { + name => "ZM_JPEG_ALARM_FILE_QUALITY", + default => "0", + description => "Set the JPEG quality setting for the saved event files during an alarm (1-100)", + help => "This value is equivalent to the regular jpeg file quality setting above except that it only applies to images saved while in an alarm state and then only if this value is set to a higher quality setting than the ordinary file setting. If set to a lower value then it is ignored. Thus leaving it at the default of 0 effectively means to use the regular file quality setting for all saved images. This is to prevent acccidentally saving important images at a worse quality setting.", + type => $types{integer}, + category => "images", + }, + # Deprecated, now stream quality + { + name => "ZM_JPEG_IMAGE_QUALITY", + default => "70", + description => "Set the JPEG quality setting for the streamed 'live' images (1-100)", + help => "When viewing a 'live' stream for a monitor ZoneMinder will grab an image from the buffer and encode it into JPEG format before sending it. This option specifies what image quality should be used to encode these images. A higher number means better quality but less compression so will take longer to view over a slow connection. By contrast a low number means quicker to view images but at the price of lower quality images. This option does not apply when viewing events or still images as these are usually just read from disk and so will be encoded at the quality specified by the previous options.", + type => $types{integer}, + category => "hidden", + }, + { + name => "ZM_JPEG_STREAM_QUALITY", + default => "70", + description => "Set the JPEG quality setting for the streamed 'live' images (1-100)", + help => "When viewing a 'live' stream for a monitor ZoneMinder will grab an image from the buffer and encode it into JPEG format before sending it. This option specifies what image quality should be used to encode these images. A higher number means better quality but less compression so will take longer to view over a slow connection. By contrast a low number means quicker to view images but at the price of lower quality images. This option does not apply when viewing events or still images as these are usually just read from disk and so will be encoded at the quality specified by the previous options.", + type => $types{integer}, + category => "images", + }, + { + name => "ZM_MPEG_TIMED_FRAMES", + default => "yes", + description => "Tag video frames with a timestamp for more realistic streaming", + help => "When using streamed MPEG based video, either for live monitor streams or events, ZoneMinder can send the streams in two ways. If this option is selected then the timestamp for each frame, taken from it's capture time, is included in the stream. This means that where the frame rate varies, for instance around an alarm, the stream will still maintain it's 'real' timing. If this option is not selected then an approximate frame rate is calculated and that is used to schedule frames instead. This option should be selected unless you encounter problems with your preferred streaming method.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_MPEG_LIVE_FORMAT", + default => "swf", + description => "What format 'live' video streams are played in", + help => "When using MPEG mode ZoneMinder can output live video. However what formats are handled by the browser varies greatly between machines. This option allows you to specify a video format using a file extension format, so you would just enter the extension of the file type you would like and the rest is determined from that. The default of 'asf' works well under Windows with Windows Media Player but I'm currently not sure what, if anything, works on a Linux platform. If you find out please let me know! If this option is left blank then live streams will revert to being in motion jpeg format", + type => $types{string}, + category => "images", + }, + { + name => "ZM_MPEG_REPLAY_FORMAT", + default => "swf", + description => "What format 'replay' video streams are played in", + help => "When using MPEG mode ZoneMinder can replay events in encoded video format. However what formats are handled by the browser varies greatly between machines. This option allows you to specify a video format using a file extension format, so you would just enter the extension of the file type you would like and the rest is determined from that. The default of 'asf' works well under Windows with Windows Media Player and 'mpg', or 'avi' etc should work under Linux. If you know any more then please let me know! If this option is left blank then live streams will revert to being in motion jpeg format", + type => $types{string}, + category => "images", + }, + { + name => "ZM_RAND_STREAM", + default => "yes", + description => "Add a random string to prevent caching of streams", + help => "Some browsers can cache the streams used by ZoneMinder. In order to prevent his a harmless random string can be appended to the url to make each invocation of the stream appear unique.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_OPT_CAMBOZOLA", + default => "no", + description => "Is the (optional) cambozola java streaming client installed", + help => "Cambozola is a handy low fat cheese flavoured Java applet that ZoneMinder uses to view image streams on browsers such as Internet Explorer that don't natively support this format. If you use this browser it is highly recommended to install this from http://www.charliemouse.com/code/cambozola/ however if it is not installed still images at a lower refresh rate can still be viewed.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_PATH_CAMBOZOLA", + default => "cambozola.jar", + description => "Web path to (optional) cambozola java streaming client", + help => "Cambozola is a handy low fat cheese flavoured Java applet that ZoneMinder uses to view image streams on browsers such as Internet Explorer that don't natively support this format. If you use this browser it is highly recommended to install this from http://www.charliemouse.com/code/cambozola/ however if it is not installed still images at a lower refresh rate can still be viewed. Leave this as 'cambozola.jar' if cambozola is installed in the same directory as the ZoneMinder web client files.", + requires => [ { name=>"ZM_OPT_CAMBOZOLA", value=>"yes" } ], + type => $types{rel_path}, + category => "images", + }, + { + name => "ZM_RELOAD_CAMBOZOLA", + default => "0", + description => "After how many seconds should Cambozola be reloaded in live view", + help => "Cambozola allows for the viewing of streaming MJPEG however it caches the entire stream into cache space on the computer, setting this to a number > 0 will cause it to automatically reload after that many seconds to avoid filling up a hard drive.", + type => $types{integer}, + category => "images", + }, + { + name => "ZM_TIMESTAMP_ON_CAPTURE", + default => "yes", + description => "Timestamp images as soon as they are captured", + help => "ZoneMinder can add a timestamp to images in two ways. The default method, when this option is set, is that each image is timestamped immediately when captured and so the image held in memory is marked right away. The second method does not timestamp the images until they are either saved as part of an event or accessed over the web. The timestamp used in both methods will contain the same time as this is preserved along with the image. The first method ensures that an image is timestamped regardless of any other circumstances but will result in all images being timestamped even those never saved or viewed. The second method necessitates that saved images are copied before being saved otherwise two timestamps perhaps at different scales may be applied. This has the (perhaps) desirable side effect that the timestamp is always applied at the same resolution so an image that has scaling applied will still have a legible and correctly scaled timestamp.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_CPU_EXTENSIONS", + default => "yes", + description => "Use advanced CPU extensions to increase performance", + help => "When advanced processor extensions such as SSE2 or SSSE3 are available, ZoneMinder can use them, which should increase performance and reduce system load. Enabling this option on processors that do not support the advanced processors extensions used by ZoneMinder is harmless and will have no effect.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_FAST_IMAGE_BLENDS", + default => "yes", + description => "Use a fast algorithm to blend the reference image", + help => "To detect alarms ZoneMinder needs to blend the captured image with the stored reference image to update it for comparison with the next image. The reference blend percentage specified for the monitor controls how much the new image affects the reference image. There are two methods that are available for this. If this option is set then fast calculation which does not use any multiplication or division is used. This calculation is extremely fast, however it limits the possible blend percentages to 50%, 25%, 12.5%, 6.25%, 3.25% and 1.5%. Any other blend percentage will be rounded to the nearest possible one. The alternative is to switch this option off and use standard blending instead, which is slower.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_OPT_ADAPTIVE_SKIP", + default => "yes", + description => "Should frame analysis try and be efficient in skipping frames", + help => "In previous versions of ZoneMinder the analysis daemon would attempt to keep up with the capture daemon by processing the last captured frame on each pass. This would sometimes have the undesirable side-effect of missing a chunk of the initial activity that caused the alarm because the pre-alarm frames would all have to be written to disk and the database before processing the next frame, leading to some delay between the first and second event frames. Setting this option enables a newer adaptive algorithm where the analysis daemon attempts to process as many captured frames as possible, only skipping frames when in danger of the capture daemon overwriting yet to be processed frames. This skip is variable depending on the size of the ring buffer and the amount of space left in it. Enabling this option will give you much better coverage of the beginning of alarms whilst biasing out any skipped frames towards the middle or end of the event. However you should be aware that this will have the effect of making the analysis daemon run somewhat behind the capture daemon during events and for particularly fast rates of capture it is possible for the adaptive algorithm to be overwhelmed and not have time to react to a rapid build up of pending frames and thus for a buffer overrun condition to occur.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_BLEND_ALARMED_IMAGES", + default => "yes", + description => "Blend alarmed images to update the reference image", + help => "To detect alarms ZoneMinder compares an image with a reference image which is formed from a composite of the previous images. This option determines whether images that cause events are included in this process. Doing so may increase the precision of the alarmed region but can cause problems if wholescale lighting changes cause alarms as this would not get fed back into the image and an alarm may persist indefinately. A better way to achive the same effect in most cases is to lower substantially the reference blend percentage in specific monitors.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_MAX_SUSPEND_TIME", + default => "30", + description => "Maximum time that a monitor may have motion detection suspended", + help => "ZoneMinder allows monitors to have motion detection to be suspended, for instance while panning a camera. Ordinarily this relies on the operator resuming motion detection afterwards as failure to do so can leave a monitor in a permanently suspended state. This setting allows you to set a maximum time which a camera may be suspended for before it automatically resumes motion detection. This time can be extended by subsequent suspend indications after the first so continuous camera movement will also occur while the monitor is suspended.", + type => $types{integer}, + category => "config", + }, + # Deprecated, really no longer necessary + { + name => "ZM_OPT_REMOTE_CAMERAS", + default => "no", + description => "Are you going to use remote/networked cameras", + help => "ZoneMinder can work with both local cameras, ie. those attached physically to your computer and remote or network cameras. If you will be using networked cameras select this option.", + type => $types{boolean}, + category => "hidden", + }, + # Deprecated, now set on a per monitor basis using the Method field + { + name => "ZM_NETCAM_REGEXPS", + default => "yes", + description => "Use regular expression matching with network cameras", + help => "Traditionally ZoneMinder has used complex regular regular expressions to handle the multitude of formats that network cameras produce. In versions from 1.21.1 the default is to use a simpler and faster built in pattern matching methodology. This works well with most networks cameras but if you have problems you can try the older, but more flexible, regular expression based method by selecting this option. Note, to use this method you must have libpcre installed on your system.", + requires => [ { name => "ZM_OPT_REMOTE_CAMERAS", value => "yes" } ], + type => $types{boolean}, + category => "hidden", + }, + { + name => "ZM_HTTP_VERSION", + default => "1.1", + description => "The version of HTTP that ZoneMinder will use to connect", + help => "ZoneMinder can communicate with network cameras using either of the HTTP/1.1 or HTTP/1.0 standard. A server will normally fall back to the version it supports iwht no problem so this should usually by left at the default. However it can be changed to HTTP/1.0 if necessary to resolve particular issues.", + type => { db_type=>"string", hint=>"1.1|1.0", pattern=>qr|^(1\.[01])$|, format=>q( $1?$1:"" ) }, + category => "network", + }, + { + name => "ZM_HTTP_UA", + default => "ZoneMinder", + description => "The user agent that ZoneMinder uses to identify itself", + help => "When ZoneMinder communicates with remote cameras it will identify itself using this string and it's version number. This is normally sufficient, however if a particular cameras expects only to communicate with certain browsers then this can be changed to a different string identifying ZoneMinder as Internet Explorer or Netscape etc.", + type => $types{string}, + category => "network", + }, + { + name => "ZM_HTTP_TIMEOUT", + default => "2500", + description => "How long ZoneMinder waits before giving up on images (milliseconds)", + help => "When retrieving remote images ZoneMinder will wait for this length of time before deciding that an image is not going to arrive and taking steps to retry. This timeout is in milliseconds (1000 per second) and will apply to each part of an image if it is not sent in one whole chunk.", + type => $types{integer}, + category => "network", + }, + { + name => "ZM_MIN_RTP_PORT", + default => "40200", + description => "Minimum port that ZoneMinder will listen for RTP traffic on", + help => "When ZoneMinder communicates with MPEG4 capable cameras using RTP with the unicast method it must open ports for the camera to connect back to for control and streaming purposes. This setting specifies the minimum port number that ZoneMinder will use. Ordinarily two adjacent ports are used for each camera, one for control packets and one for data packets. This port should be set to an even number, you may also need to open up a hole in your firewall to allow cameras to connect back if you wish to use unicasting.", + type => $types{integer}, + category => "network", + }, + { + name => "ZM_MAX_RTP_PORT", + default => "40499", + description => "Maximum port that ZoneMinder will listen for RTP traffic on", + help => "When ZoneMinder communicates with MPEG4 capable cameras using RTP with the unicast method it must open ports for the camera to connect back to for control and streaming purposes. This setting specifies the maximum port number that ZoneMinder will use. Ordinarily two adjacent ports are used for each camera, one for control packets and one for data packets. This port should be set to an even number, you may also need to open up a hole in your firewall to allow cameras to connect back if you wish to use unicasting. You should also ensure that you have opened up at least two ports for each monitor that will be connecting to unicasting network cameras.", + type => $types{integer}, + category => "network", + }, + { + name => "ZM_OPT_FFMPEG", + default => "@OPT_FFMPEG@", + description => "Is the ffmpeg video encoder/decoder installed", + help => "ZoneMinder can optionally encode a series of video images into an MPEG encoded movie file for viewing, downloading or storage. This option allows you to specify whether you have the ffmpeg tools installed. Note that creating MPEG files can be fairly CPU and disk intensive and is not a required option as events can still be reviewed as video streams without it.", + type => $types{boolean}, + category => "images", + }, + { + name => "ZM_PATH_FFMPEG", + default => "@PATH_FFMPEG@", + description => "Path to (optional) ffmpeg mpeg encoder", + help => "This path should point to where ffmpeg has been installed.", + requires => [ { name=>"ZM_OPT_FFMPEG", value=>"yes" } ], + type => $types{abs_path}, + category => "images", + }, + { + name => "ZM_FFMPEG_INPUT_OPTIONS", + default => "", + description => "Additional input options to ffmpeg", + help => "Ffmpeg can take many options on the command line to control the quality of video produced. This option allows you to specify your own set that apply to the input to ffmpeg (options that are given before the -i option). Check the ffmpeg documentation for a full list of options which may be used here.", + requires => [ { name=>"ZM_OPT_FFMPEG", value=>"yes" } ], + type => $types{string}, + category => "images", + }, + { + name => "ZM_FFMPEG_OUTPUT_OPTIONS", + default => "-r 25", + description => "Additional output options to ffmpeg", + help => "Ffmpeg can take many options on the command line to control the quality of video produced. This option allows you to specify your own set that apply to the output from ffmpeg (options that are given after the -i option). Check the ffmpeg documentation for a full list of options which may be used here. The most common one will often be to force an output frame rate supported by the video encoder.", + requires => [ { name=>"ZM_OPT_FFMPEG", value=>"yes" } ], + type => $types{string}, + category => "images", + }, + { + name => "ZM_FFMPEG_FORMATS", + default => "mpg mpeg wmv asf avi* mov swf 3gp**", + description => "Formats to allow for ffmpeg video generation", + help => "Ffmpeg can generate video in many different formats. This option allows you to list the ones you want to be able to select. As new formats are supported by ffmpeg you can add them here and be able to use them immediately. Adding a '*' after a format indicates that this will be the default format used for web video, adding '**' defines the default format for phone video.", + requires => [ { name=>"ZM_OPT_FFMPEG", value=>"yes" } ], + type => $types{string}, + category => "images", + }, + { + name => "ZM_LOG_LEVEL_SYSLOG", + default => "0", + description => "Save logging output to the system log", + help => "ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output that goes to the system log. ZoneMinder binaries have always logged to the system log but now scripts and web logging is also included. To preserve the previous behaviour you should ensure this value is set to Info or Warning. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance. If you want debug you will also need to set a level and component below", + type => { db_type=>"integer", hint=>"None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_LEVEL_FILE", + default => "-5", + description => "Save logging output to component files", + help => "ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output that goes to individual log files written by specific components. This is how logging worked previously and although useful for tracking down issues in specific components it also resulted in many disparate log files. To preserve this behaviour you should ensure this value is set to Info or Warning. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance though file output has less impact than the other options. If you want debug you will also need to set a level and component below", + type => { db_type=>"integer", hint=>"None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_LEVEL_WEBLOG", + default => "-5", + description => "Save logging output to the weblog", + help => "ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output from the web interface that goes to the httpd error log. Note that only web logging from PHP and JavaScript files is included and so this option is really only useful for investigating specific issues with those components. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance. If you want debug you will also need to set a level and component below", + type => { db_type=>"integer", hint=>"None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_LEVEL_DATABASE", + default => "0", + description => "Save logging output to the database", + help => "ZoneMinder logging is now more more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output that is written to the database. This is a new option which can make viewing logging output easier and more intuitive and also makes it easier to get an overall impression of how the system is performing. If you have a large or very busy system then it is possible that use of this option may slow your system down if the table becomes very large. Ensure you use the LOG_DATABASE_LIMIT option to keep the table to a manageable size. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can affect severely affect system performance. If you want debug you will also need to set a level and component below", + type => { db_type=>"integer", hint=>"None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_DATABASE_LIMIT", + default => "7 day", + description => "Maximum number of log entries to retain", + help => "If you are using database logging then it is possible to quickly build up a large number of entries in the Logs table. This option allows you to specify how many of these entries are kept. If you set this option to a number greater than zero then that number is used to determine the maximum number of rows, less than or equal to zero indicates no limit and is not recommended. You can also set this value to time values such as ' day' which will limit the log entries to those newer than that time. You can specify 'hour', 'day', 'week', 'month' and 'year', note that the values should be singular (no 's' at the end). The Logs table is pruned periodically so it is possible for more than the expected number of rows to be present briefly in the meantime.", + type => $types{string}, + category => "logging", + }, + { + name => "ZM_LOG_DEBUG", + default => "no", + description => "Switch debugging on", + help => "ZoneMinder components usually support debug logging available to help with diagnosing problems. Binary components have several levels of debug whereas more other components have only one. Normally this is disabled to minimise performance penalties and avoid filling logs too quickly. This option lets you switch on other options that allow you to configure additional debug information to be output. Components will pick up this instruction when they are restarted.", + type => $types{boolean}, + category => "logging", + }, + { + name => "ZM_LOG_DEBUG_TARGET", + default => "", + description => "What components should have extra debug enabled", + help => "There are three scopes of debug available. Leaving this option blank means that all components will use extra debug (not recommended). Setting this option to '_', e.g. _zmc, will limit extra debug to that component only. Setting this option to '__', e.g. '_zmc_m1' will limit extra debug to that instance of the component only. This is ordinarily what you probably want to do. To debug scripts use their names without the .pl extension, e.g. '_zmvideo' and to debug issues with the web interface use '_web'. You can specify multiple targets by separating them with '|' characters.", + requires => [ { name => "ZM_LOG_DEBUG", value => "yes" } ], + type => $types{string}, + category => "logging", + }, + { + name => "ZM_LOG_DEBUG_LEVEL", + default => 1, + description => "What level of extra debug should be enabled", + help => "There are 9 levels of debug available, with higher numbers being more debug and level 0 being no debug. However not all levels are used by all components. Also if there is debug at a high level it is usually likely to be output at such a volume that it may obstruct normal operation. For this reason you should set the level carefully and cautiously until the degree of debug you wish to see is present. Scripts and the web interface only have one level so this is an on/off type option for them.", + requires => [ { name => "ZM_LOG_DEBUG", value => "yes" } ], + type => { db_type=>"integer", hint=>"1|2|3|4|5|6|7|8|9", pattern=>qr|^(\d+)$|, format=>q( $1 ) }, + category => "logging", + }, + { + name => "ZM_LOG_DEBUG_FILE", + default => "@ZM_TMPDIR@/zm_debug.log+", + description => "Where extra debug is output to", + help => "This option allows you to specify a different target for debug output. All components have a default log file which will norally be in /tmp or /var/log and this is where debug will be written to if this value is empty. Adding a path here will temporarily redirect debug, and other logging output, to this file. This option is a simple filename and you are debugging several components then they will all try and write to the same file with undesirable consequences. Appending a '+' to the filename will cause the file to be created with a '.' suffix containing your process id. In this way debug from each run of a component is kept separate. This is the recommended setting as it will also prevent subsequent runs from overwriting the same log. You should ensure that permissions are set up to allow writing to the file and directory specified here.", + requires => [ { name => "ZM_LOG_DEBUG", value => "yes" } ], + type => $types{string}, + category => "logging", + }, + { + name => "ZM_LOG_CHECK_PERIOD", + default => "900", + description => "Time period used when calculating overall system health", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to indicate what period of historical events are used in this calculation. This value is expressed in seconds and is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALERT_WAR_COUNT", + default => "1", + description => "Number of warnings indicating system alert state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many warnings must have occurred within the defined time period to generate an overall system alert state. A value of zero means warnings are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALERT_ERR_COUNT", + default => "1", + description => "Number of errors indicating system alert state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many errors must have occurred within the defined time period to generate an overall system alert state. A value of zero means errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALERT_FAT_COUNT", + default => "0", + description => "Number of fatal error indicating system alert state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many fatal errors (including panics) must have occurred within the defined time period to generate an overall system alert state. A value of zero means fatal errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALARM_WAR_COUNT", + default => "100", + description => "Number of warnings indicating system alarm state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many warnings must have occurred within the defined time period to generate an overall system alarm state. A value of zero means warnings are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALARM_ERR_COUNT", + default => "10", + description => "Number of errors indicating system alarm state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many errors must have occurred within the defined time period to generate an overall system alarm state. A value of zero means errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_LOG_ALARM_FAT_COUNT", + default => "1", + description => "Number of fatal error indicating system alarm state", + help => "When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many fatal errors (including panics) must have occurred within the defined time period to generate an overall system alarm state. A value of zero means fatal errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None.", + type => $types{integer}, + category => "logging", + }, + { + name => "ZM_RECORD_EVENT_STATS", + default => "yes", + description => "Record event statistical information, switch off if too slow", + help => "This version of ZoneMinder records detailed information about events in the Stats table. This can help in profiling what the optimum settings are for Zones though this is tricky at present. However in future releases this will be done more easily and intuitively, especially with a large sample of events. The default option of 'yes' allows this information to be collected now in readiness for this but if you are concerned about performance you can switch this off in which case no Stats information will be saved.", + type => $types{boolean}, + category => "logging", + }, + { + name => "ZM_RECORD_DIAG_IMAGES", + default => "no", + description => "Record intermediate alarm diagnostic images, can be very slow", + help => "In addition to recording event statistics you can also record the intermediate diagnostic images that display the results of the various checks and processing that occur when trying to determine if an alarm event has taken place. There are several of these images generated for each frame and zone for each alarm or alert frame so this can have a massive impact on performance. Only switch this setting on for debug or analysis purposes and remember to switch it off again once no longer required.", + type => $types{boolean}, + category => "logging", + }, + { + name => "ZM_DUMP_CORES", + default => "no", + description => "Create core files on unexpected process failure.", + help => "When an unrecoverable error occurs in a ZoneMinder binary process is has traditionally been trapped and the details written to logs to aid in remote analysis. However in some cases it is easier to diagnose the error if a core file, which is a memory dump of the process at the time of the error, is created. This can be interactively analysed in the debugger and may reveal more or better information than that available from the logs. This option is recommended for advanced users only otherwise leave at the default. Note using this option to trigger core files will mean that there will be no indication in the binary logs that a process has died, they will just stop, however the zmdc log will still contain an entry. Also note that you may have to explicitly enable core file creation on your system via the 'ulimit -c' command or other means otherwise no file will be created regardless of the value of this option.", + type => $types{boolean}, + category => "logging", + }, + { + name => "ZM_PATH_MAP", + default => "/dev/shm", + description => "Path to the mapped memory files that that ZoneMinder can use", + help => "ZoneMinder has historically used IPC shared memory for shared data between processes. This has it's advantages and limitations. This version of ZoneMinder can use an alternate method, mapped memory, instead with can be enabled with the --enable--mmap directive to configure. This requires less system configuration and is generally more flexible. However it requires each shared data segment to map onto a filesystem file. This option indicates where those mapped files go. You should ensure that this location has sufficient space for these files and for the best performance it should be a tmpfs file system or ramdisk otherwise disk access may render this method slower than the regular shared memory one.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_PATH_SOCKS", + default => "@ZM_TMPDIR@", + description => "Path to the various Unix domain socket files that ZoneMinder uses", + help => "ZoneMinder generally uses Unix domain sockets where possible. This reduces the need for port assignments and prevents external applications from possibly compromising the daemons. However each Unix socket requires a .sock file to be created. This option indicates where those socket files go.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_PATH_LOGS", + default => "@ZM_LOGDIR@", + description => "Path to the various logs that the ZoneMinder daemons generate", + help => "There are various daemons that are used by ZoneMinder to perform various tasks. Most generate helpful log files and this is where they go. They can be deleted if not required for debugging.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_PATH_SWAP", + default => "@ZM_TMPDIR@", + description => "Path to location for temporary swap images used in streaming", + help => "Buffered playback requires temporary swap images to be stored for each instance of the streaming daemons. This option determines where these images will be stored. The images will actually be stored in sub directories beneath this location and will be automatically cleaned up after a period of time.", + type => $types{abs_path}, + category => "paths", + }, + { + name => "ZM_WEB_TITLE_PREFIX", + default => "ZM", + description => "The title prefix displayed on each window", + help => "If you have more than one installation of ZoneMinder it can be helpful to display different titles for each one. Changing this option allows you to customise the window titles to include further information to aid identification.", + type => $types{string}, + category => "web", + }, + { + name => "ZM_WEB_RESIZE_CONSOLE", + default => "yes", + description => "Should the console window resize itself to fit", + help => "Traditionally the main ZoneMinder web console window has resized itself to shrink to a size small enough to list only the monitors that are actually present. This is intended to make the window more unobtrusize but may not be to everyones tastes, especially if opened in a tab in browsers which support this kind if layout. Switch this option off to have the console window size left to the users preference", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_WEB_POPUP_ON_ALARM", + default => "yes", + description => "Should the monitor window jump to the top if an alarm occurs", + help => "When viewing a live monitor stream you can specify whether you want the window to pop to the front if an alarm occurs when the window is minimised or behind another window. This is most useful if your monitors are over doors for example when they can pop up if someone comes to the doorway.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_OPT_X10", + default => "no", + description => "Support interfacing with X10 devices", + help => "If you have an X10 Home Automation setup in your home you can use ZoneMinder to initiate or react to X10 signals if your computer has the appropriate interface controller. This option indicates whether X10 options will be available in the browser client.", + type => $types{boolean}, + category => "x10", + }, + { + name => "ZM_X10_DEVICE", + default => "/dev/ttyS0", + description => "What device is your X10 controller connected on", + requires => [ { name => "ZM_OPT_X10", value => "yes" } ], + help => "If you have an X10 controller device (e.g. XM10U) connected to your computer this option details which port it is conected on, the default of /dev/ttyS0 maps to serial or com port 1.", + type => $types{abs_path}, + category => "x10", + }, + { + name => "ZM_X10_HOUSE_CODE", + default => "A", + description => "What X10 house code should be used", + requires => [ { name => "ZM_OPT_X10", value => "yes" } ], + help => "X10 devices are grouped together by identifying them as all belonging to one House Code. This option details what that is. It should be a single letter between A and P.", + type => { db_type=>"string", hint=>"A-P", pattern=>qr|^([A-P])|i, format=>q( uc($1) ) }, + category => "x10", + }, + { + name => "ZM_X10_DB_RELOAD_INTERVAL", + default => "60", + description => "How often (in seconds) the X10 daemon reloads the monitors from the database", + requires => [ { name => "ZM_OPT_X10", value => "yes" } ], + help => "The zmx10 daemon periodically checks the database to find out what X10 events trigger, or result from, alarms. This option determines how frequently this check occurs, unless you change this area frequently this can be a fairly large value.", + type => $types{integer}, + category => "x10", + }, + { + name => "ZM_WEB_SOUND_ON_ALARM", + default => "no", + description => "Should the monitor window play a sound if an alarm occurs", + help => "When viewing a live monitor stream you can specify whether you want the window to play a sound to alert you if an alarm occurs.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_WEB_ALARM_SOUND", + default => "", + description => "The sound to play on alarm, put this in the sounds directory", + help => "You can specify a sound file to play if an alarm occurs whilst you are watching a live monitor stream. So long as your browser understands the format it does not need to be any particular type. This file should be placed in the sounds directory defined earlier.", + type => $types{file}, + requires => [ { name => "ZM_WEB_SOUND_ON_ALARM", value => "yes" } ], + category => "web", + }, + { + name => "ZM_WEB_COMPACT_MONTAGE", + default => "no", + description => "Compact the montage view by removing extra detail", + help => "The montage view shows the output of all of your active monitors in one window. This include a small menu and status information for each one. This can increase the web traffic and make the window larger than may be desired. Setting this option on removes all this extraneous information and just displays the images.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_OPT_FAST_DELETE", + default => "yes", + description => "Delete only event database records for speed", + help => "Normally an event created as the result of an alarm consists of entries in one or more database tables plus the various files associated with it. When deleting events in the browser it can take a long time to remove all of this if your are trying to do a lot of events at once. It is recommended that you set this option which means that the browser client only deletes the key entries in the events table, which means the events will no longer appear in the listing, and leaves the zmaudit daemon to clear up the rest later.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_STRICT_VIDEO_CONFIG", + default => "yes", + description => "Allow errors in setting video config to be fatal", + help => "With some video devices errors can be reported in setting the various video attributes when in fact the operation was successful. Switching this option off will still allow these errors to be reported but will not cause them to kill the video capture daemon. Note however that doing this will cause all errors to be ignored including those which are genuine and which may cause the video capture to not function correctly. Use this option with caution.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_SIGNAL_CHECK_POINTS", + default => "10", + description => "How many points in a captured image to check for signal loss", + help => "For locally attached video cameras ZoneMinder can check for signal loss by looking at a number of random points on each captured image. If all of these points are set to the same fixed colour then the camera is assumed to have lost signal. When this happens any open events are closed and a short one frame signal loss event is generated, as is another when the signal returns. This option defines how many points on each image to check. Note that this is a maximum, any points found to not have the check colour will abort any further checks so in most cases on a couple of points will actually be checked. Network and file based cameras are never checked.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_V4L_MULTI_BUFFER", + default => "yes", + description => "Use more than one buffer for Video 4 Linux devices", + help => "Performance when using Video 4 Linux devices is usually best if multiple buffers are used allowing the next image to be captured while the previous one is being processed. If you have multiple devices on a card sharing one input that requires switching then this approach can sometimes cause frames from one source to be mixed up with frames from another. Switching this option off prevents multi buffering resulting in slower but more stable image capture. This option is ignored for non-local cameras or if only one input is present on a capture chip. This option addresses a similar problem to the ZM_CAPTURES_PER_FRAME option and you should normally change the value of only one of the options at a time.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_CAPTURES_PER_FRAME", + default => "1", + description => "How many images are captured per returned frame, for shared local cameras", + help => "If you are using cameras attached to a video capture card which forces multiple inputs to share one capture chip, it can sometimes produce images with interlaced frames reversed resulting in poor image quality and a distinctive comb edge appearance. Increasing this setting allows you to force additional image captures before one is selected as the captured frame. This allows the capture hardware to 'settle down' and produce better quality images at the price of lesser capture rates. This option has no effect on (a) network cameras, or (b) where multiple inputs do not share a capture chip. This option addresses a similar problem to the ZM_V4L_MULTI_BUFFER option and you should normally change the value of only one of the options at a time.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_FILTER_RELOAD_DELAY", + default => "300", + description => "How often (in seconds) filters are reloaded in zmfilter", + help => "ZoneMinder allows you to save filters to the database which allow events that match certain criteria to be emailed, deleted or uploaded to a remote machine etc. The zmfilter daemon loads these and does the actual operation. This option determines how often the filters are reloaded from the database to get the latest versions or new filters. If you don't change filters very often this value can be set to a large value.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_FILTER_EXECUTE_INTERVAL", + default => "60", + description => "How often (in seconds) to run automatic saved filters", + help => "ZoneMinder allows you to save filters to the database which allow events that match certain criteria to be emailed, deleted or uploaded to a remote machine etc. The zmfilter daemon loads these and does the actual operation. This option determines how often the filters are executed on the saved event in the database. If you want a rapid response to new events this should be a smaller value, however this may increase the overall load on the system and affect performance of other elements.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_OPT_UPLOAD", + default => "no", + description => "Should ZoneMinder support uploading events from filters", + help => "In ZoneMinder you can create event filters that specify whether events that match certain criteria should be uploaded to a remote server for archiving. This option specifies whether this functionality should be available", + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_UPLOAD_ARCH_FORMAT", + default => "tar", + description => "What format the uploaded events should be created in.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + help => "Uploaded events may be stored in either .tar or .zip format, this option specifies which. Note that to use this you will need to have the Archive::Tar and/or Archive::Zip perl modules installed.", + type => { db_type=>"string", hint=>"tar|zip", pattern=>qr|^([tz])|i, format=>q( $1 =~ /^t/ ? "tar" : "zip" ) }, + category => "upload", + }, + { + name => "ZM_UPLOAD_ARCH_COMPRESS", + default => "no", + description => "Should archive files be compressed", + help => "When the archive files are created they can be compressed. However in general since the images are compressed already this saves only a minimal amount of space versus utilising more CPU in their creation. Only enable if you have CPU to waste and are limited in disk space on your remote server or bandwidth.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_UPLOAD_ARCH_ANALYSE", + default => "no", + description => "Include the analysis files in the archive", + help => "When the archive files are created they can contain either just the captured frames or both the captured frames and, for frames that caused an alarm, the analysed image with the changed area highlighted. This option controls files are included. Only include analysed frames if you have a high bandwidth connection to the remote server or if you need help in figuring out what caused an alarm in the first place as archives with these files in can be considerably larger.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_UPLOAD_PROTOCOL", + default => "ftp", + description => "What protocol to use to upload events", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + help => "ZoneMinder can upload events to a remote server using either FTP or SFTP. Regular FTP is widely supported but not necessarily very secure whereas SFTP (Secure FTP) runs over an ssh connection and so is encrypted and uses regular ssh ports. Note that to use this you will need to have the appropriate perl module, either Net::FTP or Net::SFTP installed depending on your choice.", + type => { db_type=>"string", hint=>"ftp|sftp", pattern=>qr|^([tz])|i, format=>q( $1 =~ /^f/ ? "ftp" : "sftp" ) }, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_HOST", + default => "", + description => "The remote server to upload to", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the name, or ip address, of the server to use.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{hostname}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_HOST", + default => "", + description => "The remote server to upload events to", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the name, or ip address, of the server to use.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{hostname}, + category => "upload", + }, + { + name => "ZM_UPLOAD_PORT", + default => "", + description => "The port on the remote upload server, if not the default (SFTP only)", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. If you are using the SFTP protocol then this option allows you to specify a particular port to use for connection. If this option is left blank then the default, port 22, is used. This option is ignored for FTP uploads.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{integer}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_USER", + default => "", + description => "Your ftp username", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the username that ZoneMinder should use to log in for ftp transfer.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{alphanum}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_USER", + default => "", + description => "Remote server username", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the username that ZoneMinder should use to log in for transfer.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{alphanum}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_PASS", + default => "", + description => "Your ftp password", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the password that ZoneMinder should use to log in for ftp transfer.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{string}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_PASS", + default => "", + description => "Remote server password", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the password that ZoneMinder should use to log in for transfer. If you are using certicate based logins for SFTP servers you can leave this option blank.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{string}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_LOC_DIR", + default => "@ZM_TMPDIR@", + description => "The local directory in which to create upload files", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the local directory that ZoneMinder should use for temporary upload files. These are files that are created from events, uploaded and then deleted.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{abs_path}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_LOC_DIR", + default => "@ZM_TMPDIR@", + description => "The local directory in which to create upload files", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the local directory that ZoneMinder should use for temporary upload files. These are files that are created from events, uploaded and then deleted.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{abs_path}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_REM_DIR", + default => "", + description => "The remote directory to upload to", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the remote directory that ZoneMinder should use to upload event files to.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{rel_path}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_REM_DIR", + default => "", + description => "The remote directory to upload to", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the remote directory that ZoneMinder should use to upload event files to.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{rel_path}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_TIMEOUT", + default => "120", + description => "How long to allow the transfer to take for each file", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the maximum ftp inactivity timeout (in seconds) that should be tolerated before ZoneMinder determines that the transfer has failed and closes down the connection.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{integer}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_TIMEOUT", + default => "120", + description => "How long to allow the transfer to take for each file", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. This option indicates the maximum inactivity timeout (in seconds) that should be tolerated before ZoneMinder determines that the transfer has failed and closes down the connection.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{integer}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_PASSIVE", + default => "yes", + description => "Use passive ftp when uploading", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates that ftp transfers should be done in passive mode. This uses a single connection for all ftp activity and, whilst slower than active transfers, is more robust and likely to work from behind filewalls. This option is ignored for SFTP transfers.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + help => "If your computer is behind a firewall or proxy you may need to set FTP to passive mode. In fact for simple transfers it makes little sense to do otherwise anyway but you can set this to 'No' if you wish.", + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_UPLOAD_FTP_DEBUG", + default => "no", + description => "Switch ftp debugging on", + help => "You can use filters to instruct ZoneMinder to upload events to a remote ftp server. If you are having (or expecting) troubles with uploading events then setting this to 'yes' permits additional information to be included in the zmfilter log file.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{boolean}, + category => "hidden", + }, + { + name => "ZM_UPLOAD_DEBUG", + default => "no", + description => "Switch upload debugging on", + help => "You can use filters to instruct ZoneMinder to upload events to a remote server. If you are having (or expecting) troubles with uploading events then setting this to 'yes' permits additional information to be generated by the underlying transfer modules and included in the logs.", + requires => [ { name => "ZM_OPT_UPLOAD", value => "yes" } ], + type => $types{boolean}, + category => "upload", + }, + { + name => "ZM_OPT_EMAIL", + default => "no", + description => "Should ZoneMinder email you details of events that match corresponding filters", + help => "In ZoneMinder you can create event filters that specify whether events that match certain criteria should have their details emailed to you at a designated email address. This will allow you to be notified of events as soon as they occur and also to quickly view the events directly. This option specifies whether this functionality should be available. The email created with this option can be any size and is intended to be sent to a regular email reader rather than a mobile device.", + type => $types{boolean}, + category => "mail", + }, + { + name => "ZM_EMAIL_ADDRESS", + default => "", + description => "The email address to send matching event details to", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" } ], + help => "This option is used to define the email address that any events that match the appropriate filters will be sent to.", + type => $types{email}, + category => "mail", + }, + { + name => "ZM_EMAIL_TEXT", + default => 'subject = "ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)" +body = " +Hello, + +An alarm has been detected on your installation of the ZoneMinder. + +The details are as follows :- + + Monitor : %MN% + Event Id : %EI% + Length : %EL% + Frames : %EF% (%EFA%) + Scores : t%EST% m%ESM% a%ESA% + +This alarm was matched by the %FN% filter and can be viewed at %EPS% + +ZoneMinder"', + description => "The text of the email used to send matching event details", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" } ], + help => "This option is used to define the content of the email that is sent for any events that match the appropriate filters.", + type => $types{text}, + category => "hidden", + }, + { + name => "ZM_EMAIL_SUBJECT", + default => "ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)", + description => "The subject of the email used to send matching event details", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" } ], + help => "This option is used to define the subject of the email that is sent for any events that match the appropriate filters.", + type => $types{string}, + category => "mail", + }, + { + name => "ZM_EMAIL_BODY", + default => " +Hello, + +An alarm has been detected on your installation of the ZoneMinder. + +The details are as follows :- + + Monitor : %MN% + Event Id : %EI% + Length : %EL% + Frames : %EF% (%EFA%) + Scores : t%EST% m%ESM% a%ESA% + +This alarm was matched by the %FN% filter and can be viewed at %EPS% + +ZoneMinder", + description => "The body of the email used to send matching event details", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" } ], + help => "This option is used to define the content of the email that is sent for any events that match the appropriate filters.", + type => $types{text}, + category => "mail", + }, + { + name => "ZM_OPT_MESSAGE", + default => "no", + description => "Should ZoneMinder message you with details of events that match corresponding filters", + help => "In ZoneMinder you can create event filters that specify whether events that match certain criteria should have their details sent to you at a designated short message email address. This will allow you to be notified of events as soon as they occur. This option specifies whether this functionality should be available. The email created by this option will be brief and is intended to be sent to an SMS gateway or a minimal mail reader such as a mobile device or phone rather than a regular email reader.", + type => $types{boolean}, + category => "mail", + }, + { + name => "ZM_MESSAGE_ADDRESS", + default => "", + description => "The email address to send matching event details to", + requires => [ { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "This option is used to define the short message email address that any events that match the appropriate filters will be sent to.", + type => $types{email}, + category => "mail", + }, + { + name => "ZM_MESSAGE_TEXT", + default => 'subject = "ZoneMinder: Alarm - %MN%-%EI%" +body = "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score."', + description => "The text of the message used to send matching event details", + requires => [ { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "This option is used to define the content of the message that is sent for any events that match the appropriate filters.", + type => $types{text}, + category => "hidden", + }, + { + name => "ZM_MESSAGE_SUBJECT", + default => "ZoneMinder: Alarm - %MN%-%EI%", + description => "The subject of the message used to send matching event details", + requires => [ { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "This option is used to define the subject of the message that is sent for any events that match the appropriate filters.", + type => $types{string}, + category => "mail", + }, + { + name => "ZM_MESSAGE_BODY", + default => "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.", + description => "The body of the message used to send matching event details", + requires => [ { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "This option is used to define the content of the message that is sent for any events that match the appropriate filters.", + type => $types{text}, + category => "mail", + }, + { + name => "ZM_NEW_MAIL_MODULES", + default => "no", + description => "Use a newer perl method to send emails", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" }, { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "Traditionally ZoneMinder has used the MIME::Entity perl module to construct and send notification emails and messages. Some people have reported problems with this module not being present at all or flexible enough for their needs. If you are one of those people this option allows you to select a new mailing method using MIME::Lite and Net::SMTP instead. This method was contributed by Ross Melin and should work for everyone but has not been extensively tested so currently is not selected by default.", + type => $types{boolean}, + category => "mail", + }, + { + name => "ZM_EMAIL_HOST", + default => "localhost", + description => "The host address of your SMTP mail server", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" }, { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "If you have chosen SMTP as the method by which to send notification emails or messages then this option allows you to choose which SMTP server to use to send them. The default of localhost may work if you have the sendmail, exim or a similar daemon running however you may wish to enter your ISP's SMTP mail server here.", + type => $types{hostname}, + category => "mail", + }, + { + name => "ZM_FROM_EMAIL", + default => "", + description => "The email address you wish your event notifications to originate from", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" }, { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "The emails or messages that will be sent to you informing you of events can appear to come from a designated email address to help you with mail filtering etc. An address of something like ZoneMinder\@your.domain is recommended.", + type => $types{email}, + category => "mail", + }, + { + name => "ZM_URL", + default => "", + description => "The URL of your ZoneMinder installation", + requires => [ { name => "ZM_OPT_EMAIL", value => "yes" }, { name => "ZM_OPT_MESSAGE", value => "yes" } ], + help => "The emails or messages that will be sent to you informing you of events can include a link to the events themselves for easy viewing. If you intend to use this feature then set this option to the url of your installation as it would appear from where you read your email, e.g. http://host.your.domain/zm.php.", + type => $types{url}, + category => "mail", + }, + { + name => "ZM_MAX_RESTART_DELAY", + default => "600", + description => "Maximum delay (in seconds) for daemon restart attempts.", + help => "The zmdc (zm daemon control) process controls when processeses are started or stopped and will attempt to restart any that fail. If a daemon fails frequently then a delay is introduced between each restart attempt. If the daemon stills fails then this delay is increased to prevent extra load being placed on the system by continual restarts. This option controls what this maximum delay is.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_WATCH_CHECK_INTERVAL", + default => "10", + description => "How often to check the capture daemons have not locked up", + help => "The zmwatch daemon checks the image capture performance of the capture daemons to ensure that they have not locked up (rarely a sync error may occur which blocks indefinately). This option determines how often the daemons are checked.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_WATCH_MAX_DELAY", + default => "5", + description => "The maximum delay allowed since the last captured image", + help => "The zmwatch daemon checks the image capture performance of the capture daemons to ensure that they have not locked up (rarely a sync error may occur which blocks indefinately). This option determines the maximum delay to allow since the last captured frame. The daemon will be restarted if it has not captured any images after this period though the actual restart may take slightly longer in conjunction with the check interval value above.", + type => $types{decimal}, + category => "system", + }, + { + + name => "ZM_RUN_AUDIT", + default => "yes", + description => "Run zmaudit to check data consistency", + help => "The zmaudit daemon exists to check that the saved information in the database and on the filesystem match and are consistent with each other. If an error occurs or if you are using 'fast deletes' it may be that database records are deleted but files remain. In this case, and similar, zmaudit will remove redundant information to synchronise the two data stores. This option controls whether zmaudit is run in the background and performs these checks and fixes continuously. This is recommended for most systems however if you have a very large number of events the process of scanning the database and filesystem may take a long time and impact performance. In this case you may prefer to not have zmaudit running unconditionally and schedule occasional checks at other, more convenient, times.", + type => $types{boolean}, + category => "system", + }, + { + + name => "ZM_AUDIT_CHECK_INTERVAL", + default => "900", + description => "How often to check database and filesystem consistency", + help => "The zmaudit daemon exists to check that the saved information in the database and on the filesystem match and are consistent with each other. If an error occurs or if you are using 'fast deletes' it may be that database records are deleted but files remain. In this case, and similar, zmaudit will remove redundant information to synchronise the two data stores. The default check interval of 900 seconds (15 minutes) is fine for most systems however if you have a very large number of events the process of scanning the database and filesystem may take a long time and impact performance. In this case you may prefer to make this interval much larger to reduce the impact on your system. This option determines how often these checks are performed.", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_FORCED_ALARM_SCORE", + default => "255", + description => "Score to give forced alarms", + help => "The 'zmu' utility can be used to force an alarm on a monitor rather than rely on the motion detection algorithms. This option determines what score to give these alarms to distinguish them from regular ones. It must be 255 or less.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_BULK_FRAME_INTERVAL", + default => "100", + description => "How often a bulk frame should be written to the database", + help => "Traditionally ZoneMinder writes an entry into the Frames database table for each frame that is captured and saved. This works well in motion detection scenarios but when in a DVR situation ('Record' or 'Mocord' mode) this results in a huge number of frame writes and a lot of database and disk bandwidth for very little additional information. Setting this to a non-zero value will enabled ZoneMinder to group these non-alarm frames into one 'bulk' frame entry which saves a lot of bandwidth and space. The only disadvantage of this is that timing information for individual frames is lost but in constant frame rate situations this is usually not significant. This setting is ignored in Modect mode and individual frames are still written if an alarm occurs in Mocord mode also.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_EVENT_CLOSE_MODE", + default => "idle", + description => "When continuous events are closed.", + help => "When a monitor is running in a continuous recording mode (Record or Mocord) events are usually closed after a fixed period of time (the section length). However in Mocord mode it is possible that motion detection may occur near the end of a section. This option controls what happens when an alarm occurs in Mocord mode. The 'time' setting means that the event will be closed at the end of the section regardless of alarm activity. The 'idle' setting means that the event will be closed at the end of the section if there is no alarm activity occuring at the time otherwise it will be closed once the alarm is over meaning the event may end up being longer than the normal section length. The 'alarm' setting means that if an alarm occurs during the event, the event will be closed once the alarm is over regardless of when this occurs. This has the effect of limiting the number of alarms to one per event and the events will be shorter than the section length if an alarm has occurred.", + type => $types{boolean}, + type => { db_type=>"string", hint=>"time|idle|alarm", pattern=>qr|^([tia])|i, format=>q( ($1 =~ /^t/) ? "time" : ($1 =~ /^i/ ? "idle" : "time" ) ) }, + category => "config", + }, + # Deprecated, superseded by event close mode + { + name => "ZM_FORCE_CLOSE_EVENTS", + default => "no", + description => "Close events at section ends.", + help => "When a monitor is running in a continuous recording mode (Record or Mocord) events are usually closed after a fixed period of time (the section length). However in Mocord mode it is possible that motion detection may occur near the end of a section and ordinarily this will prevent the event being closed until the motion has ceased. Switching this option on will force the event closed at the specified time regardless of any motion activity.", + type => $types{boolean}, + category => "hidden", + }, + { + name => "ZM_CREATE_ANALYSIS_IMAGES", + default => "yes", + description => "Create analysed alarm images with motion outlined", + help => "By default during an alarm ZoneMinder records both the raw captured image and one that has been analysed and had areas where motion was detected outlined. This can be very useful during zone configuration or in analysing why events occured. However it also incurs some overhead and in a stable system may no longer be necessary. This parameter allows you to switch the generation of these images off.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_WEIGHTED_ALARM_CENTRES", + default => "no", + description => "Use a weighted algorithm to calculate the centre of an alarm", + help => "ZoneMinder will always calculate the centre point of an alarm in a zone to give some indication of where on the screen it is. This can be used by the experimental motion tracking feature or your own custom extensions. In the alarmed or filtered pixels mode this is a simple midpoint between the extents of the detected pxiesl. However in the blob method this can instead be calculated using weighted pixel locations to give more accurate positioning for irregularly shaped blobs. This method, while more precise is also slower and so is turned off by default.", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_EVENT_IMAGE_DIGITS", + default => "3", + description => "How many significant digits are used in event image numbering", + help => "As event images are captured they are stored to the filesystem with a numerical index. By default this index has three digits so the numbers start 001, 002 etc. This works works for most scenarios as events with more than 999 frames are rarely captured. However if you have extremely long events and use external applications then you may wish to increase this to ensure correct sorting of images in listings etc. Warning, increasing this value on a live system may render existing events unviewable as the event will have been saved with the previous scheme. Decreasing this value should have no ill effects.", + type => $types{integer}, + category => "config", + }, + { + name => "ZM_DEFAULT_ASPECT_RATIO", + default => "4:3", + description => "The default width:height aspect ratio used in monitors", + help => "When specifying the dimensions of monitors you can click a checkbox to ensure that the width stays in the correct ratio to the height, or vice versa. This setting allows you to indicate what the ratio of these settings should be. This should be specified in the format : and the default of 4:3 normally be acceptable but 11:9 is another common setting. If the checkbox is not clicked when specifying monitor dimensions this setting has no effect.", + type => $types{string}, + category => "config", + }, + { + name => "ZM_USER_SELF_EDIT", + default => "no", + description => "Allow unprivileged users to change their details", + help => "Ordinarily only users with system edit privilege are able to change users details. Switching this option on allows ordinary users to change their passwords and their language settings", + type => $types{boolean}, + category => "config", + }, + { + name => "ZM_OPT_FRAME_SERVER", + default => "no", + description => "Should analysis farm out the writing of images to disk", + #requires => [ { name => "ZM_OPT_ADAPTIVE_SKIP", value => "yes" } ], + help => "In some circumstances it is possible for a slow disk to take so long writing images to disk that it causes the analysis daemon to fall behind especially during high frame rate events. Setting this option to yes enables a frame server daemon (zmf) which will be sent the images from the analysis daemon and will do the actual writing of images itself freeing up the analysis daemon to get on with other things. Should this transmission fail or other permanent or transient error occur, this function will fall back to the analysis daemon.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_FRAME_SOCKET_SIZE", + default => "0", + description => "Specify the frame server socket buffer size if non-standard", + requires => [ { name => "ZM_OPT_FRAME_SERVER", value => "yes" } ], + help => "For large captured images it is possible for the writes from the analysis daemon to the frame server to fail as the amount to be written exceeds the default buffer size. While the images are then written by the analysis daemon so no data is lost, it defeats the object of the frame server daemon in the first place. You can use this option to indicate that a larger buffer size should be used. Note that you may have to change the existing maximum socket buffer size on your system via sysctl (or in /proc/sys/net/core/wmem_max) to allow this new size to be set. Alternatively you can change the default buffer size on your system in the same way in which case that will be used with no change necessary in this option", + type => $types{integer}, + category => "system", + }, + { + name => "ZM_OPT_CONTROL", + default => "no", + description => "Support controllable (e.g. PTZ) cameras", + help => "ZoneMinder includes limited support for controllable cameras. A number of sample protocols are included and others can easily be added. If you wish to control your cameras via ZoneMinder then select this option otherwise if you only have static cameras or use other control methods then leave this option off.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_OPT_TRIGGERS", + default => "no", + description => "Interface external event triggers via socket or device files", + help => "ZoneMinder can interact with external systems which prompt or cancel alarms. This is done via the zmtrigger.pl script. This option indicates whether you want to use these external triggers. Most people will say no here.", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_CHECK_FOR_UPDATES", + default => "yes", + description => "Check with zoneminder.com for updated versions", + help => "From ZoneMinder version 1.17.0 onwards new versions are expected to be more frequent. To save checking manually for each new version ZoneMinder can check with the zoneminder.com website to determine the most recent release. These checks are infrequent, about once per week, and no personal or system information is transmitted other than your current version number. If you do not wish these checks to take place or your ZoneMinder system has no internet access you can switch these check off with this configuration variable", + type => $types{boolean}, + category => "system", + }, + { + name => "ZM_UPDATE_CHECK_PROXY", + default => "", + description => "Proxy url if required to access zoneminder.com", + help => "If you use a proxy to access the internet then ZoneMinder needs to know so it can access zoneminder.com to check for updates. If you do use a proxy enter the full proxy url here in the form of http://:/", + type => $types{string}, + category => "system", + }, + { + name => "ZM_SHM_KEY", + default => "0x7a6d0000", + description => "Shared memory root key to use", + help => "ZoneMinder uses shared memory to speed up communication between modules. To identify the right area to use shared memory keys are used. This option controls what the base key is, each monitor will have it's Id or'ed with this to get the actual key used. You will not normally need to change this value unless it clashes with another instance of ZoneMinder on the same machine. Only the first four hex digits are used, the lower four will be masked out and ignored.", + type => $types{hexadecimal}, + category => "system", + }, + # Deprecated, really no longer necessary + { + name => "ZM_WEB_REFRESH_METHOD", + default => "javascript", + description => "What method windows should use to refresh themselves", + help => "Many windows in Javascript need to refresh themselves to keep their information current. This option determines what method they should use to do this. Choosing 'javascript' means that each window will have a short JavaScript statement in with a timer to prompt the refresh. This is the most compatible method. Choosing 'http' means the refresh instruction is put in the HTTP header. This is a cleaner method but refreshes are interrupted or cancelled when a link in the window is clicked meaning that the window will no longer refresh and this would have to be done manually.", + type => { db_type=>"string", hint=>"javascript|http", pattern=>qr|^([jh])|i, format=>q( $1 =~ /^j/ ? "javascript" : "http" ) }, + category => "hidden", + }, + { + name => "ZM_WEB_EVENT_SORT_FIELD", + default => "DateTime", + description => "Default field the event lists are sorted by", + help => "Events in lists can be initially ordered in any way you want. This option controls what field is used to sort them. You can modify this ordering from filters or by clicking on headings in the lists themselves. Bear in mind however that the 'Prev' and 'Next' links, when scrolling through events, relate to the ordering in the lists and so not always to time based ordering.", + type => { db_type=>"string", hint=>"Id|Name|Cause|MonitorName|DateTime|Length|Frames|AlarmFrames|TotScore|AvgScore|MaxScore", pattern=>qr|.|, format=>q( $1 ) }, + category => "web", + }, + { + name => "ZM_WEB_EVENT_SORT_ORDER", + default => "asc", + description => "Default order the event lists are sorted by", + help => "Events in lists can be initially ordered in any way you want. This option controls what order (ascending or descending) is used to sort them. You can modify this ordering from filters or by clicking on headings in the lists themselves. Bear in mind however that the 'Prev' and 'Next' links, when scrolling through events, relate to the ordering in the lists and so not always to time based ordering.", + type => { db_type=>"string", hint=>"asc|desc", pattern=>qr|^([ad])|i, format=>q( $1 =~ /^a/i ? "asc" : "desc" ) }, + category => "web", + }, + { + name => "ZM_WEB_EVENTS_PER_PAGE", + default => "25", + description => "How many events to list per page in paged mode", + help => "In the event list view you can either list all events or just a page at a time. This option controls how many events are listed per page in paged mode and how often to repeat the column headers in non-paged mode.", + type => $types{integer}, + category => "web", + }, + { + name => "ZM_WEB_LIST_THUMBS", + default => "no", + description => "Display mini-thumbnails of event images in event lists", + help => "Ordinarily the event lists just display text details of the events to save space and time. By switching this option on you can also display small thumbnails to help you identify events of interest. The size of these thumbnails is controlled by the following two options.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_WEB_LIST_THUMB_WIDTH", + default => "48", + description => "The width of the thumbnails that appear in the event lists", + help => "This options controls the width of the thumbnail images that appear in the event lists. It should be fairly small to fit in with the rest of the table. If you prefer you can specify a height instead in the next option but you should only use one of the width or height and the other option should be set to zero. If both width and height are specified then width will be used and height ignored.", + type => $types{integer}, + requires => [ { name => "ZM_WEB_LIST_THUMBS", value => "yes" } ], + category => "web", + }, + { + name => "ZM_WEB_LIST_THUMB_HEIGHT", + default => "0", + description => "The height of the thumbnails that appear in the event lists", + help => "This options controls the height of the thumbnail images that appear in the event lists. It should be fairly small to fit in with the rest of the table. If you prefer you can specify a width instead in the previous option but you should only use one of the width or height and the other option should be set to zero. If both width and height are specified then width will be used and height ignored.", + type => $types{integer}, + requires => [ { name => "ZM_WEB_LIST_THUMBS", value => "yes" } ], + category => "web", + }, + { + name => "ZM_WEB_USE_OBJECT_TAGS", + default => "yes", + description => "Wrap embed in object tags for media content", + help => "There are two methods of including media content in web pages. The most common way is use the EMBED tag which is able to give some indication of the type of content. However this is not a standard part of HTML. The official method is to use OBJECT tags which are able to give more information allowing the correct media viewers etc to be loaded. However these are less widely supported and content may be specifically tailored to a particular platform or player. This option controls whether media content is enclosed in EMBED tags only or whether, where appropriate, it is additionally wrapped in OBJECT tags. Currently OBJECT tags are only used in a limited number of circumstances but they may become more widespread in the future. It is suggested that you leave this option on unless you encounter problems playing some content.", + type => $types{boolean}, + category => "web", + }, + { + name => "ZM_WEB_H_REFRESH_MAIN", + default => "300", + introduction => "There are now a number of options that are grouped into bandwidth categories, this allows you to configure the ZoneMinder client to work optimally over the various access methods you might to access the client.\n\nThe next few options control what happens when the client is running in 'high' bandwidth mode. You should set these options for when accessing the ZoneMinder client over a local network or high speed link. In most cases the default values will be suitable as a starting point.", + description => "How often (in seconds) the main console window should refresh itself", + help => "The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_REFRESH_CYCLE", + default => "10", + description => "How often (in seconds) the cycle watch window swaps to the next monitor", + help => "The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_REFRESH_IMAGE", + default => "5", + description => "How often (in seconds) the watched image is refreshed (if not streaming)", + help => "The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_REFRESH_STATUS", + default => "3", + description => "How often (in seconds) the status refreshes itself in the watch window", + help => "The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_REFRESH_EVENTS", + default => "30", + description => "How often (in seconds) the event listing is refreshed in the watch window", + help => "The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.", + type => $types{integer}, + category => "highband", + }, + { + name => "ZM_WEB_H_CAN_STREAM", + default => "auto", + description => "Override the automatic detection of browser streaming capability", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_STREAM_METHOD", + default => "jpeg", + description => "Which method should be used to send video streams to your browser.", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_DEFAULT_SCALE", + default => "100", + description => "What the default scaling factor applied to 'live' or 'event' views is (%)", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_DEFAULT_RATE", + default => "100", + description => "What the default replay rate factor applied to 'event' views is (%)", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_VIDEO_BITRATE", + default => "150000", + description => "What the bitrate of the video encoded stream should be set to", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_VIDEO_MAXFPS", + default => "15", + description => "What the maximum frame rate for streamed video should be", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_SCALE_THUMBS", + default => "no", + description => "Scale thumbnails in events, bandwidth versus cpu in rescaling", + help => "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 => "highband", + }, + { + name => "ZM_WEB_H_EVENTS_VIEW", + default => "events", + description => "What the default view of multiple events should be.", + help => "Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.", + type => { db_type=>"string", hint=>"events|timeline", pattern=>qr|^([lt])|i, format=>q( $1 =~ /^e/ ? "events" : "timeline" ) }, + category => "highband", + }, + { + name => "ZM_WEB_H_SHOW_PROGRESS", + default => "yes", + description => "Show the progress of replay in event view.", + help => "When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.", + type => $types{boolean}, + category => "highband", + }, + { + name => "ZM_WEB_H_AJAX_TIMEOUT", + default => "3000", + description => "How long to wait for Ajax request responses (ms)", + help => "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 => "highband", + }, + { + name => "ZM_WEB_M_REFRESH_MAIN", + default => "300", + description => "How often (in seconds) the main console window should refresh itself", + help => "The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.", + type => $types{integer}, + introduction => "The next few options control what happens when the client is running in 'medium' bandwidth mode. You should set these options for when accessing the ZoneMinder client over a slower cable or DSL link. In most cases the default values will be suitable as a starting point.", + category => "medband", + }, + { + name => "ZM_WEB_M_REFRESH_CYCLE", + default => "20", + description => "How often (in seconds) the cycle watch window swaps to the next monitor", + help => "The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.", + type => $types{integer}, + category => "medband", + }, + { + name => "ZM_WEB_M_REFRESH_IMAGE", + default => "10", + description => "How often (in seconds) the watched image is refreshed (if not streaming)", + help => "The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.", + type => $types{integer}, + category => "medband", + }, + { + name => "ZM_WEB_M_REFRESH_STATUS", + default => "5", + description => "How often (in seconds) the status refreshes itself in the watch window", + help => "The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.", + type => $types{integer}, + category => "medband", + }, + { + name => "ZM_WEB_M_REFRESH_EVENTS", + default => "60", + description => "How often (in seconds) the event listing is refreshed in the watch window", + help => "The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.", + type => $types{integer}, + category => "medband", + }, + { + name => "ZM_WEB_M_CAN_STREAM", + default => "auto", + description => "Override the automatic detection of browser streaming capability", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_STREAM_METHOD", + default => "jpeg", + description => "Which method should be used to send video streams to your browser.", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_DEFAULT_SCALE", + default => "100", + description => "What the default scaling factor applied to 'live' or 'event' views is (%)", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_DEFAULT_RATE", + default => "100", + description => "What the default replay rate factor applied to 'event' views is (%)", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_VIDEO_BITRATE", + default => "75000", + description => "What the bitrate of the video encoded stream should be set to", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_VIDEO_MAXFPS", + default => "10", + description => "What the maximum frame rate for streamed video should be", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_SCALE_THUMBS", + default => "yes", + description => "Scale thumbnails in events, bandwidth versus cpu in rescaling", + help => "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 => "medband", + }, + { + name => "ZM_WEB_M_EVENTS_VIEW", + default => "events", + description => "What the default view of multiple events should be.", + help => "Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.", + type => { db_type=>"string", hint=>"events|timeline", pattern=>qr|^([lt])|i, format=>q( $1 =~ /^e/ ? "events" : "timeline" ) }, + category => "medband", + }, + { + name => "ZM_WEB_M_SHOW_PROGRESS", + default => "yes", + description => "Show the progress of replay in event view.", + help => "When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.", + type => $types{boolean}, + category => "medband", + }, + { + name => "ZM_WEB_M_AJAX_TIMEOUT", + default => "5000", + description => "How long to wait for Ajax request responses (ms)", + help => "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 => "medband", + }, + { + name => "ZM_WEB_L_REFRESH_MAIN", + default => "300", + description => "How often (in seconds) the main console window should refresh itself", + introduction => "The next few options control what happens when the client is running in 'low' bandwidth mode. You should set these options for when accessing the ZoneMinder client over a modem or slow link. In most cases the default values will be suitable as a starting point.", + help => "The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_REFRESH_CYCLE", + default => "30", + description => "How often (in seconds) the cycle watch window swaps to the next monitor", + help => "The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_REFRESH_IMAGE", + default => "15", + description => "How often (in seconds) the watched image is refreshed (if not streaming)", + help => "The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_REFRESH_STATUS", + default => "10", + description => "How often (in seconds) the status refreshes itself in the watch window", + help => "The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_REFRESH_EVENTS", + default => "180", + description => "How often (in seconds) the event listing is refreshed in the watch window", + help => "The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.", + type => $types{integer}, + category => "lowband", + }, + { + name => "ZM_WEB_L_CAN_STREAM", + default => "auto", + description => "Override the automatic detection of browser streaming capability", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_STREAM_METHOD", + default => "jpeg", + description => "Which method should be used to send video streams to your browser.", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_DEFAULT_SCALE", + default => "100", + description => "What the default scaling factor applied to 'live' or 'event' views is (%)", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_DEFAULT_RATE", + default => "100", + description => "What the default replay rate factor applied to 'event' views is (%)", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_VIDEO_BITRATE", + default => "25000", + description => "What the bitrate of the video encoded stream should be set to", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_VIDEO_MAXFPS", + default => "5", + description => "What the maximum frame rate for streamed video should be", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_SCALE_THUMBS", + default => "yes", + description => "Scale thumbnails in events, bandwidth versus cpu in rescaling", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_L_EVENTS_VIEW", + default => "events", + description => "What the default view of multiple events should be.", + help => "Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.", + type => { db_type=>"string", hint=>"events|timeline", pattern=>qr|^([lt])|i, format=>q( $1 =~ /^e/ ? "events" : "timeline" ) }, + category => "lowband", + }, + { + name => "ZM_WEB_L_SHOW_PROGRESS", + default => "no", + description => "Show the progress of replay in event view.", + help => "When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.", + type => $types{boolean}, + category => "lowband", + }, + { + name => "ZM_WEB_L_AJAX_TIMEOUT", + default => "10000", + description => "How long to wait for Ajax request responses (ms)", + help => "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 => "lowband", + }, + { + name => "ZM_WEB_P_CAN_STREAM", + default => "auto", + description => "Override the automatic detection of browser streaming capability", + help => "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 => "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 => "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 => "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 => "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 => "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 => "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 => "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", + default => "", + description => "What the last version of ZoneMinder recorded from zoneminder.com is", + help => "", + type => $types{string}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_CURR_VERSION", + default => "@VERSION@", + description => "What the effective current version of ZoneMinder is, might be different from actual if versions ignored", + help => "", + type => $types{string}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_DB_VERSION", + default => "@VERSION@", + description => "What the version of the database is, from zmupdate", + help => "", + type => $types{string}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_LAST_CHECK", + default => "", + description => "When the last check for version from zoneminder.com was", + help => "", + type => $types{integer}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_NEXT_REMINDER", + default => "", + description => "When the earliest time to remind about versions will be", + help => "", + type => $types{string}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_DONATE_REMINDER_TIME", + default => 0, + description => "When the earliest time to remind about donations will be", + help => "", + type => $types{integer}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_DYN_SHOW_DONATE_REMINDER", + default => "yes", + description => "Remind about donations or not", + help => "", + type => $types{boolean}, + readonly => 1, + category => "dynamic", + }, + { + name => "ZM_EYEZM_DEBUG", + default => "no", + description => "Switch additional debugging on for eyeZm Plugin", + help => "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 => "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 => "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 => "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 => "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 => "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 => "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 => "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 => "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; + +# This function should never need to be called explicitly, except if +# this module is 'require'd rather than 'use'd. See zmconfgen.pl. +sub initialiseConfig +{ + return if ( $configInitialised ); + + # Do some initial data munging to finish the data structures + # Create option ids + my $option_id = 0; + foreach my $option ( @options ) + { + if ( defined($option->{default}) ) + { + $option->{value} = $option->{default} + } + else + { + $option->{value} = ''; + } + #next if ( $option->{category} eq 'hidden' ); + $option->{id} = $option_id++; + } + $configInitialised = 1; +} + +1; +__END__ + +=head1 NAME + +ZoneMinder::ConfigData - ZoneMinder Configuration Data module + +=head1 SYNOPSIS + + use ZoneMinder::ConfigData; + use ZoneMinder::ConfigData qw(:all); + + loadConfigFromDB(); + saveConfigToDB(); + +=head1 DESCRIPTION + +The ZoneMinder:ConfigData module contains the master definition of the ZoneMinder configuration options as well as helper methods. This module is intended for specialist confguration management and would not normally be used by end users. + +The configuration held in this module, which was previously in zmconfig.pl, includes the name, default value, description, help text, type and category for each option, as well as a number of additional fields in a small number of cases. + +=head1 METHODS + +=over 4 + +=item loadConfigFromDB (); + +Loads existing configuration from the database (if any) and merges it with the definitions held in this module. This results in the merging of any new configuration and the removal of any deprecated configuration while preserving the existing values of every else. + +=item saveConfigToDB (); + +Saves configuration held in memory to the database. The act of loading and saving configuration is a convenient way to ensure that the configuration held in the database corresponds with the most recent definitions and that all components are using the same set of configuration. + +=head2 EXPORT + +None by default. +The :data tag will export the various configuration data structures +The :functions tag will export the helper functions. +The :all tag will export all above symbols. + + +=head1 SEE ALSO + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control.pm new file mode 100644 index 000000000..2a646772d --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control.pm @@ -0,0 +1,205 @@ +# ========================================================================== +# +# ZoneMinder Base Control Module, $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. +# +# ========================================================================== +# +# This module contains the base class definitions for the camera control +# protocol implementations +# +package ZoneMinder::Control; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Base connection class +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Database qw(:all); + +our $AUTOLOAD; + +sub new +{ + my $class = shift; + my $id = shift; + my $self = {}; + $self->{name} = "PelcoD"; + if ( !defined($id) ) + { + Fatal( "No monitor defined when invoking protocol ".$self->{name} ); + } + $self->{id} = $id; + bless( $self, $class ); + return $self; +} + +sub DESTROY +{ +} + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + croak( "Can't access $name member of object of class $class" ); +} + +sub getKey() +{ + my $self = shift; + return( $self->{id} ); +} + +sub open +{ + my $self = shift; + Fatal( "No open method defined for protocol ".$self->{name} ); +} + +sub close +{ + my $self = shift; + Fatal( "No close method defined for protocol ".$self->{name} ); +} + +sub loadMonitor +{ + my $self = shift; + if ( !$self->{Monitor} ) + { + if ( !($self->{Monitor} = zmDbGetMonitor( $self->{id} )) ) + { + Fatal( "Monitor id ".$self->{id}." not found or not controllable" ); + } + if ( defined($self->{Monitor}->{AutoStopTimeout}) ) + { + # Convert to microseconds. + $self->{Monitor}->{AutoStopTimeout} = int(1000000*$self->{Monitor}->{AutoStopTimeout}); + } + } +} + +sub getParam +{ + my $self = shift; + my $params = shift; + my $name = shift; + my $default = shift; + + if ( defined($params->{$name}) ) + { + return( $params->{$name} ); + } + elsif ( defined($default) ) + { + return( $default ); + } + Fatal( "Missing mandatory parameter '$name'" ); +} + +sub executeCommand +{ + my $self = shift; + my $params = shift; + + $self->loadMonitor(); + + my $command = $params->{command}; + delete $params->{command}; + + #if ( !defined($self->{$command}) ) + #{ + #Fatal( "Unsupported command '$command'" ); + #} + &{$self->{$command}}( $self, $params ); +} + +sub printMsg() +{ + my $self = shift; + Fatal( "No printMsg method defined for protocol ".$self->{name} ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/AxisV2.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/AxisV2.pm new file mode 100644 index 000000000..e5a5882b9 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/AxisV2.pm @@ -0,0 +1,475 @@ +# ========================================================================== +# +# ZoneMinder Axis version 2 API Control Protocol Module, $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. +# +# ========================================================================== +# +# This module contains the implementation of the Axis V2 API camera control +# protocol +# +package ZoneMinder::Control::AxisV2; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Axis V2 Control Protocol +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Config qw(:all); + +use Time::HiRes qw( usleep ); + +sub new +{ + my $class = shift; + my $id = shift; + my $self = ZoneMinder::Control->new( $id ); + bless( $self, $class ); + srand( time() ); + return $self; +} + +our $AUTOLOAD; + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + Fatal( "Can't access $name member of object of class $class" ); +} + +sub open +{ + my $self = shift; + + $self->loadMonitor(); + + use LWP::UserAgent; + $self->{ua} = LWP::UserAgent->new; + $self->{ua}->agent( "ZoneMinder Control Agent/".ZM_VERSION ); + + $self->{state} = 'open'; +} + +sub close +{ + my $self = shift; + $self->{state} = 'closed'; +} + +sub printMsg +{ + my $self = shift; + my $msg = shift; + my $msg_len = length($msg); + + Debug( $msg."[".$msg_len."]" ); +} + +sub sendCmd +{ + my $self = shift; + my $cmd = shift; + + my $result = undef; + + printMsg( $cmd, "Tx" ); + + #print( "http://$address/$cmd\n" ); + my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/$cmd" ); + my $res = $self->{ua}->request($req); + + if ( $res->is_success ) + { + $result = !undef; + } + else + { + Error( "Error check failed: '".$res->status_line()."'" ); + } + + return( $result ); +} + +sub cameraReset +{ + my $self = shift; + Debug( "Camera Reset" ); + my $cmd = "/axis-cgi/admin/restart.cgi"; + $self->sendCmd( $cmd ); +} + +sub moveConUp +{ + my $self = shift; + Debug( "Move Up" ); + my $cmd = "/axis-cgi/com/ptz.cgi?move=up"; + $self->sendCmd( $cmd ); +} + +sub moveConDown +{ + my $self = shift; + Debug( "Move Down" ); + my $cmd = "/axis-cgi/com/ptz.cgi?move=down"; + $self->sendCmd( $cmd ); +} + +sub moveConLeft +{ + my $self = shift; + Debug( "Move Left" ); + my $cmd = "/axis-cgi/com/ptz.cgi?move=left"; + $self->sendCmd( $cmd ); +} + +sub moveConRight +{ + my $self = shift; + Debug( "Move Right" ); + my $cmd = "/axis-cgi/com/ptz.cgi?move=right"; + $self->sendCmd( $cmd ); +} + +sub moveConUpRight +{ + my $self = shift; + Debug( "Move Up/Right" ); + my $cmd = "/axis-cgi/com/ptz.cgi?move=upright"; + $self->sendCmd( $cmd ); +} + +sub moveConUpLeft +{ + my $self = shift; + Debug( "Move Up/Left" ); + my $cmd = "/axis-cgi/com/ptz.cgi?move=upleft"; + $self->sendCmd( $cmd ); +} + +sub moveConDownRight +{ + my $self = shift; + Debug( "Move Down/Right" ); + my $cmd = "/axis-cgi/com/ptz.cgi?move=downright"; + $self->sendCmd( $cmd ); +} + +sub moveConDownLeft +{ + my $self = shift; + Debug( "Move Down/Left" ); + my $cmd = "/axis-cgi/com/ptz.cgi?move=downleft"; + $self->sendCmd( $cmd ); +} + +sub moveMap +{ + my $self = shift; + my $params = shift; + my $xcoord = $self->getParam( $params, 'xcoord' ); + my $ycoord = $self->getParam( $params, 'ycoord' ); + Debug( "Move Map to $xcoord,$ycoord" ); + my $cmd = "/axis-cgi/com/ptz.cgi?center=$xcoord,$ycoord&imagewidth=".$self->{Monitor}->{Width}."&imageheight=".$self->{Monitor}->{Height}; + $self->sendCmd( $cmd ); +} + +sub moveRelUp +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'tiltstep' ); + Debug( "Step Up $step" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rtilt=$step"; + $self->sendCmd( $cmd ); +} + +sub moveRelDown +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'tiltstep' ); + Debug( "Step Down $step" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rtilt=-$step"; + $self->sendCmd( $cmd ); +} + +sub moveRelLeft +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'panstep' ); + Debug( "Step Left $step" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rpan=-$step"; + $self->sendCmd( $cmd ); +} + +sub moveRelRight +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'panstep' ); + Debug( "Step Right $step" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rpan=$step"; + $self->sendCmd( $cmd ); +} + +sub moveRelUpRight +{ + my $self = shift; + my $params = shift; + my $panstep = $self->getParam( $params, 'panstep' ); + my $tiltstep = $self->getParam( $params, 'tiltstep' ); + Debug( "Step Up/Right $tiltstep/$panstep" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rpan=$panstep&rtilt=$tiltstep"; + $self->sendCmd( $cmd ); +} + +sub moveRelUpLeft +{ + my $self = shift; + my $params = shift; + my $panstep = $self->getParam( $params, 'panstep' ); + my $tiltstep = $self->getParam( $params, 'tiltstep' ); + Debug( "Step Up/Left $tiltstep/$panstep" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rpan=-$panstep&rtilt=$tiltstep"; + $self->sendCmd( $cmd ); +} + +sub moveRelDownRight +{ + my $self = shift; + my $params = shift; + my $panstep = $self->getParam( $params, 'panstep' ); + my $tiltstep = $self->getParam( $params, 'tiltstep' ); + Debug( "Step Down/Right $tiltstep/$panstep" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rpan=$panstep&rtilt=-$tiltstep"; + $self->sendCmd( $cmd ); +} + +sub moveRelDownLeft +{ + my $self = shift; + my $params = shift; + my $panstep = $self->getParam( $params, 'panstep' ); + my $tiltstep = $self->getParam( $params, 'tiltstep' ); + Debug( "Step Down/Left $tiltstep/$panstep" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rpan=-$panstep&rtilt=-$tiltstep"; + $self->sendCmd( $cmd ); +} + +sub zoomRelTele +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Zoom Tele" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rzoom=$step"; + $self->sendCmd( $cmd ); +} + +sub zoomRelWide +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Zoom Wide" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rzoom=-$step"; + $self->sendCmd( $cmd ); +} + +sub focusRelNear +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Focus Near" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rfocus=-$step"; + $self->sendCmd( $cmd ); +} + +sub focusRelFar +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Focus Far" ); + my $cmd = "/axis-cgi/com/ptz.cgi?rfocus=$step"; + $self->sendCmd( $cmd ); +} + +sub focusAuto +{ + my $self = shift; + Debug( "Focus Auto" ); + my $cmd = "/axis-cgi/com/ptz.cgi?autofocus=on"; + $self->sendCmd( $cmd ); +} + +sub focusMan +{ + my $self = shift; + Debug( "Focus Manual" ); + my $cmd = "/axis-cgi/com/ptz.cgi?autofocus=off"; + $self->sendCmd( $cmd ); +} + +sub irisRelOpen +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Iris Open" ); + my $cmd = "/axis-cgi/com/ptz.cgi?riris=$step"; + $self->sendCmd( $cmd ); +} + +sub irisRelClose +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Iris Close" ); + my $cmd = "/axis-cgi/com/ptz.cgi?riris=-$step"; + $self->sendCmd( $cmd ); +} + +sub irisAuto +{ + my $self = shift; + Debug( "Iris Auto" ); + my $cmd = "/axis-cgi/com/ptz.cgi?autoiris=on"; + $self->sendCmd( $cmd ); +} + +sub irisMan +{ + my $self = shift; + Debug( "Iris Manual" ); + my $cmd = "/axis-cgi/com/ptz.cgi?autoiris=off"; + $self->sendCmd( $cmd ); +} + +sub presetClear +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + Debug( "Clear Preset $preset" ); + my $cmd = "/axis-cgi/com/ptz.cgi?removeserverpresetno=$preset"; + $self->sendCmd( $cmd ); +} + +sub presetSet +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + Debug( "Set Preset $preset" ); + my $cmd = "/axis-cgi/com/ptz.cgi?setserverpresetno=$preset"; + $self->sendCmd( $cmd ); +} + +sub presetGoto +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + Debug( "Goto Preset $preset" ); + my $cmd = "/axis-cgi/com/ptz.cgi?gotoserverpresetno=$preset"; + $self->sendCmd( $cmd ); +} + +sub presetHome +{ + my $self = shift; + Debug( "Home Preset" ); + my $cmd = "/axis-cgi/com/ptz.cgi?move=home"; + $self->sendCmd( $cmd ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/Ncs370.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/Ncs370.pm new file mode 100644 index 000000000..358aecb2b --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/Ncs370.pm @@ -0,0 +1,241 @@ +# ========================================================================== +# +# ZoneMinder Neu-Fusion Control Protocol Module, $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. +# +# ========================================================================== +# +# This module contains the implementation of the Neu-Fusion NCS370 IP camera +# control protocol +# +package ZoneMinder::Control::Ncs370; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Ncs370 IP Control Protocol +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Config qw(:all); + +use Time::HiRes qw( usleep ); + +sub new +{ + my $class = shift; + my $id = shift; + my $self = ZoneMinder::Control->new( $id ); + bless( $self, $class ); + srand( time() ); + return $self; +} + +our $AUTOLOAD; + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + Fatal( "Can't access $name member of object of class $class" ); +} + +sub open +{ + my $self = shift; + + $self->loadMonitor(); + + use LWP::UserAgent; + $self->{ua} = LWP::UserAgent->new; + $self->{ua}->agent( "ZoneMinder Control Agent/".ZM_VERSION ); + + $self->{state} = 'open'; +} + +sub close +{ + my $self = shift; + $self->{state} = 'closed'; +} + +sub printMsg +{ + my $self = shift; + my $msg = shift; + my $msg_len = length($msg); + + Debug( $msg."[".$msg_len."]" ); +} + +sub sendCmd +{ + my $self = shift; + my $cmd = shift; + + my $result = undef; + + printMsg( $cmd, "Tx" ); + + my $req = HTTP::Request->new( POST=>"http://".$self->{Monitor}->{ControlAddress}."/PANTILTCONTROL.CGI" ); + my $res = $self->{ua}->request($req); + + if ( $res->is_success ) + { + $result = !undef; + } + else + { + Error( "Error check failed: '".$res->status_line()."'" ); + } + + return( $result ); +} + +sub moveConUp +{ + my $self = shift; + Debug( "Move Up" ); + my $cmd = "PanSingleMoveDegree=1\nTiltSingleMoveDegree=1\nPanTiltSingleMove=1"; + $self->sendCmd( $cmd ); +} + +sub moveConDown +{ + my $self = shift; + Debug( "Move Down" ); + my $cmd = "PanSingleMoveDegree=1\nTiltSingleMoveDegree=1\nPanTiltSingleMove=7"; + $self->sendCmd( $cmd ); +} + +sub moveConLeft +{ + my $self = shift; + Debug( "Move Left" ); + my $cmd = "PanSingleMoveDegree=1\nTiltSingleMoveDegree=1\nPanTiltSingleMove=3"; + $self->sendCmd( $cmd ); +} + +sub moveConRight +{ + my $self = shift; + Debug( "Move Right" ); + my $cmd = "PanSingleMoveDegree=1\nTiltSingleMoveDegree=1\nPanTiltSingleMove=5"; + $self->sendCmd( $cmd ); +} + +sub moveConUpRight +{ + moveConUp(); + moveConRight(); +} + +sub moveConUpLeft +{ + moveConUp(); + moveConLeft(); +} + +sub moveConDownRight +{ + moveConDown(); + moveConRight(); +} + +sub moveConDownLeft +{ + moveConDown(); + moveConLeft(); +} + +sub presetHome +{ + my $self = shift; + Debug( "Home Preset" ); + my $cmd = "PanSingleMoveDegree=1\nTiltSingleMoveDegree=1\nPanTiltSingleMove=4"; + $self->sendCmd( $cmd ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/PanasonicIP.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/PanasonicIP.pm new file mode 100644 index 000000000..643765e9f --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/PanasonicIP.pm @@ -0,0 +1,322 @@ +# ========================================================================== +# +# ZoneMinder Panasonic IP Control Protocol Module, $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. +# +# ========================================================================== +# +# This module contains the implementation of the Panasonic IP camera control +# protocol +# +package ZoneMinder::Control::PanasonicIP; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Panasonic IP Control Protocol +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Config qw(:all); + +use Time::HiRes qw( usleep ); + +sub new +{ + my $class = shift; + my $id = shift; + my $self = ZoneMinder::Control->new( $id ); + bless( $self, $class ); + srand( time() ); + return $self; +} + +our $AUTOLOAD; + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + Fatal( "Can't access $name member of object of class $class" ); +} + +sub open +{ + my $self = shift; + + $self->loadMonitor(); + + use LWP::UserAgent; + $self->{ua} = LWP::UserAgent->new; + $self->{ua}->agent( "ZoneMinder Control Agent/".ZM_VERSION ); + + $self->{state} = 'open'; +} + +sub close +{ + my $self = shift; + $self->{state} = 'closed'; +} + +sub printMsg +{ + my $self = shift; + my $msg = shift; + my $msg_len = length($msg); + + Debug( $msg."[".$msg_len."]" ); +} + +sub sendCmd +{ + my $self = shift; + my $cmd = shift; + + my $result = undef; + + printMsg( $cmd, "Tx" ); + + my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/$cmd" ); + my $res = $self->{ua}->request($req); + + if ( $res->is_success ) + { + $result = !undef; + } + else + { + Error( "Error check failed: '".$res->status_line()."'" ); + } + + return( $result ); +} + +sub cameraReset +{ + my $self = shift; + Debug( "Camera Reset" ); + my $cmd = "nphRestart?PAGE=Restart&Restart=OK"; + $self->sendCmd( $cmd ); +} + +sub moveConUp +{ + my $self = shift; + Debug( "Move Up" ); + my $cmd = "nphControlCamera?Direction=TiltUp"; + $self->sendCmd( $cmd ); +} + +sub moveConDown +{ + my $self = shift; + Debug( "Move Down" ); + my $cmd = "nphControlCamera?Direction=TiltDown"; + $self->sendCmd( $cmd ); +} + +sub moveConLeft +{ + my $self = shift; + Debug( "Move Left" ); + my $cmd = "nphControlCamera?Direction=PanLeft"; + $self->sendCmd( $cmd ); +} + +sub moveConRight +{ + my $self = shift; + Debug( "Move Right" ); + my $cmd = "nphControlCamera?Direction=PanRight"; + $self->sendCmd( $cmd ); +} + +sub moveMap +{ + my $self = shift; + my $params = shift; + my $xcoord = $self->getParam( $params, 'xcoord' ); + my $ycoord = $self->getParam( $params, 'ycoord' ); + Debug( "Move Map to $xcoord,$ycoord" ); + my $cmd = "nphControlCamera?Direction=Direct&NewPosition.x=$xcoord&NewPosition.y=$ycoord&Width=".$self->{Monitor}->{Width}."&Height=".$self->{Monitor}->{Height}; + $self->sendCmd( $cmd ); +} + +sub zoomConTele +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Zoom Tele" ); + my $cmd = "nphControlCamera?Direction=ZoomTele"; + $self->sendCmd( $cmd ); +} + +sub zoomConWide +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Zoom Wide" ); + my $cmd = "nphControlCamera?Direction=ZoomWide"; + $self->sendCmd( $cmd ); +} + +sub focusConNear +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Focus Near" ); + my $cmd = "nphControlCamera?Direction=FocusNear"; + $self->sendCmd( $cmd ); +} + +sub focusConFar +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Focus Far" ); + my $cmd = "nphControlCamera?Direction=FocusFar"; + $self->sendCmd( $cmd ); +} + +sub focusAuto +{ + my $self = shift; + Debug( "Focus Auto" ); + my $cmd = "nphControlCamera?Direction=FocusAuto"; + $self->sendCmd( $cmd ); +} + +sub focusMan +{ + my $self = shift; + Debug( "Focus Manual" ); + my $cmd = "/axis-cgi/com/ptz.cgi?autofocus=off"; + $self->sendCmd( $cmd ); +} + +sub presetClear +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + Debug( "Clear Preset $preset" ); + my $cmd = "nphPresetNameCheck?Data=$preset"; + $self->sendCmd( $cmd ); +} + +sub presetSet +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + Debug( "Set Preset $preset" ); + my $cmd = "nphPresetNameCheck?PresetName=$preset&Data=$preset"; + $self->sendCmd( $cmd ); +} + +sub presetGoto +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + Debug( "Goto Preset $preset" ); + my $cmd = "nphControlCamera?Direction=Preset&PresetOperation=Move&Data=$preset"; + $self->sendCmd( $cmd ); +} + +sub presetHome +{ + my $self = shift; + Debug( "Home Preset" ); + my $cmd = "nphControlCamera?Direction=HomePosition"; + $self->sendCmd( $cmd ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/PelcoD.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/PelcoD.pm new file mode 100644 index 000000000..6c507bd1a --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/PelcoD.pm @@ -0,0 +1,735 @@ +# ========================================================================== +# +# ZoneMinder Pelco-D Control Protocol Module, $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. +# +# ========================================================================== +# +# This module contains the implementation of the Pelco-D camera control +# protocol +# +package ZoneMinder::Control::PelcoD; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Pelco-D Control Protocol +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +use Time::HiRes qw( usleep ); + +use constant SYNC => 0xff; +use constant COMMAND_GAP => 100000; # In ms + +sub new +{ + my $class = shift; + my $id = shift; + my $self = ZoneMinder::Control->new( $id ); + bless( $self, $class ); + srand( time() ); + return $self; +} + +our $AUTOLOAD; + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + Fatal( "Can't access $name member of object of class $class" ); +} + +sub open +{ + my $self = shift; + + $self->loadMonitor(); + + use Device::SerialPort; + $self->{port} = new Device::SerialPort( $self->{Monitor}->{ControlDevice} ); + $self->{port}->baudrate(2400); + $self->{port}->databits(8); + $self->{port}->parity('none'); + $self->{port}->stopbits(1); + $self->{port}->handshake('none'); + + $self->{port}->read_const_time(50); + $self->{port}->read_char_time(10); + + $self->{state} = 'open'; +} + +sub close +{ + my $self = shift; + $self->{state} = 'closed'; + $self->{port}->close(); +} + +sub printMsg +{ + if ( logDebugging() ) + { + my $self = shift; + my $msg = shift; + my $prefix = shift || ""; + $prefix = $prefix.": " if ( $prefix ); + + my $line_length = 16; + my $msg_len = int(@$msg); + + my $msg_str = $prefix; + for ( my $i = 0; $i < $msg_len; $i++ ) + { + if ( ($i > 0) && ($i%$line_length == 0) && ($i != ($msg_len-1)) ) + { + $msg_str .= sprintf( "\n%*s", length($prefix), "" ); + } + $msg_str .= sprintf( "%02x ", $msg->[$i] ); + } + $msg_str .= "[".$msg_len."]"; + Debug( $msg_str ); + } +} + +sub sendCmd +{ + my $self = shift; + my $cmd = shift; + my $ack = shift || 0; + + my $result = undef; + + my $checksum = 0x00; + for ( my $i = 1; $i < int(@$cmd); $i++ ) + { + $checksum += $cmd->[$i]; + $checksum &= 0xff; + } + push( @$cmd, $checksum ); + + $self->printMsg( $cmd, "Tx" ); + my $id = $cmd->[0] & 0xf; + + my $tx_msg = pack( "C*", @$cmd ); + + #print( "Tx: ".length( $tx_msg )." bytes\n" ); + my $n_bytes = $self->{port}->write( $tx_msg ); + if ( !$n_bytes ) + { + Error( "Write failed: $!" ); + } + if ( $n_bytes != length($tx_msg) ) + { + Error( "Incomplete write, only ".$n_bytes." of ".length($tx_msg)." written: $!" ); + } + + if ( $ack ) + { + Debug( "Waiting for ack" ); + my $max_wait = 3; + my $now = time(); + while( 1 ) + { + my ( $count, $rx_msg ) = $self->{port}->read(4); + + if ( $count ) + { + #print( "Rx1: ".$count." bytes\n" ); + my @resp = unpack( "C*", $rx_msg ); + printMsg( \@resp, "Rx" ); + + if ( $resp[0] = 0x80 + ($id<<4) ) + { + if ( ($resp[1] & 0xf0) == 0x40 ) + { + my $socket = $resp[1] & 0x0f; + Debug( "Got ack for socket $socket" ); + $result = !undef; + } + else + { + Error( "Got bogus response" ); + } + last; + } + else + { + Error( "Got message for camera ".(($resp[0]-0x80)>>4) ); + } + } + if ( (time() - $now) > $max_wait ) + { + Warning( "Response timeout" ); + last; + } + } + } +} + +sub remoteReset +{ + my $self = shift; + Debug( "Remote Reset" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x0f, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub resetDefaults +{ + my $self = shift; + Debug( "Reset Defaults" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x29, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub cameraOff +{ + my $self = shift; + Debug( "Camera Off" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x08, 0x00, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub cameraOn +{ + my $self = shift; + Debug( "Camera On" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x88, 0x00, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub autoScan +{ + my $self = shift; + Debug( "Auto Scan" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x90, 0x00, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub manScan +{ + my $self = shift; + Debug( "Manual Scan" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x10, 0x00, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub stop +{ + my $self = shift; + Debug( "Stop" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x00, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub moveConUp +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'tiltspeed' ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Up" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x08, 0x00, $speed ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub moveConDown +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'tiltspeed' ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Down" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x10, 0x00, $speed ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveConLeft +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'panspeed' ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Left" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x04, $speed, 0x00 ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveConRight +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'panspeed' ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Right" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x02, $speed, 0x00 ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveConUpLeft +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x3f ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x3f ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Up/Left" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x0c, $panspeed, $tiltspeed ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveConUpRight +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x3f ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x3f ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Up/Right" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x0a, $panspeed, $tiltspeed ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveConDownLeft +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x3f ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x3f ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Down/Left" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x14, $panspeed, $tiltspeed ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveConDownRight +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x3f ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x3f ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Down/Right" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x12, $panspeed, $tiltspeed ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveStop +{ + my $self = shift; + Debug( "Move Stop" ); + $self->stop(); +} + +sub flip180 +{ + my $self = shift; + Debug( "Flip 180" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x07, 0x00, 0x21 ); + $self->sendCmd( \@msg ); +} + +sub zeroPan +{ + my $self = shift; + Debug( "Zero Pan" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x07, 0x00, 0x22 ); + $self->sendCmd( \@msg ); +} + +sub _setZoomSpeed +{ + my $self = shift; + my $speed = shift; + Debug( "Set Zoom Speed $speed" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x25, 0x00, $speed ); + $self->sendCmd( \@msg ); +} + +sub zoomStop +{ + my $self = shift; + Debug( "Zoom Stop" ); + $self->stop(); + $self->_setZoomSpeed( 0 ); +} + +sub zoomConTele +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'speed', 0x01 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Zoom Tele" ); + $self->_setZoomSpeed( $speed ); + usleep( COMMAND_GAP ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x20, 0x00, 0x00 ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->zoomStop(); + } +} + +sub zoomConWide +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'speed', 0x01 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Zoom Wide" ); + $self->_setZoomSpeed( $speed ); + usleep( COMMAND_GAP ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x40, 0x00, 0x00 ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->zoomStop(); + } +} + +sub _setFocusSpeed +{ + my $self = shift; + my $speed = shift; + Debug( "Set Focus Speed $speed" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x27, 0x00, $speed ); + $self->sendCmd( \@msg ); +} + +sub focusConNear +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'speed', 0x03 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Focus Near" ); + $self->_setFocusSpeed( $speed ); + usleep( COMMAND_GAP ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x01, 0x00, 0x00, 0x00 ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->_setFocusSpeed( 0 ); + } +} + +sub focusConFar +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'speed', 0x03 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Focus Far" ); + $self->_setFocusSpeed( $speed ); + usleep( COMMAND_GAP ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x80, 0x00, 0x00 ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->_setFocusSpeed( 0 ); + } +} + +sub focusStop +{ + my $self = shift; + Debug( "Focus Stop" ); + $self->stop(); + $self->_setFocusSpeed( 0 ); +} + +sub focusAuto +{ + my $self = shift; + Debug( "Focus Auto" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x2b, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub focusMan +{ + my $self = shift; + Debug( "Focus Man" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x2b, 0x00, 0x02 ); + $self->sendCmd( \@msg ); +} + +sub _setIrisSpeed +{ + my $self = shift; + my $speed = shift; + Debug( "Set Iris Speed $speed" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x27, 0x00, $speed ); + $self->sendCmd( \@msg ); +} + +sub irisConClose +{ + my $self = shift; + my $params = shift; + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Iris Close" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x04, 0x00, 0x00, 0x00 ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->_setIrisSpeed( 0 ); + } +} + +sub irisConOpen +{ + my $self = shift; + my $params = shift; + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Iris Open" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x02, 0x80, 0x00, 0x00 ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->_setIrisSpeed( 0 ); + } +} + +sub irisStop +{ + my $self = shift; + Debug( "Iris Stop" ); + $self->stop(); + $self->_setIrisSpeed( 0 ); +} + +sub irisAuto +{ + my $self = shift; + Debug( "Iris Auto" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x2d, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub irisMan +{ + my $self = shift; + Debug( "Iris Man" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x2d, 0x00, 0x02 ); + $self->sendCmd( \@msg ); +} + +sub writeScreen +{ + my $self = shift; + my $params = shift; + my $string = $self->getParam( $params, 'string' ); + Debug( "Writing '$string' to screen" ); + + my @chars = unpack( "C*", $string ); + for ( my $i = 0; $i < length($string); $i++ ) + { + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x15, $i, $chars[$i] ); + $self->sendCmd( \@msg ); + usleep( COMMAND_GAP ); + } +} + +sub clearScreen +{ + my $self = shift; + Debug( "Clear Screen" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x17, 0x00, 0x00 ); + $self->sendCmd( \@msg ); +} + +sub clearPreset +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset', 1 ); + Debug( "Clear Preset $preset" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x05, 0x00, $preset ); + $self->sendCmd( \@msg ); +} + +sub presetSet +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset', 1 ); + Debug( "Set Preset $preset" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x03, 0x00, $preset ); + $self->sendCmd( \@msg ); +} + +sub presetGoto +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset', 1 ); + Debug( "Goto Preset $preset" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x07, 0x00, $preset ); + $self->sendCmd( \@msg ); +} + +sub presetHome +{ + my $self = shift; + Debug( "Home Preset" ); + my @msg = ( SYNC, $self->{Monitor}->{ControlAddress}, 0x00, 0x07, 0x00, 0x22 ); + $self->sendCmd( \@msg ); +} + +sub reset +{ + my $self = shift; + Debug( "Reset" ); + $self->remoteReset(); + $self->resetDefaults(); +} + +sub wake +{ + my $self = shift; + Debug( "Wake" ); + $self->cameraOn(); +} + +sub sleep +{ + my $self = shift; + Debug( "Sleep" ); + $self->cameraOff(); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/PelcoP.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/PelcoP.pm new file mode 100644 index 000000000..c743f2b51 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/PelcoP.pm @@ -0,0 +1,736 @@ +# ========================================================================== +# +# ZoneMinder Pelco-P Control Protocol Module, $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. +# +# ========================================================================== +# +# This module contains the implementation of the Pelco-P camera control +# protocol +# +package ZoneMinder::Control::PelcoD; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Pelco-P Control Protocol +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +use Time::HiRes qw( usleep ); + +use constant STX => 0xa0; +use constant ETX => 0xaf; +use constant COMMAND_GAP => 100000; # In ms + +sub new +{ + my $class = shift; + my $id = shift; + my $self = ZoneMinder::Control->new( $id ); + bless( $self, $class ); + srand( time() ); + return $self; +} + +our $AUTOLOAD; + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + Fatal( "Can't access $name member of object of class $class" ); +} + +sub open +{ + my $self = shift; + + $self->loadMonitor(); + + use Device::SerialPort; + $self->{port} = new Device::SerialPort( $self->{Monitor}->{ControlDevice} ); + $self->{port}->baudrate(4800); + $self->{port}->databits(8); + $self->{port}->parity('none'); + $self->{port}->stopbits(1); + $self->{port}->handshake('none'); + + $self->{port}->read_const_time(50); + $self->{port}->read_char_time(10); + + $self->{state} = 'open'; +} + +sub close +{ + my $self = shift; + $self->{state} = 'closed'; + $self->{port}->close(); +} + +sub printMsg +{ + if ( logDebugging() ) + { + my $self = shift; + my $msg = shift; + my $prefix = shift || ""; + $prefix = $prefix.": " if ( $prefix ); + + my $line_length = 16; + my $msg_len = int(@$msg); + + my $msg_str = $prefix; + for ( my $i = 0; $i < $msg_len; $i++ ) + { + if ( ($i > 0) && ($i%$line_length == 0) && ($i != ($msg_len-1)) ) + { + $msg_str .= sprintf( "\n%*s", length($prefix), "" ); + } + $msg_str .= sprintf( "%02x ", $msg->[$i] ); + } + $msg_str .= "[".$msg_len."]"; + Debug( $msg_str ); + } +} + +sub sendCmd +{ + my $self = shift; + my $cmd = shift; + my $ack = shift || 0; + + my $result = undef; + + my $checksum = 0x00; + for ( my $i = 1; $i < int(@$cmd); $i++ ) + { + $checksum ^= $cmd->[$i]; + } + $checksum &= 0xff; + push( @$cmd, $checksum ); + + $self->printMsg( $cmd, "Tx" ); + my $id = $cmd->[0] & 0xf; + + my $tx_msg = pack( "C*", @$cmd ); + + #print( "Tx: ".length( $tx_msg )." bytes\n" ); + my $n_bytes = $self->{port}->write( $tx_msg ); + if ( !$n_bytes ) + { + Error( "Write failed: $!" ); + } + if ( $n_bytes != length($tx_msg) ) + { + Error( "Incomplete write, only ".$n_bytes." of ".length($tx_msg)." written: $!" ); + } + + if ( $ack ) + { + Debug( "Waiting for ack" ); + my $max_wait = 3; + my $now = time(); + while( 1 ) + { + my ( $count, $rx_msg ) = $self->{port}->read(4); + + if ( $count ) + { + #print( "Rx1: ".$count." bytes\n" ); + my @resp = unpack( "C*", $rx_msg ); + printMsg( \@resp, "Rx" ); + + if ( $resp[0] = 0x80 + ($id<<4) ) + { + if ( ($resp[1] & 0xf0) == 0x40 ) + { + my $socket = $resp[1] & 0x0f; + Debug( "Got ack for socket $socket" ); + $result = !undef; + } + else + { + Error( "Got bogus response" ); + } + last; + } + else + { + Error( "Got message for camera ".(($resp[0]-0x80)>>4) ); + } + } + if ( (time() - $now) > $max_wait ) + { + Warning( "Response timeout" ); + last; + } + } + } +} + +sub remoteReset +{ + my $self = shift; + Debug( "Remote Reset" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x0f, 0x00, 0x00, ETX ); + $self->sendCmd( \@msg ); +} + +sub resetDefaults +{ + my $self = shift; + Debug( "Reset Defaults" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x29, 0x00, 0x00, ETX ); + $self->sendCmd( \@msg ); +} + +sub cameraOff +{ + my $self = shift; + Debug( "Camera Off" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x08, 0x00, 0x00, 0x00, ETX ); + $self->sendCmd( \@msg ); +} + +sub cameraOn +{ + my $self = shift; + Debug( "Camera On" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x88, 0x00, 0x00, 0x00, ETX ); + $self->sendCmd( \@msg ); +} + +sub autoScan +{ + my $self = shift; + Debug( "Auto Scan" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x90, 0x00, 0x00, 0x00, ETX ); + $self->sendCmd( \@msg ); +} + +sub manScan +{ + my $self = shift; + Debug( "Manual Scan" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x10, 0x00, 0x00, 0x00, ETX ); + $self->sendCmd( \@msg ); +} + +sub stop +{ + my $self = shift; + Debug( "Stop" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x00, 0x00, 0x00, ETX ); + $self->sendCmd( \@msg ); +} + +sub moveConUp +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'tiltspeed' ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Up" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x08, 0x00, $speed, ETX ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub moveConDown +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'tiltspeed' ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Down" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x10, 0x00, $speed, ETX ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveConLeft +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'panspeed' ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Left" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x04, $speed, 0x00, ETX ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveConRight +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'panspeed' ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Right" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x02, $speed, 0x00, ETX ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveConUpLeft +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x3f ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x3f ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Up/Left" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x0c, $panspeed, $tiltspeed, ETX ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveConUpRight +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x3f ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x3f ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Up/Right" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x0a, $panspeed, $tiltspeed, ETX ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveConDownLeft +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x3f ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x3f ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Down/Left" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x14, $panspeed, $tiltspeed, ETX ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveConDownRight +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x3f ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x3f ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Down/Right" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x12, $panspeed, $tiltspeed, ETX ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop(); + } +} + +sub moveStop +{ + my $self = shift; + Debug( "Move Stop" ); + $self->stop(); +} + +sub flip180 +{ + my $self = shift; + Debug( "Flip 180" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x07, 0x00, 0x21, ETX ); + $self->sendCmd( \@msg ); +} + +sub zeroPan +{ + my $self = shift; + Debug( "Zero Pan" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x07, 0x00, 0x22, ETX ); + $self->sendCmd( \@msg ); +} + +sub _setZoomSpeed +{ + my $self = shift; + my $speed = shift; + Debug( "Set Zoom Speed $speed" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x25, 0x00, $speed, ETX ); + $self->sendCmd( \@msg ); +} + +sub zoomStop +{ + my $self = shift; + Debug( "Zoom Stop" ); + $self->stop(); + $self->_setZoomSpeed( 0 ); +} + +sub zoomConTele +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'speed', 0x01 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Zoom Tele" ); + $self->_setZoomSpeed( $speed ); + usleep( COMMAND_GAP ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x20, 0x00, 0x00, ETX ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->zoomStop(); + } +} + +sub zoomConWide +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'speed', 0x01 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Zoom Wide" ); + $self->_setZoomSpeed( $speed ); + usleep( COMMAND_GAP ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x40, 0x00, 0x00, ETX ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->zoomStop(); + } +} + +sub _setFocusSpeed +{ + my $self = shift; + my $speed = shift; + Debug( "Set Focus Speed $speed" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x27, 0x00, $speed, ETX ); + $self->sendCmd( \@msg ); +} + +sub focusConNear +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'speed', 0x03 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Focus Near" ); + $self->_setFocusSpeed( $speed ); + usleep( COMMAND_GAP ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x01, 0x00, 0x00, 0x00, ETX ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->_setFocusSpeed( 0 ); + } +} + +sub focusConFar +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'speed', 0x03 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Focus Far" ); + $self->_setFocusSpeed( $speed ); + usleep( COMMAND_GAP ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x80, 0x00, 0x00, ETX ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->_setFocusSpeed( 0 ); + } +} + +sub focusStop +{ + my $self = shift; + Debug( "Focus Stop" ); + $self->stop(); + $self->_setFocusSpeed( 0 ); +} + +sub focusAuto +{ + my $self = shift; + Debug( "Focus Auto" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x2b, 0x00, 0x00, ETX ); + $self->sendCmd( \@msg ); +} + +sub focusMan +{ + my $self = shift; + Debug( "Focus Man" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x2b, 0x00, 0x02, ETX ); + $self->sendCmd( \@msg ); +} + +sub _setIrisSpeed +{ + my $self = shift; + my $speed = shift; + Debug( "Set Iris Speed $speed" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x27, 0x00, $speed, ETX ); + $self->sendCmd( \@msg ); +} + +sub irisConClose +{ + my $self = shift; + my $params = shift; + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Iris Close" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x04, 0x00, 0x00, 0x00, ETX ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->_setIrisSpeed( 0 ); + } +} + +sub irisConOpen +{ + my $self = shift; + my $params = shift; + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Iris Open" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x02, 0x80, 0x00, 0x00, ETX ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->_setIrisSpeed( 0 ); + } +} + +sub irisStop +{ + my $self = shift; + Debug( "Iris Stop" ); + $self->stop(); + $self->_setIrisSpeed( 0 ); +} + +sub irisAuto +{ + my $self = shift; + Debug( "Iris Auto" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x2d, 0x00, 0x00, ETX ); + $self->sendCmd( \@msg ); +} + +sub irisMan +{ + my $self = shift; + Debug( "Iris Man" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x2d, 0x00, 0x02, ETX ); + $self->sendCmd( \@msg ); +} + +sub writeScreen +{ + my $self = shift; + my $params = shift; + my $string = $self->getParam( $params, 'string' ); + Debug( "Writing '$string' to screen" ); + + my @chars = unpack( "C*", $string ); + for ( my $i = 0; $i < length($string); $i++ ) + { + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x15, $i, $chars[$i], ETX ); + $self->sendCmd( \@msg ); + usleep( COMMAND_GAP ); + } +} + +sub clearScreen +{ + my $self = shift; + Debug( "Clear Screen" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x17, 0x00, 0x00, ETX ); + $self->sendCmd( \@msg ); +} + +sub clearPreset +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset', 1 ); + Debug( "Clear Preset $preset" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x05, 0x00, $preset, ETX ); + $self->sendCmd( \@msg ); +} + +sub presetSet +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset', 1 ); + Debug( "Set Preset $preset" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x03, 0x00, $preset, ETX ); + $self->sendCmd( \@msg ); +} + +sub presetGoto +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset', 1 ); + Debug( "Goto Preset $preset" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x07, 0x00, $preset, ETX ); + $self->sendCmd( \@msg ); +} + +sub presetHome +{ + my $self = shift; + Debug( "Home Preset" ); + my @msg = ( STX, $self->{Monitor}->{ControlAddress}, 0x00, 0x07, 0x00, 0x22, ETX ); + $self->sendCmd( \@msg ); +} + +sub reset +{ + my $self = shift; + Debug( "Reset" ); + $self->remoteReset(); + $self->resetDefaults(); +} + +sub wake +{ + my $self = shift; + Debug( "Wake" ); + $self->cameraOn(); +} + +sub sleep +{ + my $self = shift; + Debug( "Sleep" ); + $self->cameraOff(); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/Visca.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/Visca.pm new file mode 100644 index 000000000..37f30dc09 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/Visca.pm @@ -0,0 +1,668 @@ +# ========================================================================== +# +# ZoneMinder Visca Control Protocol Module, $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. +# +# ========================================================================== +# +# This module contains the implementation of the Visca camera control +# protocol +# +package ZoneMinder::Control::Visca; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Visca Control Protocol +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +use Time::HiRes qw( usleep ); + +use constant SYNC => 0xff; +use constant COMMAND_GAP => 100000; # In ms + +sub new +{ + my $class = shift; + my $id = shift; + my $self = ZoneMinder::Control->new( $id ); + bless( $self, $class ); + srand( time() ); + return $self; +} + +our $AUTOLOAD; + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + Fatal( "Can't access $name member of object of class $class" ); +} + +sub open +{ + my $self = shift; + + $self->loadMonitor(); + + use Device::SerialPort; + $self->{port} = new Device::SerialPort( $self->{Monitor}->{ControlDevice} ); + $self->{port}->baudrate(9600); + $self->{port}->databits(8); + $self->{port}->parity('none'); + $self->{port}->stopbits(1); + $self->{port}->handshake('rts'); + $self->{port}->stty_echo(0); + + #$self->{port}->read_const_time(250); + $self->{port}->read_char_time(2); + + $self->{state} = 'open'; +} + +sub close +{ + my $self = shift; + $self->{state} = 'closed'; + $self->{port}->close(); +} + +sub printMsg +{ + if ( logDebugging() ) + { + my $self = shift; + my $msg = shift; + my $prefix = shift || ""; + $prefix = $prefix.": " if ( $prefix ); + + my $line_length = 16; + my $msg_len = int(@$msg); + + my $msg_str = $prefix; + for ( my $i = 0; $i < $msg_len; $i++ ) + { + if ( ($i > 0) && ($i%$line_length == 0) && ($i != ($msg_len-1)) ) + { + $msg_str .= sprintf( "\n%*s", length($prefix), "" ); + } + $msg_str .= sprintf( "%02x ", $msg->[$i] ); + } + $msg_str .= "[".$msg_len."]"; + Debug( $msg_str ); + } +} + +sub sendCmd +{ + my $self = shift; + my $cmd = shift; + my $ack = shift || 0; + my $cmp = shift || 0; + + my $result = undef; + + $self->printMsg( $cmd, "Tx" ); + my $id = $cmd->[0] & 0xf; + + my $tx_msg = pack( "C*", @$cmd ); + + #print( "Tx: ".length( $tx_msg )." bytes\n" ); + my $n_bytes = $self->{port}->write( $tx_msg ); + if ( !$n_bytes ) + { + Error( "Write failed: $!" ); + } + if ( $n_bytes != length($tx_msg) ) + { + Error( "Incomplete write, only ".$n_bytes." of ".length($tx_msg)." written: $!" ); + } + + if ( $ack ) + { + Debug( "Waiting for ack" ); + my $max_wait = 3; + my $now = time(); + while( 1 ) + { + my ( $count, $rx_msg ) = $self->{port}->read(4); + + if ( $count ) + { + #print( "Rx1: ".$count." bytes\n" ); + my @resp = unpack( "C*", $rx_msg ); + $self->printMsg( \@resp, "Rx" ); + + if ( $resp[0] = 0x80 + ($id<<4) ) + { + if ( ($resp[1] & 0xf0) == 0x40 ) + { + my $socket = $resp[1] & 0x0f; + Debug( "Got ack for socket $socket" ); + $result = !undef; + } + else + { + Error( "Got bogus response" ); + } + last; + } + else + { + Error( "Got message for camera ".(($resp[0]-0x80)>>4) ); + } + } + if ( (time() - $now) > $max_wait ) + { + last; + } + } + } + + if ( $cmp ) + { + Debug( "Waiting for command complete" ); + my $max_wait = 10; + my $now = time(); + while( 1 ) + { + #print( "Waiting\n" ); + my ( $count, $rx_msg ) = $self->{port}->read(16); + + if ( $count ) + { + #print( "Rx1: ".$count." bytes\n" ); + my @resp = unpack( "C*", $rx_msg ); + $self->printMsg( \@resp, "Rx" ); + + if ( $resp[0] = 0x80 + ($id<<4) ) + { + if ( ($resp[1] & 0xf0) == 0x50 ) + { + Debug( "Got command complete" ); + $result = !undef; + } + else + { + Error( "Got bogus response" ); + } + last; + } + else + { + Error( "Got message for camera ".(($resp[0]-0x80)>>4) ); + } + } + if ( (time() - $now) > $max_wait ) + { + last; + } + } + } + return( $result ); +} + +sub cameraOff +{ + my $self = shift; + Debug( "Camera Off\n" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x00, 0x0, SYNC ); + $self->sendCmd( \@msg ); +} + +sub cameraOn +{ + my $self = shift; + Debug( "Camera On\n" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x00, 0x2, SYNC ); + $self->sendCmd( \@msg ); +} + +sub stop +{ + my $self = shift; + Debug( "Stop\n" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x01, 0x00, 0x00, 0x03, 0x03, SYNC ); + $self->sendCmd( \@msg ); +} + +sub moveConUp +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'tiltspeed', 0x40 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Up" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x01, 0x00, $speed, 0x03, 0x01, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub moveConDown +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'tiltspeed', 0x40 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Down" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x01, 0x00, $speed, 0x03, 0x02, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub movConLeft +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'panspeed', 0x40 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Left" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x01, $speed, 0x00, 0x01, 0x03, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub moveConRight +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'panspeed', 0x40 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Right" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x01, $speed, 0x00, 0x02, 0x03, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub moveUpLeft +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x40 ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x40 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Up/Left" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x01, $panspeed, $tiltspeed, 0x01, 0x01, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub moveUpRight +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x40 ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x40 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Up/Right" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x01, $panspeed, $tiltspeed, 0x02, 0x01, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub moveDownLeft +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x40 ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x40 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Down/Left" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x01, $panspeed, $tiltspeed, 0x01, 0x02, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub moveDownRight +{ + my $self = shift; + my $params = shift; + my $panspeed = $self->getParam( $params, 'panspeed', 0x40 ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x40 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Move Down/Right" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x01, $panspeed, $tiltspeed, 0x02, 0x02, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->stop( $params ); + } +} + +sub moveRelUp +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'tiltstep' ); + my $speed = $self->getParam( $params, 'tiltspeed', 0x40 ); + Debug( "Step Up" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x03, 0x00, $speed, 0x00, 0x00, 0x00, 0x00, ($step&0xf000)>>12, ($step&0x0f00)>>8, ($step&0x00f0)>>4, ($step&0x000f)>>0, SYNC ); + + $self->sendCmd( \@msg ); +} + +sub moveRelDown +{ + my $self = shift; + my $params = shift; + my $step = -$self->getParam( $params, 'tiltstep' ); + my $speed = $self->getParam( $params, 'tiltspeed', 0x40 ); + Debug( "Step Down" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x03, 0x00, $speed, 0x00, 0x00, 0x00, 0x00, ($step&0xf000)>>12, ($step&0x0f00)>>8, ($step&0x00f0)>>4, ($step&0x000f)>>0, SYNC ); + $self->sendCmd( \@msg ); +} + +sub moveRelLeft +{ + my $self = shift; + my $params = shift; + my $step = -$self->getParam( $params, 'panstep' ); + my $speed = $self->getParam( $params, 'panspeed', 0x40 ); + Debug( "Step Left" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x03, $speed, 0x00, ($step&0xf000)>>12, ($step&0x0f00)>>8, ($step&0x00f0)>>4, ($step&0x000f)>>0, 0x00, 0x00, 0x00, 0x00, SYNC ); + $self->sendCmd( \@msg ); +} + +sub moveRelRight +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'panstep' ); + my $speed = $self->getParam( $params, 'panspeed', 0x40 ); + Debug( "Step Right" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x03, $speed, 0x00, ($step&0xf000)>>12, ($step&0x0f00)>>8, ($step&0x00f0)>>4, ($step&0x000f)>>0, 0x00, 0x00, 0x00, 0x00, SYNC ); + $self->sendCmd( \@msg ); +} + +sub moveRelUpLeft +{ + my $self = shift; + my $params = shift; + my $panstep = -$self->getParam( $params, 'panstep' ); + my $tiltstep = $self->getParam( $params, 'tiltstep' ); + my $panspeed = $self->getParam( $params, 'panspeed', 0x40 ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x40 ); + Debug( "Step Up/Left" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x03, $panspeed, $tiltspeed, ($panstep&0xf000)>>12, ($panstep&0x0f00)>>8, ($panstep&0x00f0)>>4, ($panstep&0x000f)>>0, ($tiltstep&0xf000)>>12, ($tiltstep&0x0f00)>>8, ($tiltstep&0x00f0)>>4, ($tiltstep&0x000f)>>0, SYNC ); + $self->sendCmd( \@msg ); +} + +sub moveRelUpRight +{ + my $self = shift; + my $params = shift; + my $panstep = $self->getParam( $params, 'panstep' ); + my $tiltstep = $self->getParam( $params, 'tiltstep' ); + my $panspeed = $self->getParam( $params, 'panspeed', 0x40 ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x40 ); + Debug( "Step Up/Right" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x03, $panspeed, $tiltspeed, ($panstep&0xf000)>>12, ($panstep&0x0f00)>>8, ($panstep&0x00f0)>>4, ($panstep&0x000f)>>0, ($tiltstep&0xf000)>>12, ($tiltstep&0x0f00)>>8, ($tiltstep&0x00f0)>>4, ($tiltstep&0x000f)>>0, SYNC ); + $self->sendCmd( \@msg ); +} + +sub moveRelDownLeft +{ + my $self = shift; + my $params = shift; + my $panstep = -$self->getParam( $params, 'panstep' ); + my $tiltstep = -$self->getParam( $params, 'tiltstep' ); + my $panspeed = $self->getParam( $params, 'panspeed', 0x40 ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x40 ); + Debug( "Step Down/Left" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x03, $panspeed, $tiltspeed, ($panstep&0xf000)>>12, ($panstep&0x0f00)>>8, ($panstep&0x00f0)>>4, ($panstep&0x000f)>>0, ($tiltstep&0xf000)>>12, ($tiltstep&0x0f00)>>8, ($tiltstep&0x00f0)>>4, ($tiltstep&0x000f)>>0, SYNC ); + $self->sendCmd( \@msg ); +} + +sub moveRelDownRight +{ + my $self = shift; + my $params = shift; + my $panstep = $self->getParam( $params, 'panstep' ); + my $tiltstep = -$self->getParam( $params, 'tiltstep' ); + my $panspeed = $self->getParam( $params, 'panspeed', 0x40 ); + my $tiltspeed = $self->getParam( $params, 'tiltspeed', 0x40 ); + Debug( "Step Down/Right" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x03, $panspeed, $tiltspeed, ($panstep&0xf000)>>12, ($panstep&0x0f00)>>8, ($panstep&0x00f0)>>4, ($panstep&0x000f)>>0, ($tiltstep&0xf000)>>12, ($tiltstep&0x0f00)>>8, ($tiltstep&0x00f0)>>4, ($tiltstep&0x000f)>>0, SYNC ); + $self->sendCmd( \@msg ); +} + +sub zoomConTele +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'speed', 0x06 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Zoom Tele" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x07, 0x20|$speed, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->zoomStop(); + } +} + +sub zoomWide +{ + my $self = shift; + my $params = shift; + my $speed = $self->getParam( $params, 'speed', 0x06 ); + my $autostop = $self->getParam( $params, 'autostop', 0 ); + Debug( "Zoom Wide" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x07, 0x30|$speed, SYNC ); + $self->sendCmd( \@msg ); + if( $autostop && $self->{Monitor}->{AutoStopTimeout} ) + { + usleep( $self->{Monitor}->{AutoStopTimeout} ); + $self->zoomStop(); + } +} + +sub zoomStop +{ + my $self = shift; + my $params = shift; + Debug( "Zoom Stop" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x07, 0x00, SYNC ); + $self->sendCmd( \@msg ); +} + +sub focusConNear +{ + my $self = shift; + my $params = shift; + Debug( "Focus Near" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x08, 0x03, SYNC ); + $self->sendCmd( \@msg ); +} + +sub focusConFar +{ + my $self = shift; + my $params = shift; + Debug( "Focus Far" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x08, 0x02, SYNC ); + $self->sendCmd( \@msg ); +} + +sub focusStop +{ + my $self = shift; + my $params = shift; + Debug( "Focus Stop" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x08, 0x00, SYNC ); + $self->sendCmd( \@msg ); +} + +sub focusAuto +{ + my $self = shift; + my $params = shift; + Debug( "Focus Auto" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x38, 0x02, SYNC ); + $self->sendCmd( \@msg ); +} + +sub focusMan +{ + my $self = shift; + my $params = shift; + Debug( "Focus Man" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x38, 0x03, SYNC ); + $self->sendCmd( \@msg ); +} + +sub presetClear +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset', 1 ); + Debug( "Clear Preset $preset" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x3f, 0x00, $preset, SYNC ); + $self->sendCmd( \@msg ); +} + +sub presetSet +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset', 1 ); + Debug( "Set Preset $preset" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x3f, 0x01, $preset, SYNC ); + $self->sendCmd( \@msg ); +} + +sub presetGoto +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset', 1 ); + Debug( "Goto Preset $preset" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x04, 0x3f, 0x02, $preset, SYNC ); + $self->sendCmd( \@msg ); +} + +sub presetHome +{ + my $self = shift; + my $params = shift; + Debug( "Home Preset" ); + my @msg = ( 0x80|$self->{Monitor}->{ControlAddress}, 0x01, 0x06, 0x04, SYNC ); + $self->sendCmd( \@msg ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/mjpgStreamer.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/mjpgStreamer.pm new file mode 100644 index 000000000..33a15cba1 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/mjpgStreamer.pm @@ -0,0 +1,252 @@ +# ========================================================================== +# +# ZoneMinder mjpg STreamer Control Protocol Module, $Date: 2007-11-04 17:30:29 +0000 (Sun, 04 Nov 2007) $, $Revision: 2229 $ +# Copyright (C) 2003, 2004, 2005, 2006 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. +# +# ========================================================================== +# +# This module contains the implementation of the mjpg streamer camera control +# protocol +# +package ZoneMinder::Control::mjpgStreamer; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# mjpgSTreamer Control Protocol +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Config qw(:all); + +use Time::HiRes qw( usleep ); + +sub new +{ + my $class = shift; + my $id = shift; + my $self = ZoneMinder::Control->new( $id ); + Debug( "Camera New" ); + bless( $self, $class ); + srand( time() ); + return $self; +} + +our $AUTOLOAD; + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + Debug( "Camera AUTOLOAD" ); + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + Fatal( "Can't access $name member of object of class $class" ); +} + +sub open +{ + my $self = shift; + + $self->loadMonitor(); + Debug( "Camera open" ); + use LWP::UserAgent; + $self->{ua} = LWP::UserAgent->new; + $self->{ua}->agent( "ZoneMinder Control Agent/".ZM_VERSION ); + + $self->{state} = 'open'; +} + +sub close +{ + my $self = shift; + $self->{state} = 'closed'; +} + +sub printMsg +{ + my $self = shift; + my $msg = shift; + my $msg_len = length($msg); + + Debug( $msg."[".$msg_len."]" ); +} + +sub sendCmd +{ + my $self = shift; + my $cmd = shift; + + my $result = undef; + + printMsg( $cmd, "Tx" ); + + my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/$cmd" ); + my $res = $self->{ua}->request($req); + + if ( $res->is_success ) + { + $result = !undef; + } + else + { + Error( "Error check failed: '".$res->status_line()."'" ); + } + + return( $result ); +} + +sub Up +{ + my $self = shift; + $self->moveConUp(); +} + +sub Down +{ + my $self = shift; + $self->moveConDown(); +} + +sub Left +{ + my $self = shift; + $self->moveConLeft(); +} + +sub Right +{ + my $self = shift; + $self->moveConRight(); +} + + +sub reset +{ + my $self = shift; + $self->cameraReset(); +} + + + +sub cameraReset +{ + my $self = shift; + Debug( "Camera Reset" ); + my $cmd = "?action=command&command=reset_pan_tilt"; + $self->sendCmd( $cmd ); +} + +sub moveConUp +{ + my $self = shift; + Debug( "Move Up" ); + my $cmd = "?action=command&command=tilt_minus"; + $self->sendCmd( $cmd ); +} + +sub moveConDown +{ + my $self = shift; + Debug( "Move Down" ); + my $cmd = "?action=command&command=tilt_plus"; + $self->sendCmd( $cmd ); +} + +sub moveConLeft +{ + my $self = shift; + Debug( "Move Left" ); + my $cmd = "?action=command&command=pan_plus"; + $self->sendCmd( $cmd ); +} + +sub moveConRight +{ + my $self = shift; + Debug( "Move Right" ); + my $cmd = "?action=command&command=pan_minus"; + $self->sendCmd( $cmd ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2005 by Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Database.pm b/scripts/ZoneMinder/lib/ZoneMinder/Database.pm new file mode 100644 index 000000000..d0bae5dde --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Database.pm @@ -0,0 +1,238 @@ +# ========================================================================== +# +# ZoneMinder Database Module, $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. +# +# ========================================================================== +# +# This module contains the common definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::Database; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'functions' => [ qw( + zmDbConnect + zmDbDisconnect + zmDbGetMonitors + zmDbGetMonitor + zmDbGetMonitorAndControl + ) ] +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Database Access +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Config qw(:all); + +use Carp; + +our $dbh = undef; + +sub zmDbConnect( ;$ ) +{ + my $force = shift; + if ( $force ) + { + zmDbDisconnect(); + } + if ( !defined( $dbh ) ) + { + my ( $host, $port ) = ( ZM_DB_HOST =~ /^([^:]+)(?::(.+))?$/ ); + + if ( defined($port) ) + { + $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".$host.";port=".$port, ZM_DB_USER, ZM_DB_PASS ); + } + else + { + $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS ); + } + $dbh->trace( 0 ); + } + return( $dbh ); +} + +sub zmDbDisconnect() +{ + if ( defined( $dbh ) ) + { + $dbh->disconnect(); + $dbh = undef; + } +} + +use constant DB_MON_ALL => 0; # All monitors +use constant DB_MON_CAPT => 1; # All monitors that are capturing +use constant DB_MON_ACTIVE => 2; # All monitors that are active +use constant DB_MON_MOTION => 3; # All monitors that are doing motion detection +use constant DB_MON_RECORD => 4; # All monitors that are doing unconditional recording +use constant DB_MON_PASSIVE => 5; # All monitors that are in nodect state + +sub zmDbGetMonitors( ;$ ) +{ + zmDbConnect(); + + my $function = shift || DB_MON_ALL; + my $sql = "select * from Monitors"; + + if ( $function ) + { + if ( $function == DB_MON_CAPT ) + { + $sql .= " where Function >= 'Monitor'"; + } + elsif ( $function == DB_MON_ACTIVE ) + { + $sql .= " where Function > 'Monitor'"; + } + elsif ( $function == DB_MON_MOTION ) + { + $sql .= " where Function = 'Modect' or Function = 'Mocord'"; + } + elsif ( $function == DB_MON_RECORD ) + { + $sql .= " where Function = 'Record' or Function = 'Mocord'"; + } + elsif ( $function == DB_MON_PASSIVE ) + { + $sql .= " where Function = 'Nodect'"; + } + } + my $sth = $dbh->prepare_cached( $sql ) or croak( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or croak( "Can't execute '$sql': ".$sth->errstr() ); + + my @monitors; + while( my $monitor = $sth->fetchrow_hashref() ) + { + push( @monitors, $monitor ); + } + $sth->finish(); + return( \@monitors ); +} + +sub zmDbGetMonitor( $ ) +{ + zmDbConnect(); + + my $id = shift; + + return( undef ) if ( !defined($id) ); + + my $sql = "select * from Monitors where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or croak( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $id ) or croak( "Can't execute '$sql': ".$sth->errstr() ); + my $monitor = $sth->fetchrow_hashref(); + + return( $monitor ); +} + +sub zmDbGetMonitorAndControl( $ ) +{ + zmDbConnect(); + + my $id = shift; + + return( undef ) if ( !defined($id) ); + + my $sql = "select C.*,M.*,C.Protocol from Monitors as M inner join Controls as C on (M.ControlId = C.Id) where M.Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $id ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + my $monitor = $sth->fetchrow_hashref(); + + return( $monitor ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/General.pm b/scripts/ZoneMinder/lib/ZoneMinder/General.pm new file mode 100644 index 000000000..5af7150a8 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/General.pm @@ -0,0 +1,768 @@ +# ========================================================================== +# +# ZoneMinder General Utility Module, $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. +# +# ========================================================================== +# +# This module contains the common definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::General; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'functions' => [ qw( + executeShellCommand + getCmdFormat + runCommand + setFileOwner + getEventPath + createEventPath + createEvent + deleteEventFiles + makePath + jsonEncode + jsonDecode + ) ] +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# General Utility Functions +# +# ========================================================================== + +use ZoneMinder::Config qw(:all); +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Database qw(:all); + +use POSIX; + +# For running general shell commands +sub executeShellCommand( $ ) +{ + my $command = shift; + my $output = qx( $command ); + my $status = $? >> 8; + if ( $status || logDebugging() ) + { + Debug( "Command: $command\n" ); + chomp( $output ); + Debug( "Output: $output\n" ); + } + return( $status ); +} + +sub getCmdFormat() +{ + Debug( "Testing valid shell syntax\n" ); + + my ( $name ) = getpwuid( $> ); + if ( $name eq ZM_WEB_USER ) + { + Debug( "Running as '$name', su commands not needed\n" ); + return( "" ); + } + + my $null_command = "true"; + + my $prefix = "sudo -u ".ZM_WEB_USER." "; + my $suffix = ""; + my $command = $prefix.$null_command.$suffix; + Debug( "Testing \"$command\"\n" ); + $command .= " > /dev/null 2>&1"; + my $output = qx($command); + my $status = $? >> 8; + if ( !$status ) + { + Debug( "Test ok, using format \"$prefix$suffix\"\n" ); + return( $prefix, $suffix ); + } + else + { + chomp( $output ); + Debug( "Test failed, '$output'\n" ); + + $prefix = "su ".ZM_WEB_USER." --shell=/bin/sh --command='"; + $suffix = "'"; + $command = $prefix.$null_command.$suffix; + Debug( "Testing \"$command\"\n" ); + my $output = qx($command); + my $status = $? >> 8; + if ( !$status ) + { + Debug( "Test ok, using format \"$prefix$suffix\"\n" ); + return( $prefix, $suffix ); + } + else + { + chomp( $output ); + Debug( "Test failed, '$output'\n" ); + + $prefix = "su ".ZM_WEB_USER." -c '"; + $suffix = "'"; + $command = $prefix.$null_command.$suffix; + Debug( "Testing \"$command\"\n" ); + $output = qx($command); + $status = $? >> 8; + if ( !$status ) + { + Debug( "Test ok, using format \"$prefix$suffix\"\n" ); + return( $prefix, $suffix ); + } + else + { + chomp( $output ); + Debug( "Test failed, '$output'\n" ); + } + } + } + Error( "Unable to find valid 'su' syntax\n" ); + exit( -1 ); +} + +our $testedShellSyntax = 0; +our ( $cmdPrefix, $cmdSuffix ); + +# For running ZM daemons etc +sub runCommand( $ ) +{ + if ( !$testedShellSyntax ) + { + # Determine the appropriate syntax for the su command + ( $cmdPrefix, $cmdSuffix ) = getCmdFormat(); + $testedShellSyntax = !undef; + } + + my $command = shift; + $command = ZM_PATH_BIN."/".$command; + if ( $cmdPrefix ) + { + $command = $cmdPrefix.$command.$cmdSuffix; + } + Debug( "Command: $command\n" ); + my $output = qx($command); + my $status = $? >> 8; + chomp( $output ); + if ( $status || logDebugging() ) + { + if ( $status ) + { + Error( "Unable to run \"$command\", output is \"$output\"\n" ); + exit( -1 ); + } + else + { + Debug( "Output: $output\n" ); + } + } + return( $output ); +} + +sub getEventPath( $ ) +{ + my $event = shift; + + my $event_path = ""; + if ( ZM_USE_DEEP_STORAGE ) + { + $event_path = ZM_DIR_EVENTS.'/'.$event->{MonitorId}.'/'.strftime( "%y/%m/%d/%H/%M/%S", localtime($event->{Time}) ); + } + else + { + $event_path = ZM_DIR_EVENTS.'/'.$event->{MonitorId}.'/'.$event->{Id}; + } + $event_path = ZM_PATH_WEB.'/'.$event_path if ( index(ZM_DIR_EVENTS,'/') != 0 ); + return( $event_path ); +} + +sub createEventPath( $ ) +{ + # + # WARNING assumes running from events directory + # + my $event = shift; + my $eventRootPath = (ZM_DIR_EVENTS=~m|/|)?ZM_DIR_EVENTS:(ZM_PATH_WEB.'/'.ZM_DIR_EVENTS); + my $eventPath = $eventRootPath.'/'.$event->{MonitorId}; + + if ( ZM_USE_DEEP_STORAGE ) + { + my @startTime = localtime( $event->{StartTime} ); + + my @datetimeParts = (); + $datetimeParts[0] = sprintf( "%02d", $startTime[5]-100 ); + $datetimeParts[1] = sprintf( "%02d", $startTime[4]+1 ); + $datetimeParts[2] = sprintf( "%02d", $startTime[3] ); + $datetimeParts[3] = sprintf( "%02d", $startTime[2] ); + $datetimeParts[4] = sprintf( "%02d", $startTime[1] ); + $datetimeParts[5] = sprintf( "%02d", $startTime[0] ); + + my $datePath = join('/',@datetimeParts[0..2]); + my $timePath = join('/',@datetimeParts[3..5]); + + makePath( $datePath, $eventPath ); + $eventPath .= '/'.$datePath; + + # Create event id symlink + my $idFile = sprintf( "%s/.%d", $eventPath, $event->{Id} ); + symlink( $timePath, $idFile ) or Fatal( "Can't symlink $idFile -> $eventPath: $!" ); + + makePath( $timePath, $eventPath ); + $eventPath .= '/'.$timePath; + setFileOwner( $idFile ); # Must come after directory has been created + + # Create empty id tag file + $idFile = sprintf( "%s/.%d", $eventPath, $event->{Id} ); + open( ID_FP, ">$idFile" ) or Fatal( "Can't open $idFile: $!" ); + close( ID_FP ); + setFileOwner( $idFile ); + } + else + { + makePath( $event->{Id}, $eventPath ); + $eventPath .= '/'.$event->{Id}; + + my $idFile = sprintf( "%s/.%d", $eventPath, $event->{Id} ); + open( ID_FP, ">$idFile" ) or Fatal( "Can't open $idFile: $!" ); + close( ID_FP ); + setFileOwner( $idFile ); + } + return( $eventPath ); +} + +use Data::Dumper; + +our $_setFileOwner = undef; +our ( $_ownerUid, $_ownerGid ); + +sub _checkProcessOwner() +{ + if ( !defined($_setFileOwner) ) + { + my ( $processOwner ) = getpwuid( $> ); + if ( $processOwner ne ZM_WEB_USER ) + { + # Not running as web user, so should be root in whch case chown the temporary directory + ( my $ownerName, my $ownerPass, $_ownerUid, $_ownerGid ) = getpwnam( ZM_WEB_USER ) or Fatal( "Can't get user details for web user '".ZM_WEB_USER."': $!" ); + $_setFileOwner = 1; + } + else + { + $_setFileOwner = 0; + } + } + return( $_setFileOwner ); +} + +sub setFileOwner( $ ) +{ + my $file = shift; + + if ( _checkProcessOwner() ) + { + chown( $_ownerUid, $_ownerGid, $file ) or Fatal( "Can't change ownership of file '$file' to '".ZM_WEB_USER.":".ZM_WEB_GROUP."': $!" ); + } +} + +our $_hasImageInfo = undef; + +sub _checkForImageInfo() +{ + if ( !defined($_hasImageInfo) ) + { + my $result = eval + { + require Image::Info; + Image::Info->import(); + }; + $_hasImageInfo = $@?0:1; + } + return( $_hasImageInfo ); +} + +sub createEvent( $;$ ) +{ + my $event = shift; + + Debug( "Creating event" ); + #print( Dumper( $event )."\n" ); + + _checkForImageInfo(); + + my $dbh = zmDbConnect(); + + if ( $event->{monitor} ) + { + $event->{MonitorId} = $event->{monitor}->{Id}; + } + elsif ( $event->{MonitorId} ) + { + my $sql = "select * from Monitors where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare sql '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{MonitorId} ) or Fatal( "Can't execute sql '$sql': ".$sth->errstr() ); + $event->{monitor} = $sth->fetchrow_hashref() or Fatal( "Unable to create event, can't load monitor with id '".$event->{MonitorId}."'" ); + $sth->finish(); + } + else + { + Fatal( "Unable to create event, no monitor or monitor id supplied" ); + } + $event->{Name} = "New Event" unless( $event->{Name} ); + $event->{Frames} = int(@{$event->{frames}}); + $event->{TotScore} = $event->{MaxScore} = 0; + + my $lastTimestamp = 0.0; + foreach my $frame ( @{$event->{frames}} ) + { + if ( !$event->{Width} ) + { + if ( $_hasImageInfo ) + { + my $imageInfo = Image::Info::image_info( $frame->{imagePath} ); + if ( $imageInfo->{error} ) + { + Error( "Unable to extract image info from '".$frame->{imagePath}."': ".$imageInfo->{error} ); + } + else + { + ( $event->{Width}, $event->{Height} ) = Image::Info::dim( $imageInfo ); + } + } + } + $frame->{Type} = $frame->{Score}>0?'Alarm':'Normal' unless( $frame->{Type} ); + $frame->{Delta} = $lastTimestamp?($frame->{TimeStamp}-$lastTimestamp):0.0; + $event->{StartTime} = $frame->{TimeStamp} unless ( $event->{StartTime} ); + $event->{TotScore} += $frame->{Score}; + $event->{MaxScore} = $frame->{Score} if ( $frame->{Score} > $event->{MaxScore} ); + $event->{AlarmFrames}++ if ( $frame->{Type} eq 'Alarm' ); + $event->{EndTime} = $frame->{TimeStamp}; + $lastTimestamp = $frame->{TimeStamp}; + } + $event->{Width} = $event->{monitor}->{Width} unless( $event->{Width} ); + $event->{Height} = $event->{monitor}->{Height} unless( $event->{Height} ); + $event->{AvgScore} = $event->{TotScore}/int($event->{AlarmFrames}); + $event->{Length} = $event->{EndTime} - $event->{StartTime}; + + my %formats = ( + StartTime => 'from_unixtime(?)', + EndTime => 'from_unixtime(?)', + ); + + my ( @fields, @formats, @values ); + while ( my ( $field, $value ) = each( %$event ) ) + { + next unless $field =~ /^[A-Z]/; + push( @fields, $field ); + push( @formats, ($formats{$field} or '?') ); + push( @values, $event->{$field} ); + } + + my $sql = "insert into Events (".join(',',@fields).") values (".join(',',@formats).")"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare sql '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( @values ) or Fatal( "Can't execute sql '$sql': ".$sth->errstr() ); + $event->{Id} = $dbh->{mysql_insertid}; + Info( "Created event ".$event->{Id} ); + + if ( $event->{EndTime} ) + { + $event->{Name} = $event->{monitor}->{EventPrefix}.$event->{Id} if ( $event->{Name} eq 'New Event' ); + my $sql = "update Events set Name = ? where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare sql '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Name}, $event->{Id} ) or Fatal( "Can't execute sql '$sql': ".$sth->errstr() ); + } + + my $eventPath = createEventPath( $event ); + + my %frameFormats = ( + TimeStamp => 'from_unixtime(?)', + ); + my $frameId = 1; + foreach my $frame ( @{$event->{frames}} ) + { + $frame->{EventId} = $event->{Id}; + $frame->{FrameId} = $frameId++; + + my ( @fields, @formats, @values ); + while ( my ( $field, $value ) = each( %$frame ) ) + { + next unless $field =~ /^[A-Z]/; + push( @fields, $field ); + push( @formats, ($frameFormats{$field} or '?') ); + push( @values, $frame->{$field} ); + } + + my $sql = "insert into Frames (".join(',',@fields).") values (".join(',',@formats).")"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare sql '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( @values ) or Fatal( "Can't execute sql '$sql': ".$sth->errstr() ); + #$frame->{FrameId} = $dbh->{mysql_insertid}; + if ( $frame->{imagePath} ) + { + $frame->{capturePath} = sprintf( "%s/%0".ZM_EVENT_IMAGE_DIGITS."d-capture.jpg", $eventPath, $frame->{FrameId} ); + rename( $frame->{imagePath}, $frame->{capturePath} ) or Fatal( "Can't copy ".$frame->{imagePath}." to ".$frame->{capturePath}.": $!" ); + setFileOwner( $frame->{capturePath} ); + if ( 0 && ZM_CREATE_ANALYSIS_IMAGES ) + { + $frame->{analysePath} = sprintf( "%s/%0".ZM_EVENT_IMAGE_DIGITS."d-analyse.jpg", $eventPath, $frame->{FrameId} ); + link( $frame->{capturePath}, $frame->{analysePath} ) or Fatal( "Can't link ".$frame->{capturePath}." to ".$frame->{analysePath}.": $!" ); + setFileOwner( $frame->{analysePath} ); + } + } + } +} + +sub addEventImage( $$ ) +{ + my $event = shift; + my $frame = shift; + + # TBD +} + +sub updateEvent( $ ) +{ + my $event = shift; + + if ( !$event->{EventId} ) + { + Error( "Unable to update event, no event id supplied" ); + return( 0 ); + } + + my $dbh = zmDbConnect(); + + $event->{Name} = $event->{monitor}->{EventPrefix}.$event->{Id} if ( $event->{Name} eq 'New Event' ); + + my %formats = ( + StartTime => 'from_unixtime(?)', + EndTime => 'from_unixtime(?)', + ); + + my ( @values, @sets ); + while ( my ( $field, $value ) = each( %$event ) ) + { + next if ( $field eq 'Id' ); + push( @values, $event->{$field} ); + push( @sets, $field." = ".($formats{$field} or '?') ); + } + my $sql = "update Events set ".join(',',@sets)." where Id = ?"; + push( @values, $event->{Id} ); + + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare sql '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( @values ) or Fatal( "Can't execute sql '$sql': ".$sth->errstr() ); +} + +sub deleteEventFiles( $;$ ) +{ + # + # WARNING assumes running from events directory + # + my $event_id = shift; + my $monitor_id = shift; + $monitor_id = '*' if ( !defined($monitor_id) ); + + if ( ZM_USE_DEEP_STORAGE ) + { + my $link_path = $monitor_id."/*/*/*/.".$event_id; + #Debug( "LP1:$link_path" ); + my @links = glob($link_path); + #Debug( "L:".$links[0].": $!" ); + if ( @links ) + { + ( $link_path ) = ( $links[0] =~ /^(.*)$/ ); # De-taint + #Debug( "LP2:$link_path" ); + + ( my $day_path = $link_path ) =~ s/\.\d+//; + #Debug( "DP:$day_path" ); + my $event_path = $day_path.readlink( $link_path ); + ( $event_path ) = ( $event_path =~ /^(.*)$/ ); # De-taint + #Debug( "EP:$event_path" ); + my $command = "/bin/rm -rf ".$event_path; + #Debug( "C:$command" ); + executeShellCommand( $command ); + + unlink( $link_path ) or Error( "Unable to unlink '$link_path': $!" ); + my @path_parts = split( /\//, $event_path ); + for ( my $i = int(@path_parts)-2; $i >= 1; $i-- ) + { + my $delete_path = join( '/', @path_parts[0..$i] ); + #Debug( "DP$i:$delete_path" ); + my @has_files = glob( $delete_path."/*" ); + #Debug( "HF1:".$has_files[0] ) if ( @has_files ); + last if ( @has_files ); + @has_files = glob( $delete_path."/.[0-9]*" ); + #Debug( "HF2:".$has_files[0] ) if ( @has_files ); + last if ( @has_files ); + my $command = "/bin/rm -rf ".$delete_path; + executeShellCommand( $command ); + } + } + } + else + { + my $command = "/bin/rm -rf $monitor_id/$event_id"; + executeShellCommand( $command ); + } +} + +sub makePath( $;$ ) +{ + my $path = shift; + my $root = shift; + $root = (( $path =~ m|^/| )?'':'.' ) unless( $root ); + + Debug( "Creating path '$path' in $root'\n" ); + my @parts = split( '/', $path ); + my $fullPath = $root; + foreach my $dir ( @parts ) + { + $fullPath .= '/'.$dir; + if ( !-d $fullPath ) + { + if ( -e $fullPath ) + { + Fatal( "Can't create '$fullPath', already exists as non directory" ); + } + else + { + Debug( "Creating '$fullPath'\n" ); + mkdir( $fullPath, 0755 ) or Fatal( "Can't mkdir '$fullPath': $!" ); + setFileOwner( $fullPath ); + } + } + } + return( $fullPath ); +} + +our $testedJSON = 0; +our $hasJSONAny = 0; + +sub _testJSON +{ + return if ( $testedJSON ); + my $result = eval + { + require JSON::Any; + JSON::Any->import(); + }; + $testedJSON = 1; + $hasJSONAny = 1 if ( $result ); +} + +sub _getJSONType( $ ) +{ + my $value = shift; + return( 'null' ) unless( defined($value) ); + return( 'integer' ) if ( $value =~ /^\d+$/ ); + return( 'double' ) if ( $value =~ /^\d+$/ ); + return( 'hash' ) if ( ref($value) eq 'HASH' ); + return( 'array' ) if ( ref($value) eq 'ARRAY' ); + return( 'string' ); +} + +sub jsonEncode( $ ); + +sub jsonEncode( $ ) +{ + my $value = shift; + + _testJSON(); + if ( $hasJSONAny ) + { + my $string = eval { JSON::Any->objToJson( $value ) }; + Fatal( "Unable to encode object to JSON: $@" ) unless( $string ); + return( $string ); + } + + my $type = _getJSONType($value); + if ( $type eq 'integer' || $type eq 'double' ) + { + return( $value ); + } + elsif ( $type eq 'boolean' ) + { + return( $value?'true':'false' ); + } + elsif ( $type eq 'string' ) + { + $value =~ s|(["\\/])|\\$1|g; + $value =~ s|\r?\n|\n|g; + return( '"'.$value.'"' ); + } + elsif ( $type eq 'null' ) + { + return( 'null' ); + } + elsif ( $type eq 'array' ) + { + return( '['.join( ',', map { jsonEncode( $_ ) } @$value ).']' ); + } + elsif ( $type eq 'hash' ) + { + my $result = '{'; + while ( my ( $subKey=>$subValue ) = each( %$value ) ) + { + $result .= ',' if ( $result ne '{' ); + $result .= '"'.$subKey.'":'.jsonEncode( $subValue ); + } + return( $result.'}' ); + } + else + { + Fatal( "Unexpected type '$type'" ); + } +} + +sub jsonDecode( $ ) +{ + my $value = shift; + + _testJSON(); + if ( $hasJSONAny ) + { + my $object = eval { JSON::Any->jsonToObj( $value ) }; + Fatal( "Unable to decode JSON string '$value': $@" ) unless( $object ); + return( $object ); + } + + my $comment = 0; + my $unescape = 0; + my $out = ''; + my @chars = split( //, $value ); + for ( my $i = 0; $i < @chars; $i++ ) + { + if ( !$comment ) + { + if ( $chars[$i] eq ':' ) + { + $out .= '=>'; + } + else + { + $out .= $chars[$i]; + } + } + elsif ( !$unescape ) + { + if ( $chars[$i] eq '\\' ) + { + $unescape = 1; + } + else + { + $out .= $chars[$i]; + } + } + else + { + if ( $chars[$i] ne '/' ) + { + $out .= '\\'; + } + $out .= $chars[$i]; + $unescape = 0; + } + if ( $chars[$i] eq '"' ) + { + $comment = !$comment; + } + } + $out =~ s/=>true/=>1/g; + $out =~ s/=>false/=>0/g; + $out =~ s/=>null/=>undef/g; + $out =~ s/`/'/g; + $out =~ s/qx/qq/g; + ( $out ) = $out =~ m/^({.+})$/; # Detaint and check it's a valid object syntax + my $result = eval $out; + Fatal( $@ ) if ( $@ ); + return( $result ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm new file mode 100644 index 000000000..46095be2e --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm @@ -0,0 +1,861 @@ +# ========================================================================== +# +# ZoneMinder Logger Module, $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. +# +# ========================================================================== +# +# This module contains the debug definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::Logger; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'constants' => [ qw( + DEBUG + INFO + WARNING + ERROR + FATAL + PANIC + NOLOG + ) ], + 'functions' => [ qw( + logInit + logReinit + logTerm + logSetSignal + logClearSignal + logDebugging + logLevel + logTermLevel + logDatabaseLevel + logFileLevel + logSyslogLevel + Mark + Dump + Debug + Info + Warning + Error + Fatal + Panic + ) ] +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Logger Facilities +# +# ========================================================================== + +use ZoneMinder::Config qw(:all); + +use DBI; +use Carp; +use POSIX; +use IO::Handle; +use Data::Dumper; +use Time::HiRes qw/gettimeofday/; +use Sys::Syslog; + +use constant { + DEBUG => 1, + INFO => 0, + WARNING => -1, + ERROR => -2, + FATAL => -3, + PANIC => -4, + NOLOG => -5 +}; + +our %codes = ( + &DEBUG => "DBG", + &INFO => "INF", + &WARNING => "WAR", + &ERROR => "ERR", + &FATAL => "FAT", + &PANIC => "PNC", + &NOLOG => "OFF" +); + +our %priorities = ( + &DEBUG => "debug", + &INFO => "info", + &WARNING => "warning", + &ERROR => "err", + &FATAL => "err", + &PANIC => "err" +); + +our $logger; + +sub new +{ + my $class = shift; + my $this = {}; + + $this->{initialised} = undef; + + #$this->{id} = "zmundef"; + ( $this->{id} ) = $0 =~ m|^(?:.*/)?([^/]+?)(?:\.[^/.]+)?$|; + $this->{idRoot} = $this->{id}; + $this->{idArgs} = ""; + + $this->{level} = INFO; + $this->{termLevel} = NOLOG; + $this->{databaseLevel} = NOLOG; + $this->{fileLevel} = NOLOG; + $this->{syslogLevel} = NOLOG; + $this->{effectiveLevel} = INFO; + + $this->{autoFlush} = 1; + $this->{hasTerm} = -t STDERR; + + ( $this->{fileName} = $0 ) =~ s|^.*/||; + $this->{logPath} = ZM_PATH_LOGS; + $this->{logFile} = $this->{logPath}."/".$this->{id}.".log"; + + $this->{trace} = 0; + + bless( $this, $class ); + return $this; +} + +sub BEGIN +{ + # Fake the config variables that are used in case they are not defined yet + # Only really necessary to support upgrade from previous version + if ( !eval('defined(ZM_LOG_DEBUG)') ) + { + no strict 'subs'; + no strict 'refs'; + my %dbgConfig = ( + ZM_LOG_LEVEL_DATABASE => 0, + ZM_LOG_LEVEL_FILE => 0, + ZM_LOG_LEVEL_SYSLOG => 0, + ZM_LOG_DEBUG => 0, + ZM_LOG_DEBUG_TARGET => "", + ZM_LOG_DEBUG_LEVEL => 1, + ZM_LOG_DEBUG_FILE => "" + ); + while ( my ( $name, $value ) = each( %dbgConfig ) ) + { + *{$name} = sub { $value }; + } + use strict 'subs'; + use strict 'refs'; + } +} + +sub DESTROY +{ + my $this = shift; + $this->terminate(); +} + +sub initialise( @ ) +{ + my $this = shift; + my %options = @_; + + $this->{id} = $options{id} if ( defined($options{id}) ); + + $this->{logPath} = $options{logPath} if ( defined($options{logPath}) ); + + my $tempLogFile; + $tempLogFile = $this->{logPath}."/".$this->{id}.".log"; + $tempLogFile = $options{logFile} if ( defined($options{logFile}) ); + if ( my $logFile = $this->getTargettedEnv('LOG_FILE') ) + { + $tempLogFile = $logFile; + } + + my $tempLevel = INFO; + my $tempTermLevel = $this->{termLevel}; + my $tempDatabaseLevel = $this->{databaseLevel}; + my $tempFileLevel = $this->{fileLevel}; + my $tempSyslogLevel = $this->{syslogLevel}; + + $tempTermLevel = $options{termLevel} if ( defined($options{termLevel}) ); + if ( defined($options{databaseLevel}) ) + { + $tempDatabaseLevel = $options{databaseLevel}; + } + else + { + $tempDatabaseLevel = ZM_LOG_LEVEL_DATABASE; + } + if ( defined($options{fileLevel}) ) + { + $tempFileLevel = $options{fileLevel}; + } + else + { + $tempFileLevel = ZM_LOG_LEVEL_FILE; + } + if ( defined($options{syslogLevel}) ) + { + $tempSyslogLevel = $options{syslogLevel}; + } + else + { + $tempSyslogLevel = ZM_LOG_LEVEL_SYSLOG; + } + + if ( defined($ENV{'LOG_PRINT'}) ) + { + $tempTermLevel = $ENV{'LOG_PRINT'}? DEBUG : NOLOG; + } + + my $level; + $tempLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL')) ); + + $tempTermLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_TERM')) ); + $tempDatabaseLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_DATABASE')) ); + $tempFileLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_FILE')) ); + $tempSyslogLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_SYSLOG')) ); + + if ( ZM_LOG_DEBUG ) + { + foreach my $target ( split( /\|/, ZM_LOG_DEBUG_TARGET ) ) + { + if ( $target eq $this->{id} || $target eq "_".$this->{id} || $target eq $this->{idRoot} || $target eq "_".$this->{idRoot} || $target eq "" ) + { + if ( ZM_LOG_DEBUG_LEVEL > NOLOG ) + { + $tempLevel = $this->limit( ZM_LOG_DEBUG_LEVEL ); + if ( ZM_LOG_DEBUG_FILE ne "" ) + { + $tempLogFile = ZM_LOG_DEBUG_FILE; + $tempFileLevel = $tempLevel; + } + } + } + } + } + + $this->logFile( $tempLogFile ); + + $this->termLevel( $tempTermLevel ); + $this->databaseLevel( $tempDatabaseLevel ); + $this->fileLevel( $tempFileLevel ); + $this->syslogLevel( $tempSyslogLevel ); + + $this->level( $tempLevel ); + + $this->{trace} = $options{trace} if ( defined($options{trace}) ); + + $this->{autoFlush} = $ENV{'LOG_FLUSH'}?1:0 if ( defined($ENV{'LOG_FLUSH'}) ); + + $this->{initialised} = !undef; + + Debug( "LogOpts: level=".$codes{$this->{level}}."/".$codes{$this->{effectiveLevel}}.", screen=".$codes{$this->{termLevel}}.", database=".$codes{$this->{databaseLevel}}.", logfile=".$codes{$this->{fileLevel}}."->".$this->{logFile}.", syslog=".$codes{$this->{syslogLevel}} ); +} + +sub terminate() +{ + my $this = shift; + return unless ( $this->{initialised} ); + $this->syslogLevel( NOLOG ); + $this->fileLevel( NOLOG ); + $this->databaseLevel( NOLOG ); + $this->termLevel( NOLOG ); +} + +sub reinitialise() +{ + my $this = shift; + + return unless ( $this->{initialised} ); + + # Bit of a nasty hack to reopen connections to log files and the DB + my $syslogLevel = $this->syslogLevel(); + $this->syslogLevel( NOLOG ); + my $logfileLevel = $this->fileLevel(); + $this->fileLevel( NOLOG ); + my $databaseLevel = $this->databaseLevel(); + $this->databaseLevel( NOLOG ); + my $screenLevel = $this->termLevel(); + $this->termLevel( NOLOG ); + + $this->syslogLevel( $syslogLevel ) if ( $syslogLevel > NOLOG ); + $this->fileLevel( $logfileLevel ) if ( $logfileLevel > NOLOG ); + $this->databaseLevel( $databaseLevel ) if ( $databaseLevel > NOLOG ); + $this->databaseLevel( $databaseLevel ) if ( $databaseLevel > NOLOG ); +} + +sub limit( $ ) +{ + my $this = shift; + my $level = shift; + return( DEBUG ) if ( $level > DEBUG ); + return( NOLOG ) if ( $level < NOLOG ); + return( $level ); +} + +sub getTargettedEnv( $ ) +{ + my $this = shift; + my $name = shift; + my $envName = $name."_".$this->{id}; + my $value; + $value = $ENV{$envName} if ( defined($ENV{$envName}) ); + if ( !defined($value) && $this->{id} ne $this->{idRoot} ) + { + $envName = $name."_".$this->{idRoot}; + $value = $ENV{$envName} if ( defined($ENV{$envName}) ); + } + if ( !defined($value) ) + { + $value = $ENV{$name} if ( defined($ENV{$name}) ); + } + if ( defined($value) ) + { + ( $value ) = $value =~ m/(.*)/; + } + return( $value ); +} + +sub fetch() +{ + if ( !$logger ) + { + $logger = ZoneMinder::Logger->new(); + $logger->initialise( 'syslogLevel'=>INFO, 'databaseLevel'=>INFO ); + } + return( $logger ); +} + +sub id( ;$ ) +{ + my $this = shift; + my $id = shift; + if ( defined($id) && $this->{id} ne $id ) + { + # Remove whitespace + $id =~ s/\S//g; + # Replace non-alphanum with underscore + $id =~ s/[^a-zA-Z_]/_/g; + + if ( $this->{id} ne $id ) + { + $this->{id} = $this->{idRoot} = $id; + if ( $id =~ /^([^_]+)_(.+)$/ ) + { + $this->{idRoot} = $1; + $this->{idArgs} = $2; + } + } + } + return( $this->{id} ); +} + +sub level( ;$ ) +{ + my $this = shift; + my $level = shift; + if ( defined($level) ) + { + $this->{level} = $this->limit( $level ); + $this->{effectiveLevel} = NOLOG; + $this->{effectiveLevel} = $this->{termLevel} if ( $this->{termLevel} > $this->{effectiveLevel} ); + $this->{effectiveLevel} = $this->{databaseLevel} if ( $this->{databaseLevel} > $this->{effectiveLevel} ); + $this->{effectiveLevel} = $this->{fileLevel} if ( $this->{fileLevel} > $this->{effectiveLevel} ); + $this->{effectiveLevel} = $this->{syslogLevel} if ( $this->{syslogLevel} > $this->{level} ); + $this->{effectiveLevel} = $this->{level} if ( $this->{effectiveLevel} > $this->{level} ); + } + return( $this->{level} ); +} + +sub debugOn() +{ + my $this = shift; + return( $this->{effectiveLevel} >= DEBUG ); +} + +sub trace( ;$ ) +{ + my $this = shift; + $this->{trace} = $_[0] if ( @_ ); + return( $this->{trace} ); +} + +sub termLevel( ;$ ) +{ + my $this = shift; + my $termLevel = shift; + if ( defined($termLevel) ) + { + $termLevel = NOLOG if ( !$this->{hasTerm} ); + $termLevel = $this->limit( $termLevel ); + if ( $this->{termLevel} != $termLevel ) + { + $this->{termLevel} = $termLevel; + } + } + return( $this->{termLevel} ); +} + +sub databaseLevel( ;$ ) +{ + my $this = shift; + my $databaseLevel = shift; + if ( defined($databaseLevel) ) + { + $databaseLevel = $this->limit( $databaseLevel ); + if ( $this->{databaseLevel} != $databaseLevel ) + { + if ( $databaseLevel > NOLOG && $this->{databaseLevel} <= NOLOG ) + { + if ( !$this->{dbh} ) + { + my ( $host, $port ) = ( ZM_DB_HOST =~ /^([^:]+)(?::(.+))?$/ ); + + if ( defined($port) ) + { + $this->{dbh} = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".$host.";port=".$port, ZM_DB_USER, ZM_DB_PASS ); + } + else + { + $this->{dbh} = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS ); + } + if ( !$this->{dbh} ) + { + $databaseLevel = NOLOG; + Error( "Unable to write log entries to DB, can't connect to database '".ZM_DB_NAME."' on host '".ZM_DB_HOST."'" ); + } + else + { + $this->{dbh}->{AutoCommit} = 1; + Fatal( "Can't set AutoCommit on in database connection" ) unless( $this->{dbh}->{AutoCommit} ); + $this->{dbh}->{mysql_auto_reconnect} = 1; + Fatal( "Can't set mysql_auto_reconnect on in database connection" ) unless( $this->{dbh}->{mysql_auto_reconnect} ); + $this->{dbh}->trace( 0 ); + } + } + } + elsif ( $databaseLevel <= NOLOG && $this->{databaseLevel} > NOLOG ) + { + if ( $this->{dbh} ) + { + $this->{dbh}->disconnect(); + undef($this->{dbh}); + } + } + $this->{databaseLevel} = $databaseLevel; + } + } + return( $this->{databaseLevel} ); +} + +sub fileLevel( ;$ ) +{ + my $this = shift; + my $fileLevel = shift; + if ( defined($fileLevel) ) + { + $fileLevel = $this->limit($fileLevel); + if ( $this->{fileLevel} != $fileLevel ) + { + $this->closeFile() if ( $this->{fileLevel} > NOLOG ); + $this->{fileLevel} = $fileLevel; + $this->openFile() if ( $this->{fileLevel} > NOLOG ); + } + } + return( $this->{fileLevel} ); +} + +sub syslogLevel( ;$ ) +{ + my $this = shift; + my $syslogLevel = shift; + if ( defined($syslogLevel) ) + { + $syslogLevel = $this->limit($syslogLevel); + if ( $this->{syslogLevel} != $syslogLevel ) + { + $this->closeSyslog() if ( $syslogLevel <= NOLOG && $this->{syslogLevel} > NOLOG ); + $this->openSyslog() if ( $syslogLevel > NOLOG && $this->{syslogLevel} <= NOLOG ); + $this->{syslogLevel} = $syslogLevel; + } + } + return( $this->{syslogLevel} ); +} + +sub openSyslog() +{ + my $this = shift; + openlog( $this->{id}, "pid", "local1" ); +} + +sub closeSyslog() +{ + my $this = shift; + #closelog(); +} + +sub logFile( $ ) +{ + my $this = shift; + my $logFile = shift; + if ( $logFile =~ /^(.+)\+$/ ) + { + $this->{logFile} = $1.'.'.$$; + } + else + { + $this->{logFile} = $logFile; + } +} + +sub openFile() +{ + my $this = shift; + if ( open( LOGFILE, ">>".$this->{logFile} ) ) + { + LOGFILE->autoflush() if ( $this->{autoFlush} ); + + my $webUid = (getpwnam( ZM_WEB_USER ))[2]; + my $webGid = (getgrnam( ZM_WEB_GROUP ))[2]; + if ( $> == 0 ) + { + chown( $webUid, $webGid, $this->{logFile} ) or Fatal( "Can't change permissions on log file '".$this->{logFile}."': $!" ) + } + } + else + { + $this->fileLevel( NOLOG ); + Error( "Can't open log file '".$this->{logFile}."': $!" ); + } +} + +sub closeFile() +{ + my $this = shift; + close( LOGFILE ) if ( fileno(LOGFILE) ); +} + +sub logPrint( $;$ ) +{ + my $this = shift; + my $level = shift; + my $string = shift; + + if ( $level <= $this->{effectiveLevel} ) + { + $string =~ s/[\r\n]+$//g; + + my $code = $codes{$level}; + + my ($seconds, $microseconds) = gettimeofday(); + my $message = sprintf( "%s.%06d %s[%d].%s [%s]", strftime( "%x %H:%M:%S", localtime( $seconds ) ), $microseconds, $this->{id}, $$, $code, $string ); + if ( $this->{trace} ) + { + $message = Carp::shortmess( $message ); + } + else + { + $message = $message."\n"; + } + syslog( $priorities{$level}, $code." [%s]", $string ) if ( $level <= $this->{syslogLevel} ); + print( LOGFILE $message ) if ( $level <= $this->{fileLevel} ); + if ( $level <= $this->{databaseLevel} ) + { + my $sql = "insert into Logs ( TimeKey, Component, Pid, Level, Code, Message, File, Line ) values ( ?, ?, ?, ?, ?, ?, ?, NULL )"; + $this->{sth} = $this->{dbh}->prepare_cached( $sql ); + if ( !$this->{sth} ) + { + $this->{databaseLevel} = NOLOG; + Fatal( "Can't prepare log entry '$sql': ".$this->{dbh}->errstr() ); + } + my $res = $this->{sth}->execute( $seconds+($microseconds/1000000.0), $this->{id}, $$, $level, $code, $string, $this->{fileName} ); + if ( !$res ) + { + $this->{databaseLevel} = NOLOG; + Fatal( "Can't execute log entry '$sql': ".$this->{sth}->errstr() ); + } + } + print( STDERR $message ) if ( $level <= $this->{termLevel} ); + } +} + +sub logInit( ;@ ) +{ + my %options = @_ ? @_ : (); + $logger = ZoneMinder::Logger->new() if ( !$logger ); + $logger->initialise( %options ); +} + +sub logReinit() +{ + fetch()->reinitialise(); +} + +sub logTerm +{ + return unless ( $logger ); + $logger->terminate(); + $logger = undef; +} + +sub logHupHandler() +{ + my $savedErrno = $!; + return unless( $logger ); + fetch()->reinitialise(); + logSetSignal(); + $! = $savedErrno; +} + +sub logSetSignal() +{ + $SIG{HUP} = \&logHupHandler; +} + +sub logClearSignal() +{ + $SIG{HUP} = 'DEFAULT'; +} + +sub logLevel( ;$ ) +{ + return( fetch()->level( @_ ) ); +} + +sub logDebugging() +{ + return( fetch()->debugOn() ); +} + +sub logTermLevel( ;$ ) +{ + return( fetch()->termLevel( @_ ) ); +} + +sub logDatabaseLevel( ;$ ) +{ + return( fetch()->databaseLevel( @_ ) ); +} + +sub logFileLevel( ;$ ) +{ + return( fetch()->fileLevel( @_ ) ); +} + +sub logSyslogLevel( ;$ ) +{ + return( fetch()->syslogLevel( @_ ) ); +} + +sub Mark( ;$$ ) +{ + my $level = shift; + $level = DEBUG unless( defined($level) ); + my $tag = "Mark"; + fetch()->logPrint( $level, $tag ); +} + +sub Dump( \$;$ ) +{ + my $var = shift; + my $label = shift; + $label = "VAR" unless( defined($label) ); + fetch()->logPrint( DEBUG, Data::Dumper->Dump( [ $var ], [ $label ] ) ); +} + +sub Debug( @ ) +{ + fetch()->logPrint( DEBUG, @_ ); +} + +sub Info( @ ) +{ + fetch()->logPrint( INFO, @_ ); +} + +sub Warning( @ ) +{ + fetch()->logPrint( WARNING, @_ ); +} + +sub Error( @ ) +{ + fetch()->logPrint( ERROR, @_ ); +} + +sub Fatal( @ ) +{ + fetch()->logPrint( FATAL, @_ ); + exit( -1 ); +} + +sub Panic( @ ) +{ + fetch()->logPrint( PANIC, @_ ); + confess( $_[0] ); +} + +1; +__END__ + +=head1 NAME + +ZoneMinder::Logger - ZoneMinder Logger module + +=head1 SYNOPSIS + + use ZoneMinder::Logger; + use ZoneMinder::Logger qw(:all); + + logInit( "myproc", DEBUG ); + + Debug( "This is what is happening" ); + Info( "Something interesting is happening" ); + Warning( "Something might be going wrong." ); + Error( "Something has gone wrong!!" ); + Fatal( "Something has gone badly wrong, gotta stop!!" ); + Panic( "Something fundamental has gone wrong, die with stack trace ); + +=head1 DESCRIPTION + +The ZoneMinder:Logger module contains the common debug and error reporting routines used by the ZoneMinder scripts. + +To use debug in your scripts you need to include this module, and call logInit. Thereafter you can sprinkle Debug or Error calls etc throughout the code safe in the knowledge that they will be reported to your error log, and possibly the syslogger, in a meaningful and consistent format. + +Debug is discussed in terms of levels where 1 and above (currently only 1 for scripts) is considered debug, 0 is considered as informational, -1 is a warning, -2 is an error and -3 is a fatal error or panic. Where levels are mentioned below as thresholds the value given and anything with a lower level (ie. more serious) will be included. + +=head1 METHODS + +=over 4 + +=item logInit ( $id, %options ); + +Initialises the debug and prepares the logging for forthcoming operations. If not called explicitly it will be called by the first debug call in your script, but with default (and probably meaningless) options. The only compulsory arguments are $id which must be a string that will identify debug coming from this script in mixed logs. Other options may be provided as below, + + Option Default Description + --------- --------- ----------- + level INFO The initial debug level which defines which statements are output and which are ignored + trace 0 Whether to use the Carp::shortmess format in debug statements to identify where the debug was emitted from + termLevel NOLOG At what level debug is written to terminal standard error, 0 is no, 1 is yes, 2 is write only if terminal + databaseLevel INFO At what level debug is written to the Log table in the database; + fileLevel NOLOG At what level debug is written to a log file of the format of .log in the standard log directory. + syslogLevel INFO At what level debug is written to syslog. + +To disable any of these action entirely set to NOLOG + +=item logTerm (); + +Used to end the debug session and close any logs etc. Not usually necessary. + +=item $id = logId ( [$id] ); + +=item $level = logLevel ( [$level] ); + +=item $trace = logTrace ( [$trace] ); + +=item $level = logLevel ( [$level] ); + +=item $termLevel = logTermLevel ( [$termLevel] ); + +=item $databaseLevel = logDatabaseLevel ( [$databaseLevel] ); + +=item $fileLevel = logFileLevel ( [$fileLevel] ); + +=item $syslogLevel = logSyslogLevel ( [$syslogLevel] ); + +These methods can be used to get and set the current settings as defined in logInit. + +=item Debug( $string ); + +This method will output a debug message if the current debug level permits it, otherwise does nothing. This message will be tagged with the DBG string in the logs. + +=item Info( $string ); + +This method will output an informational message if the current debug level permits it, otherwise does nothing. This message will be tagged with the INF string in the logs. + +=item Warning( $string ); + +This method will output a warning message if the current debug level permits it, otherwise does nothing. This message will be tagged with the WAR string in the logs. + +=item Error( $string ); + +This method will output an error message if the current debug level permits it, otherwise does nothing. This message will be tagged with the ERR string in the logs. + +=item Fatal( $string ); + +This method will output a fatal error message and then die if the current debug level permits it, otherwise does nothing. This message will be tagged with the FAT string in the logs. + +=item Panic( $string ); + +This method will output a panic error message and then die with a stack trace if the current debug level permits it, otherwise does nothing. This message will be tagged with the PNC string in the logs. + +=head2 EXPORT + +None by default. +The :constants tag will export the debug constants which define the various levels of debug +The :variables tag will export variables containing the current debug id and level +The :functions tag will export the debug functions. This or :all is what you would normally use. +The :all tag will export all above symbols. + + +=head1 SEE ALSO + +Carp +Sys::Syslog + +The ZoneMinder README file Troubleshooting section for an extended discussion on the use and configuration of syslog with ZoneMinder. + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Memory.pm b/scripts/ZoneMinder/lib/ZoneMinder/Memory.pm new file mode 100644 index 000000000..86037713d --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Memory.pm @@ -0,0 +1,873 @@ +# ========================================================================== +# +# ZoneMinder Memory Access Module, $Date: 2008-02-25 10:13:13 +0000 (Mon, 25 Feb 2008) $, $Revision: 2323 $ +# 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. +# +# ========================================================================== +# +# This module contains the common definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::Memory; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'constants' => [ qw( + STATE_IDLE + STATE_PREALARM + STATE_ALARM + STATE_ALERT + STATE_TAPE + ACTION_GET + ACTION_SET + ACTION_RELOAD + ACTION_SUSPEND + ACTION_RESUME + TRIGGER_CANCEL + TRIGGER_ON + TRIGGER_OFF + ) ], + 'functions' => [ qw( + zmMemVerify + zmMemInvalidate + zmMemRead + zmMemWrite + zmMemTidy + zmGetMonitorState + zmGetAlarmLocation + zmIsAlarmed + zmInAlarm + zmHasAlarmed + zmGetLastEvent + zmGetLastWriteTime + zmGetLastReadTime + zmMonitorEnable + zmMonitorDisable + zmMonitorSuspend + zmMonitorResume + zmTriggerEventOn + zmTriggerEventOff + zmTriggerEventCancel + zmTriggerShowtext + ) ], +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Shared Memory Facilities +# +# ========================================================================== + +use ZoneMinder::Config qw(:all); +use ZoneMinder::Logger qw(:all); + +use constant STATE_IDLE => 0; +use constant STATE_PREALARM => 1; +use constant STATE_ALARM => 2; +use constant STATE_ALERT => 3; +use constant STATE_TAPE => 4; + +use constant ACTION_GET => 1; +use constant ACTION_SET => 2; +use constant ACTION_RELOAD => 4; +use constant ACTION_SUSPEND => 16; +use constant ACTION_RESUME => 32; + +use constant TRIGGER_CANCEL => 0; +use constant TRIGGER_ON => 1; +use constant TRIGGER_OFF => 2; + +use Storable qw( freeze thaw ); + +if ( "yes" eq 'yes' ) # 'yes' if memory is mmapped +{ + require ZoneMinder::Memory::Mapped; + ZoneMinder::Memory::Mapped->import(); +} +else +{ + require ZoneMinder::Memory::Shared; + ZoneMinder::Memory::Shared->import(); +} + +# Native architecture +our $arch = int(3.2*length(~0)); +our $native = $arch/8; +our $mem_seq = 0; + +our $mem_data = +{ + "shared_data" => { "type"=>"SharedData", "seq"=>$mem_seq++, "contents"=> { + "size" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "last_write_index" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "last_read_index" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "state" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "last_event" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "action" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "brightness" => { "type"=>"int32", "seq"=>$mem_seq++ }, + "hue" => { "type"=>"int32", "seq"=>$mem_seq++ }, + "colour" => { "type"=>"int32", "seq"=>$mem_seq++ }, + "contrast" => { "type"=>"int32", "seq"=>$mem_seq++ }, + "alarm_x" => { "type"=>"int32", "seq"=>$mem_seq++ }, + "alarm_y" => { "type"=>"int32", "seq"=>$mem_seq++ }, + "valid" => { "type"=>"uint8", "seq"=>$mem_seq++ }, + "active" => { "type"=>"uint8", "seq"=>$mem_seq++ }, + "signal" => { "type"=>"uint8", "seq"=>$mem_seq++ }, + "format" => { "type"=>"uint8", "seq"=>$mem_seq++ }, + "imagesize" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "epadding1" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "epadding2" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "last_write_time" => { "type"=>"time_t64", "seq"=>$mem_seq++ }, + "last_read_time" => { "type"=>"time_t64", "seq"=>$mem_seq++ }, + "control_state" => { "type"=>"uint8[256]", "seq"=>$mem_seq++ }, + } + }, + "trigger_data" => { "type"=>"TriggerData", "seq"=>$mem_seq++, "contents"=> { + "size" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "trigger_state" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "trigger_score" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "padding" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "trigger_cause" => { "type"=>"int8[32]", "seq"=>$mem_seq++ }, + "trigger_text" => { "type"=>"int8[256]", "seq"=>$mem_seq++ }, + "trigger_showtext" => { "type"=>"int8[256]", "seq"=>$mem_seq++ }, + } + }, + "end" => { "seq"=>$mem_seq++, "size"=> 0 } +}; + +our $mem_size = 0; +our $mem_verified = {}; + +sub zmMemInit +{ + my $offset = 0; + + foreach my $section_data ( sort { $a->{seq} <=> $b->{seq} } values( %$mem_data ) ) + { + $section_data->{offset} = $offset; + $section_data->{align} = 0; + + if ( $section_data->{align} > 1 ) + { + my $rem = $offset % $section_data->{align}; + if ( $rem > 0 ) + { + $offset += ($section_data->{align} - $rem); + } + } + foreach my $member_data ( sort { $a->{seq} <=> $b->{seq} } values( %{$section_data->{contents}} ) ) + { + if ( $member_data->{type} eq "long" || $member_data->{type} eq "ulong" || $member_data->{type} eq "size_t") + { + $member_data->{size} = $member_data->{align} = $native; + } + elsif( $member_data->{type} eq "int64" || $member_data->{type} eq "uint64" || $member_data->{type} eq "time_t64") + { + $member_data->{size} = $member_data->{align} = 8; + } + elsif ( $member_data->{type} eq "int32" || $member_data->{type} eq "uint32" || $member_data->{type} eq "bool4" ) + { + $member_data->{size} = $member_data->{align} = 4; + } + elsif ($member_data->{type} eq "int16" || $member_data->{type} eq "uint16") + { + $member_data->{size} = $member_data->{align} = 2; + } + elsif ( $member_data->{type} eq "int8" || $member_data->{type} eq "uint8" || $member_data->{type} eq "bool1" ) + { + $member_data->{size} = $member_data->{align} = 1; + } + elsif ( $member_data->{type} =~ /^u?int8\[(\d+)\]$/ ) + { + $member_data->{size} = $1; + $member_data->{align} = 1; + } + else + { + Fatal( "Unexpected type '".$member_data->{type}."' found in shared data definition." ); + } + + if ( $member_data->{align} > 1 && ($offset%$member_data->{align}) > 0 ) + { + $offset += ($member_data->{align} - ($offset%$member_data->{align})); + } + $member_data->{offset} = $offset; + $offset += $member_data->{size} + } + $section_data->{size} = $offset - $section_data->{offset}; + } + + $mem_size = $offset; +} + +&zmMemInit(); + +sub zmMemVerify( $ ) +{ + my $monitor = shift; + if ( !zmMemAttach( $monitor, $mem_size ) ) + { + return( undef ); + } + + my $mem_key = zmMemKey( $monitor ); + if ( !defined($mem_verified->{$mem_key}) ) + { + my $sd_size = zmMemRead( $monitor, "shared_data:size", 1 ); + if ( $sd_size != $mem_data->{shared_data}->{size} ) + { + if ( $sd_size ) + { + Error( "Shared data size conflict in shared_data for monitor ".$monitor->{Name}.", expected ".$mem_data->{shared_data}->{size}.", got ".$sd_size ); + } + else + { + Debug( "Shared data size conflict in shared_data for monitor ".$monitor->{Name}.", expected ".$mem_data->{shared_data}->{size}.", got ".$sd_size ); + } + return( undef ); + } + my $td_size = zmMemRead( $monitor, "trigger_data:size", 1 ); + if ( $td_size != $mem_data->{trigger_data}->{size} ) + { + if ( $td_size ) + { + Error( "Shared data size conflict in trigger_data for monitor ".$monitor->{Name}.", expected ".$mem_data->{triggger_data}->{size}.", got ".$td_size ); + } + else + { + Debug( "Shared data size conflict in trigger_data for monitor ".$monitor->{Name}.", expected ".$mem_data->{triggger_data}->{size}.", got ".$td_size ); + } + return( undef ); + } + $mem_verified->{$mem_key} = !undef; + } + return( !undef ); +} + +sub zmMemRead( $$;$ ) +{ + my $monitor = shift; + my $fields = shift; + my $nocheck = shift; + + if ( !($nocheck || zmMemVerify( $monitor )) ) + { + return( undef ); + } + + if ( !ref($fields) ) + { + $fields = [ $fields ]; + } + my @values; + foreach my $field ( @$fields ) + { + my ( $section, $element ) = split( /[\/:.]/, $field ); + Fatal( "Invalid shared data selector '$field'" ) if ( !$section || !$element ); + + my $offset = $mem_data->{$section}->{contents}->{$element}->{offset}; + my $type = $mem_data->{$section}->{contents}->{$element}->{type}; + my $size = $mem_data->{$section}->{contents}->{$element}->{size}; + + my $data = zmMemGet( $monitor, $offset, $size ); + if ( !defined($data) ) + { + Error( "Unable to read '$field' from memory for monitor ".$monitor->{Id} ); + zmMemInvalidate( $monitor ); + return( undef ); + } + my $value; + if ( $type eq "long" ) + { + ( $value ) = unpack( "l!", $data ); + } + elsif ( $type eq "ulong" || $type eq "size_t" ) + { + ( $value ) = unpack( "L!", $data ); + } + elsif ( $type eq "int64" || $type eq "time_t64" ) + { + # The "q" type is only available on 64bit platforms, so use native. + ( $value ) = unpack( "l!", $data ); + } + elsif ( $type eq "uint64" ) + { + # The "q" type is only available on 64bit platforms, so use native. + ( $value ) = unpack( "L!", $data ); + } + elsif ( $type eq "int32" ) + { + ( $value ) = unpack( "l", $data ); + } + elsif ( $type eq "uint32" || $type eq "bool4" ) + { + ( $value ) = unpack( "L", $data ); + } + elsif ( $type eq "int16" ) + { + ( $value ) = unpack( "s", $data ); + } + elsif ( $type eq "uint16" ) + { + ( $value ) = unpack( "S", $data ); + } + elsif ( $type eq "int8" ) + { + ( $value ) = unpack( "c", $data ); + } + elsif ( $type eq "uint8" || $type eq "bool1" ) + { + ( $value ) = unpack( "C", $data ); + } + elsif ( $type =~ /^int8\[\d+\]$/ ) + { + ( $value ) = unpack( "Z".$size, $data ); + } + elsif ( $type =~ /^uint8\[\d+\]$/ ) + { + ( $value ) = unpack( "C".$size, $data ); + } + else + { + Fatal( "Unexpected type '".$type."' found for '".$field."'" ); + } + push( @values, $value ); + } + if ( wantarray() ) + { + return( @values ) + } + return( $values[0] ); +} + +sub zmMemInvalidate( $ ) +{ + my $monitor = shift; + my $mem_key = zmMemKey($monitor); + if ( $mem_key ) + { + delete $mem_verified->{$mem_key}; + zmMemDetach( $monitor ); + } +} + +sub zmMemTidy() +{ + zmMemClean(); +} + +sub zmMemWrite( $$;$ ) +{ + my $monitor = shift; + my $field_values = shift; + my $nocheck = shift; + + if ( !($nocheck || zmMemVerify( $monitor )) ) + { + return( undef ); + } + + while ( my ( $field, $value ) = each( %$field_values ) ) + { + my ( $section, $element ) = split( /[\/:.]/, $field ); + Fatal( "Invalid shared data selector '$field'" ) if ( !$section || !$element ); + + my $offset = $mem_data->{$section}->{contents}->{$element}->{offset}; + my $type = $mem_data->{$section}->{contents}->{$element}->{type}; + my $size = $mem_data->{$section}->{contents}->{$element}->{size}; + + my $data; + if ( $type eq "long" ) + { + $data = pack( "l!", $value ); + } + elsif ( $type eq "ulong" || $type eq "size_t" ) + { + $data = pack( "L!", $value ); + } + elsif ( $type eq "int64" || $type eq "time_t64" ) + { + # The "q" type is only available on 64bit platforms, so use native. + $data = pack( "l!", $value ); + } + elsif ( $type eq "uint64" ) + { + # The "q" type is only available on 64bit platforms, so use native. + $data = pack( "L!", $value ); + } + elsif ( $type eq "int32" ) + { + $data = pack( "l", $value ); + } + elsif ( $type eq "uint32" || $type eq "bool4" ) + { + $data = pack( "L", $value ); + } + elsif ( $type eq "int16" ) + { + $data = pack( "s", $value ); + } + elsif ( $type eq "uint16" ) + { + $data = pack( "S", $value ); + } + elsif ( $type eq "int8" ) + { + $data = pack( "c", $value ); + } + elsif ( $type eq "uint8" || $type eq "bool1" ) + { + $data = pack( "C", $value ); + } + elsif ( $type =~ /^int8\[\d+\]$/ ) + { + $data = pack( "Z".$size, $value ); + } + elsif ( $type =~ /^uint8\[\d+\]$/ ) + { + $data = pack( "C".$size, $value ); + } + else + { + Fatal( "Unexpected type '".$type."' found for '".$field."'" ); + } + + if ( !zmMemPut( $monitor, $offset, $size, $data ) ) + { + Error( "Unable to write '$value' to '$field' in memory for monitor ".$monitor->{Id} ); + zmMemInvalidate( $monitor ); + return( undef ); + } + } + return( !undef ); +} + +sub zmGetMonitorState( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "shared_data:state" ) ); +} + +sub zmGetAlarmLocation( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, [ "shared_data:alarm_x", "shared_data:alarm_y" ] ) ); +} + +sub zmSetControlState( $$ ) +{ + my $monitor = shift; + my $control_state = shift; + + zmMemWrite( $monitor, { "shared_data:control_state" => $control_state } ); +} + +sub zmGetControlState( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "shared_data:control_state" ) ); +} + +sub zmSaveControlState( $$ ) +{ + my $monitor = shift; + my $control_state = shift; + + zmSetControlState( $monitor, freeze( $control_state ) ); +} + +sub zmRestoreControlState( $ ) +{ + my $monitor = shift; + + return( thaw( zmGetControlState( $monitor ) ) ); +} + +sub zmIsAlarmed( $ ) +{ + my $monitor = shift; + + my $state = zmGetMonitorState( $monitor ); + + return( $state == STATE_ALARM ); +} + +sub zmInAlarm( $ ) +{ + my $monitor = shift; + + my $state = zmGetMonitorState( $monitor ); + + return( $state == STATE_ALARM || $state == STATE_ALERT ); +} + +sub zmHasAlarmed( $$ ) +{ + my $monitor = shift; + my $last_event_id = shift; + + my ( $state, $last_event ) = zmMemRead( $monitor, [ "shared_data:state", "shared_data:last_event" ] ); + + if ( $state == STATE_ALARM || $state == STATE_ALERT ) + { + return( $last_event ); + } + elsif( $last_event != $last_event_id ) + { + return( $last_event ); + } + return( undef ); +} + +sub zmGetLastEvent( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "shared_data:last_event" ) ); +} + +sub zmGetLastWriteTime( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "shared_data:last_write_time" ) ); +} + +sub zmGetLastReadTime( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "shared_data:last_read_time" ) ); +} + +sub zmGetMonitorActions( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "shared_data:action" ) ); +} + +sub zmMonitorEnable( $ ) +{ + my $monitor = shift; + + my $action = zmMemRead( $monitor, "shared_data:action" ); + $action |= ACTION_SUSPEND; + zmMemWrite( $monitor, { "shared_data:action" => $action } ); +} + +sub zmMonitorDisable( $ ) +{ + my $monitor = shift; + + my $action = zmMemRead( $monitor, "shared_data:action" ); + $action |= ACTION_RESUME; + zmMemWrite( $monitor, { "shared_data:action" => $action } ); +} + +sub zmMonitorSuspend( $ ) +{ + my $monitor = shift; + + my $action = zmMemRead( $monitor, "shared_data:action" ); + $action |= ACTION_SUSPEND; + zmMemWrite( $monitor, { "shared_data:action" => $action } ); +} + +sub zmMonitorResume( $ ) +{ + my $monitor = shift; + + my $action = zmMemRead( $monitor, "shared_data:action" ); + $action |= ACTION_RESUME; + zmMemWrite( $monitor, { "shared_data:action" => $action } ); +} + +sub zmGetTriggerState( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "trigger_data:trigger_state" ) ); +} + +sub zmTriggerEventOn( $$$;$$ ) +{ + my $monitor = shift; + my $score = shift; + my $cause = shift; + my $text = shift; + my $showtext = shift; + + my $values = { + "trigger_data:trigger_score" => $score, + "trigger_data:trigger_cause" => $cause, + }; + $values->{"trigger_data:trigger_text"} = $text if ( defined($text) ); + $values->{"trigger_data:trigger_showtext"} = $showtext if ( defined($showtext) ); + $values->{"trigger_data:trigger_state"} = TRIGGER_ON; # Write state last so event not read incomplete + + zmMemWrite( $monitor, $values ); +} + +sub zmTriggerEventOff( $ ) +{ + my $monitor = shift; + + my $values = { + "trigger_data:trigger_state" => TRIGGER_OFF, + "trigger_data:trigger_score" => 0, + "trigger_data:trigger_cause" => "", + "trigger_data:trigger_text" => "", + "trigger_data:trigger_showtext" => "", + }; + + zmMemWrite( $monitor, $values ); +} + +sub zmTriggerEventCancel( $ ) +{ + my $monitor = shift; + + my $values = { + "trigger_data:trigger_state" => TRIGGER_CANCEL, + "trigger_data:trigger_score" => 0, + "trigger_data:trigger_cause" => "", + "trigger_data:trigger_text" => "", + "trigger_data:trigger_showtext" => "", + }; + + zmMemWrite( $monitor, $values ); +} + +sub zmTriggerShowtext( $$ ) +{ + my $monitor = shift; + my $showtext = shift; + + my $values = { + "trigger_data:trigger_showtext" => $showtext, + }; + + zmMemWrite( $monitor, $values ); +} + +1; +__END__ + +=head1 NAME + +ZoneMinder::MappedMem - ZoneMinder Mapped Memory access module + +=head1 SYNOPSIS + + use ZoneMinder::MappedMem; + use ZoneMinder::MappedMem qw(:all); + + if ( zmMemVerify( $monitor ) ) + { + $state = zmGetMonitorState( $monitor ); + if ( $state == STATE_ALARM ) + { + ... + } + } + + ( $lri, $lwi ) = zmMemRead( $monitor, [ "shared_data:last_read_index", "shared_data:last_write_index" ] ); + zmMemWrite( $monitor, { "trigger_data:trigger_showtext" => "Some Text" } ); + +=head1 DESCRIPTION + +The ZoneMinder:MappedMem module contains methods for accessing and writing to mapped memory as well as helper methods for common operations. + +The core elements of ZoneMinder used mapped memory to allow multiple access to resources. Although ZoneMinder scripts have used this information before, up until now it was difficult to access and prone to errors. This module introduces a common API for mapped memory access (both reading and writing) making it a lot easier to customise scripts or even create your own. + +All the methods listed below require a 'monitor' parameter. This must be a reference to a hash with at least the 'Id' field set to the monitor id of the mapped memory you wish to access. Using database methods to select the monitor details will also return this kind of data. Some of the mapped memory methods will add and amend new fields to this hash. + +=over 4 + +=head1 METHODS + +=item zmMemVerify ( $monitor ); + +Verify that the mapped memory of the monitor given exists and is valid. It will return an undefined value if it is not valid. You should generally call this method first before using any of the other methods, but most of the remaining methods will also do so if the memory has not already been verified. + +=item zmMemInvalidate ( $monitor ); + +Following an error, reset the mapped memory ids and attempt to reverify on the next operation. This is mostly used when a mapped memory segment has gone away and been recreated with a different id. + +=item zmMemRead ( $monitor, $readspec ); + +This method is used to read data from mapped memory attached to the given monitor. The mapped memory will be verified if it has not already been. The 'readspec' must either be a string of the form "
:" or a reference to an array of strings of the same format. In the first case a single value is returned, in the latter case a list of values is return. Errors will cause undefined to be returned. The allowable sections and field names are described below. + +=item zmMemWrite ( $monitor, $writespec ); + +This method is used to write data to mapped memory attached to the given monitor. The mapped memory will be verified if it has not already been. The 'writespec' must be a reference to a hash with keys of the form "
:" and values as the data to be written. Errors will cause undefined to be returned, otherwise a non-undefined value will be returned. The allowable sections and field names are described below. + +=item $state = zmGetMonitorState ( $monitor ); + +Return the current state of the given monitor. This is an integer value and can be compared with the STATE constants given below. + +=item $event_id = zmGetLastEvent ( $monitor ); + +Return the event id of the last event that the monitor generated, or 0 if no event has been generated by the current monitor process. + +=item zmIsAlarmed ( $monitor ); + +Return 1 if the monitor given is currently in an alarm state, 0 otherwise. + +=item zmInAlarm ( $monitor ); + +Return 1 if the monitor given is currently in an alarm or alerted state, 0 otherwise. + +=item zmHasAlarmed ( $monitor ); + +Return 1 if the given monitor is in an alarm state, or has been in an alarm state since the last call to this method. + +=item ( $x, $y ) = zmGetAlarmLocation ( $monitor ); + +Return an x,y pair indicating the image co-ordinates of the centre of the last motion event generated by the given monitor. If no event has been generated by the current monitor process, or the alarm was not motion related, returns -1,-1. + +=item zmGetLastWriteTime ( $monitor ); + +Returns the time (in utc seconds) since the last image was captured by the given monitor and written to shared memory, or 0 otherwise. + +=item zmGetLastReadTime ( $monitor ); + +Returns the time (in utc seconds) since the last image was read from shared memory by the analysis daemon of the given monitor, or 0 otherwise or if the monitor is in monitor only mode. + +=item zmMonitorSuspend ( $monitor ); + +Suspend the given monitor from generating events caused by motion. This method can be used to prevent camera actions such as panning or zooming from causing events. If configured to do so, the monitor may automatically resume after a defined period. + +=item zmMonitorResume ( $monitor ); + +Allow the given monitor to resume generating events caused by motion. + +=item zmTriggerEventOn ( $monitor, $score, $cause [, $text, $showtext ] ); + +Trigger the given monitor to generate an event. You must supply an event score and a cause string indicating the reason for the event. You may also supply a text string containing further details about the event and a showtext string which may be included in the timestamp annotation on any images captured during the event, if configured to do so. + +=item zmTriggerEventOff ( $monitor ); + +Trigger the given monitor to not generate any events. This method does not cancel zmTriggerEventOn, but is exclusive to it. This method is intended to allow external triggers to prevent normal events being generated by monitors in the same way as zmMonitorSuspend but applies to all events and not just motion, and is intended for longer timescales than are appropriate for suspension. + +=item zmTriggerEventCancel ( $monitor ); + +Cancel any previous trigger on or off requests. This stops a triggered alarm if it exists from a previous 'on' and allows events to be generated once more following a previous 'off'. + +=item zmTriggerShowtext ( $monitor, $showtest ); + +Indicate that the given text should be displayed in the timestamp annotation on any images captured, if the format of the annotation string defined for the monitor permits. + +=head1 DATA + +The data fields in mapped memory that may be accessed are as follows. There are two main sections, shared_data which is general data and trigger_data which is used for event triggering. Whilst reading from these fields is harmless, extreme care must be taken when writing to mapped memory, especially in the shared_data section as this is normally written to only by monitor capture and analysis processes. + + shared_data The general mapped memory section + size The size, in bytes, of this section + valid Flag indicating whether this section has been initialised + active Flag indicating whether this monitor is active (enabled/disabled) + signal Flag indicating whether this monitor is reciving a valid signal + state The current monitor state, see the STATE constants below + last_write_index The last index, in the image buffer, that an image has been saved to + last_read_index The last index, in the image buffer, that an image has been analysed from + last_write_time The time (in utc seconds) when the last image was captured + last_read_time The time (in utc seconds) when the last image was analysed + last_event The id of the last event generated by the monitor analysis process, 0 if none + action The monitor actions bitmask, see the ACTION constants below + brightness Read/write location for the current monitor brightness + hue Read/write location for the current monitor hue + colour Read/write location for the current monitor colour + contrast Read/write location for the current monitor contrast + alarm_x Image x co-ordinate (from left) of the centre of the last motion event, -1 if none + alarm_y Image y co-ordinate (from top) of the centre of the last motion event, -1 if none + + trigger_data The triggered event mapped memory section + size The size, in bytes of this section + trigger_state The current trigger state, see the TRIGGER constants below + trigger_score The current triggered event score + trigger_cause The current triggered event cause string + trigger_text The current triggered event descriptive text string + trigger_showtext The triggered text that will be displayed on captured image timestamps + +=head1 CONSTANTS + +The following constants are used by the methods above, but can also be used by user scripts if required. + +=item STATE_IDLE STATE_PREALARM STATE_ALARM STATE_ALERT STATE_TAPE + +These constants define the state of the monitor with respect to alarms and events. They are used in the shared_data:state field. + +=item ACTION_GET ACTION_SET ACTION_RELOAD ACTION_SUSPEND ACTION_RESUME + +These constants defines the various values that can exist in the shared_data:action field. This is a bitmask which when non-zero defines an action that an executing monitor process should take. ACTION_GET requires that the current values of brightness, contrast, colour and hue are taken from the camera and written to the equivalent mapped memory fields. ACTION_SET implies the reverse, that the values in mapped memory should be written to the camera. ACTION_RELOAD signal that the monitor process should reload itself from the database in case any settings have changed there. ACTION_SUSPEND signals that a monitor should stop exaiming images for motion, though other alarms may still occur. ACTION_RESUME sigansl that a monitor should resume motion detectiom. + +=item TRIGGER_CANCEL TRIGGER_ON TRIGGER_OFF + +These constants are used in the definition of external triggers. TRIGGER_CANCEL is used to indicated that any previous trigger settings should be cancelled, TRIGGER_ON signals that an alarm should be created (or continued)) as a result of the current trigger and TRIGGER_OFF signals that the trigger should prevent any alarms from being generated. See the trigger methods above for further details. + +=head1 EXPORT + +None by default. +The :constants tag will export the mapped memory constants which mostly define enumerations for the variables held in memory +The :functions tag will export the mapped memory access functions. +The :all tag will export all above symbols. + + +=head1 SEE ALSO + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Memory.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/Memory.pm.in new file mode 100644 index 000000000..dfc9da828 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Memory.pm.in @@ -0,0 +1,873 @@ +# ========================================================================== +# +# ZoneMinder Memory Access Module, $Date: 2008-02-25 10:13:13 +0000 (Mon, 25 Feb 2008) $, $Revision: 2323 $ +# 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. +# +# ========================================================================== +# +# This module contains the common definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::Memory; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'constants' => [ qw( + STATE_IDLE + STATE_PREALARM + STATE_ALARM + STATE_ALERT + STATE_TAPE + ACTION_GET + ACTION_SET + ACTION_RELOAD + ACTION_SUSPEND + ACTION_RESUME + TRIGGER_CANCEL + TRIGGER_ON + TRIGGER_OFF + ) ], + 'functions' => [ qw( + zmMemVerify + zmMemInvalidate + zmMemRead + zmMemWrite + zmMemTidy + zmGetMonitorState + zmGetAlarmLocation + zmIsAlarmed + zmInAlarm + zmHasAlarmed + zmGetLastEvent + zmGetLastWriteTime + zmGetLastReadTime + zmMonitorEnable + zmMonitorDisable + zmMonitorSuspend + zmMonitorResume + zmTriggerEventOn + zmTriggerEventOff + zmTriggerEventCancel + zmTriggerShowtext + ) ], +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Shared Memory Facilities +# +# ========================================================================== + +use ZoneMinder::Config qw(:all); +use ZoneMinder::Logger qw(:all); + +use constant STATE_IDLE => 0; +use constant STATE_PREALARM => 1; +use constant STATE_ALARM => 2; +use constant STATE_ALERT => 3; +use constant STATE_TAPE => 4; + +use constant ACTION_GET => 1; +use constant ACTION_SET => 2; +use constant ACTION_RELOAD => 4; +use constant ACTION_SUSPEND => 16; +use constant ACTION_RESUME => 32; + +use constant TRIGGER_CANCEL => 0; +use constant TRIGGER_ON => 1; +use constant TRIGGER_OFF => 2; + +use Storable qw( freeze thaw ); + +if ( "@ENABLE_MMAP@" eq 'yes' ) # 'yes' if memory is mmapped +{ + require ZoneMinder::Memory::Mapped; + ZoneMinder::Memory::Mapped->import(); +} +else +{ + require ZoneMinder::Memory::Shared; + ZoneMinder::Memory::Shared->import(); +} + +# Native architecture +our $arch = int(3.2*length(~0)); +our $native = $arch/8; +our $mem_seq = 0; + +our $mem_data = +{ + "shared_data" => { "type"=>"SharedData", "seq"=>$mem_seq++, "contents"=> { + "size" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "last_write_index" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "last_read_index" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "state" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "last_event" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "action" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "brightness" => { "type"=>"int32", "seq"=>$mem_seq++ }, + "hue" => { "type"=>"int32", "seq"=>$mem_seq++ }, + "colour" => { "type"=>"int32", "seq"=>$mem_seq++ }, + "contrast" => { "type"=>"int32", "seq"=>$mem_seq++ }, + "alarm_x" => { "type"=>"int32", "seq"=>$mem_seq++ }, + "alarm_y" => { "type"=>"int32", "seq"=>$mem_seq++ }, + "valid" => { "type"=>"uint8", "seq"=>$mem_seq++ }, + "active" => { "type"=>"uint8", "seq"=>$mem_seq++ }, + "signal" => { "type"=>"uint8", "seq"=>$mem_seq++ }, + "format" => { "type"=>"uint8", "seq"=>$mem_seq++ }, + "imagesize" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "epadding1" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "epadding2" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "last_write_time" => { "type"=>"time_t64", "seq"=>$mem_seq++ }, + "last_read_time" => { "type"=>"time_t64", "seq"=>$mem_seq++ }, + "control_state" => { "type"=>"uint8[256]", "seq"=>$mem_seq++ }, + } + }, + "trigger_data" => { "type"=>"TriggerData", "seq"=>$mem_seq++, "contents"=> { + "size" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "trigger_state" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "trigger_score" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "padding" => { "type"=>"uint32", "seq"=>$mem_seq++ }, + "trigger_cause" => { "type"=>"int8[32]", "seq"=>$mem_seq++ }, + "trigger_text" => { "type"=>"int8[256]", "seq"=>$mem_seq++ }, + "trigger_showtext" => { "type"=>"int8[256]", "seq"=>$mem_seq++ }, + } + }, + "end" => { "seq"=>$mem_seq++, "size"=> 0 } +}; + +our $mem_size = 0; +our $mem_verified = {}; + +sub zmMemInit +{ + my $offset = 0; + + foreach my $section_data ( sort { $a->{seq} <=> $b->{seq} } values( %$mem_data ) ) + { + $section_data->{offset} = $offset; + $section_data->{align} = 0; + + if ( $section_data->{align} > 1 ) + { + my $rem = $offset % $section_data->{align}; + if ( $rem > 0 ) + { + $offset += ($section_data->{align} - $rem); + } + } + foreach my $member_data ( sort { $a->{seq} <=> $b->{seq} } values( %{$section_data->{contents}} ) ) + { + if ( $member_data->{type} eq "long" || $member_data->{type} eq "ulong" || $member_data->{type} eq "size_t") + { + $member_data->{size} = $member_data->{align} = $native; + } + elsif( $member_data->{type} eq "int64" || $member_data->{type} eq "uint64" || $member_data->{type} eq "time_t64") + { + $member_data->{size} = $member_data->{align} = 8; + } + elsif ( $member_data->{type} eq "int32" || $member_data->{type} eq "uint32" || $member_data->{type} eq "bool4" ) + { + $member_data->{size} = $member_data->{align} = 4; + } + elsif ($member_data->{type} eq "int16" || $member_data->{type} eq "uint16") + { + $member_data->{size} = $member_data->{align} = 2; + } + elsif ( $member_data->{type} eq "int8" || $member_data->{type} eq "uint8" || $member_data->{type} eq "bool1" ) + { + $member_data->{size} = $member_data->{align} = 1; + } + elsif ( $member_data->{type} =~ /^u?int8\[(\d+)\]$/ ) + { + $member_data->{size} = $1; + $member_data->{align} = 1; + } + else + { + Fatal( "Unexpected type '".$member_data->{type}."' found in shared data definition." ); + } + + if ( $member_data->{align} > 1 && ($offset%$member_data->{align}) > 0 ) + { + $offset += ($member_data->{align} - ($offset%$member_data->{align})); + } + $member_data->{offset} = $offset; + $offset += $member_data->{size} + } + $section_data->{size} = $offset - $section_data->{offset}; + } + + $mem_size = $offset; +} + +&zmMemInit(); + +sub zmMemVerify( $ ) +{ + my $monitor = shift; + if ( !zmMemAttach( $monitor, $mem_size ) ) + { + return( undef ); + } + + my $mem_key = zmMemKey( $monitor ); + if ( !defined($mem_verified->{$mem_key}) ) + { + my $sd_size = zmMemRead( $monitor, "shared_data:size", 1 ); + if ( $sd_size != $mem_data->{shared_data}->{size} ) + { + if ( $sd_size ) + { + Error( "Shared data size conflict in shared_data for monitor ".$monitor->{Name}.", expected ".$mem_data->{shared_data}->{size}.", got ".$sd_size ); + } + else + { + Debug( "Shared data size conflict in shared_data for monitor ".$monitor->{Name}.", expected ".$mem_data->{shared_data}->{size}.", got ".$sd_size ); + } + return( undef ); + } + my $td_size = zmMemRead( $monitor, "trigger_data:size", 1 ); + if ( $td_size != $mem_data->{trigger_data}->{size} ) + { + if ( $td_size ) + { + Error( "Shared data size conflict in trigger_data for monitor ".$monitor->{Name}.", expected ".$mem_data->{triggger_data}->{size}.", got ".$td_size ); + } + else + { + Debug( "Shared data size conflict in trigger_data for monitor ".$monitor->{Name}.", expected ".$mem_data->{triggger_data}->{size}.", got ".$td_size ); + } + return( undef ); + } + $mem_verified->{$mem_key} = !undef; + } + return( !undef ); +} + +sub zmMemRead( $$;$ ) +{ + my $monitor = shift; + my $fields = shift; + my $nocheck = shift; + + if ( !($nocheck || zmMemVerify( $monitor )) ) + { + return( undef ); + } + + if ( !ref($fields) ) + { + $fields = [ $fields ]; + } + my @values; + foreach my $field ( @$fields ) + { + my ( $section, $element ) = split( /[\/:.]/, $field ); + Fatal( "Invalid shared data selector '$field'" ) if ( !$section || !$element ); + + my $offset = $mem_data->{$section}->{contents}->{$element}->{offset}; + my $type = $mem_data->{$section}->{contents}->{$element}->{type}; + my $size = $mem_data->{$section}->{contents}->{$element}->{size}; + + my $data = zmMemGet( $monitor, $offset, $size ); + if ( !defined($data) ) + { + Error( "Unable to read '$field' from memory for monitor ".$monitor->{Id} ); + zmMemInvalidate( $monitor ); + return( undef ); + } + my $value; + if ( $type eq "long" ) + { + ( $value ) = unpack( "l!", $data ); + } + elsif ( $type eq "ulong" || $type eq "size_t" ) + { + ( $value ) = unpack( "L!", $data ); + } + elsif ( $type eq "int64" || $type eq "time_t64" ) + { + # The "q" type is only available on 64bit platforms, so use native. + ( $value ) = unpack( "l!", $data ); + } + elsif ( $type eq "uint64" ) + { + # The "q" type is only available on 64bit platforms, so use native. + ( $value ) = unpack( "L!", $data ); + } + elsif ( $type eq "int32" ) + { + ( $value ) = unpack( "l", $data ); + } + elsif ( $type eq "uint32" || $type eq "bool4" ) + { + ( $value ) = unpack( "L", $data ); + } + elsif ( $type eq "int16" ) + { + ( $value ) = unpack( "s", $data ); + } + elsif ( $type eq "uint16" ) + { + ( $value ) = unpack( "S", $data ); + } + elsif ( $type eq "int8" ) + { + ( $value ) = unpack( "c", $data ); + } + elsif ( $type eq "uint8" || $type eq "bool1" ) + { + ( $value ) = unpack( "C", $data ); + } + elsif ( $type =~ /^int8\[\d+\]$/ ) + { + ( $value ) = unpack( "Z".$size, $data ); + } + elsif ( $type =~ /^uint8\[\d+\]$/ ) + { + ( $value ) = unpack( "C".$size, $data ); + } + else + { + Fatal( "Unexpected type '".$type."' found for '".$field."'" ); + } + push( @values, $value ); + } + if ( wantarray() ) + { + return( @values ) + } + return( $values[0] ); +} + +sub zmMemInvalidate( $ ) +{ + my $monitor = shift; + my $mem_key = zmMemKey($monitor); + if ( $mem_key ) + { + delete $mem_verified->{$mem_key}; + zmMemDetach( $monitor ); + } +} + +sub zmMemTidy() +{ + zmMemClean(); +} + +sub zmMemWrite( $$;$ ) +{ + my $monitor = shift; + my $field_values = shift; + my $nocheck = shift; + + if ( !($nocheck || zmMemVerify( $monitor )) ) + { + return( undef ); + } + + while ( my ( $field, $value ) = each( %$field_values ) ) + { + my ( $section, $element ) = split( /[\/:.]/, $field ); + Fatal( "Invalid shared data selector '$field'" ) if ( !$section || !$element ); + + my $offset = $mem_data->{$section}->{contents}->{$element}->{offset}; + my $type = $mem_data->{$section}->{contents}->{$element}->{type}; + my $size = $mem_data->{$section}->{contents}->{$element}->{size}; + + my $data; + if ( $type eq "long" ) + { + $data = pack( "l!", $value ); + } + elsif ( $type eq "ulong" || $type eq "size_t" ) + { + $data = pack( "L!", $value ); + } + elsif ( $type eq "int64" || $type eq "time_t64" ) + { + # The "q" type is only available on 64bit platforms, so use native. + $data = pack( "l!", $value ); + } + elsif ( $type eq "uint64" ) + { + # The "q" type is only available on 64bit platforms, so use native. + $data = pack( "L!", $value ); + } + elsif ( $type eq "int32" ) + { + $data = pack( "l", $value ); + } + elsif ( $type eq "uint32" || $type eq "bool4" ) + { + $data = pack( "L", $value ); + } + elsif ( $type eq "int16" ) + { + $data = pack( "s", $value ); + } + elsif ( $type eq "uint16" ) + { + $data = pack( "S", $value ); + } + elsif ( $type eq "int8" ) + { + $data = pack( "c", $value ); + } + elsif ( $type eq "uint8" || $type eq "bool1" ) + { + $data = pack( "C", $value ); + } + elsif ( $type =~ /^int8\[\d+\]$/ ) + { + $data = pack( "Z".$size, $value ); + } + elsif ( $type =~ /^uint8\[\d+\]$/ ) + { + $data = pack( "C".$size, $value ); + } + else + { + Fatal( "Unexpected type '".$type."' found for '".$field."'" ); + } + + if ( !zmMemPut( $monitor, $offset, $size, $data ) ) + { + Error( "Unable to write '$value' to '$field' in memory for monitor ".$monitor->{Id} ); + zmMemInvalidate( $monitor ); + return( undef ); + } + } + return( !undef ); +} + +sub zmGetMonitorState( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "shared_data:state" ) ); +} + +sub zmGetAlarmLocation( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, [ "shared_data:alarm_x", "shared_data:alarm_y" ] ) ); +} + +sub zmSetControlState( $$ ) +{ + my $monitor = shift; + my $control_state = shift; + + zmMemWrite( $monitor, { "shared_data:control_state" => $control_state } ); +} + +sub zmGetControlState( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "shared_data:control_state" ) ); +} + +sub zmSaveControlState( $$ ) +{ + my $monitor = shift; + my $control_state = shift; + + zmSetControlState( $monitor, freeze( $control_state ) ); +} + +sub zmRestoreControlState( $ ) +{ + my $monitor = shift; + + return( thaw( zmGetControlState( $monitor ) ) ); +} + +sub zmIsAlarmed( $ ) +{ + my $monitor = shift; + + my $state = zmGetMonitorState( $monitor ); + + return( $state == STATE_ALARM ); +} + +sub zmInAlarm( $ ) +{ + my $monitor = shift; + + my $state = zmGetMonitorState( $monitor ); + + return( $state == STATE_ALARM || $state == STATE_ALERT ); +} + +sub zmHasAlarmed( $$ ) +{ + my $monitor = shift; + my $last_event_id = shift; + + my ( $state, $last_event ) = zmMemRead( $monitor, [ "shared_data:state", "shared_data:last_event" ] ); + + if ( $state == STATE_ALARM || $state == STATE_ALERT ) + { + return( $last_event ); + } + elsif( $last_event != $last_event_id ) + { + return( $last_event ); + } + return( undef ); +} + +sub zmGetLastEvent( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "shared_data:last_event" ) ); +} + +sub zmGetLastWriteTime( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "shared_data:last_write_time" ) ); +} + +sub zmGetLastReadTime( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "shared_data:last_read_time" ) ); +} + +sub zmGetMonitorActions( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "shared_data:action" ) ); +} + +sub zmMonitorEnable( $ ) +{ + my $monitor = shift; + + my $action = zmMemRead( $monitor, "shared_data:action" ); + $action |= ACTION_SUSPEND; + zmMemWrite( $monitor, { "shared_data:action" => $action } ); +} + +sub zmMonitorDisable( $ ) +{ + my $monitor = shift; + + my $action = zmMemRead( $monitor, "shared_data:action" ); + $action |= ACTION_RESUME; + zmMemWrite( $monitor, { "shared_data:action" => $action } ); +} + +sub zmMonitorSuspend( $ ) +{ + my $monitor = shift; + + my $action = zmMemRead( $monitor, "shared_data:action" ); + $action |= ACTION_SUSPEND; + zmMemWrite( $monitor, { "shared_data:action" => $action } ); +} + +sub zmMonitorResume( $ ) +{ + my $monitor = shift; + + my $action = zmMemRead( $monitor, "shared_data:action" ); + $action |= ACTION_RESUME; + zmMemWrite( $monitor, { "shared_data:action" => $action } ); +} + +sub zmGetTriggerState( $ ) +{ + my $monitor = shift; + + return( zmMemRead( $monitor, "trigger_data:trigger_state" ) ); +} + +sub zmTriggerEventOn( $$$;$$ ) +{ + my $monitor = shift; + my $score = shift; + my $cause = shift; + my $text = shift; + my $showtext = shift; + + my $values = { + "trigger_data:trigger_score" => $score, + "trigger_data:trigger_cause" => $cause, + }; + $values->{"trigger_data:trigger_text"} = $text if ( defined($text) ); + $values->{"trigger_data:trigger_showtext"} = $showtext if ( defined($showtext) ); + $values->{"trigger_data:trigger_state"} = TRIGGER_ON; # Write state last so event not read incomplete + + zmMemWrite( $monitor, $values ); +} + +sub zmTriggerEventOff( $ ) +{ + my $monitor = shift; + + my $values = { + "trigger_data:trigger_state" => TRIGGER_OFF, + "trigger_data:trigger_score" => 0, + "trigger_data:trigger_cause" => "", + "trigger_data:trigger_text" => "", + "trigger_data:trigger_showtext" => "", + }; + + zmMemWrite( $monitor, $values ); +} + +sub zmTriggerEventCancel( $ ) +{ + my $monitor = shift; + + my $values = { + "trigger_data:trigger_state" => TRIGGER_CANCEL, + "trigger_data:trigger_score" => 0, + "trigger_data:trigger_cause" => "", + "trigger_data:trigger_text" => "", + "trigger_data:trigger_showtext" => "", + }; + + zmMemWrite( $monitor, $values ); +} + +sub zmTriggerShowtext( $$ ) +{ + my $monitor = shift; + my $showtext = shift; + + my $values = { + "trigger_data:trigger_showtext" => $showtext, + }; + + zmMemWrite( $monitor, $values ); +} + +1; +__END__ + +=head1 NAME + +ZoneMinder::MappedMem - ZoneMinder Mapped Memory access module + +=head1 SYNOPSIS + + use ZoneMinder::MappedMem; + use ZoneMinder::MappedMem qw(:all); + + if ( zmMemVerify( $monitor ) ) + { + $state = zmGetMonitorState( $monitor ); + if ( $state == STATE_ALARM ) + { + ... + } + } + + ( $lri, $lwi ) = zmMemRead( $monitor, [ "shared_data:last_read_index", "shared_data:last_write_index" ] ); + zmMemWrite( $monitor, { "trigger_data:trigger_showtext" => "Some Text" } ); + +=head1 DESCRIPTION + +The ZoneMinder:MappedMem module contains methods for accessing and writing to mapped memory as well as helper methods for common operations. + +The core elements of ZoneMinder used mapped memory to allow multiple access to resources. Although ZoneMinder scripts have used this information before, up until now it was difficult to access and prone to errors. This module introduces a common API for mapped memory access (both reading and writing) making it a lot easier to customise scripts or even create your own. + +All the methods listed below require a 'monitor' parameter. This must be a reference to a hash with at least the 'Id' field set to the monitor id of the mapped memory you wish to access. Using database methods to select the monitor details will also return this kind of data. Some of the mapped memory methods will add and amend new fields to this hash. + +=over 4 + +=head1 METHODS + +=item zmMemVerify ( $monitor ); + +Verify that the mapped memory of the monitor given exists and is valid. It will return an undefined value if it is not valid. You should generally call this method first before using any of the other methods, but most of the remaining methods will also do so if the memory has not already been verified. + +=item zmMemInvalidate ( $monitor ); + +Following an error, reset the mapped memory ids and attempt to reverify on the next operation. This is mostly used when a mapped memory segment has gone away and been recreated with a different id. + +=item zmMemRead ( $monitor, $readspec ); + +This method is used to read data from mapped memory attached to the given monitor. The mapped memory will be verified if it has not already been. The 'readspec' must either be a string of the form "
:" or a reference to an array of strings of the same format. In the first case a single value is returned, in the latter case a list of values is return. Errors will cause undefined to be returned. The allowable sections and field names are described below. + +=item zmMemWrite ( $monitor, $writespec ); + +This method is used to write data to mapped memory attached to the given monitor. The mapped memory will be verified if it has not already been. The 'writespec' must be a reference to a hash with keys of the form "
:" and values as the data to be written. Errors will cause undefined to be returned, otherwise a non-undefined value will be returned. The allowable sections and field names are described below. + +=item $state = zmGetMonitorState ( $monitor ); + +Return the current state of the given monitor. This is an integer value and can be compared with the STATE constants given below. + +=item $event_id = zmGetLastEvent ( $monitor ); + +Return the event id of the last event that the monitor generated, or 0 if no event has been generated by the current monitor process. + +=item zmIsAlarmed ( $monitor ); + +Return 1 if the monitor given is currently in an alarm state, 0 otherwise. + +=item zmInAlarm ( $monitor ); + +Return 1 if the monitor given is currently in an alarm or alerted state, 0 otherwise. + +=item zmHasAlarmed ( $monitor ); + +Return 1 if the given monitor is in an alarm state, or has been in an alarm state since the last call to this method. + +=item ( $x, $y ) = zmGetAlarmLocation ( $monitor ); + +Return an x,y pair indicating the image co-ordinates of the centre of the last motion event generated by the given monitor. If no event has been generated by the current monitor process, or the alarm was not motion related, returns -1,-1. + +=item zmGetLastWriteTime ( $monitor ); + +Returns the time (in utc seconds) since the last image was captured by the given monitor and written to shared memory, or 0 otherwise. + +=item zmGetLastReadTime ( $monitor ); + +Returns the time (in utc seconds) since the last image was read from shared memory by the analysis daemon of the given monitor, or 0 otherwise or if the monitor is in monitor only mode. + +=item zmMonitorSuspend ( $monitor ); + +Suspend the given monitor from generating events caused by motion. This method can be used to prevent camera actions such as panning or zooming from causing events. If configured to do so, the monitor may automatically resume after a defined period. + +=item zmMonitorResume ( $monitor ); + +Allow the given monitor to resume generating events caused by motion. + +=item zmTriggerEventOn ( $monitor, $score, $cause [, $text, $showtext ] ); + +Trigger the given monitor to generate an event. You must supply an event score and a cause string indicating the reason for the event. You may also supply a text string containing further details about the event and a showtext string which may be included in the timestamp annotation on any images captured during the event, if configured to do so. + +=item zmTriggerEventOff ( $monitor ); + +Trigger the given monitor to not generate any events. This method does not cancel zmTriggerEventOn, but is exclusive to it. This method is intended to allow external triggers to prevent normal events being generated by monitors in the same way as zmMonitorSuspend but applies to all events and not just motion, and is intended for longer timescales than are appropriate for suspension. + +=item zmTriggerEventCancel ( $monitor ); + +Cancel any previous trigger on or off requests. This stops a triggered alarm if it exists from a previous 'on' and allows events to be generated once more following a previous 'off'. + +=item zmTriggerShowtext ( $monitor, $showtest ); + +Indicate that the given text should be displayed in the timestamp annotation on any images captured, if the format of the annotation string defined for the monitor permits. + +=head1 DATA + +The data fields in mapped memory that may be accessed are as follows. There are two main sections, shared_data which is general data and trigger_data which is used for event triggering. Whilst reading from these fields is harmless, extreme care must be taken when writing to mapped memory, especially in the shared_data section as this is normally written to only by monitor capture and analysis processes. + + shared_data The general mapped memory section + size The size, in bytes, of this section + valid Flag indicating whether this section has been initialised + active Flag indicating whether this monitor is active (enabled/disabled) + signal Flag indicating whether this monitor is reciving a valid signal + state The current monitor state, see the STATE constants below + last_write_index The last index, in the image buffer, that an image has been saved to + last_read_index The last index, in the image buffer, that an image has been analysed from + last_write_time The time (in utc seconds) when the last image was captured + last_read_time The time (in utc seconds) when the last image was analysed + last_event The id of the last event generated by the monitor analysis process, 0 if none + action The monitor actions bitmask, see the ACTION constants below + brightness Read/write location for the current monitor brightness + hue Read/write location for the current monitor hue + colour Read/write location for the current monitor colour + contrast Read/write location for the current monitor contrast + alarm_x Image x co-ordinate (from left) of the centre of the last motion event, -1 if none + alarm_y Image y co-ordinate (from top) of the centre of the last motion event, -1 if none + + trigger_data The triggered event mapped memory section + size The size, in bytes of this section + trigger_state The current trigger state, see the TRIGGER constants below + trigger_score The current triggered event score + trigger_cause The current triggered event cause string + trigger_text The current triggered event descriptive text string + trigger_showtext The triggered text that will be displayed on captured image timestamps + +=head1 CONSTANTS + +The following constants are used by the methods above, but can also be used by user scripts if required. + +=item STATE_IDLE STATE_PREALARM STATE_ALARM STATE_ALERT STATE_TAPE + +These constants define the state of the monitor with respect to alarms and events. They are used in the shared_data:state field. + +=item ACTION_GET ACTION_SET ACTION_RELOAD ACTION_SUSPEND ACTION_RESUME + +These constants defines the various values that can exist in the shared_data:action field. This is a bitmask which when non-zero defines an action that an executing monitor process should take. ACTION_GET requires that the current values of brightness, contrast, colour and hue are taken from the camera and written to the equivalent mapped memory fields. ACTION_SET implies the reverse, that the values in mapped memory should be written to the camera. ACTION_RELOAD signal that the monitor process should reload itself from the database in case any settings have changed there. ACTION_SUSPEND signals that a monitor should stop exaiming images for motion, though other alarms may still occur. ACTION_RESUME sigansl that a monitor should resume motion detectiom. + +=item TRIGGER_CANCEL TRIGGER_ON TRIGGER_OFF + +These constants are used in the definition of external triggers. TRIGGER_CANCEL is used to indicated that any previous trigger settings should be cancelled, TRIGGER_ON signals that an alarm should be created (or continued)) as a result of the current trigger and TRIGGER_OFF signals that the trigger should prevent any alarms from being generated. See the trigger methods above for further details. + +=head1 EXPORT + +None by default. +The :constants tag will export the mapped memory constants which mostly define enumerations for the variables held in memory +The :functions tag will export the mapped memory access functions. +The :all tag will export all above symbols. + + +=head1 SEE ALSO + +http://www.zoneminder.com + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Memory/Mapped.pm b/scripts/ZoneMinder/lib/ZoneMinder/Memory/Mapped.pm new file mode 100644 index 000000000..b8745d835 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Memory/Mapped.pm @@ -0,0 +1,169 @@ +# ========================================================================== +# +# ZoneMinder Mapped Memory Access Module, $Date: 2008-02-25 10:13:13 +0000 (Mon, 25 Feb 2008) $, $Revision: 2323 $ +# 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. +# +# ========================================================================== +# +# This module contains the definitions and functions used when accessing mapped memory +# +package ZoneMinder::Memory::Mapped; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'functions' => [ qw( + zmMemKey + zmMemAttach + zmMemDetach + zmMemGet + zmMemPut + zmMemClean + ) ], +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = @EXPORT_OK; + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Mapped Memory Facilities +# +# ========================================================================== + +use ZoneMinder::Config qw(:all); +use ZoneMinder::Logger qw(:all); + +use Sys::Mmap; + +sub zmMemKey( $ ) +{ + my $monitor = shift; + return( defined($monitor->{MMapAddr})?$monitor->{MMapAddr}:undef ); +} + +sub zmMemAttach( $$ ) +{ + my $monitor = shift; + my $size = shift; + if ( !defined($monitor->{MMapAddr}) ) + { + my $mmap_file = ZM_PATH_MAP."/zm.mmap.".$monitor->{Id}; + if ( !open( MMAP, "+<".$mmap_file ) ) + { + Error( sprintf( "Can't open memory map file '%s': $!\n", $mmap_file ) ); + return( undef ); + } + my $mmap = undef; + my $mmap_addr = mmap( $mmap, $size, PROT_READ|PROT_WRITE, MAP_SHARED, \*MMAP ); + if ( !$mmap_addr || !$mmap ) + { + Error( sprintf( "Can't mmap to file '%s': $!\n", $mmap_file ) ); + return( undef ); + } + $monitor->{MMapHandle} = \*MMAP; + $monitor->{MMapAddr} = $mmap_addr; + $monitor->{MMap} = \$mmap; + } + return( !undef ); +} + +sub zmMemDetach( $ ) +{ + my $monitor = shift; + + if ( $monitor->{MMap} ) + { + munmap( ${$monitor->{MMap}} ); + delete $monitor->{MMap}; + } + if ( $monitor->{MMapAddr} ) + { + delete $monitor->{MMapAddr}; + } + if ( $monitor->{MMapHandle} ) + { + close( $monitor->{MMapHandle} ); + delete $monitor->{MMapHandle}; + } +} + +sub zmMemGet( $$$ ) +{ + my $monitor = shift; + my $offset = shift; + my $size = shift; + + my $mmap = $monitor->{MMap}; + if ( !$mmap || !$$mmap ) + { + Error( sprintf( "Can't read from mapped memory for monitor '%d', gone away?", $monitor->{Id} ) ); + return( undef ); + } + my $data = substr( $$mmap, $offset, $size ); + return( $data ); +} + +sub zmMemPut( $$$$ ) +{ + my $monitor = shift; + my $offset = shift; + my $size = shift; + my $data = shift; + + my $mmap = $monitor->{MMap}; + if ( !$mmap || !$$mmap ) + { + Error( sprintf( "Can't write mapped memory for monitor '%d', gone away?", $monitor->{Id} ) ); + return( undef ); + } + substr( $$mmap, $offset, $size ) = $data; + return( !undef ); +} + +sub zmMemClean +{ + Debug( "Removing memory map files\n" ); + my $mapPath = ZM_PATH_MAP."/zm.mmap.*"; + foreach my $mapFile( glob( $mapPath ) ) + { + ( $mapFile ) = $mapFile =~ /^(.+)$/; + Debug( "Removing memory map file '$mapFile'\n" ); + unlink( $mapFile ); + } +} + +1; +__END__ diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Memory/Shared.pm b/scripts/ZoneMinder/lib/ZoneMinder/Memory/Shared.pm new file mode 100644 index 000000000..c04e4f413 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Memory/Shared.pm @@ -0,0 +1,161 @@ +# ========================================================================== +# +# ZoneMinder Shared Memory Access Module, $Date: 2007-08-29 19:11:09 +0100 (Wed, 29 Aug 2007) $, $Revision: 2175 $ +# 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. +# +# ========================================================================== +# +# This module contains the common definitions and functions used by the rest +# of the ZoneMinder scripts +# +package ZoneMinder::Memory::Shared; + +use 5.006; +use strict; +use warnings; + +require Exporter; +require ZoneMinder::Base; + +our @ISA = qw(Exporter ZoneMinder::Base); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use ZoneMinder ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( + 'functions' => [ qw( + zmMemKey + zmMemAttach + zmMemDetach + zmMemGet + zmMemPut + zmMemClean + ) ], +); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; + +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); + +our @EXPORT = @EXPORT_OK; + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Shared Memory Facilities +# +# ========================================================================== + +use ZoneMinder::Config qw(:all); +use ZoneMinder::Logger qw(:all); + +sub zmMemKey( $ ) +{ + my $monitor = shift; + return( defined($monitor->{ShmKey})?$monitor->{ShmKey}:undef ); +} + +sub zmMemAttach( $$ ) +{ + my $monitor = shift; + my $size = shift; + if ( !defined($monitor->{ShmId}) ) + { + my $shm_key = (hex(ZM_SHM_KEY)&0xffff0000)|$monitor->{Id}; + my $shm_id = shmget( $shm_key, $size, 0 ); + if ( !defined($shm_id) ) + { + Error( sprintf( "Can't get shared memory id '%x', %d: $!\n", $shm_key, $monitor->{Id} ) ); + return( undef ); + } + $monitor->{ShmKey} = $shm_key; + $monitor->{ShmId} = $shm_id; + } + return( !undef ); +} + +sub zmMemDetach( $ ) +{ + my $monitor = shift; + + delete $monitor->{ShmId}; +} + +sub zmMemGet( $$$ ) +{ + my $monitor = shift; + my $offset = shift; + my $size = shift; + + my $shm_key = $monitor->{ShmKey}; + my $shm_id = $monitor->{ShmId}; + + my $data; + if ( !shmread( $shm_id, $data, $offset, $size ) ) + { + Error( sprintf( "Can't read from shared memory '%x/%d': $!", $shm_key, $shm_id ) ); + return( undef ); + } + return( $data ); +} + +sub zmMemPut( $$$$ ) +{ + my $monitor = shift; + my $offset = shift; + my $size = shift; + my $data = shift; + + my $shm_key = $monitor->{ShmKey}; + my $shm_id = $monitor->{ShmId}; + + if ( !shmwrite( $shm_id, $data, $offset, $size ) ) + { + Error( sprintf( "Can't write to shared memory '%x/%d': $!", $shm_key, $shm_id ) ); + return( undef ); + } + return( !undef ); +} + +sub zmMemClean +{ + Debug( "Removing shared memory\n" ); + # Find ZoneMinder shared memory + my $command = "ipcs -m | grep '^".substr( sprintf( "0x%x", hex(ZM_SHM_KEY) ), 0, -2 )."'"; + Debug( "Checking for shared memory with '$command'\n" ); + open( CMD, "$command |" ) or Fatal( "Can't execute '$command': $!" ); + while( ) + { + chomp; + my ( $key, $id ) = split( /\s+/ ); + if ( $id =~ /^(\d+)/ ) + { + $id = $1; + $command = "ipcrm shm $id"; + Debug( "Removing shared memory with '$command'\n" ); + qx( $command ); + } + } + close( CMD ); +} + +1; +__END__ diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel.pm b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel.pm new file mode 100644 index 000000000..0344e6d94 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel.pm @@ -0,0 +1,166 @@ +# ========================================================================== +# +# ZoneMinder Trigger Channel Module, $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. +# +# ========================================================================== +# +# This module contains the base class definition of the trigger channel +# class tree +# +package ZoneMinder::Trigger::Channel; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Database Access +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +use Carp; + +our $AUTOLOAD; + +sub new +{ + my $class = shift; + my $self = {}; + $self->{readable} = !undef; + $self->{writeable} = !undef; + $self->{selectable} = undef; + $self->{state} = 'closed'; + bless( $self, $class ); + return $self; +} + +sub clone +{ + my $self = shift; + my $clone = { %$self }; + bless $clone, ref $self; +} + +sub open() +{ + my $self = shift; + my $class = ref($self) or croak( "Can't get class for non object $self" ); + croak( "Abstract base class method called for object of class $class" ); +} + +sub close() +{ + my $self = shift; + my $class = ref($self) or croak( "Can't get class for non object $self" ); + croak( "Abstract base class method called for object of class $class" ); +} + +sub getState() +{ + my $self = shift; + return( $self->{state} ); +} + +sub isOpen() +{ + my $self = shift; + return( $self->{state} eq "open" ); +} + +sub isConnected() +{ + my $self = shift; + return( $self->{state} eq "connected" ); +} + +sub DESTROY +{ +} + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( !exists($self->{$name}) ) + { + croak( "Can't access $name member of object of class $class" ); + } + return( $self->{$name} ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/File.pm b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/File.pm new file mode 100644 index 000000000..234dae3d7 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/File.pm @@ -0,0 +1,121 @@ +# ========================================================================== +# +# ZoneMinder Trigger Channel Handle Module, $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. +# +# ========================================================================== +# +# This module contains the class definition of the simple file based trigger +# channel class +# +package ZoneMinder::Trigger::Channel::File; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Trigger::Channel::Handle; + +our @ISA = qw(ZoneMinder::Trigger::Channel::Handle); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Simple file based trigger channel +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +use Carp; +use Fcntl; + +sub new +{ + my $class = shift; + my %params = @_; + my $self = ZoneMinder::Trigger::Channel::Handle->new; + $self->{path} = $params{path}; + bless( $self, $class ); + return $self; +} + +sub open() +{ + my $self = shift; + local *sfh; + #sysopen( *sfh, $conn->{path}, O_NONBLOCK|O_RDONLY ) or croak( "Can't sysopen: $!" ); + #open( *sfh, "<".$conn->{path} ) or croak( "Can't open: $!" ); + open( *sfh, "+<".$self->{path} ) or croak( "Can't open: $!" ); + $self->{state} = 'open'; + $self->{handle} = *sfh; +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Handle.pm b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Handle.pm new file mode 100644 index 000000000..356bb5aea --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Handle.pm @@ -0,0 +1,154 @@ +# ========================================================================== +# +# ZoneMinder Trigger Channel Handle Module, $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. +# +# ========================================================================== +# +# This module contains the class definition of the handle based trigger channel +# class +# +package ZoneMinder::Trigger::Channel::Handle; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Trigger::Channel; + +our @ISA = qw(ZoneMinder::Trigger::Channel); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Base class for handle based trigger channels +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use POSIX; + +sub new +{ + my $class = shift; + my $port = shift; + my $self = ZoneMinder::Trigger::Channel->new(); + $self->{handle} = undef; + bless( $self, $class ); + return $self; +} + +sub spawns +{ + return( undef ); +} + +sub close() +{ + my $self = shift; + close( $self->{handle} ); + $self->{state} = 'closed'; + $self->{handle} = undef; +} + +sub read() +{ + my $self = shift; + my $buffer; + my $nbytes = sysread( $self->{handle}, $buffer, POSIX::BUFSIZ ); + if ( !$nbytes ) + { + return( undef ); + } + Debug( "Read '$buffer' ($nbytes bytes)\n" ); + return( $buffer ); +} + +sub write() +{ + my $self = shift; + my $buffer = shift; + my $nbytes = syswrite( $self->{handle}, $buffer ); + if ( !defined( $nbytes) || $nbytes < length($buffer) ) + { + Error( "Unable to write buffer '".$buffer.", expected ".length($buffer)." bytes, sent ".$nbytes.": $!\n" ); + return( undef ); + } + Debug( "Wrote '$buffer' ($nbytes bytes)\n" ); + return( !undef ); +} + +sub fileno() +{ + my $self = shift; + return( defined($self->{handle})?fileno($self->{handle}):-1 ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Inet.pm b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Inet.pm new file mode 100644 index 000000000..68df0980f --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Inet.pm @@ -0,0 +1,142 @@ +# ========================================================================== +# +# ZoneMinder Trigger Channel Handle Module, $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. +# +# ========================================================================== +# +# This module contains the class definition of the tcp socket based trigger +# channel class +# +package ZoneMinder::Trigger::Channel::Inet; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Trigger::Channel::Spawning; + +our @ISA = qw(ZoneMinder::Trigger::Channel::Spawning); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Internet (TCP) based trigger channel +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +use Carp; +use Socket; + +sub new +{ + my $class = shift; + my %params = @_; + my $self = ZoneMinder::Trigger::Channel::Spawning->new(); + $self->{selectable} = !undef; + $self->{port} = $params{port}; + bless( $self, $class ); + return $self; +} + +sub open() +{ + my $self = shift; + local *sfh; + my $saddr = sockaddr_in( $self->{port}, INADDR_ANY ); + socket( *sfh, PF_INET, SOCK_STREAM, getprotobyname('tcp') ) or croak( "Can't open socket: $!" ); + setsockopt( *sfh, SOL_SOCKET, SO_REUSEADDR, 1 ); + bind( *sfh, $saddr ) or croak( "Can't bind: $!" ); + listen( *sfh, SOMAXCONN ) or croak( "Can't listen: $!" ); + $self->{state} = 'open'; + $self->{handle} = *sfh; +} + +sub _spawn( $ ) +{ + my $self = shift; + my $new_handle = shift; + my $clone = $self->clone(); + $clone->{handle} = $new_handle; + $clone->{state} = 'connected'; + return( $clone ); +} + +sub accept() +{ + my $self = shift; + local *cfh; + my $paddr = accept( *cfh, $self->{handle} ); + return( $self->_spawn( *cfh ) ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Serial.pm b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Serial.pm new file mode 100644 index 000000000..7e4ad4730 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Serial.pm @@ -0,0 +1,160 @@ +# ========================================================================== +# +# ZoneMinder Trigger Channel Handle Module, $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. +# +# ========================================================================== +# +# This module contains the class definition of the serial port trigger channel +# class +# +package ZoneMinder::Trigger::Channel::Serial; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Trigger::Channel; + +our @ISA = qw(ZoneMinder::Trigger::Channel); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Serial access trigger channel +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use Device::SerialPort; + +sub new +{ + my $class = shift; + my %params = @_; + my $self = ZoneMinder::Trigger::Channel->new; + $self->{path} = $params{path}; + bless( $self, $class ); + return $self; +} + +sub open() +{ + my $self = shift; + my $device = new Device::SerialPort( $self->{path} ); + $device->baudrate(9600); + $device->databits(8); + $device->parity('none'); + $device->stopbits(1); + $device->handshake('none'); + + $device->read_const_time(50); + $device->read_char_time(10); + + $self->{device} = $device; + $self->{state} = 'open'; + $self->{state} = 'connected'; +} + +sub close() +{ + my $self = shift; + $self->{device}->close(); + $self->{state} = 'closed'; +} + +sub read() +{ + my $self = shift; + my $buffer = $self->{device}->lookfor(); + if ( !$buffer || !length($buffer) ) + { + return( undef ); + } + Debug( "Read '$buffer' (".length($buffer)." bytes)\n" ); + return( $buffer ); +} + +sub write() +{ + my $self = shift; + my $buffer = shift; + my $nbytes = $self->{device}->write( $buffer ); + $self->{device}->write_drain(); + if ( !defined( $nbytes) || $nbytes < length($buffer) ) + { + Error( "Unable to write buffer '".$buffer.", expected ".length($buffer)." bytes, sent ".$nbytes.": $!\n" ); + return( undef ); + } + Debug( "Wrote '$buffer' ($nbytes bytes)\n" ); + return( !undef ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Spawning.pm b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Spawning.pm new file mode 100644 index 000000000..ff726ac38 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Spawning.pm @@ -0,0 +1,112 @@ +# ========================================================================== +# +# ZoneMinder Trigger Channel Handle Module, $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. +# +# ========================================================================== +# +# This module contains the class definition of the handle based trigger channel +# classes that spawn new connections when connected. +# +package ZoneMinder::Trigger::Channel::Spawning; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Trigger::Channel::Handle; + +our @ISA = qw(ZoneMinder::Trigger::Channel::Handle); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Base class for handle based triggers that spawn new connections +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +sub new +{ + my $class = shift; + my $port = shift; + my $self = ZoneMinder::Trigger::Channel::Handle->new(); + $self->{spawns} = !undef; + bless( $self, $class ); + return $self; +} + +sub spawns +{ + return( !undef ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Unix.pm b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Unix.pm new file mode 100644 index 000000000..a671ccd66 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Unix.pm @@ -0,0 +1,141 @@ +# ========================================================================== +# +# ZoneMinder Trigger Channel Handle Module, $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. +# +# ========================================================================== +# +# This module contains the class definition of the unix socket based trigger +# channel class +# +package ZoneMinder::Trigger::Channel::Unix; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Trigger::Channel::Spawning; + +our @ISA = qw(ZoneMinder::Trigger::Channel::Spawning); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Unix socket based trigger channel +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +use Carp; +use Socket; + +sub new +{ + my $class = shift; + my %params = @_; + my $self = ZoneMinder::Trigger::Channel->new; + $self->{selectable} = !undef; + $self->{path} = $params{path}; + bless( $self, $class ); + return $self; +} + +sub open() +{ + my $self = shift; + local *sfh; + unlink( $self->{path} ); + my $saddr = sockaddr_un( $self->{path} ); + socket( *sfh, PF_UNIX, SOCK_STREAM, 0 ) or croak( "Can't open socket: $!" ); + bind( *sfh, $saddr ) or croak( "Can't bind: $!" ); + listen( *sfh, SOMAXCONN ) or croak( "Can't listen: $!" ); + $self->{handle} = *sfh; +} + +sub _spawn( $ ) +{ + my $self = shift; + my $new_handle = shift; + my $clone = $self->clone(); + $clone->{handle} = $new_handle; + $clone->{state} = 'connected'; + return( $clone ); +} + +sub accept() +{ + my $self = shift; + local *cfh; + my $paddr = accept( *cfh, $self->{handle} ); + return( $self->_spawn( *cfh ) ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Connection.pm b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Connection.pm new file mode 100644 index 000000000..41b332d46 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Connection.pm @@ -0,0 +1,239 @@ +# ========================================================================== +# +# ZoneMinder Trigger Connection Module, $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. +# +# ========================================================================== +# +# This module contains the base class definition of the trigger connection +# class tree +# +package ZoneMinder::Trigger::Connection; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Base connection class +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +use Carp; + +our $AUTOLOAD; + +sub new +{ + my $class = shift; + my %params = @_; + my $self = {}; + $self->{name} = $params{name}; + $self->{channel} = $params{channel}; + $self->{input} = $params{mode} =~ /r/i; + $self->{output} = $params{mode} =~ /w/i; + bless( $self, $class ); + return $self; +} + +sub clone +{ + my $self = shift; + my $clone = { %$self }; + bless $clone, ref $self; + return( $clone ); +} + +sub spawns +{ + my $self = shift; + return( $self->{channel}->spawns() ); +} + +sub _spawn( $ ) +{ + my $self = shift; + my $new_channel = shift; + my $clone = $self->clone(); + $clone->{channel} = $new_channel; + return( $clone ); +} + +sub accept() +{ + my $self = shift; + my $new_channel = $self->{channel}->accept(); + return( $self->_spawn( $new_channel ) ); +} + +sub open() +{ + my $self = shift; + return( $self->{channel}->open() ); +} + +sub close() +{ + my $self = shift; + return( $self->{channel}->close() ); +} + +sub fileno() +{ + my $self = shift; + return( $self->{channel}->fileno() ); +} + +sub isOpen() +{ + my $self = shift; + return( $self->{channel}->isOpen() ); +} + +sub isConnected() +{ + my $self = shift; + return( $self->{channel}->isConnected() ); +} + +sub canRead() +{ + my $self = shift; + return( $self->{input} && $self->isConnected() ); +} + +sub canWrite() +{ + my $self = shift; + return( $self->{output} && $self->isConnected() ); +} + +sub getMessages +{ + my $self = shift; + my $buffer = $self->{channel}->read(); + + return( undef ) if ( !defined($buffer) ); + + my @messages = split( /\r?\n/, $buffer ); + return( \@messages ); +} + +sub putMessages +{ + my $self = shift; + my $messages = shift; + + if ( @$messages ) + { + my $buffer = join( "\n", @$messages ); + $buffer .= "\n"; + if ( !$self->{channel}->write( $buffer ) ) + { + Error( "Unable to write buffer '".$buffer." to connection ".$self->{name}." (".$self->fileno().")\n" ); + } + } + return( undef ); +} + +sub timedActions +{ +} + +sub DESTROY +{ +} + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + elsif ( defined($self->{channel}) ) + { + if ( exists($self->{channel}->{$name}) ) + { + return( $self->{channel}->{$name} ); + } + } + croak( "Can't access $name member of object of class $class" ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Connection/Example.pm b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Connection/Example.pm new file mode 100644 index 000000000..3bed2b351 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Connection/Example.pm @@ -0,0 +1,134 @@ +# ========================================================================== +# +# ZoneMinder Trigger Channel Handle Module, $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. +# +# ========================================================================== +# +# This module contains an example overriden trigger connection class +# +package ZoneMinder::Trigger::Connection::Example; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Trigger::Connection; + +our @ISA = qw(ZoneMinder::Trigger::Connection); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Example overridden connection class +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); + +sub new +{ + my $class = shift; + my $path = shift; + my $self = ZoneMinder::Trigger::Connection->new( @_ ); + bless( $self, $class ); + return $self; +} + +sub getMessages +{ + my $self = shift; + my $buffer = $self->{channel}->read(); + + return( undef ) if ( !defined($buffer) ); + + Debug( "Handling buffer '$buffer'\n" ); + my @messages = grep { s/-/|/g; 1; } split( /\r?\n/, $buffer ); + return( \@messages ); +} + +sub putMessages +{ + my $self = shift; + my $messages = shift; + + if ( @$messages ) + { + my $buffer = join( "\n", grep{ s/\|/-/; 1; } @$messages ); + $buffer .= "\n"; + if ( !$self->{channel}->write( $buffer ) ) + { + Error( "Unable to write buffer '".$buffer." to connection ".$self->{name}." (".$self->fileno().")\n" ); + } + } + return( undef ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/scripts/ZoneMinder/pm_to_blib b/scripts/ZoneMinder/pm_to_blib new file mode 100644 index 000000000..e69de29bb diff --git a/scripts/ZoneMinder/t/ZoneMinder.t b/scripts/ZoneMinder/t/ZoneMinder.t new file mode 100644 index 000000000..6ff60ee25 --- /dev/null +++ b/scripts/ZoneMinder/t/ZoneMinder.t @@ -0,0 +1,17 @@ +# Before `make install' is performed this script should be runnable with +# `make test'. After `make install' it should work as `perl ZoneMinder.t' + +######################### + +# change 'tests => 1' to 'tests => last_test_to_print'; + +use Test; +BEGIN { plan tests => 1 }; +use ZoneMinder; +ok(1); # If we made it this far, we're ok. + +######################### + +# Insert your test code below, the Test::More module is use()ed here so read +# its man page ( perldoc Test::More ) for help writing this test script. + diff --git a/scripts/zm b/scripts/zm new file mode 100644 index 000000000..52d4aacf0 --- /dev/null +++ b/scripts/zm @@ -0,0 +1,120 @@ +#!/bin/sh +# description: ZoneMinder is the top Linux video camera security and surveillance solution. ZoneMinder is intended for use in single or multi-camera video security applications.Copyright: Philip Coombes, Corey DeLasaux 2003-2008 +# chkconfig: 2345 99 00 +# processname: zmpkg.pl + +# Source function library. +. /etc/rc.d/init.d/functions + +prog=ZoneMinder +ZM_CONFIG="/etc/zm/zm.conf" +pidfile="/var/run/zm" +LOCKFILE=/var/lock/subsys/zm + +loadconf() +{ + if [ -f $ZM_CONFIG ]; then + . $ZM_CONFIG + else + echo "ERROR: $ZM_CONFIG not found." + return 1 + fi +} + +loadconf +command="$ZM_PATH_BIN/zmpkg.pl" + +start() +{ + zmupdate || return $? + loadconf || return $? + #Make sure the directory for our PID folder exists or create one. + [ ! -d $pidfile ] \ + && mkdir -m 774 $pidfile \ + && chown $ZM_WEB_USER:$ZM_WEB_GROUP $pidfile + #Make sure the folder for the socks file exists or create one + GetPath="select Value from Config where Name='ZM_PATH_SOCKS'" + dbHost=`echo $ZM_DB_HOST | cut -d: -f1` + dbPort=`echo $ZM_DB_HOST | cut -d: -s -f2` + if [ "$dbPort" = "" ] + then + ZM_PATH_SOCK=`echo $GetPath | mysql -B -h$ZM_DB_HOST -u$ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME | grep -v '^Value'` + else + ZM_PATH_SOCK=`echo $GetPath | mysql -B -h$dbHost -P$dbPort -u$ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME | grep -v '^Value'` + fi + [ ! -d $ZM_PATH_SOCK ] \ + && mkdir -m 774 $ZM_PATH_SOCK \ + && chown $ZM_WEB_USER:$ZM_WEB_GROUP $ZM_PATH_SOCK + echo -n $"Starting $prog: " + $command start + RETVAL=$? + [ $RETVAL = 0 ] && success || failure + echo + [ $RETVAL = 0 ] && touch $LOCKFILE + return $RETVAL +} + +stop() +{ + loadconf + echo -n $"Stopping $prog: " + $command stop + RETVAL=$? + [ $RETVAL = 0 ] && success || failure + echo + [ $RETVAL = 0 ] && rm -f $LOCKFILE +} + +zmstatus() +{ + loadconf + result=`$command status` + if [ "$result" = "running" ]; then + echo "ZoneMinder is running" + $ZM_PATH_BIN/zmu -l + RETVAL=0 + else + echo "ZoneMinder is stopped" + RETVAL=1 + fi +} + +zmupdate() +{ + if [ -x $ZM_PATH_BIN/zm_update ]; then + $ZM_PATH_BIN/zm_update -f + fi +} + + +case "$1" in + 'start') + start + ;; + 'stop') + stop + ;; + 'restart') + stop + start + ;; + 'condrestart') + loadconf + result=`$ZM_PATH_BIN/zmdc.pl check` + if [ "$result" = "running" ]; then + $ZM_PATH_BIN/zmdc.pl shutdown > /dev/null + rm -f $LOCKFILE + start + fi + ;; + 'status') + status httpd + status mysqld + zmstatus + ;; + *) + echo "Usage: $0 { start | stop | restart | condrestart | status }" + RETVAL=1 + ;; +esac +exit $RETVAL diff --git a/scripts/zm.in b/scripts/zm.in new file mode 100755 index 000000000..1b7a7f2a3 --- /dev/null +++ b/scripts/zm.in @@ -0,0 +1,120 @@ +#!/bin/sh +# description: ZoneMinder is the top Linux video camera security and surveillance solution. ZoneMinder is intended for use in single or multi-camera video security applications.Copyright: Philip Coombes, Corey DeLasaux 2003-2008 +# chkconfig: 2345 99 00 +# processname: zmpkg.pl + +# Source function library. +. /etc/rc.d/init.d/functions + +prog=ZoneMinder +ZM_CONFIG="@ZM_CONFIG@" +pidfile="@ZM_RUNDIR@" +LOCKFILE=/var/lock/subsys/zm + +loadconf() +{ + if [ -f $ZM_CONFIG ]; then + . $ZM_CONFIG + else + echo "ERROR: $ZM_CONFIG not found." + return 1 + fi +} + +loadconf +command="$ZM_PATH_BIN/zmpkg.pl" + +start() +{ + zmupdate || return $? + loadconf || return $? + #Make sure the directory for our PID folder exists or create one. + [ ! -d $pidfile ] \ + && mkdir -m 774 $pidfile \ + && chown $ZM_WEB_USER:$ZM_WEB_GROUP $pidfile + #Make sure the folder for the socks file exists or create one + GetPath="select Value from Config where Name='ZM_PATH_SOCKS'" + dbHost=`echo $ZM_DB_HOST | cut -d: -f1` + dbPort=`echo $ZM_DB_HOST | cut -d: -s -f2` + if [ "$dbPort" = "" ] + then + ZM_PATH_SOCK=`echo $GetPath | mysql -B -h$ZM_DB_HOST -u$ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME | grep -v '^Value'` + else + ZM_PATH_SOCK=`echo $GetPath | mysql -B -h$dbHost -P$dbPort -u$ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME | grep -v '^Value'` + fi + [ ! -d $ZM_PATH_SOCK ] \ + && mkdir -m 774 $ZM_PATH_SOCK \ + && chown $ZM_WEB_USER:$ZM_WEB_GROUP $ZM_PATH_SOCK + echo -n $"Starting $prog: " + $command start + RETVAL=$? + [ $RETVAL = 0 ] && success || failure + echo + [ $RETVAL = 0 ] && touch $LOCKFILE + return $RETVAL +} + +stop() +{ + loadconf + echo -n $"Stopping $prog: " + $command stop + RETVAL=$? + [ $RETVAL = 0 ] && success || failure + echo + [ $RETVAL = 0 ] && rm -f $LOCKFILE +} + +zmstatus() +{ + loadconf + result=`$command status` + if [ "$result" = "running" ]; then + echo "ZoneMinder is running" + $ZM_PATH_BIN/zmu -l + RETVAL=0 + else + echo "ZoneMinder is stopped" + RETVAL=1 + fi +} + +zmupdate() +{ + if [ -x $ZM_PATH_BIN/zm_update ]; then + $ZM_PATH_BIN/zm_update -f + fi +} + + +case "$1" in + 'start') + start + ;; + 'stop') + stop + ;; + 'restart') + stop + start + ;; + 'condrestart') + loadconf + result=`$ZM_PATH_BIN/zmdc.pl check` + if [ "$result" = "running" ]; then + $ZM_PATH_BIN/zmdc.pl shutdown > /dev/null + rm -f $LOCKFILE + start + fi + ;; + 'status') + status httpd + status mysqld + zmstatus + ;; + *) + echo "Usage: $0 { start | stop | restart | condrestart | status }" + RETVAL=1 + ;; +esac +exit $RETVAL diff --git a/scripts/zmaudit.pl b/scripts/zmaudit.pl new file mode 100644 index 000000000..d153b5b39 --- /dev/null +++ b/scripts/zmaudit.pl @@ -0,0 +1,510 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder Audit Script, $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. +# +# ========================================================================== +# +# This script checks for consistency between the event filesystem and +# the database. If events are found in one and not the other they are +# deleted (optionally). Additionally any monitor event directories that +# do not correspond to a database monitor are similarly disposed of. +# However monitors in the database that don't have a directory are left +# alone as this is valid if they are newly created and have no events +# yet. +# +use strict; +use bytes; + +# ========================================================================== +# +# These are the elements you can edit to suit your installation +# +# ========================================================================== + +use constant MIN_AGE => 300; # Minimum age when we will delete anything +use constant MAX_AGED_DIRS => 10; # Number of event dirs to check age on +use constant RECOVER_TAG => "(r)"; # Tag to append to event name when recovered +use constant RECOVER_TEXT => "Recovered."; # Text to append to event notes when recovered + +# ========================================================================== +# +# You shouldn't need to change anything from here downwards +# +# ========================================================================== + +use lib '/usr/share/perl/5.14.2'; # Include custom perl install path +use ZoneMinder; +use DBI; +use POSIX; +use File::Find; +use Time::HiRes qw/gettimeofday/; +use Getopt::Long; + +use constant IMAGE_PATH => ZM_PATH_WEB.'/'.ZM_DIR_IMAGES; +use constant EVENT_PATH => (ZM_DIR_EVENTS=~m|/|)?ZM_DIR_EVENTS:(ZM_PATH_WEB.'/'.ZM_DIR_EVENTS); + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +my $report = 0; +my $interactive = 0; +my $continuous = 0; + +sub usage +{ + print( " +Usage: zmaudit.pl [-r,-report|-i,-interactive] +Parameters are :- +-r, --report - Just report don't actually do anything +-i, --interactive - Ask before applying any changes +-c, --continuous - Run continuously +"); + exit( -1 ); +} + +sub aud_print( $ ); +sub confirm( ;$$ ); +sub deleteSwapImage(); + +logInit(); +logSetSignal(); + +if ( !GetOptions( 'report'=>\$report, 'interactive'=>\$interactive, 'continuous'=>\$continuous ) ) +{ + usage(); +} + +if ( ($report + $interactive + $continuous) > 1 ) +{ + print( STDERR "Error, only option may be specified\n" ); + usage(); +} + +my $dbh = zmDbConnect(); + +chdir( EVENT_PATH ); + +my $max_image_age = 6/24; # 6 hours +my $max_swap_age = 24/24; # 24 hours +my $image_path = IMAGE_PATH; +my $swap_image_path = ZM_PATH_SWAP; + +my $loop = 1; +my $cleaned = 0; +MAIN: while( $loop ) +{ + my $db_monitors; + my $monitorSelectSql = "select Id from Monitors order by Id"; + my $monitorSelectSth = $dbh->prepare_cached( $monitorSelectSql ) or Fatal( "Can't prepare '$monitorSelectSql': ".$dbh->errstr() ); + my $eventSelectSql = "select Id, (unix_timestamp() - unix_timestamp(StartTime)) as Age from Events where MonitorId = ? order by Id"; + my $eventSelectSth = $dbh->prepare_cached( $eventSelectSql ) or Fatal( "Can't prepare '$eventSelectSql': ".$dbh->errstr() ); + + $cleaned = 0; + my $res = $monitorSelectSth->execute() or Fatal( "Can't execute: ".$monitorSelectSth->errstr() ); + while( my $monitor = $monitorSelectSth->fetchrow_hashref() ) + { + Debug( "Found database monitor '$monitor->{Id}'" ); + my $db_events = $db_monitors->{$monitor->{Id}} = {}; + my $res = $eventSelectSth->execute( $monitor->{Id} ) or Fatal( "Can't execute: ".$eventSelectSth->errstr() ); + while ( my $event = $eventSelectSth->fetchrow_hashref() ) + { + $db_events->{$event->{Id}} = $event->{Age}; + } + Debug( "Got ".int(keys(%$db_events))." events\n" ); + $eventSelectSth->finish(); + } + $monitorSelectSth->finish(); + + my $fs_monitors; + foreach my $monitor ( <[0-9]*> ) + { + Debug( "Found filesystem monitor '$monitor'" ); + my $fs_events = $fs_monitors->{$monitor} = {}; + ( my $monitor_dir ) = ( $monitor =~ /^(.*)$/ ); # De-taint + + if ( ZM_USE_DEEP_STORAGE ) + { + foreach my $day_dir ( <$monitor_dir/*/*/*> ) + { + Debug( "Checking $day_dir" ); + ( $day_dir ) = ( $day_dir =~ /^(.*)$/ ); # De-taint + chdir( $day_dir ); + opendir( DIR, "." ) or Fatal( "Can't open directory '$day_dir': $!" ); + my @event_links = sort { $b <=> $a } grep { -l $_ } readdir( DIR ); + closedir( DIR ); + my $count = 0; + foreach my $event_link ( @event_links ) + { + Debug( "Checking link $event_link" ); + ( my $event = $event_link ) =~ s/^.*\.//; + my $event_path = readlink( $event_link ); + if ( $count++ > MAX_AGED_DIRS ) + { + $fs_events->{$event} = -1; + } + else + { + if ( !-e $event_path ) + { + aud_print( "Event link $day_dir/$event_link does not point to valid target" ); + if ( confirm() ) + { + ( $event_link ) = ( $event_link =~ /^(.*)$/ ); # De-taint + unlink( $event_link ); + $cleaned = 1; + } + } + else + { + $fs_events->{$event} = (time() - ($^T - ((-M $event_path) * 24*60*60))); + } + } + } + chdir( EVENT_PATH ); + } + } + else + { + chdir( $monitor_dir ); + opendir( DIR, "." ) or Fatal( "Can't open directory '$monitor_dir': $!" ); + my @temp_events = sort { $b <=> $a } grep { -d $_ && $_ =~ /^\d+$/ } readdir( DIR ); + closedir( DIR ); + my $count = 0; + foreach my $event ( @temp_events ) + { + if ( $count++ > MAX_AGED_DIRS ) + { + $fs_events->{$event} = -1; + } + else + { + $fs_events->{$event} = (time() - ($^T - ((-M $event) * 24*60*60))); + } + } + chdir( EVENT_PATH ); + } + Debug( "Got ".int(keys(%$fs_events))." events\n" ); + } + redo MAIN if ( $cleaned ); + + $cleaned = 0; + while ( my ( $fs_monitor, $fs_events ) = each(%$fs_monitors) ) + { + if ( my $db_events = $db_monitors->{$fs_monitor} ) + { + if ( $fs_events ) + { + while ( my ( $fs_event, $age ) = each(%$fs_events ) ) + { + if ( !defined($db_events->{$fs_event}) && ($age < 0 || ($age > MIN_AGE)) ) + { + aud_print( "Filesystem event '$fs_monitor/$fs_event' does not exist in database" ); + if ( confirm() ) + { + deleteEventFiles( $fs_event, $fs_monitor ); + $cleaned = 1; + } + } + } + } + } + else + { + aud_print( "Filesystem monitor '$fs_monitor' does not exist in database" ); + if ( confirm() ) + { + my $command = "rm -rf $fs_monitor"; + executeShellCommand( $command ); + $cleaned = 1; + } + } + } + + my $monitor_links; + foreach my $link ( <*> ) + { + next if ( !-l $link ); + next if ( -e $link ); + + aud_print( "Filesystem monitor link '$link' does not point to valid monitor directory" ); + if ( confirm() ) + { + ( $link ) = ( $link =~ /^(.*)$/ ); # De-taint + my $command = "rm $link"; + executeShellCommand( $command ); + $cleaned = 1; + } + } + redo MAIN if ( $cleaned ); + + $cleaned = 0; + my $deleteMonitorSql = "delete low_priority from Monitors where Id = ?"; + my $deleteMonitorSth = $dbh->prepare_cached( $deleteMonitorSql ) or Fatal( "Can't prepare '$deleteMonitorSql': ".$dbh->errstr() ); + my $deleteEventSql = "delete low_priority from Events where Id = ?"; + my $deleteEventSth = $dbh->prepare_cached( $deleteEventSql ) or Fatal( "Can't prepare '$deleteEventSql': ".$dbh->errstr() ); + my $deleteFramesSql = "delete low_priority from Frames where EventId = ?"; + my $deleteFramesSth = $dbh->prepare_cached( $deleteFramesSql ) or Fatal( "Can't prepare '$deleteFramesSql': ".$dbh->errstr() ); + my $deleteStatsSql = "delete low_priority from Stats where EventId = ?"; + my $deleteStatsSth = $dbh->prepare_cached( $deleteStatsSql ) or Fatal( "Can't prepare '$deleteStatsSql': ".$dbh->errstr() ); + while ( my ( $db_monitor, $db_events ) = each(%$db_monitors) ) + { + if ( my $fs_events = $fs_monitors->{$db_monitor} ) + { + if ( $db_events ) + { + while ( my ( $db_event, $age ) = each(%$db_events ) ) + { + if ( !defined($fs_events->{$db_event}) && ($age > MIN_AGE) ) + { + aud_print( "Database event '$db_monitor/$db_event' does not exist in filesystem" ); + if ( confirm() ) + { + my $res = $deleteEventSth->execute( $db_event ) or Fatal( "Can't execute: ".$deleteEventSth->errstr() ); + $res = $deleteFramesSth->execute( $db_event ) or Fatal( "Can't execute: ".$deleteFramesSth->errstr() ); + $res = $deleteStatsSth->execute( $db_event ) or Fatal( "Can't execute: ".$deleteStatsSth->errstr() ); + $cleaned = 1; + } + } + } + } + } + else + { + #aud_print( "Database monitor '$db_monitor' does not exist in filesystem" ); + #if ( confirm() ) + #{ + # We don't actually do this in case it's new + #my $res = $deleteMonitorSth->execute( $db_monitor ) or Fatal( "Can't execute: ".$deleteMonitorSth->errstr() ); + #$cleaned = 1; + #} + } + } + redo MAIN if ( $cleaned ); + + # Remove orphaned events (with no monitor) + $cleaned = 0; + my $selectOrphanedEventsSql = "select Events.Id, Events.Name from Events left join Monitors on (Events.MonitorId = Monitors.Id) where isnull(Monitors.Id)"; + my $selectOrphanedEventsSth = $dbh->prepare_cached( $selectOrphanedEventsSql ) or Fatal( "Can't prepare '$selectOrphanedEventsSql': ".$dbh->errstr() ); + $res = $selectOrphanedEventsSth->execute() or Fatal( "Can't execute: ".$selectOrphanedEventsSth->errstr() ); + while( my $event = $selectOrphanedEventsSth->fetchrow_hashref() ) + { + aud_print( "Found orphaned event with no monitor '$event->{Id}'" ); + if ( confirm() ) + { + $res = $deleteEventSth->execute( $event->{Id} ) or Fatal( "Can't execute: ".$deleteEventSth->errstr() ); + $cleaned = 1; + } + } + $selectOrphanedEventsSth->finish(); + redo MAIN if ( $cleaned ); + + # Remove empty events (with no frames) + $cleaned = 0; + my $selectEmptyEventsSql = "select * from Events as E left join Frames as F on (E.Id = F.EventId) where isnull(F.EventId) and now() - interval ".MIN_AGE." second > E.StartTime"; + my $selectEmptyEventsSth = $dbh->prepare_cached( $selectEmptyEventsSql ) or Fatal( "Can't prepare '$selectEmptyEventsSql': ".$dbh->errstr() ); + $res = $selectEmptyEventsSth->execute() or Fatal( "Can't execute: ".$selectEmptyEventsSth->errstr() ); + while( my $event = $selectEmptyEventsSth->fetchrow_hashref() ) + { + aud_print( "Found empty event with no frame records '$event->{Id}'" ); + if ( confirm() ) + { + $res = $deleteEventSth->execute( $event->{Id} ) or Fatal( "Can't execute: ".$deleteEventSth->errstr() ); + $cleaned = 1; + } + } + $selectEmptyEventsSth->finish(); + redo MAIN if ( $cleaned ); + + # Remove orphaned frame records + $cleaned = 0; + my $selectOrphanedFramesSql = "select distinct EventId from Frames where EventId not in (select Id from Events)"; + my $selectOrphanedFramesSth = $dbh->prepare_cached( $selectOrphanedFramesSql ) or Fatal( "Can't prepare '$selectOrphanedFramesSql': ".$dbh->errstr() ); + $res = $selectOrphanedFramesSth->execute() or Fatal( "Can't execute: ".$selectOrphanedFramesSth->errstr() ); + while( my $frame = $selectOrphanedFramesSth->fetchrow_hashref() ) + { + aud_print( "Found orphaned frame records for event '$frame->{EventId}'" ); + if ( confirm() ) + { + $res = $deleteFramesSth->execute( $frame->{EventId} ) or Fatal( "Can't execute: ".$deleteFramesSth->errstr() ); + $cleaned = 1; + } + } + $selectOrphanedFramesSth->finish(); + redo MAIN if ( $cleaned ); + + # Remove orphaned stats records + $cleaned = 0; + my $selectOrphanedStatsSql = "select distinct EventId from Stats where EventId not in (select Id from Events)"; + my $selectOrphanedStatsSth = $dbh->prepare_cached( $selectOrphanedStatsSql ) or Fatal( "Can't prepare '$selectOrphanedStatsSql': ".$dbh->errstr() ); + $res = $selectOrphanedStatsSth->execute() or Fatal( "Can't execute: ".$selectOrphanedStatsSth->errstr() ); + while( my $stat = $selectOrphanedStatsSth->fetchrow_hashref() ) + { + aud_print( "Found orphaned statistic records for event '$stat->{EventId}'" ); + if ( confirm() ) + { + $res = $deleteStatsSth->execute( $stat->{EventId} ) or Fatal( "Can't execute: ".$deleteStatsSth->errstr() ); + $cleaned = 1; + } + } + $selectOrphanedStatsSth->finish(); + redo MAIN if ( $cleaned ); + + # New audit to close any events that were left open for longer than MIN_AGE seconds + my $selectUnclosedEventsSql = "select E.Id, max(F.TimeStamp) as EndTime, unix_timestamp(max(F.TimeStamp)) - unix_timestamp(E.StartTime) as Length, max(F.FrameId) as Frames, count(if(F.Score>0,1,NULL)) as AlarmFrames, sum(F.Score) as TotScore, max(F.Score) as MaxScore, M.EventPrefix as Prefix from Events as E left join Monitors as M on E.MonitorId = M.Id inner join Frames as F on E.Id = F.EventId where isnull(E.Frames) or isnull(E.EndTime) group by E.Id having EndTime < (now() - interval ".MIN_AGE." second)"; + my $selectUnclosedEventsSth = $dbh->prepare_cached( $selectUnclosedEventsSql ) or Fatal( "Can't prepare '$selectUnclosedEventsSql': ".$dbh->errstr() ); + my $updateUnclosedEventsSql = "update low_priority Events set Name = ?, EndTime = ?, Length = ?, Frames = ?, AlarmFrames = ?, TotScore = ?, AvgScore = ?, MaxScore = ?, Notes = concat_ws( ' ', Notes, ? ) where Id = ?"; + my $updateUnclosedEventsSth = $dbh->prepare_cached( $updateUnclosedEventsSql ) or Fatal( "Can't prepare '$updateUnclosedEventsSql': ".$dbh->errstr() ); + $res = $selectUnclosedEventsSth->execute() or Fatal( "Can't execute: ".$selectUnclosedEventsSth->errstr() ); + while( my $event = $selectUnclosedEventsSth->fetchrow_hashref() ) + { + aud_print( "Found open event '$event->{Id}'" ); + if ( confirm( 'close', 'closing' ) ) + { + $res = $updateUnclosedEventsSth->execute( sprintf( "%s%d%s", $event->{Prefix}, $event->{Id}, RECOVER_TAG ), $event->{EndTime}, $event->{Length}, $event->{Frames}, $event->{AlarmFrames}, $event->{TotScore}, $event->{AlarmFrames}?int($event->{TotScore}/$event->{AlarmFrames}):0, $event->{MaxScore}, RECOVER_TEXT, $event->{Id} ) or Fatal( "Can't execute: ".$updateUnclosedEventsSth->errstr() ); + } + } + $selectUnclosedEventsSth->finish(); + + # Now delete any old image files + if ( my @old_files = grep { -M > $max_image_age } <$image_path/*.{jpg,gif,wbmp}> ) + { + aud_print( "Deleting ".int(@old_files)." old images\n" ); + my $untainted_old_files = join( ";", @old_files ); + ( $untainted_old_files ) = ( $untainted_old_files =~ /^(.*)$/ ); + unlink( split( /;/, $untainted_old_files ) ); + } + + # Now delete any old swap files + ( my $swap_image_root ) = ( $swap_image_path =~ /^(.*)$/ ); # De-taint + File::Find::find( { wanted=>\&deleteSwapImage, untaint=>1 }, $swap_image_root ); + + # Prune the Logs table if required + if ( ZM_LOG_DATABASE_LIMIT ) + { + if ( ZM_LOG_DATABASE_LIMIT =~ /^\d+$/ ) + { + # Number of rows + my $selectLogRowCountSql = "select count(*) as Rows from Logs"; + my $selectLogRowCountSth = $dbh->prepare_cached( $selectLogRowCountSql ) or Fatal( "Can't prepare '$selectLogRowCountSql': ".$dbh->errstr() ); + $res = $selectLogRowCountSth->execute() or Fatal( "Can't execute: ".$selectLogRowCountSth->errstr() ); + my $row = $selectLogRowCountSth->fetchrow_hashref(); + my $logRows = $row->{Rows}; + $selectLogRowCountSth->finish(); + if ( $logRows > ZM_LOG_DATABASE_LIMIT ) + { + my $deleteLogByRowsSql = "delete low_priority from Logs order by TimeKey asc limit ?"; + my $deleteLogByRowsSth = $dbh->prepare_cached( $deleteLogByRowsSql ) or Fatal( "Can't prepare '$deleteLogByRowsSql': ".$dbh->errstr() ); + $res = $deleteLogByRowsSth->execute( $logRows - ZM_LOG_DATABASE_LIMIT ) or Fatal( "Can't execute: ".$deleteLogByRowsSth->errstr() ); + aud_print( "Deleted ".$deleteLogByRowsSth->rows()." log table entries by count\n" ) if ( $deleteLogByRowsSth->rows() ); + } + } + else + { + # Time of record + my $deleteLogByTimeSql = "delete low_priority from Logs where TimeKey < unix_timestamp(now() - interval ".ZM_LOG_DATABASE_LIMIT.")"; + my $deleteLogByTimeSth = $dbh->prepare_cached( $deleteLogByTimeSql ) or Fatal( "Can't prepare '$deleteLogByTimeSql': ".$dbh->errstr() ); + $res = $deleteLogByTimeSth->execute() or Fatal( "Can't execute: ".$deleteLogByTimeSth->errstr() ); + aud_print( "Deleted ".$deleteLogByTimeSth->rows()." log table entries by time\n" ) if ( $deleteLogByTimeSth->rows() ); + } + } + $loop = $continuous; + + sleep( ZM_AUDIT_CHECK_INTERVAL ) if ( $continuous ); +}; + +exit( 0 ); + +sub aud_print( $ ) +{ + my $string = shift; + if ( !$continuous ) + { + print( $string ); + } + else + { + Info( $string ); + } +} + +sub confirm( ;$$ ) +{ + my $prompt = shift || "delete"; + my $action = shift || "deleting"; + + my $yesno = 0; + if ( $report ) + { + print( "\n" ); + } + elsif ( $interactive ) + { + print( ", $prompt y/n: " ); + my $char = <>; + chomp( $char ); + if ( $char eq 'q' ) + { + exit( 0 ); + } + if ( !$char ) + { + $char = 'y'; + } + $yesno = ( $char =~ /[yY]/ ); + } + else + { + if ( !$continuous ) + { + print( ", $action\n" ); + } + else + { + Info( $action ); + } + $yesno = 1; + } + return( $yesno ); +} + +sub deleteSwapImage() +{ + my $file = $_; + + if ( $file !~ /^zmswap-/ ) + { + return; + } + + # Ignore directories + if ( -d $file ) + { + return; + } + + if ( -M $file > $max_swap_age ) + { + Debug( "Deleting $file" ); + #unlink( $file ); + } +} diff --git a/scripts/zmaudit.pl.in b/scripts/zmaudit.pl.in new file mode 100644 index 000000000..955198c9f --- /dev/null +++ b/scripts/zmaudit.pl.in @@ -0,0 +1,510 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder Audit Script, $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. +# +# ========================================================================== +# +# This script checks for consistency between the event filesystem and +# the database. If events are found in one and not the other they are +# deleted (optionally). Additionally any monitor event directories that +# do not correspond to a database monitor are similarly disposed of. +# However monitors in the database that don't have a directory are left +# alone as this is valid if they are newly created and have no events +# yet. +# +use strict; +use bytes; + +# ========================================================================== +# +# These are the elements you can edit to suit your installation +# +# ========================================================================== + +use constant MIN_AGE => 300; # Minimum age when we will delete anything +use constant MAX_AGED_DIRS => 10; # Number of event dirs to check age on +use constant RECOVER_TAG => "(r)"; # Tag to append to event name when recovered +use constant RECOVER_TEXT => "Recovered."; # Text to append to event notes when recovered + +# ========================================================================== +# +# You shouldn't need to change anything from here downwards +# +# ========================================================================== + +@EXTRA_PERL_LIB@ +use ZoneMinder; +use DBI; +use POSIX; +use File::Find; +use Time::HiRes qw/gettimeofday/; +use Getopt::Long; + +use constant IMAGE_PATH => ZM_PATH_WEB.'/'.ZM_DIR_IMAGES; +use constant EVENT_PATH => (ZM_DIR_EVENTS=~m|/|)?ZM_DIR_EVENTS:(ZM_PATH_WEB.'/'.ZM_DIR_EVENTS); + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +my $report = 0; +my $interactive = 0; +my $continuous = 0; + +sub usage +{ + print( " +Usage: zmaudit.pl [-r,-report|-i,-interactive] +Parameters are :- +-r, --report - Just report don't actually do anything +-i, --interactive - Ask before applying any changes +-c, --continuous - Run continuously +"); + exit( -1 ); +} + +sub aud_print( $ ); +sub confirm( ;$$ ); +sub deleteSwapImage(); + +logInit(); +logSetSignal(); + +if ( !GetOptions( 'report'=>\$report, 'interactive'=>\$interactive, 'continuous'=>\$continuous ) ) +{ + usage(); +} + +if ( ($report + $interactive + $continuous) > 1 ) +{ + print( STDERR "Error, only option may be specified\n" ); + usage(); +} + +my $dbh = zmDbConnect(); + +chdir( EVENT_PATH ); + +my $max_image_age = 6/24; # 6 hours +my $max_swap_age = 24/24; # 24 hours +my $image_path = IMAGE_PATH; +my $swap_image_path = ZM_PATH_SWAP; + +my $loop = 1; +my $cleaned = 0; +MAIN: while( $loop ) +{ + my $db_monitors; + my $monitorSelectSql = "select Id from Monitors order by Id"; + my $monitorSelectSth = $dbh->prepare_cached( $monitorSelectSql ) or Fatal( "Can't prepare '$monitorSelectSql': ".$dbh->errstr() ); + my $eventSelectSql = "select Id, (unix_timestamp() - unix_timestamp(StartTime)) as Age from Events where MonitorId = ? order by Id"; + my $eventSelectSth = $dbh->prepare_cached( $eventSelectSql ) or Fatal( "Can't prepare '$eventSelectSql': ".$dbh->errstr() ); + + $cleaned = 0; + my $res = $monitorSelectSth->execute() or Fatal( "Can't execute: ".$monitorSelectSth->errstr() ); + while( my $monitor = $monitorSelectSth->fetchrow_hashref() ) + { + Debug( "Found database monitor '$monitor->{Id}'" ); + my $db_events = $db_monitors->{$monitor->{Id}} = {}; + my $res = $eventSelectSth->execute( $monitor->{Id} ) or Fatal( "Can't execute: ".$eventSelectSth->errstr() ); + while ( my $event = $eventSelectSth->fetchrow_hashref() ) + { + $db_events->{$event->{Id}} = $event->{Age}; + } + Debug( "Got ".int(keys(%$db_events))." events\n" ); + $eventSelectSth->finish(); + } + $monitorSelectSth->finish(); + + my $fs_monitors; + foreach my $monitor ( <[0-9]*> ) + { + Debug( "Found filesystem monitor '$monitor'" ); + my $fs_events = $fs_monitors->{$monitor} = {}; + ( my $monitor_dir ) = ( $monitor =~ /^(.*)$/ ); # De-taint + + if ( ZM_USE_DEEP_STORAGE ) + { + foreach my $day_dir ( <$monitor_dir/*/*/*> ) + { + Debug( "Checking $day_dir" ); + ( $day_dir ) = ( $day_dir =~ /^(.*)$/ ); # De-taint + chdir( $day_dir ); + opendir( DIR, "." ) or Fatal( "Can't open directory '$day_dir': $!" ); + my @event_links = sort { $b <=> $a } grep { -l $_ } readdir( DIR ); + closedir( DIR ); + my $count = 0; + foreach my $event_link ( @event_links ) + { + Debug( "Checking link $event_link" ); + ( my $event = $event_link ) =~ s/^.*\.//; + my $event_path = readlink( $event_link ); + if ( $count++ > MAX_AGED_DIRS ) + { + $fs_events->{$event} = -1; + } + else + { + if ( !-e $event_path ) + { + aud_print( "Event link $day_dir/$event_link does not point to valid target" ); + if ( confirm() ) + { + ( $event_link ) = ( $event_link =~ /^(.*)$/ ); # De-taint + unlink( $event_link ); + $cleaned = 1; + } + } + else + { + $fs_events->{$event} = (time() - ($^T - ((-M $event_path) * 24*60*60))); + } + } + } + chdir( EVENT_PATH ); + } + } + else + { + chdir( $monitor_dir ); + opendir( DIR, "." ) or Fatal( "Can't open directory '$monitor_dir': $!" ); + my @temp_events = sort { $b <=> $a } grep { -d $_ && $_ =~ /^\d+$/ } readdir( DIR ); + closedir( DIR ); + my $count = 0; + foreach my $event ( @temp_events ) + { + if ( $count++ > MAX_AGED_DIRS ) + { + $fs_events->{$event} = -1; + } + else + { + $fs_events->{$event} = (time() - ($^T - ((-M $event) * 24*60*60))); + } + } + chdir( EVENT_PATH ); + } + Debug( "Got ".int(keys(%$fs_events))." events\n" ); + } + redo MAIN if ( $cleaned ); + + $cleaned = 0; + while ( my ( $fs_monitor, $fs_events ) = each(%$fs_monitors) ) + { + if ( my $db_events = $db_monitors->{$fs_monitor} ) + { + if ( $fs_events ) + { + while ( my ( $fs_event, $age ) = each(%$fs_events ) ) + { + if ( !defined($db_events->{$fs_event}) && ($age < 0 || ($age > MIN_AGE)) ) + { + aud_print( "Filesystem event '$fs_monitor/$fs_event' does not exist in database" ); + if ( confirm() ) + { + deleteEventFiles( $fs_event, $fs_monitor ); + $cleaned = 1; + } + } + } + } + } + else + { + aud_print( "Filesystem monitor '$fs_monitor' does not exist in database" ); + if ( confirm() ) + { + my $command = "rm -rf $fs_monitor"; + executeShellCommand( $command ); + $cleaned = 1; + } + } + } + + my $monitor_links; + foreach my $link ( <*> ) + { + next if ( !-l $link ); + next if ( -e $link ); + + aud_print( "Filesystem monitor link '$link' does not point to valid monitor directory" ); + if ( confirm() ) + { + ( $link ) = ( $link =~ /^(.*)$/ ); # De-taint + my $command = "rm $link"; + executeShellCommand( $command ); + $cleaned = 1; + } + } + redo MAIN if ( $cleaned ); + + $cleaned = 0; + my $deleteMonitorSql = "delete low_priority from Monitors where Id = ?"; + my $deleteMonitorSth = $dbh->prepare_cached( $deleteMonitorSql ) or Fatal( "Can't prepare '$deleteMonitorSql': ".$dbh->errstr() ); + my $deleteEventSql = "delete low_priority from Events where Id = ?"; + my $deleteEventSth = $dbh->prepare_cached( $deleteEventSql ) or Fatal( "Can't prepare '$deleteEventSql': ".$dbh->errstr() ); + my $deleteFramesSql = "delete low_priority from Frames where EventId = ?"; + my $deleteFramesSth = $dbh->prepare_cached( $deleteFramesSql ) or Fatal( "Can't prepare '$deleteFramesSql': ".$dbh->errstr() ); + my $deleteStatsSql = "delete low_priority from Stats where EventId = ?"; + my $deleteStatsSth = $dbh->prepare_cached( $deleteStatsSql ) or Fatal( "Can't prepare '$deleteStatsSql': ".$dbh->errstr() ); + while ( my ( $db_monitor, $db_events ) = each(%$db_monitors) ) + { + if ( my $fs_events = $fs_monitors->{$db_monitor} ) + { + if ( $db_events ) + { + while ( my ( $db_event, $age ) = each(%$db_events ) ) + { + if ( !defined($fs_events->{$db_event}) && ($age > MIN_AGE) ) + { + aud_print( "Database event '$db_monitor/$db_event' does not exist in filesystem" ); + if ( confirm() ) + { + my $res = $deleteEventSth->execute( $db_event ) or Fatal( "Can't execute: ".$deleteEventSth->errstr() ); + $res = $deleteFramesSth->execute( $db_event ) or Fatal( "Can't execute: ".$deleteFramesSth->errstr() ); + $res = $deleteStatsSth->execute( $db_event ) or Fatal( "Can't execute: ".$deleteStatsSth->errstr() ); + $cleaned = 1; + } + } + } + } + } + else + { + #aud_print( "Database monitor '$db_monitor' does not exist in filesystem" ); + #if ( confirm() ) + #{ + # We don't actually do this in case it's new + #my $res = $deleteMonitorSth->execute( $db_monitor ) or Fatal( "Can't execute: ".$deleteMonitorSth->errstr() ); + #$cleaned = 1; + #} + } + } + redo MAIN if ( $cleaned ); + + # Remove orphaned events (with no monitor) + $cleaned = 0; + my $selectOrphanedEventsSql = "select Events.Id, Events.Name from Events left join Monitors on (Events.MonitorId = Monitors.Id) where isnull(Monitors.Id)"; + my $selectOrphanedEventsSth = $dbh->prepare_cached( $selectOrphanedEventsSql ) or Fatal( "Can't prepare '$selectOrphanedEventsSql': ".$dbh->errstr() ); + $res = $selectOrphanedEventsSth->execute() or Fatal( "Can't execute: ".$selectOrphanedEventsSth->errstr() ); + while( my $event = $selectOrphanedEventsSth->fetchrow_hashref() ) + { + aud_print( "Found orphaned event with no monitor '$event->{Id}'" ); + if ( confirm() ) + { + $res = $deleteEventSth->execute( $event->{Id} ) or Fatal( "Can't execute: ".$deleteEventSth->errstr() ); + $cleaned = 1; + } + } + $selectOrphanedEventsSth->finish(); + redo MAIN if ( $cleaned ); + + # Remove empty events (with no frames) + $cleaned = 0; + my $selectEmptyEventsSql = "select * from Events as E left join Frames as F on (E.Id = F.EventId) where isnull(F.EventId) and now() - interval ".MIN_AGE." second > E.StartTime"; + my $selectEmptyEventsSth = $dbh->prepare_cached( $selectEmptyEventsSql ) or Fatal( "Can't prepare '$selectEmptyEventsSql': ".$dbh->errstr() ); + $res = $selectEmptyEventsSth->execute() or Fatal( "Can't execute: ".$selectEmptyEventsSth->errstr() ); + while( my $event = $selectEmptyEventsSth->fetchrow_hashref() ) + { + aud_print( "Found empty event with no frame records '$event->{Id}'" ); + if ( confirm() ) + { + $res = $deleteEventSth->execute( $event->{Id} ) or Fatal( "Can't execute: ".$deleteEventSth->errstr() ); + $cleaned = 1; + } + } + $selectEmptyEventsSth->finish(); + redo MAIN if ( $cleaned ); + + # Remove orphaned frame records + $cleaned = 0; + my $selectOrphanedFramesSql = "select distinct EventId from Frames where EventId not in (select Id from Events)"; + my $selectOrphanedFramesSth = $dbh->prepare_cached( $selectOrphanedFramesSql ) or Fatal( "Can't prepare '$selectOrphanedFramesSql': ".$dbh->errstr() ); + $res = $selectOrphanedFramesSth->execute() or Fatal( "Can't execute: ".$selectOrphanedFramesSth->errstr() ); + while( my $frame = $selectOrphanedFramesSth->fetchrow_hashref() ) + { + aud_print( "Found orphaned frame records for event '$frame->{EventId}'" ); + if ( confirm() ) + { + $res = $deleteFramesSth->execute( $frame->{EventId} ) or Fatal( "Can't execute: ".$deleteFramesSth->errstr() ); + $cleaned = 1; + } + } + $selectOrphanedFramesSth->finish(); + redo MAIN if ( $cleaned ); + + # Remove orphaned stats records + $cleaned = 0; + my $selectOrphanedStatsSql = "select distinct EventId from Stats where EventId not in (select Id from Events)"; + my $selectOrphanedStatsSth = $dbh->prepare_cached( $selectOrphanedStatsSql ) or Fatal( "Can't prepare '$selectOrphanedStatsSql': ".$dbh->errstr() ); + $res = $selectOrphanedStatsSth->execute() or Fatal( "Can't execute: ".$selectOrphanedStatsSth->errstr() ); + while( my $stat = $selectOrphanedStatsSth->fetchrow_hashref() ) + { + aud_print( "Found orphaned statistic records for event '$stat->{EventId}'" ); + if ( confirm() ) + { + $res = $deleteStatsSth->execute( $stat->{EventId} ) or Fatal( "Can't execute: ".$deleteStatsSth->errstr() ); + $cleaned = 1; + } + } + $selectOrphanedStatsSth->finish(); + redo MAIN if ( $cleaned ); + + # New audit to close any events that were left open for longer than MIN_AGE seconds + my $selectUnclosedEventsSql = "select E.Id, max(F.TimeStamp) as EndTime, unix_timestamp(max(F.TimeStamp)) - unix_timestamp(E.StartTime) as Length, max(F.FrameId) as Frames, count(if(F.Score>0,1,NULL)) as AlarmFrames, sum(F.Score) as TotScore, max(F.Score) as MaxScore, M.EventPrefix as Prefix from Events as E left join Monitors as M on E.MonitorId = M.Id inner join Frames as F on E.Id = F.EventId where isnull(E.Frames) or isnull(E.EndTime) group by E.Id having EndTime < (now() - interval ".MIN_AGE." second)"; + my $selectUnclosedEventsSth = $dbh->prepare_cached( $selectUnclosedEventsSql ) or Fatal( "Can't prepare '$selectUnclosedEventsSql': ".$dbh->errstr() ); + my $updateUnclosedEventsSql = "update low_priority Events set Name = ?, EndTime = ?, Length = ?, Frames = ?, AlarmFrames = ?, TotScore = ?, AvgScore = ?, MaxScore = ?, Notes = concat_ws( ' ', Notes, ? ) where Id = ?"; + my $updateUnclosedEventsSth = $dbh->prepare_cached( $updateUnclosedEventsSql ) or Fatal( "Can't prepare '$updateUnclosedEventsSql': ".$dbh->errstr() ); + $res = $selectUnclosedEventsSth->execute() or Fatal( "Can't execute: ".$selectUnclosedEventsSth->errstr() ); + while( my $event = $selectUnclosedEventsSth->fetchrow_hashref() ) + { + aud_print( "Found open event '$event->{Id}'" ); + if ( confirm( 'close', 'closing' ) ) + { + $res = $updateUnclosedEventsSth->execute( sprintf( "%s%d%s", $event->{Prefix}, $event->{Id}, RECOVER_TAG ), $event->{EndTime}, $event->{Length}, $event->{Frames}, $event->{AlarmFrames}, $event->{TotScore}, $event->{AlarmFrames}?int($event->{TotScore}/$event->{AlarmFrames}):0, $event->{MaxScore}, RECOVER_TEXT, $event->{Id} ) or Fatal( "Can't execute: ".$updateUnclosedEventsSth->errstr() ); + } + } + $selectUnclosedEventsSth->finish(); + + # Now delete any old image files + if ( my @old_files = grep { -M > $max_image_age } <$image_path/*.{jpg,gif,wbmp}> ) + { + aud_print( "Deleting ".int(@old_files)." old images\n" ); + my $untainted_old_files = join( ";", @old_files ); + ( $untainted_old_files ) = ( $untainted_old_files =~ /^(.*)$/ ); + unlink( split( /;/, $untainted_old_files ) ); + } + + # Now delete any old swap files + ( my $swap_image_root ) = ( $swap_image_path =~ /^(.*)$/ ); # De-taint + File::Find::find( { wanted=>\&deleteSwapImage, untaint=>1 }, $swap_image_root ); + + # Prune the Logs table if required + if ( ZM_LOG_DATABASE_LIMIT ) + { + if ( ZM_LOG_DATABASE_LIMIT =~ /^\d+$/ ) + { + # Number of rows + my $selectLogRowCountSql = "select count(*) as Rows from Logs"; + my $selectLogRowCountSth = $dbh->prepare_cached( $selectLogRowCountSql ) or Fatal( "Can't prepare '$selectLogRowCountSql': ".$dbh->errstr() ); + $res = $selectLogRowCountSth->execute() or Fatal( "Can't execute: ".$selectLogRowCountSth->errstr() ); + my $row = $selectLogRowCountSth->fetchrow_hashref(); + my $logRows = $row->{Rows}; + $selectLogRowCountSth->finish(); + if ( $logRows > ZM_LOG_DATABASE_LIMIT ) + { + my $deleteLogByRowsSql = "delete low_priority from Logs order by TimeKey asc limit ?"; + my $deleteLogByRowsSth = $dbh->prepare_cached( $deleteLogByRowsSql ) or Fatal( "Can't prepare '$deleteLogByRowsSql': ".$dbh->errstr() ); + $res = $deleteLogByRowsSth->execute( $logRows - ZM_LOG_DATABASE_LIMIT ) or Fatal( "Can't execute: ".$deleteLogByRowsSth->errstr() ); + aud_print( "Deleted ".$deleteLogByRowsSth->rows()." log table entries by count\n" ) if ( $deleteLogByRowsSth->rows() ); + } + } + else + { + # Time of record + my $deleteLogByTimeSql = "delete low_priority from Logs where TimeKey < unix_timestamp(now() - interval ".ZM_LOG_DATABASE_LIMIT.")"; + my $deleteLogByTimeSth = $dbh->prepare_cached( $deleteLogByTimeSql ) or Fatal( "Can't prepare '$deleteLogByTimeSql': ".$dbh->errstr() ); + $res = $deleteLogByTimeSth->execute() or Fatal( "Can't execute: ".$deleteLogByTimeSth->errstr() ); + aud_print( "Deleted ".$deleteLogByTimeSth->rows()." log table entries by time\n" ) if ( $deleteLogByTimeSth->rows() ); + } + } + $loop = $continuous; + + sleep( ZM_AUDIT_CHECK_INTERVAL ) if ( $continuous ); +}; + +exit( 0 ); + +sub aud_print( $ ) +{ + my $string = shift; + if ( !$continuous ) + { + print( $string ); + } + else + { + Info( $string ); + } +} + +sub confirm( ;$$ ) +{ + my $prompt = shift || "delete"; + my $action = shift || "deleting"; + + my $yesno = 0; + if ( $report ) + { + print( "\n" ); + } + elsif ( $interactive ) + { + print( ", $prompt y/n: " ); + my $char = <>; + chomp( $char ); + if ( $char eq 'q' ) + { + exit( 0 ); + } + if ( !$char ) + { + $char = 'y'; + } + $yesno = ( $char =~ /[yY]/ ); + } + else + { + if ( !$continuous ) + { + print( ", $action\n" ); + } + else + { + Info( $action ); + } + $yesno = 1; + } + return( $yesno ); +} + +sub deleteSwapImage() +{ + my $file = $_; + + if ( $file !~ /^zmswap-/ ) + { + return; + } + + # Ignore directories + if ( -d $file ) + { + return; + } + + if ( -M $file > $max_swap_age ) + { + Debug( "Deleting $file" ); + #unlink( $file ); + } +} diff --git a/scripts/zmcontrol.pl b/scripts/zmcontrol.pl new file mode 100644 index 000000000..d71da2084 --- /dev/null +++ b/scripts/zmcontrol.pl @@ -0,0 +1,237 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder Control Script, $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. +# +# ========================================================================== +# +# This script continuously monitors the recorded events for the given +# monitor and applies any filters which would delete and/or upload +# matching events +# +use strict; + +use lib '/usr/share/perl/5.14.2'; # Include custom perl install path +use ZoneMinder; +use Getopt::Long; +use POSIX qw/strftime EPIPE/; +use Socket; +use Data::Dumper; +use Module::Load; + +use constant MAX_CONNECT_DELAY => 10; +use constant MAX_COMMAND_WAIT => 1800; + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +sub Usage +{ + print( " +Usage: zmcontrol.pl --id --command= +"); + exit( -1 ); +} + +logInit(); + +my $arg_string = join( " ", @ARGV ); + +my $id; +my %options; + +if ( !GetOptions( + 'id=i'=>\$id, + 'command=s'=>\$options{command}, + 'xcoord=i'=>\$options{xcoord}, + 'ycoord=i'=>\$options{ycoord}, + 'speed=i'=>\$options{speed}, + 'step=i'=>\$options{step}, + 'panspeed=i'=>\$options{panspeed}, + 'tiltspeed=i'=>\$options{tiltspeed}, + 'panstep=i'=>\$options{panstep}, + 'tiltstep=i'=>\$options{tiltstep}, + 'preset=i'=>\$options{preset}, + 'autostop'=>\$options{autostop}, + ) +) +{ + Usage(); +} + +if ( !$id || !$options{command} ) +{ + print( STDERR "Please give a valid monitor id and command\n" ); + Usage(); +} + +( $id ) = $id =~ /^(\w+)$/; + +Debug( $arg_string ); + +my $sock_file = ZM_PATH_SOCKS.'/zmcontrol-'.$id.'.sock'; + +socket( CLIENT, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" ); + +my $saddr = sockaddr_un( $sock_file ); +my $server_up = connect( CLIENT, $saddr ); +if ( !$server_up ) +{ + # The server isn't there + my $monitor = zmDbGetMonitorAndControl( $id ); + if ( !$monitor ) + { + Fatal( "Unable to load control data for monitor $id" ); + } + my $protocol = $monitor->{Protocol}; + + if ( -x $protocol ) + { + # Protocol is actually a script! + # Holdover from previous versions + my $command .= $protocol.' '.$arg_string; + Debug( $command."\n" ); + + my $output = qx($command); + my $status = $? >> 8; + if ( $status || logDebugging() ) + { + chomp( $output ); + Debug( "Output: $output\n" ); + } + if ( $status ) + { + Error( "Command '$command' exited with status: $status\n" ); + exit( $status ); + } + exit( 0 ); + } + + Info( "Starting control server $id/$protocol" ); + close( CLIENT ); + + if ( my $cpid = fork() ) + { + logReinit(); + + # Parent process just sleep and fall through + socket( CLIENT, PF_UNIX, SOCK_STREAM, 0 ) or die( "Can't open socket: $!" ); + my $attempts = 0; + while (!connect( CLIENT, $saddr )) + { + $attempts++; + Fatal( "Can't connect: $!" ) if ($attempts > MAX_CONNECT_DELAY); + sleep(1); + } + } + elsif ( defined($cpid) ) + { + close( STDOUT ); + close( STDERR ); + + setpgrp(); + + logReinit(); + + Info( "Control server $id/$protocol starting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() ) ); + + $0 = $0." --id $id"; + + load "ZoneMinder::Control::$protocol"; + + my $control = "ZoneMinder::Control::$protocol"->new( $id ); + my $control_key = $control->getKey(); + $control->loadMonitor(); + + $control->open(); + + socket( SERVER, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" ); + unlink( $sock_file ); + bind( SERVER, $saddr ) or Fatal( "Can't bind: $!" ); + listen( SERVER, SOMAXCONN ) or Fatal( "Can't listen: $!" ); + + my $rin = ''; + vec( $rin, fileno(SERVER), 1 ) = 1; + my $win = $rin; + my $ein = $win; + my $timeout = MAX_COMMAND_WAIT; + while( 1 ) + { + my $nfound = select( my $rout = $rin, undef, undef, $timeout ); + if ( $nfound > 0 ) + { + if ( vec( $rout, fileno(SERVER), 1 ) ) + { + my $paddr = accept( CLIENT, SERVER ); + my $message = ; + + next if ( !$message ); + + my $params = jsonDecode( $message ); + #Debug( Dumper( $params ) ); + + my $command = $params->{command}; + $control->$command( $params ); + close( CLIENT ); + } + else + { + Fatal( "Bogus descriptor" ); + } + } + elsif ( $nfound < 0 ) + { + if ( $! == EPIPE ) + { + Error( "Can't select: $!" ); + } + else + { + Fatal( "Can't select: $!" ); + } + } + else + { + #print( "Select timed out\n" ); + last; + } + } + Info( "Control server $id/$protocol exiting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() ) ); + unlink( $sock_file ); + $control->close(); + exit( 0 ); + } + else + { + Fatal( "Can't fork: $!" ); + } +} + +# The server is there, connect to it +#print( "Writing commands\n" ); +CLIENT->autoflush(); + +my $message = jsonEncode( \%options ); +print( CLIENT $message ); +shutdown( CLIENT, 1 ); + +exit( 0 ); diff --git a/scripts/zmcontrol.pl.in b/scripts/zmcontrol.pl.in new file mode 100644 index 000000000..aba203614 --- /dev/null +++ b/scripts/zmcontrol.pl.in @@ -0,0 +1,237 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder Control Script, $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. +# +# ========================================================================== +# +# This script continuously monitors the recorded events for the given +# monitor and applies any filters which would delete and/or upload +# matching events +# +use strict; + +@EXTRA_PERL_LIB@ +use ZoneMinder; +use Getopt::Long; +use POSIX qw/strftime EPIPE/; +use Socket; +use Data::Dumper; +use Module::Load; + +use constant MAX_CONNECT_DELAY => 10; +use constant MAX_COMMAND_WAIT => 1800; + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +sub Usage +{ + print( " +Usage: zmcontrol.pl --id --command= +"); + exit( -1 ); +} + +logInit(); + +my $arg_string = join( " ", @ARGV ); + +my $id; +my %options; + +if ( !GetOptions( + 'id=i'=>\$id, + 'command=s'=>\$options{command}, + 'xcoord=i'=>\$options{xcoord}, + 'ycoord=i'=>\$options{ycoord}, + 'speed=i'=>\$options{speed}, + 'step=i'=>\$options{step}, + 'panspeed=i'=>\$options{panspeed}, + 'tiltspeed=i'=>\$options{tiltspeed}, + 'panstep=i'=>\$options{panstep}, + 'tiltstep=i'=>\$options{tiltstep}, + 'preset=i'=>\$options{preset}, + 'autostop'=>\$options{autostop}, + ) +) +{ + Usage(); +} + +if ( !$id || !$options{command} ) +{ + print( STDERR "Please give a valid monitor id and command\n" ); + Usage(); +} + +( $id ) = $id =~ /^(\w+)$/; + +Debug( $arg_string ); + +my $sock_file = ZM_PATH_SOCKS.'/zmcontrol-'.$id.'.sock'; + +socket( CLIENT, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" ); + +my $saddr = sockaddr_un( $sock_file ); +my $server_up = connect( CLIENT, $saddr ); +if ( !$server_up ) +{ + # The server isn't there + my $monitor = zmDbGetMonitorAndControl( $id ); + if ( !$monitor ) + { + Fatal( "Unable to load control data for monitor $id" ); + } + my $protocol = $monitor->{Protocol}; + + if ( -x $protocol ) + { + # Protocol is actually a script! + # Holdover from previous versions + my $command .= $protocol.' '.$arg_string; + Debug( $command."\n" ); + + my $output = qx($command); + my $status = $? >> 8; + if ( $status || logDebugging() ) + { + chomp( $output ); + Debug( "Output: $output\n" ); + } + if ( $status ) + { + Error( "Command '$command' exited with status: $status\n" ); + exit( $status ); + } + exit( 0 ); + } + + Info( "Starting control server $id/$protocol" ); + close( CLIENT ); + + if ( my $cpid = fork() ) + { + logReinit(); + + # Parent process just sleep and fall through + socket( CLIENT, PF_UNIX, SOCK_STREAM, 0 ) or die( "Can't open socket: $!" ); + my $attempts = 0; + while (!connect( CLIENT, $saddr )) + { + $attempts++; + Fatal( "Can't connect: $!" ) if ($attempts > MAX_CONNECT_DELAY); + sleep(1); + } + } + elsif ( defined($cpid) ) + { + close( STDOUT ); + close( STDERR ); + + setpgrp(); + + logReinit(); + + Info( "Control server $id/$protocol starting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() ) ); + + $0 = $0." --id $id"; + + load "ZoneMinder::Control::$protocol"; + + my $control = "ZoneMinder::Control::$protocol"->new( $id ); + my $control_key = $control->getKey(); + $control->loadMonitor(); + + $control->open(); + + socket( SERVER, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" ); + unlink( $sock_file ); + bind( SERVER, $saddr ) or Fatal( "Can't bind: $!" ); + listen( SERVER, SOMAXCONN ) or Fatal( "Can't listen: $!" ); + + my $rin = ''; + vec( $rin, fileno(SERVER), 1 ) = 1; + my $win = $rin; + my $ein = $win; + my $timeout = MAX_COMMAND_WAIT; + while( 1 ) + { + my $nfound = select( my $rout = $rin, undef, undef, $timeout ); + if ( $nfound > 0 ) + { + if ( vec( $rout, fileno(SERVER), 1 ) ) + { + my $paddr = accept( CLIENT, SERVER ); + my $message = ; + + next if ( !$message ); + + my $params = jsonDecode( $message ); + #Debug( Dumper( $params ) ); + + my $command = $params->{command}; + $control->$command( $params ); + close( CLIENT ); + } + else + { + Fatal( "Bogus descriptor" ); + } + } + elsif ( $nfound < 0 ) + { + if ( $! == EPIPE ) + { + Error( "Can't select: $!" ); + } + else + { + Fatal( "Can't select: $!" ); + } + } + else + { + #print( "Select timed out\n" ); + last; + } + } + Info( "Control server $id/$protocol exiting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() ) ); + unlink( $sock_file ); + $control->close(); + exit( 0 ); + } + else + { + Fatal( "Can't fork: $!" ); + } +} + +# The server is there, connect to it +#print( "Writing commands\n" ); +CLIENT->autoflush(); + +my $message = jsonEncode( \%options ); +print( CLIENT $message ); +shutdown( CLIENT, 1 ); + +exit( 0 ); diff --git a/scripts/zmdbbackup b/scripts/zmdbbackup new file mode 100644 index 000000000..f98439f20 --- /dev/null +++ b/scripts/zmdbbackup @@ -0,0 +1,37 @@ +#!/bin/bash +#=============================================================================== +# +# FILE: zmdbbackup +# +# USAGE: ./zmdbbackup +# +# DESCRIPTION: Uses mysqldump to backup the config info in the zm DB +# OPTIONS: --- None +# REQUIREMENTS: --- mysqldump +# BUGS: --- +# NOTES: --- +# AUTHOR: Ross Melin +# COMPANY: +# VERSION: 2.0 +# CREATED: 05/26/2006 06:21:00 AM PDT +# REVISION: --- +#=============================================================================== + +# Edit these to suit your configuration +ZM_CONFIG=/etc/zm/zm.conf +source $ZM_CONFIG + +MYSQLDUMP=/usr/bin/mysqldump +BACKUP_PATH=/var/lib/zm +BACKUP_FILE=zm_backup.sql +DUMPOPTS="--user=$ZM_DB_USER --password=$ZM_DB_PASS --opt" +TABLES="Config Filters Groups Monitors States TriggersX10 Users Zones" +OUTFILE="$BACKUP_PATH/$BACKUP_FILE" + +echo "-- +-- Created by zm_db_backup for ZoneMinder Version $ZM_VERSION +--" > $OUTFILE + +$MYSQLDUMP $DUMPOPTS zm $TABLES >> $OUTFILE + +exit 0 diff --git a/scripts/zmdbbackup.in b/scripts/zmdbbackup.in new file mode 100644 index 000000000..303cf86be --- /dev/null +++ b/scripts/zmdbbackup.in @@ -0,0 +1,37 @@ +#!/bin/bash +#=============================================================================== +# +# FILE: zmdbbackup +# +# USAGE: ./zmdbbackup +# +# DESCRIPTION: Uses mysqldump to backup the config info in the zm DB +# OPTIONS: --- None +# REQUIREMENTS: --- mysqldump +# BUGS: --- +# NOTES: --- +# AUTHOR: Ross Melin +# COMPANY: +# VERSION: 2.0 +# CREATED: 05/26/2006 06:21:00 AM PDT +# REVISION: --- +#=============================================================================== + +# Edit these to suit your configuration +ZM_CONFIG=@ZM_CONFIG@ +source $ZM_CONFIG + +MYSQLDUMP=/usr/bin/mysqldump +BACKUP_PATH=/var/lib/zm +BACKUP_FILE=zm_backup.sql +DUMPOPTS="--user=$ZM_DB_USER --password=$ZM_DB_PASS --opt" +TABLES="Config Filters Groups Monitors States TriggersX10 Users Zones" +OUTFILE="$BACKUP_PATH/$BACKUP_FILE" + +echo "-- +-- Created by zm_db_backup for ZoneMinder Version $ZM_VERSION +--" > $OUTFILE + +$MYSQLDUMP $DUMPOPTS zm $TABLES >> $OUTFILE + +exit 0 diff --git a/scripts/zmdbrestore b/scripts/zmdbrestore new file mode 100644 index 000000000..68f17e887 --- /dev/null +++ b/scripts/zmdbrestore @@ -0,0 +1,172 @@ +#!/bin/bash +#=============================================================================== +# +# FILE: zmdbrestore +# +# USAGE: ./zmdbrestore +# +# DESCRIPTION: Restore a ZoneMinder DB from a backup created by zm_db_backup +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: (), +# COMPANY: +# VERSION: 1.0 +# CREATED: 05/29/2006 04:45:06 PM PDT +# REVISION: --- +#=============================================================================== + +ZM_CONFIG=/etc/zm/zm.conf +ZM_BACKUP=/var/lib/zm/zm_backup.sql +EVENTS_DIR=events + +loadcfg() { + if [ -f $ZM_CONFIG ]; then + . $ZM_CONFIG + else + echo "ERROR: $ZM_CONFIG not found." + exit 1 + fi +} + +chkcfg(){ +for n in ZM_DB_HOST ZM_DB_NAME ZM_DB_USER ZM_DB_PASS; do + eval "val=\$$n" + if [ "$val" = "" ]; then + echo "ERROR($ZM_CONFIG): $n should not be empty." + echo "Enter a $n for ZM to use the Database." + if [ "$n" = "ZM_DB_PASS" ]; then + echo -n "Will not echo on screen $n : " + stty -echo # Turns off screen echo. + read newval + stty echo # Restores screen echo. + echo "" + ### The following can be used to generate a random password + # randstr newval 16 + else + echo -n "$n : " + read newval + fi + cp $ZM_CONFIG /tmp/$$ && + sed 's/^'$n='.*$/'$n=$newval'/g' /tmp/$$ >$ZM_CONFIG + + fi +done + + if [ "$ZM_DB_HOST" = "localhost" ] + then + ClientHost=localhost + else + ClientHost=`hostname` + fi +} + +reloadcfg(){ + loadcfg +} + +chk_backup_ver(){ + if + [ -e $ZM_BACKUP ] + then + BACKUP_VER=$(cat $ZM_BACKUP | head -n 2 |tail -n 1 |cut -f 8 -d " ") + else + echo "$ZM_BACKUP doesn't exist" + exit 1 + fi + + + if + [ $BACKUP_VER != $ZM_VERSION ] + then + echo "$ZM_BACKUP is from version $BACKUP_VER" + echo "ZoneMinder version is $ZM_VERSION" + exit 1 + fi +} + +getmylogin(){ + echo "Enter MySQL Administrator username" + echo "(Default: root and password is blank)" + echo -n "MySQL Admin: " + read MYADMIN + echo -n "Password: " + read MYPASS + if [ "X$MYPASS" != "X" ]; then MYPASS="-p$MYPASS"; fi + echo "\q" |mysql -u $MYADMIN $MYPASS || exit 0 + +} + +checkfordb(){ + + if + echo "show databases" |mysql -u $MYADMIN "$MYPASS" |grep zm + then + echo "A $ZM_DB_NAME database exists." + while [ true ] + do + echo "Choose one of the following options:" + echo "[D]rop the old database and reinitialize" + echo "[E]xit and do nothing" + read OPTION + case $OPTION in + "D"|"d") + echo "drop database zm;"|mysql -u $MYADMIN $MYPASS + return + ;; + "E"|"e") + exit 0 + ;; + esac + done + + fi +} + +initdb(){ + sql=/tmp/zm.crdb.sql + echo "" >$sql + chmod 600 $sql + + echo "CREATE DATABASE $ZM_DB_NAME;" >>$sql + echo "USE $ZM_DB_NAME;" >>$sql + + echo "GRANT all on $ZM_DB_NAME.* TO '$ZM_DB_USER'@'$ClientHost' IDENTIFIED BY '$ZM_DB_PASS';" >>$sql + + cat $sql | mysql -B -h $ZM_DB_HOST -u $MYADMIN $MYPASS + rm -f $sql + + cat $ZM_PATH_UPDATE/zm_create.sql | mysql -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME + +} + +restoredb(){ + if + [ -e $ZM_BACKUP ] + then + cat $ZM_BACKUP | mysql -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME + else + echo "$ZM_BACKUP doesn't exist" + exit 1 + fi +} + +restore_events(){ + for SQL in $(find $ZM_PATH_WEB/$EVENTS_DIR -name .sql) + do + cat $SQL | mysql -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME + done +} + +loadcfg +chkcfg +reloadcfg +chk_backup_ver +getmylogin +checkfordb +initdb +restoredb +restore_events +exit 0 diff --git a/scripts/zmdbrestore.in b/scripts/zmdbrestore.in new file mode 100644 index 000000000..4cf8c0ffa --- /dev/null +++ b/scripts/zmdbrestore.in @@ -0,0 +1,172 @@ +#!/bin/bash +#=============================================================================== +# +# FILE: zmdbrestore +# +# USAGE: ./zmdbrestore +# +# DESCRIPTION: Restore a ZoneMinder DB from a backup created by zm_db_backup +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: (), +# COMPANY: +# VERSION: 1.0 +# CREATED: 05/29/2006 04:45:06 PM PDT +# REVISION: --- +#=============================================================================== + +ZM_CONFIG=@ZM_CONFIG@ +ZM_BACKUP=/var/lib/zm/zm_backup.sql +EVENTS_DIR=events + +loadcfg() { + if [ -f $ZM_CONFIG ]; then + . $ZM_CONFIG + else + echo "ERROR: $ZM_CONFIG not found." + exit 1 + fi +} + +chkcfg(){ +for n in ZM_DB_HOST ZM_DB_NAME ZM_DB_USER ZM_DB_PASS; do + eval "val=\$$n" + if [ "$val" = "" ]; then + echo "ERROR($ZM_CONFIG): $n should not be empty." + echo "Enter a $n for ZM to use the Database." + if [ "$n" = "ZM_DB_PASS" ]; then + echo -n "Will not echo on screen $n : " + stty -echo # Turns off screen echo. + read newval + stty echo # Restores screen echo. + echo "" + ### The following can be used to generate a random password + # randstr newval 16 + else + echo -n "$n : " + read newval + fi + cp $ZM_CONFIG /tmp/$$ && + sed 's/^'$n='.*$/'$n=$newval'/g' /tmp/$$ >$ZM_CONFIG + + fi +done + + if [ "$ZM_DB_HOST" = "localhost" ] + then + ClientHost=localhost + else + ClientHost=`hostname` + fi +} + +reloadcfg(){ + loadcfg +} + +chk_backup_ver(){ + if + [ -e $ZM_BACKUP ] + then + BACKUP_VER=$(cat $ZM_BACKUP | head -n 2 |tail -n 1 |cut -f 8 -d " ") + else + echo "$ZM_BACKUP doesn't exist" + exit 1 + fi + + + if + [ $BACKUP_VER != $ZM_VERSION ] + then + echo "$ZM_BACKUP is from version $BACKUP_VER" + echo "ZoneMinder version is $ZM_VERSION" + exit 1 + fi +} + +getmylogin(){ + echo "Enter MySQL Administrator username" + echo "(Default: root and password is blank)" + echo -n "MySQL Admin: " + read MYADMIN + echo -n "Password: " + read MYPASS + if [ "X$MYPASS" != "X" ]; then MYPASS="-p$MYPASS"; fi + echo "\q" |mysql -u $MYADMIN $MYPASS || exit 0 + +} + +checkfordb(){ + + if + echo "show databases" |mysql -u $MYADMIN "$MYPASS" |grep zm + then + echo "A $ZM_DB_NAME database exists." + while [ true ] + do + echo "Choose one of the following options:" + echo "[D]rop the old database and reinitialize" + echo "[E]xit and do nothing" + read OPTION + case $OPTION in + "D"|"d") + echo "drop database zm;"|mysql -u $MYADMIN $MYPASS + return + ;; + "E"|"e") + exit 0 + ;; + esac + done + + fi +} + +initdb(){ + sql=/tmp/zm.crdb.sql + echo "" >$sql + chmod 600 $sql + + echo "CREATE DATABASE $ZM_DB_NAME;" >>$sql + echo "USE $ZM_DB_NAME;" >>$sql + + echo "GRANT all on $ZM_DB_NAME.* TO '$ZM_DB_USER'@'$ClientHost' IDENTIFIED BY '$ZM_DB_PASS';" >>$sql + + cat $sql | mysql -B -h $ZM_DB_HOST -u $MYADMIN $MYPASS + rm -f $sql + + cat $ZM_PATH_UPDATE/zm_create.sql | mysql -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME + +} + +restoredb(){ + if + [ -e $ZM_BACKUP ] + then + cat $ZM_BACKUP | mysql -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME + else + echo "$ZM_BACKUP doesn't exist" + exit 1 + fi +} + +restore_events(){ + for SQL in $(find $ZM_PATH_WEB/$EVENTS_DIR -name .sql) + do + cat $SQL | mysql -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME + done +} + +loadcfg +chkcfg +reloadcfg +chk_backup_ver +getmylogin +checkfordb +initdb +restoredb +restore_events +exit 0 diff --git a/scripts/zmdc.pl b/scripts/zmdc.pl new file mode 100644 index 000000000..a63d0958b --- /dev/null +++ b/scripts/zmdc.pl @@ -0,0 +1,798 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder Daemon Control Script, $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. +# +# ========================================================================== +# +# This script is the gateway for controlling the various ZoneMinder +# daemons. All starting, stopping and restarting goes through here. +# On the first invocation it starts up a server which subsequently +# records what's running and what's not. Other invocations just +# connect to the server and pass instructions to it. +# +use strict; +use bytes; + +# ========================================================================== +# +# User config +# +# ========================================================================== + +use constant MAX_CONNECT_DELAY => 10; + +# ========================================================================== +# +# Don't change anything from here on down +# +# ========================================================================== + +use lib '/usr/share/perl/5.14.2'; # Include custom perl install path +use ZoneMinder; +use POSIX; +use Socket; +use IO::Handle; +use Data::Dumper; + +use constant SOCK_FILE => ZM_PATH_SOCKS.'/zmdc.sock'; + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +my @daemons = ( + 'zmc', + 'zma', + 'zmf', + 'zmfilter.pl', + 'zmaudit.pl', + 'zmtrigger.pl', + 'zmx10.pl', + 'zmwatch.pl', + 'zmupdate.pl', + 'zmtrack.pl' +); + +sub Usage +{ + print( " +Usage: zmdc.pl [daemon [options]] +Parameters are :- + - One of 'startup|shutdown|status|check|logrot' or + 'start|stop|restart|reload'. +[daemon [options]] - Daemon name and options, required for second group of commands +"); + exit( -1 ); +} + +my $command = shift @ARGV; +if( !$command ) +{ + print( STDERR "No command given\n" ); + Usage(); +} +my $needs_daemon = $command !~ /(?:startup|shutdown|status|check|logrot)/; +my $daemon = shift( @ARGV ); +if( $needs_daemon && !$daemon ) +{ + print( STDERR "No daemon given\n" ); + Usage(); +} +my @args; + +my $daemon_patt = '('.join( '|', @daemons ).')'; +if ( $needs_daemon ) +{ + if ( $daemon =~ /^${daemon_patt}$/ ) + { + $daemon = $1; + } + else + { + print( STDERR "Invalid daemon '$daemon' specified" ); + Usage(); + } +} + +foreach my $arg ( @ARGV ) +{ + # Detaint arguments, if they look ok + #if ( $arg =~ /^(-{0,2}[\w]+)/ ) + if ( $arg =~ /^(-{0,2}[\w\/?&=.-]+)$/ ) + { + push( @args, $1 ); + } + else + { + print( STDERR "Bogus argument '$arg' found" ); + exit( -1 ); + } +} + +socket( CLIENT, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" ); + +my $saddr = sockaddr_un( SOCK_FILE ); +my $server_up = connect( CLIENT, $saddr ); +if ( !$server_up ) +{ + if ( $command eq "logrot" ) + { + exit(); + } + if ( $command eq "check" ) + { + print( "stopped\n" ); + exit(); + } + elsif ( $command ne "startup" ) + { + print( "Unable to connect to server\n" ); + exit( -1 ); + } + # The server isn't there + print( "Starting server\n" ); + close( CLIENT ); + + if ( my $cpid = fork() ) + { + logInit(); + + # Parent process just sleep and fall through + socket( CLIENT, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" ); + my $attempts = 0; + while (!connect( CLIENT, $saddr )) + { + $attempts++; + Fatal( "Can't connect: $!" ) if ($attempts > MAX_CONNECT_DELAY); + sleep(1); + } + } + elsif ( defined($cpid) ) + { + ZMServer::run(); + } + else + { + Fatal( "Can't fork: $!" ); + } +} +if ( $command eq "check" && !$daemon ) +{ + print( "running\n" ); + exit(); +} +elsif ( $command eq "startup" ) +{ + # Our work here is done + exit() if ( !$server_up ); +} +# The server is there, connect to it +#print( "Writing commands\n" ); +CLIENT->autoflush(); +my $message = "$command"; +$message .= ";$daemon" if ( $daemon ); +$message .= ";".join( ';', @args ) if ( @args ); +print( CLIENT $message ); +shutdown( CLIENT, 1 ); +while ( my $line = ) +{ + chomp( $line ); + print( "$line\n" ); +} +# And we're done! +close( CLIENT ); +#print( "Finished writing, bye\n" ); + +exit; + +package ZMServer; + +use strict; +use bytes; + +use lib '/usr/share/perl/5.14.2'; # Include custom perl install path +use ZoneMinder; +use POSIX; +use Socket; +use IO::Handle; +use Data::Dumper; + +our %cmd_hash; +our %pid_hash; + +sub run +{ + my $fd = 0; + while( $fd < POSIX::sysconf( &POSIX::_SC_OPEN_MAX ) ) + { + POSIX::close( $fd++ ); + } + + setpgrp(); + + logInit(); + + dPrint( ZoneMinder::Logger::INFO, "Server starting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); + + if ( open( PID, ">".ZM_PID ) ) + { + print( PID $$ ); + close( PID ); + } + + killAll( 1 ); + + socket( SERVER, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" ); + unlink( main::SOCK_FILE ); + bind( SERVER, $saddr ) or Fatal( "Can't bind: $!" ); + listen( SERVER, SOMAXCONN ) or Fatal( "Can't listen: $!" ); + + $SIG{CHLD} = \&reaper; + $SIG{INT} = \&shutdownAll; + $SIG{TERM} = \&shutdownAll; + $SIG{ABRT} = \&shutdownAll; + $SIG{HUP} = \&logrot; + + my $rin = ''; + vec( $rin, fileno(SERVER), 1 ) = 1; + my $win = $rin; + my $ein = $win; + my $timeout = 0.1; + while( 1 ) + { + my $nfound = select( my $rout = $rin, undef, undef, $timeout ); + if ( $nfound > 0 ) + { + if ( vec( $rout, fileno(SERVER), 1 ) ) + { + my $paddr = accept( CLIENT, SERVER ); + my $message = ; + + next if ( !$message ); + + my ( $command, $daemon, @args ) = split( /;/, $message ); + + if ( $command eq 'start' ) + { + start( $daemon, @args ); + } + elsif ( $command eq 'stop' ) + { + stop( $daemon, @args ); + } + elsif ( $command eq 'restart' ) + { + restart( $daemon, @args ); + } + elsif ( $command eq 'reload' ) + { + reload( $daemon, @args ); + } + elsif ( $command eq 'startup' ) + { + # Do nothing, this is all we're here for + dPrint( ZoneMinder::Logger::WARNING, "Already running, ignoring command '$command'\n" ); + } + elsif ( $command eq 'shutdown' ) + { + shutdownAll(); + } + elsif ( $command eq 'check' ) + { + check( $daemon, @args ); + } + elsif ( $command eq 'status' ) + { + if ( $daemon ) + { + status( $daemon, @args ); + } + else + { + status(); + } + } + elsif ( $command eq 'logrot' ) + { + logrot(); + } + else + { + dPrint( ZoneMinder::Logger::ERROR, "Invalid command '$command'\n" ); + } + close( CLIENT ); + } + else + { + Fatal( "Bogus descriptor" ); + } + } + elsif ( $nfound < 0 ) + { + if ( $! == EINTR ) + { + # Dead child, will be reaped + #print( "Probable dead child\n" ); + # See if it needs to start up again + restartPending(); + } + elsif ( $! == EPIPE ) + { + Error( "Can't select: $!" ); + } + else + { + Fatal( "Can't select: $!" ); + } + } + else + { + #print( "Select timed out\n" ); + restartPending(); + } + } + dPrint( ZoneMinder::Logger::INFO, "Server exiting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); + unlink( main::SOCK_FILE ); + unlink( ZM_PID ); + exit(); +} + +sub cPrint +{ + if ( fileno(CLIENT) ) + { + print CLIENT @_ + } +} + +sub dPrint +{ + my $logLevel = shift; + if ( fileno(CLIENT) ) + { + print CLIENT @_ + } + if ( $logLevel == ZoneMinder::Logger::DEBUG ) + { + Debug( @_ ); + } + elsif ( $logLevel == ZoneMinder::Logger::INFO ) + { + Info( @_ ); + } + elsif ( $logLevel == ZoneMinder::Logger::WARNING ) + { + Warning( @_ ); + } + elsif ( $logLevel == ZoneMinder::Logger::ERROR ) + { + Error( @_ ); + } + elsif ( $logLevel == ZoneMinder::Logger::FATAL ) + { + Fatal( @_ ); + } +} + +sub start +{ + my $daemon = shift; + my @args = @_; + + my $command = $daemon; + $command .= ' '.join( ' ', ( @args ) ) if ( @args ); + my $process = $cmd_hash{$command}; + + if ( !$process ) + { + # It's not running, or at least it's not been started by us + $process = { daemon=>$daemon, args=>\@args, command=>$command, keepalive=>!undef }; + } + elsif ( $process->{pid} && $pid_hash{$process->{pid}} ) + { + dPrint( ZoneMinder::Logger::INFO, "'$process->{command}' already running at ".strftime( '%y/%m/%d %H:%M:%S', localtime( $process->{started}) ).", pid = $process->{pid}\n" ); + return(); + } + + my $sigset = POSIX::SigSet->new; + my $blockset = POSIX::SigSet->new( SIGCHLD ); + sigprocmask( SIG_BLOCK, $blockset, $sigset ) or Fatal( "Can't block SIGCHLD: $!" ); + if ( my $cpid = fork() ) + { + logReinit(); + + $process->{pid} = $cpid; + $process->{started} = time(); + delete( $process->{pending} ); + + dPrint( ZoneMinder::Logger::INFO, "'$command' starting at ".strftime( '%y/%m/%d %H:%M:%S', localtime( $process->{started}) ).", pid = $process->{pid}\n" ); + + $cmd_hash{$process->{command}} = $pid_hash{$cpid} = $process; + sigprocmask( SIG_SETMASK, $sigset ) or Fatal( "Can't restore SIGCHLD: $!" ); + } + elsif ( defined($cpid ) ) + { + logReinit(); + + dPrint( ZoneMinder::Logger::INFO, "'".join( ' ', ( $daemon, @args ) )."' started at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); + + if ( $daemon =~ /^${daemon_patt}$/ ) + { + $daemon = ZM_PATH_BIN.'/'.$1; + } + else + { + Fatal( "Invalid daemon '$daemon' specified" ); + } + + my @good_args; + foreach my $arg ( @args ) + { + # Detaint arguments, if they look ok + if ( $arg =~ /^(-{0,2}[\w\/?&=.-]+)$/ ) + { + push( @good_args, $1 ); + } + else + { + Fatal( "Bogus argument '$arg' found" ); + } + } + + logTerm(); + + my $fd = 0; + while( $fd < POSIX::sysconf( &POSIX::_SC_OPEN_MAX ) ) + { + POSIX::close( $fd++ ); + } + + # Child process + $SIG{CHLD} = 'DEFAULT'; + $SIG{INT} = 'DEFAULT'; + $SIG{TERM} = 'DEFAULT'; + $SIG{ABRT} = 'DEFAULT'; + + exec( $daemon, @good_args ) or Fatal( "Can't exec: $!" ); + } + else + { + Fatal( "Can't fork: $!" ); + } +} + +sub _stop +{ + my $final = shift; + my $daemon = shift; + my @args = @_; + + my $command = $daemon; + $command .= ' '.join( ' ', ( @args ) ) if ( @args ); + my $process = $cmd_hash{$command}; + if ( !$process ) + { + dPrint( ZoneMinder::Logger::WARNING, "Can't find process with command of '$command'\n" ); + return(); + } + elsif ( $process->{pending} ) + { + delete( $cmd_hash{$command} ); + dPrint( ZoneMinder::Logger::INFO, "Command '$command' removed from pending list at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); + return(); + } + + my $cpid = $process->{pid}; + if ( !$pid_hash{$cpid} ) + { + dPrint( ZoneMinder::Logger::ERROR, "No process with command of '$command' is running\n" ); + return(); + } + + dPrint( ZoneMinder::Logger::INFO, "'$daemon ".join( ' ', @args )."' stopping at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); + $process->{keepalive} = !$final; + kill( 'TERM', $cpid ); + delete( $cmd_hash{$command} ); + + # Now check it has actually gone away, if not kill -9 it + my $count = 0; + while( $cpid && kill( 0, $cpid ) ) + { + if ( $count++ > 5 ) + { + kill( 'KILL', $cpid ); + } + sleep( 1 ); + } +} + +sub stop +{ + _stop( 1, @_ ); +} + +sub restart +{ + my $daemon = shift; + my @args = @_; + + my $command = $daemon; + $command .= ' '.join( ' ', ( @args ) ) if ( @args ); + my $process = $cmd_hash{$command}; + if ( $process ) + { + if ( $process->{pid} ) + { + my $cpid = $process->{pid}; + if ( defined($pid_hash{$cpid}) ) + { + _stop( 0, $daemon, @args ); + return; + } + } + } + start( $daemon, @args ); +} + +sub reload +{ + my $daemon = shift; + my @args = @_; + + my $command = $daemon; + $command .= ' '.join( ' ', ( @args ) ) if ( @args ); + my $process = $cmd_hash{$command}; + if ( $process ) + { + if ( $process->{pid} ) + { + kill( 'HUP', $process->{pid} ); + } + } +} + +sub logrot +{ + logReinit(); + foreach my $process ( values( %pid_hash ) ) + { + if ( $process->{pid} && $process->{command} =~ /^zm.*\.pl/ ) + { + kill( 'HUP', $process->{pid} ); + } + } +} + +sub reaper +{ + my $saved_status = $!; + while ( (my $cpid = waitpid( -1, WNOHANG )) > 0 ) + { + my $status = $?; + + my $process = $pid_hash{$cpid}; + delete( $pid_hash{$cpid} ); + + if ( !$process ) + { + dPrint( ZoneMinder::Logger::INFO, "Can't find child with pid of '$cpid'\n" ); + next; + } + + $process->{stopped} = time(); + $process->{runtime} = ($process->{stopped}-$process->{started}); + delete( $process->{pid} ); + + my $exit_status = $status>>8; + my $exit_signal = $status&0xfe; + my $core_dumped = $status&0x01; + + my $out_str = "'$process->{daemon} ".join( ' ', @{$process->{args}} )."' "; + if ( $exit_signal ) + { + if ( $exit_signal == 15 || $exit_signal == 14 ) # TERM or ALRM + { + $out_str .= "exited"; + } + else + { + $out_str .= "crashed"; + } + $out_str .= ", signal $exit_signal"; + } + else + { + $out_str .= "exited "; + if ( $exit_status ) + { + $out_str .= "abnormally, exit status $exit_status"; + } + else + { + $out_str .= "normally"; + } + } + #print( ", core dumped" ) if ( $core_dumped ); + $out_str .= "\n"; + + if ( $exit_status == 0 ) + { + Info( $out_str ); + } + else + { + Error( $out_str ); + } + + if ( $process->{keepalive} ) + { + if ( !$process->{delay} || ($process->{runtime} > ZM_MAX_RESTART_DELAY) ) + { + #start( $process->{daemon}, @{$process->{args}} ); + # Schedule for immediate restart + $cmd_hash{$process->{command}} = $process; + $process->{pending} = $process->{stopped}; + $process->{delay} = 5; + } + else + { + $cmd_hash{$process->{command}} = $process; + $process->{pending} = $process->{stopped}+$process->{delay}; + $process->{delay} *= 2; + # Limit the start delay to 15 minutes max + if ( $process->{delay} > ZM_MAX_RESTART_DELAY ) + { + $process->{delay} = ZM_MAX_RESTART_DELAY; + } + } + } + } + $SIG{CHLD} = \&reaper; + $! = $saved_status; +} + +sub restartPending +{ + # Restart any pending processes + foreach my $process ( values( %cmd_hash ) ) + { + if ( $process->{pending} && $process->{pending} <= time() ) + { + dPrint( ZoneMinder::Logger::INFO, "Starting pending process, $process->{command}\n" ); + start( $process->{daemon}, @{$process->{args}} ); + } + } +} + +sub shutdownAll +{ + foreach my $process ( values( %pid_hash ) ) + { + stop( $process->{daemon}, @{$process->{args}} ); + } + killAll( 5 ); + dPrint( ZoneMinder::Logger::INFO, "Server shutdown at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); + unlink( main::SOCK_FILE ); + unlink( ZM_PID ); + close( CLIENT ); + close( SERVER ); + exit(); +} + +sub check +{ + my $daemon = shift; + my @args = @_; + + my $command = $daemon; + $command .= ' '.join( ' ', ( @args ) ) if ( @args ); + my $process = $cmd_hash{$command}; + if ( !$process ) + { + cPrint( "unknown\n" ); + } + elsif ( $process->{pending} ) + { + cPrint( "pending\n" ); + } + else + { + my $cpid = $process->{pid}; + if ( !$pid_hash{$cpid} ) + { + cPrint( "stopped\n" ); + } + else + { + cPrint( "running\n" ); + } + } +} + +sub status +{ + my $daemon = shift; + my @args = @_; + + if ( defined($daemon) ) + { + my $command = $daemon; + $command .= ' '.join( ' ', ( @args ) ) if ( @args ); + my $process = $cmd_hash{$command}; + if ( !$process ) + { + dPrint( ZoneMinder::Logger::DEBUG, "'$command' not running\n" ); + return(); + } + + if ( $process->{pending} ) + { + dPrint( ZoneMinder::Logger::DEBUG, "'$process->{command}' pending at ".strftime( '%y/%m/%d %H:%M:%S', localtime( $process->{pending}) )."\n" ); + } + else + { + my $cpid = $process->{pid}; + if ( !$pid_hash{$cpid} ) + { + dPrint( ZoneMinder::Logger::DEBUG, "'$command' not running\n" ); + return(); + } + } + dPrint( ZoneMinder::Logger::DEBUG, "'$process->{command}' running since ".strftime( '%y/%m/%d %H:%M:%S', localtime( $process->{started}) ).", pid = $process->{pid}" ); + } + else + { + foreach my $process ( values(%pid_hash) ) + { + my $out_str = "'$process->{command}' running since ".strftime( '%y/%m/%d %H:%M:%S', localtime( $process->{started}) ).", pid = $process->{pid}"; + $out_str .= ", valid" if ( kill( 0, $process->{pid} ) ); + $out_str .= "\n"; + dPrint( ZoneMinder::Logger::DEBUG, $out_str ); + } + foreach my $process ( values( %cmd_hash ) ) + { + if ( $process->{pending} ) + { + dPrint( ZoneMinder::Logger::DEBUG, "'$process->{command}' pending at ".strftime( '%y/%m/%d %H:%M:%S', localtime( $process->{pending}) )."\n" ); + } + } + } +} + +sub killAll +{ + my $delay = shift; + sleep( $delay ); + foreach my $daemon ( @daemons ) + { + my $cmd = "killall --quiet --signal TERM $daemon"; + Debug( $cmd ); + qx( $cmd ); + } + sleep( $delay ); + foreach my $daemon ( @daemons ) + { + my $cmd = "killall --quiet --signal KILL $daemon"; + Debug( $cmd ); + qx( $cmd ); + } +} diff --git a/scripts/zmdc.pl.in b/scripts/zmdc.pl.in new file mode 100644 index 000000000..47e50cc39 --- /dev/null +++ b/scripts/zmdc.pl.in @@ -0,0 +1,798 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder Daemon Control Script, $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. +# +# ========================================================================== +# +# This script is the gateway for controlling the various ZoneMinder +# daemons. All starting, stopping and restarting goes through here. +# On the first invocation it starts up a server which subsequently +# records what's running and what's not. Other invocations just +# connect to the server and pass instructions to it. +# +use strict; +use bytes; + +# ========================================================================== +# +# User config +# +# ========================================================================== + +use constant MAX_CONNECT_DELAY => 10; + +# ========================================================================== +# +# Don't change anything from here on down +# +# ========================================================================== + +@EXTRA_PERL_LIB@ +use ZoneMinder; +use POSIX; +use Socket; +use IO::Handle; +use Data::Dumper; + +use constant SOCK_FILE => ZM_PATH_SOCKS.'/zmdc.sock'; + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +my @daemons = ( + 'zmc', + 'zma', + 'zmf', + 'zmfilter.pl', + 'zmaudit.pl', + 'zmtrigger.pl', + 'zmx10.pl', + 'zmwatch.pl', + 'zmupdate.pl', + 'zmtrack.pl' +); + +sub Usage +{ + print( " +Usage: zmdc.pl [daemon [options]] +Parameters are :- + - One of 'startup|shutdown|status|check|logrot' or + 'start|stop|restart|reload'. +[daemon [options]] - Daemon name and options, required for second group of commands +"); + exit( -1 ); +} + +my $command = shift @ARGV; +if( !$command ) +{ + print( STDERR "No command given\n" ); + Usage(); +} +my $needs_daemon = $command !~ /(?:startup|shutdown|status|check|logrot)/; +my $daemon = shift( @ARGV ); +if( $needs_daemon && !$daemon ) +{ + print( STDERR "No daemon given\n" ); + Usage(); +} +my @args; + +my $daemon_patt = '('.join( '|', @daemons ).')'; +if ( $needs_daemon ) +{ + if ( $daemon =~ /^${daemon_patt}$/ ) + { + $daemon = $1; + } + else + { + print( STDERR "Invalid daemon '$daemon' specified" ); + Usage(); + } +} + +foreach my $arg ( @ARGV ) +{ + # Detaint arguments, if they look ok + #if ( $arg =~ /^(-{0,2}[\w]+)/ ) + if ( $arg =~ /^(-{0,2}[\w\/?&=.-]+)$/ ) + { + push( @args, $1 ); + } + else + { + print( STDERR "Bogus argument '$arg' found" ); + exit( -1 ); + } +} + +socket( CLIENT, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" ); + +my $saddr = sockaddr_un( SOCK_FILE ); +my $server_up = connect( CLIENT, $saddr ); +if ( !$server_up ) +{ + if ( $command eq "logrot" ) + { + exit(); + } + if ( $command eq "check" ) + { + print( "stopped\n" ); + exit(); + } + elsif ( $command ne "startup" ) + { + print( "Unable to connect to server\n" ); + exit( -1 ); + } + # The server isn't there + print( "Starting server\n" ); + close( CLIENT ); + + if ( my $cpid = fork() ) + { + logInit(); + + # Parent process just sleep and fall through + socket( CLIENT, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" ); + my $attempts = 0; + while (!connect( CLIENT, $saddr )) + { + $attempts++; + Fatal( "Can't connect: $!" ) if ($attempts > MAX_CONNECT_DELAY); + sleep(1); + } + } + elsif ( defined($cpid) ) + { + ZMServer::run(); + } + else + { + Fatal( "Can't fork: $!" ); + } +} +if ( $command eq "check" && !$daemon ) +{ + print( "running\n" ); + exit(); +} +elsif ( $command eq "startup" ) +{ + # Our work here is done + exit() if ( !$server_up ); +} +# The server is there, connect to it +#print( "Writing commands\n" ); +CLIENT->autoflush(); +my $message = "$command"; +$message .= ";$daemon" if ( $daemon ); +$message .= ";".join( ';', @args ) if ( @args ); +print( CLIENT $message ); +shutdown( CLIENT, 1 ); +while ( my $line = ) +{ + chomp( $line ); + print( "$line\n" ); +} +# And we're done! +close( CLIENT ); +#print( "Finished writing, bye\n" ); + +exit; + +package ZMServer; + +use strict; +use bytes; + +@EXTRA_PERL_LIB@ +use ZoneMinder; +use POSIX; +use Socket; +use IO::Handle; +use Data::Dumper; + +our %cmd_hash; +our %pid_hash; + +sub run +{ + my $fd = 0; + while( $fd < POSIX::sysconf( &POSIX::_SC_OPEN_MAX ) ) + { + POSIX::close( $fd++ ); + } + + setpgrp(); + + logInit(); + + dPrint( ZoneMinder::Logger::INFO, "Server starting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); + + if ( open( PID, ">".ZM_PID ) ) + { + print( PID $$ ); + close( PID ); + } + + killAll( 1 ); + + socket( SERVER, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" ); + unlink( main::SOCK_FILE ); + bind( SERVER, $saddr ) or Fatal( "Can't bind: $!" ); + listen( SERVER, SOMAXCONN ) or Fatal( "Can't listen: $!" ); + + $SIG{CHLD} = \&reaper; + $SIG{INT} = \&shutdownAll; + $SIG{TERM} = \&shutdownAll; + $SIG{ABRT} = \&shutdownAll; + $SIG{HUP} = \&logrot; + + my $rin = ''; + vec( $rin, fileno(SERVER), 1 ) = 1; + my $win = $rin; + my $ein = $win; + my $timeout = 0.1; + while( 1 ) + { + my $nfound = select( my $rout = $rin, undef, undef, $timeout ); + if ( $nfound > 0 ) + { + if ( vec( $rout, fileno(SERVER), 1 ) ) + { + my $paddr = accept( CLIENT, SERVER ); + my $message = ; + + next if ( !$message ); + + my ( $command, $daemon, @args ) = split( /;/, $message ); + + if ( $command eq 'start' ) + { + start( $daemon, @args ); + } + elsif ( $command eq 'stop' ) + { + stop( $daemon, @args ); + } + elsif ( $command eq 'restart' ) + { + restart( $daemon, @args ); + } + elsif ( $command eq 'reload' ) + { + reload( $daemon, @args ); + } + elsif ( $command eq 'startup' ) + { + # Do nothing, this is all we're here for + dPrint( ZoneMinder::Logger::WARNING, "Already running, ignoring command '$command'\n" ); + } + elsif ( $command eq 'shutdown' ) + { + shutdownAll(); + } + elsif ( $command eq 'check' ) + { + check( $daemon, @args ); + } + elsif ( $command eq 'status' ) + { + if ( $daemon ) + { + status( $daemon, @args ); + } + else + { + status(); + } + } + elsif ( $command eq 'logrot' ) + { + logrot(); + } + else + { + dPrint( ZoneMinder::Logger::ERROR, "Invalid command '$command'\n" ); + } + close( CLIENT ); + } + else + { + Fatal( "Bogus descriptor" ); + } + } + elsif ( $nfound < 0 ) + { + if ( $! == EINTR ) + { + # Dead child, will be reaped + #print( "Probable dead child\n" ); + # See if it needs to start up again + restartPending(); + } + elsif ( $! == EPIPE ) + { + Error( "Can't select: $!" ); + } + else + { + Fatal( "Can't select: $!" ); + } + } + else + { + #print( "Select timed out\n" ); + restartPending(); + } + } + dPrint( ZoneMinder::Logger::INFO, "Server exiting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); + unlink( main::SOCK_FILE ); + unlink( ZM_PID ); + exit(); +} + +sub cPrint +{ + if ( fileno(CLIENT) ) + { + print CLIENT @_ + } +} + +sub dPrint +{ + my $logLevel = shift; + if ( fileno(CLIENT) ) + { + print CLIENT @_ + } + if ( $logLevel == ZoneMinder::Logger::DEBUG ) + { + Debug( @_ ); + } + elsif ( $logLevel == ZoneMinder::Logger::INFO ) + { + Info( @_ ); + } + elsif ( $logLevel == ZoneMinder::Logger::WARNING ) + { + Warning( @_ ); + } + elsif ( $logLevel == ZoneMinder::Logger::ERROR ) + { + Error( @_ ); + } + elsif ( $logLevel == ZoneMinder::Logger::FATAL ) + { + Fatal( @_ ); + } +} + +sub start +{ + my $daemon = shift; + my @args = @_; + + my $command = $daemon; + $command .= ' '.join( ' ', ( @args ) ) if ( @args ); + my $process = $cmd_hash{$command}; + + if ( !$process ) + { + # It's not running, or at least it's not been started by us + $process = { daemon=>$daemon, args=>\@args, command=>$command, keepalive=>!undef }; + } + elsif ( $process->{pid} && $pid_hash{$process->{pid}} ) + { + dPrint( ZoneMinder::Logger::INFO, "'$process->{command}' already running at ".strftime( '%y/%m/%d %H:%M:%S', localtime( $process->{started}) ).", pid = $process->{pid}\n" ); + return(); + } + + my $sigset = POSIX::SigSet->new; + my $blockset = POSIX::SigSet->new( SIGCHLD ); + sigprocmask( SIG_BLOCK, $blockset, $sigset ) or Fatal( "Can't block SIGCHLD: $!" ); + if ( my $cpid = fork() ) + { + logReinit(); + + $process->{pid} = $cpid; + $process->{started} = time(); + delete( $process->{pending} ); + + dPrint( ZoneMinder::Logger::INFO, "'$command' starting at ".strftime( '%y/%m/%d %H:%M:%S', localtime( $process->{started}) ).", pid = $process->{pid}\n" ); + + $cmd_hash{$process->{command}} = $pid_hash{$cpid} = $process; + sigprocmask( SIG_SETMASK, $sigset ) or Fatal( "Can't restore SIGCHLD: $!" ); + } + elsif ( defined($cpid ) ) + { + logReinit(); + + dPrint( ZoneMinder::Logger::INFO, "'".join( ' ', ( $daemon, @args ) )."' started at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); + + if ( $daemon =~ /^${daemon_patt}$/ ) + { + $daemon = ZM_PATH_BIN.'/'.$1; + } + else + { + Fatal( "Invalid daemon '$daemon' specified" ); + } + + my @good_args; + foreach my $arg ( @args ) + { + # Detaint arguments, if they look ok + if ( $arg =~ /^(-{0,2}[\w\/?&=.-]+)$/ ) + { + push( @good_args, $1 ); + } + else + { + Fatal( "Bogus argument '$arg' found" ); + } + } + + logTerm(); + + my $fd = 0; + while( $fd < POSIX::sysconf( &POSIX::_SC_OPEN_MAX ) ) + { + POSIX::close( $fd++ ); + } + + # Child process + $SIG{CHLD} = 'DEFAULT'; + $SIG{INT} = 'DEFAULT'; + $SIG{TERM} = 'DEFAULT'; + $SIG{ABRT} = 'DEFAULT'; + + exec( $daemon, @good_args ) or Fatal( "Can't exec: $!" ); + } + else + { + Fatal( "Can't fork: $!" ); + } +} + +sub _stop +{ + my $final = shift; + my $daemon = shift; + my @args = @_; + + my $command = $daemon; + $command .= ' '.join( ' ', ( @args ) ) if ( @args ); + my $process = $cmd_hash{$command}; + if ( !$process ) + { + dPrint( ZoneMinder::Logger::WARNING, "Can't find process with command of '$command'\n" ); + return(); + } + elsif ( $process->{pending} ) + { + delete( $cmd_hash{$command} ); + dPrint( ZoneMinder::Logger::INFO, "Command '$command' removed from pending list at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); + return(); + } + + my $cpid = $process->{pid}; + if ( !$pid_hash{$cpid} ) + { + dPrint( ZoneMinder::Logger::ERROR, "No process with command of '$command' is running\n" ); + return(); + } + + dPrint( ZoneMinder::Logger::INFO, "'$daemon ".join( ' ', @args )."' stopping at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); + $process->{keepalive} = !$final; + kill( 'TERM', $cpid ); + delete( $cmd_hash{$command} ); + + # Now check it has actually gone away, if not kill -9 it + my $count = 0; + while( $cpid && kill( 0, $cpid ) ) + { + if ( $count++ > 5 ) + { + kill( 'KILL', $cpid ); + } + sleep( 1 ); + } +} + +sub stop +{ + _stop( 1, @_ ); +} + +sub restart +{ + my $daemon = shift; + my @args = @_; + + my $command = $daemon; + $command .= ' '.join( ' ', ( @args ) ) if ( @args ); + my $process = $cmd_hash{$command}; + if ( $process ) + { + if ( $process->{pid} ) + { + my $cpid = $process->{pid}; + if ( defined($pid_hash{$cpid}) ) + { + _stop( 0, $daemon, @args ); + return; + } + } + } + start( $daemon, @args ); +} + +sub reload +{ + my $daemon = shift; + my @args = @_; + + my $command = $daemon; + $command .= ' '.join( ' ', ( @args ) ) if ( @args ); + my $process = $cmd_hash{$command}; + if ( $process ) + { + if ( $process->{pid} ) + { + kill( 'HUP', $process->{pid} ); + } + } +} + +sub logrot +{ + logReinit(); + foreach my $process ( values( %pid_hash ) ) + { + if ( $process->{pid} && $process->{command} =~ /^zm.*\.pl/ ) + { + kill( 'HUP', $process->{pid} ); + } + } +} + +sub reaper +{ + my $saved_status = $!; + while ( (my $cpid = waitpid( -1, WNOHANG )) > 0 ) + { + my $status = $?; + + my $process = $pid_hash{$cpid}; + delete( $pid_hash{$cpid} ); + + if ( !$process ) + { + dPrint( ZoneMinder::Logger::INFO, "Can't find child with pid of '$cpid'\n" ); + next; + } + + $process->{stopped} = time(); + $process->{runtime} = ($process->{stopped}-$process->{started}); + delete( $process->{pid} ); + + my $exit_status = $status>>8; + my $exit_signal = $status&0xfe; + my $core_dumped = $status&0x01; + + my $out_str = "'$process->{daemon} ".join( ' ', @{$process->{args}} )."' "; + if ( $exit_signal ) + { + if ( $exit_signal == 15 || $exit_signal == 14 ) # TERM or ALRM + { + $out_str .= "exited"; + } + else + { + $out_str .= "crashed"; + } + $out_str .= ", signal $exit_signal"; + } + else + { + $out_str .= "exited "; + if ( $exit_status ) + { + $out_str .= "abnormally, exit status $exit_status"; + } + else + { + $out_str .= "normally"; + } + } + #print( ", core dumped" ) if ( $core_dumped ); + $out_str .= "\n"; + + if ( $exit_status == 0 ) + { + Info( $out_str ); + } + else + { + Error( $out_str ); + } + + if ( $process->{keepalive} ) + { + if ( !$process->{delay} || ($process->{runtime} > ZM_MAX_RESTART_DELAY) ) + { + #start( $process->{daemon}, @{$process->{args}} ); + # Schedule for immediate restart + $cmd_hash{$process->{command}} = $process; + $process->{pending} = $process->{stopped}; + $process->{delay} = 5; + } + else + { + $cmd_hash{$process->{command}} = $process; + $process->{pending} = $process->{stopped}+$process->{delay}; + $process->{delay} *= 2; + # Limit the start delay to 15 minutes max + if ( $process->{delay} > ZM_MAX_RESTART_DELAY ) + { + $process->{delay} = ZM_MAX_RESTART_DELAY; + } + } + } + } + $SIG{CHLD} = \&reaper; + $! = $saved_status; +} + +sub restartPending +{ + # Restart any pending processes + foreach my $process ( values( %cmd_hash ) ) + { + if ( $process->{pending} && $process->{pending} <= time() ) + { + dPrint( ZoneMinder::Logger::INFO, "Starting pending process, $process->{command}\n" ); + start( $process->{daemon}, @{$process->{args}} ); + } + } +} + +sub shutdownAll +{ + foreach my $process ( values( %pid_hash ) ) + { + stop( $process->{daemon}, @{$process->{args}} ); + } + killAll( 5 ); + dPrint( ZoneMinder::Logger::INFO, "Server shutdown at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); + unlink( main::SOCK_FILE ); + unlink( ZM_PID ); + close( CLIENT ); + close( SERVER ); + exit(); +} + +sub check +{ + my $daemon = shift; + my @args = @_; + + my $command = $daemon; + $command .= ' '.join( ' ', ( @args ) ) if ( @args ); + my $process = $cmd_hash{$command}; + if ( !$process ) + { + cPrint( "unknown\n" ); + } + elsif ( $process->{pending} ) + { + cPrint( "pending\n" ); + } + else + { + my $cpid = $process->{pid}; + if ( !$pid_hash{$cpid} ) + { + cPrint( "stopped\n" ); + } + else + { + cPrint( "running\n" ); + } + } +} + +sub status +{ + my $daemon = shift; + my @args = @_; + + if ( defined($daemon) ) + { + my $command = $daemon; + $command .= ' '.join( ' ', ( @args ) ) if ( @args ); + my $process = $cmd_hash{$command}; + if ( !$process ) + { + dPrint( ZoneMinder::Logger::DEBUG, "'$command' not running\n" ); + return(); + } + + if ( $process->{pending} ) + { + dPrint( ZoneMinder::Logger::DEBUG, "'$process->{command}' pending at ".strftime( '%y/%m/%d %H:%M:%S', localtime( $process->{pending}) )."\n" ); + } + else + { + my $cpid = $process->{pid}; + if ( !$pid_hash{$cpid} ) + { + dPrint( ZoneMinder::Logger::DEBUG, "'$command' not running\n" ); + return(); + } + } + dPrint( ZoneMinder::Logger::DEBUG, "'$process->{command}' running since ".strftime( '%y/%m/%d %H:%M:%S', localtime( $process->{started}) ).", pid = $process->{pid}" ); + } + else + { + foreach my $process ( values(%pid_hash) ) + { + my $out_str = "'$process->{command}' running since ".strftime( '%y/%m/%d %H:%M:%S', localtime( $process->{started}) ).", pid = $process->{pid}"; + $out_str .= ", valid" if ( kill( 0, $process->{pid} ) ); + $out_str .= "\n"; + dPrint( ZoneMinder::Logger::DEBUG, $out_str ); + } + foreach my $process ( values( %cmd_hash ) ) + { + if ( $process->{pending} ) + { + dPrint( ZoneMinder::Logger::DEBUG, "'$process->{command}' pending at ".strftime( '%y/%m/%d %H:%M:%S', localtime( $process->{pending}) )."\n" ); + } + } + } +} + +sub killAll +{ + my $delay = shift; + sleep( $delay ); + foreach my $daemon ( @daemons ) + { + my $cmd = "killall --quiet --signal TERM $daemon"; + Debug( $cmd ); + qx( $cmd ); + } + sleep( $delay ); + foreach my $daemon ( @daemons ) + { + my $cmd = "killall --quiet --signal KILL $daemon"; + Debug( $cmd ); + qx( $cmd ); + } +} diff --git a/scripts/zmeventdump b/scripts/zmeventdump new file mode 100644 index 000000000..074b38ed4 --- /dev/null +++ b/scripts/zmeventdump @@ -0,0 +1,50 @@ +#!/bin/bash +#=============================================================================== +# +# FILE: zmeventdump +# +# USAGE: ./zmeventdump +# +# DESCRIPTION: Uses mysqldump to create a .sql file for individual zm +# events to make Event table recovery possible by doing a +# 'find' search in ZoneMinder the events directory +# +# OPTIONS: --- None +# REQUIREMENTS: --- mysqldump +# BUGS: --- +# NOTES: --- +# AUTHOR: Ross Melin +# COMPANY: +# VERSION: 3.0 +# CREATED: 02/27/2008 05:39:00 PM PST +# REVISION: --- Update for changed zmfilter and +# ZM_USE_DEEP_STORAGE +#=============================================================================== + +# Edit these to suit your configuration +ZM_CONFIG=/etc/zm/zm.conf +MYSQLDUMP=/usr/bin/mysqldump + +# The rest should not need editing + +# Get the mysql user and password +source $ZM_CONFIG + +# zmfilter now passes the full path as an argument +EVENT_PATH=$1 + +# Get the event id from a filename in the event directory +EVENT_ID=$(ls $1/.[0-9]* | sed s:$1\/\.::) + +MYDUMPOPTS="--user=$ZM_DB_USER --password=$ZM_DB_PASS --skip-opt --compact --quick --no-create-info" + +# Dump the sql statements needed to reload the Events, Frames and Stats tables + +echo "-- ZM_DB_VERSION=$ZM_VERSION + " > $EVENT_PATH/.sql + +$MYSQLDUMP $MYDUMPOPTS --where="Id=$EVENT_ID" zm Events >> $EVENT_PATH/.sql +$MYSQLDUMP $MYDUMPOPTS --where="Eventid=$EVENT_ID" zm Frames >> $EVENT_PATH/.sql +$MYSQLDUMP $MYDUMPOPTS --where="Eventid=$EVENT_ID" zm Stats >> $EVENT_PATH/.sql + +exit 0 diff --git a/scripts/zmeventdump.in b/scripts/zmeventdump.in new file mode 100644 index 000000000..342b665b0 --- /dev/null +++ b/scripts/zmeventdump.in @@ -0,0 +1,50 @@ +#!/bin/bash +#=============================================================================== +# +# FILE: zmeventdump +# +# USAGE: ./zmeventdump +# +# DESCRIPTION: Uses mysqldump to create a .sql file for individual zm +# events to make Event table recovery possible by doing a +# 'find' search in ZoneMinder the events directory +# +# OPTIONS: --- None +# REQUIREMENTS: --- mysqldump +# BUGS: --- +# NOTES: --- +# AUTHOR: Ross Melin +# COMPANY: +# VERSION: 3.0 +# CREATED: 02/27/2008 05:39:00 PM PST +# REVISION: --- Update for changed zmfilter and +# ZM_USE_DEEP_STORAGE +#=============================================================================== + +# Edit these to suit your configuration +ZM_CONFIG=@ZM_CONFIG@ +MYSQLDUMP=/usr/bin/mysqldump + +# The rest should not need editing + +# Get the mysql user and password +source $ZM_CONFIG + +# zmfilter now passes the full path as an argument +EVENT_PATH=$1 + +# Get the event id from a filename in the event directory +EVENT_ID=$(ls $1/.[0-9]* | sed s:$1\/\.::) + +MYDUMPOPTS="--user=$ZM_DB_USER --password=$ZM_DB_PASS --skip-opt --compact --quick --no-create-info" + +# Dump the sql statements needed to reload the Events, Frames and Stats tables + +echo "-- ZM_DB_VERSION=$ZM_VERSION + " > $EVENT_PATH/.sql + +$MYSQLDUMP $MYDUMPOPTS --where="Id=$EVENT_ID" zm Events >> $EVENT_PATH/.sql +$MYSQLDUMP $MYDUMPOPTS --where="Eventid=$EVENT_ID" zm Frames >> $EVENT_PATH/.sql +$MYSQLDUMP $MYDUMPOPTS --where="Eventid=$EVENT_ID" zm Stats >> $EVENT_PATH/.sql + +exit 0 diff --git a/scripts/zmfilter.pl b/scripts/zmfilter.pl new file mode 100644 index 000000000..f3d906685 --- /dev/null +++ b/scripts/zmfilter.pl @@ -0,0 +1,1169 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder Event Filter Script, $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. +# +# ========================================================================== +# +# This script continuously monitors the recorded events for the given +# monitor and applies any filters which would delete and/or upload +# matching events +# +use strict; +use bytes; + +# ========================================================================== +# +# These are the elements you can edit to suit your installation +# +# ========================================================================== + +use constant START_DELAY => 5; # How long to wait before starting + +# ========================================================================== +# +# You shouldn't need to change anything from here downwards +# +# ========================================================================== + +use lib '/usr/share/perl/5.14.2'; # Include custom perl install path +use ZoneMinder; +use DBI; +use POSIX; +use Time::HiRes qw/gettimeofday/; +use Date::Manip; +use Getopt::Long; +use Data::Dumper; + +use constant EVENT_PATH => (ZM_DIR_EVENTS=~m|/|)?ZM_DIR_EVENTS:(ZM_PATH_WEB.'/'.ZM_DIR_EVENTS); + +logInit(); +logSetSignal(); + +if ( ZM_OPT_UPLOAD ) +{ + # Comment these out if you don't have them and don't want to upload + # or don't want to use that format + if ( ZM_UPLOAD_ARCH_FORMAT eq "zip" ) + { + require Archive::Zip; + import Archive::Zip qw( :ERROR_CODES :CONSTANTS ); + } + else + { + require Archive::Tar; + } + if ( ZM_UPLOAD_PROTOCOL eq "ftp" ) + { + require Net::FTP; + } + else + { + require Net::SFTP::Foreign; + } +} + +if ( ZM_OPT_EMAIL ) +{ + if ( ZM_NEW_MAIL_MODULES ) + { + require MIME::Lite; + require Net::SMTP; + } + else + { + require MIME::Entity; + } +} + +if ( ZM_OPT_MESSAGE ) +{ + if ( ZM_NEW_MAIL_MODULES ) + { + require MIME::Lite; + require Net::SMTP; + } + else + { + require MIME::Entity; + } +} + + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +my $delay = ZM_FILTER_EXECUTE_INTERVAL; +my $event_id = 0; +my $filter_parm = ""; + +sub Usage +{ + print( " +Usage: zmfilter.pl [-f ,--filter=] +Parameters are :- +-f, --filter= - The name of a specific filter to run +"); + exit( -1 ); +} + +# +# More or less replicates the equivalent PHP function +# +sub strtotime +{ + my $dt_str = shift; + return( UnixDate( $dt_str, '%s' ) ); +} + +# +# More or less replicates the equivalent PHP function +# +sub str_repeat +{ + my $string = shift; + my $count = shift; + return( ${string}x${count} ); +} + +# Formats a date into MySQL format +sub DateTimeToSQL +{ + my $dt_str = shift; + my $dt_val = strtotime( $dt_str ); + if ( !$dt_val ) + { + Error( "Unable to parse date string '$dt_str'\n" ); + return( undef ); + } + return( strftime( "%Y-%m-%d %H:%M:%S", localtime( $dt_val ) ) ); +} + +if ( !GetOptions( 'filter=s'=>\$filter_parm ) ) +{ + Usage(); +} + +chdir( EVENT_PATH ); + +my $dbh = zmDbConnect(); + +if ( $filter_parm ) +{ + Info( "Scanning for events using filter '$filter_parm'\n" ); +} +else +{ + Info( "Scanning for events\n" ); +} + +if ( !$filter_parm ) +{ + sleep( START_DELAY ); +} + +my $filters; +my $last_action = 0; + +while( 1 ) +{ + if ( (time() - $last_action) > ZM_FILTER_RELOAD_DELAY ) + { + Debug( "Reloading filters\n" ); + $last_action = time(); + $filters = getFilters( $filter_parm ); + } + + foreach my $filter ( @$filters ) + { + checkFilter( $filter ); + } + + last if ( $filter_parm ); + + Debug( "Sleeping for $delay seconds\n" ); + sleep( $delay ); +} + +sub getDiskPercent +{ + my $command = "df ."; + my $df = qx( $command ); + my $space = -1; + if ( $df =~ /\s(\d+)%/ms ) + { + $space = $1; + } + return( $space ); +} + +sub getDiskBlocks +{ + my $command = "df ."; + my $df = qx( $command ); + my $space = -1; + if ( $df =~ /\s(\d+)\s+\d+\s+\d+%/ms ) + { + $space = $1; + } + return( $space ); +} + +sub getLoad +{ + my $command = "uptime ."; + my $uptime = qx( $command ); + my $load = -1; + if ( $uptime =~ /load average:\s+([\d.]+)/ms ) + { + $load = $1; + Info( "Load: $load" ); + } + return( $load ); +} + +sub getFilters +{ + my $filter_name = shift; + + my @filters; + my $sql = "select * from Filters where"; + if ( $filter_name ) + { + $sql .= " Name = ? and"; + } + else + { + $sql .= " Background = 1 and"; + } + $sql .= " (AutoArchive = 1 or AutoVideo = 1 or AutoUpload = 1 or AutoEmail = 1 or AutoMessage = 1 or AutoExecute = 1 or AutoDelete = 1) order by Name"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res; + if ( $filter_name ) + { + $res = $sth->execute( $filter_name ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + } + else + { + $res = $sth->execute() or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + } + FILTER: while( my $db_filter = $sth->fetchrow_hashref() ) + { + Debug( "Found filter '$db_filter->{Name}'\n" ); + my $filter_expr = jsonDecode( $db_filter->{Query} ); + my $sql = "select E.Id,E.MonitorId,M.Name as MonitorName,M.DefaultRate,M.DefaultScale,E.Name,E.Cause,E.Notes,E.StartTime,unix_timestamp(E.StartTime) as Time,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived,E.Videoed,E.Uploaded,E.Emailed,E.Messaged,E.Executed from Events as E inner join Monitors as M on M.Id = E.MonitorId where not isnull(E.EndTime)"; + $db_filter->{Sql} = ''; + + if ( @{$filter_expr->{terms}} ) + { + for ( my $i = 0; $i < @{$filter_expr->{terms}}; $i++ ) + { + if ( exists($filter_expr->{terms}[$i]->{cnj}) ) + { + $db_filter->{Sql} .= " ".$filter_expr->{terms}[$i]->{cnj}." "; + } + if ( exists($filter_expr->{terms}[$i]->{obr}) ) + { + $db_filter->{Sql} .= " ".str_repeat( "(", $filter_expr->{terms}[$i]->{obr} )." "; + } + my $value = $filter_expr->{terms}[$i]->{val}; + my @value_list; + if ( $filter_expr->{terms}[$i]->{attr} ) + { + if ( $filter_expr->{terms}[$i]->{attr} =~ /^Monitor/ ) + { + my ( $temp_attr_name ) = $filter_expr->{terms}[$i]->{attr} =~ /^Monitor(.+)$/; + $db_filter->{Sql} .= "M.".$temp_attr_name; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'DateTime' ) + { + $db_filter->{Sql} .= "E.StartTime"; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'Date' ) + { + $db_filter->{Sql} .= "to_days( E.StartTime )"; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'Time' ) + { + $db_filter->{Sql} .= "extract( hour_second from E.StartTime )"; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'Weekday' ) + { + $db_filter->{Sql} .= "weekday( E.StartTime )"; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'DiskPercent' ) + { + $db_filter->{Sql} .= "zmDiskPercent"; + $db_filter->{HasDiskPercent} = !undef; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'DiskBlocks' ) + { + $db_filter->{Sql} .= "zmDiskBlocks"; + $db_filter->{HasDiskBlocks} = !undef; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'SystemLoad' ) + { + $db_filter->{Sql} .= "zmSystemLoad"; + $db_filter->{HasSystemLoad} = !undef; + } + else + { + $db_filter->{Sql} .= "E.".$filter_expr->{terms}[$i]->{attr}; + } + + ( my $stripped_value = $value ) =~ s/^["\']+?(.+)["\']+?$/$1/; + foreach my $temp_value ( split( /["'\s]*?,["'\s]*?/, $stripped_value ) ) + { + if ( $filter_expr->{terms}[$i]->{attr} =~ /^Monitor/ ) + { + $value = "'$temp_value'"; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'Name' || $filter_expr->{terms}[$i]->{attr} eq 'Cause' || $filter_expr->{terms}[$i]->{attr} eq 'Notes' ) + { + $value = "'$temp_value'"; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'DateTime' ) + { + $value = DateTimeToSQL( $temp_value ); + if ( !$value ) + { + Error( "Error parsing date/time '$temp_value', skipping filter '$db_filter->{Name}'\n" ); + next FILTER; + } + $value = "'$value'"; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'Date' ) + { + $value = DateTimeToSQL( $temp_value ); + if ( !$value ) + { + Error( "Error parsing date/time '$temp_value', skipping filter '$db_filter->{Name}'\n" ); + next FILTER; + } + $value = "to_days( '$value' )"; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'Time' ) + { + $value = DateTimeToSQL( $temp_value ); + if ( !$value ) + { + Error( "Error parsing date/time '$temp_value', skipping filter '$db_filter->{Name}'\n" ); + next FILTER; + } + $value = "extract( hour_second from '$value' )"; + } + else + { + $value = $temp_value; + } + push( @value_list, $value ); + } + } + if ( $filter_expr->{terms}[$i]->{op} ) + { + if ( $filter_expr->{terms}[$i]->{op} eq '=~' ) + { + $db_filter->{Sql} .= " regexp $value"; + } + elsif ( $filter_expr->{terms}[$i]->{op} eq '!~' ) + { + $db_filter->{Sql} .= " not regexp $value"; + } + elsif ( $filter_expr->{terms}[$i]->{op} eq '=[]' ) + { + $db_filter->{Sql} .= " in (".join( ",", @value_list ).")"; + } + elsif ( $filter_expr->{terms}[$i]->{op} eq '!~' ) + { + $db_filter->{Sql} .= " not in (".join( ",", @value_list ).")"; + } + else + { + $db_filter->{Sql} .= " ".$filter_expr->{terms}[$i]->{op}." $value"; + } + } + if ( exists($filter_expr->{terms}[$i]->{cbr}) ) + { + $db_filter->{Sql} .= " ".str_repeat( ")", $filter_expr->{terms}[$i]->{cbr} )." "; + } + } + } + if ( $db_filter->{Sql} ) + { + $sql .= " and ( ".$db_filter->{Sql}." )"; + } + my @auto_terms; + if ( $db_filter->{AutoArchive} ) + { + push( @auto_terms, "E.Archived = 0" ) + } + if ( $db_filter->{AutoVideo} ) + { + push( @auto_terms, "E.Videoed = 0" ) + } + if ( $db_filter->{AutoUpload} ) + { + push( @auto_terms, "E.Uploaded = 0" ) + } + if ( $db_filter->{AutoEmail} ) + { + push( @auto_terms, "E.Emailed = 0" ) + } + if ( $db_filter->{AutoMessage} ) + { + push( @auto_terms, "E.Messaged = 0" ) + } + if ( $db_filter->{AutoExecute} ) + { + push( @auto_terms, "E.Executed = 0" ) + } + if ( @auto_terms ) + { + $sql .= " and ( ".join( " or ", @auto_terms )." )"; + } + if ( !$filter_expr->{sort_field} ) + { + $filter_expr->{sort_field} = 'StartTime'; + $filter_expr->{sort_asc} = 0; + } + my $sort_column = ''; + if ( $filter_expr->{sort_field} eq 'Id' ) + { + $sort_column = "E.Id"; + } + elsif ( $filter_expr->{sort_field} eq 'MonitorName' ) + { + $sort_column = "M.Name"; + } + elsif ( $filter_expr->{sort_field} eq 'Name' ) + { + $sort_column = "E.Name"; + } + elsif ( $filter_expr->{sort_field} eq 'StartTime' ) + { + $sort_column = "E.StartTime"; + } + elsif ( $filter_expr->{sort_field} eq 'Secs' ) + { + $sort_column = "E.Length"; + } + elsif ( $filter_expr->{sort_field} eq 'Frames' ) + { + $sort_column = "E.Frames"; + } + elsif ( $filter_expr->{sort_field} eq 'AlarmFrames' ) + { + $sort_column = "E.AlarmFrames"; + } + elsif ( $filter_expr->{sort_field} eq 'TotScore' ) + { + $sort_column = "E.TotScore"; + } + elsif ( $filter_expr->{sort_field} eq 'AvgScore' ) + { + $sort_column = "E.AvgScore"; + } + elsif ( $filter_expr->{sort_field} eq 'MaxScore' ) + { + $sort_column = "E.MaxScore"; + } + else + { + $sort_column = "E.StartTime"; + } + my $sort_order = $filter_expr->{sort_asc}?"asc":"desc"; + $sql .= " order by ".$sort_column." ".$sort_order; + if ( $filter_expr->{limit} ) + { + $sql .= " limit 0,".$filter_expr->{limit}; + } + Debug( "SQL:$sql\n" ); + $db_filter->{Sql} = $sql; + if ( $db_filter->{AutoExecute} ) + { + my $script = $db_filter->{AutoExecuteCmd}; + $script =~ s/\s.*$//; + if ( !-e $script ) + { + Error( "Auto execute script '$script' not found, skipping filter '$db_filter->{Name}'\n" ); + next FILTER; + + } + elsif ( !-x $script ) + { + Error( "Auto execute script '$script' not executable, skipping filter '$db_filter->{Name}'\n" ); + next FILTER; + } + } + push( @filters, $db_filter ); + } + $sth->finish(); + + return( \@filters ); +} + +sub checkFilter +{ + my $filter = shift; + + Debug( "Checking filter '$filter->{Name}'". + ($filter->{AutoDelete}?", delete":""). + ($filter->{AutoArchive}?", archive":""). + ($filter->{AutoVideo}?", video":""). + ($filter->{AutoUpload}?", upload":""). + ($filter->{AutoEmail}?", email":""). + ($filter->{AutoMessage}?", message":""). + ($filter->{AutoExecute}?", execute":""). + "\n" + ); + my $sql = $filter->{Sql}; + + if ( $filter->{HasDiskPercent} ) + { + my $disk_percent = getDiskPercent(); + $sql =~ s/zmDiskPercent/$disk_percent/g; + } + if ( $filter->{HasDiskBlocks} ) + { + my $disk_blocks = getDiskBlocks(); + $sql =~ s/zmDiskBlocks/$disk_blocks/g; + } + if ( $filter->{HasSystemLoad} ) + { + my $load = getLoad(); + $sql =~ s/zmSystemLoad/$load/g; + } + + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute(); + if ( !$res ) + { + Error( "Can't execute filter '$sql', ignoring: ".$sth->errstr() ); + return; + } + + while( my $event = $sth->fetchrow_hashref() ) + { + Debug( "Checking event $event->{Id}\n" ); + my $delete_ok = !undef; + if ( $filter->{AutoArchive} ) + { + Info( "Archiving event $event->{Id}\n" ); + # Do it individually to avoid locking up the table for new events + my $sql = "update Events set Archived = 1 where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + } + if ( ZM_OPT_FFMPEG && $filter->{AutoVideo} ) + { + if ( !$event->{Videoed} ) + { + $delete_ok = undef if ( !generateVideo( $filter, $event ) ); + } + } + if ( ZM_OPT_EMAIL && $filter->{AutoEmail} ) + { + if ( !$event->{Emailed} ) + { + $delete_ok = undef if ( !sendEmail( $filter, $event ) ); + } + } + if ( ZM_OPT_MESSAGE && $filter->{AutoMessage} ) + { + if ( !$event->{Messaged} ) + { + $delete_ok = undef if ( !sendMessage( $filter, $event ) ); + } + } + if ( ZM_OPT_UPLOAD && $filter->{AutoUpload} ) + { + if ( !$event->{Uploaded} ) + { + $delete_ok = undef if ( !uploadArchFile( $filter, $event ) ); + } + } + if ( $filter->{AutoExecute} ) + { + if ( !$event->{Execute} ) + { + $delete_ok = undef if ( !executeCommand( $filter, $event ) ); + } + } + if ( $filter->{AutoDelete} ) + { + if ( $delete_ok ) + { + Info( "Deleting event $event->{Id}\n" ); + # Do it individually to avoid locking up the table for new events + my $sql = "delete from Events where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + + if ( !ZM_OPT_FAST_DELETE ) + { + my $sql = "delete from Frames where EventId = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + + $sql = "delete from Stats where EventId = ?"; + $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + + deleteEventFiles( $event->{Id}, $event->{MonitorId} ); + } + } + else + { + Error( "Unable to delete event $event->{Id} as previous operations failed\n" ); + } + } + } + $sth->finish(); +} + +sub generateVideo +{ + my $filter = shift; + my $event = shift; + my $phone = shift; + + my $rate = $event->{DefaultRate}/100; + my $scale = $event->{DefaultScale}/100; + my $format; + + my @ffmpeg_formats = split( /\s+/, ZM_FFMPEG_FORMATS ); + my $default_video_format; + my $default_phone_format; + foreach my $ffmpeg_format( @ffmpeg_formats ) + { + if ( $ffmpeg_format =~ /^(.+)\*\*$/ ) + { + $default_phone_format = $1; + } + elsif ( $ffmpeg_format =~ /^(.+)\*$/ ) + { + $default_video_format = $1; + } + } + + if ( $phone && $default_phone_format ) + { + $format = $default_phone_format; + } + elsif ( $default_video_format ) + { + $format = $default_video_format; + } + else + { + $format = $ffmpeg_formats[0]; + } + + my $command = ZM_PATH_BIN."/zmvideo.pl -e ".$event->{Id}." -r ".$rate." -s ".$scale." -f ".$format; + my $output = qx($command); + chomp( $output ); + my $status = $? >> 8; + if ( $status || logDebugging() ) + { + Debug( "Output: $output\n" ); + } + if ( $status ) + { + Error( "Video generation '$command' failed with status: $status\n" ); + if ( wantarray() ) + { + return( undef, undef ); + } + return( 0 ); + } + else + { + my $sql = "update Events set Videoed = 1 where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + if ( wantarray() ) + { + return( $format, sprintf( "%s/%s", getEventPath( $event ), $output ) ); + } + } + return( 1 ); +} + +sub uploadArchFile +{ + my $filter = shift; + my $event = shift; + + if ( !ZM_UPLOAD_HOST ) + { + Error( "Cannot upload archive as no upload host defined" ); + return( 0 ); + } + + my $archFile = $event->{MonitorName}.'-'.$event->{Id}; + my $archImagePath = getEventPath( $event )."/".((ZM_UPLOAD_ARCH_ANALYSE)?'{*analyse,*capture}':'*capture').".jpg"; + my @archImageFiles = glob($archImagePath); + my $archLocPath; + + my $archError = 0; + if ( ZM_UPLOAD_ARCH_FORMAT eq "zip" ) + { + $archFile .= '.zip'; + $archLocPath = ZM_UPLOAD_LOC_DIR.'/'.$archFile; + my $zip = Archive::Zip->new(); + Info( "Creating upload file '$archLocPath', ".int(@archImageFiles)." files\n" ); + + my $status = &AZ_OK; + foreach my $imageFile ( @archImageFiles ) + { + Debug( "Adding $imageFile\n" ); + my $member = $zip->addFile( $imageFile ); + if ( !$member ) + { + Error( "Unable to add image file $imageFile to zip archive $archLocPath" ); + $archError = 1; + last; + } + $member->desiredCompressionMethod( (ZM_UPLOAD_ARCH_COMPRESS)?&COMPRESSION_DEFLATED:&COMPRESSION_STORED ); + } + if ( !$archError ) + { + $status = $zip->writeToFileNamed( $archLocPath ); + + if ( $archError = ($status != &AZ_OK) ) + { + Error( "Zip error: $status\n " ); + } + } + else + { + Error( "Error adding images to zip archive $archLocPath, not writing" ); + } + } + elsif ( ZM_UPLOAD_ARCH_FORMAT eq "tar" ) + { + if ( ZM_UPLOAD_ARCH_COMPRESS ) + { + $archFile .= '.tar.gz'; + } + else + { + $archFile .= '.tar'; + } + $archLocPath = ZM_UPLOAD_LOC_DIR.'/'.$archFile; + Info( "Creating upload file '$archLocPath', ".int(@archImageFiles)." files\n" ); + + if ( $archError = !Archive::Tar->create_archive( $archLocPath, ZM_UPLOAD_ARCH_COMPRESS, @archImageFiles ) ) + { + Error( "Tar error: ".Archive::Tar->error()."\n " ); + } + } + + if ( $archError ) + { + return( 0 ); + } + else + { + if ( ZM_UPLOAD_PROTOCOL eq "ftp" ) + { + Info( "Uploading to ".ZM_UPLOAD_HOST." using FTP\n" ); + my $ftp = Net::FTP->new( ZM_UPLOAD_HOST, Timeout=>ZM_UPLOAD_TIMEOUT, Passive=>ZM_UPLOAD_FTP_PASSIVE, Debug=>ZM_UPLOAD_DEBUG ); + if ( !$ftp ) + { + Error( "Can't create FTP connection: $@" ); + return( 0 ); + } + $ftp->login( ZM_UPLOAD_USER, ZM_UPLOAD_PASS ) or Error( "FTP - Can't login" ); + $ftp->binary() or Error( "FTP - Can't go binary" ); + $ftp->cwd( ZM_UPLOAD_REM_DIR ) or Error( "FTP - Can't cwd" ) if ( ZM_UPLOAD_REM_DIR ); + $ftp->put( $archLocPath ) or Error( "FTP - Can't upload '$archLocPath'" ); + $ftp->quit() or Error( "FTP - Can't quit" ); + } + else + { + my $host = ZM_UPLOAD_HOST; + $host .= ":".ZM_UPLOAD_PORT if ( ZM_UPLOAD_PORT ); + Info( "Uploading to ".$host." using SFTP\n" ); + my %sftpOptions = ( host=>ZM_UPLOAD_HOST, user=>ZM_UPLOAD_USER ); + $sftpOptions{password} = ZM_UPLOAD_PASS if ( ZM_UPLOAD_PASS ); + $sftpOptions{port} = ZM_UPLOAD_PORT if ( ZM_UPLOAD_PORT ); + $sftpOptions{timeout} = ZM_UPLOAD_TIMEOUT if ( ZM_UPLOAD_TIMEOUT ); + $sftpOptions{more} = [ '-o'=>'StrictHostKeyChecking=no' ]; + $Net::SFTP::Foreign::debug = -1 if ( ZM_UPLOAD_DEBUG ); + my $sftp = Net::SFTP::Foreign->new( ZM_UPLOAD_HOST, %sftpOptions ); + if ( $sftp->error ) + { + Error( "Can't create SFTP connection: ".$sftp->error ); + return( 0 ); + } + $sftp->setcwd( ZM_UPLOAD_REM_DIR ) or Error( "SFTP - Can't setcwd: ".$sftp->error ) if ( ZM_UPLOAD_REM_DIR ); + $sftp->put( $archLocPath, $archFile ) or Error( "SFTP - Can't upload '$archLocPath': ".$sftp->error ); + } + unlink( $archLocPath ); + my $sql = "update Events set Uploaded = 1 where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + } + return( 1 ); +} + +sub substituteTags +{ + my $text = shift; + my $filter = shift; + my $event = shift; + my $attachments_ref = shift; + + # First we'd better check what we need to get + # We have a filter and an event, do we need any more + # monitor information? + my $need_monitor = $text =~ /%(?:MET|MEH|MED|MEW|MEN|MEA)%/; + + my $monitor = {}; + if ( $need_monitor ) + { + my $db_now = strftime( "%Y-%m-%d %H:%M:%S", localtime() ); + my $sql = "select M.Id, count(E.Id) as EventCount, count(if(E.Archived,1,NULL)) as ArchEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 HOUR && E.Archived = 0,1,NULL)) as HourEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 DAY && E.Archived = 0,1,NULL)) as DayEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 7 DAY && E.Archived = 0,1,NULL)) as WeekEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 MONTH && E.Archived = 0,1,NULL)) as MonthEventCount from Monitors as M left join Events as E on E.MonitorId = M.Id where MonitorId = ? group by E.MonitorId order by Id"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{MonitorId} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + $monitor = $sth->fetchrow_hashref(); + $sth->finish(); + return() if ( !$monitor ); + } + + # Do we need the image information too? + my $need_images = $text =~ /%(?:EPI1|EPIM|EI1|EIM)%/; + my $first_alarm_frame; + my $max_alarm_frame; + my $max_alarm_score = 0; + if ( $need_images ) + { + my $sql = "select * from Frames where EventId = ? and Type = 'Alarm' order by FrameId"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + while( my $frame = $sth->fetchrow_hashref() ) + { + if ( !$first_alarm_frame ) + { + $first_alarm_frame = $frame; + } + if ( $frame->{Score} > $max_alarm_score ) + { + $max_alarm_frame = $frame; + $max_alarm_score = $frame->{Score}; + } + } + $sth->finish(); + } + + my $url = ZM_URL; + $text =~ s/%ZP%/$url/g; + $text =~ s/%MN%/$event->{MonitorName}/g; + $text =~ s/%MET%/$monitor->{EventCount}/g; + $text =~ s/%MEH%/$monitor->{HourEventCount}/g; + $text =~ s/%MED%/$monitor->{DayEventCount}/g; + $text =~ s/%MEW%/$monitor->{WeekEventCount}/g; + $text =~ s/%MEM%/$monitor->{MonthEventCount}/g; + $text =~ s/%MEA%/$monitor->{ArchEventCount}/g; + $text =~ s/%MP%/$url?view=watch&mid=$event->{MonitorId}/g; + $text =~ s/%MPS%/$url?view=watchfeed&mid=$event->{MonitorId}&mode=stream/g; + $text =~ s/%MPI%/$url?view=watchfeed&mid=$event->{MonitorId}&mode=still/g; + $text =~ s/%EP%/$url?view=event&mid=$event->{MonitorId}&eid=$event->{Id}/g; + $text =~ s/%EPS%/$url?view=event&mode=stream&mid=$event->{MonitorId}&eid=$event->{Id}/g; + $text =~ s/%EPI%/$url?view=event&mode=still&mid=$event->{MonitorId}&eid=$event->{Id}/g; + $text =~ s/%EI%/$event->{Id}/g; + $text =~ s/%EN%/$event->{Name}/g; + $text =~ s/%EC%/$event->{Cause}/g; + $text =~ s/%ED%/$event->{Notes}/g; + $text =~ s/%ET%/$event->{StartTime}/g; + $text =~ s/%EL%/$event->{Length}/g; + $text =~ s/%EF%/$event->{Frames}/g; + $text =~ s/%EFA%/$event->{AlarmFrames}/g; + $text =~ s/%EST%/$event->{TotScore}/g; + $text =~ s/%ESA%/$event->{AvgScore}/g; + $text =~ s/%ESM%/$event->{MaxScore}/g; + if ( $first_alarm_frame ) + { + $text =~ s/%EPI1%/$url?view=frame&mid=$event->{MonitorId}&eid=$event->{Id}&fid=$first_alarm_frame->{FrameId}/g; + $text =~ s/%EPIM%/$url?view=frame&mid=$event->{MonitorId}&eid=$event->{Id}&fid=$max_alarm_frame->{FrameId}/g; + if ( $attachments_ref && $text =~ s/%EI1%//g ) + { + push( @$attachments_ref, { type=>"image/jpeg", path=>sprintf( "%s/%0".ZM_EVENT_IMAGE_DIGITS."d-capture.jpg", getEventPath( $event ), $first_alarm_frame->{FrameId} ) } ); + } + if ( $attachments_ref && $text =~ s/%EIM%//g ) + { + # Don't attach the same image twice + if ( !@$attachments_ref || ($first_alarm_frame->{FrameId} != $max_alarm_frame->{FrameId} ) ) + { + push( @$attachments_ref, { type=>"image/jpeg", path=>sprintf( "%s/%0".ZM_EVENT_IMAGE_DIGITS."d-capture.jpg", getEventPath( $event ), $max_alarm_frame->{FrameId} ) } ); + } + } + } + if ( $attachments_ref && ZM_OPT_FFMPEG ) + { + if ( $text =~ s/%EV%//g ) + { + my ( $format, $path ) = generateVideo( $filter, $event ); + if ( !$format ) + { + return( undef ); + } + push( @$attachments_ref, { type=>"video/$format", path=>$path } ); + } + if ( $text =~ s/%EVM%//g ) + { + my ( $format, $path ) = generateVideo( $filter, $event, 1 ); + if ( !$format ) + { + return( undef ); + } + push( @$attachments_ref, { type=>"video/$format", path=>$path } ); + } + } + $text =~ s/%FN%/$filter->{Name}/g; + ( my $filter_name = $filter->{Name} ) =~ s/ /+/g; + $text =~ s/%FP%/$url?view=filter&mid=$event->{MonitorId}&filter_name=$filter_name/g; + + return( $text ); +} + +sub sendEmail +{ + my $filter = shift; + my $event = shift; + + if ( !ZM_FROM_EMAIL ) + { + Error( "No 'from' email address defined, not sending email" ); + return( 0 ); + } + if ( !ZM_EMAIL_ADDRESS ) + { + Error( "No email address defined, not sending email" ); + return( 0 ); + } + + Info( "Creating notification email\n" ); + + my $subject = substituteTags( ZM_EMAIL_SUBJECT, $filter, $event ); + return( 0 ) if ( !$subject ); + my @attachments; + my $body = substituteTags( ZM_EMAIL_BODY, $filter, $event, \@attachments ); + return( 0 ) if ( !$body ); + + Info( "Sending notification email '$subject'\n" ); + + eval + { + if ( ZM_NEW_MAIL_MODULES ) + { + ### Create the multipart container + my $mail = MIME::Lite->new ( + From => ZM_FROM_EMAIL, + To => ZM_EMAIL_ADDRESS, + Subject => $subject, + Type => "multipart/mixed" + ); + ### Add the text message part + $mail->attach ( + Type => "TEXT", + Data => $body + ); + ### Add the attachments + foreach my $attachment ( @attachments ) + { + Info( "Attaching '$attachment->{path}\n" ); + $mail->attach( + Path => $attachment->{path}, + Type => $attachment->{type}, + Disposition => "attachment" + ); + } + ### Send the Message + MIME::Lite->send( "smtp", ZM_EMAIL_HOST, Timeout=>60 ); + $mail->send(); + } + else + { + my $mail = MIME::Entity->build( + From => ZM_FROM_EMAIL, + To => ZM_EMAIL_ADDRESS, + Subject => $subject, + Type => (($body=~//)?'text/html':'text/plain'), + Data => $body + ); + + foreach my $attachment ( @attachments ) + { + Info( "Attaching '$attachment->{path}\n" ); + $mail->attach( + Path => $attachment->{path}, + Type => $attachment->{type}, + Encoding => "base64" + ); + } + $mail->smtpsend( Host => ZM_EMAIL_HOST, MailFrom => ZM_FROM_EMAIL ); + } + }; + if ( $@ ) + { + Error( "Can't send email: $@" ); + return( 0 ); + } + else + { + Info( "Notification email sent\n" ); + } + my $sql = "update Events set Emailed = 1 where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + + return( 1 ); +} + +sub sendMessage +{ + my $filter = shift; + my $event = shift; + + if ( !ZM_FROM_EMAIL ) + { + Error( "No 'from' email address defined, not sending message" ); + return( 0 ); + } + if ( !ZM_MESSAGE_ADDRESS ) + { + Error( "No message address defined, not sending message" ); + return( 0 ); + } + + Info( "Creating notification message\n" ); + + my $subject = substituteTags( ZM_MESSAGE_SUBJECT, $filter, $event ); + return( 0 ) if ( !$subject ); + my @attachments; + my $body = substituteTags( ZM_MESSAGE_BODY, $filter, $event, \@attachments ); + return( 0 ) if ( !$body ); + + Info( "Sending notification message '$subject'\n" ); + + eval + { + if ( ZM_NEW_MAIL_MODULES ) + { + ### Create the multipart container + my $mail = MIME::Lite->new ( + From => ZM_FROM_EMAIL, + To => ZM_MESSAGE_ADDRESS, + Subject => $subject, + Type => "multipart/mixed" + ); + ### Add the text message part + $mail->attach ( + Type => "TEXT", + Data => $body + ); + ### Add the attachments + foreach my $attachment ( @attachments ) + { + Info( "Attaching '$attachment->{path}\n" ); + $mail->attach( + Path => $attachment->{path}, + Type => $attachment->{type}, + Disposition => "attachment" + ); + } + ### Send the Message + MIME::Lite->send( "smtp", ZM_EMAIL_HOST, Timeout=>60 ); + $mail->send(); + } + else + { + my $mail = MIME::Entity->build( + From => ZM_FROM_EMAIL, + To => ZM_MESSAGE_ADDRESS, + Subject => $subject, + Type => (($body=~//)?'text/html':'text/plain'), + Data => $body + ); + + foreach my $attachment ( @attachments ) + { + Info( "Attaching '$attachment->{path}\n" ); + $mail->attach( + Path => $attachment->{path}, + Type => $attachment->{type}, + Encoding => "base64" + ); + } + $mail->smtpsend( Host => ZM_EMAIL_HOST, MailFrom => ZM_FROM_EMAIL ); + } + }; + if ( $@ ) + { + Error( "Can't send email: $@" ); + return( 0 ); + } + else + { + Info( "Notification message sent\n" ); + } + my $sql = "update Events set Messaged = 1 where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + + return( 1 ); +} + +sub executeCommand +{ + my $filter = shift; + my $event = shift; + + my $event_path = getEventPath( $event ); + + my $command = $filter->{AutoExecuteCmd}; + $command .= " $event_path"; + + Info( "Executing '$command'\n" ); + my $output = qx($command); + my $status = $? >> 8; + if ( $status || logDebugging() ) + { + chomp( $output ); + Debug( "Output: $output\n" ); + } + if ( $status ) + { + Error( "Command '$command' exited with status: $status\n" ); + return( 0 ); + } + else + { + my $sql = "update Events set Executed = 1 where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + } + return( 1 ); +} + diff --git a/scripts/zmfilter.pl.in b/scripts/zmfilter.pl.in new file mode 100644 index 000000000..19e7a8977 --- /dev/null +++ b/scripts/zmfilter.pl.in @@ -0,0 +1,1169 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder Event Filter Script, $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. +# +# ========================================================================== +# +# This script continuously monitors the recorded events for the given +# monitor and applies any filters which would delete and/or upload +# matching events +# +use strict; +use bytes; + +# ========================================================================== +# +# These are the elements you can edit to suit your installation +# +# ========================================================================== + +use constant START_DELAY => 5; # How long to wait before starting + +# ========================================================================== +# +# You shouldn't need to change anything from here downwards +# +# ========================================================================== + +@EXTRA_PERL_LIB@ +use ZoneMinder; +use DBI; +use POSIX; +use Time::HiRes qw/gettimeofday/; +use Date::Manip; +use Getopt::Long; +use Data::Dumper; + +use constant EVENT_PATH => (ZM_DIR_EVENTS=~m|/|)?ZM_DIR_EVENTS:(ZM_PATH_WEB.'/'.ZM_DIR_EVENTS); + +logInit(); +logSetSignal(); + +if ( ZM_OPT_UPLOAD ) +{ + # Comment these out if you don't have them and don't want to upload + # or don't want to use that format + if ( ZM_UPLOAD_ARCH_FORMAT eq "zip" ) + { + require Archive::Zip; + import Archive::Zip qw( :ERROR_CODES :CONSTANTS ); + } + else + { + require Archive::Tar; + } + if ( ZM_UPLOAD_PROTOCOL eq "ftp" ) + { + require Net::FTP; + } + else + { + require Net::SFTP::Foreign; + } +} + +if ( ZM_OPT_EMAIL ) +{ + if ( ZM_NEW_MAIL_MODULES ) + { + require MIME::Lite; + require Net::SMTP; + } + else + { + require MIME::Entity; + } +} + +if ( ZM_OPT_MESSAGE ) +{ + if ( ZM_NEW_MAIL_MODULES ) + { + require MIME::Lite; + require Net::SMTP; + } + else + { + require MIME::Entity; + } +} + + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +my $delay = ZM_FILTER_EXECUTE_INTERVAL; +my $event_id = 0; +my $filter_parm = ""; + +sub Usage +{ + print( " +Usage: zmfilter.pl [-f ,--filter=] +Parameters are :- +-f, --filter= - The name of a specific filter to run +"); + exit( -1 ); +} + +# +# More or less replicates the equivalent PHP function +# +sub strtotime +{ + my $dt_str = shift; + return( UnixDate( $dt_str, '%s' ) ); +} + +# +# More or less replicates the equivalent PHP function +# +sub str_repeat +{ + my $string = shift; + my $count = shift; + return( ${string}x${count} ); +} + +# Formats a date into MySQL format +sub DateTimeToSQL +{ + my $dt_str = shift; + my $dt_val = strtotime( $dt_str ); + if ( !$dt_val ) + { + Error( "Unable to parse date string '$dt_str'\n" ); + return( undef ); + } + return( strftime( "%Y-%m-%d %H:%M:%S", localtime( $dt_val ) ) ); +} + +if ( !GetOptions( 'filter=s'=>\$filter_parm ) ) +{ + Usage(); +} + +chdir( EVENT_PATH ); + +my $dbh = zmDbConnect(); + +if ( $filter_parm ) +{ + Info( "Scanning for events using filter '$filter_parm'\n" ); +} +else +{ + Info( "Scanning for events\n" ); +} + +if ( !$filter_parm ) +{ + sleep( START_DELAY ); +} + +my $filters; +my $last_action = 0; + +while( 1 ) +{ + if ( (time() - $last_action) > ZM_FILTER_RELOAD_DELAY ) + { + Debug( "Reloading filters\n" ); + $last_action = time(); + $filters = getFilters( $filter_parm ); + } + + foreach my $filter ( @$filters ) + { + checkFilter( $filter ); + } + + last if ( $filter_parm ); + + Debug( "Sleeping for $delay seconds\n" ); + sleep( $delay ); +} + +sub getDiskPercent +{ + my $command = "df ."; + my $df = qx( $command ); + my $space = -1; + if ( $df =~ /\s(\d+)%/ms ) + { + $space = $1; + } + return( $space ); +} + +sub getDiskBlocks +{ + my $command = "df ."; + my $df = qx( $command ); + my $space = -1; + if ( $df =~ /\s(\d+)\s+\d+\s+\d+%/ms ) + { + $space = $1; + } + return( $space ); +} + +sub getLoad +{ + my $command = "uptime ."; + my $uptime = qx( $command ); + my $load = -1; + if ( $uptime =~ /load average:\s+([\d.]+)/ms ) + { + $load = $1; + Info( "Load: $load" ); + } + return( $load ); +} + +sub getFilters +{ + my $filter_name = shift; + + my @filters; + my $sql = "select * from Filters where"; + if ( $filter_name ) + { + $sql .= " Name = ? and"; + } + else + { + $sql .= " Background = 1 and"; + } + $sql .= " (AutoArchive = 1 or AutoVideo = 1 or AutoUpload = 1 or AutoEmail = 1 or AutoMessage = 1 or AutoExecute = 1 or AutoDelete = 1) order by Name"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res; + if ( $filter_name ) + { + $res = $sth->execute( $filter_name ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + } + else + { + $res = $sth->execute() or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + } + FILTER: while( my $db_filter = $sth->fetchrow_hashref() ) + { + Debug( "Found filter '$db_filter->{Name}'\n" ); + my $filter_expr = jsonDecode( $db_filter->{Query} ); + my $sql = "select E.Id,E.MonitorId,M.Name as MonitorName,M.DefaultRate,M.DefaultScale,E.Name,E.Cause,E.Notes,E.StartTime,unix_timestamp(E.StartTime) as Time,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived,E.Videoed,E.Uploaded,E.Emailed,E.Messaged,E.Executed from Events as E inner join Monitors as M on M.Id = E.MonitorId where not isnull(E.EndTime)"; + $db_filter->{Sql} = ''; + + if ( @{$filter_expr->{terms}} ) + { + for ( my $i = 0; $i < @{$filter_expr->{terms}}; $i++ ) + { + if ( exists($filter_expr->{terms}[$i]->{cnj}) ) + { + $db_filter->{Sql} .= " ".$filter_expr->{terms}[$i]->{cnj}." "; + } + if ( exists($filter_expr->{terms}[$i]->{obr}) ) + { + $db_filter->{Sql} .= " ".str_repeat( "(", $filter_expr->{terms}[$i]->{obr} )." "; + } + my $value = $filter_expr->{terms}[$i]->{val}; + my @value_list; + if ( $filter_expr->{terms}[$i]->{attr} ) + { + if ( $filter_expr->{terms}[$i]->{attr} =~ /^Monitor/ ) + { + my ( $temp_attr_name ) = $filter_expr->{terms}[$i]->{attr} =~ /^Monitor(.+)$/; + $db_filter->{Sql} .= "M.".$temp_attr_name; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'DateTime' ) + { + $db_filter->{Sql} .= "E.StartTime"; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'Date' ) + { + $db_filter->{Sql} .= "to_days( E.StartTime )"; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'Time' ) + { + $db_filter->{Sql} .= "extract( hour_second from E.StartTime )"; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'Weekday' ) + { + $db_filter->{Sql} .= "weekday( E.StartTime )"; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'DiskPercent' ) + { + $db_filter->{Sql} .= "zmDiskPercent"; + $db_filter->{HasDiskPercent} = !undef; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'DiskBlocks' ) + { + $db_filter->{Sql} .= "zmDiskBlocks"; + $db_filter->{HasDiskBlocks} = !undef; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'SystemLoad' ) + { + $db_filter->{Sql} .= "zmSystemLoad"; + $db_filter->{HasSystemLoad} = !undef; + } + else + { + $db_filter->{Sql} .= "E.".$filter_expr->{terms}[$i]->{attr}; + } + + ( my $stripped_value = $value ) =~ s/^["\']+?(.+)["\']+?$/$1/; + foreach my $temp_value ( split( /["'\s]*?,["'\s]*?/, $stripped_value ) ) + { + if ( $filter_expr->{terms}[$i]->{attr} =~ /^Monitor/ ) + { + $value = "'$temp_value'"; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'Name' || $filter_expr->{terms}[$i]->{attr} eq 'Cause' || $filter_expr->{terms}[$i]->{attr} eq 'Notes' ) + { + $value = "'$temp_value'"; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'DateTime' ) + { + $value = DateTimeToSQL( $temp_value ); + if ( !$value ) + { + Error( "Error parsing date/time '$temp_value', skipping filter '$db_filter->{Name}'\n" ); + next FILTER; + } + $value = "'$value'"; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'Date' ) + { + $value = DateTimeToSQL( $temp_value ); + if ( !$value ) + { + Error( "Error parsing date/time '$temp_value', skipping filter '$db_filter->{Name}'\n" ); + next FILTER; + } + $value = "to_days( '$value' )"; + } + elsif ( $filter_expr->{terms}[$i]->{attr} eq 'Time' ) + { + $value = DateTimeToSQL( $temp_value ); + if ( !$value ) + { + Error( "Error parsing date/time '$temp_value', skipping filter '$db_filter->{Name}'\n" ); + next FILTER; + } + $value = "extract( hour_second from '$value' )"; + } + else + { + $value = $temp_value; + } + push( @value_list, $value ); + } + } + if ( $filter_expr->{terms}[$i]->{op} ) + { + if ( $filter_expr->{terms}[$i]->{op} eq '=~' ) + { + $db_filter->{Sql} .= " regexp $value"; + } + elsif ( $filter_expr->{terms}[$i]->{op} eq '!~' ) + { + $db_filter->{Sql} .= " not regexp $value"; + } + elsif ( $filter_expr->{terms}[$i]->{op} eq '=[]' ) + { + $db_filter->{Sql} .= " in (".join( ",", @value_list ).")"; + } + elsif ( $filter_expr->{terms}[$i]->{op} eq '!~' ) + { + $db_filter->{Sql} .= " not in (".join( ",", @value_list ).")"; + } + else + { + $db_filter->{Sql} .= " ".$filter_expr->{terms}[$i]->{op}." $value"; + } + } + if ( exists($filter_expr->{terms}[$i]->{cbr}) ) + { + $db_filter->{Sql} .= " ".str_repeat( ")", $filter_expr->{terms}[$i]->{cbr} )." "; + } + } + } + if ( $db_filter->{Sql} ) + { + $sql .= " and ( ".$db_filter->{Sql}." )"; + } + my @auto_terms; + if ( $db_filter->{AutoArchive} ) + { + push( @auto_terms, "E.Archived = 0" ) + } + if ( $db_filter->{AutoVideo} ) + { + push( @auto_terms, "E.Videoed = 0" ) + } + if ( $db_filter->{AutoUpload} ) + { + push( @auto_terms, "E.Uploaded = 0" ) + } + if ( $db_filter->{AutoEmail} ) + { + push( @auto_terms, "E.Emailed = 0" ) + } + if ( $db_filter->{AutoMessage} ) + { + push( @auto_terms, "E.Messaged = 0" ) + } + if ( $db_filter->{AutoExecute} ) + { + push( @auto_terms, "E.Executed = 0" ) + } + if ( @auto_terms ) + { + $sql .= " and ( ".join( " or ", @auto_terms )." )"; + } + if ( !$filter_expr->{sort_field} ) + { + $filter_expr->{sort_field} = 'StartTime'; + $filter_expr->{sort_asc} = 0; + } + my $sort_column = ''; + if ( $filter_expr->{sort_field} eq 'Id' ) + { + $sort_column = "E.Id"; + } + elsif ( $filter_expr->{sort_field} eq 'MonitorName' ) + { + $sort_column = "M.Name"; + } + elsif ( $filter_expr->{sort_field} eq 'Name' ) + { + $sort_column = "E.Name"; + } + elsif ( $filter_expr->{sort_field} eq 'StartTime' ) + { + $sort_column = "E.StartTime"; + } + elsif ( $filter_expr->{sort_field} eq 'Secs' ) + { + $sort_column = "E.Length"; + } + elsif ( $filter_expr->{sort_field} eq 'Frames' ) + { + $sort_column = "E.Frames"; + } + elsif ( $filter_expr->{sort_field} eq 'AlarmFrames' ) + { + $sort_column = "E.AlarmFrames"; + } + elsif ( $filter_expr->{sort_field} eq 'TotScore' ) + { + $sort_column = "E.TotScore"; + } + elsif ( $filter_expr->{sort_field} eq 'AvgScore' ) + { + $sort_column = "E.AvgScore"; + } + elsif ( $filter_expr->{sort_field} eq 'MaxScore' ) + { + $sort_column = "E.MaxScore"; + } + else + { + $sort_column = "E.StartTime"; + } + my $sort_order = $filter_expr->{sort_asc}?"asc":"desc"; + $sql .= " order by ".$sort_column." ".$sort_order; + if ( $filter_expr->{limit} ) + { + $sql .= " limit 0,".$filter_expr->{limit}; + } + Debug( "SQL:$sql\n" ); + $db_filter->{Sql} = $sql; + if ( $db_filter->{AutoExecute} ) + { + my $script = $db_filter->{AutoExecuteCmd}; + $script =~ s/\s.*$//; + if ( !-e $script ) + { + Error( "Auto execute script '$script' not found, skipping filter '$db_filter->{Name}'\n" ); + next FILTER; + + } + elsif ( !-x $script ) + { + Error( "Auto execute script '$script' not executable, skipping filter '$db_filter->{Name}'\n" ); + next FILTER; + } + } + push( @filters, $db_filter ); + } + $sth->finish(); + + return( \@filters ); +} + +sub checkFilter +{ + my $filter = shift; + + Debug( "Checking filter '$filter->{Name}'". + ($filter->{AutoDelete}?", delete":""). + ($filter->{AutoArchive}?", archive":""). + ($filter->{AutoVideo}?", video":""). + ($filter->{AutoUpload}?", upload":""). + ($filter->{AutoEmail}?", email":""). + ($filter->{AutoMessage}?", message":""). + ($filter->{AutoExecute}?", execute":""). + "\n" + ); + my $sql = $filter->{Sql}; + + if ( $filter->{HasDiskPercent} ) + { + my $disk_percent = getDiskPercent(); + $sql =~ s/zmDiskPercent/$disk_percent/g; + } + if ( $filter->{HasDiskBlocks} ) + { + my $disk_blocks = getDiskBlocks(); + $sql =~ s/zmDiskBlocks/$disk_blocks/g; + } + if ( $filter->{HasSystemLoad} ) + { + my $load = getLoad(); + $sql =~ s/zmSystemLoad/$load/g; + } + + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute(); + if ( !$res ) + { + Error( "Can't execute filter '$sql', ignoring: ".$sth->errstr() ); + return; + } + + while( my $event = $sth->fetchrow_hashref() ) + { + Debug( "Checking event $event->{Id}\n" ); + my $delete_ok = !undef; + if ( $filter->{AutoArchive} ) + { + Info( "Archiving event $event->{Id}\n" ); + # Do it individually to avoid locking up the table for new events + my $sql = "update Events set Archived = 1 where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + } + if ( ZM_OPT_FFMPEG && $filter->{AutoVideo} ) + { + if ( !$event->{Videoed} ) + { + $delete_ok = undef if ( !generateVideo( $filter, $event ) ); + } + } + if ( ZM_OPT_EMAIL && $filter->{AutoEmail} ) + { + if ( !$event->{Emailed} ) + { + $delete_ok = undef if ( !sendEmail( $filter, $event ) ); + } + } + if ( ZM_OPT_MESSAGE && $filter->{AutoMessage} ) + { + if ( !$event->{Messaged} ) + { + $delete_ok = undef if ( !sendMessage( $filter, $event ) ); + } + } + if ( ZM_OPT_UPLOAD && $filter->{AutoUpload} ) + { + if ( !$event->{Uploaded} ) + { + $delete_ok = undef if ( !uploadArchFile( $filter, $event ) ); + } + } + if ( $filter->{AutoExecute} ) + { + if ( !$event->{Execute} ) + { + $delete_ok = undef if ( !executeCommand( $filter, $event ) ); + } + } + if ( $filter->{AutoDelete} ) + { + if ( $delete_ok ) + { + Info( "Deleting event $event->{Id}\n" ); + # Do it individually to avoid locking up the table for new events + my $sql = "delete from Events where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + + if ( !ZM_OPT_FAST_DELETE ) + { + my $sql = "delete from Frames where EventId = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + + $sql = "delete from Stats where EventId = ?"; + $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + + deleteEventFiles( $event->{Id}, $event->{MonitorId} ); + } + } + else + { + Error( "Unable to delete event $event->{Id} as previous operations failed\n" ); + } + } + } + $sth->finish(); +} + +sub generateVideo +{ + my $filter = shift; + my $event = shift; + my $phone = shift; + + my $rate = $event->{DefaultRate}/100; + my $scale = $event->{DefaultScale}/100; + my $format; + + my @ffmpeg_formats = split( /\s+/, ZM_FFMPEG_FORMATS ); + my $default_video_format; + my $default_phone_format; + foreach my $ffmpeg_format( @ffmpeg_formats ) + { + if ( $ffmpeg_format =~ /^(.+)\*\*$/ ) + { + $default_phone_format = $1; + } + elsif ( $ffmpeg_format =~ /^(.+)\*$/ ) + { + $default_video_format = $1; + } + } + + if ( $phone && $default_phone_format ) + { + $format = $default_phone_format; + } + elsif ( $default_video_format ) + { + $format = $default_video_format; + } + else + { + $format = $ffmpeg_formats[0]; + } + + my $command = ZM_PATH_BIN."/zmvideo.pl -e ".$event->{Id}." -r ".$rate." -s ".$scale." -f ".$format; + my $output = qx($command); + chomp( $output ); + my $status = $? >> 8; + if ( $status || logDebugging() ) + { + Debug( "Output: $output\n" ); + } + if ( $status ) + { + Error( "Video generation '$command' failed with status: $status\n" ); + if ( wantarray() ) + { + return( undef, undef ); + } + return( 0 ); + } + else + { + my $sql = "update Events set Videoed = 1 where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + if ( wantarray() ) + { + return( $format, sprintf( "%s/%s", getEventPath( $event ), $output ) ); + } + } + return( 1 ); +} + +sub uploadArchFile +{ + my $filter = shift; + my $event = shift; + + if ( !ZM_UPLOAD_HOST ) + { + Error( "Cannot upload archive as no upload host defined" ); + return( 0 ); + } + + my $archFile = $event->{MonitorName}.'-'.$event->{Id}; + my $archImagePath = getEventPath( $event )."/".((ZM_UPLOAD_ARCH_ANALYSE)?'{*analyse,*capture}':'*capture').".jpg"; + my @archImageFiles = glob($archImagePath); + my $archLocPath; + + my $archError = 0; + if ( ZM_UPLOAD_ARCH_FORMAT eq "zip" ) + { + $archFile .= '.zip'; + $archLocPath = ZM_UPLOAD_LOC_DIR.'/'.$archFile; + my $zip = Archive::Zip->new(); + Info( "Creating upload file '$archLocPath', ".int(@archImageFiles)." files\n" ); + + my $status = &AZ_OK; + foreach my $imageFile ( @archImageFiles ) + { + Debug( "Adding $imageFile\n" ); + my $member = $zip->addFile( $imageFile ); + if ( !$member ) + { + Error( "Unable to add image file $imageFile to zip archive $archLocPath" ); + $archError = 1; + last; + } + $member->desiredCompressionMethod( (ZM_UPLOAD_ARCH_COMPRESS)?&COMPRESSION_DEFLATED:&COMPRESSION_STORED ); + } + if ( !$archError ) + { + $status = $zip->writeToFileNamed( $archLocPath ); + + if ( $archError = ($status != &AZ_OK) ) + { + Error( "Zip error: $status\n " ); + } + } + else + { + Error( "Error adding images to zip archive $archLocPath, not writing" ); + } + } + elsif ( ZM_UPLOAD_ARCH_FORMAT eq "tar" ) + { + if ( ZM_UPLOAD_ARCH_COMPRESS ) + { + $archFile .= '.tar.gz'; + } + else + { + $archFile .= '.tar'; + } + $archLocPath = ZM_UPLOAD_LOC_DIR.'/'.$archFile; + Info( "Creating upload file '$archLocPath', ".int(@archImageFiles)." files\n" ); + + if ( $archError = !Archive::Tar->create_archive( $archLocPath, ZM_UPLOAD_ARCH_COMPRESS, @archImageFiles ) ) + { + Error( "Tar error: ".Archive::Tar->error()."\n " ); + } + } + + if ( $archError ) + { + return( 0 ); + } + else + { + if ( ZM_UPLOAD_PROTOCOL eq "ftp" ) + { + Info( "Uploading to ".ZM_UPLOAD_HOST." using FTP\n" ); + my $ftp = Net::FTP->new( ZM_UPLOAD_HOST, Timeout=>ZM_UPLOAD_TIMEOUT, Passive=>ZM_UPLOAD_FTP_PASSIVE, Debug=>ZM_UPLOAD_DEBUG ); + if ( !$ftp ) + { + Error( "Can't create FTP connection: $@" ); + return( 0 ); + } + $ftp->login( ZM_UPLOAD_USER, ZM_UPLOAD_PASS ) or Error( "FTP - Can't login" ); + $ftp->binary() or Error( "FTP - Can't go binary" ); + $ftp->cwd( ZM_UPLOAD_REM_DIR ) or Error( "FTP - Can't cwd" ) if ( ZM_UPLOAD_REM_DIR ); + $ftp->put( $archLocPath ) or Error( "FTP - Can't upload '$archLocPath'" ); + $ftp->quit() or Error( "FTP - Can't quit" ); + } + else + { + my $host = ZM_UPLOAD_HOST; + $host .= ":".ZM_UPLOAD_PORT if ( ZM_UPLOAD_PORT ); + Info( "Uploading to ".$host." using SFTP\n" ); + my %sftpOptions = ( host=>ZM_UPLOAD_HOST, user=>ZM_UPLOAD_USER ); + $sftpOptions{password} = ZM_UPLOAD_PASS if ( ZM_UPLOAD_PASS ); + $sftpOptions{port} = ZM_UPLOAD_PORT if ( ZM_UPLOAD_PORT ); + $sftpOptions{timeout} = ZM_UPLOAD_TIMEOUT if ( ZM_UPLOAD_TIMEOUT ); + $sftpOptions{more} = [ '-o'=>'StrictHostKeyChecking=no' ]; + $Net::SFTP::Foreign::debug = -1 if ( ZM_UPLOAD_DEBUG ); + my $sftp = Net::SFTP::Foreign->new( ZM_UPLOAD_HOST, %sftpOptions ); + if ( $sftp->error ) + { + Error( "Can't create SFTP connection: ".$sftp->error ); + return( 0 ); + } + $sftp->setcwd( ZM_UPLOAD_REM_DIR ) or Error( "SFTP - Can't setcwd: ".$sftp->error ) if ( ZM_UPLOAD_REM_DIR ); + $sftp->put( $archLocPath, $archFile ) or Error( "SFTP - Can't upload '$archLocPath': ".$sftp->error ); + } + unlink( $archLocPath ); + my $sql = "update Events set Uploaded = 1 where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + } + return( 1 ); +} + +sub substituteTags +{ + my $text = shift; + my $filter = shift; + my $event = shift; + my $attachments_ref = shift; + + # First we'd better check what we need to get + # We have a filter and an event, do we need any more + # monitor information? + my $need_monitor = $text =~ /%(?:MET|MEH|MED|MEW|MEN|MEA)%/; + + my $monitor = {}; + if ( $need_monitor ) + { + my $db_now = strftime( "%Y-%m-%d %H:%M:%S", localtime() ); + my $sql = "select M.Id, count(E.Id) as EventCount, count(if(E.Archived,1,NULL)) as ArchEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 HOUR && E.Archived = 0,1,NULL)) as HourEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 DAY && E.Archived = 0,1,NULL)) as DayEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 7 DAY && E.Archived = 0,1,NULL)) as WeekEventCount, count(if(E.StartTime>'$db_now' - INTERVAL 1 MONTH && E.Archived = 0,1,NULL)) as MonthEventCount from Monitors as M left join Events as E on E.MonitorId = M.Id where MonitorId = ? group by E.MonitorId order by Id"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{MonitorId} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + $monitor = $sth->fetchrow_hashref(); + $sth->finish(); + return() if ( !$monitor ); + } + + # Do we need the image information too? + my $need_images = $text =~ /%(?:EPI1|EPIM|EI1|EIM)%/; + my $first_alarm_frame; + my $max_alarm_frame; + my $max_alarm_score = 0; + if ( $need_images ) + { + my $sql = "select * from Frames where EventId = ? and Type = 'Alarm' order by FrameId"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + while( my $frame = $sth->fetchrow_hashref() ) + { + if ( !$first_alarm_frame ) + { + $first_alarm_frame = $frame; + } + if ( $frame->{Score} > $max_alarm_score ) + { + $max_alarm_frame = $frame; + $max_alarm_score = $frame->{Score}; + } + } + $sth->finish(); + } + + my $url = ZM_URL; + $text =~ s/%ZP%/$url/g; + $text =~ s/%MN%/$event->{MonitorName}/g; + $text =~ s/%MET%/$monitor->{EventCount}/g; + $text =~ s/%MEH%/$monitor->{HourEventCount}/g; + $text =~ s/%MED%/$monitor->{DayEventCount}/g; + $text =~ s/%MEW%/$monitor->{WeekEventCount}/g; + $text =~ s/%MEM%/$monitor->{MonthEventCount}/g; + $text =~ s/%MEA%/$monitor->{ArchEventCount}/g; + $text =~ s/%MP%/$url?view=watch&mid=$event->{MonitorId}/g; + $text =~ s/%MPS%/$url?view=watchfeed&mid=$event->{MonitorId}&mode=stream/g; + $text =~ s/%MPI%/$url?view=watchfeed&mid=$event->{MonitorId}&mode=still/g; + $text =~ s/%EP%/$url?view=event&mid=$event->{MonitorId}&eid=$event->{Id}/g; + $text =~ s/%EPS%/$url?view=event&mode=stream&mid=$event->{MonitorId}&eid=$event->{Id}/g; + $text =~ s/%EPI%/$url?view=event&mode=still&mid=$event->{MonitorId}&eid=$event->{Id}/g; + $text =~ s/%EI%/$event->{Id}/g; + $text =~ s/%EN%/$event->{Name}/g; + $text =~ s/%EC%/$event->{Cause}/g; + $text =~ s/%ED%/$event->{Notes}/g; + $text =~ s/%ET%/$event->{StartTime}/g; + $text =~ s/%EL%/$event->{Length}/g; + $text =~ s/%EF%/$event->{Frames}/g; + $text =~ s/%EFA%/$event->{AlarmFrames}/g; + $text =~ s/%EST%/$event->{TotScore}/g; + $text =~ s/%ESA%/$event->{AvgScore}/g; + $text =~ s/%ESM%/$event->{MaxScore}/g; + if ( $first_alarm_frame ) + { + $text =~ s/%EPI1%/$url?view=frame&mid=$event->{MonitorId}&eid=$event->{Id}&fid=$first_alarm_frame->{FrameId}/g; + $text =~ s/%EPIM%/$url?view=frame&mid=$event->{MonitorId}&eid=$event->{Id}&fid=$max_alarm_frame->{FrameId}/g; + if ( $attachments_ref && $text =~ s/%EI1%//g ) + { + push( @$attachments_ref, { type=>"image/jpeg", path=>sprintf( "%s/%0".ZM_EVENT_IMAGE_DIGITS."d-capture.jpg", getEventPath( $event ), $first_alarm_frame->{FrameId} ) } ); + } + if ( $attachments_ref && $text =~ s/%EIM%//g ) + { + # Don't attach the same image twice + if ( !@$attachments_ref || ($first_alarm_frame->{FrameId} != $max_alarm_frame->{FrameId} ) ) + { + push( @$attachments_ref, { type=>"image/jpeg", path=>sprintf( "%s/%0".ZM_EVENT_IMAGE_DIGITS."d-capture.jpg", getEventPath( $event ), $max_alarm_frame->{FrameId} ) } ); + } + } + } + if ( $attachments_ref && ZM_OPT_FFMPEG ) + { + if ( $text =~ s/%EV%//g ) + { + my ( $format, $path ) = generateVideo( $filter, $event ); + if ( !$format ) + { + return( undef ); + } + push( @$attachments_ref, { type=>"video/$format", path=>$path } ); + } + if ( $text =~ s/%EVM%//g ) + { + my ( $format, $path ) = generateVideo( $filter, $event, 1 ); + if ( !$format ) + { + return( undef ); + } + push( @$attachments_ref, { type=>"video/$format", path=>$path } ); + } + } + $text =~ s/%FN%/$filter->{Name}/g; + ( my $filter_name = $filter->{Name} ) =~ s/ /+/g; + $text =~ s/%FP%/$url?view=filter&mid=$event->{MonitorId}&filter_name=$filter_name/g; + + return( $text ); +} + +sub sendEmail +{ + my $filter = shift; + my $event = shift; + + if ( !ZM_FROM_EMAIL ) + { + Error( "No 'from' email address defined, not sending email" ); + return( 0 ); + } + if ( !ZM_EMAIL_ADDRESS ) + { + Error( "No email address defined, not sending email" ); + return( 0 ); + } + + Info( "Creating notification email\n" ); + + my $subject = substituteTags( ZM_EMAIL_SUBJECT, $filter, $event ); + return( 0 ) if ( !$subject ); + my @attachments; + my $body = substituteTags( ZM_EMAIL_BODY, $filter, $event, \@attachments ); + return( 0 ) if ( !$body ); + + Info( "Sending notification email '$subject'\n" ); + + eval + { + if ( ZM_NEW_MAIL_MODULES ) + { + ### Create the multipart container + my $mail = MIME::Lite->new ( + From => ZM_FROM_EMAIL, + To => ZM_EMAIL_ADDRESS, + Subject => $subject, + Type => "multipart/mixed" + ); + ### Add the text message part + $mail->attach ( + Type => "TEXT", + Data => $body + ); + ### Add the attachments + foreach my $attachment ( @attachments ) + { + Info( "Attaching '$attachment->{path}\n" ); + $mail->attach( + Path => $attachment->{path}, + Type => $attachment->{type}, + Disposition => "attachment" + ); + } + ### Send the Message + MIME::Lite->send( "smtp", ZM_EMAIL_HOST, Timeout=>60 ); + $mail->send(); + } + else + { + my $mail = MIME::Entity->build( + From => ZM_FROM_EMAIL, + To => ZM_EMAIL_ADDRESS, + Subject => $subject, + Type => (($body=~//)?'text/html':'text/plain'), + Data => $body + ); + + foreach my $attachment ( @attachments ) + { + Info( "Attaching '$attachment->{path}\n" ); + $mail->attach( + Path => $attachment->{path}, + Type => $attachment->{type}, + Encoding => "base64" + ); + } + $mail->smtpsend( Host => ZM_EMAIL_HOST, MailFrom => ZM_FROM_EMAIL ); + } + }; + if ( $@ ) + { + Error( "Can't send email: $@" ); + return( 0 ); + } + else + { + Info( "Notification email sent\n" ); + } + my $sql = "update Events set Emailed = 1 where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + + return( 1 ); +} + +sub sendMessage +{ + my $filter = shift; + my $event = shift; + + if ( !ZM_FROM_EMAIL ) + { + Error( "No 'from' email address defined, not sending message" ); + return( 0 ); + } + if ( !ZM_MESSAGE_ADDRESS ) + { + Error( "No message address defined, not sending message" ); + return( 0 ); + } + + Info( "Creating notification message\n" ); + + my $subject = substituteTags( ZM_MESSAGE_SUBJECT, $filter, $event ); + return( 0 ) if ( !$subject ); + my @attachments; + my $body = substituteTags( ZM_MESSAGE_BODY, $filter, $event, \@attachments ); + return( 0 ) if ( !$body ); + + Info( "Sending notification message '$subject'\n" ); + + eval + { + if ( ZM_NEW_MAIL_MODULES ) + { + ### Create the multipart container + my $mail = MIME::Lite->new ( + From => ZM_FROM_EMAIL, + To => ZM_MESSAGE_ADDRESS, + Subject => $subject, + Type => "multipart/mixed" + ); + ### Add the text message part + $mail->attach ( + Type => "TEXT", + Data => $body + ); + ### Add the attachments + foreach my $attachment ( @attachments ) + { + Info( "Attaching '$attachment->{path}\n" ); + $mail->attach( + Path => $attachment->{path}, + Type => $attachment->{type}, + Disposition => "attachment" + ); + } + ### Send the Message + MIME::Lite->send( "smtp", ZM_EMAIL_HOST, Timeout=>60 ); + $mail->send(); + } + else + { + my $mail = MIME::Entity->build( + From => ZM_FROM_EMAIL, + To => ZM_MESSAGE_ADDRESS, + Subject => $subject, + Type => (($body=~//)?'text/html':'text/plain'), + Data => $body + ); + + foreach my $attachment ( @attachments ) + { + Info( "Attaching '$attachment->{path}\n" ); + $mail->attach( + Path => $attachment->{path}, + Type => $attachment->{type}, + Encoding => "base64" + ); + } + $mail->smtpsend( Host => ZM_EMAIL_HOST, MailFrom => ZM_FROM_EMAIL ); + } + }; + if ( $@ ) + { + Error( "Can't send email: $@" ); + return( 0 ); + } + else + { + Info( "Notification message sent\n" ); + } + my $sql = "update Events set Messaged = 1 where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + + return( 1 ); +} + +sub executeCommand +{ + my $filter = shift; + my $event = shift; + + my $event_path = getEventPath( $event ); + + my $command = $filter->{AutoExecuteCmd}; + $command .= " $event_path"; + + Info( "Executing '$command'\n" ); + my $output = qx($command); + my $status = $? >> 8; + if ( $status || logDebugging() ) + { + chomp( $output ); + Debug( "Output: $output\n" ); + } + if ( $status ) + { + Error( "Command '$command' exited with status: $status\n" ); + return( 0 ); + } + else + { + my $sql = "update Events set Executed = 1 where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); + } + return( 1 ); +} + diff --git a/scripts/zmlogrotate.conf b/scripts/zmlogrotate.conf new file mode 100644 index 000000000..730b27bb0 --- /dev/null +++ b/scripts/zmlogrotate.conf @@ -0,0 +1,20 @@ +# First the log files + +/var/log/zm/*log { + weekly + rotate 3 + notifempty + missingok +} + +# Now the weekly db backup + +/var/lib/zm/zm_backup.sql { +weekly +rotate 3 +missingok +compress +postrotate +/usr/bin/zmdbbackup +endscript +} diff --git a/scripts/zmlogrotate.conf.in b/scripts/zmlogrotate.conf.in new file mode 100644 index 000000000..18f11adb8 --- /dev/null +++ b/scripts/zmlogrotate.conf.in @@ -0,0 +1,20 @@ +# First the log files + +/var/log/zm/*log { + weekly + rotate 3 + notifempty + missingok +} + +# Now the weekly db backup + +/var/lib/zm/zm_backup.sql { +weekly +rotate 3 +missingok +compress +postrotate +@BINDIR@/zmdbbackup +endscript +} diff --git a/scripts/zmpkg.pl b/scripts/zmpkg.pl new file mode 100644 index 000000000..632c4023f --- /dev/null +++ b/scripts/zmpkg.pl @@ -0,0 +1,247 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder Package Control Script, $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. +# +# ========================================================================== +# +# This script is used to start and stop the ZoneMinder package primarily to +# allow command line control for automatic restart on reboot (see zm script) +# +use strict; +use bytes; + +# ========================================================================== +# +# Don't change anything below here +# +# ========================================================================== + +use lib '/usr/share/perl/5.14.2'; # Include custom perl install path +use ZoneMinder; +use DBI; +use POSIX; +use Time::HiRes qw/gettimeofday/; + +# Detaint our environment +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +logInit(); + +my $command = $ARGV[0]; + +my $state; + +my $dbh = zmDbConnect(); + +if ( !$command || $command !~ /^(?:start|stop|restart|status|logrot)$/ ) +{ + if ( $command ) + { + # Check to see if it's a valid run state + my $sql = "select * from States where Name = '$command'"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or Fatal( "Can't execute: ".$sth->errstr() ); + if ( $state = $sth->fetchrow_hashref() ) + { + $state->{Name} = $command; + $state->{Definitions} = []; + foreach( split( /,/, $state->{Definition} ) ) + { + my ( $id, $function, $enabled ) = split( /:/, $_ ); + push( @{$state->{Definitions}}, { Id=>$id, Function=>$function, Enabled=>$enabled } ); + } + $command = 'state'; + } + else + { + $command = undef; + } + } + if ( !$command ) + { + print( "Usage: zmpkg.pl \n" ); + exit( -1 ); + } +} + +# Move to the right place +chdir( ZM_PATH_WEB ) or Fatal( "Can't chdir to '".ZM_PATH_WEB."': $!" ); + +my $dbg_id = ""; + +Info( "Command: $command\n" ); + +my $retval = 0; + +if ( $command eq "state" ) +{ + Info( "Updating DB: $state->{Name}\n" ); + my $sql = "select * from Monitors order by Id asc"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or Fatal( "Can't execute: ".$sth->errstr() ); + while( my $monitor = $sth->fetchrow_hashref() ) + { + foreach my $definition ( @{$state->{Definitions}} ) + { + if ( $monitor->{Id} =~ /^$definition->{Id}$/ ) + { + $monitor->{NewFunction} = $definition->{Function}; + $monitor->{NewEnabled} = $definition->{Enabled}; + } + } + #next if ( !$monitor->{NewFunction} ); + $monitor->{NewFunction} = 'None' if ( !$monitor->{NewFunction} ); + $monitor->{NewEnabled} = 0 if ( !$monitor->{NewEnabled} ); + if ( $monitor->{Function} ne $monitor->{NewFunction} || $monitor->{Enabled} ne $monitor->{NewEnabled} ) + { + my $sql = "update Monitors set Function = ?, Enabled = ? where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $monitor->{NewFunction}, $monitor->{NewEnabled}, $monitor->{Id} ) or Fatal( "Can't execute: ".$sth->errstr() ); + } + } + $sth->finish(); + + $command = "restart"; +} + +if ( $command =~ /^(?:stop|restart)$/ ) +{ + my $status = runCommand( "zmdc.pl check" ); + + if ( $status eq "running" ) + { + runCommand( "zmdc.pl shutdown" ); + zmMemTidy(); + } + else + { + $retval = 1; + } +} + +runCommand( "zmupdate.pl -f" ); + +if ( $command =~ /^(?:start|restart)$/ ) +{ + my $status = runCommand( "zmdc.pl check" ); + + if ( $status eq "stopped" ) + { + if ( ZM_DYN_DB_VERSION && ZM_DYN_DB_VERSION ne ZM_VERSION ) + { + Fatal( "Version mismatch, system is version ".ZM_VERSION.", database is ".ZM_DYN_DB_VERSION.", please run zmupdate.pl to update." ); + exit( -1 ); + } + + # Recreate the temporary directory if it's been wiped + if ( !-e "/tmp/zm" ) + { + Debug( "Recreating temporary directory '/tmp/zm'" ); + mkdir( "/tmp/zm", 0700 ) or Fatal( "Can't create missing temporary directory '/tmp/zm': $!" ); + my ( $runName ) = getpwuid( $> ); + if ( $runName ne ZM_WEB_USER ) + { + # Not running as web user, so should be root in whch case chown the temporary directory + my ( $webName, $webPass, $webUid, $webGid ) = getpwnam( ZM_WEB_USER ) or Fatal( "Can't get user details for web user '".ZM_WEB_USER."': $!" ); + chown( $webUid, $webGid, "/tmp/zm" ) or Fatal( "Can't change ownership of temporary directory '/tmp/zm' to '".ZM_WEB_USER.":".ZM_WEB_GROUP."': $!" ); + } + } + zmMemTidy(); + runCommand( "zmfix" ); + runCommand( "zmdc.pl startup" ); + + my $sql = "select * from Monitors"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or Fatal( "Can't execute: ".$sth->errstr() ); + while( my $monitor = $sth->fetchrow_hashref() ) + { + if ( $monitor->{Function} ne 'None' ) + { + if ( $monitor->{Type} eq 'Local' ) + { + runCommand( "zmdc.pl start zmc -d $monitor->{Device}" ); + } + else + { + runCommand( "zmdc.pl start zmc -m $monitor->{Id}" ); + } + if ( $monitor->{Function} ne 'Monitor' ) + { + if ( ZM_OPT_FRAME_SERVER ) + { + runCommand( "zmdc.pl start zmf -m $monitor->{Id}" ); + } + runCommand( "zmdc.pl start zma -m $monitor->{Id}" ); + } + if ( ZM_OPT_CONTROL ) + { + if ( $monitor->{Function} eq 'Modect' || $monitor->{Function} eq 'Mocord' ) + { + if ( $monitor->{Controllable} && $monitor->{TrackMotion} ) + { + runCommand( "zmdc.pl start zmtrack.pl -m $monitor->{Id}" ); + } + } + } + } + } + $sth->finish(); + + # This is now started unconditionally + runCommand( "zmdc.pl start zmfilter.pl" ); + if ( ZM_RUN_AUDIT ) + { + runCommand( "zmdc.pl start zmaudit.pl -c" ); + } + if ( ZM_OPT_TRIGGERS ) + { + runCommand( "zmdc.pl start zmtrigger.pl" ); + } + if ( ZM_OPT_X10 ) + { + runCommand( "zmdc.pl start zmx10.pl -c start" ); + } + runCommand( "zmdc.pl start zmwatch.pl" ); + if ( ZM_CHECK_FOR_UPDATES ) + { + runCommand( "zmdc.pl start zmupdate.pl -c" ); + } + } + else + { + $retval = 1; + } +} + +if ( $command eq "status" ) +{ + my $status = runCommand( "zmdc.pl check" ); + + print( STDOUT $status."\n" ); +} + +if ( $command eq "logrot" ) +{ + runCommand( "zmdc.pl logrot" ); +} + +exit( $retval ); diff --git a/scripts/zmpkg.pl.in b/scripts/zmpkg.pl.in new file mode 100644 index 000000000..1158a1a29 --- /dev/null +++ b/scripts/zmpkg.pl.in @@ -0,0 +1,247 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder Package Control Script, $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. +# +# ========================================================================== +# +# This script is used to start and stop the ZoneMinder package primarily to +# allow command line control for automatic restart on reboot (see zm script) +# +use strict; +use bytes; + +# ========================================================================== +# +# Don't change anything below here +# +# ========================================================================== + +@EXTRA_PERL_LIB@ +use ZoneMinder; +use DBI; +use POSIX; +use Time::HiRes qw/gettimeofday/; + +# Detaint our environment +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +logInit(); + +my $command = $ARGV[0]; + +my $state; + +my $dbh = zmDbConnect(); + +if ( !$command || $command !~ /^(?:start|stop|restart|status|logrot)$/ ) +{ + if ( $command ) + { + # Check to see if it's a valid run state + my $sql = "select * from States where Name = '$command'"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or Fatal( "Can't execute: ".$sth->errstr() ); + if ( $state = $sth->fetchrow_hashref() ) + { + $state->{Name} = $command; + $state->{Definitions} = []; + foreach( split( /,/, $state->{Definition} ) ) + { + my ( $id, $function, $enabled ) = split( /:/, $_ ); + push( @{$state->{Definitions}}, { Id=>$id, Function=>$function, Enabled=>$enabled } ); + } + $command = 'state'; + } + else + { + $command = undef; + } + } + if ( !$command ) + { + print( "Usage: zmpkg.pl \n" ); + exit( -1 ); + } +} + +# Move to the right place +chdir( ZM_PATH_WEB ) or Fatal( "Can't chdir to '".ZM_PATH_WEB."': $!" ); + +my $dbg_id = ""; + +Info( "Command: $command\n" ); + +my $retval = 0; + +if ( $command eq "state" ) +{ + Info( "Updating DB: $state->{Name}\n" ); + my $sql = "select * from Monitors order by Id asc"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or Fatal( "Can't execute: ".$sth->errstr() ); + while( my $monitor = $sth->fetchrow_hashref() ) + { + foreach my $definition ( @{$state->{Definitions}} ) + { + if ( $monitor->{Id} =~ /^$definition->{Id}$/ ) + { + $monitor->{NewFunction} = $definition->{Function}; + $monitor->{NewEnabled} = $definition->{Enabled}; + } + } + #next if ( !$monitor->{NewFunction} ); + $monitor->{NewFunction} = 'None' if ( !$monitor->{NewFunction} ); + $monitor->{NewEnabled} = 0 if ( !$monitor->{NewEnabled} ); + if ( $monitor->{Function} ne $monitor->{NewFunction} || $monitor->{Enabled} ne $monitor->{NewEnabled} ) + { + my $sql = "update Monitors set Function = ?, Enabled = ? where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $monitor->{NewFunction}, $monitor->{NewEnabled}, $monitor->{Id} ) or Fatal( "Can't execute: ".$sth->errstr() ); + } + } + $sth->finish(); + + $command = "restart"; +} + +if ( $command =~ /^(?:stop|restart)$/ ) +{ + my $status = runCommand( "zmdc.pl check" ); + + if ( $status eq "running" ) + { + runCommand( "zmdc.pl shutdown" ); + zmMemTidy(); + } + else + { + $retval = 1; + } +} + +runCommand( "zmupdate.pl -f" ); + +if ( $command =~ /^(?:start|restart)$/ ) +{ + my $status = runCommand( "zmdc.pl check" ); + + if ( $status eq "stopped" ) + { + if ( ZM_DYN_DB_VERSION && ZM_DYN_DB_VERSION ne ZM_VERSION ) + { + Fatal( "Version mismatch, system is version ".ZM_VERSION.", database is ".ZM_DYN_DB_VERSION.", please run zmupdate.pl to update." ); + exit( -1 ); + } + + # Recreate the temporary directory if it's been wiped + if ( !-e "@ZM_TMPDIR@" ) + { + Debug( "Recreating temporary directory '@ZM_TMPDIR@'" ); + mkdir( "@ZM_TMPDIR@", 0700 ) or Fatal( "Can't create missing temporary directory '@ZM_TMPDIR@': $!" ); + my ( $runName ) = getpwuid( $> ); + if ( $runName ne ZM_WEB_USER ) + { + # Not running as web user, so should be root in whch case chown the temporary directory + my ( $webName, $webPass, $webUid, $webGid ) = getpwnam( ZM_WEB_USER ) or Fatal( "Can't get user details for web user '".ZM_WEB_USER."': $!" ); + chown( $webUid, $webGid, "@ZM_TMPDIR@" ) or Fatal( "Can't change ownership of temporary directory '@ZM_TMPDIR@' to '".ZM_WEB_USER.":".ZM_WEB_GROUP."': $!" ); + } + } + zmMemTidy(); + runCommand( "zmfix" ); + runCommand( "zmdc.pl startup" ); + + my $sql = "select * from Monitors"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or Fatal( "Can't execute: ".$sth->errstr() ); + while( my $monitor = $sth->fetchrow_hashref() ) + { + if ( $monitor->{Function} ne 'None' ) + { + if ( $monitor->{Type} eq 'Local' ) + { + runCommand( "zmdc.pl start zmc -d $monitor->{Device}" ); + } + else + { + runCommand( "zmdc.pl start zmc -m $monitor->{Id}" ); + } + if ( $monitor->{Function} ne 'Monitor' ) + { + if ( ZM_OPT_FRAME_SERVER ) + { + runCommand( "zmdc.pl start zmf -m $monitor->{Id}" ); + } + runCommand( "zmdc.pl start zma -m $monitor->{Id}" ); + } + if ( ZM_OPT_CONTROL ) + { + if ( $monitor->{Function} eq 'Modect' || $monitor->{Function} eq 'Mocord' ) + { + if ( $monitor->{Controllable} && $monitor->{TrackMotion} ) + { + runCommand( "zmdc.pl start zmtrack.pl -m $monitor->{Id}" ); + } + } + } + } + } + $sth->finish(); + + # This is now started unconditionally + runCommand( "zmdc.pl start zmfilter.pl" ); + if ( ZM_RUN_AUDIT ) + { + runCommand( "zmdc.pl start zmaudit.pl -c" ); + } + if ( ZM_OPT_TRIGGERS ) + { + runCommand( "zmdc.pl start zmtrigger.pl" ); + } + if ( ZM_OPT_X10 ) + { + runCommand( "zmdc.pl start zmx10.pl -c start" ); + } + runCommand( "zmdc.pl start zmwatch.pl" ); + if ( ZM_CHECK_FOR_UPDATES ) + { + runCommand( "zmdc.pl start zmupdate.pl -c" ); + } + } + else + { + $retval = 1; + } +} + +if ( $command eq "status" ) +{ + my $status = runCommand( "zmdc.pl check" ); + + print( STDOUT $status."\n" ); +} + +if ( $command eq "logrot" ) +{ + runCommand( "zmdc.pl logrot" ); +} + +exit( $retval ); diff --git a/scripts/zmtrack.pl b/scripts/zmtrack.pl new file mode 100644 index 000000000..c80277005 --- /dev/null +++ b/scripts/zmtrack.pl @@ -0,0 +1,205 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder Experimental PTZ Tracking Script, $Date: 2009-06-08 10:11:56 +0100 (Mon, 08 Jun 2009) $, $Revision: 2908 $ +# 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. +# +# ========================================================================== +# +# This script is used to trigger and cancel alarms from external sources +# using an arbitrary text based format +# +use strict; +use bytes; + +# ========================================================================== +# +# User config +# +# ========================================================================== + +use constant SLEEP_TIME => 10000; # In microseconds + +# ========================================================================== +# +# Don't change anything from here on down +# +# ========================================================================== + +use ZoneMinder; +use DBI; +use POSIX; +use Data::Dumper; +use Getopt::Long; +use Time::HiRes qw( usleep ); + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +my $mid = 0; + +sub Usage +{ + print( " + Usage: zmtrack.pl -m ,--monitor=] + Parameters are :- + -m, --monitor= - Id of the monitor to track + "); + exit( -1 ); +} + +if ( !GetOptions( 'monitor=s'=>\$mid ) ) +{ + Usage(); +} + +logInit(); +logSetSignal(); + +my ( $detaint_mid ) = $mid =~ /^(\d+)$/; +$mid = $detaint_mid; + +print( "Tracker daemon $mid (experimental) starting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); + +my $dbh = zmDbConnect(); + +my $sql = "select C.*,M.* from Monitors as M left join Controls as C on M.ControlId = C.Id where M.Id = ?"; +my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + +my $res = $sth->execute( $mid ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); +my $monitor = $sth->fetchrow_hashref(); + +if ( !$monitor ) +{ + print( "Can't find monitor '$mid'\n" ); + exit( -1 ); +} +if ( !$monitor->{Controllable} ) +{ + print( "Monitor '$mid' is not controllable\n" ); + exit( -1 ); +} +if ( !$monitor->{TrackMotion} ) +{ + print( "Monitor '$mid' is not configured to track motion\n" ); + exit( -1 ); +} + +if ( !$monitor->{CanMoveMap} ) +{ + print( "Monitor '$mid' cannot move in map mode" ); + if ( $monitor->{CanMoveRel} ) + { + print( ", falling back to pseudo map mode\n" ); + } + else + { + print( "\n" ); + exit( -1 ); + } +} + +Debug( "Found monitor for id '$monitor'\n" ); +exit( -1 ) if ( !zmMemVerify( $monitor ) ); + +sub Suspend +{ + my $monitor = shift; + zmMonitorSuspend( $monitor ); +} + +sub Resume +{ + my $monitor = shift; + sleep( $monitor->{TrackDelay} ); + zmMonitorResume( $monitor ); +} + +sub Track +{ + my $monitor = shift; + my ( $x, $y ) = @_; + my ( $detaint_x ) = $x =~ /^(\d+)$/; $x = $detaint_x; + my ( $detaint_y ) = $y =~ /^(\d+)$/; $y = $detaint_y; + + my $ctrlCommand = ZM_PATH_BIN."/zmcontrol.pl -i ".$monitor->{Id}; + $ctrlCommand .= " --command=".($monitor->{CanMoveMap}?"moveMap":"movePseudoMap")." --xcoord=$x --ycoord=$y"; + executeShellCommand( $ctrlCommand ); +} + +sub Return +{ + my $monitor = shift; + + my $ctrlCommand = ZM_PATH_BIN."/zmcontrol.pl -i ".$monitor->{Id}; + if ( $monitor->{ReturnLocation} > 0 ) + { + $ctrlCommand .= " --command=presetGoto --preset=".$monitor->{ReturnLocation}; + } + else + { + $ctrlCommand .= " --command=presetHome"; + } + executeShellCommand( $ctrlCommand ); +} + +my $last_alarm = 0; +if ( ($monitor->{ReturnLocation} >= 0) ) +{ + Suspend( $monitor ); + Return( $monitor ); + Resume( $monitor ); +} + +my $alarmed = undef; +while( 1 ) +{ + if ( zmIsAlarmed( $monitor ) ) + { + my ( $alarm_x, $alarm_y ) = zmGetAlarmLocation( $monitor ); + if ( $alarm_x >= 0 && $alarm_y >= 0 ) + { + Debug( "Got alarm at $alarm_x, $alarm_y\n" ); + Suspend( $monitor ); + Track( $monitor, $alarm_x, $alarm_y ); + Resume( $monitor ); + $last_alarm = time(); + $alarmed = !undef; + } + } + else + { + if ( logDebugging() && $alarmed ) + { + print( "Left alarm state\n" ); + $alarmed = undef; + } + if ( ($monitor->{ReturnLocation} >= 0) && ($last_alarm > 0) && ((time()-$last_alarm) > $monitor->{ReturnDelay}) ) + { + Debug( "Returning to location ".$monitor->{ReturnLocation}."\n" ); + Suspend( $monitor ); + Return( $monitor ); + Resume( $monitor ); + $last_alarm = 0; + } + } + usleep( SLEEP_TIME ); +} diff --git a/scripts/zmtrack.pl.in b/scripts/zmtrack.pl.in new file mode 100644 index 000000000..c80277005 --- /dev/null +++ b/scripts/zmtrack.pl.in @@ -0,0 +1,205 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder Experimental PTZ Tracking Script, $Date: 2009-06-08 10:11:56 +0100 (Mon, 08 Jun 2009) $, $Revision: 2908 $ +# 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. +# +# ========================================================================== +# +# This script is used to trigger and cancel alarms from external sources +# using an arbitrary text based format +# +use strict; +use bytes; + +# ========================================================================== +# +# User config +# +# ========================================================================== + +use constant SLEEP_TIME => 10000; # In microseconds + +# ========================================================================== +# +# Don't change anything from here on down +# +# ========================================================================== + +use ZoneMinder; +use DBI; +use POSIX; +use Data::Dumper; +use Getopt::Long; +use Time::HiRes qw( usleep ); + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +my $mid = 0; + +sub Usage +{ + print( " + Usage: zmtrack.pl -m ,--monitor=] + Parameters are :- + -m, --monitor= - Id of the monitor to track + "); + exit( -1 ); +} + +if ( !GetOptions( 'monitor=s'=>\$mid ) ) +{ + Usage(); +} + +logInit(); +logSetSignal(); + +my ( $detaint_mid ) = $mid =~ /^(\d+)$/; +$mid = $detaint_mid; + +print( "Tracker daemon $mid (experimental) starting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); + +my $dbh = zmDbConnect(); + +my $sql = "select C.*,M.* from Monitors as M left join Controls as C on M.ControlId = C.Id where M.Id = ?"; +my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + +my $res = $sth->execute( $mid ) or Fatal( "Can't execute '$sql': ".$sth->errstr() ); +my $monitor = $sth->fetchrow_hashref(); + +if ( !$monitor ) +{ + print( "Can't find monitor '$mid'\n" ); + exit( -1 ); +} +if ( !$monitor->{Controllable} ) +{ + print( "Monitor '$mid' is not controllable\n" ); + exit( -1 ); +} +if ( !$monitor->{TrackMotion} ) +{ + print( "Monitor '$mid' is not configured to track motion\n" ); + exit( -1 ); +} + +if ( !$monitor->{CanMoveMap} ) +{ + print( "Monitor '$mid' cannot move in map mode" ); + if ( $monitor->{CanMoveRel} ) + { + print( ", falling back to pseudo map mode\n" ); + } + else + { + print( "\n" ); + exit( -1 ); + } +} + +Debug( "Found monitor for id '$monitor'\n" ); +exit( -1 ) if ( !zmMemVerify( $monitor ) ); + +sub Suspend +{ + my $monitor = shift; + zmMonitorSuspend( $monitor ); +} + +sub Resume +{ + my $monitor = shift; + sleep( $monitor->{TrackDelay} ); + zmMonitorResume( $monitor ); +} + +sub Track +{ + my $monitor = shift; + my ( $x, $y ) = @_; + my ( $detaint_x ) = $x =~ /^(\d+)$/; $x = $detaint_x; + my ( $detaint_y ) = $y =~ /^(\d+)$/; $y = $detaint_y; + + my $ctrlCommand = ZM_PATH_BIN."/zmcontrol.pl -i ".$monitor->{Id}; + $ctrlCommand .= " --command=".($monitor->{CanMoveMap}?"moveMap":"movePseudoMap")." --xcoord=$x --ycoord=$y"; + executeShellCommand( $ctrlCommand ); +} + +sub Return +{ + my $monitor = shift; + + my $ctrlCommand = ZM_PATH_BIN."/zmcontrol.pl -i ".$monitor->{Id}; + if ( $monitor->{ReturnLocation} > 0 ) + { + $ctrlCommand .= " --command=presetGoto --preset=".$monitor->{ReturnLocation}; + } + else + { + $ctrlCommand .= " --command=presetHome"; + } + executeShellCommand( $ctrlCommand ); +} + +my $last_alarm = 0; +if ( ($monitor->{ReturnLocation} >= 0) ) +{ + Suspend( $monitor ); + Return( $monitor ); + Resume( $monitor ); +} + +my $alarmed = undef; +while( 1 ) +{ + if ( zmIsAlarmed( $monitor ) ) + { + my ( $alarm_x, $alarm_y ) = zmGetAlarmLocation( $monitor ); + if ( $alarm_x >= 0 && $alarm_y >= 0 ) + { + Debug( "Got alarm at $alarm_x, $alarm_y\n" ); + Suspend( $monitor ); + Track( $monitor, $alarm_x, $alarm_y ); + Resume( $monitor ); + $last_alarm = time(); + $alarmed = !undef; + } + } + else + { + if ( logDebugging() && $alarmed ) + { + print( "Left alarm state\n" ); + $alarmed = undef; + } + if ( ($monitor->{ReturnLocation} >= 0) && ($last_alarm > 0) && ((time()-$last_alarm) > $monitor->{ReturnDelay}) ) + { + Debug( "Returning to location ".$monitor->{ReturnLocation}."\n" ); + Suspend( $monitor ); + Return( $monitor ); + Resume( $monitor ); + $last_alarm = 0; + } + } + usleep( SLEEP_TIME ); +} diff --git a/scripts/zmtrigger.pl b/scripts/zmtrigger.pl new file mode 100644 index 000000000..204d95153 --- /dev/null +++ b/scripts/zmtrigger.pl @@ -0,0 +1,440 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder External Trigger Script, $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. +# +# ========================================================================== +# +# This script is used to trigger and cancel alarms from external connections +# using an arbitrary text based format +# +# ========================================================================== +use strict; +use bytes; + +# ========================================================================== +# +# User config +# +# ========================================================================== + +use constant MAX_CONNECT_DELAY => 10; +use constant MONITOR_RELOAD_INTERVAL => 300; +use constant SELECT_TIMEOUT => 0.25; + +# ========================================================================== +# +# Channel/Connection Modules +# +# ========================================================================== + +use lib '/usr/share/perl/5.14.2'; # Include custom perl install path +use ZoneMinder; +use ZoneMinder::Trigger::Channel::Inet; +use ZoneMinder::Trigger::Channel::Unix; +use ZoneMinder::Trigger::Channel::Serial; +use ZoneMinder::Trigger::Connection; + +my @connections; +push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan1", channel=>ZoneMinder::Trigger::Channel::Inet->new( port=>6802 ), mode=>"rw" ) ); +push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan2", channel=>ZoneMinder::Trigger::Channel::Unix->new( path=>ZM_PATH_SOCKS.'/zmtrigger.sock' ), mode=>"rw" ) ); +#push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan3", channel=>ZoneMinder::Trigger::Channel::File->new( path=>'/tmp/zmtrigger.out' ), mode=>"w" ) ); +push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan4", channel=>ZoneMinder::Trigger::Channel::Serial->new( path=>'/dev/ttyS0' ), mode=>"rw" ) ); + +# ========================================================================== +# +# Don't change anything from here on down +# +# ========================================================================== + +use DBI; +#use Socket; +use Data::Dumper; +use POSIX qw( EINTR ); +use Time::HiRes qw( usleep ); + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +logInit(); +logSetSignal(); + +Info( "Trigger daemon starting\n" ); + +my $dbh = zmDbConnect(); + +my $base_rin = ''; +foreach my $connection ( @connections ) +{ + Info( "Opening connection '$connection->{name}'\n" ); + $connection->open(); +} + +my @in_select_connections = grep { $_->input() && $_->selectable() } @connections; +my @in_poll_connections = grep { $_->input() && !$_->selectable() } @connections; +my @out_connections = grep { $_->output() } @connections; + +foreach my $connection ( @in_select_connections ) +{ + vec( $base_rin, $connection->fileno(), 1 ) = 1; +} + +my %spawned_connections; +my %monitors; + +my $monitor_reload_time = 0; + +$! = undef; +my $rin = ''; +my $win = $rin; +my $ein = $win; +my $timeout = SELECT_TIMEOUT; +my %actions; +while( 1 ) +{ + $rin = $base_rin; + # Add the file descriptors of any spawned connections + foreach my $fileno ( keys(%spawned_connections) ) + { + vec( $rin, $fileno, 1 ) = 1; + } + + my $nfound = select( my $rout = $rin, undef, my $eout = $ein, $timeout ); + if ( $nfound > 0 ) + { + Debug( "Got input from $nfound connections\n" ); + foreach my $connection ( @in_select_connections ) + { + if ( vec( $rout, $connection->fileno(), 1 ) ) + { + Debug( "Got input from connection ".$connection->name()." (".$connection->fileno().")\n" ); + if ( $connection->spawns() ) + { + my $new_connection = $connection->accept(); + $spawned_connections{$new_connection->fileno()} = $new_connection; + Debug( "Added new spawned connection (".$new_connection->fileno()."), ".int(keys(%spawned_connections))." spawned connections\n" ); + } + else + { + my $messages = $connection->getMessages(); + if ( defined($messages) ) + { + foreach my $message ( @$messages ) + { + handleMessage( $connection, $message ); + } + } + } + } + } + foreach my $connection ( values(%spawned_connections) ) + { + if ( vec( $rout, $connection->fileno(), 1 ) ) + { + Debug( "Got input from spawned connection ".$connection->name()." (".$connection->fileno().")\n" ); + my $messages = $connection->getMessages(); + if ( defined($messages) ) + { + foreach my $message ( @$messages ) + { + handleMessage( $connection, $message ); + } + } + else + { + delete( $spawned_connections{$connection->fileno()} ); + Debug( "Removed spawned connection (".$connection->fileno()."), ".int(keys(%spawned_connections))." spawned connections\n" ); + $connection->close(); + } + } + } + } + elsif ( $nfound < 0 ) + { + if ( $! == EINTR ) + { + # Do nothing + } + else + { + Fatal( "Can't select: $!" ); + } + } + + # Check polled connections + foreach my $connection ( @in_poll_connections ) + { + my $messages = $connection->getMessages(); + if ( defined($messages) ) + { + foreach my $message ( @$messages ) + { + handleMessage( $connection, $message ); + } + } + } + + # Check for alarms that might have happened + my @out_messages; + foreach my $monitor ( values(%monitors) ) + { + my ( $state, $last_event ) = zmMemRead( $monitor, [ "shared_data:state", "shared_data:last_event" ] ); + + #print( "$monitor->{Id}: S:$state, LE:$last_event\n" ); + #print( "$monitor->{Id}: mS:$monitor->{LastState}, mLE:$monitor->{LastEvent}\n" ); + if ( $state == STATE_ALARM || $state == STATE_ALERT ) # In alarm state + { + if ( !defined($monitor->{LastEvent}) || ($last_event != $monitor->{LastEvent}) ) # A new event + { + push( @out_messages, $monitor->{Id}."|on|".time()."|".$last_event ); + } + else # The same one as last time, so ignore it + { + # Do nothing + } + } + elsif ( ($state == STATE_IDLE && $monitor->{LastState} != STATE_IDLE) || ($state == STATE_TAPE && $monitor->{LastState} != STATE_TAPE) ) # Out of alarm state + { + push( @out_messages, $monitor->{Id}."|off|".time()."|".$last_event ); + } + elsif ( defined($monitor->{LastEvent}) && ($last_event != $monitor->{LastEvent}) ) # We've missed a whole event + { + push( @out_messages, $monitor->{Id}."|on|".time()."|".$last_event ); + push( @out_messages, $monitor->{Id}."|off|".time()."|".$last_event ); + } + $monitor->{LastState} = $state; + $monitor->{LastEvent} = $last_event; + } + foreach my $connection ( @out_connections ) + { + if ( $connection->canWrite() ) + { + $connection->putMessages( \@out_messages ); + } + } + foreach my $connection ( values(%spawned_connections) ) + { + if ( $connection->canWrite() ) + { + $connection->putMessages( \@out_messages ); + } + } + + Debug( "Checking for timed actions\n" ) if ( int(keys(%actions)) ); + my $now = time(); + foreach my $action_time ( sort( grep { $_ < $now } keys( %actions ) ) ) + { + Info( "Found actions expiring at $action_time\n" ); + foreach my $action ( @{$actions{$action_time}} ) + { + my $connection = $action->{connection}; + my $message = $action->{message}; + Info( "Found action '$message'\n" ); + handleMessage( $connection, $message ); + } + delete( $actions{$action_time} ); + } + + # Allow connections to do their own timed actions + foreach my $connection ( @connections ) + { + my $messages = $connection->timedActions(); + if ( defined($messages) ) + { + foreach my $message ( @$messages ) + { + handleMessage( $connection, $message ); + } + } + } + foreach my $connection ( values(%spawned_connections) ) + { + my $messages = $connection->timedActions(); + if ( defined($messages) ) + { + foreach my $message ( @$messages ) + { + handleMessage( $connection, $message ); + } + } + } + + # If necessary reload monitors + if ( (time() - $monitor_reload_time) > MONITOR_RELOAD_INTERVAL ) + { + foreach my $monitor ( values(%monitors) ) + { + # Free up any used memory handle + zmMemInvalidate( $monitor ); + } + loadMonitors(); + } +} +Info( "Trigger daemon exiting\n" ); +exit; + +sub loadMonitors +{ + Debug( "Loading monitors\n" ); + $monitor_reload_time = time(); + + my %new_monitors = (); + + my $sql = "select * from Monitors where find_in_set( Function, 'Modect,Mocord,Nodect' )"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or Fatal( "Can't execute: ".$sth->errstr() ); + while( my $monitor = $sth->fetchrow_hashref() ) + { + next if ( !zmMemVerify( $monitor ) ); # Check shared memory ok + + if ( defined($monitors{$monitor->{Id}}->{LastState}) ) + { + $monitor->{LastState} = $monitors{$monitor->{Id}}->{LastState}; + } + else + { + $monitor->{LastState} = zmGetMonitorState( $monitor ); + } + if ( defined($monitors{$monitor->{Id}}->{LastEvent}) ) + { + $monitor->{LastEvent} = $monitors{$monitor->{Id}}->{LastEvent}; + } + else + { + $monitor->{LastEvent} = zmGetLastEvent( $monitor ); + } + $new_monitors{$monitor->{Id}} = $monitor; + } + %monitors = %new_monitors; +} + +sub handleMessage +{ + my $connection = shift; + my $message = shift; + + my ( $id, $action, $score, $cause, $text, $showtext ) = split( /\|/, $message ); + $score = 0 if ( !defined($score) ); + $cause = "" if ( !defined($cause) ); + $text = "" if ( !defined($text) ); + + my $monitor = $monitors{$id}; + if ( !$monitor ) + { + Warning( "Can't find monitor '$id' for message '$message'\n" ); + return; + } + Debug( "Found monitor for id '$id'\n" ); + + next if ( !zmMemVerify( $monitor ) ); + + Debug( "Handling action '$action'\n" ); + if ( $action =~ /^(enable|disable)(?:\+(\d+))?$/ ) + { + my $state = $1; + my $delay = $2; + if ( $state eq "enable" ) + { + zmMonitorEnable( $monitor ); + } + else + { + zmMonitorDisable( $monitor ); + } + # Force a reload + $monitor_reload_time = 0; + Info( "Set monitor to $state\n" ); + if ( $delay ) + { + my $action_time = time()+$delay; + my $action_text = $id."|".(($state eq "enable")?"disable":"enable"); + my $action_array = $actions{$action_time}; + if ( !$action_array ) + { + $action_array = $actions{$action_time} = []; + } + push( @$action_array, { connection=>$connection, message=>$action_text } ); + Debug( "Added timed event '$action_text', expires at $action_time (+$delay secs)\n" ); + } + } + elsif ( $action =~ /^(on|off)(?:\+(\d+))?$/ ) + { + next if ( !$monitor->{Enabled} ); + + my $trigger = $1; + my $delay = $2; + my $trigger_data; + if ( $trigger eq "on" ) + { + zmTriggerEventOn( $monitor, $score, $cause, $text ); + zmTriggerShowtext( $monitor, $showtext ) if defined($showtext); + Info( "Trigger '$trigger' '$cause'\n" ); + } + elsif ( $trigger eq "off" ) + { + my $last_event = zmGetLastEvent( $monitor ); + zmTriggerEventOff( $monitor ); + zmTriggerShowtext( $monitor, $showtext ) if defined($showtext); + Info( "Trigger '$trigger'\n" ); + # Wait til it's finished + while( zmInAlarm( $monitor ) && ($last_event == zmGetLastEvent( $monitor )) ) + { + # Tenth of a second + usleep( 100000 ); + } + zmTriggerEventCancel( $monitor ); + } + else + { + Info( "Trigger '$trigger'\n" ); + zmTriggerEventCancel( $monitor ); + } + if ( $delay ) + { + my $action_time = time()+$delay; + #my $action_text = $id."|cancel|0|".$cause."|".$text; + my $action_text = $id."|cancel"; + my $action_array = $actions{$action_time}; + if ( !$action_array ) + { + $action_array = $actions{$action_time} = []; + } + push( @$action_array, { connection=>$connection, message=>$action_text } ); + Debug( "Added timed event '$action_text', expires at $action_time (+$delay secs)\n" ); + } + } + elsif( $action eq "cancel" ) + { + zmTriggerEventCancel( $monitor ); + zmTriggerShowtext( $monitor, $showtext ) if defined($showtext); + Info( "Cancelled event\n" ); + } + elsif( $action eq "show" ) + { + zmTriggerShowtext( $monitor, $showtext ); + Info( "Updated show text to '$showtext'\n" ); + } + else + { + Error( "Unrecognised action '$action' in message '$message'\n" ); + } +} diff --git a/scripts/zmtrigger.pl.in b/scripts/zmtrigger.pl.in new file mode 100644 index 000000000..11c5c9a29 --- /dev/null +++ b/scripts/zmtrigger.pl.in @@ -0,0 +1,440 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder External Trigger Script, $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. +# +# ========================================================================== +# +# This script is used to trigger and cancel alarms from external connections +# using an arbitrary text based format +# +# ========================================================================== +use strict; +use bytes; + +# ========================================================================== +# +# User config +# +# ========================================================================== + +use constant MAX_CONNECT_DELAY => 10; +use constant MONITOR_RELOAD_INTERVAL => 300; +use constant SELECT_TIMEOUT => 0.25; + +# ========================================================================== +# +# Channel/Connection Modules +# +# ========================================================================== + +@EXTRA_PERL_LIB@ +use ZoneMinder; +use ZoneMinder::Trigger::Channel::Inet; +use ZoneMinder::Trigger::Channel::Unix; +use ZoneMinder::Trigger::Channel::Serial; +use ZoneMinder::Trigger::Connection; + +my @connections; +push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan1", channel=>ZoneMinder::Trigger::Channel::Inet->new( port=>6802 ), mode=>"rw" ) ); +push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan2", channel=>ZoneMinder::Trigger::Channel::Unix->new( path=>ZM_PATH_SOCKS.'/zmtrigger.sock' ), mode=>"rw" ) ); +#push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan3", channel=>ZoneMinder::Trigger::Channel::File->new( path=>'/tmp/zmtrigger.out' ), mode=>"w" ) ); +push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan4", channel=>ZoneMinder::Trigger::Channel::Serial->new( path=>'/dev/ttyS0' ), mode=>"rw" ) ); + +# ========================================================================== +# +# Don't change anything from here on down +# +# ========================================================================== + +use DBI; +#use Socket; +use Data::Dumper; +use POSIX qw( EINTR ); +use Time::HiRes qw( usleep ); + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +logInit(); +logSetSignal(); + +Info( "Trigger daemon starting\n" ); + +my $dbh = zmDbConnect(); + +my $base_rin = ''; +foreach my $connection ( @connections ) +{ + Info( "Opening connection '$connection->{name}'\n" ); + $connection->open(); +} + +my @in_select_connections = grep { $_->input() && $_->selectable() } @connections; +my @in_poll_connections = grep { $_->input() && !$_->selectable() } @connections; +my @out_connections = grep { $_->output() } @connections; + +foreach my $connection ( @in_select_connections ) +{ + vec( $base_rin, $connection->fileno(), 1 ) = 1; +} + +my %spawned_connections; +my %monitors; + +my $monitor_reload_time = 0; + +$! = undef; +my $rin = ''; +my $win = $rin; +my $ein = $win; +my $timeout = SELECT_TIMEOUT; +my %actions; +while( 1 ) +{ + $rin = $base_rin; + # Add the file descriptors of any spawned connections + foreach my $fileno ( keys(%spawned_connections) ) + { + vec( $rin, $fileno, 1 ) = 1; + } + + my $nfound = select( my $rout = $rin, undef, my $eout = $ein, $timeout ); + if ( $nfound > 0 ) + { + Debug( "Got input from $nfound connections\n" ); + foreach my $connection ( @in_select_connections ) + { + if ( vec( $rout, $connection->fileno(), 1 ) ) + { + Debug( "Got input from connection ".$connection->name()." (".$connection->fileno().")\n" ); + if ( $connection->spawns() ) + { + my $new_connection = $connection->accept(); + $spawned_connections{$new_connection->fileno()} = $new_connection; + Debug( "Added new spawned connection (".$new_connection->fileno()."), ".int(keys(%spawned_connections))." spawned connections\n" ); + } + else + { + my $messages = $connection->getMessages(); + if ( defined($messages) ) + { + foreach my $message ( @$messages ) + { + handleMessage( $connection, $message ); + } + } + } + } + } + foreach my $connection ( values(%spawned_connections) ) + { + if ( vec( $rout, $connection->fileno(), 1 ) ) + { + Debug( "Got input from spawned connection ".$connection->name()." (".$connection->fileno().")\n" ); + my $messages = $connection->getMessages(); + if ( defined($messages) ) + { + foreach my $message ( @$messages ) + { + handleMessage( $connection, $message ); + } + } + else + { + delete( $spawned_connections{$connection->fileno()} ); + Debug( "Removed spawned connection (".$connection->fileno()."), ".int(keys(%spawned_connections))." spawned connections\n" ); + $connection->close(); + } + } + } + } + elsif ( $nfound < 0 ) + { + if ( $! == EINTR ) + { + # Do nothing + } + else + { + Fatal( "Can't select: $!" ); + } + } + + # Check polled connections + foreach my $connection ( @in_poll_connections ) + { + my $messages = $connection->getMessages(); + if ( defined($messages) ) + { + foreach my $message ( @$messages ) + { + handleMessage( $connection, $message ); + } + } + } + + # Check for alarms that might have happened + my @out_messages; + foreach my $monitor ( values(%monitors) ) + { + my ( $state, $last_event ) = zmMemRead( $monitor, [ "shared_data:state", "shared_data:last_event" ] ); + + #print( "$monitor->{Id}: S:$state, LE:$last_event\n" ); + #print( "$monitor->{Id}: mS:$monitor->{LastState}, mLE:$monitor->{LastEvent}\n" ); + if ( $state == STATE_ALARM || $state == STATE_ALERT ) # In alarm state + { + if ( !defined($monitor->{LastEvent}) || ($last_event != $monitor->{LastEvent}) ) # A new event + { + push( @out_messages, $monitor->{Id}."|on|".time()."|".$last_event ); + } + else # The same one as last time, so ignore it + { + # Do nothing + } + } + elsif ( ($state == STATE_IDLE && $monitor->{LastState} != STATE_IDLE) || ($state == STATE_TAPE && $monitor->{LastState} != STATE_TAPE) ) # Out of alarm state + { + push( @out_messages, $monitor->{Id}."|off|".time()."|".$last_event ); + } + elsif ( defined($monitor->{LastEvent}) && ($last_event != $monitor->{LastEvent}) ) # We've missed a whole event + { + push( @out_messages, $monitor->{Id}."|on|".time()."|".$last_event ); + push( @out_messages, $monitor->{Id}."|off|".time()."|".$last_event ); + } + $monitor->{LastState} = $state; + $monitor->{LastEvent} = $last_event; + } + foreach my $connection ( @out_connections ) + { + if ( $connection->canWrite() ) + { + $connection->putMessages( \@out_messages ); + } + } + foreach my $connection ( values(%spawned_connections) ) + { + if ( $connection->canWrite() ) + { + $connection->putMessages( \@out_messages ); + } + } + + Debug( "Checking for timed actions\n" ) if ( int(keys(%actions)) ); + my $now = time(); + foreach my $action_time ( sort( grep { $_ < $now } keys( %actions ) ) ) + { + Info( "Found actions expiring at $action_time\n" ); + foreach my $action ( @{$actions{$action_time}} ) + { + my $connection = $action->{connection}; + my $message = $action->{message}; + Info( "Found action '$message'\n" ); + handleMessage( $connection, $message ); + } + delete( $actions{$action_time} ); + } + + # Allow connections to do their own timed actions + foreach my $connection ( @connections ) + { + my $messages = $connection->timedActions(); + if ( defined($messages) ) + { + foreach my $message ( @$messages ) + { + handleMessage( $connection, $message ); + } + } + } + foreach my $connection ( values(%spawned_connections) ) + { + my $messages = $connection->timedActions(); + if ( defined($messages) ) + { + foreach my $message ( @$messages ) + { + handleMessage( $connection, $message ); + } + } + } + + # If necessary reload monitors + if ( (time() - $monitor_reload_time) > MONITOR_RELOAD_INTERVAL ) + { + foreach my $monitor ( values(%monitors) ) + { + # Free up any used memory handle + zmMemInvalidate( $monitor ); + } + loadMonitors(); + } +} +Info( "Trigger daemon exiting\n" ); +exit; + +sub loadMonitors +{ + Debug( "Loading monitors\n" ); + $monitor_reload_time = time(); + + my %new_monitors = (); + + my $sql = "select * from Monitors where find_in_set( Function, 'Modect,Mocord,Nodect' )"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or Fatal( "Can't execute: ".$sth->errstr() ); + while( my $monitor = $sth->fetchrow_hashref() ) + { + next if ( !zmMemVerify( $monitor ) ); # Check shared memory ok + + if ( defined($monitors{$monitor->{Id}}->{LastState}) ) + { + $monitor->{LastState} = $monitors{$monitor->{Id}}->{LastState}; + } + else + { + $monitor->{LastState} = zmGetMonitorState( $monitor ); + } + if ( defined($monitors{$monitor->{Id}}->{LastEvent}) ) + { + $monitor->{LastEvent} = $monitors{$monitor->{Id}}->{LastEvent}; + } + else + { + $monitor->{LastEvent} = zmGetLastEvent( $monitor ); + } + $new_monitors{$monitor->{Id}} = $monitor; + } + %monitors = %new_monitors; +} + +sub handleMessage +{ + my $connection = shift; + my $message = shift; + + my ( $id, $action, $score, $cause, $text, $showtext ) = split( /\|/, $message ); + $score = 0 if ( !defined($score) ); + $cause = "" if ( !defined($cause) ); + $text = "" if ( !defined($text) ); + + my $monitor = $monitors{$id}; + if ( !$monitor ) + { + Warning( "Can't find monitor '$id' for message '$message'\n" ); + return; + } + Debug( "Found monitor for id '$id'\n" ); + + next if ( !zmMemVerify( $monitor ) ); + + Debug( "Handling action '$action'\n" ); + if ( $action =~ /^(enable|disable)(?:\+(\d+))?$/ ) + { + my $state = $1; + my $delay = $2; + if ( $state eq "enable" ) + { + zmMonitorEnable( $monitor ); + } + else + { + zmMonitorDisable( $monitor ); + } + # Force a reload + $monitor_reload_time = 0; + Info( "Set monitor to $state\n" ); + if ( $delay ) + { + my $action_time = time()+$delay; + my $action_text = $id."|".(($state eq "enable")?"disable":"enable"); + my $action_array = $actions{$action_time}; + if ( !$action_array ) + { + $action_array = $actions{$action_time} = []; + } + push( @$action_array, { connection=>$connection, message=>$action_text } ); + Debug( "Added timed event '$action_text', expires at $action_time (+$delay secs)\n" ); + } + } + elsif ( $action =~ /^(on|off)(?:\+(\d+))?$/ ) + { + next if ( !$monitor->{Enabled} ); + + my $trigger = $1; + my $delay = $2; + my $trigger_data; + if ( $trigger eq "on" ) + { + zmTriggerEventOn( $monitor, $score, $cause, $text ); + zmTriggerShowtext( $monitor, $showtext ) if defined($showtext); + Info( "Trigger '$trigger' '$cause'\n" ); + } + elsif ( $trigger eq "off" ) + { + my $last_event = zmGetLastEvent( $monitor ); + zmTriggerEventOff( $monitor ); + zmTriggerShowtext( $monitor, $showtext ) if defined($showtext); + Info( "Trigger '$trigger'\n" ); + # Wait til it's finished + while( zmInAlarm( $monitor ) && ($last_event == zmGetLastEvent( $monitor )) ) + { + # Tenth of a second + usleep( 100000 ); + } + zmTriggerEventCancel( $monitor ); + } + else + { + Info( "Trigger '$trigger'\n" ); + zmTriggerEventCancel( $monitor ); + } + if ( $delay ) + { + my $action_time = time()+$delay; + #my $action_text = $id."|cancel|0|".$cause."|".$text; + my $action_text = $id."|cancel"; + my $action_array = $actions{$action_time}; + if ( !$action_array ) + { + $action_array = $actions{$action_time} = []; + } + push( @$action_array, { connection=>$connection, message=>$action_text } ); + Debug( "Added timed event '$action_text', expires at $action_time (+$delay secs)\n" ); + } + } + elsif( $action eq "cancel" ) + { + zmTriggerEventCancel( $monitor ); + zmTriggerShowtext( $monitor, $showtext ) if defined($showtext); + Info( "Cancelled event\n" ); + } + elsif( $action eq "show" ) + { + zmTriggerShowtext( $monitor, $showtext ); + Info( "Updated show text to '$showtext'\n" ); + } + else + { + Error( "Unrecognised action '$action' in message '$message'\n" ); + } +} diff --git a/scripts/zmupdate.pl b/scripts/zmupdate.pl new file mode 100644 index 000000000..7aa64ac3a --- /dev/null +++ b/scripts/zmupdate.pl @@ -0,0 +1,984 @@ +#!/usr/bin/perl -w +# +# ========================================================================== +# +# ZoneMinder Update Script, $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. +# +# ========================================================================== +# +# This script just checks what the most recent release of ZoneMinder is +# at the the moment. It will eventually be responsible for applying and +# configuring upgrades etc, including on the fly upgrades. +# +use strict; +use bytes; + +# ========================================================================== +# +# These are the elements you can edit to suit your installation +# +# ========================================================================== + +use constant CHECK_INTERVAL => (1*24*60*60); # Interval between version checks + +# ========================================================================== +# +# Don't change anything below here +# +# ========================================================================== + +use lib '/usr/share/perl/5.14.2'; # Include custom perl install path +use ZoneMinder::Base qw(:all); +use ZoneMinder::Config qw(:all); +use ZoneMinder::Logger qw(:all); +use ZoneMinder::General qw(:all); +use ZoneMinder::Database qw(:all); +use ZoneMinder::ConfigAdmin qw( :functions ); +use POSIX; +use DBI; +use Getopt::Long; +use Data::Dumper; + +use constant EVENT_PATH => (ZM_DIR_EVENTS=~m|/|)?ZM_DIR_EVENTS:(ZM_PATH_WEB.'/'.ZM_DIR_EVENTS); + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin:/usr/local/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +my $web_uid = (getpwnam( ZM_WEB_USER ))[2]; +my $use_log = (($> == 0) || ($> == $web_uid)); + +logInit( toFile=>$use_log?DEBUG:NOLOG ); +logSetSignal(); + +my $interactive = 1; +my $check = 0; +my $freshen = 0; +my $rename = 0; +my $zoneFix = 0; +my $migrateEvents = 0; +my $version = ''; +my $dbUser = ZM_DB_USER; +my $dbPass = ZM_DB_PASS; +my $updateDir = ''; +sub Usage +{ + print( " +Usage: zmupdate.pl <-c,--check|-f,--freshen|-v,--version=> [-u -p]> +Parameters are :- +-c, --check - Check for updated versions of ZoneMinder +-f, --freshen - Freshen the configuration in the database. Equivalent of old zmconfig.pl -noi +-v, --version= - Force upgrade to the current version from +-u, --user= - Alternate DB user with privileges to alter DB +-p, --pass= - Password of alternate DB user with privileges to alter DB +-d,--dir= - Directory containing update files if not in default build location +"); + exit( -1 ); +} + +if ( !GetOptions( 'check'=>\$check, 'freshen'=>\$freshen, 'rename'=>\$rename, 'zone-fix'=>\$zoneFix, 'migrate-events'=>\$migrateEvents, 'version=s'=>\$version, 'interactive!'=>\$interactive, 'user:s'=>\$dbUser, 'pass:s'=>\$dbPass, 'dir:s'=>\$updateDir ) ) +{ + Usage(); +} + +if ( ! ($check || $freshen || $rename || $zoneFix || $migrateEvents || $version) ) +{ + if ( ZM_DYN_DB_VERSION ) + { + $version = ZM_DYN_DB_VERSION; + } + else + { + print( STDERR "Please give a valid option\n" ); + Usage(); + } +} + +if ( ($check + $freshen + $rename + $zoneFix + $migrateEvents + ($version?1:0)) > 1 ) +{ + print( STDERR "Please give only one option\n" ); + Usage(); +} + +if ( $check && ZM_CHECK_FOR_UPDATES ) +{ + print( "Update agent starting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); + + my $dbh = zmDbConnect(); + + my $currVersion = ZM_DYN_CURR_VERSION; + my $lastVersion = ZM_DYN_LAST_VERSION; + my $lastCheck = ZM_DYN_LAST_CHECK; + + if ( !$currVersion ) + { + $currVersion = ZM_VERSION; + + my $sql = "update Config set Value = ? where Name = 'ZM_DYN_CURR_VERSION'"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( "$currVersion" ) or die( "Can't execute: ".$sth->errstr() ); + } + zmDbDisconnect(); + + while( 1 ) + { + my $now = time(); + if ( !$lastVersion || !$lastCheck || (($now-$lastCheck) > CHECK_INTERVAL) ) + { + $dbh = zmDbConnect(); + + Info( "Checking for updates\n" ); + + use LWP::UserAgent; + my $ua = LWP::UserAgent->new; + $ua->agent( "ZoneMinder Update Agent/".ZM_VERSION ); + if ( eval('defined(ZM_UPDATE_CHECK_PROXY)') ) + { + no strict 'subs'; + if ( ZM_UPDATE_CHECK_PROXY ) + { + $ua->proxy( "http", ZM_UPDATE_CHECK_PROXY ); + } + use strict 'subs'; + } + my $req = HTTP::Request->new( GET=>'http://www.zoneminder.com/version' ); + my $res = $ua->request($req); + + if ( $res->is_success ) + { + $lastVersion = $res->content; + chomp($lastVersion); + $lastCheck = $now; + + Info( "Got version: '".$lastVersion."'\n" ); + + my $lv_sql = "update Config set Value = ? where Name = 'ZM_DYN_LAST_VERSION'"; + my $lv_sth = $dbh->prepare_cached( $lv_sql ) or die( "Can't prepare '$lv_sql': ".$dbh->errstr() ); + my $lv_res = $lv_sth->execute( $lastVersion ) or die( "Can't execute: ".$lv_sth->errstr() ); + + my $lc_sql = "update Config set Value = ? where Name = 'ZM_DYN_LAST_CHECK'"; + my $lc_sth = $dbh->prepare_cached( $lc_sql ) or die( "Can't prepare '$lc_sql': ".$dbh->errstr() ); + my $lc_res = $lc_sth->execute( $lastCheck ) or die( "Can't execute: ".$lc_sth->errstr() ); + } + else + { + Error( "Error check failed: '".$res->status_line()."'\n" ); + } + zmDbDisconnect(); + } + sleep( 3600 ); + } + print( "Update agent exiting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); +} +if ( $rename ) +{ + require File::Find; + + chdir( EVENT_PATH ); + + sub renameImage + { + my $file = $_; + + # Ignore directories + if ( -d $file ) + { + print( "Checking directory '$file'\n" ); + return; + } + if ( $file !~ /(capture|analyse)-(\d+)(\.jpg)/ ) + { + return; + } + my $newFile = "$2-$1$3"; + + print( "Renaming '$file' to '$newFile'\n" ); + rename( $file, $newFile ) or warn( "Can't rename '$file' to '$newFile'" ); + } + + File::Find::find( \&renameImage, '.' ); +} +if ( $zoneFix ) +{ + require DBI; + + my $dbh = zmDbConnect(); + + my $sql = "select Z.*, M.Width as MonitorWidth, M.Height as MonitorHeight from Zones as Z inner join Monitors as M on Z.MonitorId = M.Id where Z.Units = 'Percent'"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + my @zones; + while( my $zone = $sth->fetchrow_hashref() ) + { + push( @zones, $zone ); + } + $sth->finish(); + + foreach my $zone ( @zones ) + { + my $zone_width = (($zone->{HiX}*$zone->{MonitorWidth})-($zone->{LoX}*$zone->{MonitorWidth}))/100; + my $zone_height = (($zone->{HiY}*$zone->{MonitorHeight})-($zone->{LoY}*$zone->{MonitorHeight}))/100; + my $zone_area = $zone_width * $zone_height; + my $monitor_area = $zone->{MonitorWidth} * $zone->{MonitorHeight}; + my $sql = "update Zones set MinAlarmPixels = ?, MaxAlarmPixels = ?, MinFilterPixels = ?, MaxFilterPixels = ?, MinBlobPixels = ?, MaxBlobPixels = ? where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( + ($zone->{MinAlarmPixels}*$monitor_area)/$zone_area, + ($zone->{MaxAlarmPixels}*$monitor_area)/$zone_area, + ($zone->{MinFilterPixels}*$monitor_area)/$zone_area, + ($zone->{MaxFilterPixels}*$monitor_area)/$zone_area, + ($zone->{MinBlobPixels}*$monitor_area)/$zone_area, + ($zone->{MaxBlobPixels}*$monitor_area)/$zone_area, + $zone->{Id} + ) or die( "Can't execute: ".$sth->errstr() ); + } +} +if ( $migrateEvents ) +{ + my $webUid = (getpwnam( ZM_WEB_USER ))[2]; + my $webGid = (getgrnam( ZM_WEB_USER ))[2]; + + if ( !(($> == 0) || ($> == $webUid)) ) + { + print( "Error, migrating events can only be done as user root or ".ZM_WEB_USER.".\n" ); + exit( -1 ); + } + + # Run as web user/group + $( = $webGid; + $) = $webGid; + $< = $webUid; + $> = $webUid; + + print( "\nAbout to convert saved events to deep storage, please ensure that ZoneMinder is fully stopped before proceeding.\nThis process is not easily reversible. Are you sure you wish to proceed?\n\nPress 'y' to continue or 'n' to abort : " ); + my $response = ; + chomp( $response ); + while ( $response !~ /^[yYnN]$/ ) + { + print( "Please press 'y' to continue or 'n' to abort only : " ); + $response = ; + chomp( $response ); + } + + if ( $response =~ /^[yY]$/ ) + { + print( "Converting all events to deep storage.\n" ); + + chdir( ZM_PATH_WEB ); + my $dbh = zmDbConnect(); + my $sql = "select *, unix_timestamp(StartTime) as UnixStartTime from Events"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute(); + if ( !$res ) + { + Fatal( "Can't fetch Events: ".$sth->errstr() ); + } + + while( my $event = $sth->fetchrow_hashref() ) + { + my $oldEventPath = ZM_DIR_EVENTS.'/'.$event->{MonitorId}.'/'.$event->{Id}; + + if ( !-d $oldEventPath ) + { + print( "Warning, can't find old event path '$oldEventPath', already converted?\n" ); + next; + } + + print( "Converting event ".$event->{Id}."\n" ); + my $newDatePath = ZM_DIR_EVENTS.'/'.$event->{MonitorId}.'/'.strftime( "%y/%m/%d", localtime($event->{UnixStartTime}) ); + my $newTimePath = strftime( "%H/%M/%S", localtime($event->{UnixStartTime}) ); + my $newEventPath = $newDatePath.'/'.$newTimePath; + ( my $truncEventPath = $newEventPath ) =~ s|/\d+$||; + makePath( $truncEventPath, ZM_PATH_WEB ); + my $idLink = $newDatePath.'/.'.$event->{Id}; + symlink( $newTimePath, $idLink ) or die( "Can't symlink $newTimePath -> $idLink: $!" ); + rename( $oldEventPath, $newEventPath ) or die( "Can't move $oldEventPath -> $newEventPath: $!" ); + } + + print( "Updating configuration.\n" ); + $sql = "update Config set Value = ? where Name = 'ZM_USE_DEEP_STORAGE'"; + $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + $res = $sth->execute( 1 ) or die( "Can't execute: ".$sth->errstr() ); + + print( "All events converted.\n\n" ); + } + else + { + print( "Aborting event conversion.\n\n" ); + } +} +if ( $freshen ) +{ + print( "\nFreshening configuration in database\n" ); + loadConfigFromDB(); + saveConfigToDB(); +} +if ( $version ) +{ + my ( $detaint_version ) = $version =~ /^([\w.]+)$/; + $version = $detaint_version; + + if ( ZM_VERSION eq $version ) + { + print( "\nDatabase already at version $version, update aborted.\n\n" ); + exit( -1 ); + } + + print( "\nInitiating database upgrade to version ".ZM_VERSION." from version $version\n" ); + if ( $interactive ) + { + if ( ZM_DYN_DB_VERSION && ZM_DYN_DB_VERSION ne $version ) + { + print( "\nWARNING - You have specified an upgrade from version $version but the database version found is ".ZM_DYN_DB_VERSION.". Is this correct?\nPress enter to continue or ctrl-C to abort : " ); + my $response = ; + } + + print( "\nPlease ensure that ZoneMinder is stopped on your system prior to upgrading the database.\nPress enter to continue or ctrl-C to stop : " ); + my $response = ; + + print( "\nDo you wish to take a backup of your database prior to upgrading?\nThis may result in a large file in /tmp/zm if you have a lot of events.\nPress 'y' for a backup or 'n' to continue : " ); + $response = ; + chomp( $response ); + while ( $response !~ /^[yYnN]$/ ) + { + print( "Please press 'y' for a backup or 'n' to continue only : " ); + $response = ; + chomp( $response ); + } + + if ( $response =~ /^[yY]$/ ) + { + my ( $host, $port ) = ( ZM_DB_HOST =~ /^([^:]+)(?::(.+))?$/ ); + my $command = "mysqldump -h".$host; + $command .= " -P".$port if defined($port); + if ( $dbUser ) + { + $command .= " -u".$dbUser; + if ( $dbPass ) + { + $command .= " -p".$dbPass; + } + } + my $backup = "/tmp/zm/".ZM_DB_NAME."-".$version.".dump"; + $command .= " --add-drop-table --databases ".ZM_DB_NAME." > ".$backup; + print( "Creating backup to $backup. This may take several minutes.\n" ); + print( "Executing '$command'\n" ) if ( logDebugging() ); + my $output = qx($command); + my $status = $? >> 8; + if ( $status || logDebugging() ) + { + chomp( $output ); + print( "Output: $output\n" ); + } + if ( $status ) + { + die( "Command '$command' exited with status: $status\n" ); + } + else + { + print( "Database successfully backed up to $backup, proceeding to upgrade.\n" ); + } + } + elsif ( $response !~ /^[nN]$/ ) + { + die( "Unexpected response '$response'" ); + } + } + sub patchDB + { + my $dbh = shift; + my $version = shift; + + my ( $host, $port ) = ( ZM_DB_HOST =~ /^([^:]+)(?::(.+))?$/ ); + my $command = "mysql -h".$host; + $command .= " -P".$port if defined($port); + if ( $dbUser ) + { + $command .= " -u".$dbUser; + if ( $dbPass ) + { + $command .= " -p".$dbPass; + } + } + $command .= " ".ZM_DB_NAME." < "; + if ( $updateDir ) + { + $command .= $updateDir; + } + else + { + $command .= ZM_PATH_BUILD."/db"; + } + $command .= "/zm_update-".$version.".sql"; + + print( "Executing '$command'\n" ) if ( logDebugging() ); + my $output = qx($command); + my $status = $? >> 8; + if ( $status || logDebugging() ) + { + chomp( $output ); + print( "Output: $output\n" ); + } + if ( $status ) + { + die( "Command '$command' exited with status: $status\n" ); + } + else + { + print( "\nDatabase successfully upgraded from version $version.\n" ); + my $sql = "update Config set Value = ? where Name = 'ZM_DYN_DB_VERSION'"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $version ) or die( "Can't execute: ".$sth->errstr() ); + } + } + + print( "\nUpgrading database to version ".ZM_VERSION."\n" ); + + # Update config first of all + loadConfigFromDB(); + saveConfigToDB(); + + my $dbh = zmDbConnect(); + + my $cascade = undef; + if ( $cascade || $version eq "1.19.0" ) + { + # Patch the database + patchDB( $dbh, "1.19.0" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.19.1" ) + { + # Patch the database + patchDB( $dbh, "1.19.1"); + $cascade = !undef; + } + if ( $cascade || $version eq "1.19.2" ) + { + # Patch the database + patchDB( $dbh, "1.19.2" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.19.3" ) + { + # Patch the database + patchDB( $dbh, "1.19.3" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.19.4" ) + { + require DBI; + + # Rename the event directories and create a new symlink for the names + chdir( EVENT_PATH ); + + my $sql = "select * from Monitors order by Id"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + while( my $monitor = $sth->fetchrow_hashref() ) + { + if ( -d $monitor->{Name} ) + { + rename( $monitor->{Name}, $monitor->{Id} ) or warn( "Can't rename existing monitor directory '$monitor->{Name}' to '$monitor->{Id}': $!" ); + symlink( $monitor->{Id}, $monitor->{Name} ) or warn( "Can't symlink monitor directory '$monitor->{Id}' to '$monitor->{Name}': $!" ); + } + } + $sth->finish(); + + # Patch the database + patchDB( $dbh, "1.19.4" ); + + $cascade = !undef; + } + if ( $cascade || $version eq "1.19.5" ) + { + print( "\nThis version now only uses one database user.\nPlease ensure you have run zmconfig.pl and re-entered your database username and password prior to upgrading, or the upgrade will fail.\nPress enter to continue or ctrl-C to stop : " ); + # Patch the database + my $dummy = ; + patchDB( $dbh, "1.19.5" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.20.0" ) + { + # Patch the database + patchDB( $dbh, "1.20.0" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.20.1" ) + { + # Patch the database + patchDB( $dbh, "1.20.1" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.21.0" ) + { + # Patch the database + patchDB( $dbh, "1.21.0" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.21.1" ) + { + # Patch the database + patchDB( $dbh, "1.21.1" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.21.2" ) + { + # Patch the database + patchDB( $dbh, "1.21.2" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.21.3" ) + { + # Patch the database + patchDB( $dbh, "1.21.3" ); + + # Add appropriate widths and heights to events + { + print( "Updating events. This may take a few minutes. Please wait.\n" ); + my $sql = "select * from Monitors order by Id"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + while( my $monitor = $sth->fetchrow_hashref() ) + { + my $sql = "update Events set Width = ?, Height = ? where MonitorId = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $monitor->{Width}, $monitor->{Height}, $monitor->{Id} ) or die( "Can't execute: ".$sth->errstr() ); + } + $sth->finish(); + } + + # Add sequence numbers + { + print( "Updating monitor sequences. Please wait.\n" ); + my $sql = "select * from Monitors order by Id"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + my $sequence = 1; + while( my $monitor = $sth->fetchrow_hashref() ) + { + my $sql = "update Monitors set Sequence = ? where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $sequence++, $monitor->{Id} ) or die( "Can't execute: ".$sth->errstr() ); + } + $sth->finish(); + } + + # Update saved filters + { + print( "Updating saved filters. Please wait.\n" ); + my $sql = "select * from Filters"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + my @filters; + while( my $filter = $sth->fetchrow_hashref() ) + { + push( @filters, $filter ); + } + $sth->finish(); + $sql = "update Filters set Query = ? where Name = ?"; + $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + foreach my $filter ( @filters ) + { + if ( $filter->{Query} =~ /op\d=&/ ) + { + ( my $newQuery = $filter->{Query} ) =~ s/(op\d=)&/$1=&/g; + $res = $sth->execute( $newQuery, $filter->{Name} ) or die( "Can't execute: ".$sth->errstr() ); + } + } + } + + $cascade = !undef; + } + if ( $cascade || $version eq "1.21.4" ) + { + # Patch the database + patchDB( $dbh, "1.21.4" ); + + # Convert zones to new format + { + print( "Updating zones. Please wait.\n" ); + + # Get the existing zones from the DB + my $sql = "select Z.*,M.Width,M.Height from Zones as Z inner join Monitors as M on (Z.MonitorId = M.Id)"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + my @zones; + while( my $zone = $sth->fetchrow_hashref() ) + { + push( @zones, $zone ); + } + $sth->finish(); + + no strict 'refs'; + foreach my $zone ( @zones ) + { + # Create the coordinate strings + if ( $zone->{Units} eq "Pixels" ) + { + my $sql = "update Zones set NumCoords = 4, Coords = concat( LoX,',',LoY,' ',HiX,',',LoY,' ',HiX,',',HiY,' ',LoX,',',HiY ), Area = round( ((HiX-LoX)+1)*((HiY-LoY)+1) ) where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $zone->{Id} ) or die( "Can't execute: ".$sth->errstr() ); + } + else + { + my $loX = ($zone->{LoX} * ($zone->{Width}-1) ) / 100; + my $hiX = ($zone->{HiX} * ($zone->{Width}-1) ) / 100; + my $loY = ($zone->{LoY} * ($zone->{Height}-1) ) / 100; + my $hiY = ($zone->{HiY} * ($zone->{Height}-1) ) / 100; + my $area = (($hiX-$loX)+1)*(($hiY-$loY)+1); + my $sql = "update Zones set NumCoords = 4, Coords = concat( round(?),',',round(?),' ',round(?),',',round(?),' ',round(?),',',round(?),' ',round(?),',',round(?) ), Area = round(?), MinAlarmPixels = round(?), MaxAlarmPixels = round(?), MinFilterPixels = round(?), MaxFilterPixels = round(?), MinBlobPixels = round(?), MaxBlobPixels = round(?) where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $loX, $loY, $hiX, $loY, $hiX, $hiY, $loX, $hiY, $area, ($zone->{MinAlarmPixels}*$area)/100, ($zone->{MaxAlarmPixels}*$area)/100, ($zone->{MinFilterPixels}*$area)/100, ($zone->{MaxFilterPixels}*$area)/100, ($zone->{MinBlobPixels}*$area)/100, ($zone->{MaxBlobPixels}*$area)/100, $zone->{Id} ) or die( "Can't execute: ".$sth->errstr() ); + } + } + } + # Convert run states to new format + { + print( "Updating run states. Please wait.\n" ); + + # Get the existing zones from the DB + my $sql = "select * from States"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + my @states; + while( my $state = $sth->fetchrow_hashref() ) + { + push( @states, $state ); + } + $sth->finish(); + + foreach my $state ( @states ) + { + my @new_defns; + foreach my $defn ( split( /,/, $state->{Definition} ) ) + { + push( @new_defns, $defn.":1" ); + } + my $sql = "update States set Definition = ? where Name = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( join( ',', @new_defns ), $state->{Name} ) or die( "Can't execute: ".$sth->errstr() ); + } + } + + $cascade = !undef; + } + if ( $cascade || $version eq "1.22.0" ) + { + # Patch the database + patchDB( $dbh, "1.22.0" ); + + # Check for maximum FPS setting and update alarm max fps settings + { + print( "Updating monitors. Please wait.\n" ); + if ( defined(&ZM_NO_MAX_FPS_ON_ALARM) && &ZM_NO_MAX_FPS_ON_ALARM ) + { + # Update the individual monitor settings to match the previous global one + my $sql = "update Monitors set AlarmMaxFPS = NULL"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + } + else + { + # Update the individual monitor settings to match the previous global one + my $sql = "update Monitors set AlarmMaxFPS = MaxFPS"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + } + } + { + print( "Updating mail configuration. Please wait.\n" ); + my ( $sql, $sth, $res ); + if ( defined(&ZM_EMAIL_TEXT) && &ZM_EMAIL_TEXT ) + { + my ( $email_subject, $email_body ) = ZM_EMAIL_TEXT =~ /subject\s*=\s*"([^\n]*)".*body\s*=\s*"(.*)"?$/ms; + $sql = "replace into Config set Id = 0, Name = 'ZM_EMAIL_SUBJECT', Value = '".$email_subject."', Type = 'string', DefaultValue = 'ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)', Hint = 'string', Pattern = '(?-xism:^(.+)\$)', Format = ' \$1 ', Prompt = 'The subject of the email used to send matching event details', Help = 'This option is used to define the subject of the email that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1'"; + $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + $sql = "replace into Config set Id = 0, Name = 'ZM_EMAIL_BODY', Value = '".$email_body."', Hint = 'free text', Pattern = '(?-xism:^(.+)\$)', Format = ' \$1 ', Prompt = 'The body of the email used to send matching event details', Help = 'This option is used to define the content of the email that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1'"; + $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + } + if ( defined(&ZM_MESSAGE_TEXT) && &ZM_MESSAGE_TEXT ) + { + my ( $message_subject, $message_body ) = ZM_MESSAGE_TEXT =~ /subject\s*=\s*"([^\n]*)".*body\s*=\s*"(.*)"?$/ms; + $sql = "replace into Config set Id = 0, Name = 'ZM_MESSAGE_SUBJECT', Value = '".$message_subject."', Type = 'string', DefaultValue = 'ZoneMinder: Alarm - %MN%-%EI%', Hint = 'string', Pattern = '(?-xism:^(.+)\$)', Format = ' \$1 ', Prompt = 'The subject of the message used to send matching event details', Help = 'This option is used to define the subject of the message that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1'"; + $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + $sql = "replace into Config set Id = 0, Name = 'ZM_MESSAGE_BODY', Value = '".$message_body."', Type = 'text', DefaultValue = 'ZM alarm detected - %ED% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.', Hint = 'free text', Pattern = '(?-xism:^(.+)\$)', Format = ' \$1 ', Prompt = 'The body of the message used to send matching event details', Help = 'This option is used to define the content of the message that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1'"; + $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + } + } + $cascade = !undef; + } + if ( $cascade || $version eq "1.22.1" ) + { + # Patch the database + patchDB( $dbh, "1.22.1" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.22.2" ) + { + # Patch the database + patchDB( $dbh, "1.22.2" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.22.3" ) + { + # Patch the database + patchDB( $dbh, "1.22.3" ); + + # Convert timestamp strings to new format + { + my $sql = "select * from Monitors"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + my @db_monitors; + while( my $db_monitor = $sth->fetchrow_hashref() ) + { + push( @db_monitors, $db_monitor ); + } + $sth->finish(); + foreach my $db_monitor ( @db_monitors ) + { + if ( $db_monitor->{LabelFormat} =~ /\%\%s/ ) + { + $db_monitor->{LabelFormat} =~ s/\%\%s/%N/; + $db_monitor->{LabelFormat} =~ s/\%\%s/%Q/; + + my $sql = "update Monitors set LabelFormat = ? where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $db_monitor->{LabelFormat}, $db_monitor->{Id} ) or die( "Can't execute: ".$sth->errstr() ); + } + } + } + + # Convert filters to new format + { + my $sql = "select * from Filters"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + my @dbFilters; + while( my $dbFilter = $sth->fetchrow_hashref() ) + { + push( @dbFilters, $dbFilter ); + } + $sth->finish(); + foreach my $dbFilter ( @dbFilters ) + { + my %filter_terms; + foreach my $filter_parm ( split( /&/, $dbFilter->{Query} ) ) + { + my( $key, $value ) = split( /=/, $filter_parm, 2 ); + if ( $key ) + { + $filter_terms{$key} = $value; + } + } + my $filter = { 'terms' => [] }; + for ( my $i = 1; $i <= $filter_terms{trms}; $i++ ) + { + my $term = {}; + my $conjunction_name = "cnj$i"; + my $obracket_name = "obr$i"; + my $cbracket_name = "cbr$i"; + my $attr_name = "attr$i"; + my $op_name = "op$i"; + my $value_name = "val$i"; + + $term->{cnj} = $filter_terms{$conjunction_name} if ( $filter_terms{$conjunction_name} ); + $term->{obr} = $filter_terms{$obracket_name} if ( $filter_terms{$obracket_name} ); + $term->{attr} = $filter_terms{$attr_name} if ( $filter_terms{$attr_name} ); + $term->{val} = $filter_terms{$value_name} if ( defined($filter_terms{$value_name}) ); + $term->{op} = $filter_terms{$op_name} if ( $filter_terms{$op_name} ); + $term->{cbr} = $filter_terms{$cbracket_name} if ( $filter_terms{$cbracket_name} ); + push( @{$filter->{terms}}, $term ); + } + $filter->{sort_field} = $filter_terms{sort_field} if ( $filter_terms{sort_field} ); + $filter->{sort_asc} = $filter_terms{sort_asc} if ( $filter_terms{sort_asc} ); + $filter->{limit} = $filter_terms{limit} if ( $filter_terms{limit} ); + + my $newQuery = 'a:'.int(keys(%$filter)).':{s:5:"terms";a:'.int(@{$filter->{terms}}).':{'; + my $i = 0; + foreach my $term ( @{$filter->{terms}} ) + { + $newQuery .= 'i:'.$i.';a:'.int(keys(%$term)).':{'; + while ( my ( $key, $val ) = each( %$term ) ) + { + $newQuery .= 's:'.length($key).':"'.$key.'";'; + $newQuery .= 's:'.length($val).':"'.$val.'";'; + } + $newQuery .= '}'; + $i++; + } + $newQuery .= '}'; + foreach my $field ( "sort_field", "sort_asc", "limit" ) + { + if ( defined($filter->{$field}) ) + { + $newQuery .= 's:'.length($field).':"'.$field.'";'; + $newQuery .= 's:'.length($filter->{$field}).':"'.$filter->{$field}.'";'; + } + } + $newQuery .= '}'; + + my $sql = "update Filters set Query = ? where Name = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $newQuery, $dbFilter->{Name} ) or die( "Can't execute: ".$sth->errstr() ); + } + } + + # Update the stream quality setting to the old image quality ones + { + my $dbh = zmDbConnect(); + + my $sql = "update Config set Value = ? where Name = 'ZM_JPEG_STREAM_QUALITY'"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( ZM_JPEG_IMAGE_QUALITY ) or die( "Can't execute: ".$sth->errstr() ); + } + $cascade = !undef; + } + if ( $cascade || $version eq "1.23.0" ) + { + # Patch the database + patchDB( $dbh, "1.23.0" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.23.1" ) + { + # Patch the database + patchDB( $dbh, "1.23.1" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.23.2" ) + { + # Patch the database + patchDB( $dbh, "1.23.2" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.23.3" ) + { + # Patch the database + patchDB( $dbh, "1.23.3" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.24.0" ) + { + # Patch the database + patchDB( $dbh, "1.24.0" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.24.1" ) + { + # Patch the database + patchDB( $dbh, "1.24.1" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.24.2" ) + { + # Patch the database + patchDB( $dbh, "1.24.2" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.24.3" ) + { + my $result = eval + { + require PHP::Serialization; + PHP::Serialization->import(); + }; + die( "Unable to perform upgrade from 1.24.3, PHP::Serialization module not found" ) if ( $result ); + + # Patch the database + patchDB( $dbh, "1.24.3" ); + + # Convert filters to JSON from PHP format serialisation + { + print( "\nConverting filters from PHP to JSON format\n" ); + my $sql = "select * from Filters"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + my @dbFilters; + while( my $dbFilter = $sth->fetchrow_hashref() ) + { + push( @dbFilters, $dbFilter ); + } + $sth->finish(); + foreach my $dbFilter ( @dbFilters ) + { + print( " ".$dbFilter->{Name} ); + eval { + my $phpQuery = $dbFilter->{Query}; + my $query = PHP::Serialization::unserialize( $phpQuery ); + my $jsonQuery = jsonEncode( $query ); + my $sql = "update Filters set Query = ? where Name = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $jsonQuery, $dbFilter->{Name} ) or die( "Can't execute: ".$sth->errstr() ); + }; + if ( $@ ) + { + print( " - failed, please check or report. Query is '".$dbFilter->{Query}."'\n" ); + print( $@ ); + } + else + { + print( " - complete\n" ); + } + } + print( "Conversion complete\n" ); + } + $cascade = !undef; + } + if ( $cascade || $version eq "1.24.4" ) + { + # Patch the database + patchDB( $dbh, "1.24.4" ); + + # Copy the FTP specific values to the new general config + my $fetchSql = "select * from Config where Name like 'ZM_UPLOAD_FTP_%'"; + my $fetchSth = $dbh->prepare_cached( $fetchSql ) or die( "Can't prepare '$fetchSql': ".$dbh->errstr() ); + my $updateSql = "update Config set Value = ? where Name = ?"; + my $updateSth = $dbh->prepare_cached( $updateSql ) or die( "Can't prepare '$updateSql': ".$dbh->errstr() ); + my $fetchRes = $fetchSth->execute() or die( "Can't execute: ".$fetchSth->errstr() ); + while( my $config = $fetchSth->fetchrow_hashref() ) + { + ( my $name = $config->{Name} ) =~ s/_FTP_/_/; + my $updateRes = $updateSth->execute( $config->{Value}, $name ) or die( "Can't execute: ".$updateSth->errstr() ); + } + $cascade = !undef; + } + if ( $cascade ) + { + my $installed_version = ZM_VERSION; + my $sql = "update Config set Value = ? where Name = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( "$installed_version", "ZM_DYN_DB_VERSION" ) or die( "Can't execute: ".$sth->errstr() ); + $res = $sth->execute( "$installed_version", "ZM_DYN_CURR_VERSION" ) or die( "Can't execute: ".$sth->errstr() ); + $dbh->disconnect(); + } + else + { + $dbh->disconnect(); + die( "Can't find upgrade from version '$version'" ); + } + print( "\nDatabase upgrade to version ".ZM_VERSION." successful.\n\n" ); +} +exit( 0 ); diff --git a/scripts/zmupdate.pl.in b/scripts/zmupdate.pl.in new file mode 100644 index 000000000..1a3d8fd58 --- /dev/null +++ b/scripts/zmupdate.pl.in @@ -0,0 +1,984 @@ +#!/usr/bin/perl -w +# +# ========================================================================== +# +# ZoneMinder Update Script, $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. +# +# ========================================================================== +# +# This script just checks what the most recent release of ZoneMinder is +# at the the moment. It will eventually be responsible for applying and +# configuring upgrades etc, including on the fly upgrades. +# +use strict; +use bytes; + +# ========================================================================== +# +# These are the elements you can edit to suit your installation +# +# ========================================================================== + +use constant CHECK_INTERVAL => (1*24*60*60); # Interval between version checks + +# ========================================================================== +# +# Don't change anything below here +# +# ========================================================================== + +@EXTRA_PERL_LIB@ +use ZoneMinder::Base qw(:all); +use ZoneMinder::Config qw(:all); +use ZoneMinder::Logger qw(:all); +use ZoneMinder::General qw(:all); +use ZoneMinder::Database qw(:all); +use ZoneMinder::ConfigAdmin qw( :functions ); +use POSIX; +use DBI; +use Getopt::Long; +use Data::Dumper; + +use constant EVENT_PATH => (ZM_DIR_EVENTS=~m|/|)?ZM_DIR_EVENTS:(ZM_PATH_WEB.'/'.ZM_DIR_EVENTS); + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin:/usr/local/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +my $web_uid = (getpwnam( ZM_WEB_USER ))[2]; +my $use_log = (($> == 0) || ($> == $web_uid)); + +logInit( toFile=>$use_log?DEBUG:NOLOG ); +logSetSignal(); + +my $interactive = 1; +my $check = 0; +my $freshen = 0; +my $rename = 0; +my $zoneFix = 0; +my $migrateEvents = 0; +my $version = ''; +my $dbUser = ZM_DB_USER; +my $dbPass = ZM_DB_PASS; +my $updateDir = ''; +sub Usage +{ + print( " +Usage: zmupdate.pl <-c,--check|-f,--freshen|-v,--version=> [-u -p]> +Parameters are :- +-c, --check - Check for updated versions of ZoneMinder +-f, --freshen - Freshen the configuration in the database. Equivalent of old zmconfig.pl -noi +-v, --version= - Force upgrade to the current version from +-u, --user= - Alternate DB user with privileges to alter DB +-p, --pass= - Password of alternate DB user with privileges to alter DB +-d,--dir= - Directory containing update files if not in default build location +"); + exit( -1 ); +} + +if ( !GetOptions( 'check'=>\$check, 'freshen'=>\$freshen, 'rename'=>\$rename, 'zone-fix'=>\$zoneFix, 'migrate-events'=>\$migrateEvents, 'version=s'=>\$version, 'interactive!'=>\$interactive, 'user:s'=>\$dbUser, 'pass:s'=>\$dbPass, 'dir:s'=>\$updateDir ) ) +{ + Usage(); +} + +if ( ! ($check || $freshen || $rename || $zoneFix || $migrateEvents || $version) ) +{ + if ( ZM_DYN_DB_VERSION ) + { + $version = ZM_DYN_DB_VERSION; + } + else + { + print( STDERR "Please give a valid option\n" ); + Usage(); + } +} + +if ( ($check + $freshen + $rename + $zoneFix + $migrateEvents + ($version?1:0)) > 1 ) +{ + print( STDERR "Please give only one option\n" ); + Usage(); +} + +if ( $check && ZM_CHECK_FOR_UPDATES ) +{ + print( "Update agent starting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); + + my $dbh = zmDbConnect(); + + my $currVersion = ZM_DYN_CURR_VERSION; + my $lastVersion = ZM_DYN_LAST_VERSION; + my $lastCheck = ZM_DYN_LAST_CHECK; + + if ( !$currVersion ) + { + $currVersion = ZM_VERSION; + + my $sql = "update Config set Value = ? where Name = 'ZM_DYN_CURR_VERSION'"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( "$currVersion" ) or die( "Can't execute: ".$sth->errstr() ); + } + zmDbDisconnect(); + + while( 1 ) + { + my $now = time(); + if ( !$lastVersion || !$lastCheck || (($now-$lastCheck) > CHECK_INTERVAL) ) + { + $dbh = zmDbConnect(); + + Info( "Checking for updates\n" ); + + use LWP::UserAgent; + my $ua = LWP::UserAgent->new; + $ua->agent( "ZoneMinder Update Agent/".ZM_VERSION ); + if ( eval('defined(ZM_UPDATE_CHECK_PROXY)') ) + { + no strict 'subs'; + if ( ZM_UPDATE_CHECK_PROXY ) + { + $ua->proxy( "http", ZM_UPDATE_CHECK_PROXY ); + } + use strict 'subs'; + } + my $req = HTTP::Request->new( GET=>'http://www.zoneminder.com/version' ); + my $res = $ua->request($req); + + if ( $res->is_success ) + { + $lastVersion = $res->content; + chomp($lastVersion); + $lastCheck = $now; + + Info( "Got version: '".$lastVersion."'\n" ); + + my $lv_sql = "update Config set Value = ? where Name = 'ZM_DYN_LAST_VERSION'"; + my $lv_sth = $dbh->prepare_cached( $lv_sql ) or die( "Can't prepare '$lv_sql': ".$dbh->errstr() ); + my $lv_res = $lv_sth->execute( $lastVersion ) or die( "Can't execute: ".$lv_sth->errstr() ); + + my $lc_sql = "update Config set Value = ? where Name = 'ZM_DYN_LAST_CHECK'"; + my $lc_sth = $dbh->prepare_cached( $lc_sql ) or die( "Can't prepare '$lc_sql': ".$dbh->errstr() ); + my $lc_res = $lc_sth->execute( $lastCheck ) or die( "Can't execute: ".$lc_sth->errstr() ); + } + else + { + Error( "Error check failed: '".$res->status_line()."'\n" ); + } + zmDbDisconnect(); + } + sleep( 3600 ); + } + print( "Update agent exiting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); +} +if ( $rename ) +{ + require File::Find; + + chdir( EVENT_PATH ); + + sub renameImage + { + my $file = $_; + + # Ignore directories + if ( -d $file ) + { + print( "Checking directory '$file'\n" ); + return; + } + if ( $file !~ /(capture|analyse)-(\d+)(\.jpg)/ ) + { + return; + } + my $newFile = "$2-$1$3"; + + print( "Renaming '$file' to '$newFile'\n" ); + rename( $file, $newFile ) or warn( "Can't rename '$file' to '$newFile'" ); + } + + File::Find::find( \&renameImage, '.' ); +} +if ( $zoneFix ) +{ + require DBI; + + my $dbh = zmDbConnect(); + + my $sql = "select Z.*, M.Width as MonitorWidth, M.Height as MonitorHeight from Zones as Z inner join Monitors as M on Z.MonitorId = M.Id where Z.Units = 'Percent'"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + my @zones; + while( my $zone = $sth->fetchrow_hashref() ) + { + push( @zones, $zone ); + } + $sth->finish(); + + foreach my $zone ( @zones ) + { + my $zone_width = (($zone->{HiX}*$zone->{MonitorWidth})-($zone->{LoX}*$zone->{MonitorWidth}))/100; + my $zone_height = (($zone->{HiY}*$zone->{MonitorHeight})-($zone->{LoY}*$zone->{MonitorHeight}))/100; + my $zone_area = $zone_width * $zone_height; + my $monitor_area = $zone->{MonitorWidth} * $zone->{MonitorHeight}; + my $sql = "update Zones set MinAlarmPixels = ?, MaxAlarmPixels = ?, MinFilterPixels = ?, MaxFilterPixels = ?, MinBlobPixels = ?, MaxBlobPixels = ? where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( + ($zone->{MinAlarmPixels}*$monitor_area)/$zone_area, + ($zone->{MaxAlarmPixels}*$monitor_area)/$zone_area, + ($zone->{MinFilterPixels}*$monitor_area)/$zone_area, + ($zone->{MaxFilterPixels}*$monitor_area)/$zone_area, + ($zone->{MinBlobPixels}*$monitor_area)/$zone_area, + ($zone->{MaxBlobPixels}*$monitor_area)/$zone_area, + $zone->{Id} + ) or die( "Can't execute: ".$sth->errstr() ); + } +} +if ( $migrateEvents ) +{ + my $webUid = (getpwnam( ZM_WEB_USER ))[2]; + my $webGid = (getgrnam( ZM_WEB_USER ))[2]; + + if ( !(($> == 0) || ($> == $webUid)) ) + { + print( "Error, migrating events can only be done as user root or ".ZM_WEB_USER.".\n" ); + exit( -1 ); + } + + # Run as web user/group + $( = $webGid; + $) = $webGid; + $< = $webUid; + $> = $webUid; + + print( "\nAbout to convert saved events to deep storage, please ensure that ZoneMinder is fully stopped before proceeding.\nThis process is not easily reversible. Are you sure you wish to proceed?\n\nPress 'y' to continue or 'n' to abort : " ); + my $response = ; + chomp( $response ); + while ( $response !~ /^[yYnN]$/ ) + { + print( "Please press 'y' to continue or 'n' to abort only : " ); + $response = ; + chomp( $response ); + } + + if ( $response =~ /^[yY]$/ ) + { + print( "Converting all events to deep storage.\n" ); + + chdir( ZM_PATH_WEB ); + my $dbh = zmDbConnect(); + my $sql = "select *, unix_timestamp(StartTime) as UnixStartTime from Events"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute(); + if ( !$res ) + { + Fatal( "Can't fetch Events: ".$sth->errstr() ); + } + + while( my $event = $sth->fetchrow_hashref() ) + { + my $oldEventPath = ZM_DIR_EVENTS.'/'.$event->{MonitorId}.'/'.$event->{Id}; + + if ( !-d $oldEventPath ) + { + print( "Warning, can't find old event path '$oldEventPath', already converted?\n" ); + next; + } + + print( "Converting event ".$event->{Id}."\n" ); + my $newDatePath = ZM_DIR_EVENTS.'/'.$event->{MonitorId}.'/'.strftime( "%y/%m/%d", localtime($event->{UnixStartTime}) ); + my $newTimePath = strftime( "%H/%M/%S", localtime($event->{UnixStartTime}) ); + my $newEventPath = $newDatePath.'/'.$newTimePath; + ( my $truncEventPath = $newEventPath ) =~ s|/\d+$||; + makePath( $truncEventPath, ZM_PATH_WEB ); + my $idLink = $newDatePath.'/.'.$event->{Id}; + symlink( $newTimePath, $idLink ) or die( "Can't symlink $newTimePath -> $idLink: $!" ); + rename( $oldEventPath, $newEventPath ) or die( "Can't move $oldEventPath -> $newEventPath: $!" ); + } + + print( "Updating configuration.\n" ); + $sql = "update Config set Value = ? where Name = 'ZM_USE_DEEP_STORAGE'"; + $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + $res = $sth->execute( 1 ) or die( "Can't execute: ".$sth->errstr() ); + + print( "All events converted.\n\n" ); + } + else + { + print( "Aborting event conversion.\n\n" ); + } +} +if ( $freshen ) +{ + print( "\nFreshening configuration in database\n" ); + loadConfigFromDB(); + saveConfigToDB(); +} +if ( $version ) +{ + my ( $detaint_version ) = $version =~ /^([\w.]+)$/; + $version = $detaint_version; + + if ( ZM_VERSION eq $version ) + { + print( "\nDatabase already at version $version, update aborted.\n\n" ); + exit( -1 ); + } + + print( "\nInitiating database upgrade to version ".ZM_VERSION." from version $version\n" ); + if ( $interactive ) + { + if ( ZM_DYN_DB_VERSION && ZM_DYN_DB_VERSION ne $version ) + { + print( "\nWARNING - You have specified an upgrade from version $version but the database version found is ".ZM_DYN_DB_VERSION.". Is this correct?\nPress enter to continue or ctrl-C to abort : " ); + my $response = ; + } + + print( "\nPlease ensure that ZoneMinder is stopped on your system prior to upgrading the database.\nPress enter to continue or ctrl-C to stop : " ); + my $response = ; + + print( "\nDo you wish to take a backup of your database prior to upgrading?\nThis may result in a large file in @ZM_TMPDIR@ if you have a lot of events.\nPress 'y' for a backup or 'n' to continue : " ); + $response = ; + chomp( $response ); + while ( $response !~ /^[yYnN]$/ ) + { + print( "Please press 'y' for a backup or 'n' to continue only : " ); + $response = ; + chomp( $response ); + } + + if ( $response =~ /^[yY]$/ ) + { + my ( $host, $port ) = ( ZM_DB_HOST =~ /^([^:]+)(?::(.+))?$/ ); + my $command = "mysqldump -h".$host; + $command .= " -P".$port if defined($port); + if ( $dbUser ) + { + $command .= " -u".$dbUser; + if ( $dbPass ) + { + $command .= " -p".$dbPass; + } + } + my $backup = "@ZM_TMPDIR@/".ZM_DB_NAME."-".$version.".dump"; + $command .= " --add-drop-table --databases ".ZM_DB_NAME." > ".$backup; + print( "Creating backup to $backup. This may take several minutes.\n" ); + print( "Executing '$command'\n" ) if ( logDebugging() ); + my $output = qx($command); + my $status = $? >> 8; + if ( $status || logDebugging() ) + { + chomp( $output ); + print( "Output: $output\n" ); + } + if ( $status ) + { + die( "Command '$command' exited with status: $status\n" ); + } + else + { + print( "Database successfully backed up to $backup, proceeding to upgrade.\n" ); + } + } + elsif ( $response !~ /^[nN]$/ ) + { + die( "Unexpected response '$response'" ); + } + } + sub patchDB + { + my $dbh = shift; + my $version = shift; + + my ( $host, $port ) = ( ZM_DB_HOST =~ /^([^:]+)(?::(.+))?$/ ); + my $command = "mysql -h".$host; + $command .= " -P".$port if defined($port); + if ( $dbUser ) + { + $command .= " -u".$dbUser; + if ( $dbPass ) + { + $command .= " -p".$dbPass; + } + } + $command .= " ".ZM_DB_NAME." < "; + if ( $updateDir ) + { + $command .= $updateDir; + } + else + { + $command .= ZM_PATH_BUILD."/db"; + } + $command .= "/zm_update-".$version.".sql"; + + print( "Executing '$command'\n" ) if ( logDebugging() ); + my $output = qx($command); + my $status = $? >> 8; + if ( $status || logDebugging() ) + { + chomp( $output ); + print( "Output: $output\n" ); + } + if ( $status ) + { + die( "Command '$command' exited with status: $status\n" ); + } + else + { + print( "\nDatabase successfully upgraded from version $version.\n" ); + my $sql = "update Config set Value = ? where Name = 'ZM_DYN_DB_VERSION'"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $version ) or die( "Can't execute: ".$sth->errstr() ); + } + } + + print( "\nUpgrading database to version ".ZM_VERSION."\n" ); + + # Update config first of all + loadConfigFromDB(); + saveConfigToDB(); + + my $dbh = zmDbConnect(); + + my $cascade = undef; + if ( $cascade || $version eq "1.19.0" ) + { + # Patch the database + patchDB( $dbh, "1.19.0" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.19.1" ) + { + # Patch the database + patchDB( $dbh, "1.19.1"); + $cascade = !undef; + } + if ( $cascade || $version eq "1.19.2" ) + { + # Patch the database + patchDB( $dbh, "1.19.2" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.19.3" ) + { + # Patch the database + patchDB( $dbh, "1.19.3" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.19.4" ) + { + require DBI; + + # Rename the event directories and create a new symlink for the names + chdir( EVENT_PATH ); + + my $sql = "select * from Monitors order by Id"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + while( my $monitor = $sth->fetchrow_hashref() ) + { + if ( -d $monitor->{Name} ) + { + rename( $monitor->{Name}, $monitor->{Id} ) or warn( "Can't rename existing monitor directory '$monitor->{Name}' to '$monitor->{Id}': $!" ); + symlink( $monitor->{Id}, $monitor->{Name} ) or warn( "Can't symlink monitor directory '$monitor->{Id}' to '$monitor->{Name}': $!" ); + } + } + $sth->finish(); + + # Patch the database + patchDB( $dbh, "1.19.4" ); + + $cascade = !undef; + } + if ( $cascade || $version eq "1.19.5" ) + { + print( "\nThis version now only uses one database user.\nPlease ensure you have run zmconfig.pl and re-entered your database username and password prior to upgrading, or the upgrade will fail.\nPress enter to continue or ctrl-C to stop : " ); + # Patch the database + my $dummy = ; + patchDB( $dbh, "1.19.5" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.20.0" ) + { + # Patch the database + patchDB( $dbh, "1.20.0" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.20.1" ) + { + # Patch the database + patchDB( $dbh, "1.20.1" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.21.0" ) + { + # Patch the database + patchDB( $dbh, "1.21.0" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.21.1" ) + { + # Patch the database + patchDB( $dbh, "1.21.1" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.21.2" ) + { + # Patch the database + patchDB( $dbh, "1.21.2" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.21.3" ) + { + # Patch the database + patchDB( $dbh, "1.21.3" ); + + # Add appropriate widths and heights to events + { + print( "Updating events. This may take a few minutes. Please wait.\n" ); + my $sql = "select * from Monitors order by Id"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + while( my $monitor = $sth->fetchrow_hashref() ) + { + my $sql = "update Events set Width = ?, Height = ? where MonitorId = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $monitor->{Width}, $monitor->{Height}, $monitor->{Id} ) or die( "Can't execute: ".$sth->errstr() ); + } + $sth->finish(); + } + + # Add sequence numbers + { + print( "Updating monitor sequences. Please wait.\n" ); + my $sql = "select * from Monitors order by Id"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + my $sequence = 1; + while( my $monitor = $sth->fetchrow_hashref() ) + { + my $sql = "update Monitors set Sequence = ? where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $sequence++, $monitor->{Id} ) or die( "Can't execute: ".$sth->errstr() ); + } + $sth->finish(); + } + + # Update saved filters + { + print( "Updating saved filters. Please wait.\n" ); + my $sql = "select * from Filters"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + my @filters; + while( my $filter = $sth->fetchrow_hashref() ) + { + push( @filters, $filter ); + } + $sth->finish(); + $sql = "update Filters set Query = ? where Name = ?"; + $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + foreach my $filter ( @filters ) + { + if ( $filter->{Query} =~ /op\d=&/ ) + { + ( my $newQuery = $filter->{Query} ) =~ s/(op\d=)&/$1=&/g; + $res = $sth->execute( $newQuery, $filter->{Name} ) or die( "Can't execute: ".$sth->errstr() ); + } + } + } + + $cascade = !undef; + } + if ( $cascade || $version eq "1.21.4" ) + { + # Patch the database + patchDB( $dbh, "1.21.4" ); + + # Convert zones to new format + { + print( "Updating zones. Please wait.\n" ); + + # Get the existing zones from the DB + my $sql = "select Z.*,M.Width,M.Height from Zones as Z inner join Monitors as M on (Z.MonitorId = M.Id)"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + my @zones; + while( my $zone = $sth->fetchrow_hashref() ) + { + push( @zones, $zone ); + } + $sth->finish(); + + no strict 'refs'; + foreach my $zone ( @zones ) + { + # Create the coordinate strings + if ( $zone->{Units} eq "Pixels" ) + { + my $sql = "update Zones set NumCoords = 4, Coords = concat( LoX,',',LoY,' ',HiX,',',LoY,' ',HiX,',',HiY,' ',LoX,',',HiY ), Area = round( ((HiX-LoX)+1)*((HiY-LoY)+1) ) where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $zone->{Id} ) or die( "Can't execute: ".$sth->errstr() ); + } + else + { + my $loX = ($zone->{LoX} * ($zone->{Width}-1) ) / 100; + my $hiX = ($zone->{HiX} * ($zone->{Width}-1) ) / 100; + my $loY = ($zone->{LoY} * ($zone->{Height}-1) ) / 100; + my $hiY = ($zone->{HiY} * ($zone->{Height}-1) ) / 100; + my $area = (($hiX-$loX)+1)*(($hiY-$loY)+1); + my $sql = "update Zones set NumCoords = 4, Coords = concat( round(?),',',round(?),' ',round(?),',',round(?),' ',round(?),',',round(?),' ',round(?),',',round(?) ), Area = round(?), MinAlarmPixels = round(?), MaxAlarmPixels = round(?), MinFilterPixels = round(?), MaxFilterPixels = round(?), MinBlobPixels = round(?), MaxBlobPixels = round(?) where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $loX, $loY, $hiX, $loY, $hiX, $hiY, $loX, $hiY, $area, ($zone->{MinAlarmPixels}*$area)/100, ($zone->{MaxAlarmPixels}*$area)/100, ($zone->{MinFilterPixels}*$area)/100, ($zone->{MaxFilterPixels}*$area)/100, ($zone->{MinBlobPixels}*$area)/100, ($zone->{MaxBlobPixels}*$area)/100, $zone->{Id} ) or die( "Can't execute: ".$sth->errstr() ); + } + } + } + # Convert run states to new format + { + print( "Updating run states. Please wait.\n" ); + + # Get the existing zones from the DB + my $sql = "select * from States"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + my @states; + while( my $state = $sth->fetchrow_hashref() ) + { + push( @states, $state ); + } + $sth->finish(); + + foreach my $state ( @states ) + { + my @new_defns; + foreach my $defn ( split( /,/, $state->{Definition} ) ) + { + push( @new_defns, $defn.":1" ); + } + my $sql = "update States set Definition = ? where Name = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( join( ',', @new_defns ), $state->{Name} ) or die( "Can't execute: ".$sth->errstr() ); + } + } + + $cascade = !undef; + } + if ( $cascade || $version eq "1.22.0" ) + { + # Patch the database + patchDB( $dbh, "1.22.0" ); + + # Check for maximum FPS setting and update alarm max fps settings + { + print( "Updating monitors. Please wait.\n" ); + if ( defined(&ZM_NO_MAX_FPS_ON_ALARM) && &ZM_NO_MAX_FPS_ON_ALARM ) + { + # Update the individual monitor settings to match the previous global one + my $sql = "update Monitors set AlarmMaxFPS = NULL"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + } + else + { + # Update the individual monitor settings to match the previous global one + my $sql = "update Monitors set AlarmMaxFPS = MaxFPS"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + } + } + { + print( "Updating mail configuration. Please wait.\n" ); + my ( $sql, $sth, $res ); + if ( defined(&ZM_EMAIL_TEXT) && &ZM_EMAIL_TEXT ) + { + my ( $email_subject, $email_body ) = ZM_EMAIL_TEXT =~ /subject\s*=\s*"([^\n]*)".*body\s*=\s*"(.*)"?$/ms; + $sql = "replace into Config set Id = 0, Name = 'ZM_EMAIL_SUBJECT', Value = '".$email_subject."', Type = 'string', DefaultValue = 'ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)', Hint = 'string', Pattern = '(?-xism:^(.+)\$)', Format = ' \$1 ', Prompt = 'The subject of the email used to send matching event details', Help = 'This option is used to define the subject of the email that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1'"; + $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + $sql = "replace into Config set Id = 0, Name = 'ZM_EMAIL_BODY', Value = '".$email_body."', Hint = 'free text', Pattern = '(?-xism:^(.+)\$)', Format = ' \$1 ', Prompt = 'The body of the email used to send matching event details', Help = 'This option is used to define the content of the email that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1'"; + $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + } + if ( defined(&ZM_MESSAGE_TEXT) && &ZM_MESSAGE_TEXT ) + { + my ( $message_subject, $message_body ) = ZM_MESSAGE_TEXT =~ /subject\s*=\s*"([^\n]*)".*body\s*=\s*"(.*)"?$/ms; + $sql = "replace into Config set Id = 0, Name = 'ZM_MESSAGE_SUBJECT', Value = '".$message_subject."', Type = 'string', DefaultValue = 'ZoneMinder: Alarm - %MN%-%EI%', Hint = 'string', Pattern = '(?-xism:^(.+)\$)', Format = ' \$1 ', Prompt = 'The subject of the message used to send matching event details', Help = 'This option is used to define the subject of the message that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1'"; + $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + $sql = "replace into Config set Id = 0, Name = 'ZM_MESSAGE_BODY', Value = '".$message_body."', Type = 'text', DefaultValue = 'ZM alarm detected - %ED% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.', Hint = 'free text', Pattern = '(?-xism:^(.+)\$)', Format = ' \$1 ', Prompt = 'The body of the message used to send matching event details', Help = 'This option is used to define the content of the message that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1'"; + $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + } + } + $cascade = !undef; + } + if ( $cascade || $version eq "1.22.1" ) + { + # Patch the database + patchDB( $dbh, "1.22.1" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.22.2" ) + { + # Patch the database + patchDB( $dbh, "1.22.2" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.22.3" ) + { + # Patch the database + patchDB( $dbh, "1.22.3" ); + + # Convert timestamp strings to new format + { + my $sql = "select * from Monitors"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + my @db_monitors; + while( my $db_monitor = $sth->fetchrow_hashref() ) + { + push( @db_monitors, $db_monitor ); + } + $sth->finish(); + foreach my $db_monitor ( @db_monitors ) + { + if ( $db_monitor->{LabelFormat} =~ /\%\%s/ ) + { + $db_monitor->{LabelFormat} =~ s/\%\%s/%N/; + $db_monitor->{LabelFormat} =~ s/\%\%s/%Q/; + + my $sql = "update Monitors set LabelFormat = ? where Id = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $db_monitor->{LabelFormat}, $db_monitor->{Id} ) or die( "Can't execute: ".$sth->errstr() ); + } + } + } + + # Convert filters to new format + { + my $sql = "select * from Filters"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + my @dbFilters; + while( my $dbFilter = $sth->fetchrow_hashref() ) + { + push( @dbFilters, $dbFilter ); + } + $sth->finish(); + foreach my $dbFilter ( @dbFilters ) + { + my %filter_terms; + foreach my $filter_parm ( split( /&/, $dbFilter->{Query} ) ) + { + my( $key, $value ) = split( /=/, $filter_parm, 2 ); + if ( $key ) + { + $filter_terms{$key} = $value; + } + } + my $filter = { 'terms' => [] }; + for ( my $i = 1; $i <= $filter_terms{trms}; $i++ ) + { + my $term = {}; + my $conjunction_name = "cnj$i"; + my $obracket_name = "obr$i"; + my $cbracket_name = "cbr$i"; + my $attr_name = "attr$i"; + my $op_name = "op$i"; + my $value_name = "val$i"; + + $term->{cnj} = $filter_terms{$conjunction_name} if ( $filter_terms{$conjunction_name} ); + $term->{obr} = $filter_terms{$obracket_name} if ( $filter_terms{$obracket_name} ); + $term->{attr} = $filter_terms{$attr_name} if ( $filter_terms{$attr_name} ); + $term->{val} = $filter_terms{$value_name} if ( defined($filter_terms{$value_name}) ); + $term->{op} = $filter_terms{$op_name} if ( $filter_terms{$op_name} ); + $term->{cbr} = $filter_terms{$cbracket_name} if ( $filter_terms{$cbracket_name} ); + push( @{$filter->{terms}}, $term ); + } + $filter->{sort_field} = $filter_terms{sort_field} if ( $filter_terms{sort_field} ); + $filter->{sort_asc} = $filter_terms{sort_asc} if ( $filter_terms{sort_asc} ); + $filter->{limit} = $filter_terms{limit} if ( $filter_terms{limit} ); + + my $newQuery = 'a:'.int(keys(%$filter)).':{s:5:"terms";a:'.int(@{$filter->{terms}}).':{'; + my $i = 0; + foreach my $term ( @{$filter->{terms}} ) + { + $newQuery .= 'i:'.$i.';a:'.int(keys(%$term)).':{'; + while ( my ( $key, $val ) = each( %$term ) ) + { + $newQuery .= 's:'.length($key).':"'.$key.'";'; + $newQuery .= 's:'.length($val).':"'.$val.'";'; + } + $newQuery .= '}'; + $i++; + } + $newQuery .= '}'; + foreach my $field ( "sort_field", "sort_asc", "limit" ) + { + if ( defined($filter->{$field}) ) + { + $newQuery .= 's:'.length($field).':"'.$field.'";'; + $newQuery .= 's:'.length($filter->{$field}).':"'.$filter->{$field}.'";'; + } + } + $newQuery .= '}'; + + my $sql = "update Filters set Query = ? where Name = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $newQuery, $dbFilter->{Name} ) or die( "Can't execute: ".$sth->errstr() ); + } + } + + # Update the stream quality setting to the old image quality ones + { + my $dbh = zmDbConnect(); + + my $sql = "update Config set Value = ? where Name = 'ZM_JPEG_STREAM_QUALITY'"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( ZM_JPEG_IMAGE_QUALITY ) or die( "Can't execute: ".$sth->errstr() ); + } + $cascade = !undef; + } + if ( $cascade || $version eq "1.23.0" ) + { + # Patch the database + patchDB( $dbh, "1.23.0" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.23.1" ) + { + # Patch the database + patchDB( $dbh, "1.23.1" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.23.2" ) + { + # Patch the database + patchDB( $dbh, "1.23.2" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.23.3" ) + { + # Patch the database + patchDB( $dbh, "1.23.3" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.24.0" ) + { + # Patch the database + patchDB( $dbh, "1.24.0" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.24.1" ) + { + # Patch the database + patchDB( $dbh, "1.24.1" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.24.2" ) + { + # Patch the database + patchDB( $dbh, "1.24.2" ); + $cascade = !undef; + } + if ( $cascade || $version eq "1.24.3" ) + { + my $result = eval + { + require PHP::Serialization; + PHP::Serialization->import(); + }; + die( "Unable to perform upgrade from 1.24.3, PHP::Serialization module not found" ) if ( $result ); + + # Patch the database + patchDB( $dbh, "1.24.3" ); + + # Convert filters to JSON from PHP format serialisation + { + print( "\nConverting filters from PHP to JSON format\n" ); + my $sql = "select * from Filters"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + my @dbFilters; + while( my $dbFilter = $sth->fetchrow_hashref() ) + { + push( @dbFilters, $dbFilter ); + } + $sth->finish(); + foreach my $dbFilter ( @dbFilters ) + { + print( " ".$dbFilter->{Name} ); + eval { + my $phpQuery = $dbFilter->{Query}; + my $query = PHP::Serialization::unserialize( $phpQuery ); + my $jsonQuery = jsonEncode( $query ); + my $sql = "update Filters set Query = ? where Name = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $jsonQuery, $dbFilter->{Name} ) or die( "Can't execute: ".$sth->errstr() ); + }; + if ( $@ ) + { + print( " - failed, please check or report. Query is '".$dbFilter->{Query}."'\n" ); + print( $@ ); + } + else + { + print( " - complete\n" ); + } + } + print( "Conversion complete\n" ); + } + $cascade = !undef; + } + if ( $cascade || $version eq "1.24.4" ) + { + # Patch the database + patchDB( $dbh, "1.24.4" ); + + # Copy the FTP specific values to the new general config + my $fetchSql = "select * from Config where Name like 'ZM_UPLOAD_FTP_%'"; + my $fetchSth = $dbh->prepare_cached( $fetchSql ) or die( "Can't prepare '$fetchSql': ".$dbh->errstr() ); + my $updateSql = "update Config set Value = ? where Name = ?"; + my $updateSth = $dbh->prepare_cached( $updateSql ) or die( "Can't prepare '$updateSql': ".$dbh->errstr() ); + my $fetchRes = $fetchSth->execute() or die( "Can't execute: ".$fetchSth->errstr() ); + while( my $config = $fetchSth->fetchrow_hashref() ) + { + ( my $name = $config->{Name} ) =~ s/_FTP_/_/; + my $updateRes = $updateSth->execute( $config->{Value}, $name ) or die( "Can't execute: ".$updateSth->errstr() ); + } + $cascade = !undef; + } + if ( $cascade ) + { + my $installed_version = ZM_VERSION; + my $sql = "update Config set Value = ? where Name = ?"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( "$installed_version", "ZM_DYN_DB_VERSION" ) or die( "Can't execute: ".$sth->errstr() ); + $res = $sth->execute( "$installed_version", "ZM_DYN_CURR_VERSION" ) or die( "Can't execute: ".$sth->errstr() ); + $dbh->disconnect(); + } + else + { + $dbh->disconnect(); + die( "Can't find upgrade from version '$version'" ); + } + print( "\nDatabase upgrade to version ".ZM_VERSION." successful.\n\n" ); +} +exit( 0 ); diff --git a/scripts/zmvideo.pl b/scripts/zmvideo.pl new file mode 100644 index 000000000..cd011d8b7 --- /dev/null +++ b/scripts/zmvideo.pl @@ -0,0 +1,243 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder Video Creation Script, $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. +# +# ========================================================================== +# +# This script is used to create MPEG videos of events for the web pages +# or as email attachments. +# +use strict; +use bytes; + +# ========================================================================== +# +# You shouldn't need to change anything from here downwards +# +# ========================================================================== + +use lib '/usr/share/perl/5.14.2'; # Include custom perl install path +use ZoneMinder; +use DBI; +use Data::Dumper; +use POSIX qw(strftime); +use Getopt::Long qw(:config no_ignore_case ); + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +logInit(); + +my $event_id; +my $format = 'mpg'; +my $rate = ''; +my $scale = ''; +my $fps = ''; +my $size = ''; +my $overwrite = 0; + +my @formats = split( /\s+/, ZM_FFMPEG_FORMATS ); +for ( my $i = 0; $i < @formats; $i++ ) +{ + if ( $i =~ /^(.+)\*$/ ) + { + $format = $formats[$i] = $1; + } +} + +sub Usage +{ + print( " +Usage: zmvideo.pl -e ,--event= [--format ] [--rate=] [--scale=] [--fps=] [--size=] [--overwrite] +Parameters are :- +-e, --event= - What event to create the video for +-f, --format= - What format to create the video in, default is mpg. For ffmpeg only. +-r, --rate= - Relative rate , 1 = realtime, 2 = double speed , 0.5 = half speed etc +-s, --scale= - Scale, 1 = normal, 2 = double size, 0.5 = half size etc +-F, --fps= - Absolute frame rate, in frames per second +-S, --size= - Absolute video size, WxH or other specification supported by ffmpeg +-o, --overwrite - Whether to overwrite an existing file, off by default. +"); + exit( -1 ); +} + +if ( !GetOptions( 'event=i'=>\$event_id, 'format|f=s'=>\$format, 'rate|r=f'=>\$rate, 'scale|s=f'=>\$scale, 'fps|F=f'=>\$fps, 'size|S=s'=>\$size, 'overwrite'=>\$overwrite ) ) +{ + Usage(); +} + +if ( !$event_id || $event_id < 0 ) +{ + print( STDERR "Please give a valid event id\n" ); + Usage(); +} + +if ( !ZM_OPT_FFMPEG ) +{ + print( STDERR "Mpeg encoding is not currently enabled\n" ); + exit(-1); +} + +if ( !$rate && !$fps ) +{ + $rate = 1; +} + +if ( !$scale && !$size ) +{ + $scale = 1; +} + +if ( $rate && ($rate < 0.25 || $rate > 100) ) +{ + print( STDERR "Rate is out of range, 0.25 >= rate <= 100\n" ); + Usage(); +} + +if ( $scale && ($scale < 0.25 || $scale > 4) ) +{ + print( STDERR "Scale is out of range, 0.25 >= scale <= 4\n" ); + Usage(); +} + +if ( $fps && ($fps > 30) ) +{ + print( STDERR "FPS is out of range, <= 30\n" ); + Usage(); +} + +my ( $detaint_format ) = $format =~ /^(\w+)$/; +my ( $detaint_rate ) = $rate =~ /^(-?\d+(?:\.\d+)?)$/; +my ( $detaint_scale ) = $scale =~ /^(-?\d+(?:\.\d+)?)$/; +my ( $detaint_fps ) = $fps =~ /^(-?\d+(?:\.\d+)?)$/; +my ( $detaint_size ) = $size =~ /^(\w+)$/; + +$format = $detaint_format; +$rate = $detaint_rate; +$scale = $detaint_scale; +$fps = $detaint_fps; +$size = $detaint_size; + +my $dbh = zmDbConnect(); + +my @filters; +my $sql = "select max(F.Delta)-min(F.Delta) as FullLength, E.*, unix_timestamp(E.StartTime) as Time, M.Name as MonitorName, M.Width as MonitorWidth, M.Height as MonitorHeight, M.Palette from Frames as F inner join Events as E on F.EventId = E.Id inner join Monitors as M on E.MonitorId = M.Id where EventId = '$event_id' group by F.EventId"; +my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); +my $res = $sth->execute() or Fatal( "Can't execute: ".$sth->errstr() ); +my $event = $sth->fetchrow_hashref(); +$sth->finish(); +my $event_path = getEventPath( $event ); +chdir( $event_path ); +( my $video_name = $event->{Name} ) =~ s/\s/_/g; + +my @file_parts; +if ( $rate ) +{ + my $file_rate = $rate; + $file_rate =~ s/\./_/; + $file_rate =~ s/_00//; + $file_rate =~ s/(_\d+)0+$/$1/; + $file_rate = 'r'.$file_rate; + push( @file_parts, $file_rate ); +} +elsif ( $fps ) +{ + my $file_fps = $fps; + $file_fps =~ s/\./_/; + $file_fps =~ s/_00//; + $file_fps =~ s/(_\d+)0+$/$1/; + $file_fps = 'R'.$file_fps; + push( @file_parts, $file_fps ); +} + +if ( $scale ) +{ + my $file_scale = $scale; + $file_scale =~ s/\./_/; + $file_scale =~ s/_00//; + $file_scale =~ s/(_\d+)0+$/$1/; + $file_scale = 's'.$file_scale; + push( @file_parts, $file_scale ); +} +elsif ( $size ) +{ + my $file_size = 'S'.$size; + push( @file_parts, $file_size ); +} +my $video_file = "$video_name-".$file_parts[0]."-".$file_parts[1].".$format"; + +if ( $overwrite || !-s $video_file ) +{ + Info( "Creating video file $video_file for event $event->{Id}\n" ); + + my $frame_rate = sprintf( "%.2f", $event->{Frames}/$event->{FullLength} ); + if ( $rate ) + { + if ( $rate != 1.0 ) + { + $frame_rate *= $rate; + } + } + elsif ( $fps ) + { + $frame_rate = $fps; + } + + my $width = $event->{MonitorWidth}; + my $height = $event->{MonitorHeight}; + my $video_size = " ${width}x${height}"; + + if ( $scale ) + { + if ( $scale != 1.0 ) + { + $width = int($width*$scale); + $height = int($height*$scale); + $video_size = " ${width}x${height}"; + } + } + elsif ( $size ) + { + $video_size = $size; + } + + my $command = ZM_PATH_FFMPEG." -y -r $frame_rate ".ZM_FFMPEG_INPUT_OPTIONS." -i %0".ZM_EVENT_IMAGE_DIGITS."d-capture.jpg -s $video_size ".ZM_FFMPEG_OUTPUT_OPTIONS." '$video_file' > ffmpeg.log 2>&1"; + Debug( $command."\n" ); + my $output = qx($command); + + my $status = $? >> 8; + if ( $status ) + { + Error( "Unable to generate video, check ".$event_path."/ffmpeg.log for details" ); + exit( -1 ); + } + + Info( "Finished $video_file\n" ); +} +else +{ + Info( "Video file $video_file already exists for event $event->{Id}\n" ); +} +#print( STDOUT $event->{MonitorId}.'/'.$event->{Id}.'/'.$video_file."\n" ); +print( STDOUT $video_file."\n" ); +exit( 0 ); diff --git a/scripts/zmvideo.pl.in b/scripts/zmvideo.pl.in new file mode 100644 index 000000000..236e5d20c --- /dev/null +++ b/scripts/zmvideo.pl.in @@ -0,0 +1,243 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder Video Creation Script, $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. +# +# ========================================================================== +# +# This script is used to create MPEG videos of events for the web pages +# or as email attachments. +# +use strict; +use bytes; + +# ========================================================================== +# +# You shouldn't need to change anything from here downwards +# +# ========================================================================== + +@EXTRA_PERL_LIB@ +use ZoneMinder; +use DBI; +use Data::Dumper; +use POSIX qw(strftime); +use Getopt::Long qw(:config no_ignore_case ); + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +logInit(); + +my $event_id; +my $format = 'mpg'; +my $rate = ''; +my $scale = ''; +my $fps = ''; +my $size = ''; +my $overwrite = 0; + +my @formats = split( /\s+/, ZM_FFMPEG_FORMATS ); +for ( my $i = 0; $i < @formats; $i++ ) +{ + if ( $i =~ /^(.+)\*$/ ) + { + $format = $formats[$i] = $1; + } +} + +sub Usage +{ + print( " +Usage: zmvideo.pl -e ,--event= [--format ] [--rate=] [--scale=] [--fps=] [--size=] [--overwrite] +Parameters are :- +-e, --event= - What event to create the video for +-f, --format= - What format to create the video in, default is mpg. For ffmpeg only. +-r, --rate= - Relative rate , 1 = realtime, 2 = double speed , 0.5 = half speed etc +-s, --scale= - Scale, 1 = normal, 2 = double size, 0.5 = half size etc +-F, --fps= - Absolute frame rate, in frames per second +-S, --size= - Absolute video size, WxH or other specification supported by ffmpeg +-o, --overwrite - Whether to overwrite an existing file, off by default. +"); + exit( -1 ); +} + +if ( !GetOptions( 'event=i'=>\$event_id, 'format|f=s'=>\$format, 'rate|r=f'=>\$rate, 'scale|s=f'=>\$scale, 'fps|F=f'=>\$fps, 'size|S=s'=>\$size, 'overwrite'=>\$overwrite ) ) +{ + Usage(); +} + +if ( !$event_id || $event_id < 0 ) +{ + print( STDERR "Please give a valid event id\n" ); + Usage(); +} + +if ( !ZM_OPT_FFMPEG ) +{ + print( STDERR "Mpeg encoding is not currently enabled\n" ); + exit(-1); +} + +if ( !$rate && !$fps ) +{ + $rate = 1; +} + +if ( !$scale && !$size ) +{ + $scale = 1; +} + +if ( $rate && ($rate < 0.25 || $rate > 100) ) +{ + print( STDERR "Rate is out of range, 0.25 >= rate <= 100\n" ); + Usage(); +} + +if ( $scale && ($scale < 0.25 || $scale > 4) ) +{ + print( STDERR "Scale is out of range, 0.25 >= scale <= 4\n" ); + Usage(); +} + +if ( $fps && ($fps > 30) ) +{ + print( STDERR "FPS is out of range, <= 30\n" ); + Usage(); +} + +my ( $detaint_format ) = $format =~ /^(\w+)$/; +my ( $detaint_rate ) = $rate =~ /^(-?\d+(?:\.\d+)?)$/; +my ( $detaint_scale ) = $scale =~ /^(-?\d+(?:\.\d+)?)$/; +my ( $detaint_fps ) = $fps =~ /^(-?\d+(?:\.\d+)?)$/; +my ( $detaint_size ) = $size =~ /^(\w+)$/; + +$format = $detaint_format; +$rate = $detaint_rate; +$scale = $detaint_scale; +$fps = $detaint_fps; +$size = $detaint_size; + +my $dbh = zmDbConnect(); + +my @filters; +my $sql = "select max(F.Delta)-min(F.Delta) as FullLength, E.*, unix_timestamp(E.StartTime) as Time, M.Name as MonitorName, M.Width as MonitorWidth, M.Height as MonitorHeight, M.Palette from Frames as F inner join Events as E on F.EventId = E.Id inner join Monitors as M on E.MonitorId = M.Id where EventId = '$event_id' group by F.EventId"; +my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); +my $res = $sth->execute() or Fatal( "Can't execute: ".$sth->errstr() ); +my $event = $sth->fetchrow_hashref(); +$sth->finish(); +my $event_path = getEventPath( $event ); +chdir( $event_path ); +( my $video_name = $event->{Name} ) =~ s/\s/_/g; + +my @file_parts; +if ( $rate ) +{ + my $file_rate = $rate; + $file_rate =~ s/\./_/; + $file_rate =~ s/_00//; + $file_rate =~ s/(_\d+)0+$/$1/; + $file_rate = 'r'.$file_rate; + push( @file_parts, $file_rate ); +} +elsif ( $fps ) +{ + my $file_fps = $fps; + $file_fps =~ s/\./_/; + $file_fps =~ s/_00//; + $file_fps =~ s/(_\d+)0+$/$1/; + $file_fps = 'R'.$file_fps; + push( @file_parts, $file_fps ); +} + +if ( $scale ) +{ + my $file_scale = $scale; + $file_scale =~ s/\./_/; + $file_scale =~ s/_00//; + $file_scale =~ s/(_\d+)0+$/$1/; + $file_scale = 's'.$file_scale; + push( @file_parts, $file_scale ); +} +elsif ( $size ) +{ + my $file_size = 'S'.$size; + push( @file_parts, $file_size ); +} +my $video_file = "$video_name-".$file_parts[0]."-".$file_parts[1].".$format"; + +if ( $overwrite || !-s $video_file ) +{ + Info( "Creating video file $video_file for event $event->{Id}\n" ); + + my $frame_rate = sprintf( "%.2f", $event->{Frames}/$event->{FullLength} ); + if ( $rate ) + { + if ( $rate != 1.0 ) + { + $frame_rate *= $rate; + } + } + elsif ( $fps ) + { + $frame_rate = $fps; + } + + my $width = $event->{MonitorWidth}; + my $height = $event->{MonitorHeight}; + my $video_size = " ${width}x${height}"; + + if ( $scale ) + { + if ( $scale != 1.0 ) + { + $width = int($width*$scale); + $height = int($height*$scale); + $video_size = " ${width}x${height}"; + } + } + elsif ( $size ) + { + $video_size = $size; + } + + my $command = ZM_PATH_FFMPEG." -y -r $frame_rate ".ZM_FFMPEG_INPUT_OPTIONS." -i %0".ZM_EVENT_IMAGE_DIGITS."d-capture.jpg -s $video_size ".ZM_FFMPEG_OUTPUT_OPTIONS." '$video_file' > ffmpeg.log 2>&1"; + Debug( $command."\n" ); + my $output = qx($command); + + my $status = $? >> 8; + if ( $status ) + { + Error( "Unable to generate video, check ".$event_path."/ffmpeg.log for details" ); + exit( -1 ); + } + + Info( "Finished $video_file\n" ); +} +else +{ + Info( "Video file $video_file already exists for event $event->{Id}\n" ); +} +#print( STDOUT $event->{MonitorId}.'/'.$event->{Id}.'/'.$video_file."\n" ); +print( STDOUT $video_file."\n" ); +exit( 0 ); diff --git a/scripts/zmwatch.pl b/scripts/zmwatch.pl new file mode 100644 index 000000000..5d16d3122 --- /dev/null +++ b/scripts/zmwatch.pl @@ -0,0 +1,148 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder WatchDog Script, $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. +# +# ========================================================================== +# +# This does some basic setup for ZoneMinder to run and then periodically +# checks the fps output of the active daemons to check they haven't +# locked up. If they have then they are killed and restarted +# +use strict; +use bytes; + +# ========================================================================== +# +# These are the elements you can edit to suit your installation +# +# ========================================================================== + +use constant START_DELAY => 30; # To give everything else time to start + +# ========================================================================== +# +# Don't change anything below here +# +# ========================================================================== + +use lib '/usr/share/perl/5.14.2'; # Include custom perl install path +use ZoneMinder; +use POSIX; +use DBI; +use Data::Dumper; + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +sub Usage +{ + print( " +Usage: zmwatch.pl +"); + exit( -1 ); +} + +logInit(); +logSetSignal(); + +Info( "Watchdog starting\n" ); +Info( "Watchdog pausing for ".START_DELAY." seconds\n" ); +sleep( START_DELAY ); + +my $dbh = zmDbConnect(); + +my $sql = "select * from Monitors"; +my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + +while( 1 ) +{ + my $now = time(); + my $res = $sth->execute() or Fatal( "Can't execute: ".$sth->errstr() ); + while( my $monitor = $sth->fetchrow_hashref() ) + { + if ( $monitor->{Function} ne 'None' ) + { + my $restart = 0; + if ( zmMemVerify( $monitor ) && zmMemRead( $monitor, "shared_data:valid" ) ) + { + # Check we have got an image recently + my $image_time = zmGetLastWriteTime( $monitor ); + next if ( !defined($image_time) ); # Can't read from shared data + next if ( !$image_time ); # We can't get the last capture time so can't be sure it's died. + + my $max_image_delay = ($monitor->{MaxFPS}&&($monitor->{MaxFPS}>0)&&($monitor->{MaxFPS}<1))?(3/$monitor->{MaxFPS}):ZM_WATCH_MAX_DELAY; + my $image_delay = $now-$image_time; + Debug( "Monitor $monitor->{Id} last captured $image_delay seconds ago, max is $max_image_delay\n" ); + if ( $image_delay > $max_image_delay ) + { + Info( "Restarting capture daemon for ".$monitor->{Name}.", time since last capture $image_delay seconds ($now-$image_time)\n" ); + $restart = 1; + } + } + else + { + #Info( "Restarting capture daemon for ".$monitor->{Name}.", shared data not valid\n" ); + #$restart = 1; + } + + if ( $restart ) + { + my $command; + if ( $monitor->{Type} eq 'Local' ) + { + $command = "zmdc.pl restart zmc -d $monitor->{Device}"; + } + else + { + $command = "zmdc.pl restart zmc -m $monitor->{Id}"; + } + runCommand( $command ); + } + elsif ( $monitor->{Function} ne 'Monitor' ) + { + if ( zmMemVerify( $monitor ) && zmMemRead( $monitor, "shared_data:valid" ) ) + { + # Check we have got an image recently + my $image_time = zmGetLastReadTime( $monitor ); + next if ( !defined($image_time) ); # Can't read from shared data + next if ( !$image_time ); # We can't get the last capture time so can't be sure it's died. + + my $max_image_delay = ($monitor->{MaxFPS}&&($monitor->{MaxFPS}>0)&&($monitor->{MaxFPS}<1))?(3/$monitor->{MaxFPS}):ZM_WATCH_MAX_DELAY; + my $image_delay = $now-$image_time; + Debug( "Monitor $monitor->{Id} last analysed $image_delay seconds ago, max is $max_image_delay\n" ); + if ( $image_delay > $max_image_delay ) + { + Info( "Restarting analysis daemon for ".$monitor->{Name}.", time since last analysis $image_delay seconds ($now-$image_time)\n" ); + my $command = "zmdc.pl restart zma -m ".$monitor->{Id}; + runCommand( $command ); + } + } + } + } + # Prevent open handles building up if we have connect to shared memory + zmMemInvalidate( $monitor ); + } + sleep( ZM_WATCH_CHECK_INTERVAL ); +} +Info( "Watchdog exiting\n" ); +exit(); diff --git a/scripts/zmwatch.pl.in b/scripts/zmwatch.pl.in new file mode 100644 index 000000000..4d50f0496 --- /dev/null +++ b/scripts/zmwatch.pl.in @@ -0,0 +1,148 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder WatchDog Script, $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. +# +# ========================================================================== +# +# This does some basic setup for ZoneMinder to run and then periodically +# checks the fps output of the active daemons to check they haven't +# locked up. If they have then they are killed and restarted +# +use strict; +use bytes; + +# ========================================================================== +# +# These are the elements you can edit to suit your installation +# +# ========================================================================== + +use constant START_DELAY => 30; # To give everything else time to start + +# ========================================================================== +# +# Don't change anything below here +# +# ========================================================================== + +@EXTRA_PERL_LIB@ +use ZoneMinder; +use POSIX; +use DBI; +use Data::Dumper; + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +sub Usage +{ + print( " +Usage: zmwatch.pl +"); + exit( -1 ); +} + +logInit(); +logSetSignal(); + +Info( "Watchdog starting\n" ); +Info( "Watchdog pausing for ".START_DELAY." seconds\n" ); +sleep( START_DELAY ); + +my $dbh = zmDbConnect(); + +my $sql = "select * from Monitors"; +my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + +while( 1 ) +{ + my $now = time(); + my $res = $sth->execute() or Fatal( "Can't execute: ".$sth->errstr() ); + while( my $monitor = $sth->fetchrow_hashref() ) + { + if ( $monitor->{Function} ne 'None' ) + { + my $restart = 0; + if ( zmMemVerify( $monitor ) && zmMemRead( $monitor, "shared_data:valid" ) ) + { + # Check we have got an image recently + my $image_time = zmGetLastWriteTime( $monitor ); + next if ( !defined($image_time) ); # Can't read from shared data + next if ( !$image_time ); # We can't get the last capture time so can't be sure it's died. + + my $max_image_delay = ($monitor->{MaxFPS}&&($monitor->{MaxFPS}>0)&&($monitor->{MaxFPS}<1))?(3/$monitor->{MaxFPS}):ZM_WATCH_MAX_DELAY; + my $image_delay = $now-$image_time; + Debug( "Monitor $monitor->{Id} last captured $image_delay seconds ago, max is $max_image_delay\n" ); + if ( $image_delay > $max_image_delay ) + { + Info( "Restarting capture daemon for ".$monitor->{Name}.", time since last capture $image_delay seconds ($now-$image_time)\n" ); + $restart = 1; + } + } + else + { + #Info( "Restarting capture daemon for ".$monitor->{Name}.", shared data not valid\n" ); + #$restart = 1; + } + + if ( $restart ) + { + my $command; + if ( $monitor->{Type} eq 'Local' ) + { + $command = "zmdc.pl restart zmc -d $monitor->{Device}"; + } + else + { + $command = "zmdc.pl restart zmc -m $monitor->{Id}"; + } + runCommand( $command ); + } + elsif ( $monitor->{Function} ne 'Monitor' ) + { + if ( zmMemVerify( $monitor ) && zmMemRead( $monitor, "shared_data:valid" ) ) + { + # Check we have got an image recently + my $image_time = zmGetLastReadTime( $monitor ); + next if ( !defined($image_time) ); # Can't read from shared data + next if ( !$image_time ); # We can't get the last capture time so can't be sure it's died. + + my $max_image_delay = ($monitor->{MaxFPS}&&($monitor->{MaxFPS}>0)&&($monitor->{MaxFPS}<1))?(3/$monitor->{MaxFPS}):ZM_WATCH_MAX_DELAY; + my $image_delay = $now-$image_time; + Debug( "Monitor $monitor->{Id} last analysed $image_delay seconds ago, max is $max_image_delay\n" ); + if ( $image_delay > $max_image_delay ) + { + Info( "Restarting analysis daemon for ".$monitor->{Name}.", time since last analysis $image_delay seconds ($now-$image_time)\n" ); + my $command = "zmdc.pl restart zma -m ".$monitor->{Id}; + runCommand( $command ); + } + } + } + } + # Prevent open handles building up if we have connect to shared memory + zmMemInvalidate( $monitor ); + } + sleep( ZM_WATCH_CHECK_INTERVAL ); +} +Info( "Watchdog exiting\n" ); +exit(); diff --git a/scripts/zmx10.pl b/scripts/zmx10.pl new file mode 100644 index 000000000..936e18889 --- /dev/null +++ b/scripts/zmx10.pl @@ -0,0 +1,675 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder X10 Control Script, $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. +# +# ========================================================================== +# +# This script controls the monitoring of the X10 interface and the consequent +# management of the ZM daemons based on the receipt of X10 signals. +# +use strict; +use bytes; + +# ========================================================================== +# +# These are the elements you can edit to suit your installation +# +# ========================================================================== + +use constant CAUSE_STRING => "X10"; # What gets written as the cause of any events + +# ========================================================================== +# +# Don't change anything below here +# +# ========================================================================== + +use lib '/usr/share/perl/5.14.2'; # Include custom perl install path +use ZoneMinder; +use POSIX; +use Socket; +use Getopt::Long; +use Data::Dumper; + +use constant SOCK_FILE => ZM_PATH_SOCKS.'/zmx10.sock'; + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +sub Usage +{ + print( " +Usage: zmx10.pl -c ,--command= [-u ,--unit-code=] +Parameters are :- +-c , --command= - Command to issue, one of 'on','off','dim','bright','status','shutdown' +-u , --unit-code= - Unit code to act on required for all commands except 'status' (optional) and 'shutdown' +"); + exit( -1 ); +} + +logInit(); +logSetSignal(); + +my $command; +my $unit_code; + +if ( !GetOptions( 'command=s'=>\$command, 'unit-code=i'=>\$unit_code ) ) +{ + Usage(); +} + +die( "No command given" ) unless( $command ); +die( "No unit code given" ) unless( $unit_code || ($command =~ /(?:start|status|shutdown)/) ); + +if ( $command eq "start" ) +{ + X10Server::runServer(); + exit(); +} + +socket( CLIENT, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" ); + +my $saddr = sockaddr_un( SOCK_FILE ); + +if ( !connect( CLIENT, $saddr ) ) +{ + # The server isn't there + print( "Unable to connect, starting server\n" ); + close( CLIENT ); + + if ( my $cpid = fork() ) + { + # Parent process just sleep and fall through + sleep( 2 ); + logReinit(); + socket( CLIENT, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" ); + connect( CLIENT, $saddr ) or Fatal( "Can't connect: $!" ); + } + elsif ( defined($cpid) ) + { + setpgrp(); + + logReinit(); + X10Server::runServer(); + } + else + { + Fatal( "Can't fork: $!" ); + } +} +# The server is there, connect to it +#print( "Writing commands\n" ); +CLIENT->autoflush(); +my $message = "$command"; +$message .= ";$unit_code" if ( $unit_code ); +print( CLIENT $message ); +shutdown( CLIENT, 1 ); +while ( my $line = ) +{ + chomp( $line ); + print( "$line\n" ); +} +close( CLIENT ); +#print( "Finished writing, bye\n" ); +exit; + +# +# ========================================================================== +# +# This is the X10 Server package +# +# ========================================================================== +# +package X10Server; + +use strict; +use bytes; + +use ZoneMinder; +use POSIX; +use DBI; +use Socket; +use X10::ActiveHome; +use Data::Dumper; + +our $dbh; +our $x10; + +our %monitor_hash; +our %device_hash; +our %pending_tasks; + +sub runServer +{ + Info( "X10 server starting\n" ); + + socket( SERVER, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" ); + unlink( main::SOCK_FILE ); + my $saddr = sockaddr_un( main::SOCK_FILE ); + bind( SERVER, $saddr ) or Fatal( "Can't bind: $!" ); + listen( SERVER, SOMAXCONN ) or Fatal( "Can't listen: $!" ); + + $dbh = zmDbConnect(); + + $x10 = new X10::ActiveHome( port=>ZM_X10_DEVICE, house_code=>ZM_X10_HOUSE_CODE, debug=>0 ); + + loadTasks(); + + $x10->register_listener( \&x10listen ); + + my $rin = ''; + vec( $rin, fileno(SERVER),1) = 1; + vec( $rin, $x10->select_fds(),1) = 1; + my $timeout = 0.2; + #print( "F:".fileno(SERVER)."\n" ); + my $reload = undef; + my $reload_count = 0; + my $reload_limit = &ZM_X10_DB_RELOAD_INTERVAL / $timeout; + while( 1 ) + { + my $nfound = select( my $rout = $rin, undef, undef, $timeout ); + #print( "Off select, NF:$nfound, ER:$!\n" ); + #print( vec( $rout, fileno(SERVER),1)."\n" ); + #print( vec( $rout, $x10->select_fds(),1)."\n" ); + if ( $nfound > 0 ) + { + if ( vec( $rout, fileno(SERVER),1) ) + { + my $paddr = accept( CLIENT, SERVER ); + my $message = ; + + my ( $command, $unit_code ) = split( /;/, $message ); + + my $device; + if ( defined($unit_code) ) + { + if ( $unit_code < 1 || $unit_code > 16 ) + { + dPrint( ZoneMinder::Logger::ERROR, "Invalid unit code '$unit_code'\n" ); + next; + } + + $device = $device_hash{$unit_code}; + if ( !$device ) + { + $device = $device_hash{$unit_code} = { appliance=>$x10->Appliance( unit_code=>$unit_code ), status=>'unknown' }; + } + } + + my $result; + if ( $command eq 'on' ) + { + $result = $device->{appliance}->on(); + } + elsif ( $command eq 'off' ) + { + $result = $device->{appliance}->off(); + } + #elsif ( $command eq 'dim' ) + #{ + #$result = $device->{appliance}->dim(); + #} + #elsif ( $command eq 'bright' ) + #{ + #$result = $device->{appliance}->bright(); + #} + elsif ( $command eq 'status' ) + { + if ( $device ) + { + dPrint( ZoneMinder::Logger::DEBUG, $unit_code." ".$device->{status}."\n" ); + } + else + { + foreach my $unit_code ( sort( keys(%device_hash) ) ) + { + my $device = $device_hash{$unit_code}; + dPrint( ZoneMinder::Logger::DEBUG, $unit_code." ".$device->{status}."\n" ); + } + } + } + elsif ( $command eq 'shutdown' ) + { + last; + } + else + { + dPrint( ZoneMinder::Logger::ERROR, "Invalid command '$command'\n" ); + } + if ( defined($result) ) + { + if ( 1 || $result ) + { + $device->{status} = uc($command); + dPrint( ZoneMinder::Logger::DEBUG, $device->{appliance}->address()." $command, ok\n" ); + #x10listen( new X10::Event( sprintf("%s %s", $device->{appliance}->address, uc($command) ) ) ); + } + else + { + dPrint( ZoneMinder::Logger::ERROR, $device->{appliance}->address()." $command, failed\n" ); + } + } + close( CLIENT ); + } + elsif ( vec( $rout, $x10->select_fds(),1) ) + { + $x10->handle_input(); + } + else + { + Fatal( "Bogus descriptor" ); + } + } + elsif ( $nfound < 0 ) + { + if ( $! != EINTR ) + { + Fatal( "Can't select: $!" ); + } + } + else + { + #print( "Select timed out\n" ); + # Check for state changes + foreach my $monitor_id ( sort(keys(%monitor_hash) ) ) + { + my $monitor = $monitor_hash{$monitor_id}; + my $state = zmGetMonitorState( $monitor ); + if ( !defined($state) ) + { + $reload = !undef; + next; + } + if ( defined( $monitor->{LastState} ) ) + { + my $task_list; + if ( ($state == STATE_ALARM || $state == STATE_ALERT) && ($monitor->{LastState} == STATE_IDLE || $monitor->{LastState} == STATE_TAPE) ) # Gone into alarm state + { + Debug( "Applying ON_list for $monitor_id\n" ); + $task_list = $monitor->{"ON_list"}; + } + elsif ( ($state == STATE_IDLE && $monitor->{LastState} != STATE_IDLE) || ($state == STATE_TAPE && $monitor->{LastState} != STATE_TAPE) ) # Come out of alarm state + { + Debug( "Applying OFF_list for $monitor_id\n" ); + $task_list = $monitor->{"OFF_list"}; + } + if ( $task_list ) + { + foreach my $task ( @$task_list ) + { + processTask( $task ); + } + } + } + $monitor->{LastState} = $state; + } + + # Check for pending tasks + my $now = time(); + foreach my $activation_time ( sort(keys(%pending_tasks) ) ) + { + last if ( $activation_time > $now ); + my $pending_list = $pending_tasks{$activation_time}; + foreach my $task ( @$pending_list ) + { + processTask( $task ); + } + delete( $pending_tasks{$activation_time} ); + } + if ( $reload || ++$reload_count >= $reload_limit ) + { + loadTasks(); + $reload = undef; + $reload_count = 0; + } + } + } + Info( "X10 server exiting\n" ); + close( SERVER ); + exit(); +} + +sub addToDeviceList +{ + my $unit_code = shift; + my $event = shift; + my $monitor = shift; + my $function = shift; + my $limit = shift; + + Debug( "Adding to device list, uc:$unit_code, ev:$event, mo:".$monitor->{Id}.", fu:$function, li:$limit\n" ); + my $device = $device_hash{$unit_code}; + if ( !$device ) + { + $device = $device_hash{$unit_code} = { appliance=>$x10->Appliance( unit_code=>$unit_code ), status=>'unknown' }; + } + + my $task = { type=>"device", monitor=>$monitor, address=>$device->{appliance}->address(), function=>$function }; + if ( $limit ) + { + $task->{limit} = $limit + } + + my $task_list = $device->{$event."_list"}; + if ( !$task_list ) + { + $task_list = $device->{$event."_list"} = []; + } + push( @$task_list, $task ); +} + +sub addToMonitorList +{ + my $monitor = shift; + my $event = shift; + my $unit_code = shift; + my $function = shift; + my $limit = shift; + + Debug( "Adding to monitor list, uc:$unit_code, ev:$event, mo:".$monitor->{Id}.", fu:$function, li:$limit\n" ); + my $device = $device_hash{$unit_code}; + if ( !$device ) + { + $device = $device_hash{$unit_code} = { appliance=>$x10->Appliance( unit_code=>$unit_code ), status=>'unknown' }; + } + + my $task = { type=>"monitor", device=>$device, id=>$monitor->{Id}, function=>$function }; + if ( $limit ) + { + $task->{limit} = $limit; + } + + my $task_list = $monitor->{$event."_list"}; + if ( !$task_list ) + { + $task_list = $monitor->{$event."_list"} = []; + } + push( @$task_list, $task ); +} + +sub loadTasks +{ + %monitor_hash = (); + + Debug( "Loading tasks\n" ); + # Clear out all old device task lists + foreach my $unit_code ( sort( keys(%device_hash) ) ) + { + my $device = $device_hash{$unit_code}; + $device->{ON_list} = []; + $device->{OFF_list} = []; + } + + my $sql = "select M.*,T.* from Monitors as M inner join TriggersX10 as T on (M.Id = T.MonitorId) where find_in_set( M.Function, 'Modect,Record,Mocord,Nodect' ) and M.Enabled = 1 and find_in_set( 'X10', M.Triggers )"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or Fatal( "Can't execute: ".$sth->errstr() ); + while( my $monitor = $sth->fetchrow_hashref() ) + { + next if ( !zmMemVerify( $monitor ) ); # Check shared memory ok + + $monitor_hash{$monitor->{Id}} = $monitor; + + if ( $monitor->{Activation} ) + { + Debug( "$monitor->{Name} has active string '$monitor->{Activation}'\n" ); + foreach my $code_string ( split( /,/, $monitor->{Activation} ) ) + { + #Debug( "Code string: $code_string\n" ); + my ( $invert, $unit_code, $modifier, $limit ) = ( $code_string =~ /^([!~])?(\d+)(?:([+-])(\d+)?)?$/ ); + $limit = 0 if ( !$limit ); + if ( $unit_code ) + { + if ( !$modifier || $modifier eq '+' ) + { + addToDeviceList( $unit_code, "ON", $monitor, !$invert?"start_active":"stop_active", $limit ); + } + if ( !$modifier || $modifier eq '-' ) + { + addToDeviceList( $unit_code, "OFF", $monitor, !$invert?"stop_active":"start_active", $limit ); + } + } + } + } + if ( $monitor->{AlarmInput} ) + { + Debug( "$monitor->{Name} has alarm input string '$monitor->{AlarmInput}'\n" ); + foreach my $code_string ( split( /,/, $monitor->{AlarmInput} ) ) + { + #Debug( "Code string: $code_string\n" ); + my ( $invert, $unit_code, $modifier, $limit ) = ( $code_string =~ /^([!~])?(\d+)(?:([+-])(\d+)?)?$/ ); + $limit = 0 if ( !$limit ); + if ( $unit_code ) + { + if ( !$modifier || $modifier eq '+' ) + { + addToDeviceList( $unit_code, "ON", $monitor, !$invert?"start_alarm":"stop_alarm", $limit ); + } + if ( !$modifier || $modifier eq '-' ) + { + addToDeviceList( $unit_code, "OFF", $monitor, !$invert?"stop_alarm":"start_alarm", $limit ); + } + } + } + } + if ( $monitor->{AlarmOutput} ) + { + Debug( "$monitor->{Name} has alarm output string '$monitor->{AlarmOutput}'\n" ); + foreach my $code_string ( split( /,/, $monitor->{AlarmOutput} ) ) + { + #Debug( "Code string: $code_string\n" ); + my ( $invert, $unit_code, $modifier, $limit ) = ( $code_string =~ /^([!~])?(\d+)(?:([+-])(\d+)?)?$/ ); + $limit = 0 if ( !$limit ); + if ( $unit_code ) + { + if ( !$modifier || $modifier eq '+' ) + { + addToMonitorList( $monitor, "ON", $unit_code, !$invert?"on":"off", $limit ); + } + if ( !$modifier || $modifier eq '-' ) + { + addToMonitorList( $monitor, "OFF", $unit_code, !$invert?"off":"on", $limit ); + } + } + } + } + zmMemInvalidate( $monitor ); + } +} + +sub addPendingTask +{ + my $task = shift; + + # Check whether we are just extending a previous pending task + # and remove it if it's there + foreach my $activation_time ( sort(keys(%pending_tasks) ) ) + { + my $pending_list = $pending_tasks{$activation_time}; + my $new_pending_list = []; + foreach my $pending_task ( @$pending_list ) + { + if ( $task->{type} ne $pending_task->{type} ) + { + push( @$new_pending_list, $pending_task ) + } + elsif ( $task->{type} eq "device" ) + { + if (( $task->{monitor}->{Id} != $pending_task->{monitor}->{Id} ) + || ( $task->{function} ne $pending_task->{function} )) + { + push( @$new_pending_list, $pending_task ) + } + } + elsif ( $task->{type} eq "monitor" ) + { + if (( $task->{device}->{appliance}->unit_code() != $pending_task->{device}->{appliance}->unit_code() ) + || ( $task->{function} ne $pending_task->{function} )) + { + push( @$new_pending_list, $pending_task ) + } + } + } + if ( @$new_pending_list ) + { + $pending_tasks{$activation_time} = $new_pending_list; + } + else + { + delete( $pending_tasks{$activation_time} ); + } + } + + my $end_time = time() + $task->{limit}; + my $pending_list = $pending_tasks{$end_time}; + if ( !$pending_list ) + { + $pending_list = $pending_tasks{$end_time} = []; + } + my $pending_task; + if ( $task->{type} eq "device" ) + { + $pending_task = { type=>$task->{type}, monitor=>$task->{monitor}, function=>$task->{function} }; + $pending_task->{function} =~ s/start/stop/; + } + elsif ( $task->{type} eq "monitor" ) + { + $pending_task = { type=>$task->{type}, device=>$task->{device}, function=>$task->{function} }; + $pending_task->{function} =~ s/on/off/; + } + push( @$pending_list, $pending_task ); +} + +sub processTask +{ + my $task = shift; + + if ( $task->{type} eq "device" ) + { + my ( $instruction, $class ) = ( $task->{function} =~ /^(.+)_(.+)$/ ); + + if ( $class eq "active" ) + { + if ( $instruction eq "start" ) + { + zmMonitorEnable( $task->{monitor} ); + if ( $task->{limit} ) + { + addPendingTask( $task ); + } + } + elsif( $instruction eq "stop" ) + { + zmMonitorDisable( $task->{monitor} ); + } + } + elsif( $class eq "alarm" ) + { + if ( $instruction eq "start" ) + { + zmTriggerEventOn( $task->{monitor}, 0, main::CAUSE_STRING, $task->{address} ); + if ( $task->{limit} ) + { + addPendingTask( $task ); + } + } + elsif( $instruction eq "stop" ) + { + zmTriggerEventCancel( $task->{monitor} ); + } + } + } + elsif( $task->{type} eq "monitor" ) + { + if ( $task->{function} eq "on" ) + { + $task->{device}->{appliance}->on(); + if ( $task->{limit} ) + { + addPendingTask( $task ); + } + } + elsif ( $task->{function} eq "off" ) + { + $task->{device}->{appliance}->off(); + } + } +} + +sub dPrint +{ + my $dbg_level = shift; + if ( fileno(CLIENT) ) + { + print CLIENT @_ + } + if ( $dbg_level == ZoneMinder::Logger::DEBUG ) + { + Debug( @_ ); + } + elsif ( $dbg_level == ZoneMinder::Logger::INFO ) + { + Info( @_ ); + } + elsif ( $dbg_level == ZoneMinder::Logger::WARNING ) + { + Warning( @_ ); + } + elsif ( $dbg_level == ZoneMinder::Logger::ERROR ) + { + Error( @_ ); + } + elsif ( $dbg_level == ZoneMinder::Logger::FATAL ) + { + Fatal( @_ ); + } +} + +sub x10listen +{ + foreach my $event ( @_ ) + { + #print( Data::Dumper( $_ )."\n" ); + if ( $event->house_code() eq ZM_X10_HOUSE_CODE ) + { + my $unit_code = $event->unit_code(); + my $device = $device_hash{$unit_code}; + if ( !$device ) + { + $device = $device_hash{$unit_code} = { appliance=>$x10->Appliance( unit_code=>$unit_code ), status=>'unknown' }; + } + next if ( $event->func() !~ /(?:ON|OFF)/ ); + $device->{status} = $event->func(); + my $task_list = $device->{$event->func()."_list"}; + if ( $task_list ) + { + foreach my $task ( @$task_list ) + { + processTask( $task ); + } + } + } + Info( "Got event - ".$event->as_string()."\n" ); + } +} + +1; diff --git a/scripts/zmx10.pl.in b/scripts/zmx10.pl.in new file mode 100644 index 000000000..14eff5a01 --- /dev/null +++ b/scripts/zmx10.pl.in @@ -0,0 +1,675 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder X10 Control Script, $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. +# +# ========================================================================== +# +# This script controls the monitoring of the X10 interface and the consequent +# management of the ZM daemons based on the receipt of X10 signals. +# +use strict; +use bytes; + +# ========================================================================== +# +# These are the elements you can edit to suit your installation +# +# ========================================================================== + +use constant CAUSE_STRING => "X10"; # What gets written as the cause of any events + +# ========================================================================== +# +# Don't change anything below here +# +# ========================================================================== + +@EXTRA_PERL_LIB@ +use ZoneMinder; +use POSIX; +use Socket; +use Getopt::Long; +use Data::Dumper; + +use constant SOCK_FILE => ZM_PATH_SOCKS.'/zmx10.sock'; + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +sub Usage +{ + print( " +Usage: zmx10.pl -c ,--command= [-u ,--unit-code=] +Parameters are :- +-c , --command= - Command to issue, one of 'on','off','dim','bright','status','shutdown' +-u , --unit-code= - Unit code to act on required for all commands except 'status' (optional) and 'shutdown' +"); + exit( -1 ); +} + +logInit(); +logSetSignal(); + +my $command; +my $unit_code; + +if ( !GetOptions( 'command=s'=>\$command, 'unit-code=i'=>\$unit_code ) ) +{ + Usage(); +} + +die( "No command given" ) unless( $command ); +die( "No unit code given" ) unless( $unit_code || ($command =~ /(?:start|status|shutdown)/) ); + +if ( $command eq "start" ) +{ + X10Server::runServer(); + exit(); +} + +socket( CLIENT, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" ); + +my $saddr = sockaddr_un( SOCK_FILE ); + +if ( !connect( CLIENT, $saddr ) ) +{ + # The server isn't there + print( "Unable to connect, starting server\n" ); + close( CLIENT ); + + if ( my $cpid = fork() ) + { + # Parent process just sleep and fall through + sleep( 2 ); + logReinit(); + socket( CLIENT, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" ); + connect( CLIENT, $saddr ) or Fatal( "Can't connect: $!" ); + } + elsif ( defined($cpid) ) + { + setpgrp(); + + logReinit(); + X10Server::runServer(); + } + else + { + Fatal( "Can't fork: $!" ); + } +} +# The server is there, connect to it +#print( "Writing commands\n" ); +CLIENT->autoflush(); +my $message = "$command"; +$message .= ";$unit_code" if ( $unit_code ); +print( CLIENT $message ); +shutdown( CLIENT, 1 ); +while ( my $line = ) +{ + chomp( $line ); + print( "$line\n" ); +} +close( CLIENT ); +#print( "Finished writing, bye\n" ); +exit; + +# +# ========================================================================== +# +# This is the X10 Server package +# +# ========================================================================== +# +package X10Server; + +use strict; +use bytes; + +use ZoneMinder; +use POSIX; +use DBI; +use Socket; +use X10::ActiveHome; +use Data::Dumper; + +our $dbh; +our $x10; + +our %monitor_hash; +our %device_hash; +our %pending_tasks; + +sub runServer +{ + Info( "X10 server starting\n" ); + + socket( SERVER, PF_UNIX, SOCK_STREAM, 0 ) or Fatal( "Can't open socket: $!" ); + unlink( main::SOCK_FILE ); + my $saddr = sockaddr_un( main::SOCK_FILE ); + bind( SERVER, $saddr ) or Fatal( "Can't bind: $!" ); + listen( SERVER, SOMAXCONN ) or Fatal( "Can't listen: $!" ); + + $dbh = zmDbConnect(); + + $x10 = new X10::ActiveHome( port=>ZM_X10_DEVICE, house_code=>ZM_X10_HOUSE_CODE, debug=>0 ); + + loadTasks(); + + $x10->register_listener( \&x10listen ); + + my $rin = ''; + vec( $rin, fileno(SERVER),1) = 1; + vec( $rin, $x10->select_fds(),1) = 1; + my $timeout = 0.2; + #print( "F:".fileno(SERVER)."\n" ); + my $reload = undef; + my $reload_count = 0; + my $reload_limit = &ZM_X10_DB_RELOAD_INTERVAL / $timeout; + while( 1 ) + { + my $nfound = select( my $rout = $rin, undef, undef, $timeout ); + #print( "Off select, NF:$nfound, ER:$!\n" ); + #print( vec( $rout, fileno(SERVER),1)."\n" ); + #print( vec( $rout, $x10->select_fds(),1)."\n" ); + if ( $nfound > 0 ) + { + if ( vec( $rout, fileno(SERVER),1) ) + { + my $paddr = accept( CLIENT, SERVER ); + my $message = ; + + my ( $command, $unit_code ) = split( /;/, $message ); + + my $device; + if ( defined($unit_code) ) + { + if ( $unit_code < 1 || $unit_code > 16 ) + { + dPrint( ZoneMinder::Logger::ERROR, "Invalid unit code '$unit_code'\n" ); + next; + } + + $device = $device_hash{$unit_code}; + if ( !$device ) + { + $device = $device_hash{$unit_code} = { appliance=>$x10->Appliance( unit_code=>$unit_code ), status=>'unknown' }; + } + } + + my $result; + if ( $command eq 'on' ) + { + $result = $device->{appliance}->on(); + } + elsif ( $command eq 'off' ) + { + $result = $device->{appliance}->off(); + } + #elsif ( $command eq 'dim' ) + #{ + #$result = $device->{appliance}->dim(); + #} + #elsif ( $command eq 'bright' ) + #{ + #$result = $device->{appliance}->bright(); + #} + elsif ( $command eq 'status' ) + { + if ( $device ) + { + dPrint( ZoneMinder::Logger::DEBUG, $unit_code." ".$device->{status}."\n" ); + } + else + { + foreach my $unit_code ( sort( keys(%device_hash) ) ) + { + my $device = $device_hash{$unit_code}; + dPrint( ZoneMinder::Logger::DEBUG, $unit_code." ".$device->{status}."\n" ); + } + } + } + elsif ( $command eq 'shutdown' ) + { + last; + } + else + { + dPrint( ZoneMinder::Logger::ERROR, "Invalid command '$command'\n" ); + } + if ( defined($result) ) + { + if ( 1 || $result ) + { + $device->{status} = uc($command); + dPrint( ZoneMinder::Logger::DEBUG, $device->{appliance}->address()." $command, ok\n" ); + #x10listen( new X10::Event( sprintf("%s %s", $device->{appliance}->address, uc($command) ) ) ); + } + else + { + dPrint( ZoneMinder::Logger::ERROR, $device->{appliance}->address()." $command, failed\n" ); + } + } + close( CLIENT ); + } + elsif ( vec( $rout, $x10->select_fds(),1) ) + { + $x10->handle_input(); + } + else + { + Fatal( "Bogus descriptor" ); + } + } + elsif ( $nfound < 0 ) + { + if ( $! != EINTR ) + { + Fatal( "Can't select: $!" ); + } + } + else + { + #print( "Select timed out\n" ); + # Check for state changes + foreach my $monitor_id ( sort(keys(%monitor_hash) ) ) + { + my $monitor = $monitor_hash{$monitor_id}; + my $state = zmGetMonitorState( $monitor ); + if ( !defined($state) ) + { + $reload = !undef; + next; + } + if ( defined( $monitor->{LastState} ) ) + { + my $task_list; + if ( ($state == STATE_ALARM || $state == STATE_ALERT) && ($monitor->{LastState} == STATE_IDLE || $monitor->{LastState} == STATE_TAPE) ) # Gone into alarm state + { + Debug( "Applying ON_list for $monitor_id\n" ); + $task_list = $monitor->{"ON_list"}; + } + elsif ( ($state == STATE_IDLE && $monitor->{LastState} != STATE_IDLE) || ($state == STATE_TAPE && $monitor->{LastState} != STATE_TAPE) ) # Come out of alarm state + { + Debug( "Applying OFF_list for $monitor_id\n" ); + $task_list = $monitor->{"OFF_list"}; + } + if ( $task_list ) + { + foreach my $task ( @$task_list ) + { + processTask( $task ); + } + } + } + $monitor->{LastState} = $state; + } + + # Check for pending tasks + my $now = time(); + foreach my $activation_time ( sort(keys(%pending_tasks) ) ) + { + last if ( $activation_time > $now ); + my $pending_list = $pending_tasks{$activation_time}; + foreach my $task ( @$pending_list ) + { + processTask( $task ); + } + delete( $pending_tasks{$activation_time} ); + } + if ( $reload || ++$reload_count >= $reload_limit ) + { + loadTasks(); + $reload = undef; + $reload_count = 0; + } + } + } + Info( "X10 server exiting\n" ); + close( SERVER ); + exit(); +} + +sub addToDeviceList +{ + my $unit_code = shift; + my $event = shift; + my $monitor = shift; + my $function = shift; + my $limit = shift; + + Debug( "Adding to device list, uc:$unit_code, ev:$event, mo:".$monitor->{Id}.", fu:$function, li:$limit\n" ); + my $device = $device_hash{$unit_code}; + if ( !$device ) + { + $device = $device_hash{$unit_code} = { appliance=>$x10->Appliance( unit_code=>$unit_code ), status=>'unknown' }; + } + + my $task = { type=>"device", monitor=>$monitor, address=>$device->{appliance}->address(), function=>$function }; + if ( $limit ) + { + $task->{limit} = $limit + } + + my $task_list = $device->{$event."_list"}; + if ( !$task_list ) + { + $task_list = $device->{$event."_list"} = []; + } + push( @$task_list, $task ); +} + +sub addToMonitorList +{ + my $monitor = shift; + my $event = shift; + my $unit_code = shift; + my $function = shift; + my $limit = shift; + + Debug( "Adding to monitor list, uc:$unit_code, ev:$event, mo:".$monitor->{Id}.", fu:$function, li:$limit\n" ); + my $device = $device_hash{$unit_code}; + if ( !$device ) + { + $device = $device_hash{$unit_code} = { appliance=>$x10->Appliance( unit_code=>$unit_code ), status=>'unknown' }; + } + + my $task = { type=>"monitor", device=>$device, id=>$monitor->{Id}, function=>$function }; + if ( $limit ) + { + $task->{limit} = $limit; + } + + my $task_list = $monitor->{$event."_list"}; + if ( !$task_list ) + { + $task_list = $monitor->{$event."_list"} = []; + } + push( @$task_list, $task ); +} + +sub loadTasks +{ + %monitor_hash = (); + + Debug( "Loading tasks\n" ); + # Clear out all old device task lists + foreach my $unit_code ( sort( keys(%device_hash) ) ) + { + my $device = $device_hash{$unit_code}; + $device->{ON_list} = []; + $device->{OFF_list} = []; + } + + my $sql = "select M.*,T.* from Monitors as M inner join TriggersX10 as T on (M.Id = T.MonitorId) where find_in_set( M.Function, 'Modect,Record,Mocord,Nodect' ) and M.Enabled = 1 and find_in_set( 'X10', M.Triggers )"; + my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or Fatal( "Can't execute: ".$sth->errstr() ); + while( my $monitor = $sth->fetchrow_hashref() ) + { + next if ( !zmMemVerify( $monitor ) ); # Check shared memory ok + + $monitor_hash{$monitor->{Id}} = $monitor; + + if ( $monitor->{Activation} ) + { + Debug( "$monitor->{Name} has active string '$monitor->{Activation}'\n" ); + foreach my $code_string ( split( /,/, $monitor->{Activation} ) ) + { + #Debug( "Code string: $code_string\n" ); + my ( $invert, $unit_code, $modifier, $limit ) = ( $code_string =~ /^([!~])?(\d+)(?:([+-])(\d+)?)?$/ ); + $limit = 0 if ( !$limit ); + if ( $unit_code ) + { + if ( !$modifier || $modifier eq '+' ) + { + addToDeviceList( $unit_code, "ON", $monitor, !$invert?"start_active":"stop_active", $limit ); + } + if ( !$modifier || $modifier eq '-' ) + { + addToDeviceList( $unit_code, "OFF", $monitor, !$invert?"stop_active":"start_active", $limit ); + } + } + } + } + if ( $monitor->{AlarmInput} ) + { + Debug( "$monitor->{Name} has alarm input string '$monitor->{AlarmInput}'\n" ); + foreach my $code_string ( split( /,/, $monitor->{AlarmInput} ) ) + { + #Debug( "Code string: $code_string\n" ); + my ( $invert, $unit_code, $modifier, $limit ) = ( $code_string =~ /^([!~])?(\d+)(?:([+-])(\d+)?)?$/ ); + $limit = 0 if ( !$limit ); + if ( $unit_code ) + { + if ( !$modifier || $modifier eq '+' ) + { + addToDeviceList( $unit_code, "ON", $monitor, !$invert?"start_alarm":"stop_alarm", $limit ); + } + if ( !$modifier || $modifier eq '-' ) + { + addToDeviceList( $unit_code, "OFF", $monitor, !$invert?"stop_alarm":"start_alarm", $limit ); + } + } + } + } + if ( $monitor->{AlarmOutput} ) + { + Debug( "$monitor->{Name} has alarm output string '$monitor->{AlarmOutput}'\n" ); + foreach my $code_string ( split( /,/, $monitor->{AlarmOutput} ) ) + { + #Debug( "Code string: $code_string\n" ); + my ( $invert, $unit_code, $modifier, $limit ) = ( $code_string =~ /^([!~])?(\d+)(?:([+-])(\d+)?)?$/ ); + $limit = 0 if ( !$limit ); + if ( $unit_code ) + { + if ( !$modifier || $modifier eq '+' ) + { + addToMonitorList( $monitor, "ON", $unit_code, !$invert?"on":"off", $limit ); + } + if ( !$modifier || $modifier eq '-' ) + { + addToMonitorList( $monitor, "OFF", $unit_code, !$invert?"off":"on", $limit ); + } + } + } + } + zmMemInvalidate( $monitor ); + } +} + +sub addPendingTask +{ + my $task = shift; + + # Check whether we are just extending a previous pending task + # and remove it if it's there + foreach my $activation_time ( sort(keys(%pending_tasks) ) ) + { + my $pending_list = $pending_tasks{$activation_time}; + my $new_pending_list = []; + foreach my $pending_task ( @$pending_list ) + { + if ( $task->{type} ne $pending_task->{type} ) + { + push( @$new_pending_list, $pending_task ) + } + elsif ( $task->{type} eq "device" ) + { + if (( $task->{monitor}->{Id} != $pending_task->{monitor}->{Id} ) + || ( $task->{function} ne $pending_task->{function} )) + { + push( @$new_pending_list, $pending_task ) + } + } + elsif ( $task->{type} eq "monitor" ) + { + if (( $task->{device}->{appliance}->unit_code() != $pending_task->{device}->{appliance}->unit_code() ) + || ( $task->{function} ne $pending_task->{function} )) + { + push( @$new_pending_list, $pending_task ) + } + } + } + if ( @$new_pending_list ) + { + $pending_tasks{$activation_time} = $new_pending_list; + } + else + { + delete( $pending_tasks{$activation_time} ); + } + } + + my $end_time = time() + $task->{limit}; + my $pending_list = $pending_tasks{$end_time}; + if ( !$pending_list ) + { + $pending_list = $pending_tasks{$end_time} = []; + } + my $pending_task; + if ( $task->{type} eq "device" ) + { + $pending_task = { type=>$task->{type}, monitor=>$task->{monitor}, function=>$task->{function} }; + $pending_task->{function} =~ s/start/stop/; + } + elsif ( $task->{type} eq "monitor" ) + { + $pending_task = { type=>$task->{type}, device=>$task->{device}, function=>$task->{function} }; + $pending_task->{function} =~ s/on/off/; + } + push( @$pending_list, $pending_task ); +} + +sub processTask +{ + my $task = shift; + + if ( $task->{type} eq "device" ) + { + my ( $instruction, $class ) = ( $task->{function} =~ /^(.+)_(.+)$/ ); + + if ( $class eq "active" ) + { + if ( $instruction eq "start" ) + { + zmMonitorEnable( $task->{monitor} ); + if ( $task->{limit} ) + { + addPendingTask( $task ); + } + } + elsif( $instruction eq "stop" ) + { + zmMonitorDisable( $task->{monitor} ); + } + } + elsif( $class eq "alarm" ) + { + if ( $instruction eq "start" ) + { + zmTriggerEventOn( $task->{monitor}, 0, main::CAUSE_STRING, $task->{address} ); + if ( $task->{limit} ) + { + addPendingTask( $task ); + } + } + elsif( $instruction eq "stop" ) + { + zmTriggerEventCancel( $task->{monitor} ); + } + } + } + elsif( $task->{type} eq "monitor" ) + { + if ( $task->{function} eq "on" ) + { + $task->{device}->{appliance}->on(); + if ( $task->{limit} ) + { + addPendingTask( $task ); + } + } + elsif ( $task->{function} eq "off" ) + { + $task->{device}->{appliance}->off(); + } + } +} + +sub dPrint +{ + my $dbg_level = shift; + if ( fileno(CLIENT) ) + { + print CLIENT @_ + } + if ( $dbg_level == ZoneMinder::Logger::DEBUG ) + { + Debug( @_ ); + } + elsif ( $dbg_level == ZoneMinder::Logger::INFO ) + { + Info( @_ ); + } + elsif ( $dbg_level == ZoneMinder::Logger::WARNING ) + { + Warning( @_ ); + } + elsif ( $dbg_level == ZoneMinder::Logger::ERROR ) + { + Error( @_ ); + } + elsif ( $dbg_level == ZoneMinder::Logger::FATAL ) + { + Fatal( @_ ); + } +} + +sub x10listen +{ + foreach my $event ( @_ ) + { + #print( Data::Dumper( $_ )."\n" ); + if ( $event->house_code() eq ZM_X10_HOUSE_CODE ) + { + my $unit_code = $event->unit_code(); + my $device = $device_hash{$unit_code}; + if ( !$device ) + { + $device = $device_hash{$unit_code} = { appliance=>$x10->Appliance( unit_code=>$unit_code ), status=>'unknown' }; + } + next if ( $event->func() !~ /(?:ON|OFF)/ ); + $device->{status} = $event->func(); + my $task_list = $device->{$event->func()."_list"}; + if ( $task_list ) + { + foreach my $task ( @$task_list ) + { + processTask( $task ); + } + } + } + Info( "Got event - ".$event->as_string()."\n" ); + } +} + +1; diff --git a/src/.deps/zm.Po b/src/.deps/zm.Po new file mode 100644 index 000000000..aa5176d0d --- /dev/null +++ b/src/.deps/zm.Po @@ -0,0 +1,269 @@ +zm.o: zm.cpp zm.h zm_config.h ../config.h zm_config_defines.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: diff --git a/src/.deps/zm_box.Po b/src/.deps/zm_box.Po new file mode 100644 index 000000000..1846ae588 --- /dev/null +++ b/src/.deps/zm_box.Po @@ -0,0 +1,297 @@ +zm_box.o: zm_box.cpp zm.h zm_config.h ../config.h zm_config_defines.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_box.h zm_coord.h /usr/include/math.h \ + /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_box.h: + +zm_coord.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: diff --git a/src/.deps/zm_buffer.Po b/src/.deps/zm_buffer.Po new file mode 100644 index 000000000..15df85a25 --- /dev/null +++ b/src/.deps/zm_buffer.Po @@ -0,0 +1,275 @@ +zm_buffer.o: zm_buffer.cpp /usr/include/string.h /usr/include/features.h \ + /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h zm.h zm_config.h ../config.h zm_config_defines.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_buffer.h + +/usr/include/string.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_buffer.h: diff --git a/src/.deps/zm_camera.Po b/src/.deps/zm_camera.Po new file mode 100644 index 000000000..e9ac27af4 --- /dev/null +++ b/src/.deps/zm_camera.Po @@ -0,0 +1,418 @@ +zm_camera.o: zm_camera.cpp zm.h zm_config.h ../config.h \ + zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_camera.h /usr/include/x86_64-linux-gnu/sys/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctls.h \ + /usr/include/x86_64-linux-gnu/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/x86_64-linux-gnu/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctl-types.h \ + /usr/include/x86_64-linux-gnu/sys/ttydefaults.h zm_image.h zm_jpeg.h \ + /usr/include/setjmp.h jinclude.h /root/zm/libjpeg-turbo-1.2.1/jconfig.h \ + /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/string.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_coord.h zm_box.h \ + /usr/include/math.h /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h zm_poly.h zm_mem_utils.h \ + zm_utils.h /usr/include/x86_64-linux-gnu/sys/time.h \ + /usr/include/c++/4.7/vector /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/zlib.h /usr/include/zconf.h + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_camera.h: + +/usr/include/x86_64-linux-gnu/sys/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctls.h: + +/usr/include/x86_64-linux-gnu/asm/ioctls.h: + +/usr/include/asm-generic/ioctls.h: + +/usr/include/linux/ioctl.h: + +/usr/include/x86_64-linux-gnu/asm/ioctl.h: + +/usr/include/asm-generic/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctl-types.h: + +/usr/include/x86_64-linux-gnu/sys/ttydefaults.h: + +zm_image.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/string.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_coord.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: diff --git a/src/.deps/zm_comms.Po b/src/.deps/zm_comms.Po new file mode 100644 index 000000000..42f6a4dd1 --- /dev/null +++ b/src/.deps/zm_comms.Po @@ -0,0 +1,439 @@ +zm_comms.o: zm_comms.cpp zm_comms.h zm_exception.h zm.h zm_config.h \ + ../config.h zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + /usr/include/netdb.h /usr/include/netinet/in.h \ + /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h \ + /usr/include/x86_64-linux-gnu/bits/in.h /usr/include/rpc/netdb.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/netdb.h /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/x86_64-linux-gnu/sys/un.h /usr/include/string.h \ + /usr/include/c++/4.7/set /usr/include/c++/4.7/bits/stl_set.h \ + /usr/include/c++/4.7/bits/stl_multiset.h /usr/include/c++/4.7/vector \ + /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/fcntl.h \ + /usr/include/x86_64-linux-gnu/bits/fcntl.h \ + /usr/include/x86_64-linux-gnu/bits/stat.h /usr/include/alloca.h \ + /usr/include/x86_64-linux-gnu/sys/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctls.h \ + /usr/include/x86_64-linux-gnu/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/x86_64-linux-gnu/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctl-types.h \ + /usr/include/x86_64-linux-gnu/sys/ttydefaults.h \ + /usr/include/x86_64-linux-gnu/sys/param.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/linux/param.h /usr/include/x86_64-linux-gnu/asm/param.h \ + /usr/include/asm-generic/param.h /usr/include/netinet/tcp.h + +zm_comms.h: + +zm_exception.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/netdb.h: + +/usr/include/netinet/in.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/x86_64-linux-gnu/bits/in.h: + +/usr/include/rpc/netdb.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/netdb.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/x86_64-linux-gnu/sys/un.h: + +/usr/include/string.h: + +/usr/include/c++/4.7/set: + +/usr/include/c++/4.7/bits/stl_set.h: + +/usr/include/c++/4.7/bits/stl_multiset.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/fcntl.h: + +/usr/include/x86_64-linux-gnu/bits/fcntl.h: + +/usr/include/x86_64-linux-gnu/bits/stat.h: + +/usr/include/alloca.h: + +/usr/include/x86_64-linux-gnu/sys/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctls.h: + +/usr/include/x86_64-linux-gnu/asm/ioctls.h: + +/usr/include/asm-generic/ioctls.h: + +/usr/include/linux/ioctl.h: + +/usr/include/x86_64-linux-gnu/asm/ioctl.h: + +/usr/include/asm-generic/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctl-types.h: + +/usr/include/x86_64-linux-gnu/sys/ttydefaults.h: + +/usr/include/x86_64-linux-gnu/sys/param.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/linux/param.h: + +/usr/include/x86_64-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/netinet/tcp.h: diff --git a/src/.deps/zm_config.Po b/src/.deps/zm_config.Po new file mode 100644 index 000000000..7301b983d --- /dev/null +++ b/src/.deps/zm_config.Po @@ -0,0 +1,310 @@ +zm_config.o: zm_config.cpp zm.h zm_config.h ../config.h \ + zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_db.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_db.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: diff --git a/src/.deps/zm_coord.Po b/src/.deps/zm_coord.Po new file mode 100644 index 000000000..2c657d78e --- /dev/null +++ b/src/.deps/zm_coord.Po @@ -0,0 +1,272 @@ +zm_coord.o: zm_coord.cpp zm.h zm_config.h ../config.h zm_config_defines.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_coord.h + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_coord.h: diff --git a/src/.deps/zm_db.Po b/src/.deps/zm_db.Po new file mode 100644 index 000000000..024e31879 --- /dev/null +++ b/src/.deps/zm_db.Po @@ -0,0 +1,285 @@ +zm_db.o: zm_db.cpp /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h /usr/include/xlocale.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/string.h zm.h zm_config.h ../config.h zm_config_defines.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_db.h + +/usr/include/stdlib.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/xlocale.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_db.h: diff --git a/src/.deps/zm_detector.Po b/src/.deps/zm_detector.Po new file mode 100644 index 000000000..c4097bcbb --- /dev/null +++ b/src/.deps/zm_detector.Po @@ -0,0 +1,548 @@ +zm_detector.o: zm_detector.cpp zm_detector.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc /usr/include/syslog.h \ + /usr/include/x86_64-linux-gnu/sys/syslog.h \ + /usr/include/x86_64-linux-gnu/bits/syslog-path.h /usr/include/libgen.h \ + zm_image.h zm.h zm_config.h ../config.h zm_config_defines.h zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_jpeg.h /usr/include/setjmp.h jinclude.h \ + /root/zm/libjpeg-turbo-1.2.1/jconfig.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/string.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_coord.h zm_box.h \ + /usr/include/math.h /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h zm_poly.h zm_mem_utils.h \ + zm_utils.h /usr/include/x86_64-linux-gnu/sys/time.h \ + /usr/include/c++/4.7/vector /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/zlib.h /usr/include/zconf.h zm_zone.h zm_event.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/sys/stat.h \ + /usr/include/x86_64-linux-gnu/bits/stat.h /usr/include/c++/4.7/set \ + /usr/include/c++/4.7/bits/stl_set.h \ + /usr/include/c++/4.7/bits/stl_multiset.h zm_stream.h \ + /usr/include/x86_64-linux-gnu/sys/un.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h zm_mpeg.h zm_ffmpeg.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/inttypes.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/avconfig.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h + +zm_detector.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +/usr/include/syslog.h: + +/usr/include/x86_64-linux-gnu/sys/syslog.h: + +/usr/include/x86_64-linux-gnu/bits/syslog-path.h: + +/usr/include/libgen.h: + +zm_image.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/string.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_coord.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +zm_zone.h: + +zm_event.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/sys/stat.h: + +/usr/include/x86_64-linux-gnu/bits/stat.h: + +/usr/include/c++/4.7/set: + +/usr/include/c++/4.7/bits/stl_set.h: + +/usr/include/c++/4.7/bits/stl_multiset.h: + +zm_stream.h: + +/usr/include/x86_64-linux-gnu/sys/un.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +zm_mpeg.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/inttypes.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: diff --git a/src/.deps/zm_event.Po b/src/.deps/zm_event.Po new file mode 100644 index 000000000..708c0e478 --- /dev/null +++ b/src/.deps/zm_event.Po @@ -0,0 +1,758 @@ +zm_event.o: zm_event.cpp /usr/include/fcntl.h /usr/include/features.h \ + /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/x86_64-linux-gnu/bits/fcntl.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/time.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/stat.h \ + /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/arpa/inet.h \ + /usr/include/netinet/in.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/x86_64-linux-gnu/bits/in.h \ + /usr/include/x86_64-linux-gnu/sys/un.h /usr/include/string.h \ + /usr/include/xlocale.h /usr/include/x86_64-linux-gnu/sys/ipc.h \ + /usr/include/x86_64-linux-gnu/bits/ipctypes.h \ + /usr/include/x86_64-linux-gnu/bits/ipc.h \ + /usr/include/x86_64-linux-gnu/sys/msg.h \ + /usr/include/x86_64-linux-gnu/bits/msq.h /usr/include/getopt.h \ + /usr/include/glob.h zm.h zm_config.h ../config.h zm_config_defines.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/c++/4.7/map \ + /usr/include/c++/4.7/bits/stl_tree.h /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h zm_db.h \ + zm_time.h /usr/include/x86_64-linux-gnu/sys/time.h zm_mpeg.h zm_ffmpeg.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/errno.h /usr/include/x86_64-linux-gnu/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h /usr/include/libio.h \ + /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/avconfig.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h zm_signal.h /usr/include/signal.h \ + /usr/include/x86_64-linux-gnu/bits/signum.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/sigaction.h \ + /usr/include/x86_64-linux-gnu/bits/sigcontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigstack.h \ + /usr/include/x86_64-linux-gnu/sys/ucontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigthread.h /usr/include/execinfo.h \ + zm_event.h /usr/include/x86_64-linux-gnu/sys/stat.h \ + /usr/include/c++/4.7/set /usr/include/c++/4.7/bits/stl_set.h \ + /usr/include/c++/4.7/bits/stl_multiset.h zm_image.h zm_jpeg.h \ + /usr/include/setjmp.h jinclude.h /root/zm/libjpeg-turbo-1.2.1/jconfig.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_coord.h zm_box.h \ + zm_poly.h zm_mem_utils.h zm_utils.h /usr/include/c++/4.7/vector \ + /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/zlib.h \ + /usr/include/zconf.h zm_stream.h zm_monitor.h \ + /usr/include/c++/4.7/sstream /usr/include/c++/4.7/istream \ + /usr/include/c++/4.7/ios /usr/include/c++/4.7/bits/ios_base.h \ + /usr/include/c++/4.7/bits/locale_classes.h \ + /usr/include/c++/4.7/bits/locale_classes.tcc \ + /usr/include/c++/4.7/streambuf /usr/include/c++/4.7/bits/streambuf.tcc \ + /usr/include/c++/4.7/bits/basic_ios.h \ + /usr/include/c++/4.7/bits/locale_facets.h /usr/include/c++/4.7/cwctype \ + /usr/include/wctype.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h \ + /usr/include/c++/4.7/bits/streambuf_iterator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h \ + /usr/include/c++/4.7/bits/locale_facets.tcc \ + /usr/include/c++/4.7/bits/basic_ios.tcc /usr/include/c++/4.7/ostream \ + /usr/include/c++/4.7/bits/ostream.tcc \ + /usr/include/c++/4.7/bits/istream.tcc \ + /usr/include/c++/4.7/bits/sstream.tcc zm_zone.h zm_camera.h \ + /usr/include/x86_64-linux-gnu/sys/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctls.h \ + /usr/include/x86_64-linux-gnu/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/x86_64-linux-gnu/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctl-types.h \ + /usr/include/x86_64-linux-gnu/sys/ttydefaults.h zm_plugin_manager.h \ + /usr/include/x86_64-linux-gnu/sys/dir.h /usr/include/dirent.h \ + /usr/include/x86_64-linux-gnu/bits/dirent.h \ + /usr/include/x86_64-linux-gnu/sys/param.h /usr/include/linux/param.h \ + /usr/include/x86_64-linux-gnu/asm/param.h \ + /usr/include/asm-generic/param.h zm_image_analyser.h \ + /usr/include/c++/4.7/list /usr/include/c++/4.7/bits/stl_list.h \ + /usr/include/c++/4.7/bits/list.tcc /usr/include/c++/4.7/stdexcept \ + /usr/include/c++/4.7/iostream /usr/include/c++/4.7/memory \ + /usr/include/c++/4.7/bits/stl_tempbuf.h \ + /usr/include/c++/4.7/bits/stl_raw_storage_iter.h \ + /usr/include/c++/4.7/backward/auto_ptr.h zm_detector.h \ + /usr/include/syslog.h /usr/include/x86_64-linux-gnu/sys/syslog.h \ + /usr/include/x86_64-linux-gnu/bits/syslog-path.h /usr/include/libgen.h \ + zm_plugin.h /usr/include/dlfcn.h \ + /usr/include/x86_64-linux-gnu/bits/dlfcn.h zmf.h \ + /usr/include/x86_64-linux-gnu/sys/sendfile.h + +/usr/include/fcntl.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/x86_64-linux-gnu/bits/fcntl.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/time.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/stat.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/arpa/inet.h: + +/usr/include/netinet/in.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/x86_64-linux-gnu/bits/in.h: + +/usr/include/x86_64-linux-gnu/sys/un.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/x86_64-linux-gnu/sys/ipc.h: + +/usr/include/x86_64-linux-gnu/bits/ipctypes.h: + +/usr/include/x86_64-linux-gnu/bits/ipc.h: + +/usr/include/x86_64-linux-gnu/sys/msg.h: + +/usr/include/x86_64-linux-gnu/bits/msq.h: + +/usr/include/getopt.h: + +/usr/include/glob.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +zm_db.h: + +zm_time.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +zm_mpeg.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/inttypes.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: + +zm_signal.h: + +/usr/include/signal.h: + +/usr/include/x86_64-linux-gnu/bits/signum.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/sigaction.h: + +/usr/include/x86_64-linux-gnu/bits/sigcontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigstack.h: + +/usr/include/x86_64-linux-gnu/sys/ucontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigthread.h: + +/usr/include/execinfo.h: + +zm_event.h: + +/usr/include/x86_64-linux-gnu/sys/stat.h: + +/usr/include/c++/4.7/set: + +/usr/include/c++/4.7/bits/stl_set.h: + +/usr/include/c++/4.7/bits/stl_multiset.h: + +zm_image.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_coord.h: + +zm_box.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +zm_stream.h: + +zm_monitor.h: + +/usr/include/c++/4.7/sstream: + +/usr/include/c++/4.7/istream: + +/usr/include/c++/4.7/ios: + +/usr/include/c++/4.7/bits/ios_base.h: + +/usr/include/c++/4.7/bits/locale_classes.h: + +/usr/include/c++/4.7/bits/locale_classes.tcc: + +/usr/include/c++/4.7/streambuf: + +/usr/include/c++/4.7/bits/streambuf.tcc: + +/usr/include/c++/4.7/bits/basic_ios.h: + +/usr/include/c++/4.7/bits/locale_facets.h: + +/usr/include/c++/4.7/cwctype: + +/usr/include/wctype.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h: + +/usr/include/c++/4.7/bits/streambuf_iterator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h: + +/usr/include/c++/4.7/bits/locale_facets.tcc: + +/usr/include/c++/4.7/bits/basic_ios.tcc: + +/usr/include/c++/4.7/ostream: + +/usr/include/c++/4.7/bits/ostream.tcc: + +/usr/include/c++/4.7/bits/istream.tcc: + +/usr/include/c++/4.7/bits/sstream.tcc: + +zm_zone.h: + +zm_camera.h: + +/usr/include/x86_64-linux-gnu/sys/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctls.h: + +/usr/include/x86_64-linux-gnu/asm/ioctls.h: + +/usr/include/asm-generic/ioctls.h: + +/usr/include/linux/ioctl.h: + +/usr/include/x86_64-linux-gnu/asm/ioctl.h: + +/usr/include/asm-generic/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctl-types.h: + +/usr/include/x86_64-linux-gnu/sys/ttydefaults.h: + +zm_plugin_manager.h: + +/usr/include/x86_64-linux-gnu/sys/dir.h: + +/usr/include/dirent.h: + +/usr/include/x86_64-linux-gnu/bits/dirent.h: + +/usr/include/x86_64-linux-gnu/sys/param.h: + +/usr/include/linux/param.h: + +/usr/include/x86_64-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +zm_image_analyser.h: + +/usr/include/c++/4.7/list: + +/usr/include/c++/4.7/bits/stl_list.h: + +/usr/include/c++/4.7/bits/list.tcc: + +/usr/include/c++/4.7/stdexcept: + +/usr/include/c++/4.7/iostream: + +/usr/include/c++/4.7/memory: + +/usr/include/c++/4.7/bits/stl_tempbuf.h: + +/usr/include/c++/4.7/bits/stl_raw_storage_iter.h: + +/usr/include/c++/4.7/backward/auto_ptr.h: + +zm_detector.h: + +/usr/include/syslog.h: + +/usr/include/x86_64-linux-gnu/sys/syslog.h: + +/usr/include/x86_64-linux-gnu/bits/syslog-path.h: + +/usr/include/libgen.h: + +zm_plugin.h: + +/usr/include/dlfcn.h: + +/usr/include/x86_64-linux-gnu/bits/dlfcn.h: + +zmf.h: + +/usr/include/x86_64-linux-gnu/sys/sendfile.h: diff --git a/src/.deps/zm_exception.Po b/src/.deps/zm_exception.Po new file mode 100644 index 000000000..d726ff59f --- /dev/null +++ b/src/.deps/zm_exception.Po @@ -0,0 +1,271 @@ +zm_exception.o: zm_exception.cpp zm_exception.h zm.h zm_config.h \ + ../config.h zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h + +zm_exception.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: diff --git a/src/.deps/zm_ffmpeg.Po b/src/.deps/zm_ffmpeg.Po new file mode 100644 index 000000000..98bf6cb96 --- /dev/null +++ b/src/.deps/zm_ffmpeg.Po @@ -0,0 +1 @@ +zm_ffmpeg.o: zm_ffmpeg.cpp diff --git a/src/.deps/zm_ffmpeg_camera.Po b/src/.deps/zm_ffmpeg_camera.Po new file mode 100644 index 000000000..2045c0670 --- /dev/null +++ b/src/.deps/zm_ffmpeg_camera.Po @@ -0,0 +1,516 @@ +zm_ffmpeg_camera.o: zm_ffmpeg_camera.cpp zm.h zm_config.h ../config.h \ + zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_ffmpeg_camera.h zm_camera.h /usr/include/x86_64-linux-gnu/sys/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctls.h \ + /usr/include/x86_64-linux-gnu/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/x86_64-linux-gnu/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctl-types.h \ + /usr/include/x86_64-linux-gnu/sys/ttydefaults.h zm_image.h zm_jpeg.h \ + /usr/include/setjmp.h jinclude.h /root/zm/libjpeg-turbo-1.2.1/jconfig.h \ + /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/string.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_coord.h zm_box.h \ + /usr/include/math.h /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h zm_poly.h zm_mem_utils.h \ + zm_utils.h /usr/include/x86_64-linux-gnu/sys/time.h \ + /usr/include/c++/4.7/vector /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/zlib.h /usr/include/zconf.h zm_buffer.h zm_ffmpeg.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/avconfig.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_ffmpeg_camera.h: + +zm_camera.h: + +/usr/include/x86_64-linux-gnu/sys/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctls.h: + +/usr/include/x86_64-linux-gnu/asm/ioctls.h: + +/usr/include/asm-generic/ioctls.h: + +/usr/include/linux/ioctl.h: + +/usr/include/x86_64-linux-gnu/asm/ioctl.h: + +/usr/include/asm-generic/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctl-types.h: + +/usr/include/x86_64-linux-gnu/sys/ttydefaults.h: + +zm_image.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/string.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_coord.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +zm_buffer.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/inttypes.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: diff --git a/src/.deps/zm_file_camera.Po b/src/.deps/zm_file_camera.Po new file mode 100644 index 000000000..80f377c6a --- /dev/null +++ b/src/.deps/zm_file_camera.Po @@ -0,0 +1,498 @@ +zm_file_camera.o: zm_file_camera.cpp /usr/include/stdio.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h /usr/include/xlocale.h \ + /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/unistd.h \ + /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/x86_64-linux-gnu/sys/time.h /usr/include/syslog.h \ + /usr/include/x86_64-linux-gnu/sys/syslog.h \ + /usr/include/x86_64-linux-gnu/bits/syslog-path.h /usr/include/signal.h \ + /usr/include/x86_64-linux-gnu/bits/signum.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/sigaction.h \ + /usr/include/x86_64-linux-gnu/bits/sigcontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigstack.h \ + /usr/include/x86_64-linux-gnu/sys/ucontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigthread.h /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/x86_64-linux-gnu/sys/stat.h \ + /usr/include/x86_64-linux-gnu/bits/stat.h zm.h zm_config.h ../config.h \ + zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_file_camera.h zm_camera.h /usr/include/x86_64-linux-gnu/sys/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctls.h \ + /usr/include/x86_64-linux-gnu/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/x86_64-linux-gnu/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctl-types.h \ + /usr/include/x86_64-linux-gnu/sys/ttydefaults.h zm_image.h zm_jpeg.h \ + /usr/include/setjmp.h jinclude.h /root/zm/libjpeg-turbo-1.2.1/jconfig.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_coord.h zm_box.h \ + /usr/include/math.h /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h zm_poly.h zm_mem_utils.h \ + zm_utils.h /usr/include/c++/4.7/vector \ + /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/zlib.h \ + /usr/include/zconf.h zm_buffer.h zm_regexp.h /usr/include/pcre.h \ + /usr/include/x86_64-linux-gnu/sys/param.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/linux/param.h /usr/include/x86_64-linux-gnu/asm/param.h \ + /usr/include/asm-generic/param.h + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/xlocale.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/syslog.h: + +/usr/include/x86_64-linux-gnu/sys/syslog.h: + +/usr/include/x86_64-linux-gnu/bits/syslog-path.h: + +/usr/include/signal.h: + +/usr/include/x86_64-linux-gnu/bits/signum.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/sigaction.h: + +/usr/include/x86_64-linux-gnu/bits/sigcontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigstack.h: + +/usr/include/x86_64-linux-gnu/sys/ucontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigthread.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/x86_64-linux-gnu/sys/stat.h: + +/usr/include/x86_64-linux-gnu/bits/stat.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_file_camera.h: + +zm_camera.h: + +/usr/include/x86_64-linux-gnu/sys/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctls.h: + +/usr/include/x86_64-linux-gnu/asm/ioctls.h: + +/usr/include/asm-generic/ioctls.h: + +/usr/include/linux/ioctl.h: + +/usr/include/x86_64-linux-gnu/asm/ioctl.h: + +/usr/include/asm-generic/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctl-types.h: + +/usr/include/x86_64-linux-gnu/sys/ttydefaults.h: + +zm_image.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_coord.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +zm_buffer.h: + +zm_regexp.h: + +/usr/include/pcre.h: + +/usr/include/x86_64-linux-gnu/sys/param.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/linux/param.h: + +/usr/include/x86_64-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: diff --git a/src/.deps/zm_image.Po b/src/.deps/zm_image.Po new file mode 100644 index 000000000..3e0f05e9e --- /dev/null +++ b/src/.deps/zm_image.Po @@ -0,0 +1,399 @@ +zm_image.o: zm_image.cpp zm.h zm_config.h ../config.h zm_config_defines.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_font.h zm_image.h zm_jpeg.h /usr/include/setjmp.h jinclude.h \ + /root/zm/libjpeg-turbo-1.2.1/jconfig.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/string.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_coord.h zm_box.h \ + /usr/include/math.h /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h zm_poly.h zm_mem_utils.h \ + zm_utils.h /usr/include/x86_64-linux-gnu/sys/time.h \ + /usr/include/c++/4.7/vector /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/zlib.h /usr/include/zconf.h \ + /usr/include/x86_64-linux-gnu/sys/stat.h \ + /usr/include/x86_64-linux-gnu/bits/stat.h + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_font.h: + +zm_image.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/string.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_coord.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +/usr/include/x86_64-linux-gnu/sys/stat.h: + +/usr/include/x86_64-linux-gnu/bits/stat.h: diff --git a/src/.deps/zm_image_analyser.Po b/src/.deps/zm_image_analyser.Po new file mode 100644 index 000000000..af11ee9b9 --- /dev/null +++ b/src/.deps/zm_image_analyser.Po @@ -0,0 +1,627 @@ +zm_image_analyser.o: zm_image_analyser.cpp zm_image_analyser.h \ + /usr/include/c++/4.7/list /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/stl_list.h /usr/include/c++/4.7/bits/list.tcc \ + /usr/include/c++/4.7/string /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/postypes.h /usr/include/c++/4.7/cwchar \ + /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc \ + /usr/include/c++/4.7/stdexcept /usr/include/c++/4.7/iostream \ + /usr/include/c++/4.7/ostream /usr/include/c++/4.7/ios \ + /usr/include/c++/4.7/bits/ios_base.h \ + /usr/include/c++/4.7/bits/locale_classes.h \ + /usr/include/c++/4.7/bits/locale_classes.tcc \ + /usr/include/c++/4.7/streambuf /usr/include/c++/4.7/bits/streambuf.tcc \ + /usr/include/c++/4.7/bits/basic_ios.h \ + /usr/include/c++/4.7/bits/locale_facets.h /usr/include/c++/4.7/cwctype \ + /usr/include/wctype.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h \ + /usr/include/c++/4.7/bits/streambuf_iterator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h \ + /usr/include/c++/4.7/bits/locale_facets.tcc \ + /usr/include/c++/4.7/bits/basic_ios.tcc \ + /usr/include/c++/4.7/bits/ostream.tcc /usr/include/c++/4.7/istream \ + /usr/include/c++/4.7/bits/istream.tcc /usr/include/c++/4.7/memory \ + /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_tempbuf.h \ + /usr/include/c++/4.7/bits/stl_raw_storage_iter.h \ + /usr/include/c++/4.7/backward/auto_ptr.h zm.h zm_config.h ../config.h \ + zm_config_defines.h zm_logger.h /usr/include/unistd.h \ + /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_detector.h /usr/include/syslog.h \ + /usr/include/x86_64-linux-gnu/sys/syslog.h \ + /usr/include/x86_64-linux-gnu/bits/syslog-path.h /usr/include/libgen.h \ + zm_image.h zm_jpeg.h /usr/include/setjmp.h jinclude.h \ + /root/zm/libjpeg-turbo-1.2.1/jconfig.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/string.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_coord.h zm_box.h \ + /usr/include/math.h /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h zm_poly.h zm_mem_utils.h \ + zm_utils.h /usr/include/x86_64-linux-gnu/sys/time.h \ + /usr/include/c++/4.7/vector /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/zlib.h /usr/include/zconf.h zm_zone.h zm_event.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/sys/stat.h \ + /usr/include/x86_64-linux-gnu/bits/stat.h /usr/include/c++/4.7/set \ + /usr/include/c++/4.7/bits/stl_set.h \ + /usr/include/c++/4.7/bits/stl_multiset.h zm_stream.h \ + /usr/include/x86_64-linux-gnu/sys/un.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h zm_mpeg.h zm_ffmpeg.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/inttypes.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/avconfig.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h + +zm_image_analyser.h: + +/usr/include/c++/4.7/list: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/stl_list.h: + +/usr/include/c++/4.7/bits/list.tcc: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +/usr/include/c++/4.7/stdexcept: + +/usr/include/c++/4.7/iostream: + +/usr/include/c++/4.7/ostream: + +/usr/include/c++/4.7/ios: + +/usr/include/c++/4.7/bits/ios_base.h: + +/usr/include/c++/4.7/bits/locale_classes.h: + +/usr/include/c++/4.7/bits/locale_classes.tcc: + +/usr/include/c++/4.7/streambuf: + +/usr/include/c++/4.7/bits/streambuf.tcc: + +/usr/include/c++/4.7/bits/basic_ios.h: + +/usr/include/c++/4.7/bits/locale_facets.h: + +/usr/include/c++/4.7/cwctype: + +/usr/include/wctype.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h: + +/usr/include/c++/4.7/bits/streambuf_iterator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h: + +/usr/include/c++/4.7/bits/locale_facets.tcc: + +/usr/include/c++/4.7/bits/basic_ios.tcc: + +/usr/include/c++/4.7/bits/ostream.tcc: + +/usr/include/c++/4.7/istream: + +/usr/include/c++/4.7/bits/istream.tcc: + +/usr/include/c++/4.7/memory: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_tempbuf.h: + +/usr/include/c++/4.7/bits/stl_raw_storage_iter.h: + +/usr/include/c++/4.7/backward/auto_ptr.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_detector.h: + +/usr/include/syslog.h: + +/usr/include/x86_64-linux-gnu/sys/syslog.h: + +/usr/include/x86_64-linux-gnu/bits/syslog-path.h: + +/usr/include/libgen.h: + +zm_image.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/string.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_coord.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +zm_zone.h: + +zm_event.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/sys/stat.h: + +/usr/include/x86_64-linux-gnu/bits/stat.h: + +/usr/include/c++/4.7/set: + +/usr/include/c++/4.7/bits/stl_set.h: + +/usr/include/c++/4.7/bits/stl_multiset.h: + +zm_stream.h: + +/usr/include/x86_64-linux-gnu/sys/un.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +zm_mpeg.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/inttypes.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: diff --git a/src/.deps/zm_jpeg.Po b/src/.deps/zm_jpeg.Po new file mode 100644 index 000000000..6baed7c19 --- /dev/null +++ b/src/.deps/zm_jpeg.Po @@ -0,0 +1,295 @@ +zm_jpeg.o: zm_jpeg.cpp zm_jpeg.h /usr/include/setjmp.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h jinclude.h \ + /root/zm/libjpeg-turbo-1.2.1/jconfig.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h /usr/include/xlocale.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/string.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_logger.h /usr/include/unistd.h \ + /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc /usr/include/c++/4.7/map \ + /usr/include/c++/4.7/bits/stl_tree.h /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h + +zm_jpeg.h: + +/usr/include/setjmp.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/xlocale.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/stdio.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/string.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: diff --git a/src/.deps/zm_local_camera.Po b/src/.deps/zm_local_camera.Po new file mode 100644 index 000000000..272154c08 --- /dev/null +++ b/src/.deps/zm_local_camera.Po @@ -0,0 +1,563 @@ +zm_local_camera.o: zm_local_camera.cpp zm.h zm_config.h ../config.h \ + zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_local_camera.h zm_camera.h /usr/include/x86_64-linux-gnu/sys/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctls.h \ + /usr/include/x86_64-linux-gnu/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/x86_64-linux-gnu/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctl-types.h \ + /usr/include/x86_64-linux-gnu/sys/ttydefaults.h zm_image.h zm_jpeg.h \ + /usr/include/setjmp.h jinclude.h /root/zm/libjpeg-turbo-1.2.1/jconfig.h \ + /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/string.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_coord.h zm_box.h \ + /usr/include/math.h /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h zm_poly.h zm_mem_utils.h \ + zm_utils.h /usr/include/x86_64-linux-gnu/sys/time.h \ + /usr/include/c++/4.7/vector /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/zlib.h /usr/include/zconf.h /usr/include/linux/videodev2.h \ + /usr/include/linux/types.h /usr/include/x86_64-linux-gnu/asm/types.h \ + /usr/include/asm-generic/types.h /usr/include/asm-generic/int-ll64.h \ + /usr/include/x86_64-linux-gnu/asm/bitsperlong.h \ + /usr/include/asm-generic/bitsperlong.h /usr/include/linux/posix_types.h \ + /usr/include/linux/stddef.h \ + /usr/include/x86_64-linux-gnu/asm/posix_types.h \ + /usr/include/x86_64-linux-gnu/asm/posix_types_64.h zm_ffmpeg.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/avconfig.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h \ + /usr/include/x86_64-linux-gnu/sys/stat.h \ + /usr/include/x86_64-linux-gnu/bits/stat.h /usr/include/fcntl.h \ + /usr/include/x86_64-linux-gnu/bits/fcntl.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/sys/mman.h \ + /usr/include/x86_64-linux-gnu/bits/mman.h + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_local_camera.h: + +zm_camera.h: + +/usr/include/x86_64-linux-gnu/sys/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctls.h: + +/usr/include/x86_64-linux-gnu/asm/ioctls.h: + +/usr/include/asm-generic/ioctls.h: + +/usr/include/linux/ioctl.h: + +/usr/include/x86_64-linux-gnu/asm/ioctl.h: + +/usr/include/asm-generic/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctl-types.h: + +/usr/include/x86_64-linux-gnu/sys/ttydefaults.h: + +zm_image.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/string.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_coord.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +/usr/include/linux/videodev2.h: + +/usr/include/linux/types.h: + +/usr/include/x86_64-linux-gnu/asm/types.h: + +/usr/include/asm-generic/types.h: + +/usr/include/asm-generic/int-ll64.h: + +/usr/include/x86_64-linux-gnu/asm/bitsperlong.h: + +/usr/include/asm-generic/bitsperlong.h: + +/usr/include/linux/posix_types.h: + +/usr/include/linux/stddef.h: + +/usr/include/x86_64-linux-gnu/asm/posix_types.h: + +/usr/include/x86_64-linux-gnu/asm/posix_types_64.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/inttypes.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: + +/usr/include/x86_64-linux-gnu/sys/stat.h: + +/usr/include/x86_64-linux-gnu/bits/stat.h: + +/usr/include/fcntl.h: + +/usr/include/x86_64-linux-gnu/bits/fcntl.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/sys/mman.h: + +/usr/include/x86_64-linux-gnu/bits/mman.h: diff --git a/src/.deps/zm_logger.Po b/src/.deps/zm_logger.Po new file mode 100644 index 000000000..015a50955 --- /dev/null +++ b/src/.deps/zm_logger.Po @@ -0,0 +1,370 @@ +zm_logger.o: zm_logger.cpp zm_logger.h /usr/include/unistd.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h /usr/include/xlocale.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc /usr/include/c++/4.7/map \ + /usr/include/c++/4.7/bits/stl_tree.h /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h zm_config.h \ + ../config.h zm_config_defines.h zm_utils.h \ + /usr/include/x86_64-linux-gnu/sys/time.h /usr/include/c++/4.7/vector \ + /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/syslog.h \ + /usr/include/x86_64-linux-gnu/sys/syslog.h \ + /usr/include/x86_64-linux-gnu/bits/syslog-path.h /usr/include/syscall.h \ + /usr/include/x86_64-linux-gnu/sys/syscall.h \ + /usr/include/x86_64-linux-gnu/asm/unistd.h \ + /usr/include/x86_64-linux-gnu/asm/unistd_64.h \ + /usr/include/x86_64-linux-gnu/bits/syscall.h /usr/include/signal.h \ + /usr/include/x86_64-linux-gnu/bits/signum.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/sigaction.h \ + /usr/include/x86_64-linux-gnu/bits/sigcontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigstack.h \ + /usr/include/x86_64-linux-gnu/sys/ucontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigthread.h /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/syslog.h: + +/usr/include/x86_64-linux-gnu/sys/syslog.h: + +/usr/include/x86_64-linux-gnu/bits/syslog-path.h: + +/usr/include/syscall.h: + +/usr/include/x86_64-linux-gnu/sys/syscall.h: + +/usr/include/x86_64-linux-gnu/asm/unistd.h: + +/usr/include/x86_64-linux-gnu/asm/unistd_64.h: + +/usr/include/x86_64-linux-gnu/bits/syscall.h: + +/usr/include/signal.h: + +/usr/include/x86_64-linux-gnu/bits/signum.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/sigaction.h: + +/usr/include/x86_64-linux-gnu/bits/sigcontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigstack.h: + +/usr/include/x86_64-linux-gnu/sys/ucontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigthread.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: diff --git a/src/.deps/zm_monitor.Po b/src/.deps/zm_monitor.Po new file mode 100644 index 000000000..f5109b778 --- /dev/null +++ b/src/.deps/zm_monitor.Po @@ -0,0 +1,813 @@ +zm_monitor.o: zm_monitor.cpp /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/time.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/sys/stat.h \ + /usr/include/x86_64-linux-gnu/bits/stat.h /usr/include/arpa/inet.h \ + /usr/include/netinet/in.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h \ + /usr/include/x86_64-linux-gnu/bits/in.h /usr/include/glob.h zm.h \ + zm_config.h ../config.h zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h zm_db.h \ + zm_time.h /usr/include/x86_64-linux-gnu/sys/time.h zm_mpeg.h zm_ffmpeg.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/errno.h /usr/include/x86_64-linux-gnu/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h /usr/include/libio.h \ + /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/avconfig.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h zm_signal.h /usr/include/signal.h \ + /usr/include/x86_64-linux-gnu/bits/signum.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/sigaction.h \ + /usr/include/x86_64-linux-gnu/bits/sigcontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigstack.h \ + /usr/include/x86_64-linux-gnu/sys/ucontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigthread.h /usr/include/execinfo.h \ + zm_monitor.h /usr/include/c++/4.7/vector \ + /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/c++/4.7/sstream \ + /usr/include/c++/4.7/istream /usr/include/c++/4.7/ios \ + /usr/include/c++/4.7/bits/ios_base.h \ + /usr/include/c++/4.7/bits/locale_classes.h \ + /usr/include/c++/4.7/bits/locale_classes.tcc \ + /usr/include/c++/4.7/streambuf /usr/include/c++/4.7/bits/streambuf.tcc \ + /usr/include/c++/4.7/bits/basic_ios.h \ + /usr/include/c++/4.7/bits/locale_facets.h /usr/include/c++/4.7/cwctype \ + /usr/include/wctype.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h \ + /usr/include/c++/4.7/bits/streambuf_iterator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h \ + /usr/include/c++/4.7/bits/locale_facets.tcc \ + /usr/include/c++/4.7/bits/basic_ios.tcc /usr/include/c++/4.7/ostream \ + /usr/include/c++/4.7/bits/ostream.tcc \ + /usr/include/c++/4.7/bits/istream.tcc \ + /usr/include/c++/4.7/bits/sstream.tcc zm_coord.h zm_image.h zm_jpeg.h \ + /usr/include/setjmp.h jinclude.h /root/zm/libjpeg-turbo-1.2.1/jconfig.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_box.h zm_poly.h \ + zm_mem_utils.h zm_utils.h /usr/include/zlib.h /usr/include/zconf.h \ + zm_zone.h zm_event.h /usr/include/c++/4.7/set \ + /usr/include/c++/4.7/bits/stl_set.h \ + /usr/include/c++/4.7/bits/stl_multiset.h zm_stream.h \ + /usr/include/x86_64-linux-gnu/sys/un.h zm_camera.h \ + /usr/include/x86_64-linux-gnu/sys/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctls.h \ + /usr/include/x86_64-linux-gnu/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/x86_64-linux-gnu/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctl-types.h \ + /usr/include/x86_64-linux-gnu/sys/ttydefaults.h zm_plugin_manager.h \ + /usr/include/x86_64-linux-gnu/sys/dir.h /usr/include/dirent.h \ + /usr/include/x86_64-linux-gnu/bits/dirent.h \ + /usr/include/x86_64-linux-gnu/sys/param.h /usr/include/linux/param.h \ + /usr/include/x86_64-linux-gnu/asm/param.h \ + /usr/include/asm-generic/param.h zm_image_analyser.h \ + /usr/include/c++/4.7/list /usr/include/c++/4.7/bits/stl_list.h \ + /usr/include/c++/4.7/bits/list.tcc /usr/include/c++/4.7/stdexcept \ + /usr/include/c++/4.7/iostream /usr/include/c++/4.7/memory \ + /usr/include/c++/4.7/bits/stl_tempbuf.h \ + /usr/include/c++/4.7/bits/stl_raw_storage_iter.h \ + /usr/include/c++/4.7/backward/auto_ptr.h zm_detector.h \ + /usr/include/syslog.h /usr/include/x86_64-linux-gnu/sys/syslog.h \ + /usr/include/x86_64-linux-gnu/bits/syslog-path.h /usr/include/libgen.h \ + zm_plugin.h /usr/include/dlfcn.h \ + /usr/include/x86_64-linux-gnu/bits/dlfcn.h zm_local_camera.h \ + /usr/include/linux/videodev2.h /usr/include/linux/types.h \ + /usr/include/x86_64-linux-gnu/asm/types.h \ + /usr/include/asm-generic/types.h /usr/include/asm-generic/int-ll64.h \ + /usr/include/x86_64-linux-gnu/asm/bitsperlong.h \ + /usr/include/asm-generic/bitsperlong.h /usr/include/linux/posix_types.h \ + /usr/include/linux/stddef.h \ + /usr/include/x86_64-linux-gnu/asm/posix_types.h \ + /usr/include/x86_64-linux-gnu/asm/posix_types_64.h zm_remote_camera.h \ + /usr/include/netdb.h /usr/include/rpc/netdb.h \ + /usr/include/x86_64-linux-gnu/bits/netdb.h zm_remote_camera_http.h \ + zm_buffer.h zm_regexp.h /usr/include/pcre.h zm_remote_camera_rtsp.h \ + zm_rtsp.h zm_comms.h zm_exception.h zm_thread.h zm_rtp_source.h \ + zm_file_camera.h zm_ffmpeg_camera.h \ + /usr/include/x86_64-linux-gnu/sys/mman.h \ + /usr/include/x86_64-linux-gnu/bits/mman.h /usr/include/fcntl.h \ + /usr/include/x86_64-linux-gnu/bits/fcntl.h + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/time.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/sys/stat.h: + +/usr/include/x86_64-linux-gnu/bits/stat.h: + +/usr/include/arpa/inet.h: + +/usr/include/netinet/in.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/x86_64-linux-gnu/bits/in.h: + +/usr/include/glob.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +zm_db.h: + +zm_time.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +zm_mpeg.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/inttypes.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: + +zm_signal.h: + +/usr/include/signal.h: + +/usr/include/x86_64-linux-gnu/bits/signum.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/sigaction.h: + +/usr/include/x86_64-linux-gnu/bits/sigcontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigstack.h: + +/usr/include/x86_64-linux-gnu/sys/ucontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigthread.h: + +/usr/include/execinfo.h: + +zm_monitor.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/c++/4.7/sstream: + +/usr/include/c++/4.7/istream: + +/usr/include/c++/4.7/ios: + +/usr/include/c++/4.7/bits/ios_base.h: + +/usr/include/c++/4.7/bits/locale_classes.h: + +/usr/include/c++/4.7/bits/locale_classes.tcc: + +/usr/include/c++/4.7/streambuf: + +/usr/include/c++/4.7/bits/streambuf.tcc: + +/usr/include/c++/4.7/bits/basic_ios.h: + +/usr/include/c++/4.7/bits/locale_facets.h: + +/usr/include/c++/4.7/cwctype: + +/usr/include/wctype.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h: + +/usr/include/c++/4.7/bits/streambuf_iterator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h: + +/usr/include/c++/4.7/bits/locale_facets.tcc: + +/usr/include/c++/4.7/bits/basic_ios.tcc: + +/usr/include/c++/4.7/ostream: + +/usr/include/c++/4.7/bits/ostream.tcc: + +/usr/include/c++/4.7/bits/istream.tcc: + +/usr/include/c++/4.7/bits/sstream.tcc: + +zm_coord.h: + +zm_image.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_box.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +zm_zone.h: + +zm_event.h: + +/usr/include/c++/4.7/set: + +/usr/include/c++/4.7/bits/stl_set.h: + +/usr/include/c++/4.7/bits/stl_multiset.h: + +zm_stream.h: + +/usr/include/x86_64-linux-gnu/sys/un.h: + +zm_camera.h: + +/usr/include/x86_64-linux-gnu/sys/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctls.h: + +/usr/include/x86_64-linux-gnu/asm/ioctls.h: + +/usr/include/asm-generic/ioctls.h: + +/usr/include/linux/ioctl.h: + +/usr/include/x86_64-linux-gnu/asm/ioctl.h: + +/usr/include/asm-generic/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctl-types.h: + +/usr/include/x86_64-linux-gnu/sys/ttydefaults.h: + +zm_plugin_manager.h: + +/usr/include/x86_64-linux-gnu/sys/dir.h: + +/usr/include/dirent.h: + +/usr/include/x86_64-linux-gnu/bits/dirent.h: + +/usr/include/x86_64-linux-gnu/sys/param.h: + +/usr/include/linux/param.h: + +/usr/include/x86_64-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +zm_image_analyser.h: + +/usr/include/c++/4.7/list: + +/usr/include/c++/4.7/bits/stl_list.h: + +/usr/include/c++/4.7/bits/list.tcc: + +/usr/include/c++/4.7/stdexcept: + +/usr/include/c++/4.7/iostream: + +/usr/include/c++/4.7/memory: + +/usr/include/c++/4.7/bits/stl_tempbuf.h: + +/usr/include/c++/4.7/bits/stl_raw_storage_iter.h: + +/usr/include/c++/4.7/backward/auto_ptr.h: + +zm_detector.h: + +/usr/include/syslog.h: + +/usr/include/x86_64-linux-gnu/sys/syslog.h: + +/usr/include/x86_64-linux-gnu/bits/syslog-path.h: + +/usr/include/libgen.h: + +zm_plugin.h: + +/usr/include/dlfcn.h: + +/usr/include/x86_64-linux-gnu/bits/dlfcn.h: + +zm_local_camera.h: + +/usr/include/linux/videodev2.h: + +/usr/include/linux/types.h: + +/usr/include/x86_64-linux-gnu/asm/types.h: + +/usr/include/asm-generic/types.h: + +/usr/include/asm-generic/int-ll64.h: + +/usr/include/x86_64-linux-gnu/asm/bitsperlong.h: + +/usr/include/asm-generic/bitsperlong.h: + +/usr/include/linux/posix_types.h: + +/usr/include/linux/stddef.h: + +/usr/include/x86_64-linux-gnu/asm/posix_types.h: + +/usr/include/x86_64-linux-gnu/asm/posix_types_64.h: + +zm_remote_camera.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/x86_64-linux-gnu/bits/netdb.h: + +zm_remote_camera_http.h: + +zm_buffer.h: + +zm_regexp.h: + +/usr/include/pcre.h: + +zm_remote_camera_rtsp.h: + +zm_rtsp.h: + +zm_comms.h: + +zm_exception.h: + +zm_thread.h: + +zm_rtp_source.h: + +zm_file_camera.h: + +zm_ffmpeg_camera.h: + +/usr/include/x86_64-linux-gnu/sys/mman.h: + +/usr/include/x86_64-linux-gnu/bits/mman.h: + +/usr/include/fcntl.h: + +/usr/include/x86_64-linux-gnu/bits/fcntl.h: diff --git a/src/.deps/zm_mpeg.Po b/src/.deps/zm_mpeg.Po new file mode 100644 index 000000000..26750ac9d --- /dev/null +++ b/src/.deps/zm_mpeg.Po @@ -0,0 +1,430 @@ +zm_mpeg.o: zm_mpeg.cpp /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h /usr/include/xlocale.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/string.h zm.h zm_config.h ../config.h zm_config_defines.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_rgb.h zm_mpeg.h zm_ffmpeg.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h /usr/include/libio.h \ + /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/avconfig.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h + +/usr/include/stdlib.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/xlocale.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_rgb.h: + +zm_mpeg.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/inttypes.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: diff --git a/src/.deps/zm_plugin.Po b/src/.deps/zm_plugin.Po new file mode 100644 index 000000000..2a1b5978a --- /dev/null +++ b/src/.deps/zm_plugin.Po @@ -0,0 +1,298 @@ +zm_plugin.o: zm_plugin.cpp zm_plugin.h /usr/include/stdlib.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h /usr/include/xlocale.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/dlfcn.h \ + /usr/include/x86_64-linux-gnu/bits/dlfcn.h \ + /usr/include/c++/4.7/stdexcept /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/string /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm.h zm_config.h ../config.h \ + zm_config_defines.h zm_logger.h /usr/include/unistd.h \ + /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h + +zm_plugin.h: + +/usr/include/stdlib.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/xlocale.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/stdio.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/dlfcn.h: + +/usr/include/x86_64-linux-gnu/bits/dlfcn.h: + +/usr/include/c++/4.7/stdexcept: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: diff --git a/src/.deps/zm_plugin_manager.Po b/src/.deps/zm_plugin_manager.Po new file mode 100644 index 000000000..5c93a9603 --- /dev/null +++ b/src/.deps/zm_plugin_manager.Po @@ -0,0 +1,655 @@ +zm_plugin_manager.o: zm_plugin_manager.cpp zm_plugin_manager.h \ + /usr/include/stdio.h /usr/include/features.h \ + /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h /usr/include/xlocale.h \ + /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc /usr/include/c++/4.7/map \ + /usr/include/c++/4.7/bits/stl_tree.h /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h \ + /usr/include/x86_64-linux-gnu/sys/dir.h /usr/include/dirent.h \ + /usr/include/x86_64-linux-gnu/bits/dirent.h \ + /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h /usr/include/x86_64-linux-gnu/sys/param.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/linux/param.h /usr/include/x86_64-linux-gnu/asm/param.h \ + /usr/include/asm-generic/param.h /usr/include/unistd.h \ + /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h zm.h \ + zm_config.h ../config.h zm_config_defines.h zm_logger.h \ + /usr/include/mysql/mysql.h /usr/include/mysql/mysql_version.h \ + /usr/include/mysql/mysql_com.h /usr/include/mysql/mysql_time.h \ + /usr/include/mysql/my_list.h /usr/include/mysql/typelib.h \ + /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_image_analyser.h /usr/include/c++/4.7/list \ + /usr/include/c++/4.7/bits/stl_list.h /usr/include/c++/4.7/bits/list.tcc \ + /usr/include/c++/4.7/stdexcept /usr/include/c++/4.7/iostream \ + /usr/include/c++/4.7/ostream /usr/include/c++/4.7/ios \ + /usr/include/c++/4.7/bits/ios_base.h \ + /usr/include/c++/4.7/bits/locale_classes.h \ + /usr/include/c++/4.7/bits/locale_classes.tcc \ + /usr/include/c++/4.7/streambuf /usr/include/c++/4.7/bits/streambuf.tcc \ + /usr/include/c++/4.7/bits/basic_ios.h \ + /usr/include/c++/4.7/bits/locale_facets.h /usr/include/c++/4.7/cwctype \ + /usr/include/wctype.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h \ + /usr/include/c++/4.7/bits/streambuf_iterator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h \ + /usr/include/c++/4.7/bits/locale_facets.tcc \ + /usr/include/c++/4.7/bits/basic_ios.tcc \ + /usr/include/c++/4.7/bits/ostream.tcc /usr/include/c++/4.7/istream \ + /usr/include/c++/4.7/bits/istream.tcc /usr/include/c++/4.7/memory \ + /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_tempbuf.h \ + /usr/include/c++/4.7/bits/stl_raw_storage_iter.h \ + /usr/include/c++/4.7/backward/auto_ptr.h zm_detector.h \ + /usr/include/syslog.h /usr/include/x86_64-linux-gnu/sys/syslog.h \ + /usr/include/x86_64-linux-gnu/bits/syslog-path.h /usr/include/libgen.h \ + zm_image.h zm_jpeg.h /usr/include/setjmp.h jinclude.h \ + /root/zm/libjpeg-turbo-1.2.1/jconfig.h /usr/include/string.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_coord.h zm_box.h \ + /usr/include/math.h /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h zm_poly.h zm_mem_utils.h \ + zm_utils.h /usr/include/x86_64-linux-gnu/sys/time.h \ + /usr/include/c++/4.7/vector /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/zlib.h /usr/include/zconf.h zm_zone.h zm_event.h \ + /usr/include/x86_64-linux-gnu/sys/stat.h \ + /usr/include/x86_64-linux-gnu/bits/stat.h /usr/include/c++/4.7/set \ + /usr/include/c++/4.7/bits/stl_set.h \ + /usr/include/c++/4.7/bits/stl_multiset.h zm_stream.h \ + /usr/include/x86_64-linux-gnu/sys/un.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h zm_mpeg.h zm_ffmpeg.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/inttypes.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/avconfig.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h zm_plugin.h /usr/include/dlfcn.h \ + /usr/include/x86_64-linux-gnu/bits/dlfcn.h + +zm_plugin_manager.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/xlocale.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/x86_64-linux-gnu/sys/dir.h: + +/usr/include/dirent.h: + +/usr/include/x86_64-linux-gnu/bits/dirent.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/sys/param.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/linux/param.h: + +/usr/include/x86_64-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +zm_logger.h: + +/usr/include/mysql/mysql.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_image_analyser.h: + +/usr/include/c++/4.7/list: + +/usr/include/c++/4.7/bits/stl_list.h: + +/usr/include/c++/4.7/bits/list.tcc: + +/usr/include/c++/4.7/stdexcept: + +/usr/include/c++/4.7/iostream: + +/usr/include/c++/4.7/ostream: + +/usr/include/c++/4.7/ios: + +/usr/include/c++/4.7/bits/ios_base.h: + +/usr/include/c++/4.7/bits/locale_classes.h: + +/usr/include/c++/4.7/bits/locale_classes.tcc: + +/usr/include/c++/4.7/streambuf: + +/usr/include/c++/4.7/bits/streambuf.tcc: + +/usr/include/c++/4.7/bits/basic_ios.h: + +/usr/include/c++/4.7/bits/locale_facets.h: + +/usr/include/c++/4.7/cwctype: + +/usr/include/wctype.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h: + +/usr/include/c++/4.7/bits/streambuf_iterator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h: + +/usr/include/c++/4.7/bits/locale_facets.tcc: + +/usr/include/c++/4.7/bits/basic_ios.tcc: + +/usr/include/c++/4.7/bits/ostream.tcc: + +/usr/include/c++/4.7/istream: + +/usr/include/c++/4.7/bits/istream.tcc: + +/usr/include/c++/4.7/memory: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_tempbuf.h: + +/usr/include/c++/4.7/bits/stl_raw_storage_iter.h: + +/usr/include/c++/4.7/backward/auto_ptr.h: + +zm_detector.h: + +/usr/include/syslog.h: + +/usr/include/x86_64-linux-gnu/sys/syslog.h: + +/usr/include/x86_64-linux-gnu/bits/syslog-path.h: + +/usr/include/libgen.h: + +zm_image.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/usr/include/string.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_coord.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +zm_zone.h: + +zm_event.h: + +/usr/include/x86_64-linux-gnu/sys/stat.h: + +/usr/include/x86_64-linux-gnu/bits/stat.h: + +/usr/include/c++/4.7/set: + +/usr/include/c++/4.7/bits/stl_set.h: + +/usr/include/c++/4.7/bits/stl_multiset.h: + +zm_stream.h: + +/usr/include/x86_64-linux-gnu/sys/un.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +zm_mpeg.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/inttypes.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: + +zm_plugin.h: + +/usr/include/dlfcn.h: + +/usr/include/x86_64-linux-gnu/bits/dlfcn.h: diff --git a/src/.deps/zm_poly.Po b/src/.deps/zm_poly.Po new file mode 100644 index 000000000..7a39ab09f --- /dev/null +++ b/src/.deps/zm_poly.Po @@ -0,0 +1,299 @@ +zm_poly.o: zm_poly.cpp zm.h zm_config.h ../config.h zm_config_defines.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_poly.h zm_coord.h zm_box.h /usr/include/math.h \ + /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_poly.h: + +zm_coord.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: diff --git a/src/.deps/zm_regexp.Po b/src/.deps/zm_regexp.Po new file mode 100644 index 000000000..32df8b282 --- /dev/null +++ b/src/.deps/zm_regexp.Po @@ -0,0 +1,287 @@ +zm_regexp.o: zm_regexp.cpp /usr/include/string.h /usr/include/features.h \ + /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h zm.h zm_config.h ../config.h zm_config_defines.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_regexp.h /usr/include/pcre.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h + +/usr/include/string.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_regexp.h: + +/usr/include/pcre.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: diff --git a/src/.deps/zm_remote_camera.Po b/src/.deps/zm_remote_camera.Po new file mode 100644 index 000000000..c11683838 --- /dev/null +++ b/src/.deps/zm_remote_camera.Po @@ -0,0 +1,463 @@ +zm_remote_camera.o: zm_remote_camera.cpp zm_remote_camera.h zm_camera.h \ + /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/features.h \ + /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/time.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/sys/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctls.h \ + /usr/include/x86_64-linux-gnu/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/x86_64-linux-gnu/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctl-types.h \ + /usr/include/x86_64-linux-gnu/sys/ttydefaults.h zm_image.h zm.h \ + zm_config.h ../config.h zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h /usr/include/xlocale.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_jpeg.h /usr/include/setjmp.h jinclude.h \ + /root/zm/libjpeg-turbo-1.2.1/jconfig.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/string.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_coord.h zm_box.h \ + /usr/include/math.h /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h zm_poly.h zm_mem_utils.h \ + zm_utils.h /usr/include/x86_64-linux-gnu/sys/time.h \ + /usr/include/c++/4.7/vector /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/zlib.h /usr/include/zconf.h /usr/include/netdb.h \ + /usr/include/netinet/in.h /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h \ + /usr/include/x86_64-linux-gnu/bits/in.h /usr/include/rpc/netdb.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/netdb.h + +zm_remote_camera.h: + +zm_camera.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/time.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/sys/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctls.h: + +/usr/include/x86_64-linux-gnu/asm/ioctls.h: + +/usr/include/asm-generic/ioctls.h: + +/usr/include/linux/ioctl.h: + +/usr/include/x86_64-linux-gnu/asm/ioctl.h: + +/usr/include/asm-generic/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctl-types.h: + +/usr/include/x86_64-linux-gnu/sys/ttydefaults.h: + +zm_image.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/string.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_coord.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +/usr/include/netdb.h: + +/usr/include/netinet/in.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/x86_64-linux-gnu/bits/in.h: + +/usr/include/rpc/netdb.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/netdb.h: diff --git a/src/.deps/zm_remote_camera_http.Po b/src/.deps/zm_remote_camera_http.Po new file mode 100644 index 000000000..acb25bffe --- /dev/null +++ b/src/.deps/zm_remote_camera_http.Po @@ -0,0 +1,473 @@ +zm_remote_camera_http.o: zm_remote_camera_http.cpp \ + zm_remote_camera_http.h zm_remote_camera.h zm_camera.h \ + /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/features.h \ + /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/time.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/sys/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctls.h \ + /usr/include/x86_64-linux-gnu/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/x86_64-linux-gnu/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctl-types.h \ + /usr/include/x86_64-linux-gnu/sys/ttydefaults.h zm_image.h zm.h \ + zm_config.h ../config.h zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h /usr/include/xlocale.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_jpeg.h /usr/include/setjmp.h jinclude.h \ + /root/zm/libjpeg-turbo-1.2.1/jconfig.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/string.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_coord.h zm_box.h \ + /usr/include/math.h /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h zm_poly.h zm_mem_utils.h \ + zm_utils.h /usr/include/x86_64-linux-gnu/sys/time.h \ + /usr/include/c++/4.7/vector /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/zlib.h /usr/include/zconf.h /usr/include/netdb.h \ + /usr/include/netinet/in.h /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h \ + /usr/include/x86_64-linux-gnu/bits/in.h /usr/include/rpc/netdb.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/netdb.h zm_buffer.h zm_regexp.h \ + /usr/include/pcre.h + +zm_remote_camera_http.h: + +zm_remote_camera.h: + +zm_camera.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/time.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/sys/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctls.h: + +/usr/include/x86_64-linux-gnu/asm/ioctls.h: + +/usr/include/asm-generic/ioctls.h: + +/usr/include/linux/ioctl.h: + +/usr/include/x86_64-linux-gnu/asm/ioctl.h: + +/usr/include/asm-generic/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctl-types.h: + +/usr/include/x86_64-linux-gnu/sys/ttydefaults.h: + +zm_image.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/string.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_coord.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +/usr/include/netdb.h: + +/usr/include/netinet/in.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/x86_64-linux-gnu/bits/in.h: + +/usr/include/rpc/netdb.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/netdb.h: + +zm_buffer.h: + +zm_regexp.h: + +/usr/include/pcre.h: diff --git a/src/.deps/zm_remote_camera_rtsp.Po b/src/.deps/zm_remote_camera_rtsp.Po new file mode 100644 index 000000000..dcf666cd4 --- /dev/null +++ b/src/.deps/zm_remote_camera_rtsp.Po @@ -0,0 +1,582 @@ +zm_remote_camera_rtsp.o: zm_remote_camera_rtsp.cpp zm.h zm_config.h \ + ../config.h zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_remote_camera_rtsp.h zm_remote_camera.h zm_camera.h \ + /usr/include/x86_64-linux-gnu/sys/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctls.h \ + /usr/include/x86_64-linux-gnu/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/x86_64-linux-gnu/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctl-types.h \ + /usr/include/x86_64-linux-gnu/sys/ttydefaults.h zm_image.h zm_jpeg.h \ + /usr/include/setjmp.h jinclude.h /root/zm/libjpeg-turbo-1.2.1/jconfig.h \ + /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/string.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_coord.h zm_box.h \ + /usr/include/math.h /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h zm_poly.h zm_mem_utils.h \ + zm_utils.h /usr/include/x86_64-linux-gnu/sys/time.h \ + /usr/include/c++/4.7/vector /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/zlib.h /usr/include/zconf.h /usr/include/netdb.h \ + /usr/include/netinet/in.h /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h \ + /usr/include/x86_64-linux-gnu/bits/in.h /usr/include/rpc/netdb.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/netdb.h zm_buffer.h zm_rtsp.h \ + zm_ffmpeg.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/avconfig.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h zm_comms.h zm_exception.h \ + /usr/include/x86_64-linux-gnu/sys/un.h /usr/include/c++/4.7/set \ + /usr/include/c++/4.7/bits/stl_set.h \ + /usr/include/c++/4.7/bits/stl_multiset.h zm_thread.h zm_rtp_source.h + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_remote_camera_rtsp.h: + +zm_remote_camera.h: + +zm_camera.h: + +/usr/include/x86_64-linux-gnu/sys/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctls.h: + +/usr/include/x86_64-linux-gnu/asm/ioctls.h: + +/usr/include/asm-generic/ioctls.h: + +/usr/include/linux/ioctl.h: + +/usr/include/x86_64-linux-gnu/asm/ioctl.h: + +/usr/include/asm-generic/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctl-types.h: + +/usr/include/x86_64-linux-gnu/sys/ttydefaults.h: + +zm_image.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/string.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_coord.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +/usr/include/netdb.h: + +/usr/include/netinet/in.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/x86_64-linux-gnu/bits/in.h: + +/usr/include/rpc/netdb.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/netdb.h: + +zm_buffer.h: + +zm_rtsp.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/inttypes.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: + +zm_comms.h: + +zm_exception.h: + +/usr/include/x86_64-linux-gnu/sys/un.h: + +/usr/include/c++/4.7/set: + +/usr/include/c++/4.7/bits/stl_set.h: + +/usr/include/c++/4.7/bits/stl_multiset.h: + +zm_thread.h: + +zm_rtp_source.h: diff --git a/src/.deps/zm_rtp.Po b/src/.deps/zm_rtp.Po new file mode 100644 index 000000000..764741cb4 --- /dev/null +++ b/src/.deps/zm_rtp.Po @@ -0,0 +1,271 @@ +zm_rtp.o: zm_rtp.cpp zm_rtp.h zm.h zm_config.h ../config.h \ + zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h + +zm_rtp.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: diff --git a/src/.deps/zm_rtp_ctrl.Po b/src/.deps/zm_rtp_ctrl.Po new file mode 100644 index 000000000..d500e3568 --- /dev/null +++ b/src/.deps/zm_rtp_ctrl.Po @@ -0,0 +1,521 @@ +zm_rtp_ctrl.o: zm_rtp_ctrl.cpp zm.h zm_config.h ../config.h \ + zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_rtp_ctrl.h zm_rtp.h zm_comms.h zm_exception.h /usr/include/netdb.h \ + /usr/include/netinet/in.h /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h \ + /usr/include/x86_64-linux-gnu/bits/in.h /usr/include/rpc/netdb.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/netdb.h /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/x86_64-linux-gnu/sys/un.h /usr/include/string.h \ + /usr/include/c++/4.7/set /usr/include/c++/4.7/bits/stl_set.h \ + /usr/include/c++/4.7/bits/stl_multiset.h /usr/include/c++/4.7/vector \ + /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc zm_thread.h zm_utils.h \ + /usr/include/x86_64-linux-gnu/sys/time.h zm_time.h zm_rtsp.h zm_ffmpeg.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h /usr/include/libio.h \ + /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/avconfig.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h zm_rtp_source.h zm_buffer.h + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_rtp_ctrl.h: + +zm_rtp.h: + +zm_comms.h: + +zm_exception.h: + +/usr/include/netdb.h: + +/usr/include/netinet/in.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/x86_64-linux-gnu/bits/in.h: + +/usr/include/rpc/netdb.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/netdb.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/x86_64-linux-gnu/sys/un.h: + +/usr/include/string.h: + +/usr/include/c++/4.7/set: + +/usr/include/c++/4.7/bits/stl_set.h: + +/usr/include/c++/4.7/bits/stl_multiset.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +zm_thread.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +zm_time.h: + +zm_rtsp.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/inttypes.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: + +zm_rtp_source.h: + +zm_buffer.h: diff --git a/src/.deps/zm_rtp_data.Po b/src/.deps/zm_rtp_data.Po new file mode 100644 index 000000000..99ce87dec --- /dev/null +++ b/src/.deps/zm_rtp_data.Po @@ -0,0 +1,521 @@ +zm_rtp_data.o: zm_rtp_data.cpp zm.h zm_config.h ../config.h \ + zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_rtp_data.h zm_thread.h zm_exception.h zm_utils.h \ + /usr/include/x86_64-linux-gnu/sys/time.h /usr/include/c++/4.7/vector \ + /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc zm_buffer.h /usr/include/string.h \ + zm_rtsp.h zm_ffmpeg.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h /usr/include/libio.h \ + /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/avconfig.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h zm_comms.h /usr/include/netdb.h \ + /usr/include/netinet/in.h /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h \ + /usr/include/x86_64-linux-gnu/bits/in.h /usr/include/rpc/netdb.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/netdb.h \ + /usr/include/x86_64-linux-gnu/sys/un.h /usr/include/c++/4.7/set \ + /usr/include/c++/4.7/bits/stl_set.h \ + /usr/include/c++/4.7/bits/stl_multiset.h zm_rtp_source.h \ + /usr/include/arpa/inet.h + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_rtp_data.h: + +zm_thread.h: + +zm_exception.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +zm_buffer.h: + +/usr/include/string.h: + +zm_rtsp.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/inttypes.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: + +zm_comms.h: + +/usr/include/netdb.h: + +/usr/include/netinet/in.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/x86_64-linux-gnu/bits/in.h: + +/usr/include/rpc/netdb.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/netdb.h: + +/usr/include/x86_64-linux-gnu/sys/un.h: + +/usr/include/c++/4.7/set: + +/usr/include/c++/4.7/bits/stl_set.h: + +/usr/include/c++/4.7/bits/stl_multiset.h: + +zm_rtp_source.h: + +/usr/include/arpa/inet.h: diff --git a/src/.deps/zm_rtp_source.Po b/src/.deps/zm_rtp_source.Po new file mode 100644 index 000000000..60fae6d12 --- /dev/null +++ b/src/.deps/zm_rtp_source.Po @@ -0,0 +1,344 @@ +zm_rtp_source.o: zm_rtp_source.cpp zm_rtp_source.h zm_buffer.h zm.h \ + zm_config.h ../config.h zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + /usr/include/string.h zm_thread.h zm_exception.h zm_utils.h \ + /usr/include/x86_64-linux-gnu/sys/time.h /usr/include/c++/4.7/vector \ + /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc zm_time.h zm_rtp_data.h \ + /usr/include/arpa/inet.h /usr/include/netinet/in.h \ + /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h \ + /usr/include/x86_64-linux-gnu/bits/in.h + +zm_rtp_source.h: + +zm_buffer.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/string.h: + +zm_thread.h: + +zm_exception.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +zm_time.h: + +zm_rtp_data.h: + +/usr/include/arpa/inet.h: + +/usr/include/netinet/in.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/x86_64-linux-gnu/bits/in.h: diff --git a/src/.deps/zm_rtsp.Po b/src/.deps/zm_rtsp.Po new file mode 100644 index 000000000..c3688b036 --- /dev/null +++ b/src/.deps/zm_rtsp.Po @@ -0,0 +1,547 @@ +zm_rtsp.o: zm_rtsp.cpp zm.h zm_config.h ../config.h zm_config_defines.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_rtsp.h zm_ffmpeg.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h /usr/include/libio.h \ + /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/avconfig.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h zm_comms.h zm_exception.h \ + /usr/include/netdb.h /usr/include/netinet/in.h \ + /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h \ + /usr/include/x86_64-linux-gnu/bits/in.h /usr/include/rpc/netdb.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/netdb.h \ + /usr/include/x86_64-linux-gnu/sys/un.h /usr/include/c++/4.7/set \ + /usr/include/c++/4.7/bits/stl_set.h \ + /usr/include/c++/4.7/bits/stl_multiset.h /usr/include/c++/4.7/vector \ + /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc zm_thread.h zm_utils.h \ + /usr/include/x86_64-linux-gnu/sys/time.h zm_rtp_source.h zm_buffer.h \ + zm_rtp_data.h zm_rtp_ctrl.h zm_rtp.h zm_db.h zm_sdp.h \ + /usr/include/signal.h /usr/include/x86_64-linux-gnu/bits/signum.h \ + /usr/include/x86_64-linux-gnu/bits/sigaction.h \ + /usr/include/x86_64-linux-gnu/bits/sigcontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigstack.h \ + /usr/include/x86_64-linux-gnu/sys/ucontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigthread.h + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_rtsp.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/inttypes.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: + +zm_comms.h: + +zm_exception.h: + +/usr/include/netdb.h: + +/usr/include/netinet/in.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/x86_64-linux-gnu/bits/in.h: + +/usr/include/rpc/netdb.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/netdb.h: + +/usr/include/x86_64-linux-gnu/sys/un.h: + +/usr/include/c++/4.7/set: + +/usr/include/c++/4.7/bits/stl_set.h: + +/usr/include/c++/4.7/bits/stl_multiset.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +zm_thread.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +zm_rtp_source.h: + +zm_buffer.h: + +zm_rtp_data.h: + +zm_rtp_ctrl.h: + +zm_rtp.h: + +zm_db.h: + +zm_sdp.h: + +/usr/include/signal.h: + +/usr/include/x86_64-linux-gnu/bits/signum.h: + +/usr/include/x86_64-linux-gnu/bits/sigaction.h: + +/usr/include/x86_64-linux-gnu/bits/sigcontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigstack.h: + +/usr/include/x86_64-linux-gnu/sys/ucontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigthread.h: diff --git a/src/.deps/zm_sdp.Po b/src/.deps/zm_sdp.Po new file mode 100644 index 000000000..0fa6d7d38 --- /dev/null +++ b/src/.deps/zm_sdp.Po @@ -0,0 +1,453 @@ +zm_sdp.o: zm_sdp.cpp zm.h zm_config.h ../config.h zm_config_defines.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_sdp.h zm_utils.h /usr/include/x86_64-linux-gnu/sys/time.h \ + /usr/include/c++/4.7/vector /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc zm_exception.h zm_ffmpeg.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/errno.h /usr/include/x86_64-linux-gnu/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h /usr/include/libio.h \ + /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/avconfig.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_sdp.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +zm_exception.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/inttypes.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: diff --git a/src/.deps/zm_signal.Po b/src/.deps/zm_signal.Po new file mode 100644 index 000000000..81f6b5829 --- /dev/null +++ b/src/.deps/zm_signal.Po @@ -0,0 +1,320 @@ +zm_signal.o: zm_signal.cpp zm.h zm_config.h ../config.h \ + zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_signal.h /usr/include/signal.h \ + /usr/include/x86_64-linux-gnu/bits/signum.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/sigaction.h \ + /usr/include/x86_64-linux-gnu/bits/sigcontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigstack.h \ + /usr/include/x86_64-linux-gnu/sys/ucontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigthread.h /usr/include/execinfo.h \ + /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/string.h \ + /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_signal.h: + +/usr/include/signal.h: + +/usr/include/x86_64-linux-gnu/bits/signum.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/sigaction.h: + +/usr/include/x86_64-linux-gnu/bits/sigcontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigstack.h: + +/usr/include/x86_64-linux-gnu/sys/ucontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigthread.h: + +/usr/include/execinfo.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/string.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: diff --git a/src/.deps/zm_stream.Po b/src/.deps/zm_stream.Po new file mode 100644 index 000000000..863661909 --- /dev/null +++ b/src/.deps/zm_stream.Po @@ -0,0 +1,692 @@ +zm_stream.o: zm_stream.cpp /usr/include/x86_64-linux-gnu/sys/un.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h /usr/include/features.h \ + /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h /usr/include/string.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h zm.h zm_config.h ../config.h zm_config_defines.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_mpeg.h zm_ffmpeg.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/inttypes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h /usr/include/math.h \ + /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h /usr/include/libio.h \ + /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/avconfig.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h zm_monitor.h \ + /usr/include/c++/4.7/vector /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/c++/4.7/sstream \ + /usr/include/c++/4.7/istream /usr/include/c++/4.7/ios \ + /usr/include/c++/4.7/bits/ios_base.h \ + /usr/include/c++/4.7/bits/locale_classes.h \ + /usr/include/c++/4.7/bits/locale_classes.tcc \ + /usr/include/c++/4.7/streambuf /usr/include/c++/4.7/bits/streambuf.tcc \ + /usr/include/c++/4.7/bits/basic_ios.h \ + /usr/include/c++/4.7/bits/locale_facets.h /usr/include/c++/4.7/cwctype \ + /usr/include/wctype.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h \ + /usr/include/c++/4.7/bits/streambuf_iterator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h \ + /usr/include/c++/4.7/bits/locale_facets.tcc \ + /usr/include/c++/4.7/bits/basic_ios.tcc /usr/include/c++/4.7/ostream \ + /usr/include/c++/4.7/bits/ostream.tcc \ + /usr/include/c++/4.7/bits/istream.tcc \ + /usr/include/c++/4.7/bits/sstream.tcc zm_coord.h zm_image.h zm_jpeg.h \ + /usr/include/setjmp.h jinclude.h /root/zm/libjpeg-turbo-1.2.1/jconfig.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_box.h zm_poly.h \ + zm_mem_utils.h zm_utils.h /usr/include/x86_64-linux-gnu/sys/time.h \ + /usr/include/zlib.h /usr/include/zconf.h zm_zone.h zm_event.h \ + /usr/include/x86_64-linux-gnu/sys/stat.h \ + /usr/include/x86_64-linux-gnu/bits/stat.h /usr/include/c++/4.7/set \ + /usr/include/c++/4.7/bits/stl_set.h \ + /usr/include/c++/4.7/bits/stl_multiset.h zm_stream.h \ + /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h zm_camera.h \ + /usr/include/x86_64-linux-gnu/sys/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctls.h \ + /usr/include/x86_64-linux-gnu/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/x86_64-linux-gnu/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctl-types.h \ + /usr/include/x86_64-linux-gnu/sys/ttydefaults.h zm_plugin_manager.h \ + /usr/include/x86_64-linux-gnu/sys/dir.h /usr/include/dirent.h \ + /usr/include/x86_64-linux-gnu/bits/dirent.h \ + /usr/include/x86_64-linux-gnu/sys/param.h /usr/include/linux/param.h \ + /usr/include/x86_64-linux-gnu/asm/param.h \ + /usr/include/asm-generic/param.h zm_image_analyser.h \ + /usr/include/c++/4.7/list /usr/include/c++/4.7/bits/stl_list.h \ + /usr/include/c++/4.7/bits/list.tcc /usr/include/c++/4.7/stdexcept \ + /usr/include/c++/4.7/iostream /usr/include/c++/4.7/memory \ + /usr/include/c++/4.7/bits/stl_tempbuf.h \ + /usr/include/c++/4.7/bits/stl_raw_storage_iter.h \ + /usr/include/c++/4.7/backward/auto_ptr.h zm_detector.h \ + /usr/include/syslog.h /usr/include/x86_64-linux-gnu/sys/syslog.h \ + /usr/include/x86_64-linux-gnu/bits/syslog-path.h /usr/include/libgen.h \ + zm_plugin.h /usr/include/dlfcn.h \ + /usr/include/x86_64-linux-gnu/bits/dlfcn.h + +/usr/include/x86_64-linux-gnu/sys/un.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/string.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_mpeg.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/inttypes.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: + +zm_monitor.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/c++/4.7/sstream: + +/usr/include/c++/4.7/istream: + +/usr/include/c++/4.7/ios: + +/usr/include/c++/4.7/bits/ios_base.h: + +/usr/include/c++/4.7/bits/locale_classes.h: + +/usr/include/c++/4.7/bits/locale_classes.tcc: + +/usr/include/c++/4.7/streambuf: + +/usr/include/c++/4.7/bits/streambuf.tcc: + +/usr/include/c++/4.7/bits/basic_ios.h: + +/usr/include/c++/4.7/bits/locale_facets.h: + +/usr/include/c++/4.7/cwctype: + +/usr/include/wctype.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h: + +/usr/include/c++/4.7/bits/streambuf_iterator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h: + +/usr/include/c++/4.7/bits/locale_facets.tcc: + +/usr/include/c++/4.7/bits/basic_ios.tcc: + +/usr/include/c++/4.7/ostream: + +/usr/include/c++/4.7/bits/ostream.tcc: + +/usr/include/c++/4.7/bits/istream.tcc: + +/usr/include/c++/4.7/bits/sstream.tcc: + +zm_coord.h: + +zm_image.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_box.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +zm_zone.h: + +zm_event.h: + +/usr/include/x86_64-linux-gnu/sys/stat.h: + +/usr/include/x86_64-linux-gnu/bits/stat.h: + +/usr/include/c++/4.7/set: + +/usr/include/c++/4.7/bits/stl_set.h: + +/usr/include/c++/4.7/bits/stl_multiset.h: + +zm_stream.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +zm_camera.h: + +/usr/include/x86_64-linux-gnu/sys/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctls.h: + +/usr/include/x86_64-linux-gnu/asm/ioctls.h: + +/usr/include/asm-generic/ioctls.h: + +/usr/include/linux/ioctl.h: + +/usr/include/x86_64-linux-gnu/asm/ioctl.h: + +/usr/include/asm-generic/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctl-types.h: + +/usr/include/x86_64-linux-gnu/sys/ttydefaults.h: + +zm_plugin_manager.h: + +/usr/include/x86_64-linux-gnu/sys/dir.h: + +/usr/include/dirent.h: + +/usr/include/x86_64-linux-gnu/bits/dirent.h: + +/usr/include/x86_64-linux-gnu/sys/param.h: + +/usr/include/linux/param.h: + +/usr/include/x86_64-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +zm_image_analyser.h: + +/usr/include/c++/4.7/list: + +/usr/include/c++/4.7/bits/stl_list.h: + +/usr/include/c++/4.7/bits/list.tcc: + +/usr/include/c++/4.7/stdexcept: + +/usr/include/c++/4.7/iostream: + +/usr/include/c++/4.7/memory: + +/usr/include/c++/4.7/bits/stl_tempbuf.h: + +/usr/include/c++/4.7/bits/stl_raw_storage_iter.h: + +/usr/include/c++/4.7/backward/auto_ptr.h: + +zm_detector.h: + +/usr/include/syslog.h: + +/usr/include/x86_64-linux-gnu/sys/syslog.h: + +/usr/include/x86_64-linux-gnu/bits/syslog-path.h: + +/usr/include/libgen.h: + +zm_plugin.h: + +/usr/include/dlfcn.h: + +/usr/include/x86_64-linux-gnu/bits/dlfcn.h: diff --git a/src/.deps/zm_thread.Po b/src/.deps/zm_thread.Po new file mode 100644 index 000000000..8a5431b07 --- /dev/null +++ b/src/.deps/zm_thread.Po @@ -0,0 +1,341 @@ +zm_thread.o: zm_thread.cpp zm_thread.h /usr/include/unistd.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/pthread.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h /usr/include/sched.h \ + /usr/include/time.h /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h /usr/include/xlocale.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h zm_exception.h zm.h \ + zm_config.h ../config.h zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_utils.h /usr/include/x86_64-linux-gnu/sys/time.h \ + /usr/include/c++/4.7/vector /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/string.h \ + /usr/include/signal.h /usr/include/x86_64-linux-gnu/bits/signum.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/sigaction.h \ + /usr/include/x86_64-linux-gnu/bits/sigcontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigstack.h \ + /usr/include/x86_64-linux-gnu/sys/ucontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigthread.h /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + zm_threaddata.cpp + +zm_thread.h: + +/usr/include/unistd.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/pthread.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/xlocale.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +zm_exception.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/string.h: + +/usr/include/signal.h: + +/usr/include/x86_64-linux-gnu/bits/signum.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/sigaction.h: + +/usr/include/x86_64-linux-gnu/bits/sigcontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigstack.h: + +/usr/include/x86_64-linux-gnu/sys/ucontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigthread.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +zm_threaddata.cpp: diff --git a/src/.deps/zm_time.Po b/src/.deps/zm_time.Po new file mode 100644 index 000000000..256f73978 --- /dev/null +++ b/src/.deps/zm_time.Po @@ -0,0 +1,274 @@ +zm_time.o: zm_time.cpp zm_time.h zm.h zm_config.h ../config.h \ + zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + /usr/include/x86_64-linux-gnu/sys/time.h + +zm_time.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: diff --git a/src/.deps/zm_timer.Po b/src/.deps/zm_timer.Po new file mode 100644 index 000000000..46f7e6e91 --- /dev/null +++ b/src/.deps/zm_timer.Po @@ -0,0 +1,300 @@ +zm_timer.o: zm_timer.cpp zm_timer.h zm_thread.h /usr/include/unistd.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/pthread.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h /usr/include/sched.h \ + /usr/include/time.h /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h /usr/include/xlocale.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h zm_exception.h zm.h \ + zm_config.h ../config.h zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_utils.h /usr/include/x86_64-linux-gnu/sys/time.h \ + /usr/include/c++/4.7/vector /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc + +zm_timer.h: + +zm_thread.h: + +/usr/include/unistd.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/pthread.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/xlocale.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +zm_exception.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: diff --git a/src/.deps/zm_user.Po b/src/.deps/zm_user.Po new file mode 100644 index 000000000..c04ac182e --- /dev/null +++ b/src/.deps/zm_user.Po @@ -0,0 +1,342 @@ +zm_user.o: zm_user.cpp zm.h zm_config.h ../config.h zm_config_defines.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_db.h zm_user.h /usr/include/gnutls/openssl.h \ + /usr/include/gnutls/gnutls.h /usr/include/gnutls/compat.h \ + /usr/include/gcrypt.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/gpg-error.h \ + /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h \ + /usr/include/x86_64-linux-gnu/sys/time.h /usr/include/gcrypt-module.h \ + /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_db.h: + +zm_user.h: + +/usr/include/gnutls/openssl.h: + +/usr/include/gnutls/gnutls.h: + +/usr/include/gnutls/compat.h: + +/usr/include/gcrypt.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/gpg-error.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/gcrypt-module.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: diff --git a/src/.deps/zm_utils.Po b/src/.deps/zm_utils.Po new file mode 100644 index 000000000..3d4ce2c45 --- /dev/null +++ b/src/.deps/zm_utils.Po @@ -0,0 +1,307 @@ +zm_utils.o: zm_utils.cpp zm.h zm_config.h ../config.h zm_config_defines.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_utils.h /usr/include/x86_64-linux-gnu/sys/time.h \ + /usr/include/c++/4.7/vector /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/string.h \ + /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/string.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: diff --git a/src/.deps/zm_zone.Po b/src/.deps/zm_zone.Po new file mode 100644 index 000000000..80a119ab8 --- /dev/null +++ b/src/.deps/zm_zone.Po @@ -0,0 +1,693 @@ +zm_zone.o: zm_zone.cpp zm.h zm_config.h ../config.h zm_config_defines.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_db.h zm_zone.h zm_rgb.h zm_coord.h zm_poly.h zm_box.h \ + /usr/include/math.h /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h zm_image.h zm_jpeg.h \ + /usr/include/setjmp.h jinclude.h /root/zm/libjpeg-turbo-1.2.1/jconfig.h \ + /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/string.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_mem_utils.h zm_utils.h \ + /usr/include/x86_64-linux-gnu/sys/time.h /usr/include/c++/4.7/vector \ + /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/zlib.h /usr/include/zconf.h zm_event.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/sys/stat.h \ + /usr/include/x86_64-linux-gnu/bits/stat.h /usr/include/c++/4.7/set \ + /usr/include/c++/4.7/bits/stl_set.h \ + /usr/include/c++/4.7/bits/stl_multiset.h zm_stream.h \ + /usr/include/x86_64-linux-gnu/sys/un.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h zm_mpeg.h zm_ffmpeg.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/inttypes.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/avconfig.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h zm_monitor.h \ + /usr/include/c++/4.7/sstream /usr/include/c++/4.7/istream \ + /usr/include/c++/4.7/ios /usr/include/c++/4.7/bits/ios_base.h \ + /usr/include/c++/4.7/bits/locale_classes.h \ + /usr/include/c++/4.7/bits/locale_classes.tcc \ + /usr/include/c++/4.7/streambuf /usr/include/c++/4.7/bits/streambuf.tcc \ + /usr/include/c++/4.7/bits/basic_ios.h \ + /usr/include/c++/4.7/bits/locale_facets.h /usr/include/c++/4.7/cwctype \ + /usr/include/wctype.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h \ + /usr/include/c++/4.7/bits/streambuf_iterator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h \ + /usr/include/c++/4.7/bits/locale_facets.tcc \ + /usr/include/c++/4.7/bits/basic_ios.tcc /usr/include/c++/4.7/ostream \ + /usr/include/c++/4.7/bits/ostream.tcc \ + /usr/include/c++/4.7/bits/istream.tcc \ + /usr/include/c++/4.7/bits/sstream.tcc zm_camera.h \ + /usr/include/x86_64-linux-gnu/sys/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctls.h \ + /usr/include/x86_64-linux-gnu/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/x86_64-linux-gnu/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctl-types.h \ + /usr/include/x86_64-linux-gnu/sys/ttydefaults.h zm_plugin_manager.h \ + /usr/include/x86_64-linux-gnu/sys/dir.h /usr/include/dirent.h \ + /usr/include/x86_64-linux-gnu/bits/dirent.h \ + /usr/include/x86_64-linux-gnu/sys/param.h /usr/include/linux/param.h \ + /usr/include/x86_64-linux-gnu/asm/param.h \ + /usr/include/asm-generic/param.h zm_image_analyser.h \ + /usr/include/c++/4.7/list /usr/include/c++/4.7/bits/stl_list.h \ + /usr/include/c++/4.7/bits/list.tcc /usr/include/c++/4.7/stdexcept \ + /usr/include/c++/4.7/iostream /usr/include/c++/4.7/memory \ + /usr/include/c++/4.7/bits/stl_tempbuf.h \ + /usr/include/c++/4.7/bits/stl_raw_storage_iter.h \ + /usr/include/c++/4.7/backward/auto_ptr.h zm_detector.h \ + /usr/include/syslog.h /usr/include/x86_64-linux-gnu/sys/syslog.h \ + /usr/include/x86_64-linux-gnu/bits/syslog-path.h /usr/include/libgen.h \ + zm_plugin.h /usr/include/dlfcn.h \ + /usr/include/x86_64-linux-gnu/bits/dlfcn.h + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_db.h: + +zm_zone.h: + +zm_rgb.h: + +zm_coord.h: + +zm_poly.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +zm_image.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/string.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +zm_event.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/sys/stat.h: + +/usr/include/x86_64-linux-gnu/bits/stat.h: + +/usr/include/c++/4.7/set: + +/usr/include/c++/4.7/bits/stl_set.h: + +/usr/include/c++/4.7/bits/stl_multiset.h: + +zm_stream.h: + +/usr/include/x86_64-linux-gnu/sys/un.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +zm_mpeg.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/inttypes.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: + +zm_monitor.h: + +/usr/include/c++/4.7/sstream: + +/usr/include/c++/4.7/istream: + +/usr/include/c++/4.7/ios: + +/usr/include/c++/4.7/bits/ios_base.h: + +/usr/include/c++/4.7/bits/locale_classes.h: + +/usr/include/c++/4.7/bits/locale_classes.tcc: + +/usr/include/c++/4.7/streambuf: + +/usr/include/c++/4.7/bits/streambuf.tcc: + +/usr/include/c++/4.7/bits/basic_ios.h: + +/usr/include/c++/4.7/bits/locale_facets.h: + +/usr/include/c++/4.7/cwctype: + +/usr/include/wctype.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h: + +/usr/include/c++/4.7/bits/streambuf_iterator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h: + +/usr/include/c++/4.7/bits/locale_facets.tcc: + +/usr/include/c++/4.7/bits/basic_ios.tcc: + +/usr/include/c++/4.7/ostream: + +/usr/include/c++/4.7/bits/ostream.tcc: + +/usr/include/c++/4.7/bits/istream.tcc: + +/usr/include/c++/4.7/bits/sstream.tcc: + +zm_camera.h: + +/usr/include/x86_64-linux-gnu/sys/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctls.h: + +/usr/include/x86_64-linux-gnu/asm/ioctls.h: + +/usr/include/asm-generic/ioctls.h: + +/usr/include/linux/ioctl.h: + +/usr/include/x86_64-linux-gnu/asm/ioctl.h: + +/usr/include/asm-generic/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctl-types.h: + +/usr/include/x86_64-linux-gnu/sys/ttydefaults.h: + +zm_plugin_manager.h: + +/usr/include/x86_64-linux-gnu/sys/dir.h: + +/usr/include/dirent.h: + +/usr/include/x86_64-linux-gnu/bits/dirent.h: + +/usr/include/x86_64-linux-gnu/sys/param.h: + +/usr/include/linux/param.h: + +/usr/include/x86_64-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +zm_image_analyser.h: + +/usr/include/c++/4.7/list: + +/usr/include/c++/4.7/bits/stl_list.h: + +/usr/include/c++/4.7/bits/list.tcc: + +/usr/include/c++/4.7/stdexcept: + +/usr/include/c++/4.7/iostream: + +/usr/include/c++/4.7/memory: + +/usr/include/c++/4.7/bits/stl_tempbuf.h: + +/usr/include/c++/4.7/bits/stl_raw_storage_iter.h: + +/usr/include/c++/4.7/backward/auto_ptr.h: + +zm_detector.h: + +/usr/include/syslog.h: + +/usr/include/x86_64-linux-gnu/sys/syslog.h: + +/usr/include/x86_64-linux-gnu/bits/syslog-path.h: + +/usr/include/libgen.h: + +zm_plugin.h: + +/usr/include/dlfcn.h: + +/usr/include/x86_64-linux-gnu/bits/dlfcn.h: diff --git a/src/.deps/zma.Po b/src/.deps/zma.Po new file mode 100644 index 000000000..6c508ba1c --- /dev/null +++ b/src/.deps/zma.Po @@ -0,0 +1,718 @@ +zma.o: zma.cpp /usr/include/getopt.h /usr/include/ctype.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h /usr/include/xlocale.h \ + /usr/include/signal.h /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/bits/signum.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/sigaction.h \ + /usr/include/x86_64-linux-gnu/bits/sigcontext.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/x86_64-linux-gnu/bits/sigstack.h \ + /usr/include/x86_64-linux-gnu/sys/ucontext.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/sigthread.h zm.h zm_config.h \ + ../config.h zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/c++/4.7/map \ + /usr/include/c++/4.7/bits/stl_tree.h /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_db.h zm_signal.h /usr/include/execinfo.h zm_monitor.h \ + /usr/include/c++/4.7/vector /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/c++/4.7/sstream \ + /usr/include/c++/4.7/istream /usr/include/c++/4.7/ios \ + /usr/include/c++/4.7/bits/ios_base.h \ + /usr/include/c++/4.7/bits/locale_classes.h \ + /usr/include/c++/4.7/bits/locale_classes.tcc \ + /usr/include/c++/4.7/streambuf /usr/include/c++/4.7/bits/streambuf.tcc \ + /usr/include/c++/4.7/bits/basic_ios.h \ + /usr/include/c++/4.7/bits/locale_facets.h /usr/include/c++/4.7/cwctype \ + /usr/include/wctype.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h \ + /usr/include/c++/4.7/bits/streambuf_iterator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h \ + /usr/include/c++/4.7/bits/locale_facets.tcc \ + /usr/include/c++/4.7/bits/basic_ios.tcc /usr/include/c++/4.7/ostream \ + /usr/include/c++/4.7/bits/ostream.tcc \ + /usr/include/c++/4.7/bits/istream.tcc \ + /usr/include/c++/4.7/bits/sstream.tcc zm_coord.h zm_image.h zm_jpeg.h \ + /usr/include/setjmp.h jinclude.h /root/zm/libjpeg-turbo-1.2.1/jconfig.h \ + /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/string.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_box.h \ + /usr/include/math.h /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h zm_poly.h zm_mem_utils.h \ + zm_utils.h /usr/include/x86_64-linux-gnu/sys/time.h /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/zlib.h /usr/include/zconf.h zm_zone.h zm_event.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/sys/stat.h \ + /usr/include/x86_64-linux-gnu/bits/stat.h /usr/include/c++/4.7/set \ + /usr/include/c++/4.7/bits/stl_set.h \ + /usr/include/c++/4.7/bits/stl_multiset.h zm_stream.h \ + /usr/include/x86_64-linux-gnu/sys/un.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h zm_mpeg.h zm_ffmpeg.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/inttypes.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/avconfig.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h zm_camera.h \ + /usr/include/x86_64-linux-gnu/sys/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctls.h \ + /usr/include/x86_64-linux-gnu/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/x86_64-linux-gnu/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctl-types.h \ + /usr/include/x86_64-linux-gnu/sys/ttydefaults.h zm_plugin_manager.h \ + /usr/include/x86_64-linux-gnu/sys/dir.h /usr/include/dirent.h \ + /usr/include/x86_64-linux-gnu/bits/dirent.h \ + /usr/include/x86_64-linux-gnu/sys/param.h /usr/include/linux/param.h \ + /usr/include/x86_64-linux-gnu/asm/param.h \ + /usr/include/asm-generic/param.h zm_image_analyser.h \ + /usr/include/c++/4.7/list /usr/include/c++/4.7/bits/stl_list.h \ + /usr/include/c++/4.7/bits/list.tcc /usr/include/c++/4.7/stdexcept \ + /usr/include/c++/4.7/iostream /usr/include/c++/4.7/memory \ + /usr/include/c++/4.7/bits/stl_tempbuf.h \ + /usr/include/c++/4.7/bits/stl_raw_storage_iter.h \ + /usr/include/c++/4.7/backward/auto_ptr.h zm_detector.h \ + /usr/include/syslog.h /usr/include/x86_64-linux-gnu/sys/syslog.h \ + /usr/include/x86_64-linux-gnu/bits/syslog-path.h /usr/include/libgen.h \ + zm_plugin.h /usr/include/dlfcn.h \ + /usr/include/x86_64-linux-gnu/bits/dlfcn.h + +/usr/include/getopt.h: + +/usr/include/ctype.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/xlocale.h: + +/usr/include/signal.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/bits/signum.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/sigaction.h: + +/usr/include/x86_64-linux-gnu/bits/sigcontext.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/x86_64-linux-gnu/bits/sigstack.h: + +/usr/include/x86_64-linux-gnu/sys/ucontext.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/sigthread.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_db.h: + +zm_signal.h: + +/usr/include/execinfo.h: + +zm_monitor.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/c++/4.7/sstream: + +/usr/include/c++/4.7/istream: + +/usr/include/c++/4.7/ios: + +/usr/include/c++/4.7/bits/ios_base.h: + +/usr/include/c++/4.7/bits/locale_classes.h: + +/usr/include/c++/4.7/bits/locale_classes.tcc: + +/usr/include/c++/4.7/streambuf: + +/usr/include/c++/4.7/bits/streambuf.tcc: + +/usr/include/c++/4.7/bits/basic_ios.h: + +/usr/include/c++/4.7/bits/locale_facets.h: + +/usr/include/c++/4.7/cwctype: + +/usr/include/wctype.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h: + +/usr/include/c++/4.7/bits/streambuf_iterator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h: + +/usr/include/c++/4.7/bits/locale_facets.tcc: + +/usr/include/c++/4.7/bits/basic_ios.tcc: + +/usr/include/c++/4.7/ostream: + +/usr/include/c++/4.7/bits/ostream.tcc: + +/usr/include/c++/4.7/bits/istream.tcc: + +/usr/include/c++/4.7/bits/sstream.tcc: + +zm_coord.h: + +zm_image.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/string.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +zm_zone.h: + +zm_event.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/sys/stat.h: + +/usr/include/x86_64-linux-gnu/bits/stat.h: + +/usr/include/c++/4.7/set: + +/usr/include/c++/4.7/bits/stl_set.h: + +/usr/include/c++/4.7/bits/stl_multiset.h: + +zm_stream.h: + +/usr/include/x86_64-linux-gnu/sys/un.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +zm_mpeg.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/inttypes.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: + +zm_camera.h: + +/usr/include/x86_64-linux-gnu/sys/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctls.h: + +/usr/include/x86_64-linux-gnu/asm/ioctls.h: + +/usr/include/asm-generic/ioctls.h: + +/usr/include/linux/ioctl.h: + +/usr/include/x86_64-linux-gnu/asm/ioctl.h: + +/usr/include/asm-generic/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctl-types.h: + +/usr/include/x86_64-linux-gnu/sys/ttydefaults.h: + +zm_plugin_manager.h: + +/usr/include/x86_64-linux-gnu/sys/dir.h: + +/usr/include/dirent.h: + +/usr/include/x86_64-linux-gnu/bits/dirent.h: + +/usr/include/x86_64-linux-gnu/sys/param.h: + +/usr/include/linux/param.h: + +/usr/include/x86_64-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +zm_image_analyser.h: + +/usr/include/c++/4.7/list: + +/usr/include/c++/4.7/bits/stl_list.h: + +/usr/include/c++/4.7/bits/list.tcc: + +/usr/include/c++/4.7/stdexcept: + +/usr/include/c++/4.7/iostream: + +/usr/include/c++/4.7/memory: + +/usr/include/c++/4.7/bits/stl_tempbuf.h: + +/usr/include/c++/4.7/bits/stl_raw_storage_iter.h: + +/usr/include/c++/4.7/backward/auto_ptr.h: + +zm_detector.h: + +/usr/include/syslog.h: + +/usr/include/x86_64-linux-gnu/sys/syslog.h: + +/usr/include/x86_64-linux-gnu/bits/syslog-path.h: + +/usr/include/libgen.h: + +zm_plugin.h: + +/usr/include/dlfcn.h: + +/usr/include/x86_64-linux-gnu/bits/dlfcn.h: diff --git a/src/.deps/zmc.Po b/src/.deps/zmc.Po new file mode 100644 index 000000000..311cdfb36 --- /dev/null +++ b/src/.deps/zmc.Po @@ -0,0 +1,726 @@ +zmc.o: zmc.cpp /usr/include/getopt.h /usr/include/ctype.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h /usr/include/xlocale.h \ + /usr/include/signal.h /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/bits/signum.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/sigaction.h \ + /usr/include/x86_64-linux-gnu/bits/sigcontext.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/x86_64-linux-gnu/bits/sigstack.h \ + /usr/include/x86_64-linux-gnu/sys/ucontext.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/sigthread.h /usr/include/values.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/float.h zm.h zm_config.h \ + ../config.h zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/c++/4.7/map \ + /usr/include/c++/4.7/bits/stl_tree.h /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_db.h zm_time.h /usr/include/x86_64-linux-gnu/sys/time.h zm_signal.h \ + /usr/include/execinfo.h zm_monitor.h /usr/include/c++/4.7/vector \ + /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/c++/4.7/sstream \ + /usr/include/c++/4.7/istream /usr/include/c++/4.7/ios \ + /usr/include/c++/4.7/bits/ios_base.h \ + /usr/include/c++/4.7/bits/locale_classes.h \ + /usr/include/c++/4.7/bits/locale_classes.tcc \ + /usr/include/c++/4.7/streambuf /usr/include/c++/4.7/bits/streambuf.tcc \ + /usr/include/c++/4.7/bits/basic_ios.h \ + /usr/include/c++/4.7/bits/locale_facets.h /usr/include/c++/4.7/cwctype \ + /usr/include/wctype.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h \ + /usr/include/c++/4.7/bits/streambuf_iterator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h \ + /usr/include/c++/4.7/bits/locale_facets.tcc \ + /usr/include/c++/4.7/bits/basic_ios.tcc /usr/include/c++/4.7/ostream \ + /usr/include/c++/4.7/bits/ostream.tcc \ + /usr/include/c++/4.7/bits/istream.tcc \ + /usr/include/c++/4.7/bits/sstream.tcc zm_coord.h zm_image.h zm_jpeg.h \ + /usr/include/setjmp.h jinclude.h /root/zm/libjpeg-turbo-1.2.1/jconfig.h \ + /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/string.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_box.h \ + /usr/include/math.h /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h zm_poly.h zm_mem_utils.h \ + zm_utils.h /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/zlib.h /usr/include/zconf.h zm_zone.h zm_event.h \ + /usr/include/x86_64-linux-gnu/sys/stat.h \ + /usr/include/x86_64-linux-gnu/bits/stat.h /usr/include/c++/4.7/set \ + /usr/include/c++/4.7/bits/stl_set.h \ + /usr/include/c++/4.7/bits/stl_multiset.h zm_stream.h \ + /usr/include/x86_64-linux-gnu/sys/un.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h zm_mpeg.h zm_ffmpeg.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/inttypes.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/avconfig.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h zm_camera.h \ + /usr/include/x86_64-linux-gnu/sys/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctls.h \ + /usr/include/x86_64-linux-gnu/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/x86_64-linux-gnu/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctl-types.h \ + /usr/include/x86_64-linux-gnu/sys/ttydefaults.h zm_plugin_manager.h \ + /usr/include/x86_64-linux-gnu/sys/dir.h /usr/include/dirent.h \ + /usr/include/x86_64-linux-gnu/bits/dirent.h \ + /usr/include/x86_64-linux-gnu/sys/param.h /usr/include/linux/param.h \ + /usr/include/x86_64-linux-gnu/asm/param.h \ + /usr/include/asm-generic/param.h zm_image_analyser.h \ + /usr/include/c++/4.7/list /usr/include/c++/4.7/bits/stl_list.h \ + /usr/include/c++/4.7/bits/list.tcc /usr/include/c++/4.7/stdexcept \ + /usr/include/c++/4.7/iostream /usr/include/c++/4.7/memory \ + /usr/include/c++/4.7/bits/stl_tempbuf.h \ + /usr/include/c++/4.7/bits/stl_raw_storage_iter.h \ + /usr/include/c++/4.7/backward/auto_ptr.h zm_detector.h \ + /usr/include/syslog.h /usr/include/x86_64-linux-gnu/sys/syslog.h \ + /usr/include/x86_64-linux-gnu/bits/syslog-path.h /usr/include/libgen.h \ + zm_plugin.h /usr/include/dlfcn.h \ + /usr/include/x86_64-linux-gnu/bits/dlfcn.h + +/usr/include/getopt.h: + +/usr/include/ctype.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/xlocale.h: + +/usr/include/signal.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/bits/signum.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/sigaction.h: + +/usr/include/x86_64-linux-gnu/bits/sigcontext.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/x86_64-linux-gnu/bits/sigstack.h: + +/usr/include/x86_64-linux-gnu/sys/ucontext.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/sigthread.h: + +/usr/include/values.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/float.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_db.h: + +zm_time.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +zm_signal.h: + +/usr/include/execinfo.h: + +zm_monitor.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/c++/4.7/sstream: + +/usr/include/c++/4.7/istream: + +/usr/include/c++/4.7/ios: + +/usr/include/c++/4.7/bits/ios_base.h: + +/usr/include/c++/4.7/bits/locale_classes.h: + +/usr/include/c++/4.7/bits/locale_classes.tcc: + +/usr/include/c++/4.7/streambuf: + +/usr/include/c++/4.7/bits/streambuf.tcc: + +/usr/include/c++/4.7/bits/basic_ios.h: + +/usr/include/c++/4.7/bits/locale_facets.h: + +/usr/include/c++/4.7/cwctype: + +/usr/include/wctype.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h: + +/usr/include/c++/4.7/bits/streambuf_iterator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h: + +/usr/include/c++/4.7/bits/locale_facets.tcc: + +/usr/include/c++/4.7/bits/basic_ios.tcc: + +/usr/include/c++/4.7/ostream: + +/usr/include/c++/4.7/bits/ostream.tcc: + +/usr/include/c++/4.7/bits/istream.tcc: + +/usr/include/c++/4.7/bits/sstream.tcc: + +zm_coord.h: + +zm_image.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/string.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +zm_zone.h: + +zm_event.h: + +/usr/include/x86_64-linux-gnu/sys/stat.h: + +/usr/include/x86_64-linux-gnu/bits/stat.h: + +/usr/include/c++/4.7/set: + +/usr/include/c++/4.7/bits/stl_set.h: + +/usr/include/c++/4.7/bits/stl_multiset.h: + +zm_stream.h: + +/usr/include/x86_64-linux-gnu/sys/un.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +zm_mpeg.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/inttypes.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: + +zm_camera.h: + +/usr/include/x86_64-linux-gnu/sys/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctls.h: + +/usr/include/x86_64-linux-gnu/asm/ioctls.h: + +/usr/include/asm-generic/ioctls.h: + +/usr/include/linux/ioctl.h: + +/usr/include/x86_64-linux-gnu/asm/ioctl.h: + +/usr/include/asm-generic/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctl-types.h: + +/usr/include/x86_64-linux-gnu/sys/ttydefaults.h: + +zm_plugin_manager.h: + +/usr/include/x86_64-linux-gnu/sys/dir.h: + +/usr/include/dirent.h: + +/usr/include/x86_64-linux-gnu/bits/dirent.h: + +/usr/include/x86_64-linux-gnu/sys/param.h: + +/usr/include/linux/param.h: + +/usr/include/x86_64-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +zm_image_analyser.h: + +/usr/include/c++/4.7/list: + +/usr/include/c++/4.7/bits/stl_list.h: + +/usr/include/c++/4.7/bits/list.tcc: + +/usr/include/c++/4.7/stdexcept: + +/usr/include/c++/4.7/iostream: + +/usr/include/c++/4.7/memory: + +/usr/include/c++/4.7/bits/stl_tempbuf.h: + +/usr/include/c++/4.7/bits/stl_raw_storage_iter.h: + +/usr/include/c++/4.7/backward/auto_ptr.h: + +zm_detector.h: + +/usr/include/syslog.h: + +/usr/include/x86_64-linux-gnu/sys/syslog.h: + +/usr/include/x86_64-linux-gnu/bits/syslog-path.h: + +/usr/include/libgen.h: + +zm_plugin.h: + +/usr/include/dlfcn.h: + +/usr/include/x86_64-linux-gnu/bits/dlfcn.h: diff --git a/src/.deps/zmf.Po b/src/.deps/zmf.Po new file mode 100644 index 000000000..cc2a60300 --- /dev/null +++ b/src/.deps/zmf.Po @@ -0,0 +1,722 @@ +zmf.o: zmf.cpp /usr/include/stdio.h /usr/include/features.h \ + /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h /usr/include/xlocale.h \ + /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/x86_64-linux-gnu/sys/time.h /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h \ + /usr/include/x86_64-linux-gnu/sys/un.h /usr/include/string.h \ + /usr/include/signal.h /usr/include/x86_64-linux-gnu/bits/signum.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/sigaction.h \ + /usr/include/x86_64-linux-gnu/bits/sigcontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigstack.h \ + /usr/include/x86_64-linux-gnu/sys/ucontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigthread.h zm.h zm_config.h \ + ../config.h zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_db.h zm_signal.h /usr/include/execinfo.h zm_monitor.h \ + /usr/include/c++/4.7/vector /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/c++/4.7/sstream \ + /usr/include/c++/4.7/istream /usr/include/c++/4.7/ios \ + /usr/include/c++/4.7/bits/ios_base.h \ + /usr/include/c++/4.7/bits/locale_classes.h \ + /usr/include/c++/4.7/bits/locale_classes.tcc \ + /usr/include/c++/4.7/streambuf /usr/include/c++/4.7/bits/streambuf.tcc \ + /usr/include/c++/4.7/bits/basic_ios.h \ + /usr/include/c++/4.7/bits/locale_facets.h /usr/include/c++/4.7/cwctype \ + /usr/include/wctype.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h \ + /usr/include/c++/4.7/bits/streambuf_iterator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h \ + /usr/include/c++/4.7/bits/locale_facets.tcc \ + /usr/include/c++/4.7/bits/basic_ios.tcc /usr/include/c++/4.7/ostream \ + /usr/include/c++/4.7/bits/ostream.tcc \ + /usr/include/c++/4.7/bits/istream.tcc \ + /usr/include/c++/4.7/bits/sstream.tcc zm_coord.h zm_image.h zm_jpeg.h \ + /usr/include/setjmp.h jinclude.h /root/zm/libjpeg-turbo-1.2.1/jconfig.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_box.h \ + /usr/include/math.h /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h zm_poly.h zm_mem_utils.h \ + zm_utils.h /usr/include/zlib.h /usr/include/zconf.h zm_zone.h zm_event.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/sys/stat.h \ + /usr/include/x86_64-linux-gnu/bits/stat.h /usr/include/c++/4.7/set \ + /usr/include/c++/4.7/bits/stl_set.h \ + /usr/include/c++/4.7/bits/stl_multiset.h zm_stream.h zm_mpeg.h \ + zm_ffmpeg.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/common.h /usr/include/inttypes.h \ + /usr/include/libavutil/attributes.h /usr/include/libavutil/avconfig.h \ + /usr/include/libavutil/mem.h /usr/include/libavutil/error.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/mathematics.h \ + /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h zm_camera.h \ + /usr/include/x86_64-linux-gnu/sys/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctls.h \ + /usr/include/x86_64-linux-gnu/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/x86_64-linux-gnu/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctl-types.h \ + /usr/include/x86_64-linux-gnu/sys/ttydefaults.h zm_plugin_manager.h \ + /usr/include/x86_64-linux-gnu/sys/dir.h /usr/include/dirent.h \ + /usr/include/x86_64-linux-gnu/bits/dirent.h \ + /usr/include/x86_64-linux-gnu/sys/param.h /usr/include/linux/param.h \ + /usr/include/x86_64-linux-gnu/asm/param.h \ + /usr/include/asm-generic/param.h zm_image_analyser.h \ + /usr/include/c++/4.7/list /usr/include/c++/4.7/bits/stl_list.h \ + /usr/include/c++/4.7/bits/list.tcc /usr/include/c++/4.7/stdexcept \ + /usr/include/c++/4.7/iostream /usr/include/c++/4.7/memory \ + /usr/include/c++/4.7/bits/stl_tempbuf.h \ + /usr/include/c++/4.7/bits/stl_raw_storage_iter.h \ + /usr/include/c++/4.7/backward/auto_ptr.h zm_detector.h \ + /usr/include/syslog.h /usr/include/x86_64-linux-gnu/sys/syslog.h \ + /usr/include/x86_64-linux-gnu/bits/syslog-path.h /usr/include/libgen.h \ + zm_plugin.h /usr/include/dlfcn.h \ + /usr/include/x86_64-linux-gnu/bits/dlfcn.h zmf.h + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/xlocale.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/x86_64-linux-gnu/sys/un.h: + +/usr/include/string.h: + +/usr/include/signal.h: + +/usr/include/x86_64-linux-gnu/bits/signum.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/sigaction.h: + +/usr/include/x86_64-linux-gnu/bits/sigcontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigstack.h: + +/usr/include/x86_64-linux-gnu/sys/ucontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigthread.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_db.h: + +zm_signal.h: + +/usr/include/execinfo.h: + +zm_monitor.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/c++/4.7/sstream: + +/usr/include/c++/4.7/istream: + +/usr/include/c++/4.7/ios: + +/usr/include/c++/4.7/bits/ios_base.h: + +/usr/include/c++/4.7/bits/locale_classes.h: + +/usr/include/c++/4.7/bits/locale_classes.tcc: + +/usr/include/c++/4.7/streambuf: + +/usr/include/c++/4.7/bits/streambuf.tcc: + +/usr/include/c++/4.7/bits/basic_ios.h: + +/usr/include/c++/4.7/bits/locale_facets.h: + +/usr/include/c++/4.7/cwctype: + +/usr/include/wctype.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h: + +/usr/include/c++/4.7/bits/streambuf_iterator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h: + +/usr/include/c++/4.7/bits/locale_facets.tcc: + +/usr/include/c++/4.7/bits/basic_ios.tcc: + +/usr/include/c++/4.7/ostream: + +/usr/include/c++/4.7/bits/ostream.tcc: + +/usr/include/c++/4.7/bits/istream.tcc: + +/usr/include/c++/4.7/bits/sstream.tcc: + +zm_coord.h: + +zm_image.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +zm_zone.h: + +zm_event.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/sys/stat.h: + +/usr/include/x86_64-linux-gnu/bits/stat.h: + +/usr/include/c++/4.7/set: + +/usr/include/c++/4.7/bits/stl_set.h: + +/usr/include/c++/4.7/bits/stl_multiset.h: + +zm_stream.h: + +zm_mpeg.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/inttypes.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: + +zm_camera.h: + +/usr/include/x86_64-linux-gnu/sys/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctls.h: + +/usr/include/x86_64-linux-gnu/asm/ioctls.h: + +/usr/include/asm-generic/ioctls.h: + +/usr/include/linux/ioctl.h: + +/usr/include/x86_64-linux-gnu/asm/ioctl.h: + +/usr/include/asm-generic/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctl-types.h: + +/usr/include/x86_64-linux-gnu/sys/ttydefaults.h: + +zm_plugin_manager.h: + +/usr/include/x86_64-linux-gnu/sys/dir.h: + +/usr/include/dirent.h: + +/usr/include/x86_64-linux-gnu/bits/dirent.h: + +/usr/include/x86_64-linux-gnu/sys/param.h: + +/usr/include/linux/param.h: + +/usr/include/x86_64-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +zm_image_analyser.h: + +/usr/include/c++/4.7/list: + +/usr/include/c++/4.7/bits/stl_list.h: + +/usr/include/c++/4.7/bits/list.tcc: + +/usr/include/c++/4.7/stdexcept: + +/usr/include/c++/4.7/iostream: + +/usr/include/c++/4.7/memory: + +/usr/include/c++/4.7/bits/stl_tempbuf.h: + +/usr/include/c++/4.7/bits/stl_raw_storage_iter.h: + +/usr/include/c++/4.7/backward/auto_ptr.h: + +zm_detector.h: + +/usr/include/syslog.h: + +/usr/include/x86_64-linux-gnu/sys/syslog.h: + +/usr/include/x86_64-linux-gnu/bits/syslog-path.h: + +/usr/include/libgen.h: + +zm_plugin.h: + +/usr/include/dlfcn.h: + +/usr/include/x86_64-linux-gnu/bits/dlfcn.h: + +zmf.h: diff --git a/src/.deps/zmfix.Po b/src/.deps/zmfix.Po new file mode 100644 index 000000000..28075c479 --- /dev/null +++ b/src/.deps/zmfix.Po @@ -0,0 +1,347 @@ +zmfix.o: zmfix.cpp /usr/include/stdio.h /usr/include/features.h \ + /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h /usr/include/xlocale.h \ + /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/unistd.h \ + /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/errno.h /usr/include/x86_64-linux-gnu/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/fcntl.h /usr/include/x86_64-linux-gnu/bits/fcntl.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/stat.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/sys/stat.h /usr/include/mysql/mysql.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h zm.h \ + zm_config.h ../config.h zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_db.h + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/xlocale.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/fcntl.h: + +/usr/include/x86_64-linux-gnu/bits/fcntl.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/stat.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/sys/stat.h: + +/usr/include/mysql/mysql.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_db.h: diff --git a/src/.deps/zms.Po b/src/.deps/zms.Po new file mode 100644 index 000000000..7d3f75494 --- /dev/null +++ b/src/.deps/zms.Po @@ -0,0 +1,754 @@ +zms.o: zms.cpp /usr/include/x86_64-linux-gnu/sys/ipc.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/x86_64-linux-gnu/bits/ipctypes.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h \ + /usr/include/x86_64-linux-gnu/bits/ipc.h \ + /usr/include/x86_64-linux-gnu/sys/msg.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/x86_64-linux-gnu/bits/msq.h /usr/include/time.h zm.h \ + zm_config.h ../config.h zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h /usr/include/xlocale.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_db.h zm_user.h /usr/include/gnutls/openssl.h \ + /usr/include/gnutls/gnutls.h /usr/include/gnutls/compat.h \ + /usr/include/gcrypt.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/gpg-error.h \ + /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h \ + /usr/include/x86_64-linux-gnu/sys/time.h /usr/include/gcrypt-module.h \ + zm_signal.h /usr/include/signal.h \ + /usr/include/x86_64-linux-gnu/bits/signum.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/sigaction.h \ + /usr/include/x86_64-linux-gnu/bits/sigcontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigstack.h \ + /usr/include/x86_64-linux-gnu/sys/ucontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigthread.h /usr/include/execinfo.h \ + zm_monitor.h /usr/include/c++/4.7/vector \ + /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/c++/4.7/sstream \ + /usr/include/c++/4.7/istream /usr/include/c++/4.7/ios \ + /usr/include/c++/4.7/bits/ios_base.h \ + /usr/include/c++/4.7/bits/locale_classes.h \ + /usr/include/c++/4.7/bits/locale_classes.tcc \ + /usr/include/c++/4.7/streambuf /usr/include/c++/4.7/bits/streambuf.tcc \ + /usr/include/c++/4.7/bits/basic_ios.h \ + /usr/include/c++/4.7/bits/locale_facets.h /usr/include/c++/4.7/cwctype \ + /usr/include/wctype.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h \ + /usr/include/c++/4.7/bits/streambuf_iterator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h \ + /usr/include/c++/4.7/bits/locale_facets.tcc \ + /usr/include/c++/4.7/bits/basic_ios.tcc /usr/include/c++/4.7/ostream \ + /usr/include/c++/4.7/bits/ostream.tcc \ + /usr/include/c++/4.7/bits/istream.tcc \ + /usr/include/c++/4.7/bits/sstream.tcc zm_coord.h zm_image.h zm_jpeg.h \ + /usr/include/setjmp.h jinclude.h /root/zm/libjpeg-turbo-1.2.1/jconfig.h \ + /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_box.h \ + /usr/include/math.h /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h zm_poly.h zm_mem_utils.h \ + zm_utils.h /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/zlib.h /usr/include/zconf.h zm_zone.h zm_event.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/sys/stat.h \ + /usr/include/x86_64-linux-gnu/bits/stat.h /usr/include/c++/4.7/set \ + /usr/include/c++/4.7/bits/stl_set.h \ + /usr/include/c++/4.7/bits/stl_multiset.h zm_stream.h \ + /usr/include/x86_64-linux-gnu/sys/un.h zm_mpeg.h zm_ffmpeg.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/inttypes.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/avconfig.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h zm_camera.h \ + /usr/include/x86_64-linux-gnu/sys/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctls.h \ + /usr/include/x86_64-linux-gnu/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/x86_64-linux-gnu/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctl-types.h \ + /usr/include/x86_64-linux-gnu/sys/ttydefaults.h zm_plugin_manager.h \ + /usr/include/x86_64-linux-gnu/sys/dir.h /usr/include/dirent.h \ + /usr/include/x86_64-linux-gnu/bits/dirent.h \ + /usr/include/x86_64-linux-gnu/sys/param.h /usr/include/linux/param.h \ + /usr/include/x86_64-linux-gnu/asm/param.h \ + /usr/include/asm-generic/param.h zm_image_analyser.h \ + /usr/include/c++/4.7/list /usr/include/c++/4.7/bits/stl_list.h \ + /usr/include/c++/4.7/bits/list.tcc /usr/include/c++/4.7/stdexcept \ + /usr/include/c++/4.7/iostream /usr/include/c++/4.7/memory \ + /usr/include/c++/4.7/bits/stl_tempbuf.h \ + /usr/include/c++/4.7/bits/stl_raw_storage_iter.h \ + /usr/include/c++/4.7/backward/auto_ptr.h zm_detector.h \ + /usr/include/syslog.h /usr/include/x86_64-linux-gnu/sys/syslog.h \ + /usr/include/x86_64-linux-gnu/bits/syslog-path.h /usr/include/libgen.h \ + zm_plugin.h /usr/include/dlfcn.h \ + /usr/include/x86_64-linux-gnu/bits/dlfcn.h + +/usr/include/x86_64-linux-gnu/sys/ipc.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/x86_64-linux-gnu/bits/ipctypes.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/x86_64-linux-gnu/bits/ipc.h: + +/usr/include/x86_64-linux-gnu/sys/msg.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/x86_64-linux-gnu/bits/msq.h: + +/usr/include/time.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_db.h: + +zm_user.h: + +/usr/include/gnutls/openssl.h: + +/usr/include/gnutls/gnutls.h: + +/usr/include/gnutls/compat.h: + +/usr/include/gcrypt.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/gpg-error.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/gcrypt-module.h: + +zm_signal.h: + +/usr/include/signal.h: + +/usr/include/x86_64-linux-gnu/bits/signum.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/sigaction.h: + +/usr/include/x86_64-linux-gnu/bits/sigcontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigstack.h: + +/usr/include/x86_64-linux-gnu/sys/ucontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigthread.h: + +/usr/include/execinfo.h: + +zm_monitor.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/c++/4.7/sstream: + +/usr/include/c++/4.7/istream: + +/usr/include/c++/4.7/ios: + +/usr/include/c++/4.7/bits/ios_base.h: + +/usr/include/c++/4.7/bits/locale_classes.h: + +/usr/include/c++/4.7/bits/locale_classes.tcc: + +/usr/include/c++/4.7/streambuf: + +/usr/include/c++/4.7/bits/streambuf.tcc: + +/usr/include/c++/4.7/bits/basic_ios.h: + +/usr/include/c++/4.7/bits/locale_facets.h: + +/usr/include/c++/4.7/cwctype: + +/usr/include/wctype.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h: + +/usr/include/c++/4.7/bits/streambuf_iterator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h: + +/usr/include/c++/4.7/bits/locale_facets.tcc: + +/usr/include/c++/4.7/bits/basic_ios.tcc: + +/usr/include/c++/4.7/ostream: + +/usr/include/c++/4.7/bits/ostream.tcc: + +/usr/include/c++/4.7/bits/istream.tcc: + +/usr/include/c++/4.7/bits/sstream.tcc: + +zm_coord.h: + +zm_image.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +zm_zone.h: + +zm_event.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/sys/stat.h: + +/usr/include/x86_64-linux-gnu/bits/stat.h: + +/usr/include/c++/4.7/set: + +/usr/include/c++/4.7/bits/stl_set.h: + +/usr/include/c++/4.7/bits/stl_multiset.h: + +zm_stream.h: + +/usr/include/x86_64-linux-gnu/sys/un.h: + +zm_mpeg.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/inttypes.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: + +zm_camera.h: + +/usr/include/x86_64-linux-gnu/sys/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctls.h: + +/usr/include/x86_64-linux-gnu/asm/ioctls.h: + +/usr/include/asm-generic/ioctls.h: + +/usr/include/linux/ioctl.h: + +/usr/include/x86_64-linux-gnu/asm/ioctl.h: + +/usr/include/asm-generic/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctl-types.h: + +/usr/include/x86_64-linux-gnu/sys/ttydefaults.h: + +zm_plugin_manager.h: + +/usr/include/x86_64-linux-gnu/sys/dir.h: + +/usr/include/dirent.h: + +/usr/include/x86_64-linux-gnu/bits/dirent.h: + +/usr/include/x86_64-linux-gnu/sys/param.h: + +/usr/include/linux/param.h: + +/usr/include/x86_64-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +zm_image_analyser.h: + +/usr/include/c++/4.7/list: + +/usr/include/c++/4.7/bits/stl_list.h: + +/usr/include/c++/4.7/bits/list.tcc: + +/usr/include/c++/4.7/stdexcept: + +/usr/include/c++/4.7/iostream: + +/usr/include/c++/4.7/memory: + +/usr/include/c++/4.7/bits/stl_tempbuf.h: + +/usr/include/c++/4.7/bits/stl_raw_storage_iter.h: + +/usr/include/c++/4.7/backward/auto_ptr.h: + +zm_detector.h: + +/usr/include/syslog.h: + +/usr/include/x86_64-linux-gnu/sys/syslog.h: + +/usr/include/x86_64-linux-gnu/bits/syslog-path.h: + +/usr/include/libgen.h: + +zm_plugin.h: + +/usr/include/dlfcn.h: + +/usr/include/x86_64-linux-gnu/bits/dlfcn.h: diff --git a/src/.deps/zmstreamer.Po b/src/.deps/zmstreamer.Po new file mode 100644 index 000000000..0d72970cf --- /dev/null +++ b/src/.deps/zmstreamer.Po @@ -0,0 +1,753 @@ +zmstreamer.o: zmstreamer.cpp /usr/include/stdio.h /usr/include/features.h \ + /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h /usr/include/xlocale.h \ + /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/x86_64-linux-gnu/sys/ipc.h \ + /usr/include/x86_64-linux-gnu/bits/ipctypes.h \ + /usr/include/x86_64-linux-gnu/bits/ipc.h \ + /usr/include/x86_64-linux-gnu/sys/msg.h \ + /usr/include/x86_64-linux-gnu/bits/msq.h zm.h zm_config.h ../config.h \ + zm_config_defines.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/ctype.h \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/c++/4.7/map /usr/include/c++/4.7/bits/stl_tree.h \ + /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_db.h zm_user.h /usr/include/gnutls/openssl.h \ + /usr/include/gnutls/gnutls.h /usr/include/gnutls/compat.h \ + /usr/include/gcrypt.h /usr/include/string.h /usr/include/gpg-error.h \ + /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h \ + /usr/include/x86_64-linux-gnu/sys/time.h /usr/include/gcrypt-module.h \ + zm_signal.h /usr/include/signal.h \ + /usr/include/x86_64-linux-gnu/bits/signum.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/sigaction.h \ + /usr/include/x86_64-linux-gnu/bits/sigcontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigstack.h \ + /usr/include/x86_64-linux-gnu/sys/ucontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigthread.h /usr/include/execinfo.h \ + zm_monitor.h /usr/include/c++/4.7/vector \ + /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/c++/4.7/sstream \ + /usr/include/c++/4.7/istream /usr/include/c++/4.7/ios \ + /usr/include/c++/4.7/bits/ios_base.h \ + /usr/include/c++/4.7/bits/locale_classes.h \ + /usr/include/c++/4.7/bits/locale_classes.tcc \ + /usr/include/c++/4.7/streambuf /usr/include/c++/4.7/bits/streambuf.tcc \ + /usr/include/c++/4.7/bits/basic_ios.h \ + /usr/include/c++/4.7/bits/locale_facets.h /usr/include/c++/4.7/cwctype \ + /usr/include/wctype.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h \ + /usr/include/c++/4.7/bits/streambuf_iterator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h \ + /usr/include/c++/4.7/bits/locale_facets.tcc \ + /usr/include/c++/4.7/bits/basic_ios.tcc /usr/include/c++/4.7/ostream \ + /usr/include/c++/4.7/bits/ostream.tcc \ + /usr/include/c++/4.7/bits/istream.tcc \ + /usr/include/c++/4.7/bits/sstream.tcc zm_coord.h zm_image.h zm_jpeg.h \ + /usr/include/setjmp.h jinclude.h /root/zm/libjpeg-turbo-1.2.1/jconfig.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_box.h \ + /usr/include/math.h /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h zm_poly.h zm_mem_utils.h \ + zm_utils.h /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/zlib.h /usr/include/zconf.h zm_zone.h zm_event.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/sys/stat.h \ + /usr/include/x86_64-linux-gnu/bits/stat.h /usr/include/c++/4.7/set \ + /usr/include/c++/4.7/bits/stl_set.h \ + /usr/include/c++/4.7/bits/stl_multiset.h zm_stream.h \ + /usr/include/x86_64-linux-gnu/sys/un.h zm_mpeg.h zm_ffmpeg.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/inttypes.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/avconfig.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h zm_camera.h \ + /usr/include/x86_64-linux-gnu/sys/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctls.h \ + /usr/include/x86_64-linux-gnu/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/x86_64-linux-gnu/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctl-types.h \ + /usr/include/x86_64-linux-gnu/sys/ttydefaults.h zm_plugin_manager.h \ + /usr/include/x86_64-linux-gnu/sys/dir.h /usr/include/dirent.h \ + /usr/include/x86_64-linux-gnu/bits/dirent.h \ + /usr/include/x86_64-linux-gnu/sys/param.h /usr/include/linux/param.h \ + /usr/include/x86_64-linux-gnu/asm/param.h \ + /usr/include/asm-generic/param.h zm_image_analyser.h \ + /usr/include/c++/4.7/list /usr/include/c++/4.7/bits/stl_list.h \ + /usr/include/c++/4.7/bits/list.tcc /usr/include/c++/4.7/stdexcept \ + /usr/include/c++/4.7/iostream /usr/include/c++/4.7/memory \ + /usr/include/c++/4.7/bits/stl_tempbuf.h \ + /usr/include/c++/4.7/bits/stl_raw_storage_iter.h \ + /usr/include/c++/4.7/backward/auto_ptr.h zm_detector.h \ + /usr/include/syslog.h /usr/include/x86_64-linux-gnu/sys/syslog.h \ + /usr/include/x86_64-linux-gnu/bits/syslog-path.h /usr/include/libgen.h \ + zm_plugin.h /usr/include/dlfcn.h \ + /usr/include/x86_64-linux-gnu/bits/dlfcn.h + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/xlocale.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/x86_64-linux-gnu/sys/ipc.h: + +/usr/include/x86_64-linux-gnu/bits/ipctypes.h: + +/usr/include/x86_64-linux-gnu/bits/ipc.h: + +/usr/include/x86_64-linux-gnu/sys/msg.h: + +/usr/include/x86_64-linux-gnu/bits/msq.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_db.h: + +zm_user.h: + +/usr/include/gnutls/openssl.h: + +/usr/include/gnutls/gnutls.h: + +/usr/include/gnutls/compat.h: + +/usr/include/gcrypt.h: + +/usr/include/string.h: + +/usr/include/gpg-error.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/gcrypt-module.h: + +zm_signal.h: + +/usr/include/signal.h: + +/usr/include/x86_64-linux-gnu/bits/signum.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/sigaction.h: + +/usr/include/x86_64-linux-gnu/bits/sigcontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigstack.h: + +/usr/include/x86_64-linux-gnu/sys/ucontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigthread.h: + +/usr/include/execinfo.h: + +zm_monitor.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/c++/4.7/sstream: + +/usr/include/c++/4.7/istream: + +/usr/include/c++/4.7/ios: + +/usr/include/c++/4.7/bits/ios_base.h: + +/usr/include/c++/4.7/bits/locale_classes.h: + +/usr/include/c++/4.7/bits/locale_classes.tcc: + +/usr/include/c++/4.7/streambuf: + +/usr/include/c++/4.7/bits/streambuf.tcc: + +/usr/include/c++/4.7/bits/basic_ios.h: + +/usr/include/c++/4.7/bits/locale_facets.h: + +/usr/include/c++/4.7/cwctype: + +/usr/include/wctype.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h: + +/usr/include/c++/4.7/bits/streambuf_iterator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h: + +/usr/include/c++/4.7/bits/locale_facets.tcc: + +/usr/include/c++/4.7/bits/basic_ios.tcc: + +/usr/include/c++/4.7/ostream: + +/usr/include/c++/4.7/bits/ostream.tcc: + +/usr/include/c++/4.7/bits/istream.tcc: + +/usr/include/c++/4.7/bits/sstream.tcc: + +zm_coord.h: + +zm_image.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +zm_zone.h: + +zm_event.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/sys/stat.h: + +/usr/include/x86_64-linux-gnu/bits/stat.h: + +/usr/include/c++/4.7/set: + +/usr/include/c++/4.7/bits/stl_set.h: + +/usr/include/c++/4.7/bits/stl_multiset.h: + +zm_stream.h: + +/usr/include/x86_64-linux-gnu/sys/un.h: + +zm_mpeg.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/inttypes.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: + +zm_camera.h: + +/usr/include/x86_64-linux-gnu/sys/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctls.h: + +/usr/include/x86_64-linux-gnu/asm/ioctls.h: + +/usr/include/asm-generic/ioctls.h: + +/usr/include/linux/ioctl.h: + +/usr/include/x86_64-linux-gnu/asm/ioctl.h: + +/usr/include/asm-generic/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctl-types.h: + +/usr/include/x86_64-linux-gnu/sys/ttydefaults.h: + +zm_plugin_manager.h: + +/usr/include/x86_64-linux-gnu/sys/dir.h: + +/usr/include/dirent.h: + +/usr/include/x86_64-linux-gnu/bits/dirent.h: + +/usr/include/x86_64-linux-gnu/sys/param.h: + +/usr/include/linux/param.h: + +/usr/include/x86_64-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +zm_image_analyser.h: + +/usr/include/c++/4.7/list: + +/usr/include/c++/4.7/bits/stl_list.h: + +/usr/include/c++/4.7/bits/list.tcc: + +/usr/include/c++/4.7/stdexcept: + +/usr/include/c++/4.7/iostream: + +/usr/include/c++/4.7/memory: + +/usr/include/c++/4.7/bits/stl_tempbuf.h: + +/usr/include/c++/4.7/bits/stl_raw_storage_iter.h: + +/usr/include/c++/4.7/backward/auto_ptr.h: + +zm_detector.h: + +/usr/include/syslog.h: + +/usr/include/x86_64-linux-gnu/sys/syslog.h: + +/usr/include/x86_64-linux-gnu/bits/syslog-path.h: + +/usr/include/libgen.h: + +zm_plugin.h: + +/usr/include/dlfcn.h: + +/usr/include/x86_64-linux-gnu/bits/dlfcn.h: diff --git a/src/.deps/zmu.Po b/src/.deps/zmu.Po new file mode 100644 index 000000000..9608d5ee1 --- /dev/null +++ b/src/.deps/zmu.Po @@ -0,0 +1,771 @@ +zmu.o: zmu.cpp /usr/include/getopt.h /usr/include/ctype.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h /usr/include/xlocale.h \ + zm.h zm_config.h ../config.h zm_config_defines.h \ + /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/postypes.h \ + /usr/include/c++/4.7/cwchar /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/iosfwd \ + /usr/include/c++/4.7/cctype /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/basic_string.tcc zm_logger.h \ + /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ + /usr/include/x86_64-linux-gnu/bits/environments.h \ + /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/c++/4.7/map \ + /usr/include/c++/4.7/bits/stl_tree.h /usr/include/c++/4.7/bits/stl_map.h \ + /usr/include/c++/4.7/bits/stl_multimap.h /usr/include/mysql/mysql.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/mysql/mysql_version.h /usr/include/mysql/mysql_com.h \ + /usr/include/mysql/mysql_time.h /usr/include/mysql/my_list.h \ + /usr/include/mysql/typelib.h /usr/include/mysql/my_alloc.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ + zm_db.h zm_user.h /usr/include/gnutls/openssl.h \ + /usr/include/gnutls/gnutls.h /usr/include/gnutls/compat.h \ + /usr/include/gcrypt.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/gpg-error.h \ + /usr/include/x86_64-linux-gnu/sys/socket.h \ + /usr/include/x86_64-linux-gnu/sys/uio.h \ + /usr/include/x86_64-linux-gnu/bits/uio.h \ + /usr/include/x86_64-linux-gnu/bits/socket.h \ + /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ + /usr/include/x86_64-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/x86_64-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h \ + /usr/include/x86_64-linux-gnu/sys/time.h /usr/include/gcrypt-module.h \ + zm_signal.h /usr/include/signal.h \ + /usr/include/x86_64-linux-gnu/bits/signum.h \ + /usr/include/x86_64-linux-gnu/bits/siginfo.h \ + /usr/include/x86_64-linux-gnu/bits/sigaction.h \ + /usr/include/x86_64-linux-gnu/bits/sigcontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigstack.h \ + /usr/include/x86_64-linux-gnu/sys/ucontext.h \ + /usr/include/x86_64-linux-gnu/bits/sigthread.h /usr/include/execinfo.h \ + zm_monitor.h /usr/include/c++/4.7/vector \ + /usr/include/c++/4.7/bits/stl_construct.h \ + /usr/include/c++/4.7/ext/alloc_traits.h \ + /usr/include/c++/4.7/bits/stl_uninitialized.h \ + /usr/include/c++/4.7/bits/stl_vector.h \ + /usr/include/c++/4.7/bits/stl_bvector.h \ + /usr/include/c++/4.7/bits/vector.tcc /usr/include/c++/4.7/sstream \ + /usr/include/c++/4.7/istream /usr/include/c++/4.7/ios \ + /usr/include/c++/4.7/bits/ios_base.h \ + /usr/include/c++/4.7/bits/locale_classes.h \ + /usr/include/c++/4.7/bits/locale_classes.tcc \ + /usr/include/c++/4.7/streambuf /usr/include/c++/4.7/bits/streambuf.tcc \ + /usr/include/c++/4.7/bits/basic_ios.h \ + /usr/include/c++/4.7/bits/locale_facets.h /usr/include/c++/4.7/cwctype \ + /usr/include/wctype.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h \ + /usr/include/c++/4.7/bits/streambuf_iterator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h \ + /usr/include/c++/4.7/bits/locale_facets.tcc \ + /usr/include/c++/4.7/bits/basic_ios.tcc /usr/include/c++/4.7/ostream \ + /usr/include/c++/4.7/bits/ostream.tcc \ + /usr/include/c++/4.7/bits/istream.tcc \ + /usr/include/c++/4.7/bits/sstream.tcc zm_coord.h zm_image.h zm_jpeg.h \ + /usr/include/setjmp.h jinclude.h /root/zm/libjpeg-turbo-1.2.1/jconfig.h \ + /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \ + /root/zm/libjpeg-turbo-1.2.1/jpeglib.h \ + /root/zm/libjpeg-turbo-1.2.1/jmorecfg.h \ + /root/zm/libjpeg-turbo-1.2.1/jerror.h zm_rgb.h zm_box.h \ + /usr/include/math.h /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h zm_poly.h zm_mem_utils.h \ + zm_utils.h /usr/include/errno.h \ + /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/x86_64-linux-gnu/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/zlib.h /usr/include/zconf.h zm_zone.h zm_event.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ + /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \ + /usr/include/x86_64-linux-gnu/sys/stat.h \ + /usr/include/x86_64-linux-gnu/bits/stat.h /usr/include/c++/4.7/set \ + /usr/include/c++/4.7/bits/stl_set.h \ + /usr/include/c++/4.7/bits/stl_multiset.h zm_stream.h \ + /usr/include/x86_64-linux-gnu/sys/un.h zm_mpeg.h zm_ffmpeg.h \ + /usr/include/libavutil/avutil.h /usr/include/libavutil/common.h \ + /usr/include/inttypes.h /usr/include/libavutil/attributes.h \ + /usr/include/libavutil/avconfig.h /usr/include/libavutil/mem.h \ + /usr/include/libavutil/error.h /usr/include/libavutil/avutil.h \ + /usr/include/libavutil/mathematics.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/intfloat_readwrite.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavcodec/avcodec.h \ + /usr/include/libavutil/samplefmt.h /usr/include/libavutil/cpu.h \ + /usr/include/libavutil/dict.h /usr/include/libavutil/log.h \ + /usr/include/libavutil/pixfmt.h /usr/include/libavutil/rational.h \ + /usr/include/libavutil/audioconvert.h /usr/include/libavcodec/version.h \ + /usr/include/libavformat/avformat.h /usr/include/libavformat/avio.h \ + /usr/include/libavutil/common.h /usr/include/libavformat/version.h \ + /usr/include/libswscale/swscale.h zm_camera.h \ + /usr/include/x86_64-linux-gnu/sys/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctls.h \ + /usr/include/x86_64-linux-gnu/asm/ioctls.h \ + /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ + /usr/include/x86_64-linux-gnu/asm/ioctl.h \ + /usr/include/asm-generic/ioctl.h \ + /usr/include/x86_64-linux-gnu/bits/ioctl-types.h \ + /usr/include/x86_64-linux-gnu/sys/ttydefaults.h zm_plugin_manager.h \ + /usr/include/x86_64-linux-gnu/sys/dir.h /usr/include/dirent.h \ + /usr/include/x86_64-linux-gnu/bits/dirent.h \ + /usr/include/x86_64-linux-gnu/sys/param.h /usr/include/linux/param.h \ + /usr/include/x86_64-linux-gnu/asm/param.h \ + /usr/include/asm-generic/param.h zm_image_analyser.h \ + /usr/include/c++/4.7/list /usr/include/c++/4.7/bits/stl_list.h \ + /usr/include/c++/4.7/bits/list.tcc /usr/include/c++/4.7/stdexcept \ + /usr/include/c++/4.7/iostream /usr/include/c++/4.7/memory \ + /usr/include/c++/4.7/bits/stl_tempbuf.h \ + /usr/include/c++/4.7/bits/stl_raw_storage_iter.h \ + /usr/include/c++/4.7/backward/auto_ptr.h zm_detector.h \ + /usr/include/syslog.h /usr/include/x86_64-linux-gnu/sys/syslog.h \ + /usr/include/x86_64-linux-gnu/bits/syslog-path.h /usr/include/libgen.h \ + zm_plugin.h /usr/include/dlfcn.h \ + /usr/include/x86_64-linux-gnu/bits/dlfcn.h zm_local_camera.h \ + /usr/include/linux/videodev2.h /usr/include/linux/types.h \ + /usr/include/x86_64-linux-gnu/asm/types.h \ + /usr/include/asm-generic/types.h /usr/include/asm-generic/int-ll64.h \ + /usr/include/x86_64-linux-gnu/asm/bitsperlong.h \ + /usr/include/asm-generic/bitsperlong.h /usr/include/linux/posix_types.h \ + /usr/include/linux/stddef.h \ + /usr/include/x86_64-linux-gnu/asm/posix_types.h \ + /usr/include/x86_64-linux-gnu/asm/posix_types_64.h + +/usr/include/getopt.h: + +/usr/include/ctype.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/xlocale.h: + +zm.h: + +zm_config.h: + +../config.h: + +zm_config_defines.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/cctype: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +zm_logger.h: + +/usr/include/unistd.h: + +/usr/include/x86_64-linux-gnu/bits/posix_opt.h: + +/usr/include/x86_64-linux-gnu/bits/environments.h: + +/usr/include/x86_64-linux-gnu/bits/confname.h: + +/usr/include/c++/4.7/map: + +/usr/include/c++/4.7/bits/stl_tree.h: + +/usr/include/c++/4.7/bits/stl_map.h: + +/usr/include/c++/4.7/bits/stl_multimap.h: + +/usr/include/mysql/mysql.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/mysql/mysql_version.h: + +/usr/include/mysql/mysql_com.h: + +/usr/include/mysql/mysql_time.h: + +/usr/include/mysql/my_list.h: + +/usr/include/mysql/typelib.h: + +/usr/include/mysql/my_alloc.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: + +/usr/include/stdint.h: + +zm_db.h: + +zm_user.h: + +/usr/include/gnutls/openssl.h: + +/usr/include/gnutls/gnutls.h: + +/usr/include/gnutls/compat.h: + +/usr/include/gcrypt.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/gpg-error.h: + +/usr/include/x86_64-linux-gnu/sys/socket.h: + +/usr/include/x86_64-linux-gnu/sys/uio.h: + +/usr/include/x86_64-linux-gnu/bits/uio.h: + +/usr/include/x86_64-linux-gnu/bits/socket.h: + +/usr/include/x86_64-linux-gnu/bits/sockaddr.h: + +/usr/include/x86_64-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/x86_64-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/x86_64-linux-gnu/sys/time.h: + +/usr/include/gcrypt-module.h: + +zm_signal.h: + +/usr/include/signal.h: + +/usr/include/x86_64-linux-gnu/bits/signum.h: + +/usr/include/x86_64-linux-gnu/bits/siginfo.h: + +/usr/include/x86_64-linux-gnu/bits/sigaction.h: + +/usr/include/x86_64-linux-gnu/bits/sigcontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigstack.h: + +/usr/include/x86_64-linux-gnu/sys/ucontext.h: + +/usr/include/x86_64-linux-gnu/bits/sigthread.h: + +/usr/include/execinfo.h: + +zm_monitor.h: + +/usr/include/c++/4.7/vector: + +/usr/include/c++/4.7/bits/stl_construct.h: + +/usr/include/c++/4.7/ext/alloc_traits.h: + +/usr/include/c++/4.7/bits/stl_uninitialized.h: + +/usr/include/c++/4.7/bits/stl_vector.h: + +/usr/include/c++/4.7/bits/stl_bvector.h: + +/usr/include/c++/4.7/bits/vector.tcc: + +/usr/include/c++/4.7/sstream: + +/usr/include/c++/4.7/istream: + +/usr/include/c++/4.7/ios: + +/usr/include/c++/4.7/bits/ios_base.h: + +/usr/include/c++/4.7/bits/locale_classes.h: + +/usr/include/c++/4.7/bits/locale_classes.tcc: + +/usr/include/c++/4.7/streambuf: + +/usr/include/c++/4.7/bits/streambuf.tcc: + +/usr/include/c++/4.7/bits/basic_ios.h: + +/usr/include/c++/4.7/bits/locale_facets.h: + +/usr/include/c++/4.7/cwctype: + +/usr/include/wctype.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h: + +/usr/include/c++/4.7/bits/streambuf_iterator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h: + +/usr/include/c++/4.7/bits/locale_facets.tcc: + +/usr/include/c++/4.7/bits/basic_ios.tcc: + +/usr/include/c++/4.7/ostream: + +/usr/include/c++/4.7/bits/ostream.tcc: + +/usr/include/c++/4.7/bits/istream.tcc: + +/usr/include/c++/4.7/bits/sstream.tcc: + +zm_coord.h: + +zm_image.h: + +zm_jpeg.h: + +/usr/include/setjmp.h: + +jinclude.h: + +/root/zm/libjpeg-turbo-1.2.1/jconfig.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/root/zm/libjpeg-turbo-1.2.1/jpeglib.h: + +/root/zm/libjpeg-turbo-1.2.1/jmorecfg.h: + +/root/zm/libjpeg-turbo-1.2.1/jerror.h: + +zm_rgb.h: + +zm_box.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +zm_poly.h: + +zm_mem_utils.h: + +zm_utils.h: + +/usr/include/errno.h: + +/usr/include/x86_64-linux-gnu/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/x86_64-linux-gnu/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/zlib.h: + +/usr/include/zconf.h: + +zm_zone.h: + +zm_event.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/x86_64-linux-gnu/bits/xopen_lim.h: + +/usr/include/x86_64-linux-gnu/sys/stat.h: + +/usr/include/x86_64-linux-gnu/bits/stat.h: + +/usr/include/c++/4.7/set: + +/usr/include/c++/4.7/bits/stl_set.h: + +/usr/include/c++/4.7/bits/stl_multiset.h: + +zm_stream.h: + +/usr/include/x86_64-linux-gnu/sys/un.h: + +zm_mpeg.h: + +zm_ffmpeg.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/common.h: + +/usr/include/inttypes.h: + +/usr/include/libavutil/attributes.h: + +/usr/include/libavutil/avconfig.h: + +/usr/include/libavutil/mem.h: + +/usr/include/libavutil/error.h: + +/usr/include/libavutil/avutil.h: + +/usr/include/libavutil/mathematics.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/intfloat_readwrite.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavcodec/avcodec.h: + +/usr/include/libavutil/samplefmt.h: + +/usr/include/libavutil/cpu.h: + +/usr/include/libavutil/dict.h: + +/usr/include/libavutil/log.h: + +/usr/include/libavutil/pixfmt.h: + +/usr/include/libavutil/rational.h: + +/usr/include/libavutil/audioconvert.h: + +/usr/include/libavcodec/version.h: + +/usr/include/libavformat/avformat.h: + +/usr/include/libavformat/avio.h: + +/usr/include/libavutil/common.h: + +/usr/include/libavformat/version.h: + +/usr/include/libswscale/swscale.h: + +zm_camera.h: + +/usr/include/x86_64-linux-gnu/sys/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctls.h: + +/usr/include/x86_64-linux-gnu/asm/ioctls.h: + +/usr/include/asm-generic/ioctls.h: + +/usr/include/linux/ioctl.h: + +/usr/include/x86_64-linux-gnu/asm/ioctl.h: + +/usr/include/asm-generic/ioctl.h: + +/usr/include/x86_64-linux-gnu/bits/ioctl-types.h: + +/usr/include/x86_64-linux-gnu/sys/ttydefaults.h: + +zm_plugin_manager.h: + +/usr/include/x86_64-linux-gnu/sys/dir.h: + +/usr/include/dirent.h: + +/usr/include/x86_64-linux-gnu/bits/dirent.h: + +/usr/include/x86_64-linux-gnu/sys/param.h: + +/usr/include/linux/param.h: + +/usr/include/x86_64-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +zm_image_analyser.h: + +/usr/include/c++/4.7/list: + +/usr/include/c++/4.7/bits/stl_list.h: + +/usr/include/c++/4.7/bits/list.tcc: + +/usr/include/c++/4.7/stdexcept: + +/usr/include/c++/4.7/iostream: + +/usr/include/c++/4.7/memory: + +/usr/include/c++/4.7/bits/stl_tempbuf.h: + +/usr/include/c++/4.7/bits/stl_raw_storage_iter.h: + +/usr/include/c++/4.7/backward/auto_ptr.h: + +zm_detector.h: + +/usr/include/syslog.h: + +/usr/include/x86_64-linux-gnu/sys/syslog.h: + +/usr/include/x86_64-linux-gnu/bits/syslog-path.h: + +/usr/include/libgen.h: + +zm_plugin.h: + +/usr/include/dlfcn.h: + +/usr/include/x86_64-linux-gnu/bits/dlfcn.h: + +zm_local_camera.h: + +/usr/include/linux/videodev2.h: + +/usr/include/linux/types.h: + +/usr/include/x86_64-linux-gnu/asm/types.h: + +/usr/include/asm-generic/types.h: + +/usr/include/asm-generic/int-ll64.h: + +/usr/include/x86_64-linux-gnu/asm/bitsperlong.h: + +/usr/include/asm-generic/bitsperlong.h: + +/usr/include/linux/posix_types.h: + +/usr/include/linux/stddef.h: + +/usr/include/x86_64-linux-gnu/asm/posix_types.h: + +/usr/include/x86_64-linux-gnu/asm/posix_types_64.h: diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 000000000..4941a6dd5 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,141 @@ +AUTOMAKE_OPTIONS = gnu + +AM_CPPFLAGS = @MYSQL_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 \ + zmfix + +zm_SOURCES = \ + zm_box.cpp \ + zm_buffer.cpp \ + zm_camera.cpp \ + zm_comms.cpp \ + zm_config.cpp \ + zm_coord.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_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_sdp.cpp \ + zm_signal.cpp \ + zm_stream.cpp \ + zm_thread.cpp \ + zm_time.cpp \ + zm_timer.cpp \ + zm_user.cpp \ + zm_utils.cpp \ + zm_zone.cpp \ + zm_detector.cpp \ + zm_plugin.cpp \ + zm_plugin_manager.cpp \ + zm_image_analyser.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) +zmfix_SOURCES = zmfix.cpp zm_config.cpp zm_regexp.cpp zm_logger.cpp zm_utils.cpp zm_db.cpp zm.cpp + +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_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_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_zone.h \ + zm_detector.h \ + zm_plugin.h \ + zm_plugin_manager.h \ + zm_image_analyser.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 ) + ( cd $(DESTDIR)@bindir@; chmod u+s zmfix ) + +uninstall-hook: + ( cd $(DESTDIR)$(cgidir); rm -f zms nph-zms ) + diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 000000000..1d121d968 --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,779 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +bin_PROGRAMS = zmc$(EXEEXT) zma$(EXEEXT) zmu$(EXEEXT) zms$(EXEEXT) \ + zmf$(EXEEXT) zmstreamer$(EXEEXT) zmfix$(EXEEXT) +subdir = src +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/zm_config.h.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = zm_config.h +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am__objects_1 = zm_box.$(OBJEXT) zm_buffer.$(OBJEXT) \ + zm_camera.$(OBJEXT) zm_comms.$(OBJEXT) zm_config.$(OBJEXT) \ + zm_coord.$(OBJEXT) zm.$(OBJEXT) zm_db.$(OBJEXT) \ + zm_logger.$(OBJEXT) zm_event.$(OBJEXT) zm_exception.$(OBJEXT) \ + zm_file_camera.$(OBJEXT) zm_ffmpeg_camera.$(OBJEXT) \ + zm_image.$(OBJEXT) zm_jpeg.$(OBJEXT) zm_local_camera.$(OBJEXT) \ + zm_monitor.$(OBJEXT) zm_ffmpeg.$(OBJEXT) zm_mpeg.$(OBJEXT) \ + zm_poly.$(OBJEXT) zm_regexp.$(OBJEXT) \ + zm_remote_camera.$(OBJEXT) zm_remote_camera_http.$(OBJEXT) \ + zm_remote_camera_rtsp.$(OBJEXT) zm_rtp.$(OBJEXT) \ + zm_rtp_ctrl.$(OBJEXT) zm_rtp_data.$(OBJEXT) \ + zm_rtp_source.$(OBJEXT) zm_rtsp.$(OBJEXT) zm_sdp.$(OBJEXT) \ + zm_signal.$(OBJEXT) zm_stream.$(OBJEXT) zm_thread.$(OBJEXT) \ + zm_time.$(OBJEXT) zm_timer.$(OBJEXT) zm_user.$(OBJEXT) \ + zm_utils.$(OBJEXT) zm_zone.$(OBJEXT) zm_detector.$(OBJEXT) \ + zm_plugin.$(OBJEXT) zm_plugin_manager.$(OBJEXT) \ + zm_image_analyser.$(OBJEXT) +am_zma_OBJECTS = zma.$(OBJEXT) $(am__objects_1) +zma_OBJECTS = $(am_zma_OBJECTS) +zma_LDADD = $(LDADD) +am_zmc_OBJECTS = zmc.$(OBJEXT) $(am__objects_1) +zmc_OBJECTS = $(am_zmc_OBJECTS) +zmc_LDADD = $(LDADD) +am_zmf_OBJECTS = zmf.$(OBJEXT) $(am__objects_1) +zmf_OBJECTS = $(am_zmf_OBJECTS) +zmf_LDADD = $(LDADD) +am_zmfix_OBJECTS = zmfix.$(OBJEXT) zm_config.$(OBJEXT) \ + zm_regexp.$(OBJEXT) zm_logger.$(OBJEXT) zm_utils.$(OBJEXT) \ + zm_db.$(OBJEXT) zm.$(OBJEXT) +zmfix_OBJECTS = $(am_zmfix_OBJECTS) +zmfix_LDADD = $(LDADD) +am_zms_OBJECTS = zms.$(OBJEXT) $(am__objects_1) +zms_OBJECTS = $(am_zms_OBJECTS) +zms_LDADD = $(LDADD) +am_zmstreamer_OBJECTS = zmstreamer.$(OBJEXT) $(am__objects_1) +zmstreamer_OBJECTS = $(am_zmstreamer_OBJECTS) +zmstreamer_LDADD = $(LDADD) +am_zmu_OBJECTS = zmu.$(OBJEXT) $(am__objects_1) +zmu_OBJECTS = $(am_zmu_OBJECTS) +zmu_LDADD = $(LDADD) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +SOURCES = $(zma_SOURCES) $(zmc_SOURCES) $(zmf_SOURCES) \ + $(zmfix_SOURCES) $(zms_SOURCES) $(zmstreamer_SOURCES) \ + $(zmu_SOURCES) +DIST_SOURCES = $(zma_SOURCES) $(zmc_SOURCES) $(zmf_SOURCES) \ + $(zmfix_SOURCES) $(zms_SOURCES) $(zmstreamer_SOURCES) \ + $(zmu_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +AM_CPPFLAGS = @MYSQL_CFLAGS@ @FFMPEG_CFLAGS@ -Wall -Wno-sign-compare -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@ +zm_SOURCES = \ + zm_box.cpp \ + zm_buffer.cpp \ + zm_camera.cpp \ + zm_comms.cpp \ + zm_config.cpp \ + zm_coord.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_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_sdp.cpp \ + zm_signal.cpp \ + zm_stream.cpp \ + zm_thread.cpp \ + zm_time.cpp \ + zm_timer.cpp \ + zm_user.cpp \ + zm_utils.cpp \ + zm_zone.cpp \ + zm_detector.cpp \ + zm_plugin.cpp \ + zm_plugin_manager.cpp \ + zm_image_analyser.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) +zmfix_SOURCES = zmfix.cpp zm_config.cpp zm_regexp.cpp zm_logger.cpp zm_utils.cpp zm_db.cpp zm.cpp +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_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_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_zone.h \ + zm_detector.h \ + zm_plugin.h \ + zm_plugin_manager.h \ + zm_image_analyser.h + +EXTRA_DIST = \ + zm_config.h.in \ + zm_threaddata.cpp + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +zm_config.h: $(top_builddir)/config.status $(srcdir)/zm_config.h.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +zma$(EXEEXT): $(zma_OBJECTS) $(zma_DEPENDENCIES) $(EXTRA_zma_DEPENDENCIES) + @rm -f zma$(EXEEXT) + $(CXXLINK) $(zma_OBJECTS) $(zma_LDADD) $(LIBS) +zmc$(EXEEXT): $(zmc_OBJECTS) $(zmc_DEPENDENCIES) $(EXTRA_zmc_DEPENDENCIES) + @rm -f zmc$(EXEEXT) + $(CXXLINK) $(zmc_OBJECTS) $(zmc_LDADD) $(LIBS) +zmf$(EXEEXT): $(zmf_OBJECTS) $(zmf_DEPENDENCIES) $(EXTRA_zmf_DEPENDENCIES) + @rm -f zmf$(EXEEXT) + $(CXXLINK) $(zmf_OBJECTS) $(zmf_LDADD) $(LIBS) +zmfix$(EXEEXT): $(zmfix_OBJECTS) $(zmfix_DEPENDENCIES) $(EXTRA_zmfix_DEPENDENCIES) + @rm -f zmfix$(EXEEXT) + $(CXXLINK) $(zmfix_OBJECTS) $(zmfix_LDADD) $(LIBS) +zms$(EXEEXT): $(zms_OBJECTS) $(zms_DEPENDENCIES) $(EXTRA_zms_DEPENDENCIES) + @rm -f zms$(EXEEXT) + $(CXXLINK) $(zms_OBJECTS) $(zms_LDADD) $(LIBS) +zmstreamer$(EXEEXT): $(zmstreamer_OBJECTS) $(zmstreamer_DEPENDENCIES) $(EXTRA_zmstreamer_DEPENDENCIES) + @rm -f zmstreamer$(EXEEXT) + $(CXXLINK) $(zmstreamer_OBJECTS) $(zmstreamer_LDADD) $(LIBS) +zmu$(EXEEXT): $(zmu_OBJECTS) $(zmu_DEPENDENCIES) $(EXTRA_zmu_DEPENDENCIES) + @rm -f zmu$(EXEEXT) + $(CXXLINK) $(zmu_OBJECTS) $(zmu_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_box.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_buffer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_camera.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_comms.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_config.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_coord.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_db.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_detector.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_event.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_exception.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_ffmpeg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_ffmpeg_camera.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_file_camera.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_image.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_image_analyser.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_jpeg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_local_camera.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_logger.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_monitor.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_mpeg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_plugin.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_plugin_manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_poly.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_regexp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_remote_camera.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_remote_camera_http.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_remote_camera_rtsp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_rtp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_rtp_ctrl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_rtp_data.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_rtp_source.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_rtsp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_sdp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_signal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_stream.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_thread.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_time.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_timer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_user.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_utils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zm_zone.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zma.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zmc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zmf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zmfix.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zms.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zmstreamer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zmu.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook +.MAKE: install-am install-exec-am install-strip uninstall-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic ctags dist-hook distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-exec-hook install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-hook + + +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 ) + ( cd $(DESTDIR)@bindir@; chmod u+s zmfix ) + +uninstall-hook: + ( cd $(DESTDIR)$(cgidir); rm -f zms nph-zms ) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/jinclude.h b/src/jinclude.h new file mode 100644 index 000000000..e1065bc6f --- /dev/null +++ b/src/jinclude.h @@ -0,0 +1,91 @@ +/* + * jinclude.h + * + * Copyright (C) 2001-2008 Philip Coombes + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file exists to provide a single place to fix any problems with + * including the wrong system include files. (Common problems are taken + * care of by the standard jconfig symbols, but on really weird systems + * you may have to edit this file.) + * + * NOTE: this file is NOT intended to be included by applications using the + * JPEG library. Most applications need only include jpeglib.h. + */ + + +/* Include auto-config file to find out which system include files we need. */ + +#include "jconfig.h" /* auto configuration options */ +#define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */ + +/* + * We need the NULL macro and size_t typedef. + * On an ANSI-conforming system it is sufficient to include . + * Otherwise, we get them from or ; we may have to + * pull in as well. + * Note that the core JPEG library does not require ; + * only the default error handler and data source/destination modules do. + * But we must pull it in because of the references to FILE in jpeglib.h. + * You can remove those references if you want to compile without . + */ + +#ifdef HAVE_STDDEF_H +#include +#endif + +#ifdef HAVE_STDLIB_H +#include +#endif + +#ifdef NEED_SYS_TYPES_H +#include +#endif + +#include + +/* + * We need memory copying and zeroing functions, plus strncpy(). + * ANSI and System V implementations declare these in . + * BSD doesn't have the mem() functions, but it does have bcopy()/bzero(). + * Some systems may declare memset and memcpy in . + * + * NOTE: we assume the size parameters to these functions are of type size_t. + * Change the casts in these macros if not! + */ + +#ifdef NEED_BSD_STRINGS + +#include +#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size)) +#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size)) + +#else /* not BSD, assume ANSI/SysV string lib */ + +#include +#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size)) +#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size)) + +#endif + +/* + * In ANSI C, and indeed any rational implementation, size_t is also the + * type returned by sizeof(). However, it seems there are some irrational + * implementations out there, in which sizeof() returns an int even though + * size_t is defined as long or unsigned long. To ensure consistent results + * we always use this SIZEOF() macro in place of using sizeof() directly. + */ + +#define SIZEOF(object) ((size_t) sizeof(object)) + +/* + * The modules that use fread() and fwrite() always invoke them through + * these macros. On some systems you may need to twiddle the argument casts. + * CAUTION: argument order is different from underlying functions! + */ + +#define JFREAD(file,buf,sizeofbuf) \ + ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) +#define JFWRITE(file,buf,sizeofbuf) \ + ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) diff --git a/src/zm.cpp b/src/zm.cpp new file mode 100644 index 000000000..311c2b77b --- /dev/null +++ b/src/zm.cpp @@ -0,0 +1,22 @@ +// +// ZoneMinder Core Implementation, $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. +// + +#include "zm.h" + +// This space intentionally left blank diff --git a/src/zm.h b/src/zm.h new file mode 100644 index 000000000..914a1aae1 --- /dev/null +++ b/src/zm.h @@ -0,0 +1,35 @@ +// +// ZoneMinder Core Interfaces, $Date$, $Revision$ +// $Copyright$ +// +// 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. +// + +#ifndef ZM_H +#define ZM_H + +#include "zm_config.h" +#include "zm_logger.h" + +extern "C" +{ +#if !HAVE_DECL_ROUND +double round(double); +#endif +} + +#include + +#endif // ZM_H diff --git a/src/zm_box.cpp b/src/zm_box.cpp new file mode 100644 index 000000000..2cb8c9a5e --- /dev/null +++ b/src/zm_box.cpp @@ -0,0 +1,23 @@ +// +// ZoneMinder Box Class Implementation, $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. +// + +#include "zm.h" +#include "zm_box.h" + +// This section deliberately left blank diff --git a/src/zm_box.h b/src/zm_box.h new file mode 100644 index 000000000..8a18b8847 --- /dev/null +++ b/src/zm_box.h @@ -0,0 +1,70 @@ +// +// ZoneMinder Box Class Interfaces, $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. +// + +#ifndef ZM_BOX_H +#define ZM_BOX_H + +#include "zm.h" +#include "zm_coord.h" + +#include + +// +// Class used for storing a box, which is defined as a region +// defined by two coordinates +// +class Box +{ +private: + Coord lo, hi; + Coord size; + +public: + inline Box() + { + } + inline Box( int p_size ) : lo( 0, 0 ), hi ( p_size-1, p_size-1 ), size( Coord::Range( hi, lo ) ) { } + inline Box( int p_x_size, int p_y_size ) : lo( 0, 0 ), hi ( p_x_size-1, p_y_size-1 ), size( Coord::Range( hi, lo ) ) { } + inline Box( int lo_x, int lo_y, int hi_x, int hi_y ) : lo( lo_x, lo_y ), hi( hi_x, hi_y ), size( Coord::Range( hi, lo ) ) { } + inline Box( const Coord &p_lo, const Coord &p_hi ) : lo( p_lo ), hi( p_hi ), size( Coord::Range( hi, lo ) ) { } + + inline const Coord &Lo() const { return( lo ); } + inline int LoX() const { return( lo.X() ); } + inline int LoY() const { return( lo.Y() ); } + inline const Coord &Hi() const { return( hi ); } + inline int HiX() const { return( hi.X() ); } + inline int HiY() const { return( hi.Y() ); } + inline const Coord &Size() const { return( size ); } + inline int Width() const { return( size.X() ); } + inline int Height() const { return( size.Y() ); } + inline int Area() const { return( size.X()*size.Y() ); } + + inline const Coord Centre() const + { + int mid_x = int(round(lo.X()+(size.X()/2.0))); + int mid_y = int(round(lo.Y()+(size.Y()/2.0))); + return( Coord( mid_x, mid_y ) ); + } + inline bool Inside( const Coord &coord ) const + { + return( coord.X() >= lo.X() && coord.X() <= hi.X() && coord.Y() >= lo.Y() && coord.Y() <= hi.Y() ); + } +}; + +#endif // ZM_BOX_H diff --git a/src/zm_buffer.cpp b/src/zm_buffer.cpp new file mode 100644 index 000000000..384f45bcc --- /dev/null +++ b/src/zm_buffer.cpp @@ -0,0 +1,69 @@ +/* + * ZoneMinder flexible memory class implementation, $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. +*/ + +#include + +#include "zm.h" +#include "zm_buffer.h" + +unsigned int Buffer::assign( const unsigned char *pStorage, unsigned int pSize ) +{ + if ( mAllocation < pSize ) + { + delete[] mStorage; + mAllocation = pSize; + mHead = mStorage = new unsigned char[pSize]; + } + mSize = pSize; + memcpy( mStorage, pStorage, mSize ); + mHead = mStorage; + mTail = mHead + mSize; + return( mSize ); +} + +unsigned int Buffer::expand( unsigned int count ) +{ + int spare = mAllocation - mSize; + int headSpace = mHead - mStorage; + int tailSpace = spare - headSpace; + int width = mTail - mHead; + if ( spare > (int)count ) + { + if ( tailSpace < (int)count ) + { + memmove( mStorage, mHead, mSize ); + mHead = mStorage; + mTail = mHead + width; + } + } + else + { + mAllocation += count; + unsigned char *newStorage = new unsigned char[mAllocation]; + if ( mStorage ) + { + memcpy( newStorage, mHead, mSize ); + delete[] mStorage; + } + mStorage = newStorage; + mHead = mStorage; + mTail = mHead + width; + } + return( mSize ); +} diff --git a/src/zm_buffer.h b/src/zm_buffer.h new file mode 100644 index 000000000..3f2343b1a --- /dev/null +++ b/src/zm_buffer.h @@ -0,0 +1,214 @@ +/* + * ZoneMinder Flexible Memory Interface, $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 demTails. + * + * 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. +*/ + +#ifndef ZM_BUFFER_H +#define ZM_BUFFER_H + +#include "zm.h" + +#include + +class Buffer +{ +protected: + unsigned char *mStorage; + unsigned int mAllocation; + unsigned int mSize; + unsigned char *mHead; + unsigned char *mTail; + +public: + Buffer() : mStorage( 0 ), mAllocation( 0 ), mSize( 0 ), mHead( 0 ), mTail( 0 ) + { + } + Buffer( unsigned int pSize ) : mAllocation( pSize ), mSize( 0 ) + { + mHead = mStorage = new unsigned char[mAllocation]; + mTail = mHead; + } + Buffer( const unsigned char *pStorage, unsigned int pSize ) : mAllocation( pSize ), mSize( pSize ) + { + mHead = mStorage = new unsigned char[mSize]; + memcpy( mStorage, pStorage, mSize ); + mTail = mHead + mSize; + } + Buffer( const Buffer &buffer ) : mAllocation( buffer.mSize ), mSize( buffer.mSize ) + { + mHead = mStorage = new unsigned char[mSize]; + memcpy( mStorage, buffer.mHead, mSize ); + mTail = mHead + mSize; + } + ~Buffer() + { + delete[] mStorage; + } + unsigned char *head() const { return( mHead ); } + unsigned char *tail() const { return( mTail ); } + unsigned int size() const { return( mSize ); } + bool empty() const { return( mSize == 0 ); } + unsigned int size( unsigned int pSize ) + { + if ( mSize < pSize ) + { + expand( pSize-mSize ); + } + return( mSize ); + } + //unsigned int Allocation() const { return( mAllocation ); } + + void clear() + { + mSize = 0; + mHead = mTail = mStorage; + } + + unsigned int assign( const unsigned char *pStorage, unsigned int pSize ); + unsigned int assign( const Buffer &buffer ) + { + return( assign( buffer.mHead, buffer.mSize ) ); + } + + // Trim from the front of the buffer + unsigned int consume( unsigned int count ) + { + if ( count > mSize ) + { + Warning( "Attempt to consume %d bytes of buffer, size is only %d bytes", count, mSize ); + count = mSize; + } + mHead += count; + mSize -= count; + tidy( 0 ); + return( count ); + } + // Trim from the end of the buffer + unsigned int shrink( unsigned int count ) + { + if ( count > mSize ) + { + Warning( "Attempt to shrink buffer by %d bytes, size is only %d bytes", count, mSize ); + count = mSize; + } + mSize -= count; + if ( mTail > (mHead + mSize) ) + mTail = mHead + mSize; + tidy( 0 ); + return( count ); + } + // Add to the end of the buffer + unsigned int expand( unsigned int count ); + + // Return pointer to the first pSize bytes and advance the head + unsigned char *extract( unsigned int pSize ) + { + if ( pSize > mSize ) + { + Warning( "Attempt to extract %d bytes of buffer, size is only %d bytes", pSize, mSize ); + pSize = mSize; + } + unsigned char *oldHead = mHead; + mHead += pSize; + mSize -= pSize; + tidy( 0 ); + return( oldHead ); + } + // Add bytes to the end of the buffer + unsigned int append( const unsigned char *pStorage, unsigned int pSize ) + { + expand( pSize ); + memcpy( mTail, pStorage, pSize ); + mTail += pSize; + mSize += pSize; + return( mSize ); + } + unsigned int append( const char *pStorage, unsigned int pSize ) + { + return( append( (const unsigned char *)pStorage, pSize ) ); + } + unsigned int append( const Buffer &buffer ) + { + return( append( buffer.mHead, buffer.mSize ) ); + } + void tidy( bool level=0 ) + { + if ( mHead != mStorage ) + { + if ( mSize == 0 ) + mHead = mTail = mStorage; + else if ( level >= 1 ) + { + if ( (mHead-mStorage) > mSize ) + { + memcpy( mStorage, mHead, mSize ); + mHead = mStorage; + mTail = mHead + mSize; + } + else if ( level >= 2 ) + { + memmove( mStorage, mHead, mSize ); + mHead = mStorage; + mTail = mHead + mSize; + } + } + } + } + + Buffer &operator=( const Buffer &buffer ) + { + assign( buffer ); + return( *this ); + } + Buffer &operator+=( const Buffer &buffer ) + { + append( buffer ); + return( *this ); + } + Buffer &operator+=( unsigned int count ) + { + expand( count ); + return( *this ); + } + Buffer &operator-=( unsigned int count ) + { + consume( count ); + return( *this ); + } + operator unsigned char *() const + { + return( mHead ); + } + operator char *() const + { + return( (char *)mHead ); + } + unsigned char *operator+(int offset) const + { + return( (unsigned char *)(mHead+offset) ); + } + unsigned char operator[](int index) const + { + return( *(mHead+index) ); + } + operator int () const + { + return( (int)mSize ); + } +}; + +#endif // ZM_BUFFER_H diff --git a/src/zm_camera.cpp b/src/zm_camera.cpp new file mode 100644 index 000000000..18950d341 --- /dev/null +++ b/src/zm_camera.cpp @@ -0,0 +1,52 @@ +// +// ZoneMinder Camera Class Implementation, $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. +// + +#include "zm.h" +#include "zm_camera.h" + +Camera::Camera( int p_id, SourceType p_type, int p_width, int p_height, int p_colours, int p_subpixelorder, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ) : + id( p_id ), + type( p_type ), + width( p_width), + height( p_height ), + colours( p_colours ), + subpixelorder( p_subpixelorder ), + brightness( p_brightness ), + hue( p_hue ), + colour( p_colour ), + contrast( p_contrast ), + capture( p_capture ) +{ + pixels = width * height; + imagesize = pixels * colours; + + Debug(2,"New camera id: %d width: %d height: %d colours: %d subpixelorder: %d capture: %d",id,width,height,colours,subpixelorder,capture); + + /* Because many loops are unrolled and work on 16 colours/time or 4 pixels/time, we have to meet requirements */ + if((colours == ZM_COLOUR_GRAY8 || colours == ZM_COLOUR_RGB32) && (imagesize % 16) != 0) { + Fatal("Image size is not multiples of 16"); + } else if(colours == ZM_COLOUR_RGB24 && ((imagesize % 16) != 0 || (imagesize % 12) != 0)) { + Fatal("Image size is not multiples of 12 and 16"); + } +} + +Camera::~Camera() +{ +} + diff --git a/src/zm_camera.h b/src/zm_camera.h new file mode 100644 index 000000000..8713d3956 --- /dev/null +++ b/src/zm_camera.h @@ -0,0 +1,81 @@ +// +// ZoneMinder Camera Class Interface, $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. +// + +#ifndef ZM_CAMERA_H +#define ZM_CAMERA_H + +#include +#include + +#include "zm_image.h" + +// +// Abstract base class for cameras. This is intended just to express +// common attributes +// +class Camera +{ +protected: + typedef enum { LOCAL_SRC, REMOTE_SRC, FILE_SRC, FFMPEG_SRC } SourceType; + + int id; + SourceType type; + unsigned int width; + unsigned int height; + unsigned int colours; + unsigned int subpixelorder; + unsigned int pixels; + unsigned int imagesize; + int brightness; + int hue; + int colour; + int contrast; + bool capture; + +public: + Camera( int p_id, SourceType p_type, int p_width, int p_height, int p_colours, int p_subpixelorder, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ); + virtual ~Camera(); + + int getId() const { return( id ); } + SourceType Type() const { return( type ); } + bool IsLocal() const { return( type == LOCAL_SRC ); } + bool IsRemote() const { return( type == REMOTE_SRC ); } + bool IsFile() const { return( type == FILE_SRC ); } + bool IsFfmpeg() const { return( type == FFMPEG_SRC ); } + unsigned int Width() const { return( width ); } + unsigned int Height() const { return( height ); } + unsigned int Colours() const { return( colours ); } + unsigned int SubpixelOrder() const { return( subpixelorder ); } + unsigned int Pixels() const { return( pixels ); } + unsigned int ImageSize() const { return( imagesize ); } + + virtual int Brightness( int/*p_brightness*/=-1 ) { return( -1 ); } + virtual int Hue( int/*p_hue*/=-1 ) { return( -1 ); } + virtual int Colour( int/*p_colour*/=-1 ) { return( -1 ); } + virtual int Contrast( int/*p_contrast*/=-1 ) { return( -1 ); } + + bool CanCapture() const { return( capture ); } + + virtual int PrimeCapture() { return( 0 ); } + virtual int PreCapture()=0; + virtual int Capture( Image &image )=0; + virtual int PostCapture()=0; +}; + +#endif // ZM_CAMERA_H diff --git a/src/zm_comms.cpp b/src/zm_comms.cpp new file mode 100644 index 000000000..b30bed1d5 --- /dev/null +++ b/src/zm_comms.cpp @@ -0,0 +1,711 @@ +// +// ZoneMinder Communications Class Implementation, $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. +// + +#include "zm_comms.h" + +#include "zm_logger.h" + +#include +#include +#include +//#include +#include +#include +//#include +#include +#include +//#include +//#include +#include + +int CommsBase::readV( int iovcnt, /* const void *, int, */ ... ) +{ + va_list arg_ptr; + //struct iovec iov[iovcnt]; + struct iovec *iov = (struct iovec *)alloca( sizeof(struct iovec)*iovcnt ); + + va_start( arg_ptr, iovcnt ); + for ( int i = 0; i < iovcnt; i++ ) + { + iov[i].iov_base = va_arg( arg_ptr, void * ); + iov[i].iov_len = va_arg( arg_ptr, int ); + } + va_end( arg_ptr ); + + int nBytes = ::readv( mRd, iov, iovcnt ); + if ( nBytes < 0 ) + Debug( 1, "Readv of %d buffers max on rd %d failed: %s", iovcnt, mRd, strerror(errno) ); + return( nBytes ); +} + +int CommsBase::writeV( int iovcnt, /* const void *, int, */ ... ) +{ + va_list arg_ptr; + //struct iovec iov[iovcnt]; + struct iovec *iov = (struct iovec *)alloca( sizeof(struct iovec)*iovcnt ); + + va_start( arg_ptr, iovcnt ); + for ( int i = 0; i < iovcnt; i++ ) + { + iov[i].iov_base = va_arg( arg_ptr, void * ); + iov[i].iov_len = va_arg( arg_ptr, int ); + } + va_end( arg_ptr ); + + ssize_t nBytes = ::writev( mWd, iov, iovcnt ); + if ( nBytes < 0 ) + Debug( 1, "Writev of %d buffers on wd %d failed: %s", iovcnt, mWd, strerror(errno) ); + return( nBytes ); +} + +bool Pipe::open() +{ + if ( ::pipe( mFd ) < 0 ) + { + Error( "pipe(), errno = %d, error = %s", errno, strerror(errno) ); + return( false ); + } + + return( true ); +} + +bool Pipe::close() +{ + if ( mFd[0] > -1 ) ::close( mFd[0] ); + mFd[0] = -1; + if ( mFd[1] > -1 ) ::close( mFd[1] ); + mFd[1] = -1; + return( true ); +} + +bool Pipe::setBlocking( bool blocking ) +{ + int flags; + + /* Now set it for non-blocking I/O */ + if ( (flags = fcntl( mFd[1], F_GETFL )) < 0 ) + { + Error( "fcntl(), errno = %d, error = %s", errno, strerror(errno) ); + return( false ); + } + if ( blocking ) + { + flags &= ~O_NONBLOCK; + } + else + { + flags |= O_NONBLOCK; + } + if ( fcntl( mFd[1], F_SETFL, flags ) < 0 ) + { + Error( "fcntl(), errno = %d, error = %s", errno, strerror(errno) ); + return( false ); + } + + return( true ); +} + +SockAddr::SockAddr( const struct sockaddr *addr ) : mAddr( addr ) +{ +} + +SockAddr *SockAddr::newSockAddr( const struct sockaddr &addr, socklen_t len ) +{ + if ( addr.sa_family == AF_INET && len == SockAddrInet::addrSize() ) + { + return( new SockAddrInet( (const struct sockaddr_in *)&addr ) ); + } + else if ( addr.sa_family == AF_UNIX && len == SockAddrUnix::addrSize() ) + { + return( new SockAddrUnix( (const struct sockaddr_un *)&addr ) ); + } + Error( "Unable to create new SockAddr from addr family %d with size %d", addr.sa_family, len ); + return( 0 ); +} + +SockAddr *SockAddr::newSockAddr( const SockAddr *addr ) +{ + if ( !addr ) + return( 0 ); + + if ( addr->getDomain() == AF_INET ) + { + return( new SockAddrInet( *(SockAddrInet *)addr ) ); + } + else if ( addr->getDomain() == AF_UNIX ) + { + return( new SockAddrUnix( *(SockAddrUnix *)addr ) ); + } + Error( "Unable to create new SockAddr from addr family %d", addr->getDomain() ); + return( 0 ); +} + +SockAddrInet::SockAddrInet() : SockAddr( (struct sockaddr *)&mAddrIn ) +{ +} + +bool SockAddrInet::resolve( const char *host, const char *serv, const char *proto ) +{ + memset( &mAddrIn, 0, sizeof(mAddrIn) ); + + struct hostent *hostent=0; + if ( !(hostent = ::gethostbyname( host ) ) ) + { + Error( "gethostbyname( %s ), h_errno = %d", host, h_errno ); + return( false ); + } + + struct servent *servent=0; + if ( !(servent = ::getservbyname( serv, proto ) ) ) + { + Error( "getservbyname( %s ), errno = %d, error = %s", serv, errno, strerror(errno) ); + return( false ); + } + + mAddrIn.sin_port = servent->s_port; + mAddrIn.sin_family = AF_INET; + mAddrIn.sin_addr.s_addr = ((struct in_addr *)(hostent->h_addr))->s_addr; + + return( true ); +} + +bool SockAddrInet::resolve( const char *host, int port, const char *proto ) +{ + memset( &mAddrIn, 0, sizeof(mAddrIn) ); + + struct hostent *hostent=0; + if ( !(hostent = ::gethostbyname( host ) ) ) + { + Error( "gethostbyname( %s ), h_errno = %d", host, h_errno ); + return( false ); + } + + mAddrIn.sin_port = htons(port); + mAddrIn.sin_family = AF_INET; + mAddrIn.sin_addr.s_addr = ((struct in_addr *)(hostent->h_addr))->s_addr; + return( true ); +} + +bool SockAddrInet::resolve( const char *serv, const char *proto ) +{ + memset( &mAddrIn, 0, sizeof(mAddrIn) ); + + struct servent *servent=0; + if ( !(servent = ::getservbyname( serv, proto ) ) ) + { + Error( "getservbyname( %s ), errno = %d, error = %s", serv, errno, strerror(errno) ); + return( false ); + } + + mAddrIn.sin_port = servent->s_port; + mAddrIn.sin_family = AF_INET; + mAddrIn.sin_addr.s_addr = INADDR_ANY; + + return( true ); +} + +bool SockAddrInet::resolve( int port, const char *proto ) +{ + memset( &mAddrIn, 0, sizeof(mAddrIn) ); + + mAddrIn.sin_port = htons(port); + mAddrIn.sin_family = AF_INET; + mAddrIn.sin_addr.s_addr = INADDR_ANY; + + return( true ); +} + +SockAddrUnix::SockAddrUnix() : SockAddr( (struct sockaddr *)&mAddrUn ) +{ +} + +bool SockAddrUnix::resolve( const char *path, const char *proto ) +{ + memset( &mAddrUn, 0, sizeof(mAddrUn) ); + + strncpy( mAddrUn.sun_path, path, sizeof(mAddrUn.sun_path) ); + mAddrUn.sun_family = AF_UNIX; + + return( true ); +} + +bool Socket::socket() +{ + if ( mSd >= 0 ) + return( true ); + + if ( (mSd = ::socket( getDomain(), getType(), 0 ) ) < 0 ) + { + Error( "socket(), errno = %d, error = %s", errno, strerror(errno) ); + return( false ); + } + + int val = 1; + + (void)::setsockopt( mSd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val) ); + (void)::setsockopt( mSd, SOL_SOCKET, SO_KEEPALIVE, &val, sizeof(val) ); + + mState = DISCONNECTED; + + return( true ); +} + +bool Socket::connect() +{ + if ( !socket() ) + return( false ); + + if ( ::connect( mSd, mRemoteAddr->getAddr(), getAddrSize() ) == -1 ) + { + Error( "connect(), errno = %d, error = %s", errno, strerror(errno) ); + close(); + return( false ); + } + + mState = CONNECTED; + + return( true ); +} + +bool Socket::bind() +{ + if ( !socket() ) + return( false ); + + if ( ::bind( mSd, mLocalAddr->getAddr(), getAddrSize() ) == -1 ) + { + Error( "bind(), errno = %d, error = %s", errno, strerror(errno) ); + close(); + return( false ); + } + return( true ); +} + +bool Socket::listen() +{ + if ( ::listen( mSd, SOMAXCONN ) == -1 ) + { + Error( "listen(), errno = %d, error = %s", errno, strerror(errno) ); + close(); + return( false ); + } + + mState = LISTENING; + + return( true ); +} + +bool Socket::accept() +{ + struct sockaddr *rem_addr = mLocalAddr->getTempAddr(); + socklen_t rem_addr_size = getAddrSize(); + + int newSd = -1; + if ( (newSd = ::accept( mSd, rem_addr, &rem_addr_size )) == -1 ) + { + Error( "accept(), errno = %d, error = %s", errno, strerror(errno) ); + close(); + return( false ); + } + + ::close( mSd ); + mSd = newSd; + + mState = CONNECTED; + + return( true ); +} + +bool Socket::accept( int &newSd ) +{ + struct sockaddr *rem_addr = mLocalAddr->getTempAddr(); + socklen_t rem_addr_size = getAddrSize(); + + newSd = -1; + if ( (newSd = ::accept( mSd, rem_addr, &rem_addr_size )) == -1 ) + { + Error( "accept(), errno = %d, error = %s", errno, strerror(errno) ); + close(); + return( false ); + } + + return( true ); +} + +bool Socket::close() +{ + if ( mSd > -1 ) ::close( mSd ); + mSd = -1; + mState = CLOSED; + return( true ); +} + +int Socket::bytesToRead() const +{ + int bytes_to_read = 0; + + if ( ioctl( mSd, FIONREAD, &bytes_to_read ) < 0 ) + { + Error( "ioctl(), errno = %d, error = %s", errno, strerror(errno) ); + return( -1 ); + } + return( bytes_to_read ); +} + +bool Socket::getBlocking( bool &blocking ) +{ + int flags; + + if ( (flags = fcntl( mSd, F_GETFL )) < 0 ) + { + Error( "fcntl(), errno = %d, error = %s", errno, strerror(errno) ); + return( false ); + } + blocking = (flags & O_NONBLOCK); + return( true ); +} + +bool Socket::setBlocking( bool blocking ) +{ +#if 0 + // ioctl is apparently not recommended + int ioctl_arg = !blocking; + if ( ioctl( mSd, FIONBIO, &ioctl_arg ) < 0 ) + { + Error( "ioctl(), errno = %d, error = %s", errno, strerror(errno) ); + return( false ); + } + return( true ); +#endif + + int flags; + + /* Now set it for non-blocking I/O */ + if ( (flags = fcntl( mSd, F_GETFL )) < 0 ) + { + Error( "fcntl(), errno = %d, error = %s", errno, strerror(errno) ); + return( false ); + } + if ( blocking ) + { + flags &= ~O_NONBLOCK; + } + else + { + flags |= O_NONBLOCK; + } + if ( fcntl( mSd, F_SETFL, flags ) < 0 ) + { + Error( "fcntl(), errno = %d, error = %s", errno, strerror(errno) ); + return( false ); + } + + return( true ); +} + +bool Socket::getSendBufferSize( int &buffersize ) const +{ + socklen_t optlen = sizeof(buffersize); + if ( getsockopt( mSd, SOL_SOCKET, SO_SNDBUF, &buffersize, &optlen ) < 0 ) + { + Error( "getsockopt(), errno = %d, error = %s", errno, strerror(errno) ); + return( -1 ); + } + return( buffersize ); +} + +bool Socket::getRecvBufferSize( int &buffersize ) const +{ + socklen_t optlen = sizeof(buffersize); + if ( getsockopt( mSd, SOL_SOCKET, SO_RCVBUF, &buffersize, &optlen ) < 0 ) + { + Error( "getsockopt(), errno = %d, error = %s", errno, strerror(errno) ); + return( -1 ); + } + return( buffersize ); +} + +bool Socket::setSendBufferSize( int buffersize ) +{ + if ( setsockopt( mSd, SOL_SOCKET, SO_SNDBUF, (char *)&buffersize, sizeof(buffersize)) < 0 ) + { + Error( "setsockopt(), errno = %d, error = %s", errno, strerror(errno) ); + return( false ); + } + return( true ); +} + +bool Socket::setRecvBufferSize( int buffersize ) +{ + if ( setsockopt( mSd, SOL_SOCKET, SO_RCVBUF, (char *)&buffersize, sizeof(buffersize)) < 0 ) + { + Error( "setsockopt(), errno = %d, error = %s", errno, strerror(errno) ); + return( false ); + } + return( true ); +} + +bool Socket::getRouting( bool &route ) const +{ + int dontRoute; + socklen_t optlen = sizeof(dontRoute); + if ( getsockopt( mSd, SOL_SOCKET, SO_DONTROUTE, &dontRoute, &optlen ) < 0 ) + { + Error( "getsockopt(), errno = %d, error = %s", errno, strerror(errno) ); + return( false ); + } + route = !dontRoute; + return( true ); +} + +bool Socket::setRouting( bool route ) +{ + int dontRoute = !route; + if ( setsockopt( mSd, SOL_SOCKET, SO_DONTROUTE, (char *)&dontRoute, sizeof(dontRoute)) < 0 ) + { + Error( "setsockopt(), errno = %d, error = %s", errno, strerror(errno) ); + return( false ); + } + return( true ); +} + +bool Socket::getNoDelay( bool &nodelay ) const +{ + int int_nodelay; + socklen_t optlen = sizeof(int_nodelay); + if ( getsockopt( mSd, IPPROTO_TCP, TCP_NODELAY, &int_nodelay, &optlen ) < 0 ) + { + Error( "getsockopt(), errno = %d, error = %s", errno, strerror(errno) ); + return( false ); + } + nodelay = int_nodelay; + return( true ); +} + +bool Socket::setNoDelay( bool nodelay ) +{ + int int_nodelay = nodelay; + + if ( setsockopt( mSd, IPPROTO_TCP, TCP_NODELAY, (char *)&int_nodelay, sizeof(int_nodelay)) < 0 ) + { + Error( "setsockopt(), errno = %d, error = %s", errno, strerror(errno) ); + return( false ); + } + return( true ); +} + +bool TcpInetServer::listen() +{ + return( Socket::listen() ); +} + +bool TcpInetServer::accept() +{ + return( Socket::accept() ); +} + +bool TcpInetServer::accept( TcpInetSocket *&newSocket ) +{ + int newSd = -1; + newSocket = 0; + + if ( !Socket::accept( newSd ) ) + return( false ); + + newSocket = new TcpInetSocket( *this, newSd ); + + return( true ); +} + +bool TcpUnixServer::accept( TcpUnixSocket *&newSocket ) +{ + int newSd = -1; + newSocket = 0; + + if ( !Socket::accept( newSd ) ) + return( false ); + + newSocket = new TcpUnixSocket( *this, newSd ); + + return( true ); +} + +Select::Select() : mHasTimeout( false ), mMaxFd( -1 ) +{ +} + +Select::Select( struct timeval timeout ) : mMaxFd( -1 ) +{ + setTimeout( timeout ); +} + +Select::Select( int timeout ) : mMaxFd( -1 ) +{ + setTimeout( timeout ); +} + +Select::Select( double timeout ) : mMaxFd( -1 ) +{ + setTimeout( timeout ); +} + +void Select::setTimeout( int timeout ) +{ + mTimeout.tv_sec = timeout; + mTimeout.tv_usec = 0; + mHasTimeout = true; +} + +void Select::setTimeout( double timeout ) +{ + mTimeout.tv_sec = int(timeout); + mTimeout.tv_usec = suseconds_t((timeout-mTimeout.tv_sec)*1000000.0); + mHasTimeout = true; +} + +void Select::setTimeout( struct timeval timeout ) +{ + mTimeout = timeout; + mHasTimeout = true; +} + +void Select::clearTimeout() +{ + mHasTimeout = false; +} + +void Select::calcMaxFd() +{ + mMaxFd = -1; + for ( CommsSet::iterator iter = mReaders.begin(); iter != mReaders.end(); iter++ ) + if ( (*iter)->getMaxDesc() > mMaxFd ) + mMaxFd = (*iter)->getMaxDesc(); + for ( CommsSet::iterator iter = mWriters.begin(); iter != mWriters.end(); iter++ ) + if ( (*iter)->getMaxDesc() > mMaxFd ) + mMaxFd = (*iter)->getMaxDesc(); +} + +bool Select::addReader( CommsBase *comms ) +{ + if ( !comms->isOpen() ) + { + Error( "Unable to add closed reader" ); + return( false ); + } + std::pair result = mReaders.insert( comms ); + if ( result.second ) + if ( comms->getMaxDesc() > mMaxFd ) + mMaxFd = comms->getMaxDesc(); + return( result.second ); +} + +bool Select::deleteReader( CommsBase *comms ) +{ + if ( !comms->isOpen() ) + { + Error( "Unable to add closed reader" ); + return( false ); + } + if ( mReaders.erase( comms ) ) + { + calcMaxFd(); + return( true ); + } + return( false ); +} + +void Select::clearReaders() +{ + mReaders.clear(); + mMaxFd = -1; +} + +bool Select::addWriter( CommsBase *comms ) +{ + std::pair result = mWriters.insert( comms ); + if ( result.second ) + if ( comms->getMaxDesc() > mMaxFd ) + mMaxFd = comms->getMaxDesc(); + return( result.second ); +} + +bool Select::deleteWriter( CommsBase *comms ) +{ + if ( mWriters.erase( comms ) ) + { + calcMaxFd(); + return( true ); + } + return( false ); +} + +void Select::clearWriters() +{ + mWriters.clear(); + mMaxFd = -1; +} + +int Select::wait() +{ + struct timeval tempTimeout = mTimeout; + struct timeval *selectTimeout = mHasTimeout?&tempTimeout:NULL; + + fd_set rfds; + fd_set wfds; + + mReadable.clear(); + FD_ZERO(&rfds); + for ( CommsSet::iterator iter = mReaders.begin(); iter != mReaders.end(); iter++ ) + FD_SET((*iter)->getReadDesc(),&rfds); + + mWriteable.clear(); + FD_ZERO(&wfds); + for ( CommsSet::iterator iter = mWriters.begin(); iter != mWriters.end(); iter++ ) + FD_SET((*iter)->getWriteDesc(),&wfds); + + int nFound = select( mMaxFd+1, &rfds, &wfds, NULL, selectTimeout ); + if( nFound == 0 ) + { + Debug( 1, "Select timed out" ); + } + else if ( nFound < 0) + { + Error( "Select error: %s", strerror(errno) ); + } + else + { + for ( CommsSet::iterator iter = mReaders.begin(); iter != mReaders.end(); iter++ ) + if ( FD_ISSET((*iter)->getReadDesc(),&rfds) ) + mReadable.push_back( *iter ); + for ( CommsSet::iterator iter = mWriters.begin(); iter != mWriters.end(); iter++ ) + if ( FD_ISSET((*iter)->getWriteDesc(),&rfds) ) + mWriteable.push_back( *iter ); + } + return( nFound ); +} + +const Select::CommsList &Select::getReadable() const +{ + return( mReadable ); +} + +const Select::CommsList &Select::getWriteable() const +{ + return( mWriteable ); +} diff --git a/src/zm_comms.h b/src/zm_comms.h new file mode 100644 index 000000000..60d4a3ad4 --- /dev/null +++ b/src/zm_comms.h @@ -0,0 +1,889 @@ +// +// ZoneMinder Communicatoions Class Interface, $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. +// + +#ifndef ZM_COMMS_H +#define ZM_COMMS_H + +#include "zm_exception.h" + +#include +#include +#include +#include + +#include +#include + +class CommsException : public Exception +{ +public: + CommsException( const std::string &message ) : Exception( message ) + { + } +}; + +class CommsBase +{ +protected: + const int &mRd; + const int &mWd; + +protected: + CommsBase( int &rd, int &wd ) : mRd( rd ), mWd( wd ) + { + } + virtual ~CommsBase() + { + } + +public: + virtual bool close()=0; + virtual bool isOpen() const=0; + virtual bool isClosed() const=0; + virtual bool setBlocking( bool blocking )=0; + +public: + int getReadDesc() const + { + return( mRd ); + } + int getWriteDesc() const + { + return( mWd ); + } + int getMaxDesc() const + { + return( mRd>mWd?mRd:mWd ); + } + + virtual int read( void *msg, int len ) + { + ssize_t nBytes = ::read( mRd, msg, len ); + if ( nBytes < 0 ) + Debug( 1, "Read of %d bytes max on rd %d failed: %s", len, mRd, strerror(errno) ); + return( nBytes ); + } + virtual int write( const void *msg, int len ) + { + ssize_t nBytes = ::write( mWd, msg, len ); + if ( nBytes < 0 ) + Debug( 1, "Write of %d bytes on wd %d failed: %s", len, mWd, strerror(errno) ); + return( nBytes ); + } + virtual int readV( const struct iovec *iov, int iovcnt ) + { + int nBytes = ::readv( mRd, iov, iovcnt ); + if ( nBytes < 0 ) + Debug( 1, "Readv of %d buffers max on rd %d failed: %s", iovcnt, mRd, strerror(errno) ); + return( nBytes ); + } + virtual int writeV( const struct iovec *iov, int iovcnt ) + { + ssize_t nBytes = ::writev( mWd, iov, iovcnt ); + if ( nBytes < 0 ) + Debug( 1, "Writev of %d buffers on wd %d failed: %s", iovcnt, mWd, strerror(errno) ); + return( nBytes ); + } + virtual int readV( int iovcnt, /* const void *msg1, int len1, */ ... ); + virtual int writeV( int iovcnt, /* const void *msg1, int len1, */ ... ); +}; + +class Pipe : public CommsBase +{ +protected: + int mFd[2]; + +public: + Pipe() : CommsBase( mFd[0], mFd[1] ) + { + mFd[0] = -1; + mFd[1] = -1; + } + ~Pipe() + { + close(); + } + +public: + bool open(); + bool close(); + + bool isOpen() const + { + return( mFd[0] != -1 && mFd[1] != -1 ); + } + int getReadDesc() const + { + return( mFd[0] ); + } + int getWriteDesc() const + { + return( mFd[1] ); + } + + bool setBlocking( bool blocking ); +}; + +class SockAddr +{ +private: + const struct sockaddr *mAddr; + +public: + SockAddr( const struct sockaddr *addr ); + virtual ~SockAddr() + { + } + + static SockAddr *newSockAddr( const struct sockaddr &addr, socklen_t len ); + static SockAddr *newSockAddr( const SockAddr *addr ); + + int getDomain() const + { + return( mAddr?mAddr->sa_family:AF_UNSPEC ); + } + + const struct sockaddr *getAddr() const + { + return( mAddr ); + } + virtual socklen_t getAddrSize() const=0; + virtual struct sockaddr *getTempAddr() const=0; +}; + +class SockAddrInet : public SockAddr +{ +private: + struct sockaddr_in mAddrIn; + struct sockaddr_in mTempAddrIn; + +public: + SockAddrInet(); + SockAddrInet( const SockAddrInet &addr ) : SockAddr( (const struct sockaddr *)&mAddrIn ), mAddrIn( addr.mAddrIn ) + { + } + SockAddrInet( const struct sockaddr_in *addr ) : SockAddr( (const struct sockaddr *)&mAddrIn ), mAddrIn( *addr ) + { + } + + + bool resolve( const char *host, const char *serv, const char *proto ); + bool resolve( const char *host, int port, const char *proto ); + bool resolve( const char *serv, const char *proto ); + bool resolve( int port, const char *proto ); + + socklen_t getAddrSize() const + { + return( sizeof(mAddrIn) ); + } + struct sockaddr *getTempAddr() const + { + return( (sockaddr *)&mTempAddrIn ); + } + +public: + static socklen_t addrSize() + { + return( sizeof(sockaddr_in) ); + } +}; + +class SockAddrUnix : public SockAddr +{ +private: + struct sockaddr_un mAddrUn; + struct sockaddr_un mTempAddrUn; + +public: + SockAddrUnix(); + SockAddrUnix( const SockAddrUnix &addr ) : SockAddr( (const struct sockaddr *)&mAddrUn ), mAddrUn( addr.mAddrUn ) + { + } + SockAddrUnix( const struct sockaddr_un *addr ) : SockAddr( (const struct sockaddr *)&mAddrUn ), mAddrUn( *addr ) + { + } + + bool resolve( const char *path, const char *proto ); + + socklen_t getAddrSize() const + { + return( sizeof(mAddrUn) ); + } + struct sockaddr *getTempAddr() const + { + return( (sockaddr *)&mTempAddrUn ); + } + +public: + static socklen_t addrSize() + { + return( sizeof(sockaddr_un) ); + } +}; + +class Socket : public CommsBase +{ +protected: + typedef enum { CLOSED, DISCONNECTED, LISTENING, CONNECTED } State; + +protected: + int mSd; + State mState; + SockAddr *mLocalAddr; + SockAddr *mRemoteAddr; + +protected: + Socket() : CommsBase( mSd, mSd ), mSd( -1 ), mState( CLOSED ), mLocalAddr( 0 ), mRemoteAddr( 0 ) + { + } + Socket( const Socket &socket, int newSd ) : CommsBase( mSd, mSd ), mSd( newSd ), mState( CONNECTED ), mLocalAddr( 0 ), mRemoteAddr( 0 ) + { + if ( socket.mLocalAddr ) + mLocalAddr = SockAddr::newSockAddr( mLocalAddr ); + if ( socket.mRemoteAddr ) + mRemoteAddr = SockAddr::newSockAddr( mRemoteAddr ); + } + virtual ~Socket() + { + close(); + delete mLocalAddr; + delete mRemoteAddr; + } + +public: + bool isOpen() const + { + return( !isClosed() ); + } + bool isClosed() const + { + return( mState == CLOSED ); + } + bool isDisconnected() const + { + return( mState == DISCONNECTED ); + } + bool isConnected() const + { + return( mState == CONNECTED ); + } + virtual bool close(); + +protected: + bool isListening() const + { + return( mState == LISTENING ); + } + +protected: + virtual bool socket(); + virtual bool bind(); + +protected: + virtual bool connect(); + virtual bool listen(); + virtual bool accept(); + virtual bool accept( int & ); + +public: + virtual int send( const void *msg, int len ) const + { + ssize_t nBytes = ::send( mSd, msg, len, 0 ); + if ( nBytes < 0 ) + Debug( 1, "Send of %d bytes on sd %d failed: %s", len, mSd, strerror(errno) ); + return( nBytes ); + } + virtual int recv( void *msg, int len ) const + { + ssize_t nBytes = ::recv( mSd, msg, len, 0 ); + if ( nBytes < 0 ) + Debug( 1, "Recv of %d bytes max on sd %d failed: %s", len, mSd, strerror(errno) ); + return( nBytes ); + } + virtual int send( const std::string &msg ) const + { + ssize_t nBytes = ::send( mSd, msg.data(), msg.size(), 0 ); + if ( nBytes < 0 ) + Debug( 1, "Send of string '%s' (%zd bytes) on sd %d failed: %s", msg.c_str(), msg.size(), mSd, strerror(errno) ); + return( nBytes ); + } + virtual int recv( std::string &msg ) const + { + char buffer[msg.capacity()]; + int nBytes = 0; + if ( (nBytes = ::recv( mSd, buffer, sizeof(buffer), 0 )) < 0 ) + { + Debug( 1, "Recv of %zd bytes max to string on sd %d failed: %s", sizeof(buffer), mSd, strerror(errno) ); + return( nBytes ); + } + buffer[nBytes] = '\0'; + msg = buffer; + return( nBytes ); + } + virtual int recv( std::string &msg, size_t maxLen ) const + { + char buffer[maxLen]; + int nBytes = 0; + if ( (nBytes = ::recv( mSd, buffer, sizeof(buffer), 0 )) < 0 ) + { + Debug( 1, "Recv of %zd bytes max to string on sd %d failed: %s", maxLen, mSd, strerror(errno) ); + return( nBytes ); + } + buffer[nBytes] = '\0'; + msg = buffer; + return( nBytes ); + } + virtual int bytesToRead() const; + + int getDesc() const + { + return( mSd ); + } + //virtual bool isOpen() const + //{ + //return( mSd != -1 ); + //} + + virtual int getDomain() const=0; + virtual int getType() const=0; + virtual const char *getProtocol() const=0; + + const SockAddr *getLocalAddr() const + { + return( mLocalAddr ); + } + const SockAddr *getRemoteAddr() const + { + return( mRemoteAddr ); + } + virtual socklen_t getAddrSize() const=0; + + bool getBlocking( bool &blocking ); + bool setBlocking( bool blocking ); + + bool getSendBufferSize( int & ) const; + bool getRecvBufferSize( int & ) const; + + bool setSendBufferSize( int ); + bool setRecvBufferSize( int ); + + bool getRouting( bool & ) const; + bool setRouting( bool ); + + bool getNoDelay( bool & ) const; + bool setNoDelay( bool ); +}; + +class InetSocket : virtual public Socket +{ +public: + int getDomain() const + { + return( AF_INET ); + } + virtual socklen_t getAddrSize() const + { + return( SockAddrInet::addrSize() ); + } + +protected: + bool resolveLocal( const char *host, const char *serv, const char *proto ) + { + SockAddrInet *addr = new SockAddrInet; + mLocalAddr = addr; + return( addr->resolve( host, serv, proto ) ); + } + bool resolveLocal( const char *host, int port, const char *proto ) + { + SockAddrInet *addr = new SockAddrInet; + mLocalAddr = addr; + return( addr->resolve( host, port, proto ) ); + } + bool resolveLocal( const char *serv, const char *proto ) + { + SockAddrInet *addr = new SockAddrInet; + mLocalAddr = addr; + return( addr->resolve( serv, proto ) ); + } + bool resolveLocal( int port, const char *proto ) + { + SockAddrInet *addr = new SockAddrInet; + mLocalAddr = addr; + return( addr->resolve( port, proto ) ); + } + + bool resolveRemote( const char *host, const char *serv, const char *proto ) + { + SockAddrInet *addr = new SockAddrInet; + mRemoteAddr = addr; + return( addr->resolve( host, serv, proto ) ); + } + bool resolveRemote( const char *host, int port, const char *proto ) + { + SockAddrInet *addr = new SockAddrInet; + mRemoteAddr = addr; + return( addr->resolve( host, port, proto ) ); + } + +protected: + bool bind( const SockAddrInet &addr ) + { + mLocalAddr = new SockAddrInet( addr ); + return( Socket::bind() ); + } + bool bind( const char *host, const char *serv ) + { + if ( !resolveLocal( host, serv, getProtocol() ) ) + return( false ); + return( Socket::bind() ); + } + bool bind( const char *host, int port ) + { + if ( !resolveLocal( host, port, getProtocol() ) ) + return( false ); + return( Socket::bind() ); + } + bool bind( const char *serv ) + { + if ( !resolveLocal( serv, getProtocol() ) ) + return( false ); + return( Socket::bind() ); + } + bool bind( int port ) + { + if ( !resolveLocal( port, getProtocol() ) ) + return( false ); + return( Socket::bind() ); + } + + bool connect( const SockAddrInet &addr ) + { + mRemoteAddr = new SockAddrInet( addr ); + return( Socket::connect() ); + } + bool connect( const char *host, const char *serv ) + { + if ( !resolveRemote( host, serv, getProtocol() ) ) + return( false ); + return( Socket::connect() ); + } + bool connect( const char *host, int port ) + { + if ( !resolveRemote( host, port, getProtocol() ) ) + return( false ); + return( Socket::connect() ); + } +}; + +class UnixSocket : virtual public Socket +{ +public: + int getDomain() const + { + return( AF_UNIX ); + } + virtual socklen_t getAddrSize() const + { + return( SockAddrUnix::addrSize() ); + } + +protected: + bool resolveLocal( const char *serv, const char *proto ) + { + SockAddrUnix *addr = new SockAddrUnix; + mLocalAddr = addr; + return( addr->resolve( serv, proto ) ); + } + + bool resolveRemote( const char *path, const char *proto ) + { + SockAddrUnix *addr = new SockAddrUnix; + mRemoteAddr = addr; + return( addr->resolve( path, proto ) ); + } + +protected: + bool bind( const char *path ) + { + if ( !UnixSocket::resolveLocal( path, getProtocol() ) ) + return( false ); + return( Socket::bind() ); + } + + bool connect( const char *path ) + { + if ( !UnixSocket::resolveRemote( path, getProtocol() ) ) + return( false ); + return( Socket::connect() ); + } +}; + +class UdpSocket : virtual public Socket +{ +public: + int getType() const + { + return( SOCK_DGRAM ); + } + const char *getProtocol() const + { + return( "udp" ); + } + +public: + virtual int sendto( const void *msg, int len, const SockAddr *addr=0 ) const + { + ssize_t nBytes = ::sendto( mSd, msg, len, 0, addr?addr->getAddr():NULL, addr?addr->getAddrSize():0 ); + if ( nBytes < 0 ) + Debug( 1, "Sendto of %d bytes on sd %d failed: %s", len, mSd, strerror(errno) ); + return( nBytes ); + } + virtual int recvfrom( void *msg, int len, SockAddr *addr=0 ) const + { + ssize_t nBytes = 0; + if ( addr ) + { + struct sockaddr sockAddr; + socklen_t sockLen; + nBytes = ::recvfrom( mSd, msg, len, 0, &sockAddr, &sockLen ); + if ( nBytes < 0 ) + { + Debug( 1, "Recvfrom of %d bytes max on sd %d (with address) failed: %s", len, mSd, strerror(errno) ); + } + else if ( sockLen ) + { + addr = SockAddr::newSockAddr( sockAddr, sockLen ); + } + } + else + { + nBytes = ::recvfrom( mSd, msg, len, 0, NULL, 0 ); + if ( nBytes < 0 ) + Debug( 1, "Recvfrom of %d bytes max on sd %d (no address) failed: %s", len, mSd, strerror(errno) ); + } + return( nBytes ); + } +}; + +class UdpInetSocket : virtual public UdpSocket, virtual public InetSocket +{ +public: + bool bind( const SockAddrInet &addr ) + { + return( InetSocket::bind( addr ) ); + } + bool bind( const char *host, const char *serv ) + { + return( InetSocket::bind( host, serv ) ); + } + bool bind( const char *host, int port ) + { + return( InetSocket::bind( host, port ) ); + } + bool bind( const char *serv ) + { + return( InetSocket::bind( serv ) ); + } + bool bind( int port ) + { + return( InetSocket::bind( port ) ); + } + + bool connect( const SockAddrInet &addr ) + { + return( InetSocket::connect( addr ) ); + } + bool connect( const char *host, const char *serv ) + { + return( InetSocket::connect( host, serv ) ); + } + bool connect( const char *host, int port ) + { + return( InetSocket::connect( host, port ) ); + } +}; + +class UdpUnixSocket : virtual public UdpSocket, virtual public UnixSocket +{ +public: + bool bind( const char *path ) + { + return( UnixSocket::bind( path ) ); + } + + bool connect( const char *path ) + { + return( UnixSocket::connect( path ) ); + } +}; + +class UdpInetClient : public UdpInetSocket +{ +protected: + bool bind( const SockAddrInet &addr ) + { + return( UdpInetSocket::bind( addr ) ); + } + bool bind( const char *host, const char *serv ) + { + return( UdpInetSocket::bind( host, serv ) ); + } + bool bind( const char *host, int port ) + { + return( UdpInetSocket::bind( host, port ) ); + } + bool bind( const char *serv ) + { + return( UdpInetSocket::bind( serv ) ); + } + bool bind( int port ) + { + return( UdpInetSocket::bind( port ) ); + } + +public: + bool connect( const SockAddrInet &addr ) + { + return( UdpInetSocket::connect( addr ) ); + } + bool connect( const char *host, const char *serv ) + { + return( UdpInetSocket::connect( host, serv ) ); + } + bool connect( const char *host, int port ) + { + return( UdpInetSocket::connect( host, port ) ); + } +}; + +class UdpUnixClient : public UdpUnixSocket +{ +public: + bool bind( const char *path ) + { + return( UdpUnixSocket::bind( path ) ); + } + +public: + bool connect( const char *path ) + { + return( UdpUnixSocket::connect( path) ); + } +}; + +class UdpInetServer : public UdpInetSocket +{ +public: + bool bind( const SockAddrInet &addr ) + { + return( UdpInetSocket::bind( addr ) ); + } + bool bind( const char *host, const char *serv ) + { + return( UdpInetSocket::bind( host, serv ) ); + } + bool bind( const char *host, int port ) + { + return( UdpInetSocket::bind( host, port ) ); + } + bool bind( const char *serv ) + { + return( UdpInetSocket::bind( serv ) ); + } + bool bind( int port ) + { + return( UdpInetSocket::bind( port ) ); + } + +protected: + bool connect( const char *host, const char *serv ) + { + return( UdpInetSocket::connect( host, serv ) ); + } + bool connect( const char *host, int port ) + { + return( UdpInetSocket::connect( host, port ) ); + } +}; + +class UdpUnixServer : public UdpUnixSocket +{ +public: + bool bind( const char *path ) + { + return( UdpUnixSocket::bind( path ) ); + } + +protected: + bool connect( const char *path ) + { + return( UdpUnixSocket::connect( path ) ); + } +}; + +class TcpSocket : virtual public Socket +{ +public: + TcpSocket() + { + } + TcpSocket( const TcpSocket &socket, int newSd ) : Socket( socket, newSd ) + { + } + +public: + int getType() const + { + return( SOCK_STREAM ); + } + const char *getProtocol() const + { + return( "tcp" ); + } +}; + +class TcpInetSocket : virtual public TcpSocket, virtual public InetSocket +{ +public: + TcpInetSocket() + { + } + TcpInetSocket( const TcpInetSocket &socket, int newSd ) : TcpSocket( socket, newSd ) + { + } +}; + +class TcpUnixSocket : virtual public TcpSocket, virtual public UnixSocket +{ +public: + TcpUnixSocket() + { + } + TcpUnixSocket( const TcpUnixSocket &socket, int newSd ) : TcpSocket( socket, newSd ) + { + } +}; + +class TcpInetClient : public TcpInetSocket +{ +public: + bool connect( const char *host, const char *serv ) + { + return( TcpInetSocket::connect( host, serv ) ); + } + bool connect( const char *host, int port ) + { + return( TcpInetSocket::connect( host, port ) ); + } +}; + +class TcpUnixClient : public TcpUnixSocket +{ +public: + bool connect( const char *path ) + { + return( TcpUnixSocket::connect( path) ); + } +}; + +class TcpInetServer : public TcpInetSocket +{ +public: + bool bind( const char *host, const char *serv ) + { + return( TcpInetSocket::bind( host, serv ) ); + } + bool bind( const char *host, int port ) + { + return( TcpInetSocket::bind( host, port ) ); + } + bool bind( const char *serv ) + { + return( TcpInetSocket::bind( serv ) ); + } + bool bind( int port ) + { + return( TcpInetSocket::bind( port ) ); + } + +public: + bool isListening() const { return( Socket::isListening() ); } + bool listen(); + bool accept(); + bool accept( TcpInetSocket *&newSocket ); +}; + +class TcpUnixServer : public TcpUnixSocket +{ +public: + bool bind( const char *path ) + { + return( TcpUnixSocket::bind( path ) ); + } + +public: + bool isListening() const { return( Socket::isListening() ); } + bool listen(); + bool accept(); + bool accept( TcpUnixSocket *&newSocket ); +}; + +class Select +{ +public: + typedef std::set CommsSet; + typedef std::vector CommsList; + +protected: + CommsSet mReaders; + CommsSet mWriters; + CommsList mReadable; + CommsList mWriteable; + bool mHasTimeout; + struct timeval mTimeout; + int mMaxFd; + +public: + Select(); + Select( struct timeval timeout ); + Select( int timeout ); + Select( double timeout ); + + void setTimeout( int timeout ); + void setTimeout( double timeout ); + void setTimeout( struct timeval timeout ); + void clearTimeout(); + + void calcMaxFd(); + + bool addReader( CommsBase *comms ); + bool deleteReader( CommsBase *comms ); + void clearReaders(); + + bool addWriter( CommsBase *comms ); + bool deleteWriter( CommsBase *comms ); + void clearWriters(); + + int wait(); + + const CommsList &getReadable() const; + const CommsList &getWriteable() const; +}; + +#endif // ZM_COMMS_H diff --git a/src/zm_config.cpp b/src/zm_config.cpp new file mode 100644 index 000000000..2b54cfeb1 --- /dev/null +++ b/src/zm_config.cpp @@ -0,0 +1,301 @@ +// +// ZoneMinder Configuration Implementation, $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. +// + +#include "zm.h" +#include "zm_db.h" + +#include +#include +#include +#include + +void zmLoadConfig() +{ + FILE *cfg; + char line[512]; + char *val; + if ( (cfg = fopen( ZM_CONFIG, "r")) == NULL ) + { + Fatal( "Can't open %s: %s", ZM_CONFIG, strerror(errno) ); + } + while ( fgets( line, sizeof(line), cfg ) != NULL ) + { + char *line_ptr = line; + + // Trim off any cr/lf line endings + int chomp_len = strcspn( line_ptr, "\r\n" ); + line_ptr[chomp_len] = '\0'; + + // Remove leading white space + int white_len = strspn( line_ptr, " \t" ); + line_ptr += white_len; + + // Check for comment or empty line + if ( *line_ptr == '\0' || *line_ptr == '#' ) + continue; + + // Remove trailing white space + char *temp_ptr = line_ptr+strlen(line_ptr)-1; + while ( *temp_ptr == ' ' || *temp_ptr == '\t' ) + { + *temp_ptr-- = '\0'; + temp_ptr--; + } + + // Now look for the '=' in the middle of the line + temp_ptr = strchr( line_ptr, '=' ); + if ( !temp_ptr ) + { + Warning( "Invalid data in %s: '%s'", ZM_CONFIG, line ); + continue; + } + + // Assign the name and value parts + char *name_ptr = line_ptr; + char *val_ptr = temp_ptr+1; + + // Trim trailing space from the name part + do + { + *temp_ptr = '\0'; + temp_ptr--; + } + while ( *temp_ptr == ' ' || *temp_ptr == '\t' ); + + // Remove leading white space from the value part + white_len = strspn( val_ptr, " \t" ); + val_ptr += white_len; + + val = (char *)malloc( strlen(val_ptr)+1 ); + strncpy( val, val_ptr, strlen(val_ptr)+1 ); + + if ( strcasecmp( name_ptr, "ZM_DB_HOST" ) == 0 ) + staticConfig.DB_HOST = val; + else if ( strcasecmp( name_ptr, "ZM_DB_NAME" ) == 0 ) + staticConfig.DB_NAME = val; + else if ( strcasecmp( name_ptr, "ZM_DB_USER" ) == 0 ) + staticConfig.DB_USER = val; + else if ( strcasecmp( name_ptr, "ZM_DB_PASS" ) == 0 ) + staticConfig.DB_PASS = val; + else if ( strcasecmp( name_ptr, "ZM_PATH_WEB" ) == 0 ) + staticConfig.PATH_WEB = val; + else + { + // We ignore this now as there may be more parameters than the + // c/c++ binaries are bothered about + // Warning( "Invalid parameter '%s' in %s", name_ptr, ZM_CONFIG ); + } + } + fclose( cfg); + zmDbConnect(); + config.Load(); + config.Assign(); +} + +StaticConfig staticConfig; + +ConfigItem::ConfigItem( const char *p_name, const char *p_value, const char *const p_type ) +{ + name = new char[strlen(p_name)+1]; + strcpy( name, p_name ); + value = new char[strlen(p_value)+1]; + strcpy( value, p_value ); + type = new char[strlen(p_type)+1]; + strcpy( type, p_type ); + + //Info( "Created new config item %s = %s (%s)\n", name, value, type ); + + accessed = false; +} + +ConfigItem::~ConfigItem() +{ + delete[] name; + delete[] value; + delete[] type; +} + +void ConfigItem::ConvertValue() const +{ + if ( !strcmp( type, "boolean" ) ) + { + cfg_type = CFG_BOOLEAN; + cfg_value.boolean_value = (bool)strtol( value, 0, 0 ); + } + else if ( !strcmp( type, "integer" ) ) + { + cfg_type = CFG_INTEGER; + cfg_value.integer_value = strtol( value, 0, 10 ); + } + else if ( !strcmp( type, "hexadecimal" ) ) + { + cfg_type = CFG_INTEGER; + cfg_value.integer_value = strtol( value, 0, 16 ); + } + else if ( !strcmp( type, "decimal" ) ) + { + cfg_type = CFG_DECIMAL; + cfg_value.decimal_value = strtod( value, 0 ); + } + else + { + cfg_type = CFG_STRING; + cfg_value.string_value = value; + } + accessed = true; +} + +bool ConfigItem::BooleanValue() const +{ + if ( !accessed ) + ConvertValue(); + + if ( cfg_type != CFG_BOOLEAN ) + { + Error( "Attempt to fetch boolean value for %s, actual type is %s. Try running 'zmupdate.pl -f' to reload config.", name, type ); + exit( -1 ); + } + + return( cfg_value.boolean_value ); +} + +int ConfigItem::IntegerValue() const +{ + if ( !accessed ) + ConvertValue(); + + if ( cfg_type != CFG_INTEGER ) + { + Error( "Attempt to fetch integer value for %s, actual type is %s. Try running 'zmupdate.pl -f' to reload config.", name, type ); + exit( -1 ); + } + + return( cfg_value.integer_value ); +} + +double ConfigItem::DecimalValue() const +{ + if ( !accessed ) + ConvertValue(); + + if ( cfg_type != CFG_DECIMAL ) + { + Error( "Attempt to fetch decimal value for %s, actual type is %s. Try running 'zmupdate.pl -f' to reload config.", name, type ); + exit( -1 ); + } + + return( cfg_value.decimal_value ); +} + +const char *ConfigItem::StringValue() const +{ + if ( !accessed ) + ConvertValue(); + + if ( cfg_type != CFG_STRING ) + { + Error( "Attempt to fetch string value for %s, actual type is %s. Try running 'zmupdate.pl -f' to reload config.", name, type ); + exit( -1 ); + } + + return( cfg_value.string_value ); +} + +Config::Config() +{ + n_items = 0; + items = 0; +} + +Config::~Config() +{ + if ( items ) + { + for ( int i = 0; i < n_items; i++ ) + { + delete items[i]; + } + delete[] items; + } +} + +void Config::Load() +{ + static char sql[ZM_SQL_SML_BUFSIZ]; + + strncpy( sql, "select Name, Value, Type from Config order by Id", sizeof(sql) ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + n_items = mysql_num_rows( result ); + + if ( n_items <= ZM_MAX_CFG_ID ) + { + Error( "Config mismatch, expected %d items, read %d. Try running 'zmupdate.pl -f' to reload config.", ZM_MAX_CFG_ID+1, n_items ); + exit( -1 ); + } + + items = new ConfigItem *[n_items]; + for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) + { + items[i] = new ConfigItem( dbrow[0], dbrow[1], dbrow[2] ); + } + mysql_free_result( result ); +} + +void Config::Assign() +{ +ZM_CFG_ASSIGN_LIST +} + +const ConfigItem &Config::Item( int id ) +{ + if ( !n_items ) + { + Load(); + Assign(); + } + + if ( id < 0 || id > ZM_MAX_CFG_ID ) + { + Error( "Attempt to access invalid config, id = %d. Try running 'zmupdate.pl -f' to reload config.", id ); + exit( -1 ); + } + + ConfigItem *item = items[id]; + + if ( !item ) + { + Error( "Can't find config item %d", id ); + exit( -1 ); + } + + return( *item ); +} + +Config config; diff --git a/src/zm_config.h b/src/zm_config.h new file mode 100644 index 000000000..10928a82e --- /dev/null +++ b/src/zm_config.h @@ -0,0 +1,135 @@ +// +// ZoneMinder Configuration, $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. +// + +#ifndef ZM_CONFIG_H +#define ZM_CONFIG_H + +#include "config.h" +#include "zm_config_defines.h" + +#include + +#define ZM_CONFIG "/etc/zm/zm.conf" // Path to config file +#define ZM_VERSION "1.25.0" // ZoneMinder Version + +#define ZM_HAS_V4L1 0 +#define ZM_HAS_V4L2 1 +#define ZM_HAS_V4L 1 + +#ifdef HAVE_LIBAVFORMAT +#define ZM_HAS_FFMPEG 1 +#endif // HAVE_LIBAVFORMAT + +#define ZM_MAX_IMAGE_WIDTH 2048 // The largest image we imagine ever handling +#define ZM_MAX_IMAGE_HEIGHT 1536 // The largest image we imagine ever handling +#define ZM_MAX_IMAGE_COLOURS 4 // The largest image we imagine ever handling +#define ZM_MAX_IMAGE_DIM (ZM_MAX_IMAGE_WIDTH*ZM_MAX_IMAGE_HEIGHT) +#define ZM_MAX_IMAGE_SIZE (ZM_MAX_IMAGE_DIM*ZM_MAX_IMAGE_COLOURS) + +#define ZM_SCALE_BASE 100 // The factor by which we bump up 'scale' to simulate FP +#define ZM_RATE_BASE 100 // The factor by which we bump up 'rate' to simulate FP + +#define ZM_SQL_SML_BUFSIZ 256 // Size of SQL buffer +#define ZM_SQL_MED_BUFSIZ 1024 // Size of SQL buffer +#define ZM_SQL_LGE_BUFSIZ 8192 // Size of SQL buffer + +#define ZM_NETWORK_BUFSIZ 32768 // Size of network buffer + +#define ZM_MAX_FPS 30 // The maximum frame rate we expect to handle +#define ZM_SAMPLE_RATE int(1000000/ZM_MAX_FPS) // A general nyquist sample frequency for delays etc +#define ZM_SUSPENDED_RATE int(1000000/4) // A slower rate for when disabled etc + +extern void zmLoadConfig(); + +struct StaticConfig +{ + std::string DB_HOST; + std::string DB_NAME; + std::string DB_USER; + std::string DB_PASS; + std::string PATH_WEB; +}; + +extern StaticConfig staticConfig; + +class ConfigItem +{ +private: + char *name; + char *value; + char *type; + + mutable enum { CFG_BOOLEAN, CFG_INTEGER, CFG_DECIMAL, CFG_STRING } cfg_type; + mutable union + { + bool boolean_value; + int integer_value; + double decimal_value; + char *string_value; + } cfg_value; + mutable bool accessed; + +public: + ConfigItem( const char *p_name, const char *p_value, const char *const p_type ); + ~ConfigItem(); + void ConvertValue() const; + bool BooleanValue() const; + int IntegerValue() const; + double DecimalValue() const; + const char *StringValue() const; + + inline operator bool() const + { + return( BooleanValue() ); + } + inline operator int() const + { + return( IntegerValue() ); + } + inline operator double() const + { + return( DecimalValue() ); + } + inline operator const char *() const + { + return( StringValue() ); + } +}; + +class Config +{ +public: + ZM_CFG_DECLARE_LIST + +private: + int n_items; + ConfigItem **items; + +public: + Config(); + ~Config(); + + void Load(); + void Assign(); + const ConfigItem &Item( int id ); +}; + +extern Config config; + +#endif // ZM_CONFIG_H diff --git a/src/zm_config.h.in b/src/zm_config.h.in new file mode 100644 index 000000000..01098c90f --- /dev/null +++ b/src/zm_config.h.in @@ -0,0 +1,135 @@ +// +// ZoneMinder Configuration, $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. +// + +#ifndef ZM_CONFIG_H +#define ZM_CONFIG_H + +#include "config.h" +#include "zm_config_defines.h" + +#include + +#define ZM_CONFIG "@ZM_CONFIG@" // Path to config file +#define ZM_VERSION "@VERSION@" // ZoneMinder Version + +#define ZM_HAS_V4L1 @ZM_HAS_V4L1@ +#define ZM_HAS_V4L2 @ZM_HAS_V4L2@ +#define ZM_HAS_V4L @ZM_HAS_V4L@ + +#ifdef HAVE_LIBAVFORMAT +#define ZM_HAS_FFMPEG 1 +#endif // HAVE_LIBAVFORMAT + +#define ZM_MAX_IMAGE_WIDTH 2048 // The largest image we imagine ever handling +#define ZM_MAX_IMAGE_HEIGHT 1536 // The largest image we imagine ever handling +#define ZM_MAX_IMAGE_COLOURS 4 // The largest image we imagine ever handling +#define ZM_MAX_IMAGE_DIM (ZM_MAX_IMAGE_WIDTH*ZM_MAX_IMAGE_HEIGHT) +#define ZM_MAX_IMAGE_SIZE (ZM_MAX_IMAGE_DIM*ZM_MAX_IMAGE_COLOURS) + +#define ZM_SCALE_BASE 100 // The factor by which we bump up 'scale' to simulate FP +#define ZM_RATE_BASE 100 // The factor by which we bump up 'rate' to simulate FP + +#define ZM_SQL_SML_BUFSIZ 256 // Size of SQL buffer +#define ZM_SQL_MED_BUFSIZ 1024 // Size of SQL buffer +#define ZM_SQL_LGE_BUFSIZ 8192 // Size of SQL buffer + +#define ZM_NETWORK_BUFSIZ 32768 // Size of network buffer + +#define ZM_MAX_FPS 30 // The maximum frame rate we expect to handle +#define ZM_SAMPLE_RATE int(1000000/ZM_MAX_FPS) // A general nyquist sample frequency for delays etc +#define ZM_SUSPENDED_RATE int(1000000/4) // A slower rate for when disabled etc + +extern void zmLoadConfig(); + +struct StaticConfig +{ + std::string DB_HOST; + std::string DB_NAME; + std::string DB_USER; + std::string DB_PASS; + std::string PATH_WEB; +}; + +extern StaticConfig staticConfig; + +class ConfigItem +{ +private: + char *name; + char *value; + char *type; + + mutable enum { CFG_BOOLEAN, CFG_INTEGER, CFG_DECIMAL, CFG_STRING } cfg_type; + mutable union + { + bool boolean_value; + int integer_value; + double decimal_value; + char *string_value; + } cfg_value; + mutable bool accessed; + +public: + ConfigItem( const char *p_name, const char *p_value, const char *const p_type ); + ~ConfigItem(); + void ConvertValue() const; + bool BooleanValue() const; + int IntegerValue() const; + double DecimalValue() const; + const char *StringValue() const; + + inline operator bool() const + { + return( BooleanValue() ); + } + inline operator int() const + { + return( IntegerValue() ); + } + inline operator double() const + { + return( DecimalValue() ); + } + inline operator const char *() const + { + return( StringValue() ); + } +}; + +class Config +{ +public: + ZM_CFG_DECLARE_LIST + +private: + int n_items; + ConfigItem **items; + +public: + Config(); + ~Config(); + + void Load(); + void Assign(); + const ConfigItem &Item( int id ); +}; + +extern Config config; + +#endif // ZM_CONFIG_H diff --git a/src/zm_config_defines.h b/src/zm_config_defines.h new file mode 100644 index 000000000..e16183ea9 --- /dev/null +++ b/src/zm_config_defines.h @@ -0,0 +1,676 @@ +// The file is autogenerated by zmconfgen.pl +// Do not edit this file as any changes will be overwritten + +#define ZM_LANG_DEFAULT 0 +#define ZM_OPT_USE_AUTH 1 +#define ZM_AUTH_TYPE 2 +#define ZM_AUTH_RELAY 3 +#define ZM_AUTH_HASH_SECRET 4 +#define ZM_AUTH_HASH_IPS 5 +#define ZM_AUTH_HASH_LOGINS 6 +#define ZM_DIR_EVENTS 7 +#define ZM_USE_DEEP_STORAGE 8 +#define ZM_DIR_IMAGES 9 +#define ZM_DIR_SOUNDS 10 +#define ZM_PATH_ZMS 11 +#define ZM_COLOUR_JPEG_FILES 12 +#define ZM_ADD_JPEG_COMMENTS 13 +#define ZM_JPEG_FILE_QUALITY 14 +#define ZM_JPEG_ALARM_FILE_QUALITY 15 +#define ZM_JPEG_IMAGE_QUALITY 16 +#define ZM_JPEG_STREAM_QUALITY 17 +#define ZM_MPEG_TIMED_FRAMES 18 +#define ZM_MPEG_LIVE_FORMAT 19 +#define ZM_MPEG_REPLAY_FORMAT 20 +#define ZM_RAND_STREAM 21 +#define ZM_OPT_CAMBOZOLA 22 +#define ZM_PATH_CAMBOZOLA 23 +#define ZM_RELOAD_CAMBOZOLA 24 +#define ZM_TIMESTAMP_ON_CAPTURE 25 +#define ZM_CPU_EXTENSIONS 26 +#define ZM_FAST_IMAGE_BLENDS 27 +#define ZM_OPT_ADAPTIVE_SKIP 28 +#define ZM_BLEND_ALARMED_IMAGES 29 +#define ZM_MAX_SUSPEND_TIME 30 +#define ZM_OPT_REMOTE_CAMERAS 31 +#define ZM_NETCAM_REGEXPS 32 +#define ZM_HTTP_VERSION 33 +#define ZM_HTTP_UA 34 +#define ZM_HTTP_TIMEOUT 35 +#define ZM_MIN_RTP_PORT 36 +#define ZM_MAX_RTP_PORT 37 +#define ZM_OPT_FFMPEG 38 +#define ZM_PATH_FFMPEG 39 +#define ZM_FFMPEG_INPUT_OPTIONS 40 +#define ZM_FFMPEG_OUTPUT_OPTIONS 41 +#define ZM_FFMPEG_FORMATS 42 +#define ZM_LOG_LEVEL_SYSLOG 43 +#define ZM_LOG_LEVEL_FILE 44 +#define ZM_LOG_LEVEL_WEBLOG 45 +#define ZM_LOG_LEVEL_DATABASE 46 +#define ZM_LOG_DATABASE_LIMIT 47 +#define ZM_LOG_DEBUG 48 +#define ZM_LOG_DEBUG_TARGET 49 +#define ZM_LOG_DEBUG_LEVEL 50 +#define ZM_LOG_DEBUG_FILE 51 +#define ZM_LOG_CHECK_PERIOD 52 +#define ZM_LOG_ALERT_WAR_COUNT 53 +#define ZM_LOG_ALERT_ERR_COUNT 54 +#define ZM_LOG_ALERT_FAT_COUNT 55 +#define ZM_LOG_ALARM_WAR_COUNT 56 +#define ZM_LOG_ALARM_ERR_COUNT 57 +#define ZM_LOG_ALARM_FAT_COUNT 58 +#define ZM_RECORD_EVENT_STATS 59 +#define ZM_RECORD_DIAG_IMAGES 60 +#define ZM_DUMP_CORES 61 +#define ZM_PATH_MAP 62 +#define ZM_PATH_SOCKS 63 +#define ZM_PATH_LOGS 64 +#define ZM_PATH_SWAP 65 +#define ZM_WEB_TITLE_PREFIX 66 +#define ZM_WEB_RESIZE_CONSOLE 67 +#define ZM_WEB_POPUP_ON_ALARM 68 +#define ZM_OPT_X10 69 +#define ZM_X10_DEVICE 70 +#define ZM_X10_HOUSE_CODE 71 +#define ZM_X10_DB_RELOAD_INTERVAL 72 +#define ZM_WEB_SOUND_ON_ALARM 73 +#define ZM_WEB_ALARM_SOUND 74 +#define ZM_WEB_COMPACT_MONTAGE 75 +#define ZM_OPT_FAST_DELETE 76 +#define ZM_STRICT_VIDEO_CONFIG 77 +#define ZM_SIGNAL_CHECK_POINTS 78 +#define ZM_V4L_MULTI_BUFFER 79 +#define ZM_CAPTURES_PER_FRAME 80 +#define ZM_FILTER_RELOAD_DELAY 81 +#define ZM_FILTER_EXECUTE_INTERVAL 82 +#define ZM_OPT_UPLOAD 83 +#define ZM_UPLOAD_ARCH_FORMAT 84 +#define ZM_UPLOAD_ARCH_COMPRESS 85 +#define ZM_UPLOAD_ARCH_ANALYSE 86 +#define ZM_UPLOAD_PROTOCOL 87 +#define ZM_UPLOAD_FTP_HOST 88 +#define ZM_UPLOAD_HOST 89 +#define ZM_UPLOAD_PORT 90 +#define ZM_UPLOAD_FTP_USER 91 +#define ZM_UPLOAD_USER 92 +#define ZM_UPLOAD_FTP_PASS 93 +#define ZM_UPLOAD_PASS 94 +#define ZM_UPLOAD_FTP_LOC_DIR 95 +#define ZM_UPLOAD_LOC_DIR 96 +#define ZM_UPLOAD_FTP_REM_DIR 97 +#define ZM_UPLOAD_REM_DIR 98 +#define ZM_UPLOAD_FTP_TIMEOUT 99 +#define ZM_UPLOAD_TIMEOUT 100 +#define ZM_UPLOAD_FTP_PASSIVE 101 +#define ZM_UPLOAD_FTP_DEBUG 102 +#define ZM_UPLOAD_DEBUG 103 +#define ZM_OPT_EMAIL 104 +#define ZM_EMAIL_ADDRESS 105 +#define ZM_EMAIL_TEXT 106 +#define ZM_EMAIL_SUBJECT 107 +#define ZM_EMAIL_BODY 108 +#define ZM_OPT_MESSAGE 109 +#define ZM_MESSAGE_ADDRESS 110 +#define ZM_MESSAGE_TEXT 111 +#define ZM_MESSAGE_SUBJECT 112 +#define ZM_MESSAGE_BODY 113 +#define ZM_NEW_MAIL_MODULES 114 +#define ZM_EMAIL_HOST 115 +#define ZM_FROM_EMAIL 116 +#define ZM_URL 117 +#define ZM_MAX_RESTART_DELAY 118 +#define ZM_WATCH_CHECK_INTERVAL 119 +#define ZM_WATCH_MAX_DELAY 120 +#define ZM_RUN_AUDIT 121 +#define ZM_AUDIT_CHECK_INTERVAL 122 +#define ZM_FORCED_ALARM_SCORE 123 +#define ZM_BULK_FRAME_INTERVAL 124 +#define ZM_EVENT_CLOSE_MODE 125 +#define ZM_FORCE_CLOSE_EVENTS 126 +#define ZM_CREATE_ANALYSIS_IMAGES 127 +#define ZM_WEIGHTED_ALARM_CENTRES 128 +#define ZM_EVENT_IMAGE_DIGITS 129 +#define ZM_DEFAULT_ASPECT_RATIO 130 +#define ZM_USER_SELF_EDIT 131 +#define ZM_OPT_FRAME_SERVER 132 +#define ZM_FRAME_SOCKET_SIZE 133 +#define ZM_OPT_CONTROL 134 +#define ZM_OPT_TRIGGERS 135 +#define ZM_CHECK_FOR_UPDATES 136 +#define ZM_UPDATE_CHECK_PROXY 137 +#define ZM_SHM_KEY 138 +#define ZM_WEB_REFRESH_METHOD 139 +#define ZM_WEB_EVENT_SORT_FIELD 140 +#define ZM_WEB_EVENT_SORT_ORDER 141 +#define ZM_WEB_EVENTS_PER_PAGE 142 +#define ZM_WEB_LIST_THUMBS 143 +#define ZM_WEB_LIST_THUMB_WIDTH 144 +#define ZM_WEB_LIST_THUMB_HEIGHT 145 +#define ZM_WEB_USE_OBJECT_TAGS 146 +#define ZM_WEB_H_REFRESH_MAIN 147 +#define ZM_WEB_H_REFRESH_CYCLE 148 +#define ZM_WEB_H_REFRESH_IMAGE 149 +#define ZM_WEB_H_REFRESH_STATUS 150 +#define ZM_WEB_H_REFRESH_EVENTS 151 +#define ZM_WEB_H_CAN_STREAM 152 +#define ZM_WEB_H_STREAM_METHOD 153 +#define ZM_WEB_H_DEFAULT_SCALE 154 +#define ZM_WEB_H_DEFAULT_RATE 155 +#define ZM_WEB_H_VIDEO_BITRATE 156 +#define ZM_WEB_H_VIDEO_MAXFPS 157 +#define ZM_WEB_H_SCALE_THUMBS 158 +#define ZM_WEB_H_EVENTS_VIEW 159 +#define ZM_WEB_H_SHOW_PROGRESS 160 +#define ZM_WEB_H_AJAX_TIMEOUT 161 +#define ZM_WEB_M_REFRESH_MAIN 162 +#define ZM_WEB_M_REFRESH_CYCLE 163 +#define ZM_WEB_M_REFRESH_IMAGE 164 +#define ZM_WEB_M_REFRESH_STATUS 165 +#define ZM_WEB_M_REFRESH_EVENTS 166 +#define ZM_WEB_M_CAN_STREAM 167 +#define ZM_WEB_M_STREAM_METHOD 168 +#define ZM_WEB_M_DEFAULT_SCALE 169 +#define ZM_WEB_M_DEFAULT_RATE 170 +#define ZM_WEB_M_VIDEO_BITRATE 171 +#define ZM_WEB_M_VIDEO_MAXFPS 172 +#define ZM_WEB_M_SCALE_THUMBS 173 +#define ZM_WEB_M_EVENTS_VIEW 174 +#define ZM_WEB_M_SHOW_PROGRESS 175 +#define ZM_WEB_M_AJAX_TIMEOUT 176 +#define ZM_WEB_L_REFRESH_MAIN 177 +#define ZM_WEB_L_REFRESH_CYCLE 178 +#define ZM_WEB_L_REFRESH_IMAGE 179 +#define ZM_WEB_L_REFRESH_STATUS 180 +#define ZM_WEB_L_REFRESH_EVENTS 181 +#define ZM_WEB_L_CAN_STREAM 182 +#define ZM_WEB_L_STREAM_METHOD 183 +#define ZM_WEB_L_DEFAULT_SCALE 184 +#define ZM_WEB_L_DEFAULT_RATE 185 +#define ZM_WEB_L_VIDEO_BITRATE 186 +#define ZM_WEB_L_VIDEO_MAXFPS 187 +#define ZM_WEB_L_SCALE_THUMBS 188 +#define ZM_WEB_L_EVENTS_VIEW 189 +#define ZM_WEB_L_SHOW_PROGRESS 190 +#define ZM_WEB_L_AJAX_TIMEOUT 191 +#define ZM_WEB_P_CAN_STREAM 192 +#define ZM_WEB_P_STREAM_METHOD 193 +#define ZM_WEB_P_DEFAULT_SCALE 194 +#define ZM_WEB_P_DEFAULT_RATE 195 +#define ZM_WEB_P_VIDEO_BITRATE 196 +#define ZM_WEB_P_VIDEO_MAXFPS 197 +#define ZM_WEB_P_SCALE_THUMBS 198 +#define ZM_WEB_P_AJAX_TIMEOUT 199 +#define ZM_DYN_LAST_VERSION 200 +#define ZM_DYN_CURR_VERSION 201 +#define ZM_DYN_DB_VERSION 202 +#define ZM_DYN_LAST_CHECK 203 +#define ZM_DYN_NEXT_REMINDER 204 +#define ZM_DYN_DONATE_REMINDER_TIME 205 +#define ZM_DYN_SHOW_DONATE_REMINDER 206 +#define ZM_EYEZM_DEBUG 207 +#define ZM_EYEZM_LOG_TO_FILE 208 +#define ZM_EYEZM_LOG_FILE 209 +#define ZM_EYEZM_EVENT_VCODEC 210 +#define ZM_EYEZM_FEED_VCODEC 211 +#define ZM_EYEZM_H264_DEFAULT_BR 212 +#define ZM_EYEZM_H264_DEFAULT_EVBR 213 +#define ZM_EYEZM_H264_TIMEOUT 214 +#define ZM_EYEZM_SEG_DURATION 215 +#define ZM_PATH_PLUGINS 216 +#define ZM_PLUGIN_EXTENSION 217 +#define ZM_PLUGINS_CONFIG_PATH 218 +#define ZM_LOAD_PLUGINS 219 +#define ZM_TURNOFF_NATIVE_ANALYSIS 220 + + +#define ZM_MAX_CFG_ID 220 + +#define ZM_CFG_DECLARE_LIST \ + const char *lang_default;\ + bool opt_use_auth;\ + const char *auth_type;\ + const char *auth_relay;\ + const char *auth_hash_secret;\ + bool auth_hash_ips;\ + bool auth_hash_logins;\ + const char *dir_events;\ + bool use_deep_storage;\ + const char *dir_images;\ + const char *dir_sounds;\ + const char *path_zms;\ + bool colour_jpeg_files;\ + bool add_jpeg_comments;\ + int jpeg_file_quality;\ + int jpeg_alarm_file_quality;\ + int jpeg_image_quality;\ + int jpeg_stream_quality;\ + bool mpeg_timed_frames;\ + const char *mpeg_live_format;\ + const char *mpeg_replay_format;\ + bool rand_stream;\ + bool opt_cambozola;\ + const char *path_cambozola;\ + int reload_cambozola;\ + bool timestamp_on_capture;\ + bool cpu_extensions;\ + bool fast_image_blends;\ + bool opt_adaptive_skip;\ + bool blend_alarmed_images;\ + int max_suspend_time;\ + bool opt_remote_cameras;\ + bool netcam_regexps;\ + const char *http_version;\ + const char *http_ua;\ + int http_timeout;\ + int min_rtp_port;\ + int max_rtp_port;\ + bool opt_ffmpeg;\ + const char *path_ffmpeg;\ + const char *ffmpeg_input_options;\ + const char *ffmpeg_output_options;\ + const char *ffmpeg_formats;\ + int log_level_syslog;\ + int log_level_file;\ + int log_level_weblog;\ + int log_level_database;\ + const char *log_database_limit;\ + bool log_debug;\ + const char *log_debug_target;\ + int log_debug_level;\ + const char *log_debug_file;\ + int log_check_period;\ + int log_alert_war_count;\ + int log_alert_err_count;\ + int log_alert_fat_count;\ + int log_alarm_war_count;\ + int log_alarm_err_count;\ + int log_alarm_fat_count;\ + bool record_event_stats;\ + bool record_diag_images;\ + bool dump_cores;\ + const char *path_map;\ + const char *path_socks;\ + const char *path_logs;\ + const char *path_swap;\ + const char *web_title_prefix;\ + bool web_resize_console;\ + bool web_popup_on_alarm;\ + bool opt_x10;\ + const char *x10_device;\ + const char *x10_house_code;\ + int x10_db_reload_interval;\ + bool web_sound_on_alarm;\ + const char *web_alarm_sound;\ + bool web_compact_montage;\ + bool opt_fast_delete;\ + bool strict_video_config;\ + int signal_check_points;\ + bool v4l_multi_buffer;\ + int captures_per_frame;\ + int filter_reload_delay;\ + int filter_execute_interval;\ + bool opt_upload;\ + const char *upload_arch_format;\ + bool upload_arch_compress;\ + bool upload_arch_analyse;\ + const char *upload_protocol;\ + const char *upload_ftp_host;\ + const char *upload_host;\ + int upload_port;\ + const char *upload_ftp_user;\ + const char *upload_user;\ + const char *upload_ftp_pass;\ + const char *upload_pass;\ + const char *upload_ftp_loc_dir;\ + const char *upload_loc_dir;\ + const char *upload_ftp_rem_dir;\ + const char *upload_rem_dir;\ + int upload_ftp_timeout;\ + int upload_timeout;\ + bool upload_ftp_passive;\ + bool upload_ftp_debug;\ + bool upload_debug;\ + bool opt_email;\ + const char *email_address;\ + const char *email_text;\ + const char *email_subject;\ + const char *email_body;\ + bool opt_message;\ + const char *message_address;\ + const char *message_text;\ + const char *message_subject;\ + const char *message_body;\ + bool new_mail_modules;\ + const char *email_host;\ + const char *from_email;\ + const char *url;\ + int max_restart_delay;\ + int watch_check_interval;\ + double watch_max_delay;\ + bool run_audit;\ + int audit_check_interval;\ + int forced_alarm_score;\ + int bulk_frame_interval;\ + const char *event_close_mode;\ + bool force_close_events;\ + bool create_analysis_images;\ + bool weighted_alarm_centres;\ + int event_image_digits;\ + const char *default_aspect_ratio;\ + bool user_self_edit;\ + bool opt_frame_server;\ + int frame_socket_size;\ + bool opt_control;\ + bool opt_triggers;\ + bool check_for_updates;\ + const char *update_check_proxy;\ + int shm_key;\ + const char *web_refresh_method;\ + const char *web_event_sort_field;\ + const char *web_event_sort_order;\ + int web_events_per_page;\ + bool web_list_thumbs;\ + int web_list_thumb_width;\ + int web_list_thumb_height;\ + bool web_use_object_tags;\ + int web_h_refresh_main;\ + int web_h_refresh_cycle;\ + int web_h_refresh_image;\ + int web_h_refresh_status;\ + int web_h_refresh_events;\ + const char *web_h_can_stream;\ + const char *web_h_stream_method;\ + int web_h_default_scale;\ + int web_h_default_rate;\ + int web_h_video_bitrate;\ + int web_h_video_maxfps;\ + bool web_h_scale_thumbs;\ + const char *web_h_events_view;\ + bool web_h_show_progress;\ + int web_h_ajax_timeout;\ + int web_m_refresh_main;\ + int web_m_refresh_cycle;\ + int web_m_refresh_image;\ + int web_m_refresh_status;\ + int web_m_refresh_events;\ + const char *web_m_can_stream;\ + const char *web_m_stream_method;\ + int web_m_default_scale;\ + int web_m_default_rate;\ + int web_m_video_bitrate;\ + int web_m_video_maxfps;\ + bool web_m_scale_thumbs;\ + const char *web_m_events_view;\ + bool web_m_show_progress;\ + int web_m_ajax_timeout;\ + int web_l_refresh_main;\ + int web_l_refresh_cycle;\ + int web_l_refresh_image;\ + int web_l_refresh_status;\ + int web_l_refresh_events;\ + const char *web_l_can_stream;\ + const char *web_l_stream_method;\ + int web_l_default_scale;\ + int web_l_default_rate;\ + int web_l_video_bitrate;\ + int web_l_video_maxfps;\ + bool web_l_scale_thumbs;\ + const char *web_l_events_view;\ + bool web_l_show_progress;\ + int web_l_ajax_timeout;\ + const char *web_p_can_stream;\ + const char *web_p_stream_method;\ + int web_p_default_scale;\ + int web_p_default_rate;\ + int web_p_video_bitrate;\ + int web_p_video_maxfps;\ + bool web_p_scale_thumbs;\ + int web_p_ajax_timeout;\ + const char *dyn_last_version;\ + const char *dyn_curr_version;\ + const char *dyn_db_version;\ + int dyn_last_check;\ + const char *dyn_next_reminder;\ + int dyn_donate_reminder_time;\ + bool dyn_show_donate_reminder;\ + bool eyezm_debug;\ + bool eyezm_log_to_file;\ + const char *eyezm_log_file;\ + const char *eyezm_event_vcodec;\ + const char *eyezm_feed_vcodec;\ + const char *eyezm_h264_default_br;\ + const char *eyezm_h264_default_evbr;\ + const char *eyezm_h264_timeout;\ + const char *eyezm_seg_duration;\ + const char *path_plugins;\ + const char *plugin_extension;\ + const char *plugins_config_path;\ + bool load_plugins;\ + bool turnoff_native_analysis;\ + + +#define ZM_CFG_ASSIGN_LIST \ + lang_default = (const char *)config.Item( ZM_LANG_DEFAULT );\ + opt_use_auth = (bool)config.Item( ZM_OPT_USE_AUTH );\ + auth_type = (const char *)config.Item( ZM_AUTH_TYPE );\ + auth_relay = (const char *)config.Item( ZM_AUTH_RELAY );\ + auth_hash_secret = (const char *)config.Item( ZM_AUTH_HASH_SECRET );\ + auth_hash_ips = (bool)config.Item( ZM_AUTH_HASH_IPS );\ + auth_hash_logins = (bool)config.Item( ZM_AUTH_HASH_LOGINS );\ + dir_events = (const char *)config.Item( ZM_DIR_EVENTS );\ + use_deep_storage = (bool)config.Item( ZM_USE_DEEP_STORAGE );\ + dir_images = (const char *)config.Item( ZM_DIR_IMAGES );\ + dir_sounds = (const char *)config.Item( ZM_DIR_SOUNDS );\ + path_zms = (const char *)config.Item( ZM_PATH_ZMS );\ + colour_jpeg_files = (bool)config.Item( ZM_COLOUR_JPEG_FILES );\ + add_jpeg_comments = (bool)config.Item( ZM_ADD_JPEG_COMMENTS );\ + jpeg_file_quality = (int)config.Item( ZM_JPEG_FILE_QUALITY );\ + jpeg_alarm_file_quality = (int)config.Item( ZM_JPEG_ALARM_FILE_QUALITY );\ + jpeg_image_quality = (int)config.Item( ZM_JPEG_IMAGE_QUALITY );\ + jpeg_stream_quality = (int)config.Item( ZM_JPEG_STREAM_QUALITY );\ + mpeg_timed_frames = (bool)config.Item( ZM_MPEG_TIMED_FRAMES );\ + mpeg_live_format = (const char *)config.Item( ZM_MPEG_LIVE_FORMAT );\ + mpeg_replay_format = (const char *)config.Item( ZM_MPEG_REPLAY_FORMAT );\ + rand_stream = (bool)config.Item( ZM_RAND_STREAM );\ + opt_cambozola = (bool)config.Item( ZM_OPT_CAMBOZOLA );\ + path_cambozola = (const char *)config.Item( ZM_PATH_CAMBOZOLA );\ + reload_cambozola = (int)config.Item( ZM_RELOAD_CAMBOZOLA );\ + timestamp_on_capture = (bool)config.Item( ZM_TIMESTAMP_ON_CAPTURE );\ + cpu_extensions = (bool)config.Item( ZM_CPU_EXTENSIONS );\ + fast_image_blends = (bool)config.Item( ZM_FAST_IMAGE_BLENDS );\ + opt_adaptive_skip = (bool)config.Item( ZM_OPT_ADAPTIVE_SKIP );\ + blend_alarmed_images = (bool)config.Item( ZM_BLEND_ALARMED_IMAGES );\ + max_suspend_time = (int)config.Item( ZM_MAX_SUSPEND_TIME );\ + opt_remote_cameras = (bool)config.Item( ZM_OPT_REMOTE_CAMERAS );\ + netcam_regexps = (bool)config.Item( ZM_NETCAM_REGEXPS );\ + http_version = (const char *)config.Item( ZM_HTTP_VERSION );\ + http_ua = (const char *)config.Item( ZM_HTTP_UA );\ + http_timeout = (int)config.Item( ZM_HTTP_TIMEOUT );\ + min_rtp_port = (int)config.Item( ZM_MIN_RTP_PORT );\ + max_rtp_port = (int)config.Item( ZM_MAX_RTP_PORT );\ + opt_ffmpeg = (bool)config.Item( ZM_OPT_FFMPEG );\ + path_ffmpeg = (const char *)config.Item( ZM_PATH_FFMPEG );\ + ffmpeg_input_options = (const char *)config.Item( ZM_FFMPEG_INPUT_OPTIONS );\ + ffmpeg_output_options = (const char *)config.Item( ZM_FFMPEG_OUTPUT_OPTIONS );\ + ffmpeg_formats = (const char *)config.Item( ZM_FFMPEG_FORMATS );\ + log_level_syslog = (int)config.Item( ZM_LOG_LEVEL_SYSLOG );\ + log_level_file = (int)config.Item( ZM_LOG_LEVEL_FILE );\ + log_level_weblog = (int)config.Item( ZM_LOG_LEVEL_WEBLOG );\ + log_level_database = (int)config.Item( ZM_LOG_LEVEL_DATABASE );\ + log_database_limit = (const char *)config.Item( ZM_LOG_DATABASE_LIMIT );\ + log_debug = (bool)config.Item( ZM_LOG_DEBUG );\ + log_debug_target = (const char *)config.Item( ZM_LOG_DEBUG_TARGET );\ + log_debug_level = (int)config.Item( ZM_LOG_DEBUG_LEVEL );\ + log_debug_file = (const char *)config.Item( ZM_LOG_DEBUG_FILE );\ + log_check_period = (int)config.Item( ZM_LOG_CHECK_PERIOD );\ + log_alert_war_count = (int)config.Item( ZM_LOG_ALERT_WAR_COUNT );\ + log_alert_err_count = (int)config.Item( ZM_LOG_ALERT_ERR_COUNT );\ + log_alert_fat_count = (int)config.Item( ZM_LOG_ALERT_FAT_COUNT );\ + log_alarm_war_count = (int)config.Item( ZM_LOG_ALARM_WAR_COUNT );\ + log_alarm_err_count = (int)config.Item( ZM_LOG_ALARM_ERR_COUNT );\ + log_alarm_fat_count = (int)config.Item( ZM_LOG_ALARM_FAT_COUNT );\ + record_event_stats = (bool)config.Item( ZM_RECORD_EVENT_STATS );\ + record_diag_images = (bool)config.Item( ZM_RECORD_DIAG_IMAGES );\ + dump_cores = (bool)config.Item( ZM_DUMP_CORES );\ + path_map = (const char *)config.Item( ZM_PATH_MAP );\ + path_socks = (const char *)config.Item( ZM_PATH_SOCKS );\ + path_logs = (const char *)config.Item( ZM_PATH_LOGS );\ + path_swap = (const char *)config.Item( ZM_PATH_SWAP );\ + web_title_prefix = (const char *)config.Item( ZM_WEB_TITLE_PREFIX );\ + web_resize_console = (bool)config.Item( ZM_WEB_RESIZE_CONSOLE );\ + web_popup_on_alarm = (bool)config.Item( ZM_WEB_POPUP_ON_ALARM );\ + opt_x10 = (bool)config.Item( ZM_OPT_X10 );\ + x10_device = (const char *)config.Item( ZM_X10_DEVICE );\ + x10_house_code = (const char *)config.Item( ZM_X10_HOUSE_CODE );\ + x10_db_reload_interval = (int)config.Item( ZM_X10_DB_RELOAD_INTERVAL );\ + web_sound_on_alarm = (bool)config.Item( ZM_WEB_SOUND_ON_ALARM );\ + web_alarm_sound = (const char *)config.Item( ZM_WEB_ALARM_SOUND );\ + web_compact_montage = (bool)config.Item( ZM_WEB_COMPACT_MONTAGE );\ + opt_fast_delete = (bool)config.Item( ZM_OPT_FAST_DELETE );\ + strict_video_config = (bool)config.Item( ZM_STRICT_VIDEO_CONFIG );\ + signal_check_points = (int)config.Item( ZM_SIGNAL_CHECK_POINTS );\ + v4l_multi_buffer = (bool)config.Item( ZM_V4L_MULTI_BUFFER );\ + captures_per_frame = (int)config.Item( ZM_CAPTURES_PER_FRAME );\ + filter_reload_delay = (int)config.Item( ZM_FILTER_RELOAD_DELAY );\ + filter_execute_interval = (int)config.Item( ZM_FILTER_EXECUTE_INTERVAL );\ + opt_upload = (bool)config.Item( ZM_OPT_UPLOAD );\ + upload_arch_format = (const char *)config.Item( ZM_UPLOAD_ARCH_FORMAT );\ + upload_arch_compress = (bool)config.Item( ZM_UPLOAD_ARCH_COMPRESS );\ + upload_arch_analyse = (bool)config.Item( ZM_UPLOAD_ARCH_ANALYSE );\ + upload_protocol = (const char *)config.Item( ZM_UPLOAD_PROTOCOL );\ + upload_ftp_host = (const char *)config.Item( ZM_UPLOAD_FTP_HOST );\ + upload_host = (const char *)config.Item( ZM_UPLOAD_HOST );\ + upload_port = (int)config.Item( ZM_UPLOAD_PORT );\ + upload_ftp_user = (const char *)config.Item( ZM_UPLOAD_FTP_USER );\ + upload_user = (const char *)config.Item( ZM_UPLOAD_USER );\ + upload_ftp_pass = (const char *)config.Item( ZM_UPLOAD_FTP_PASS );\ + upload_pass = (const char *)config.Item( ZM_UPLOAD_PASS );\ + upload_ftp_loc_dir = (const char *)config.Item( ZM_UPLOAD_FTP_LOC_DIR );\ + upload_loc_dir = (const char *)config.Item( ZM_UPLOAD_LOC_DIR );\ + upload_ftp_rem_dir = (const char *)config.Item( ZM_UPLOAD_FTP_REM_DIR );\ + upload_rem_dir = (const char *)config.Item( ZM_UPLOAD_REM_DIR );\ + upload_ftp_timeout = (int)config.Item( ZM_UPLOAD_FTP_TIMEOUT );\ + upload_timeout = (int)config.Item( ZM_UPLOAD_TIMEOUT );\ + upload_ftp_passive = (bool)config.Item( ZM_UPLOAD_FTP_PASSIVE );\ + upload_ftp_debug = (bool)config.Item( ZM_UPLOAD_FTP_DEBUG );\ + upload_debug = (bool)config.Item( ZM_UPLOAD_DEBUG );\ + opt_email = (bool)config.Item( ZM_OPT_EMAIL );\ + email_address = (const char *)config.Item( ZM_EMAIL_ADDRESS );\ + email_text = (const char *)config.Item( ZM_EMAIL_TEXT );\ + email_subject = (const char *)config.Item( ZM_EMAIL_SUBJECT );\ + email_body = (const char *)config.Item( ZM_EMAIL_BODY );\ + opt_message = (bool)config.Item( ZM_OPT_MESSAGE );\ + message_address = (const char *)config.Item( ZM_MESSAGE_ADDRESS );\ + message_text = (const char *)config.Item( ZM_MESSAGE_TEXT );\ + message_subject = (const char *)config.Item( ZM_MESSAGE_SUBJECT );\ + message_body = (const char *)config.Item( ZM_MESSAGE_BODY );\ + new_mail_modules = (bool)config.Item( ZM_NEW_MAIL_MODULES );\ + email_host = (const char *)config.Item( ZM_EMAIL_HOST );\ + from_email = (const char *)config.Item( ZM_FROM_EMAIL );\ + url = (const char *)config.Item( ZM_URL );\ + max_restart_delay = (int)config.Item( ZM_MAX_RESTART_DELAY );\ + watch_check_interval = (int)config.Item( ZM_WATCH_CHECK_INTERVAL );\ + watch_max_delay = (double) config.Item( ZM_WATCH_MAX_DELAY );\ + run_audit = (bool)config.Item( ZM_RUN_AUDIT );\ + audit_check_interval = (int)config.Item( ZM_AUDIT_CHECK_INTERVAL );\ + forced_alarm_score = (int)config.Item( ZM_FORCED_ALARM_SCORE );\ + bulk_frame_interval = (int)config.Item( ZM_BULK_FRAME_INTERVAL );\ + event_close_mode = (const char *)config.Item( ZM_EVENT_CLOSE_MODE );\ + force_close_events = (bool)config.Item( ZM_FORCE_CLOSE_EVENTS );\ + create_analysis_images = (bool)config.Item( ZM_CREATE_ANALYSIS_IMAGES );\ + weighted_alarm_centres = (bool)config.Item( ZM_WEIGHTED_ALARM_CENTRES );\ + event_image_digits = (int)config.Item( ZM_EVENT_IMAGE_DIGITS );\ + default_aspect_ratio = (const char *)config.Item( ZM_DEFAULT_ASPECT_RATIO );\ + user_self_edit = (bool)config.Item( ZM_USER_SELF_EDIT );\ + opt_frame_server = (bool)config.Item( ZM_OPT_FRAME_SERVER );\ + frame_socket_size = (int)config.Item( ZM_FRAME_SOCKET_SIZE );\ + opt_control = (bool)config.Item( ZM_OPT_CONTROL );\ + opt_triggers = (bool)config.Item( ZM_OPT_TRIGGERS );\ + check_for_updates = (bool)config.Item( ZM_CHECK_FOR_UPDATES );\ + update_check_proxy = (const char *)config.Item( ZM_UPDATE_CHECK_PROXY );\ + shm_key = (int)config.Item( ZM_SHM_KEY );\ + web_refresh_method = (const char *)config.Item( ZM_WEB_REFRESH_METHOD );\ + web_event_sort_field = (const char *)config.Item( ZM_WEB_EVENT_SORT_FIELD );\ + web_event_sort_order = (const char *)config.Item( ZM_WEB_EVENT_SORT_ORDER );\ + web_events_per_page = (int)config.Item( ZM_WEB_EVENTS_PER_PAGE );\ + web_list_thumbs = (bool)config.Item( ZM_WEB_LIST_THUMBS );\ + web_list_thumb_width = (int)config.Item( ZM_WEB_LIST_THUMB_WIDTH );\ + web_list_thumb_height = (int)config.Item( ZM_WEB_LIST_THUMB_HEIGHT );\ + web_use_object_tags = (bool)config.Item( ZM_WEB_USE_OBJECT_TAGS );\ + web_h_refresh_main = (int)config.Item( ZM_WEB_H_REFRESH_MAIN );\ + web_h_refresh_cycle = (int)config.Item( ZM_WEB_H_REFRESH_CYCLE );\ + web_h_refresh_image = (int)config.Item( ZM_WEB_H_REFRESH_IMAGE );\ + web_h_refresh_status = (int)config.Item( ZM_WEB_H_REFRESH_STATUS );\ + web_h_refresh_events = (int)config.Item( ZM_WEB_H_REFRESH_EVENTS );\ + web_h_can_stream = (const char *)config.Item( ZM_WEB_H_CAN_STREAM );\ + web_h_stream_method = (const char *)config.Item( ZM_WEB_H_STREAM_METHOD );\ + web_h_default_scale = (int)config.Item( ZM_WEB_H_DEFAULT_SCALE );\ + web_h_default_rate = (int)config.Item( ZM_WEB_H_DEFAULT_RATE );\ + web_h_video_bitrate = (int)config.Item( ZM_WEB_H_VIDEO_BITRATE );\ + web_h_video_maxfps = (int)config.Item( ZM_WEB_H_VIDEO_MAXFPS );\ + web_h_scale_thumbs = (bool)config.Item( ZM_WEB_H_SCALE_THUMBS );\ + web_h_events_view = (const char *)config.Item( ZM_WEB_H_EVENTS_VIEW );\ + web_h_show_progress = (bool)config.Item( ZM_WEB_H_SHOW_PROGRESS );\ + web_h_ajax_timeout = (int)config.Item( ZM_WEB_H_AJAX_TIMEOUT );\ + web_m_refresh_main = (int)config.Item( ZM_WEB_M_REFRESH_MAIN );\ + web_m_refresh_cycle = (int)config.Item( ZM_WEB_M_REFRESH_CYCLE );\ + web_m_refresh_image = (int)config.Item( ZM_WEB_M_REFRESH_IMAGE );\ + web_m_refresh_status = (int)config.Item( ZM_WEB_M_REFRESH_STATUS );\ + web_m_refresh_events = (int)config.Item( ZM_WEB_M_REFRESH_EVENTS );\ + web_m_can_stream = (const char *)config.Item( ZM_WEB_M_CAN_STREAM );\ + web_m_stream_method = (const char *)config.Item( ZM_WEB_M_STREAM_METHOD );\ + web_m_default_scale = (int)config.Item( ZM_WEB_M_DEFAULT_SCALE );\ + web_m_default_rate = (int)config.Item( ZM_WEB_M_DEFAULT_RATE );\ + web_m_video_bitrate = (int)config.Item( ZM_WEB_M_VIDEO_BITRATE );\ + web_m_video_maxfps = (int)config.Item( ZM_WEB_M_VIDEO_MAXFPS );\ + web_m_scale_thumbs = (bool)config.Item( ZM_WEB_M_SCALE_THUMBS );\ + web_m_events_view = (const char *)config.Item( ZM_WEB_M_EVENTS_VIEW );\ + web_m_show_progress = (bool)config.Item( ZM_WEB_M_SHOW_PROGRESS );\ + web_m_ajax_timeout = (int)config.Item( ZM_WEB_M_AJAX_TIMEOUT );\ + web_l_refresh_main = (int)config.Item( ZM_WEB_L_REFRESH_MAIN );\ + web_l_refresh_cycle = (int)config.Item( ZM_WEB_L_REFRESH_CYCLE );\ + web_l_refresh_image = (int)config.Item( ZM_WEB_L_REFRESH_IMAGE );\ + web_l_refresh_status = (int)config.Item( ZM_WEB_L_REFRESH_STATUS );\ + web_l_refresh_events = (int)config.Item( ZM_WEB_L_REFRESH_EVENTS );\ + web_l_can_stream = (const char *)config.Item( ZM_WEB_L_CAN_STREAM );\ + web_l_stream_method = (const char *)config.Item( ZM_WEB_L_STREAM_METHOD );\ + web_l_default_scale = (int)config.Item( ZM_WEB_L_DEFAULT_SCALE );\ + web_l_default_rate = (int)config.Item( ZM_WEB_L_DEFAULT_RATE );\ + web_l_video_bitrate = (int)config.Item( ZM_WEB_L_VIDEO_BITRATE );\ + web_l_video_maxfps = (int)config.Item( ZM_WEB_L_VIDEO_MAXFPS );\ + web_l_scale_thumbs = (bool)config.Item( ZM_WEB_L_SCALE_THUMBS );\ + web_l_events_view = (const char *)config.Item( ZM_WEB_L_EVENTS_VIEW );\ + web_l_show_progress = (bool)config.Item( ZM_WEB_L_SHOW_PROGRESS );\ + web_l_ajax_timeout = (int)config.Item( ZM_WEB_L_AJAX_TIMEOUT );\ + web_p_can_stream = (const char *)config.Item( ZM_WEB_P_CAN_STREAM );\ + web_p_stream_method = (const char *)config.Item( ZM_WEB_P_STREAM_METHOD );\ + web_p_default_scale = (int)config.Item( ZM_WEB_P_DEFAULT_SCALE );\ + web_p_default_rate = (int)config.Item( ZM_WEB_P_DEFAULT_RATE );\ + web_p_video_bitrate = (int)config.Item( ZM_WEB_P_VIDEO_BITRATE );\ + web_p_video_maxfps = (int)config.Item( ZM_WEB_P_VIDEO_MAXFPS );\ + web_p_scale_thumbs = (bool)config.Item( ZM_WEB_P_SCALE_THUMBS );\ + web_p_ajax_timeout = (int)config.Item( ZM_WEB_P_AJAX_TIMEOUT );\ + dyn_last_version = (const char *)config.Item( ZM_DYN_LAST_VERSION );\ + dyn_curr_version = (const char *)config.Item( ZM_DYN_CURR_VERSION );\ + dyn_db_version = (const char *)config.Item( ZM_DYN_DB_VERSION );\ + dyn_last_check = (int)config.Item( ZM_DYN_LAST_CHECK );\ + dyn_next_reminder = (const char *)config.Item( ZM_DYN_NEXT_REMINDER );\ + dyn_donate_reminder_time = (int)config.Item( ZM_DYN_DONATE_REMINDER_TIME );\ + dyn_show_donate_reminder = (bool)config.Item( ZM_DYN_SHOW_DONATE_REMINDER );\ + eyezm_debug = (bool)config.Item( ZM_EYEZM_DEBUG );\ + eyezm_log_to_file = (bool)config.Item( ZM_EYEZM_LOG_TO_FILE );\ + eyezm_log_file = (const char *)config.Item( ZM_EYEZM_LOG_FILE );\ + eyezm_event_vcodec = (const char *)config.Item( ZM_EYEZM_EVENT_VCODEC );\ + eyezm_feed_vcodec = (const char *)config.Item( ZM_EYEZM_FEED_VCODEC );\ + eyezm_h264_default_br = (const char *)config.Item( ZM_EYEZM_H264_DEFAULT_BR );\ + eyezm_h264_default_evbr = (const char *)config.Item( ZM_EYEZM_H264_DEFAULT_EVBR );\ + eyezm_h264_timeout = (const char *)config.Item( ZM_EYEZM_H264_TIMEOUT );\ + eyezm_seg_duration = (const char *)config.Item( ZM_EYEZM_SEG_DURATION );\ + path_plugins = (const char *)config.Item( ZM_PATH_PLUGINS );\ + plugin_extension = (const char *)config.Item( ZM_PLUGIN_EXTENSION );\ + plugins_config_path = (const char *)config.Item( ZM_PLUGINS_CONFIG_PATH );\ + load_plugins = (bool)config.Item( ZM_LOAD_PLUGINS );\ + turnoff_native_analysis = (bool)config.Item( ZM_TURNOFF_NATIVE_ANALYSIS );\ + + diff --git a/src/zm_coord.cpp b/src/zm_coord.cpp new file mode 100644 index 000000000..cef188b63 --- /dev/null +++ b/src/zm_coord.cpp @@ -0,0 +1,23 @@ +// +// ZoneMinder Coordinate Class Implementation, $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. +// + +#include "zm.h" +#include "zm_coord.h" + +// This section deliberately left blank diff --git a/src/zm_coord.h b/src/zm_coord.h new file mode 100644 index 000000000..6a6620529 --- /dev/null +++ b/src/zm_coord.h @@ -0,0 +1,67 @@ +// +// ZoneMinder Coordinate Class Interface, $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. +// + +#ifndef ZM_COORD_H +#define ZM_COORD_H + +#include "zm.h" + +// +// Class used for storing an x,y pair, i.e. a coordinate +// +class Coord +{ +private: + int x, y; + +public: + inline Coord() : x(0), y(0) + { + } + inline Coord( int p_x, int p_y ) : x(p_x), y(p_y) + { + } + inline Coord( const Coord &p_coord ) : x(p_coord.x), y(p_coord.y) + { + } + inline int &X() { return( x ); } + inline const int &X() const { return( x ); } + inline int &Y() { return( y ); } + inline const int &Y() const { return( y ); } + + inline static Coord Range( const Coord &coord1, const Coord &coord2 ) + { + Coord result( (coord1.x-coord2.x)+1, (coord1.y-coord2.y)+1 ); + return( result ); + } + + inline bool operator==( const Coord &coord ) { return( x == coord.x && y == coord.y ); } + inline bool operator!=( const Coord &coord ) { return( x != coord.x || y != coord.y ); } + inline bool operator>( const Coord &coord ) { return( x > coord.x && y > coord.y ); } + inline bool operator>=( const Coord &coord ) { return( !(operator<(coord)) ); } + inline bool operator<( const Coord &coord ) { return( x < coord.x && y < coord.y ); } + inline bool operator<=( const Coord &coord ) { return( !(operator>(coord)) ); } + inline Coord &operator+=( const Coord &coord ) { x += coord.x; y += coord.y; return( *this ); } + inline Coord &operator-=( const Coord &coord ) { x -= coord.x; y -= coord.y; return( *this ); } + + inline friend Coord operator+( const Coord &coord1, const Coord &coord2 ) { Coord result( coord1 ); result += coord2; return( result ); } + inline friend Coord operator-( const Coord &coord1, const Coord &coord2 ) { Coord result( coord1 ); result -= coord2; return( result ); } +}; + +#endif // ZM_COORD_H diff --git a/src/zm_db.cpp b/src/zm_db.cpp new file mode 100644 index 000000000..26a33d6f5 --- /dev/null +++ b/src/zm_db.cpp @@ -0,0 +1,66 @@ +// +// ZoneMinder MySQL Implementation, $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. +// + +#include +#include + +#include "zm.h" +#include "zm_db.h" + +MYSQL dbconn; + +int zmDbConnected = false; + +void zmDbConnect() +{ + if ( !mysql_init( &dbconn ) ) + { + Error( "Can't initialise database connection: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + my_bool reconnect = 1; + if ( mysql_options( &dbconn, MYSQL_OPT_RECONNECT, &reconnect ) ) + Fatal( "Can't set database auto reconnect option: %s", mysql_error( &dbconn ) ); + std::string::size_type colonIndex = staticConfig.DB_HOST.find( ":/" ); + if ( colonIndex != std::string::npos ) + { + std::string dbHost = staticConfig.DB_HOST.substr( 0, colonIndex ); + std::string dbPort = staticConfig.DB_HOST.substr( colonIndex+1 ); + if ( !mysql_real_connect( &dbconn, dbHost.c_str(), staticConfig.DB_USER.c_str(), staticConfig.DB_PASS.c_str(), 0, atoi(dbPort.c_str()), 0, 0 ) ) + { + Error( "Can't connect to server: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + } + else + { + if ( !mysql_real_connect( &dbconn, staticConfig.DB_HOST.c_str(), staticConfig.DB_USER.c_str(), staticConfig.DB_PASS.c_str(), 0, 0, 0, 0 ) ) + { + Error( "Can't connect to server: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + } + if ( mysql_select_db( &dbconn, staticConfig.DB_NAME.c_str() ) ) + { + Error( "Can't select database: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + zmDbConnected = true; +} + diff --git a/src/zm_db.h b/src/zm_db.h new file mode 100644 index 000000000..dda2dd30f --- /dev/null +++ b/src/zm_db.h @@ -0,0 +1,37 @@ +// +// ZoneMinder Core Interfaces, $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. +// + +#ifndef ZM_DB_H +#define ZM_DB_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif +extern MYSQL dbconn; + +extern int zmDbConnected; + +void zmDbConnect(); +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif // ZM_DB_H diff --git a/src/zm_detector.cpp b/src/zm_detector.cpp new file mode 100644 index 000000000..0ec360c66 --- /dev/null +++ b/src/zm_detector.cpp @@ -0,0 +1,200 @@ +#include "zm_detector.h" + + + +/*!\fn Detector::Detector(const Detector& source) + * \param source is the object to copy + */ +Detector::Detector(const Detector& source) + : m_sDetectionCause(source.m_sDetectionCause), + m_fMinAlarmScore(source.m_fMinAlarmScore), + m_fMaxAlarmScore(source.m_fMaxAlarmScore), + m_fImageScaleFactor(source.m_fImageScaleFactor), + m_nNewWidth(source.m_nNewWidth), + m_nNewHeight(source.m_nNewHeight), + m_sLogPrefix(source.m_sLogPrefix), + m_sConfigSectionName(source.m_sConfigSectionName) +{ + //setlogmask (LOG_UPTO (LOG_LEVEL)); + //openlog(m_sLogPrefix.c_str(), LOG_PID|LOG_CONS, LOG_USER); +} + + + +/*!\fn Detector& ImageAnalyser::Detector::operator=(const ImageAnalyser::Detector& source) + * \param source is the object to copy + */ +Detector& Detector::operator=(const Detector& source) +{ + m_sDetectionCause = source.m_sDetectionCause; + m_fMinAlarmScore = source.m_fMinAlarmScore; + m_fMaxAlarmScore = source.m_fMaxAlarmScore; + m_fImageScaleFactor = source.m_fImageScaleFactor; + m_sLogPrefix = source.m_sLogPrefix; + m_nNewWidth = source.m_nNewWidth; + m_nNewHeight = source.m_nNewHeight; + m_sConfigSectionName = source.m_sConfigSectionName; + + //setlogmask (LOG_UPTO (LOG_LEVEL)); + //openlog(m_sLogPrefix.c_str(), LOG_PID|LOG_CONS, LOG_USER); + + return *this; +} + + + +/*!\fn Detector::getDetectionCause() + * return detection cause as string + */ +string Detector::getDetectionCause() +{ + return m_sDetectionCause; +} + + + + +/*! \fn Detector::log(int nLogLevel, string sMessage) + */ +void Detector::log(int nLogLevel, string sMessage) +{ + string sMessageToLog = m_sLogPrefix + string(" : ") + sMessage; + syslog(nLogLevel, "%s", sMessageToLog.c_str()); +} + + +//Detector::~Detector() {} + + + + +/*! \fn int FaceDetectorPlugin::Detect(const Image &image, Event::StringSet &zoneSet) + * \param image is an image to detect faces on + * \param zoneSet is set of zone names (see zm_zone.h) + * \return detection score + */ +int Detector::Detect(const Image &zmImage, Zone** zones, int n_numZones, Event::StringSet &zoneSet) +{ + //log(LOG_LEVEL, "Detection invoking."); + bool alarm = false; + char szMessage[50]; + unsigned int score = 0; + + if (n_numZones <= 0) return (alarm); + + +// // Blank out all exclusion zones +// for ( int n_zone = 0; n_zone < n_zones; n_zone++ ) +// { +// Zone *zone = zones[n_zone]; +// zone->ClearAlarm(); +// if ( !zone->IsInactive() ) +// { +// continue; +// } +// Debug( 3, "Blanking inactive zone %s", zone->Label() ); +// delta_image->Fill( RGB_BLACK, zone->GetPolygon() ); +// } + + // Check preclusive zones first + for (int n_zone = 0; n_zone < n_numZones; n_zone++) + { + Zone *zone = zones[n_zone]; + if (!zone->IsPreclusive()) + { + continue; + } + sprintf(szMessage, "Checking preclusive zone %s", zone->Label()); + log(LOG_DEBUG, szMessage); + if (checkZone(zone, &zmImage)) + { + alarm = true; + score += zone->Score(); + zone->SetAlarm(); + sprintf(szMessage, "Zone is alarmed, zone score = %d", zone->Score()); + log(LOG_DEBUG, szMessage); + zoneSet.insert(zone->Label()); + } + } + + if ( alarm ) + { + alarm = false; + score = 0; + } + else + { + // Find all alarm pixels in active zones + for (int n_zone = 0; n_zone < n_numZones; n_zone++) + { + Zone *zone = zones[n_zone]; + if (!zone->IsActive()) + { + continue; + } + //sprintf(szMessage, "Checking active zone %s", zone->Label()); + //log(LOG_DEBUG, szMessage); + if (checkZone(zone, &zmImage)) + { + alarm = true; + score += zone->Score(); + zone->SetAlarm(); + sprintf(szMessage, "Zone is alarmed, zone score = %d", zone->Score()); + log(LOG_DEBUG, szMessage); + zoneSet.insert(zone->Label()); + } + } + + if ( alarm ) + { + // Checking inclusive zones + for (int n_zone = 0; n_zone < n_numZones; n_zone++) + { + Zone *zone = zones[n_zone]; + if (!zone->IsInclusive()) + { + continue; + } + sprintf(szMessage, "Checking inclusive zone %s", zone->Label()); + log(LOG_DEBUG, szMessage); + if (checkZone(zone, &zmImage)) + { + alarm = true; + score += zone->Score(); + zone->SetAlarm(); + sprintf(szMessage, "Zone is alarmed, zone score = %d", zone->Score()); + log(LOG_DEBUG, szMessage); + zoneSet.insert(zone->Label()); + } + } + } + else + { + // Find all alarm pixels in exclusive zones + for (int n_zone = 0; n_zone < n_numZones; n_zone++) + { + Zone *zone = zones[n_zone]; + if (!zone->IsExclusive()) + { + continue; + } + sprintf(szMessage, "Checking exclusive zone %s", zone->Label()); + log(LOG_DEBUG, szMessage); + if (checkZone(zone, &zmImage)) + { + alarm = true; + score += zone->Score(); + zone->SetAlarm(); + sprintf(szMessage, "Zone is alarmed, zone score = %d", zone->Score()); + log(LOG_DEBUG, szMessage); + zoneSet.insert(zone->Label()); + } + } + } //else if(alarm) : exclusive + } //else if(alarm) + + + return(score?score:alarm); +} + + diff --git a/src/zm_detector.h b/src/zm_detector.h new file mode 100644 index 000000000..b1902577c --- /dev/null +++ b/src/zm_detector.h @@ -0,0 +1,129 @@ +#ifndef ZM_DETECTOR_H +#define ZM_DETECTOR_H + + +#include +#include +#include + +#include "zm_image.h" +#include "zm_zone.h" +#include "zm_event.h" + + + +#define DEFAULT_DETECTION_CAUSE "Object Detected" +#define DEFAULT_MIN_ALARM_SCORE 1.0 +#define DEFAULT_MAX_ALARM_SCORE 99.0 +#define DEFAULT_IMAGE_SCALE_FACTOR 1.0 + +#define DEFAULT_LOG_PREFIX "ZM PLUGIN" +#define LOG_LEVEL LOG_NOTICE +#define DEFAULT_CONFIGFILE_SECTION "libzm_vscvl_plugin" + +using namespace std; + + +//! Base class for object detectors, defined in plugins. +class Detector +{ + +public: + + //! Destructor + virtual ~Detector() { closelog(); } + + //! Default constructor + Detector() +{ + m_sLogPrefix = DEFAULT_LOG_PREFIX; + + //setlogmask (LOG_UPTO (LOG_LEVEL)); + //openlog(m_sLogPrefix.c_str(), LOG_PID|LOG_CONS, LOG_USER); + + m_sDetectionCause = DEFAULT_DETECTION_CAUSE; + m_fMinAlarmScore = DEFAULT_MIN_ALARM_SCORE; + m_fMaxAlarmScore = DEFAULT_MAX_ALARM_SCORE; + m_fImageScaleFactor = DEFAULT_IMAGE_SCALE_FACTOR; + m_sConfigSectionName = DEFAULT_CONFIGFILE_SECTION; + m_nNewWidth = 0; + m_nNewHeight = 0; +} + + //! Constructor with section name parameter. + Detector(string sPluginFileName) +{ + m_sLogPrefix = DEFAULT_LOG_PREFIX; + + char* szPluginFileName = strdup(sPluginFileName.c_str()); + + string sPluginFileNameName = string(basename(szPluginFileName)); + + size_t idx = sPluginFileNameName.rfind('.'); + + if (idx == string::npos) + m_sConfigSectionName = sPluginFileNameName; + else + m_sConfigSectionName = sPluginFileNameName.substr(0, idx); + + m_sDetectionCause = DEFAULT_DETECTION_CAUSE; + m_fMinAlarmScore = DEFAULT_MIN_ALARM_SCORE; + m_fMaxAlarmScore = DEFAULT_MAX_ALARM_SCORE; + m_fImageScaleFactor = DEFAULT_IMAGE_SCALE_FACTOR; + m_nNewWidth = 0; + m_nNewHeight = 0; +} + + //! Copy constructor + Detector(const Detector& source); + + //! Assignment operator + Detector& operator=(const Detector& source); + + //! Detect (in an image later) + int Detect(const Image &image, Zone** zones, int n_numZones, Event::StringSet &zoneSet); + + //! Load detector's parameters from a config file. + virtual void loadConfig(string sConfigFileName) = 0; + + //! Returns detection case string. + string getDetectionCause(); + +protected: + + //! Do detection inside one given zone. + virtual bool checkZone(Zone *zone, const Image *zmImage) = 0; + + //! Log messages to the SYSLOG. + void log(int, string sMessage); + + //! String to be shown as detection cause for event. + string m_sDetectionCause; + + //! Minimum score value to consider frame as to be alarmed. + double m_fMinAlarmScore; + + //! Maximum score value to consider frame as to be alarmed. + double m_fMaxAlarmScore; + + //! Maximum allowed width of frame image. + double m_fImageScaleFactor; + + //! Width of image to resize. + int m_nNewWidth; + + //! Height of image to resize. + int m_nNewHeight; +// +// //! Output stream for logging errors. +// ofstream m_outStream; + + //! String prefix for SYSLOG messages. + string m_sLogPrefix; + + //! Name of config file section to search parameters. + string m_sConfigSectionName; +}; + + +#endif // ZM_DETECTOR_H diff --git a/src/zm_event.cpp b/src/zm_event.cpp new file mode 100644 index 000000000..a43f31a66 --- /dev/null +++ b/src/zm_event.cpp @@ -0,0 +1,1457 @@ +// +// ZoneMinder Event Class Implementation, $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. +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "zm.h" +#include "zm_db.h" +#include "zm_time.h" +#include "zm_mpeg.h" +#include "zm_signal.h" +#include "zm_event.h" +#include "zm_monitor.h" + +#include "zmf.h" + +#if HAVE_SYS_SENDFILE_H +#include +#endif + +//#define USE_PREPARED_SQL 1 + +bool Event::initialised = false; +char Event::capture_file_format[PATH_MAX]; +char Event::analyse_file_format[PATH_MAX]; +char Event::general_file_format[PATH_MAX]; + +int Event::pre_alarm_count = 0; +Event::PreAlarmData Event::pre_alarm_data[MAX_PRE_ALARM_FRAMES] = { { 0 } }; + +Event::Event( Monitor *p_monitor, struct timeval p_start_time, const std::string &p_cause, const StringSetMap &p_noteSetMap ) : + monitor( p_monitor ), + start_time( p_start_time ), + cause( p_cause ), + noteSetMap( p_noteSetMap ) +{ + if ( !initialised ) + Initialise(); + + std::string notes; + createNotes( notes ); + + bool untimedEvent = false; + if ( !start_time.tv_sec ) + { + untimedEvent = true; + gettimeofday( &start_time, 0 ); + } + + static char sql[ZM_SQL_MED_BUFSIZ]; + + struct tm *stime = localtime( &start_time.tv_sec ); + snprintf( sql, sizeof(sql), "insert into Events ( MonitorId, Name, StartTime, Width, Height, Cause, Notes ) values ( %d, 'New Event', from_unixtime( %ld ), %d, %d, '%s', '%s' )", monitor->Id(), start_time.tv_sec, monitor->Width(), monitor->Height(), cause.c_str(), notes.c_str() ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't insert event: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + id = mysql_insert_id( &dbconn ); + if ( untimedEvent ) + { + Warning( "Event %d has zero time, setting to current", id ); + } + end_time.tv_sec = 0; + frames = 0; + alarm_frames = 0; + tot_score = 0; + max_score = 0; + + if ( config.use_deep_storage ) + { + char *path_ptr = path; + path_ptr += snprintf( path_ptr, sizeof(path), "%s/%d", config.dir_events, monitor->Id() ); + + int dt_parts[6]; + dt_parts[0] = stime->tm_year-100; + dt_parts[1] = stime->tm_mon+1; + dt_parts[2] = stime->tm_mday; + dt_parts[3] = stime->tm_hour; + dt_parts[4] = stime->tm_min; + dt_parts[5] = stime->tm_sec; + + char date_path[PATH_MAX] = ""; + char time_path[PATH_MAX] = ""; + char *time_path_ptr = time_path; + for ( unsigned int i = 0; i < sizeof(dt_parts)/sizeof(*dt_parts); i++ ) + { + path_ptr += snprintf( path_ptr, sizeof(path)-(path_ptr-path), "/%02d", dt_parts[i] ); + + struct stat statbuf; + errno = 0; + stat( path, &statbuf ); + if ( errno == ENOENT || errno == ENOTDIR ) + { + if ( mkdir( path, 0755 ) ) + { + Fatal( "Can't mkdir %s: %s", path, strerror(errno)); + } + } + if ( i == 2 ) + strncpy( date_path, path, sizeof(date_path) ); + else if ( i >= 3 ) + time_path_ptr += snprintf( time_path_ptr, sizeof(time_path)-(time_path_ptr-time_path), "%s%02d", i>3?"/":"", dt_parts[i] ); + } + char id_file[PATH_MAX]; + // Create event id symlink + snprintf( id_file, sizeof(id_file), "%s/.%d", date_path, id ); + if ( symlink( time_path, id_file ) < 0 ) + Fatal( "Can't symlink %s -> %s: %s", id_file, path, strerror(errno)); + // Create empty id tag file + snprintf( id_file, sizeof(id_file), "%s/.%d", path, id ); + if ( FILE *id_fp = fopen( id_file, "w" ) ) + fclose( id_fp ); + else + Fatal( "Can't fopen %s: %s", id_file, strerror(errno)); + } + else + { + snprintf( path, sizeof(path), "%s/%d/%d", config.dir_events, monitor->Id(), id ); + + struct stat statbuf; + errno = 0; + stat( path, &statbuf ); + if ( errno == ENOENT || errno == ENOTDIR ) + { + if ( mkdir( path, 0755 ) ) + { + Error( "Can't mkdir %s: %s", path, strerror(errno)); + } + } + char id_file[PATH_MAX]; + // Create empty id tag file + snprintf( id_file, sizeof(id_file), "%s/.%d", path, id ); + if ( FILE *id_fp = fopen( id_file, "w" ) ) + fclose( id_fp ); + else + Fatal( "Can't fopen %s: %s", id_file, strerror(errno)); + } + last_db_frame = 0; +} + +Event::~Event() +{ + if ( frames > last_db_frame ) + { + struct DeltaTimeval delta_time; + DELTA_TIMEVAL( delta_time, end_time, start_time, DT_PREC_2 ); + + Debug( 1, "Adding closing frame %d to DB", frames ); + static char sql[ZM_SQL_SML_BUFSIZ]; + snprintf( sql, sizeof(sql), "insert into Frames ( EventId, FrameId, TimeStamp, Delta ) values ( %d, %d, from_unixtime( %ld ), %s%ld.%02ld )", id, frames, end_time.tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't insert frame: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + } + + static char sql[ZM_SQL_MED_BUFSIZ]; + + struct DeltaTimeval delta_time; + DELTA_TIMEVAL( delta_time, end_time, start_time, DT_PREC_2 ); + + snprintf( sql, sizeof(sql), "update Events set Name='%s%d', EndTime = from_unixtime( %ld ), Length = %s%ld.%02ld, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d where Id = %d", monitor->EventPrefix(), id, end_time.tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec, frames, alarm_frames, tot_score, (int)(alarm_frames?(tot_score/alarm_frames):0), max_score, id ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't update event: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } +} + +void Event::createNotes( std::string ¬es ) +{ + notes.clear(); + for ( StringSetMap::const_iterator mapIter = noteSetMap.begin(); mapIter != noteSetMap.end(); mapIter++ ) + { + notes += mapIter->first; + notes += ": "; + const StringSet &stringSet = mapIter->second; + for ( StringSet::const_iterator setIter = stringSet.begin(); setIter != stringSet.end(); setIter++ ) + { + if ( setIter != stringSet.begin() ) + notes += ", "; + notes += *setIter; + } + } +} + +int Event::sd = -1; + +bool Event::OpenFrameSocket( int monitor_id ) +{ + if ( sd > 0 ) + { + close( sd ); + } + + sd = socket( AF_UNIX, SOCK_STREAM, 0); + if ( sd < 0 ) + { + Error( "Can't create socket: %s", strerror(errno) ); + return( false ); + } + + int socket_buffer_size = config.frame_socket_size; + if ( socket_buffer_size > 0 ) + { + if ( setsockopt( sd, SOL_SOCKET, SO_SNDBUF, &socket_buffer_size, sizeof(socket_buffer_size) ) < 0 ) + { + Error( "Can't get socket buffer size to %d, error = %s", socket_buffer_size, strerror(errno) ); + close( sd ); + sd = -1; + return( false ); + } + } + + int flags; + if ( (flags = fcntl( sd, F_GETFL )) < 0 ) + { + Error( "Can't get socket flags, error = %s", strerror(errno) ); + close( sd ); + sd = -1; + return( false ); + } + flags |= O_NONBLOCK; + if ( fcntl( sd, F_SETFL, flags ) < 0 ) + { + Error( "Can't set socket flags, error = %s", strerror(errno) ); + close( sd ); + sd = -1; + return( false ); + } + + char sock_path[PATH_MAX] = ""; + snprintf( sock_path, sizeof(sock_path), "%s/zmf-%d.sock", config.path_socks, monitor_id ); + + struct sockaddr_un addr; + + strncpy( addr.sun_path, sock_path, sizeof(addr.sun_path) ); + addr.sun_family = AF_UNIX; + + if ( connect( sd, (struct sockaddr *)&addr, strlen(addr.sun_path)+sizeof(addr.sun_family)) < 0 ) + { + Warning( "Can't connect to frame server: %s", strerror(errno) ); + close( sd ); + sd = -1; + return( false ); + } + + Debug( 1, "Opened connection to frame server" ); + return( true ); +} + +bool Event::ValidateFrameSocket( int monitor_id ) +{ + if ( sd < 0 ) + { + return( OpenFrameSocket( monitor_id ) ); + } + return( true ); +} + +bool Event::SendFrameImage( const Image *image, bool alarm_frame ) +{ + if ( !ValidateFrameSocket( monitor->Id() ) ) + { + return( false ); + } + + static int jpg_buffer_size = 0; + static unsigned char jpg_buffer[ZM_MAX_IMAGE_SIZE]; + + image->EncodeJpeg( jpg_buffer, &jpg_buffer_size, (alarm_frame&&(config.jpeg_alarm_file_quality>config.jpeg_file_quality))?config.jpeg_alarm_file_quality:config.jpeg_file_quality ); + + static FrameHeader frame_header; + + frame_header.event_id = id; + if ( config.use_deep_storage ) + frame_header.event_time = start_time.tv_sec; + frame_header.frame_id = frames; + frame_header.alarm_frame = alarm_frame; + frame_header.image_length = jpg_buffer_size; + + struct iovec iovecs[2]; + iovecs[0].iov_base = &frame_header; + iovecs[0].iov_len = sizeof(frame_header); + iovecs[1].iov_base = jpg_buffer; + iovecs[1].iov_len = jpg_buffer_size; + + ssize_t writev_size = sizeof(frame_header)+jpg_buffer_size; + ssize_t writev_result = writev( sd, iovecs, sizeof(iovecs)/sizeof(*iovecs)); + if ( writev_result != writev_size ) + { + if ( writev_result < 0 ) + { + if ( errno == EAGAIN ) + { + Warning( "Blocking write detected" ); + } + else + { + Error( "Can't write frame: %s", strerror(errno) ); + close( sd ); + sd = -1; + } + } + else + { + Error( "Incomplete frame write: %zd of %zd bytes written", writev_result, writev_size ); + close( sd ); + sd = -1; + } + return( false ); + } + Debug( 1, "Wrote frame image, %d bytes", jpg_buffer_size ); + + return( true ); +} + +bool Event::WriteFrameImage( Image *image, struct timeval timestamp, const char *event_file, bool alarm_frame ) +{ + if ( config.timestamp_on_capture ) + { + if ( !config.opt_frame_server || !SendFrameImage( image, alarm_frame) ) + { + if ( alarm_frame && (config.jpeg_alarm_file_quality > config.jpeg_file_quality) ) + image->WriteJpeg( event_file, config.jpeg_alarm_file_quality ); + else + image->WriteJpeg( event_file ); + } + } + else + { + Image ts_image( *image ); + monitor->TimestampImage( &ts_image, ×tamp ); + if ( !config.opt_frame_server || !SendFrameImage( &ts_image, alarm_frame) ) + { + if ( alarm_frame && (config.jpeg_alarm_file_quality > config.jpeg_file_quality) ) + ts_image.WriteJpeg( event_file, config.jpeg_alarm_file_quality ); + else + ts_image.WriteJpeg( event_file ); + } + } + return( true ); +} + +void Event::updateNotes( const StringSetMap &newNoteSetMap ) +{ + bool update = false; + + //Info( "Checking notes, %d <> %d", noteSetMap.size(), newNoteSetMap.size() ); + if ( newNoteSetMap.size() > 0 ) + { + if ( noteSetMap.size() == 0 ) + { + noteSetMap = newNoteSetMap; + update = true; + } + else + { + for ( StringSetMap::const_iterator newNoteSetMapIter = newNoteSetMap.begin(); newNoteSetMapIter != newNoteSetMap.end(); newNoteSetMapIter++ ) + { + const std::string &newNoteGroup = newNoteSetMapIter->first; + const StringSet &newNoteSet = newNoteSetMapIter->second; + //Info( "Got %d new strings", newNoteSet.size() ); + if ( newNoteSet.size() > 0 ) + { + StringSetMap::iterator noteSetMapIter = noteSetMap.find( newNoteGroup ); + if ( noteSetMapIter == noteSetMap.end() ) + { + //Info( "Can't find note group %s, copying %d strings", newNoteGroup.c_str(), newNoteSet.size() ); + noteSetMap.insert( StringSetMap::value_type( newNoteGroup, newNoteSet ) ); + update = true; + } + else + { + StringSet ¬eSet = noteSetMapIter->second; + //Info( "Found note group %s, got %d strings", newNoteGroup.c_str(), newNoteSet.size() ); + for ( StringSet::const_iterator newNoteSetIter = newNoteSet.begin(); newNoteSetIter != newNoteSet.end(); newNoteSetIter++ ) + { + const std::string &newNote = *newNoteSetIter; + StringSet::iterator noteSetIter = noteSet.find( newNote ); + if ( noteSetIter == noteSet.end() ) + { + noteSet.insert( newNote ); + update = true; + } + } + } + } + } + } + } + + if ( update ) + { + std::string notes; + createNotes( notes ); + + Debug( 2, "Updating notes for event %d, '%s'", id, notes.c_str() ); + static char sql[ZM_SQL_MED_BUFSIZ]; +#if USE_PREPARED_SQL + static MYSQL_STMT *stmt = 0; + + char notesStr[ZM_SQL_MED_BUFSIZ] = ""; + unsigned long notesLen = 0; + + if ( !stmt ) + { + const char *sql = "update Events set Notes = ? where Id = ?"; + + stmt = mysql_stmt_init( &dbconn ); + if ( mysql_stmt_prepare( stmt, sql, strlen(sql) ) ) + { + Fatal( "Unable to prepare sql '%s': %s", sql, mysql_stmt_error(stmt) ); + } + + /* Get the parameter count from the statement */ + if ( mysql_stmt_param_count( stmt ) != 2 ) + { + Fatal( "Unexpected parameter count %ld in sql '%s'", mysql_stmt_param_count( stmt ), sql ); + } + + MYSQL_BIND bind[2]; + memset(bind, 0, sizeof(bind)); + + /* STRING PARAM */ + bind[0].buffer_type = MYSQL_TYPE_STRING; + bind[0].buffer = (char *)notesStr; + bind[0].buffer_length = sizeof(notesStr); + bind[0].is_null = 0; + bind[0].length = ¬esLen; + + bind[1].buffer_type= MYSQL_TYPE_LONG; + bind[1].buffer= (char *)&id; + bind[1].is_null= 0; + bind[1].length= 0; + + /* Bind the buffers */ + if ( mysql_stmt_bind_param( stmt, bind ) ) + { + Fatal( "Unable to bind sql '%s': %s", sql, mysql_stmt_error(stmt) ); + } + } + + strncpy( notesStr, notes.c_str(), sizeof(notesStr) ); + notesLen = notes.length(); + + if ( mysql_stmt_execute( stmt ) ) + { + Fatal( "Unable to execute sql '%s': %s", sql, mysql_stmt_error(stmt) ); + } +#else + static char escapedNotes[ZM_SQL_MED_BUFSIZ]; + + mysql_real_escape_string( &dbconn, escapedNotes, notes.c_str(), notes.length() ); + + snprintf( sql, sizeof(sql), "update Events set Notes = '%s' where Id = %d", escapedNotes, id ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't insert event: %s", mysql_error( &dbconn ) ); + } +#endif + } +} + +void Event::AddFrames( int n_frames, Image **images, struct timeval **timestamps ) +{ + static char sql[ZM_SQL_LGE_BUFSIZ]; + strncpy( sql, "insert into Frames ( EventId, FrameId, TimeStamp, Delta ) values ", sizeof(sql) ); + int frameCount = 0; + for ( int i = 0; i < n_frames; i++ ) + { + if ( !timestamps[i]->tv_sec ) + { + Debug( 1, "Not adding pre-capture frame %d, zero timestamp", i ); + continue; + } + + frames++; + + static char event_file[PATH_MAX]; + snprintf( event_file, sizeof(event_file), capture_file_format, path, frames ); + + Debug( 1, "Writing pre-capture frame %d", frames ); + WriteFrameImage( images[i], *(timestamps[i]), event_file ); + + struct DeltaTimeval delta_time; + DELTA_TIMEVAL( delta_time, *(timestamps[i]), start_time, DT_PREC_2 ); + + int sql_len = strlen(sql); + snprintf( sql+sql_len, sizeof(sql)-sql_len, "( %d, %d, from_unixtime(%ld), %s%ld.%02ld ), ", id, frames, timestamps[i]->tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec ); + + frameCount++; + } + + if ( frameCount ) + { + Debug( 1, "Adding %d/%d frames to DB", frameCount, n_frames ); + *(sql+strlen(sql)-2) = '\0'; + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't insert frames: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + last_db_frame = frames; + } + else + { + Debug( 1, "No valid pre-capture frames to add" ); + } +} + +void Event::AddFrame( Image *image, struct timeval timestamp, int score, Image *alarm_image ) +{ + if ( !timestamp.tv_sec ) + { + Debug( 1, "Not adding new frame, zero timestamp" ); + return; + } + + frames++; + + static char event_file[PATH_MAX]; + snprintf( event_file, sizeof(event_file), capture_file_format, path, frames ); + + Debug( 1, "Writing capture frame %d", frames ); + WriteFrameImage( image, timestamp, event_file ); + + struct DeltaTimeval delta_time; + DELTA_TIMEVAL( delta_time, timestamp, start_time, DT_PREC_2 ); + + bool db_frame = (score>=0) || ((frames%config.bulk_frame_interval)==0) || !frames; + + if ( db_frame ) + { + const char *frame_type = score>0?"Alarm":(score<0?"Bulk":"Normal"); + + Debug( 1, "Adding frame %d to DB", frames ); + static char sql[ZM_SQL_MED_BUFSIZ]; + snprintf( sql, sizeof(sql), "insert into Frames ( EventId, FrameId, Type, TimeStamp, Delta, Score ) values ( %d, %d, '%s', from_unixtime( %ld ), %s%ld.%02ld, %d )", id, frames, frame_type, timestamp.tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec, score ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't insert frame: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + last_db_frame = frames; + + // We are writing a bulk frame + if ( score < 0 ) + { + snprintf( sql, sizeof(sql), "update Events set Length = %s%ld.%02ld, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d where Id = %d", delta_time.positive?"":"-", delta_time.sec, delta_time.fsec, frames, alarm_frames, tot_score, (int)(alarm_frames?(tot_score/alarm_frames):0), max_score, id ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't update event: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + } + } + + end_time = timestamp; + + if ( score > 0 ) + { + alarm_frames++; + + tot_score += score; + if ( score > (int)max_score ) + max_score = score; + + if ( alarm_image ) + { + snprintf( event_file, sizeof(event_file), analyse_file_format, path, frames ); + + Debug( 1, "Writing analysis frame %d", frames ); + WriteFrameImage( alarm_image, timestamp, event_file, true ); + } + } + + /* This makes viewing the diagnostic images impossible because it keeps deleting them + if ( config.record_diag_images ) + { + char diag_glob[PATH_MAX] = ""; + + snprintf( diag_glob, sizeof(diag_glob), "%s/%d/diag-*.jpg", config.dir_events, monitor->Id() ); + glob_t pglob; + int glob_status = glob( diag_glob, 0, 0, &pglob ); + if ( glob_status != 0 ) + { + if ( glob_status < 0 ) + { + Error( "Can't glob '%s': %s", diag_glob, strerror(errno) ); + } + else + { + Debug( 1, "Can't glob '%s': %d", diag_glob, glob_status ); + } + } + else + { + char new_diag_path[PATH_MAX] = ""; + for ( int i = 0; i < pglob.gl_pathc; i++ ) + { + char *diag_path = pglob.gl_pathv[i]; + + char *diag_file = strstr( diag_path, "diag-" ); + + if ( diag_file ) + { + snprintf( new_diag_path, sizeof(new_diag_path), general_file_format, path, frames, diag_file ); + + if ( rename( diag_path, new_diag_path ) < 0 ) + { + Error( "Can't rename '%s' to '%s': %s", diag_path, new_diag_path, strerror(errno) ); + } + } + } + } + globfree( &pglob ); + } + */ +} + +bool EventStream::loadInitialEventData( int monitor_id, time_t event_time ) +{ + static char sql[ZM_SQL_SML_BUFSIZ]; + + snprintf( sql, sizeof(sql), "select Id from Events where MonitorId = %d and unix_timestamp( EndTime ) > %ld order by Id asc limit 1", monitor_id, event_time ); + + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + MYSQL_ROW dbrow = mysql_fetch_row( result ); + + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + int init_event_id = atoi( dbrow[0] ); + + mysql_free_result( result ); + + loadEventData( init_event_id ); + + if ( event_time ) + { + curr_stream_time = event_time; + curr_frame_id = 1; + if ( event_time >= event_data->start_time ) + { + for (unsigned int i = 0; i < event_data->frame_count; i++ ) + { + //Info( "eft %d > et %d", event_data->frames[i].timestamp, event_time ); + if ( event_data->frames[i].timestamp >= event_time ) + { + curr_frame_id = i+1; + Debug( 3, "Set cst:%.2f", curr_stream_time ); + Debug( 3, "Set cfid:%d", curr_frame_id ); + break; + } + } + Debug( 3, "Skipping %ld frames", event_data->frame_count ); + } + } + return( true ); +} + +bool EventStream::loadInitialEventData( int init_event_id, int init_frame_id ) +{ + loadEventData( init_event_id ); + + if ( init_frame_id ) + { + curr_stream_time = event_data->frames[init_frame_id-1].timestamp; + curr_frame_id = init_frame_id; + } + else + { + curr_stream_time = event_data->start_time; + } + + return( true ); +} + +bool EventStream::loadEventData( int event_id ) +{ + static char sql[ZM_SQL_MED_BUFSIZ]; + + snprintf( sql, sizeof(sql), "select M.Id, M.Name, E.Frames, unix_timestamp( StartTime ) as StartTimestamp, max(F.Delta)-min(F.Delta) as Duration from Events as E inner join Monitors as M on E.MonitorId = M.Id inner join Frames as F on E.Id = F.EventId where E.Id = %d group by E.Id", event_id ); + + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + if ( !mysql_num_rows( result ) ) + { + Fatal( "Unable to load event %d, not found in DB", event_id ); + } + + MYSQL_ROW dbrow = mysql_fetch_row( result ); + + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + delete event_data; + event_data = new EventData; + event_data->event_id = event_id; + event_data->monitor_id = atoi( dbrow[0] ); + event_data->start_time = atoi(dbrow[3]); + if ( config.use_deep_storage ) + { + struct tm *event_time = localtime( &event_data->start_time ); + if ( config.dir_events[0] == '/' ) + snprintf( event_data->path, sizeof(event_data->path), "%s/%ld/%02d/%02d/%02d/%02d/%02d/%02d", config.dir_events, event_data->monitor_id, event_time->tm_year-100, event_time->tm_mon+1, event_time->tm_mday, event_time->tm_hour, event_time->tm_min, event_time->tm_sec ); + else + snprintf( event_data->path, sizeof(event_data->path), "%s/%s/%ld/%02d/%02d/%02d/%02d/%02d/%02d", staticConfig.PATH_WEB.c_str(), config.dir_events, event_data->monitor_id, event_time->tm_year-100, event_time->tm_mon+1, event_time->tm_mday, event_time->tm_hour, event_time->tm_min, event_time->tm_sec ); + } + else + { + if ( config.dir_events[0] == '/' ) + snprintf( event_data->path, sizeof(event_data->path), "%s/%ld/%ld", config.dir_events, event_data->monitor_id, event_data->event_id ); + else + snprintf( event_data->path, sizeof(event_data->path), "%s/%s/%ld/%ld", staticConfig.PATH_WEB.c_str(), config.dir_events, event_data->monitor_id, event_data->event_id ); + } + event_data->frame_count = atoi(dbrow[2]); + event_data->duration = atof(dbrow[4]); + + updateFrameRate( (double)event_data->frame_count/event_data->duration ); + + mysql_free_result( result ); + + snprintf( sql, sizeof(sql), "select FrameId, unix_timestamp( `TimeStamp` ), Delta from Frames where EventId = %d order by FrameId asc", event_id ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + event_data->n_frames = mysql_num_rows( result ); + + event_data->frames = new FrameData[event_data->frame_count]; + int id, last_id = 0; + time_t timestamp, last_timestamp = event_data->start_time; + double delta, last_delta = 0.0; + while ( ( dbrow = mysql_fetch_row( result ) ) ) + { + id = atoi(dbrow[0]); + timestamp = atoi(dbrow[1]); + delta = atof(dbrow[2]); + int id_diff = id - last_id; + double frame_delta = (delta-last_delta)/id_diff; + if ( id_diff > 1 ) + { + for ( int i = last_id+1; i < id; i++ ) + { + event_data->frames[i-1].timestamp = (time_t)(last_timestamp + ((i-last_id)*frame_delta)); + event_data->frames[i-1].offset = (time_t)(event_data->frames[i-1].timestamp-event_data->start_time); + event_data->frames[i-1].delta = frame_delta; + event_data->frames[i-1].in_db = false; + } + } + event_data->frames[id-1].timestamp = timestamp; + event_data->frames[id-1].offset = (time_t)(event_data->frames[id-1].timestamp-event_data->start_time); + event_data->frames[id-1].delta = id>1?frame_delta:0.0; + event_data->frames[id-1].in_db = true; + last_id = id; + last_delta = delta; + last_timestamp = timestamp; + } + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + //for ( int i = 0; i < 250; i++ ) + //{ + //Info( "%d -> %d @ %f (%d)", i+1, event_data->frames[i].timestamp, event_data->frames[i].delta, event_data->frames[i].in_db ); + //} + + mysql_free_result( result ); + + if ( forceEventChange || mode == MODE_ALL_GAPLESS ) + { + if ( replay_rate > 0 ) + curr_stream_time = event_data->frames[0].timestamp; + else + curr_stream_time = event_data->frames[event_data->frame_count-1].timestamp; + } + Debug( 2, "Event:%ld, Frames:%ld, Duration: %.2f", event_data->event_id, event_data->frame_count, event_data->duration ); + + return( true ); +} + +void EventStream::processCommand( const CmdMsg *msg ) +{ + Debug( 2, "Got message, type %d, msg %d", msg->msg_type, msg->msg_data[0] ) + // Check for incoming command + switch( (MsgCommand)msg->msg_data[0] ) + { + case CMD_PAUSE : + { + Debug( 1, "Got PAUSE command" ); + + // Set paused flag + paused = true; + replay_rate = ZM_RATE_BASE; + last_frame_sent = TV_2_FLOAT( now ); + break; + } + case CMD_PLAY : + { + Debug( 1, "Got PLAY command" ); + if ( paused ) + { + // Clear paused flag + paused = false; + } + replay_rate = ZM_RATE_BASE; + break; + } + case CMD_VARPLAY : + { + Debug( 1, "Got VARPLAY command" ); + if ( paused ) + { + // Clear paused flag + paused = false; + } + replay_rate = ntohs(((unsigned char)msg->msg_data[2]<<8)|(unsigned char)msg->msg_data[1])-32768; + break; + } + case CMD_STOP : + { + Debug( 1, "Got STOP command" ); + + // Clear paused flag + paused = false; + break; + } + case CMD_FASTFWD : + { + Debug( 1, "Got FAST FWD command" ); + if ( paused ) + { + // Clear paused flag + paused = false; + } + // Set play rate + switch ( replay_rate ) + { + case 2 * ZM_RATE_BASE : + replay_rate = 5 * ZM_RATE_BASE; + break; + case 5 * ZM_RATE_BASE : + replay_rate = 10 * ZM_RATE_BASE; + break; + case 10 * ZM_RATE_BASE : + replay_rate = 25 * ZM_RATE_BASE; + break; + case 25 * ZM_RATE_BASE : + case 50 * ZM_RATE_BASE : + replay_rate = 50 * ZM_RATE_BASE; + break; + default : + replay_rate = 2 * ZM_RATE_BASE; + break; + } + break; + } + case CMD_SLOWFWD : + { + Debug( 1, "Got SLOW FWD command" ); + // Set paused flag + paused = true; + // Set play rate + replay_rate = ZM_RATE_BASE; + // Set step + step = 1; + break; + } + case CMD_SLOWREV : + { + Debug( 1, "Got SLOW REV command" ); + // Set paused flag + paused = true; + // Set play rate + replay_rate = ZM_RATE_BASE; + // Set step + step = -1; + break; + } + case CMD_FASTREV : + { + Debug( 1, "Got FAST REV command" ); + if ( paused ) + { + // Clear paused flag + paused = false; + } + // Set play rate + switch ( replay_rate ) + { + case -2 * ZM_RATE_BASE : + replay_rate = -5 * ZM_RATE_BASE; + break; + case -5 * ZM_RATE_BASE : + replay_rate = -10 * ZM_RATE_BASE; + break; + case -10 * ZM_RATE_BASE : + replay_rate = -25 * ZM_RATE_BASE; + break; + case -25 * ZM_RATE_BASE : + case -50 * ZM_RATE_BASE : + replay_rate = -50 * ZM_RATE_BASE; + break; + default : + replay_rate = -2 * ZM_RATE_BASE; + break; + } + break; + } + case CMD_ZOOMIN : + { + x = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; + y = ((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; + Debug( 1, "Got ZOOM IN command, to %d,%d", x, y ); + switch ( zoom ) + { + case 100: + zoom = 150; + break; + case 150: + zoom = 200; + break; + case 200: + zoom = 300; + break; + case 300: + zoom = 400; + break; + case 400: + default : + zoom = 500; + break; + } + break; + } + case CMD_ZOOMOUT : + { + Debug( 1, "Got ZOOM OUT command" ); + switch ( zoom ) + { + case 500: + zoom = 400; + break; + case 400: + zoom = 300; + break; + case 300: + zoom = 200; + break; + case 200: + zoom = 150; + break; + case 150: + default : + zoom = 100; + break; + } + break; + } + case CMD_PAN : + { + x = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; + y = ((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; + Debug( 1, "Got PAN command, to %d,%d", x, y ); + break; + } + case CMD_SCALE : + { + scale = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; + Debug( 1, "Got SCALE command, to %d", scale ); + break; + } + case CMD_PREV : + { + Debug( 1, "Got PREV command" ); + if ( replay_rate >= 0 ) + curr_frame_id = 0; + else + curr_frame_id = event_data->frame_count-1; + paused = false; + forceEventChange = true; + break; + } + case CMD_NEXT : + { + Debug( 1, "Got NEXT command" ); + if ( replay_rate >= 0 ) + curr_frame_id = event_data->frame_count-1; + else + curr_frame_id = 0; + paused = false; + forceEventChange = true; + break; + } + case CMD_SEEK : + { + int offset = ((unsigned char)msg->msg_data[1]<<24)|((unsigned char)msg->msg_data[2]<<16)|((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; + curr_frame_id = (int)(event_data->frame_count*offset/event_data->duration); + Debug( 1, "Got SEEK command, to %d (new cfid: %d)", offset, curr_frame_id ); + break; + } + case CMD_QUERY : + { + Debug( 1, "Got QUERY command, sending STATUS" ); + break; + } + default : + { + // Do nothing, for now + } + } + struct { + int event; + int progress; + int rate; + int zoom; + bool paused; + } status_data; + + status_data.event = event_data->event_id; + status_data.progress = (int)event_data->frames[curr_frame_id-1].offset; + status_data.rate = replay_rate; + status_data.zoom = zoom; + status_data.paused = paused; + Debug( 2, "E:%d, P:%d, p:%d R:%d, Z:%d", + status_data.event, + status_data.paused, + status_data.progress, + status_data.rate, + status_data.zoom + ); + + DataMsg status_msg; + status_msg.msg_type = MSG_DATA_EVENT; + memcpy( &status_msg.msg_data, &status_data, sizeof(status_msg.msg_data) ); + if ( sendto( sd, &status_msg, sizeof(status_msg), MSG_DONTWAIT, (sockaddr *)&rem_addr, sizeof(rem_addr) ) < 0 ) + { + //if ( errno != EAGAIN ) + { + Error( "Can't sendto on sd %d: %s", sd, strerror(errno) ); + exit( -1 ); + } + } + + updateFrameRate( (double)event_data->frame_count/event_data->duration ); +} + +void EventStream::checkEventLoaded() +{ + bool reload_event = false; + static char sql[ZM_SQL_SML_BUFSIZ]; + + if ( curr_frame_id <= 0 ) + { + snprintf( sql, sizeof(sql), "select Id from Events where MonitorId = %ld and Id < %ld order by Id desc limit 1", event_data->monitor_id, event_data->event_id ); + reload_event = true; + } + else if ( (unsigned int)curr_frame_id > event_data->frame_count ) + { + snprintf( sql, sizeof(sql), "select Id from Events where MonitorId = %ld and Id > %ld order by Id asc limit 1", event_data->monitor_id, event_data->event_id ); + reload_event = true; + } + + if ( reload_event ) + { + if ( forceEventChange || mode != MODE_SINGLE ) + { + //Info( "SQL:%s", sql ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + MYSQL_ROW dbrow = mysql_fetch_row( result ); + + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + if ( dbrow ) + { + int event_id = atoi(dbrow[0]); + Debug( 1, "Loading new event %d", event_id ); + + loadEventData( event_id ); + + Debug( 2, "Current frame id = %d", curr_frame_id ); + if ( curr_frame_id <= 0 ) + curr_frame_id = event_data->frame_count; + else + curr_frame_id = 1; + Debug( 2, "New frame id = %d", curr_frame_id ); + } + else + { + if ( curr_frame_id <= 0 ) + curr_frame_id = 1; + else + curr_frame_id = event_data->frame_count; + paused = true; + } + mysql_free_result( result ); + forceEventChange = false; + } + else + { + if ( curr_frame_id <= 0 ) + curr_frame_id = 1; + else + curr_frame_id = event_data->frame_count; + paused = true; + } + } +} + +bool EventStream::sendFrame( int delta_us ) +{ + Debug( 2, "Sending frame %d", curr_frame_id ); + + static char filepath[PATH_MAX]; + static struct stat filestat; + FILE *fdj = NULL; + + snprintf( filepath, sizeof(filepath), Event::capture_file_format, event_data->path, curr_frame_id ); + +#if HAVE_LIBAVCODEC + if ( type == STREAM_MPEG ) + { + Image image( filepath ); + + Image *send_image = prepareImage( &image ); + + if ( !vid_stream ) + { + vid_stream = new VideoStream( "pipe:", format, bitrate, effective_fps, send_image->Colours(), send_image->SubpixelOrder(), send_image->Width(), send_image->Height() ); + fprintf( stdout, "Content-type: %s\r\n\r\n", vid_stream->MimeType() ); + vid_stream->OpenStream(); + } + /* double pts = */ vid_stream->EncodeFrame( send_image->Buffer(), send_image->Size(), config.mpeg_timed_frames, delta_us*1000 ); + } + else +#endif // HAVE_LIBAVCODEC + { + static unsigned char temp_img_buffer[ZM_MAX_IMAGE_SIZE]; + + int img_buffer_size = 0; + uint8_t *img_buffer = temp_img_buffer; + + bool send_raw = ((scale>=ZM_SCALE_BASE)&&(zoom==ZM_SCALE_BASE)); + + fprintf( stdout, "--ZoneMinderFrame\r\n" ); + + if ( type != STREAM_JPEG ) + send_raw = false; + + if ( send_raw ) + { + fdj = fopen( filepath, "rb" ); + if ( !fdj ) + { + Error( "Can't open %s: %s", filepath, strerror(errno) ); + return( false ); + } +#if HAVE_SENDFILE + if( fstat(fileno(fdj),&filestat) < 0 ) { + Error( "Failed getting information about file %s: %s", filepath, strerror(errno) ); + return( false ); + } +#else + img_buffer_size = fread( img_buffer, 1, sizeof(temp_img_buffer), fdj ); +#endif + } + else + { + Image image( filepath ); + + Image *send_image = prepareImage( &image ); + + switch( type ) + { + case STREAM_JPEG : + send_image->EncodeJpeg( img_buffer, &img_buffer_size ); + break; + case STREAM_RAW : + img_buffer = (uint8_t*)(send_image->Buffer()); + img_buffer_size = send_image->Size(); + break; + case STREAM_ZIP : + unsigned long zip_buffer_size; + send_image->Zip( img_buffer, &zip_buffer_size ); + img_buffer_size = zip_buffer_size; + break; + default: + Fatal( "Unexpected frame type %d", type ); + break; + } + } + + switch( type ) + { + case STREAM_JPEG : + fprintf( stdout, "Content-Type: image/jpeg\r\n" ); + break; + case STREAM_RAW : + fprintf( stdout, "Content-Type: image/x-rgb\r\n" ); + break; + case STREAM_ZIP : + fprintf( stdout, "Content-Type: image/x-rgbz\r\n" ); + break; + default : + Fatal( "Unexpected frame type %d", type ); + break; + } + + + if(send_raw) { +#if HAVE_SENDFILE + fprintf( stdout, "Content-Length: %d\r\n\r\n", (int)filestat.st_size ); + if(sendfile(fileno(stdout), fileno(fdj), 0, (int)filestat.st_size) != (int)filestat.st_size) { + /* sendfile() failed, use standard way instead */ + img_buffer_size = fread( img_buffer, 1, sizeof(temp_img_buffer), fdj ); + if ( fwrite( img_buffer, img_buffer_size, 1, stdout ) != 1 ) { + Error("Unable to send raw frame %u: %s",curr_frame_id,strerror(errno)); + return( false ); + } + } +#else + fprintf( stdout, "Content-Length: %d\r\n\r\n", img_buffer_size ); + if ( fwrite( img_buffer, img_buffer_size, 1, stdout ) != 1 ) { + Error("Unable to send raw frame %u: %s",curr_frame_id,strerror(errno)); + return( false ); + } +#endif + fclose(fdj); /* Close the file handle */ + } else { + fprintf( stdout, "Content-Length: %d\r\n\r\n", img_buffer_size ); + if ( fwrite( img_buffer, img_buffer_size, 1, stdout ) != 1 ) + { + Error( "Unable to send stream frame: %s", strerror(errno) ); + return( false ); + } + } + + fprintf( stdout, "\r\n\r\n" ); + fflush( stdout ); + } + last_frame_sent = TV_2_FLOAT( now ); + return( true ); +} + +void EventStream::runStream() +{ + Event::Initialise(); + + openComms(); + + checkInitialised(); + + updateFrameRate( (double)event_data->frame_count/event_data->duration ); + + if ( type == STREAM_JPEG ) + fprintf( stdout, "Content-Type: multipart/x-mixed-replace;boundary=ZoneMinderFrame\r\n\r\n" ); + + if ( !event_data ) + { + sendTextFrame( "No event data found" ); + exit( 0 ); + } + + unsigned int delta_us = 0; + while( !zm_terminate ) + { + gettimeofday( &now, NULL ); + + while(checkCommandQueue()); + + if ( step != 0 ) + curr_frame_id += step; + + checkEventLoaded(); + + // Get current frame data + FrameData *frame_data = &event_data->frames[curr_frame_id-1]; + + //Info( "cst:%.2f", curr_stream_time ); + //Info( "cfid:%d", curr_frame_id ); + //Info( "fdt:%d", frame_data->timestamp ); + if ( !paused ) + { + bool in_event = true; + double time_to_event = 0; + if ( replay_rate > 0 ) + { + time_to_event = event_data->frames[0].timestamp - curr_stream_time; + if ( time_to_event > 0 ) + in_event = false; + } + else if ( replay_rate < 0 ) + { + time_to_event = curr_stream_time - event_data->frames[event_data->frame_count-1].timestamp; + if ( time_to_event > 0 ) + in_event = false; + } + if ( !in_event ) + { + double actual_delta_time = TV_2_FLOAT( now ) - last_frame_sent; + if ( actual_delta_time > 1 ) + { + static char frame_text[64]; + snprintf( frame_text, sizeof(frame_text), "Time to next event = %d seconds", (int)time_to_event ); + if ( !sendTextFrame( frame_text ) ) + zm_terminate = true; + } + //else + //{ + usleep( STREAM_PAUSE_WAIT ); + //curr_stream_time += (replay_rate>0?1:-1) * ((1.0L * replay_rate * STREAM_PAUSE_WAIT)/(ZM_RATE_BASE * 1000000)); + curr_stream_time += (1.0L * replay_rate * STREAM_PAUSE_WAIT)/(ZM_RATE_BASE * 1000000); + //} + continue; + } + } + + // Figure out if we should send this frame + bool send_frame = false; + if ( !paused ) + { + // If we are streaming and this frame is due to be sent + if ( ((curr_frame_id-1)%frame_mod) == 0 ) + { + delta_us = (unsigned int)(frame_data->delta * 1000000); + if ( effective_fps < base_fps ) + delta_us = (unsigned int)((delta_us * base_fps)/effective_fps); + send_frame = true; + } + } + else if ( step != 0 ) + { + // We are paused and are just stepping forward or backward one frame + step = 0; + send_frame = true; + } + else + { + // We are paused, and doing nothing + double actual_delta_time = TV_2_FLOAT( now ) - last_frame_sent; + if ( actual_delta_time > MAX_STREAM_DELAY ) + { + // Send keepalive + Debug( 2, "Sending keepalive frame" ); + send_frame = true; + } + } + + if ( send_frame ) + if ( !sendFrame( delta_us ) ) + zm_terminate = true; + + curr_stream_time = frame_data->timestamp; + + if ( !paused ) + { + curr_frame_id += replay_rate>0?1:-1; + if ( send_frame && type != STREAM_MPEG ) + { + Debug( 3, "dUs: %d", delta_us ); + usleep( delta_us ); + } + } + else + { + usleep( (unsigned long)((1000000 * ZM_RATE_BASE)/((base_fps?base_fps:1)*abs(replay_rate*2))) ); + } + } +#if HAVE_LIBAVCODEC + if ( type == STREAM_MPEG ) + delete vid_stream; +#endif // HAVE_LIBAVCODEC + + closeComms(); +} diff --git a/src/zm_event.h b/src/zm_event.h new file mode 100644 index 000000000..7029a9f5c --- /dev/null +++ b/src/zm_event.h @@ -0,0 +1,266 @@ +// +// ZoneMinder Core Interfaces, $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. +// + +#ifndef ZM_EVENT_H +#define ZM_EVENT_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "zm.h" +#include "zm_image.h" +#include "zm_stream.h" + +class Zone; +class Monitor; + +#define MAX_PRE_ALARM_FRAMES 16 // Maximum number of prealarm frames that can be stored + +// +// Class describing events, i.e. captured periods of activity. +// +class Event +{ +friend class EventStream; + +protected: + static bool initialised; + static char capture_file_format[PATH_MAX]; + static char analyse_file_format[PATH_MAX]; + static char general_file_format[PATH_MAX]; + +protected: + static int sd; + +public: + typedef std::set StringSet; + typedef std::map StringSetMap; + +protected: + typedef enum { NORMAL, BULK, ALARM } FrameType; + + struct PreAlarmData + { + Image *image; + struct timeval timestamp; + unsigned int score; + Image *alarm_frame; + }; + + static int pre_alarm_count; + static PreAlarmData pre_alarm_data[MAX_PRE_ALARM_FRAMES]; + +protected: + unsigned int id; + Monitor *monitor; + struct timeval start_time; + struct timeval end_time; + std::string cause; + StringSetMap noteSetMap; + int frames; + int alarm_frames; + unsigned int tot_score; + unsigned int max_score; + char path[PATH_MAX]; + +protected: + int last_db_frame; + +protected: + static void Initialise() + { + if ( initialised ) + return; + + snprintf( capture_file_format, sizeof(capture_file_format), "%%s/%%0%dd-capture.jpg", config.event_image_digits ); + snprintf( analyse_file_format, sizeof(analyse_file_format), "%%s/%%0%dd-analyse.jpg", config.event_image_digits ); + snprintf( general_file_format, sizeof(general_file_format), "%%s/%%0%dd-%%s", config.event_image_digits ); + + initialised = true; + } + + void createNotes( std::string ¬es ); + +public: + static bool OpenFrameSocket( int ); + static bool ValidateFrameSocket( int ); + +public: + Event( Monitor *p_monitor, struct timeval p_start_time, const std::string &p_cause, const StringSetMap &p_noteSetMap ); + ~Event(); + + int Id() const { return( id ); } + const std::string &Cause() { return( cause ); } + int Frames() const { return( frames ); } + int AlarmFrames() const { return( alarm_frames ); } + + const struct timeval &StartTime() const { return( start_time ); } + const struct timeval &EndTime() const { return( end_time ); } + struct timeval &EndTime() { return( end_time ); } + + bool SendFrameImage( const Image *image, bool alarm_frame=false ); + bool WriteFrameImage( Image *image, struct timeval timestamp, const char *event_file, bool alarm_frame=false ); + + void updateNotes( const StringSetMap &stringSetMap ); + + void AddFrames( int n_frames, Image **images, struct timeval **timestamps ); + void AddFrame( Image *image, struct timeval timestamp, int score=0, Image *alarm_frame=NULL ); + +public: + static const char *getSubPath( struct tm *time ) + { + static char subpath[PATH_MAX] = ""; + snprintf( subpath, sizeof(subpath), "%02d/%02d/%02d/%02d/%02d/%02d", time->tm_year-100, time->tm_mon+1, time->tm_mday, time->tm_hour, time->tm_min, time->tm_sec ); + return( subpath ); + } + static const char *getSubPath( time_t *time ) + { + return( Event::getSubPath( localtime( time ) ) ); + } + +public: + static int PreAlarmCount() + { + return( pre_alarm_count ); + } + static void EmptyPreAlarmFrames() + { + if ( pre_alarm_count > 0 ) + { + for ( int i = 0; i < MAX_PRE_ALARM_FRAMES; i++ ) + { + delete pre_alarm_data[i].image; + delete pre_alarm_data[i].alarm_frame; + } + memset( pre_alarm_data, 0, sizeof(pre_alarm_data) ); + } + pre_alarm_count = 0; + } + static void AddPreAlarmFrame( Image *image, struct timeval timestamp, int score=0, Image *alarm_frame=NULL ) + { + pre_alarm_data[pre_alarm_count].image = new Image( *image ); + pre_alarm_data[pre_alarm_count].timestamp = timestamp; + pre_alarm_data[pre_alarm_count].score = score; + if ( alarm_frame ) + { + pre_alarm_data[pre_alarm_count].alarm_frame = new Image( *alarm_frame ); + } + pre_alarm_count++; + } + void SavePreAlarmFrames() + { + for ( int i = 0; i < pre_alarm_count; i++ ) + { + AddFrame( pre_alarm_data[i].image, pre_alarm_data[i].timestamp, pre_alarm_data[i].score, pre_alarm_data[i].alarm_frame ); + } + EmptyPreAlarmFrames(); + } +}; + +class EventStream : public StreamBase +{ +public: + typedef enum { MODE_SINGLE, MODE_ALL, MODE_ALL_GAPLESS } StreamMode; + +protected: + struct FrameData { + //unsigned long id; + time_t timestamp; + time_t offset; + double delta; + bool in_db; + }; + + struct EventData + { + unsigned long event_id; + unsigned long monitor_id; + unsigned long frame_count; + time_t start_time; + double duration; + char path[PATH_MAX]; + int n_frames; + FrameData *frames; + }; + +protected: + static const int STREAM_PAUSE_WAIT = 250000; // Microseconds + + static const StreamMode DEFAULT_MODE = MODE_SINGLE; + +protected: + StreamMode mode; + bool forceEventChange; + +protected: + int curr_frame_id; + double curr_stream_time; + + EventData *event_data; + +protected: + bool loadEventData( int event_id ); + bool loadInitialEventData( int init_event_id, int init_frame_id ); + bool loadInitialEventData( int monitor_id, time_t event_time ); + + void checkEventLoaded(); + void processCommand( const CmdMsg *msg ); + bool sendFrame( int delta_us ); + +public: + EventStream() + { + mode = DEFAULT_MODE; + + forceEventChange = false; + + curr_frame_id = 0; + curr_stream_time = 0.0; + + event_data = 0; + } + void setStreamStart( int init_event_id, int init_frame_id=0 ) + { + loadInitialEventData( init_event_id, init_frame_id ); + loadMonitor( event_data->monitor_id ); + } + void setStreamStart( int monitor_id, time_t event_time ) + { + loadInitialEventData( monitor_id, event_time ); + loadMonitor( monitor_id ); + } + void setStreamMode( StreamMode p_mode ) + { + mode = p_mode; + } + void runStream(); +}; + +#endif // ZM_EVENT_H diff --git a/src/zm_exception.cpp b/src/zm_exception.cpp new file mode 100644 index 000000000..b7fe9e9a4 --- /dev/null +++ b/src/zm_exception.cpp @@ -0,0 +1,22 @@ +// +// ZoneMinder Exception Class Implementation, $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. +// + +#include "zm_exception.h" + +// Blank diff --git a/src/zm_exception.h b/src/zm_exception.h new file mode 100644 index 000000000..4af60bfa6 --- /dev/null +++ b/src/zm_exception.h @@ -0,0 +1,68 @@ +// +// ZoneMinder Exception Class Interface, $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. +// + +#ifndef ZM_EXCEPTION_H +#define ZM_EXCEPTION_H + +#include "zm.h" + +#include + +class Exception +{ +protected: + typedef enum { INFO, WARNING, ERROR, FATAL } Severity; + +protected: + std::string mMessage; + Severity mSeverity; + +public: + Exception( const std::string &message, Severity severity=ERROR ) : mMessage( message ), mSeverity( severity ) + { + } + +public: + const std::string &getMessage() const + { + return( mMessage ); + } + Severity getSeverity() const + { + return( mSeverity ); + } + bool isInfo() const + { + return( mSeverity == INFO ); + } + bool isWarning() const + { + return( mSeverity == WARNING ); + } + bool isError() const + { + return( mSeverity == ERROR ); + } + bool isFatal() const + { + return( mSeverity == FATAL ); + } +}; + +#endif // ZM_EXCEPTION_H diff --git a/src/zm_ffmpeg.cpp b/src/zm_ffmpeg.cpp new file mode 100644 index 000000000..577a188ca --- /dev/null +++ b/src/zm_ffmpeg.cpp @@ -0,0 +1,24 @@ +/* + * ZoneMinder FFMPEG implementation, $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 HAVE_LIBAVCODEC + +#include "zm_ffmpeg.h" + +#endif // HAVE_LIBAVCODEC diff --git a/src/zm_ffmpeg.h b/src/zm_ffmpeg.h new file mode 100644 index 000000000..059f88b39 --- /dev/null +++ b/src/zm_ffmpeg.h @@ -0,0 +1,74 @@ +/* + * ZoneMinder FFMPEG Interface, $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. +*/ + +#ifndef ZM_FFMPEG_H +#define ZM_FFMPEG_H + +#if HAVE_LIBAVCODEC + +#ifdef __cplusplus +extern "C" { +#endif +#if HAVE_LIBAVUTIL_AVUTIL_H +#include +#endif +#if HAVE_LIBAVCODEC_AVCODEC_H +#include +#endif +#if HAVE_LIBAVFORMAT_AVFORMAT_H +#include +#endif +#if HAVE_LIBSWSCALE +#if HAVE_LIBSWSCALE_SWSCALE_H +#include +#include // this is a fix for error: ‘av_rescale_q’ was not declared in this scope +#endif +#endif // HAVE_LIBSWSCALE +#ifdef __cplusplus +} +#endif + +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 4, 0) + #if defined(AVIO_WRONLY) + #define AVIO_FLAG_WRITE AVIO_WRONLY + #else + #define AVIO_FLAG_WRITE URL_WRONLY + #endif +#endif + +#if FFMPEG_VERSION_INT == 0x000408 +#define ZM_FFMPEG_048 1 +#elif FFMPEG_VERSION_INT == 0x000409 +#if LIBAVCODEC_VERSION_INT < ((50<<16)+(0<<8)+0) +#define ZM_FFMPEG_049 1 +#else // LIBAVCODEC_VERSION_INT +#define ZM_FFMPEG_SVN 1 +#endif // LIBAVCODEC_VERSION_INT +#else // FFMPEG_VERSION_INT +#define ZM_FFMPEG_SVN 1 +#endif // FFMPEG_VERSION_INT + +/* Fix for not having SWS_CPU_CAPS_SSE2 defined */ +#ifndef SWS_CPU_CAPS_SSE2 +#define SWS_CPU_CAPS_SSE2 0x02000000 +#endif + +#endif // HAVE_LIBAVCODEC + +#endif // ZM_FFMPEG_H diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp new file mode 100644 index 000000000..c69907d9c --- /dev/null +++ b/src/zm_ffmpeg_camera.cpp @@ -0,0 +1,263 @@ +// +// ZoneMinder Ffmpeg Camera Class Implementation, $Date: 2009-01-16 12:18:50 +0000 (Fri, 16 Jan 2009) $, $Revision: 2713 $ +// 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. +// + +#include "zm.h" + +#if HAVE_LIBAVFORMAT + +#include "zm_ffmpeg_camera.h" + +FfmpegCamera::FfmpegCamera( int p_id, const std::string &p_path, int p_width, int p_height, int p_colours, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ) : + Camera( p_id, FFMPEG_SRC, p_width, p_height, p_colours, ZM_SUBPIX_ORDER_DEFAULT_FOR_COLOUR(p_colours), p_brightness, p_contrast, p_hue, p_colour, p_capture ), + mPath( p_path ) +{ + if ( capture ) + { + Initialise(); + } + + mFormatContext = NULL; + mVideoStreamId = -1; + mCodecContext = NULL; + mCodec = NULL; + mRawFrame = NULL; + mFrame = NULL; + frameCount = 0; + +#if HAVE_LIBSWSCALE + mConvertContext = NULL; +#endif + /* Has to be located inside the constructor so other components such as zma will receive correct colours and subpixel order */ + if(colours == ZM_COLOUR_RGB32) { + subpixelorder = ZM_SUBPIX_ORDER_RGBA; + imagePixFormat = PIX_FMT_RGBA; + } else if(colours == ZM_COLOUR_RGB24) { + subpixelorder = ZM_SUBPIX_ORDER_RGB; + imagePixFormat = PIX_FMT_RGB24; + } else if(colours == ZM_COLOUR_GRAY8) { + subpixelorder = ZM_SUBPIX_ORDER_NONE; + imagePixFormat = PIX_FMT_GRAY8; + } else { + Panic("Unexpected colours: %d",colours); + } + +} + +FfmpegCamera::~FfmpegCamera() +{ + av_freep( &mFrame ); + av_freep( &mRawFrame ); + +#if HAVE_LIBSWSCALE + if ( mConvertContext ) + { + sws_freeContext( mConvertContext ); + mConvertContext = NULL; + } +#endif + + if ( mCodecContext ) + { + avcodec_close( mCodecContext ); + mCodecContext = NULL; // Freed by av_close_input_file + } + if ( mFormatContext ) + { +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 4, 0) + av_close_input_file( mFormatContext ); +#else + avformat_close_input( &mFormatContext ); +#endif + mFormatContext = NULL; + } + + if ( capture ) + { + Terminate(); + } +} + +void FfmpegCamera::Initialise() +{ + if ( logDebugging() ) + av_log_set_level( AV_LOG_DEBUG ); + else + av_log_set_level( AV_LOG_QUIET ); + + av_register_all(); +} + +void FfmpegCamera::Terminate() +{ +} + +int FfmpegCamera::PrimeCapture() +{ + Info( "Priming capture from %s", mPath.c_str() ); + + // Open the input, not necessarily a file +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 4, 0) + if ( av_open_input_file( &mFormatContext, mPath.c_str(), NULL, 0, NULL ) !=0 ) +#else + if ( avformat_open_input( &mFormatContext, mPath.c_str(), NULL, NULL ) !=0 ) +#endif + Fatal( "Unable to open input %s due to: %s", mPath.c_str(), strerror(errno) ); + + // Locate stream info from input +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 4, 0) + if ( av_find_stream_info( mFormatContext ) < 0 ) +#else + if ( avformat_find_stream_info( mFormatContext, 0 ) < 0 ) +#endif + Fatal( "Unable to find stream info from %s due to: %s", mPath.c_str(), strerror(errno) ); + + // Find first video stream present + mVideoStreamId = -1; + for (unsigned int i=0; i < mFormatContext->nb_streams; i++ ) + { +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1) + if ( mFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO ) +#else + if ( mFormatContext->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO ) +#endif + { + mVideoStreamId = i; + break; + } + } + if ( mVideoStreamId == -1 ) + Fatal( "Unable to locate video stream in %s", mPath.c_str() ); + + mCodecContext = mFormatContext->streams[mVideoStreamId]->codec; + + // Try and get the codec from the codec context + if ( (mCodec = avcodec_find_decoder( mCodecContext->codec_id )) == NULL ) + Fatal( "Can't find codec for video stream from %s", mPath.c_str() ); + + // Open the codec +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 7, 0) + if ( avcodec_open( mCodecContext, mCodec ) < 0 ) +#else + if ( avcodec_open2( mCodecContext, mCodec, 0 ) < 0 ) +#endif + Fatal( "Unable to open codec for video stream from %s", mPath.c_str() ); + + // Allocate space for the native video frame + mRawFrame = avcodec_alloc_frame(); + + // Allocate space for the converted video frame + mFrame = avcodec_alloc_frame(); + + if(mRawFrame == NULL || mFrame == NULL) + Fatal( "Unable to allocate frame for %s", mPath.c_str() ); + + int pSize = avpicture_get_size( imagePixFormat, width, height ); + if( (unsigned int)pSize != imagesize) { + Fatal("Image size mismatch. Required: %d Available: %d",pSize,imagesize); + } + +#if HAVE_LIBSWSCALE + if(!sws_isSupportedInput(mCodecContext->pix_fmt)) { + Fatal("swscale does not support the codec format: %c%c%c%c",(mCodecContext->pix_fmt)&0xff,((mCodecContext->pix_fmt>>8)&0xff),((mCodecContext->pix_fmt>>16)&0xff),((mCodecContext->pix_fmt>>24)&0xff)); + } + + if(!sws_isSupportedOutput(imagePixFormat)) { + Fatal("swscale does not support the target format: %c%c%c%c",(imagePixFormat)&0xff,((imagePixFormat>>8)&0xff),((imagePixFormat>>16)&0xff),((imagePixFormat>>24)&0xff)); + } + +#else // HAVE_LIBSWSCALE + Fatal( "You must compile ffmpeg with the --enable-swscale option to use ffmpeg cameras" ); +#endif // HAVE_LIBSWSCALE + + return( 0 ); +} + +int FfmpegCamera::PreCapture() +{ + // Nothing to do here + return( 0 ); +} + +int FfmpegCamera::Capture( Image &image ) +{ + AVPacket packet; + uint8_t* directbuffer; + + /* Request a writeable buffer of the target image */ + directbuffer = image.WriteBuffer(width, height, colours, subpixelorder); + if(directbuffer == NULL) { + Error("Failed requesting writeable buffer for the captured image."); + return (-1); + } + + int frameComplete = false; + while ( !frameComplete ) + { + int avResult = av_read_frame( mFormatContext, &packet ); + if ( avResult < 0 ) + { + Error( "Unable to read packet from stream %d: error %d", packet.stream_index, avResult ); + return( -1 ); + } + Debug( 5, "Got packet from stream %d", packet.stream_index ); + if ( packet.stream_index == mVideoStreamId ) + { + if ( avcodec_decode_video2( mCodecContext, mRawFrame, &frameComplete, &packet ) < 0 ) + Fatal( "Unable to decode frame at frame %d", frameCount ); + + Debug( 4, "Decoded video packet at frame %d", frameCount ); + + if ( frameComplete ) + { + Debug( 3, "Got frame %d", frameCount ); + + avpicture_fill( (AVPicture *)mFrame, directbuffer, imagePixFormat, width, height); + +#if HAVE_LIBSWSCALE + if(mConvertContext == NULL) { + if(config.cpu_extensions && sseversion >= 20) { + mConvertContext = sws_getContext( mCodecContext->width, mCodecContext->height, mCodecContext->pix_fmt, width, height, imagePixFormat, SWS_BICUBIC | SWS_CPU_CAPS_SSE2, NULL, NULL, NULL ); + } else { + mConvertContext = sws_getContext( mCodecContext->width, mCodecContext->height, mCodecContext->pix_fmt, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL ); + } + if(mConvertContext == NULL) + Fatal( "Unable to create conversion context for %s", mPath.c_str() ); + } + + if ( sws_scale( mConvertContext, mRawFrame->data, mRawFrame->linesize, 0, mCodecContext->height, mFrame->data, mFrame->linesize ) < 0 ) + Fatal( "Unable to convert raw format %u to target format %u at frame %d", mCodecContext->pix_fmt, imagePixFormat, frameCount ); +#else // HAVE_LIBSWSCALE + Fatal( "You must compile ffmpeg with the --enable-swscale option to use ffmpeg cameras" ); +#endif // HAVE_LIBSWSCALE + + frameCount++; + } + } + av_free_packet( &packet ); + } + return (0); +} + +int FfmpegCamera::PostCapture() +{ + // Nothing to do here + return( 0 ); +} + +#endif // HAVE_LIBAVFORMAT diff --git a/src/zm_ffmpeg_camera.h b/src/zm_ffmpeg_camera.h new file mode 100644 index 000000000..3b256d5d6 --- /dev/null +++ b/src/zm_ffmpeg_camera.h @@ -0,0 +1,69 @@ +// +// ZoneMinder Ffmpeg Class Interface, $Date: 2008-07-25 10:33:23 +0100 (Fri, 25 Jul 2008) $, $Revision: 2611 $ +// 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. +// + +#ifndef ZM_FFMPEG_CAMERA_H +#define ZM_FFMPEG_CAMERA_H + +#include "zm_camera.h" + +#include "zm_buffer.h" +//#include "zm_utils.h" +#include "zm_ffmpeg.h" + +// +// Class representing 'remote' cameras, i.e. those which are +// accessed over a network connection. +// +class FfmpegCamera : public Camera +{ +protected: + std::string mPath; + + int frameCount; + +#if HAVE_LIBAVFORMAT + AVFormatContext *mFormatContext; + int mVideoStreamId; + AVCodecContext *mCodecContext; + AVCodec *mCodec; + AVFrame *mRawFrame; + AVFrame *mFrame; + PixelFormat imagePixFormat; +#endif // HAVE_LIBAVFORMAT + +#if HAVE_LIBSWSCALE + struct SwsContext *mConvertContext; +#endif + +public: + FfmpegCamera( int p_id, const std::string &path, int p_width, int p_height, int p_colours, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ); + ~FfmpegCamera(); + + const std::string &Path() const { return( mPath ); } + + void Initialise(); + void Terminate(); + + int PrimeCapture(); + int PreCapture(); + int Capture( Image &image ); + int PostCapture(); +}; + +#endif // ZM_FFMPEG_CAMERA_H diff --git a/src/zm_file_camera.cpp b/src/zm_file_camera.cpp new file mode 100644 index 000000000..28ce2b155 --- /dev/null +++ b/src/zm_file_camera.cpp @@ -0,0 +1,91 @@ +// +// ZoneMinder File Camera Class Implementation, $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. +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "zm.h" +#include "zm_file_camera.h" + +FileCamera::FileCamera( int p_id, const char *p_path, int p_width, int p_height, int p_colours, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ) : Camera( p_id, FILE_SRC, p_width, p_height, p_colours, ZM_SUBPIX_ORDER_DEFAULT_FOR_COLOUR(p_colours), p_brightness, p_contrast, p_hue, p_colour, p_capture ) +{ + strncpy( path, p_path, sizeof(path) ); + if ( capture ) + { + Initialise(); + } +} + +FileCamera::~FileCamera() +{ + if ( capture ) + { + Terminate(); + } +} + +void FileCamera::Initialise() +{ + if ( !path[0] ) + { + Error( "No path specified for file image" ); + exit( -1 ); + } +} + +void FileCamera::Terminate() +{ +} + +int FileCamera::PreCapture() +{ + struct stat statbuf; + if ( stat( path, &statbuf ) < 0 ) + { + Error( "Can't stat %s: %s", path, strerror(errno) ); + return( -1 ); + } + + while ( (time( 0 ) - statbuf.st_mtime) < 1 ) + { + usleep( 100000 ); + } + return( 0 ); +} + +int FileCamera::Capture( Image &image ) +{ + return( image.ReadJpeg( path, colours, subpixelorder )?0:-1 ); +} + +int FileCamera::PostCapture() +{ + return( 0 ); +} diff --git a/src/zm_file_camera.h b/src/zm_file_camera.h new file mode 100644 index 000000000..ad972e372 --- /dev/null +++ b/src/zm_file_camera.h @@ -0,0 +1,51 @@ +// +// ZoneMinder File Camera Class Interface, $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. +// + +#ifndef ZM_FILE_CAMERA_H +#define ZM_FILE_CAMERA_H + +#include "zm_camera.h" +#include "zm_buffer.h" +#include "zm_regexp.h" + +#include + +// +// Class representing 'file' cameras, i.e. those which are +// accessed over a network connection. +// +class FileCamera : public Camera +{ +protected: + char path[PATH_MAX]; + +public: + FileCamera( int p_id, const char *p_path, int p_width, int p_height, int p_colours, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ); + ~FileCamera(); + + const char *Path() const { return( path ); } + + void Initialise(); + void Terminate(); + int PreCapture(); + int Capture( Image &image ); + int PostCapture(); +}; + +#endif // ZM_FILE_CAMERA_H diff --git a/src/zm_font.h b/src/zm_font.h new file mode 100644 index 000000000..844ff4f1e --- /dev/null +++ b/src/zm_font.h @@ -0,0 +1,3337 @@ +/**********************************************/ +/* */ +/* Font file generated by rthelen */ +/* */ +/**********************************************/ + +static unsigned char fontdata[] = { + + /* 0 0x00 '^A' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 1 0x01 '^B' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 2 0x02 '^C' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 3 0x03 '^D' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 4 0x04 '^E' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 5 0x05 '^F' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 6 0x06 '^G' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 7 0x07 '^H' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 8 0x08 '^I' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 9 0x09 '^J' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 10 0x0a '^K' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 11 0x0b '^L' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 12 0x0c '^M' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 13 0x0d '^N' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 14 0x0e '^O' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 15 0x0f '^P' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 16 0x10 '^Q' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 17 0x11 '^R' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x54, /* 0 0 0 00 */ + 0x38, /* 00 000 */ + 0x54, /* 0 0 0 00 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 18 0x12 '^S' */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x50, /* 0 0 0000 */ + 0x50, /* 0 0 0000 */ + 0x20, /* 00 00000 */ + 0x20, /* 00 00000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 19 0x13 '^T' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x7c, /* 0 00 */ + 0x38, /* 00 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 20 0x14 '^U' */ + 0x18, /* 000 000 */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x7c, /* 0 00 */ + 0x78, /* 0 000 */ + 0x78, /* 0 000 */ + 0x7c, /* 0 00 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 21 0x15 '^V' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 22 0x16 '^W' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 23 0x17 '^X' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 24 0x18 '^Y' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 25 0x19 '^Z' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 26 0x1a '^[' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 27 0x1b '^\' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 28 0x1c '^]' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 29 0x1d '^^' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 30 0x1e '^_' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 31 0x1f '^`' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 32 0x20 ' ' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 33 0x21 '!' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 34 0x22 '"' */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 35 0x23 '#' */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x7c, /* 0 00 */ + 0x28, /* 00 0 000 */ + 0x7c, /* 0 00 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 36 0x24 '$' */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x54, /* 0 0 0 00 */ + 0x50, /* 0 0 0000 */ + 0x38, /* 00 000 */ + 0x14, /* 000 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x38, /* 00 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 37 0x25 '%' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x54, /* 0 0 0 00 */ + 0x58, /* 0 0 000 */ + 0x28, /* 00 0 000 */ + 0x34, /* 00 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x48, /* 0 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 38 0x26 '&' */ + 0x00, /* 00000000 */ + 0x30, /* 00 0000 */ + 0x48, /* 0 00 000 */ + 0x50, /* 0 0 0000 */ + 0x20, /* 00 00000 */ + 0x54, /* 0 0 0 00 */ + 0x48, /* 0 00 000 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 39 0x27 ''' */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 40 0x28 '(' */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x04, /* 00000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 41 0x29 ')' */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 42 0x2a '*' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x54, /* 0 0 0 00 */ + 0x38, /* 00 000 */ + 0x54, /* 0 0 0 00 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 43 0x2b '+' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x7c, /* 0 00 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 44 0x2c ',' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x30, /* 00 0000 */ + 0x30, /* 00 0000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x00, /* 00000000 */ + + /* 45 0x2d '-' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 46 0x2e '.' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 000 000 */ + 0x18, /* 000 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 47 0x2f '/' */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x20, /* 00 00000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x00, /* 00000000 */ + + /* 48 0x30 '0' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x54, /* 0 0 0 00 */ + 0x64, /* 0 00 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 49 0x31 '1' */ + 0x00, /* 00000000 */ + 0x08, /* 0000 000 */ + 0x18, /* 000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x1c, /* 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 50 0x32 '2' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 51 0x33 '3' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x04, /* 00000 00 */ + 0x18, /* 000 000 */ + 0x04, /* 00000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 52 0x34 '4' */ + 0x00, /* 00000000 */ + 0x08, /* 0000 000 */ + 0x18, /* 000 000 */ + 0x28, /* 00 0 000 */ + 0x48, /* 0 00 000 */ + 0x7c, /* 0 00 */ + 0x08, /* 0000 000 */ + 0x1c, /* 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 53 0x35 '5' */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x40, /* 0 000000 */ + 0x78, /* 0 000 */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 54 0x36 '6' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x40, /* 0 000000 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 55 0x37 '7' */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 56 0x38 '8' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 57 0x39 '9' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x3c, /* 00 00 */ + 0x04, /* 00000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 58 0x3a ':' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 000 000 */ + 0x18, /* 000 000 */ + 0x00, /* 00000000 */ + 0x18, /* 000 000 */ + 0x18, /* 000 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 59 0x3b ';' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x30, /* 00 0000 */ + 0x30, /* 00 0000 */ + 0x00, /* 00000000 */ + 0x30, /* 00 0000 */ + 0x30, /* 00 0000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x00, /* 00000000 */ + + /* 60 0x3c '<' */ + 0x00, /* 00000000 */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x04, /* 00000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 61 0x3d '=' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 62 0x3e '>' */ + 0x00, /* 00000000 */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 63 0x3f '?' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 64 0x40 '@' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x74, /* 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x78, /* 0 000 */ + 0x40, /* 0 000000 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 65 0x41 'A' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 66 0x42 'B' */ + 0x00, /* 00000000 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x78, /* 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 67 0x43 'C' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 68 0x44 'D' */ + 0x00, /* 00000000 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x78, /* 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 69 0x45 'E' */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x78, /* 0 000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 70 0x46 'F' */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x78, /* 0 000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 71 0x47 'G' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x40, /* 0 000000 */ + 0x4c, /* 0 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 72 0x48 'H' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 73 0x49 'I' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 74 0x4a 'J' */ + 0x00, /* 00000000 */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 75 0x4b 'K' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x48, /* 0 00 000 */ + 0x50, /* 0 0 0000 */ + 0x60, /* 0 00000 */ + 0x50, /* 0 0 0000 */ + 0x48, /* 0 00 000 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 76 0x4c 'L' */ + 0x00, /* 00000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 77 0x4d 'M' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x6c, /* 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 78 0x4e 'N' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x64, /* 0 00 00 */ + 0x54, /* 0 0 0 00 */ + 0x4c, /* 0 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 79 0x4f 'O' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 80 0x50 'P' */ + 0x00, /* 00000000 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x78, /* 0 000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 81 0x51 'Q' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x54, /* 0 0 0 00 */ + 0x38, /* 00 000 */ + 0x04, /* 00000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 82 0x52 'R' */ + 0x00, /* 00000000 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 83 0x53 'S' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x40, /* 0 000000 */ + 0x38, /* 00 000 */ + 0x04, /* 00000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 84 0x54 'T' */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 85 0x55 'U' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 86 0x56 'V' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x28, /* 00 0 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 87 0x57 'W' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x6c, /* 0 0 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 88 0x58 'X' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x28, /* 00 0 000 */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 89 0x59 'Y' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x28, /* 00 0 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 90 0x5a 'Z' */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x40, /* 0 000000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 91 0x5b '[' */ + 0x0c, /* 0000 00 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x0c, /* 0000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 92 0x5c '\' */ + 0x20, /* 00 00000 */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x02, /* 000000 0 */ + 0x02, /* 000000 0 */ + 0x00, /* 00000000 */ + + /* 93 0x5d ']' */ + 0x30, /* 00 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x30, /* 00 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 94 0x5e '^' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 95 0x5f '_' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 0 0 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 96 0x60 '`' */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 97 0x61 'a' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 98 0x62 'b' */ + 0x00, /* 00000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x78, /* 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 99 0x63 'c' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x40, /* 0 000000 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 100 0x64 'd' */ + 0x00, /* 00000000 */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 101 0x65 'e' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x40, /* 0 000000 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 102 0x66 'f' */ + 0x00, /* 00000000 */ + 0x0c, /* 0000 00 */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 103 0x67 'g' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x3c, /* 00 00 */ + 0x04, /* 00000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + + /* 104 0x68 'h' */ + 0x00, /* 00000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 105 0x69 'i' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x30, /* 00 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 106 0x6a 'j' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x30, /* 00 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x60, /* 0 00000 */ + 0x00, /* 00000000 */ + + /* 107 0x6b 'k' */ + 0x00, /* 00000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x48, /* 0 00 000 */ + 0x50, /* 0 0 0000 */ + 0x70, /* 0 0000 */ + 0x48, /* 0 00 000 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 108 0x6c 'l' */ + 0x00, /* 00000000 */ + 0x30, /* 00 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 109 0x6d 'm' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x78, /* 0 000 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 110 0x6e 'n' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x58, /* 0 0 000 */ + 0x64, /* 0 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 111 0x6f 'o' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 112 0x70 'p' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x78, /* 0 000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x00, /* 00000000 */ + + /* 113 0x71 'q' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x3c, /* 00 00 */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x00, /* 00000000 */ + + /* 114 0x72 'r' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x58, /* 0 0 000 */ + 0x64, /* 0 00 00 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 115 0x73 's' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x40, /* 0 000000 */ + 0x38, /* 00 000 */ + 0x04, /* 00000 00 */ + 0x78, /* 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 116 0x74 't' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x0c, /* 0000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 117 0x75 'u' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 118 0x76 'v' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x28, /* 00 0 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 119 0x77 'w' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 120 0x78 'x' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x28, /* 00 0 000 */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 121 0x79 'y' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x3c, /* 00 00 */ + 0x04, /* 00000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + + /* 122 0x7a 'z' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 123 0x7b '{' */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x04, /* 00000 00 */ + 0x00, /* 00000000 */ + + /* 124 0x7c '|' */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 125 0x7d '}' */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x00, /* 00000000 */ + + /* 126 0x7e '~' */ + 0x00, /* 00000000 */ + 0x34, /* 00 0 00 */ + 0x58, /* 0 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 127 0x7f '^?' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 128 0x80 '\200' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 129 0x81 '\201' */ + 0x28, /* 00 0 000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 130 0x82 '\202' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 131 0x83 '\203' */ + 0x10, /* 000 0000 */ + 0x7c, /* 0 00 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x78, /* 0 000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 132 0x84 '\204' */ + 0x58, /* 0 0 000 */ + 0x44, /* 0 000 00 */ + 0x64, /* 0 00 00 */ + 0x54, /* 0 0 0 00 */ + 0x4c, /* 0 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 133 0x85 '\205' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 134 0x86 '\206' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 135 0x87 '\207' */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 136 0x88 '\210' */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 137 0x89 '\211' */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 138 0x8a '\212' */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 139 0x8b '\213' */ + 0x34, /* 00 0 00 */ + 0x58, /* 0 0 000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 140 0x8c '\214' */ + 0x18, /* 000 000 */ + 0x24, /* 00 00 00 */ + 0x18, /* 000 000 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 141 0x8d '\215' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x3c, /* 00 00 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x00, /* 00000000 */ + + /* 142 0x8e '\216' */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x40, /* 0 000000 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 143 0x8f '\217' */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x40, /* 0 000000 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 144 0x90 '\220' */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x40, /* 0 000000 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 145 0x91 '\221' */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x40, /* 0 000000 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 146 0x92 '\222' */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 147 0x93 '\223' */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 148 0x94 '\224' */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 149 0x95 '\225' */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 150 0x96 '\226' */ + 0x34, /* 00 0 00 */ + 0x58, /* 0 0 000 */ + 0x00, /* 00000000 */ + 0x58, /* 0 0 000 */ + 0x64, /* 0 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 151 0x97 '\227' */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 152 0x98 '\230' */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 153 0x99 '\231' */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 154 0x9a '\232' */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 155 0x9b '\233' */ + 0x34, /* 00 0 00 */ + 0x58, /* 0 0 000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 156 0x9c '\234' */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 157 0x9d '\235' */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 158 0x9e '\236' */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 159 0x9f '\237' */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 160 0xa0 '\240' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 161 0xa1 '\241' */ + 0x18, /* 000 000 */ + 0x24, /* 00 00 00 */ + 0x24, /* 00 00 00 */ + 0x18, /* 000 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 162 0xa2 '\242' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x54, /* 0 0 0 00 */ + 0x50, /* 0 0 0000 */ + 0x54, /* 0 0 0 00 */ + 0x38, /* 00 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 163 0xa3 '\243' */ + 0x30, /* 00 0000 */ + 0x48, /* 0 00 000 */ + 0x40, /* 0 000000 */ + 0x70, /* 0 0000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x44, /* 0 000 00 */ + 0x78, /* 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 164 0xa4 '\244' */ + 0x44, /* 0 000 00 */ + 0x24, /* 00 00 00 */ + 0x50, /* 0 0 0000 */ + 0x48, /* 0 00 000 */ + 0x24, /* 00 00 00 */ + 0x14, /* 000 0 00 */ + 0x48, /* 0 00 000 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 165 0xa5 '\245' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x7c, /* 0 00 */ + 0x7c, /* 0 00 */ + 0x7c, /* 0 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 166 0xa6 '\246' */ + 0x3c, /* 00 00 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x3c, /* 00 00 */ + 0x14, /* 000 0 00 */ + 0x14, /* 000 0 00 */ + 0x14, /* 000 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 167 0xa7 '\247' */ + 0x18, /* 000 000 */ + 0x24, /* 00 00 00 */ + 0x44, /* 0 000 00 */ + 0x48, /* 0 00 000 */ + 0x48, /* 0 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x58, /* 0 0 000 */ + 0x40, /* 0 000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 168 0xa8 '\250' */ + 0x00, /* 00000000 */ + 0x70, /* 0 0000 */ + 0x08, /* 0000 000 */ + 0x64, /* 0 00 00 */ + 0x54, /* 0 0 0 00 */ + 0x64, /* 0 00 00 */ + 0x58, /* 0 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 169 0xa9 '\251' */ + 0x00, /* 00000000 */ + 0x70, /* 0 0000 */ + 0x08, /* 0000 000 */ + 0x34, /* 00 0 00 */ + 0x44, /* 0 000 00 */ + 0x34, /* 00 0 00 */ + 0x08, /* 0000 000 */ + 0x70, /* 0 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 170 0xaa '\252' */ + 0x00, /* 00000000 */ + 0x7a, /* 0 0 0 */ + 0x2e, /* 00 0 0 */ + 0x2e, /* 00 0 0 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 171 0xab '\253' */ + 0x00, /* 00000000 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 172 0xac '\254' */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 173 0xad '\255' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x08, /* 0000 000 */ + 0x7c, /* 0 00 */ + 0x10, /* 000 0000 */ + 0x7c, /* 0 00 */ + 0x20, /* 00 00000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 174 0xae '\256' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x50, /* 0 0 0000 */ + 0x50, /* 0 0 0000 */ + 0x78, /* 0 000 */ + 0x50, /* 0 0 0000 */ + 0x50, /* 0 0 0000 */ + 0x5c, /* 0 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 175 0xaf '\257' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x54, /* 0 0 0 00 */ + 0x64, /* 0 00 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 176 0xb0 '\260' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x6c, /* 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x6c, /* 0 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 177 0xb1 '\261' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x7c, /* 0 00 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 178 0xb2 '\262' */ + 0x00, /* 00000000 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 179 0xb3 '\263' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x1c, /* 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 180 0xb4 '\264' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x28, /* 00 0 000 */ + 0x7c, /* 0 00 */ + 0x10, /* 000 0000 */ + 0x7c, /* 0 00 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 181 0xb5 '\265' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x48, /* 0 00 000 */ + 0x48, /* 0 00 000 */ + 0x48, /* 0 00 000 */ + 0x48, /* 0 00 000 */ + 0x74, /* 0 0 00 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x00, /* 00000000 */ + + /* 182 0xb6 '\266' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x0c, /* 0000 00 */ + 0x14, /* 000 0 00 */ + 0x24, /* 00 00 00 */ + 0x24, /* 00 00 00 */ + 0x18, /* 000 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 183 0xb7 '\267' */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x24, /* 00 00 00 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x24, /* 00 00 00 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 184 0xb8 '\270' */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 185 0xb9 '\271' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 186 0xba '\272' */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x60, /* 0 00000 */ + 0x00, /* 00000000 */ + + /* 187 0xbb '\273' */ + 0x00, /* 00000000 */ + 0x1c, /* 000 00 */ + 0x24, /* 00 00 00 */ + 0x24, /* 00 00 00 */ + 0x1c, /* 000 00 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 188 0xbc '\274' */ + 0x00, /* 00000000 */ + 0x18, /* 000 000 */ + 0x24, /* 00 00 00 */ + 0x24, /* 00 00 00 */ + 0x18, /* 000 000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 189 0xbd '\275' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x28, /* 00 0 000 */ + 0x6c, /* 0 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 190 0xbe '\276' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x54, /* 0 0 0 00 */ + 0x5c, /* 0 0 00 */ + 0x50, /* 0 0 0000 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 191 0xbf '\277' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x4c, /* 0 00 00 */ + 0x54, /* 0 0 0 00 */ + 0x64, /* 0 00 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 192 0xc0 '\300' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x40, /* 0 000000 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 193 0xc1 '\301' */ + 0x00, /* 00000000 */ + 0x08, /* 0000 000 */ + 0x00, /* 00000000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 194 0xc2 '\302' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 195 0xc3 '\303' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x0c, /* 0000 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x50, /* 0 0 0000 */ + 0x20, /* 00 00000 */ + 0x20, /* 00 00000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 196 0xc4 '\304' */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x60, /* 0 00000 */ + 0x00, /* 00000000 */ + + /* 197 0xc5 '\305' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x04, /* 00000 00 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x40, /* 0 000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 198 0xc6 '\306' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 199 0xc7 '\307' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x24, /* 00 00 00 */ + 0x48, /* 0 00 000 */ + 0x48, /* 0 00 000 */ + 0x24, /* 00 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 200 0xc8 '\310' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x48, /* 0 00 000 */ + 0x24, /* 00 00 00 */ + 0x24, /* 00 00 00 */ + 0x48, /* 0 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 201 0xc9 '\311' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x54, /* 0 0 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 202 0xca '\312' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 203 0xcb '\313' */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 204 0xcc '\314' */ + 0x58, /* 0 0 000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 205 0xcd '\315' */ + 0x58, /* 0 0 000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 206 0xce '\316' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x50, /* 0 0 0000 */ + 0x50, /* 0 0 0000 */ + 0x58, /* 0 0 000 */ + 0x50, /* 0 0 0000 */ + 0x50, /* 0 0 0000 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 207 0xcf '\317' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x54, /* 0 0 0 00 */ + 0x5c, /* 0 0 00 */ + 0x50, /* 0 0 0000 */ + 0x2c, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 208 0xd0 '\320' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 209 0xd1 '\321' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 0 0 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 210 0xd2 '\322' */ + 0x00, /* 00000000 */ + 0x14, /* 000 0 00 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 211 0xd3 '\323' */ + 0x00, /* 00000000 */ + 0x14, /* 000 0 00 */ + 0x14, /* 000 0 00 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 212 0xd4 '\324' */ + 0x00, /* 00000000 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x18, /* 000 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 213 0xd5 '\325' */ + 0x00, /* 00000000 */ + 0x18, /* 000 000 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 214 0xd6 '\326' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 215 0xd7 '\327' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x44, /* 0 000 00 */ + 0x28, /* 00 0 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 216 0xd8 '\330' */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x3c, /* 00 00 */ + 0x04, /* 00000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + + /* 217 0xd9 '\331' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 0 0 */ + 0x00, /* 00000000 */ + 0x7e, /* 0 0 */ + 0x00, /* 00000000 */ + 0x7e, /* 0 0 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 218 0xda '\332' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 219 0xdb '\333' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 220 0xdc '\334' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 221 0xdd '\335' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 222 0xde '\336' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 223 0xdf '\337' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 224 0xe0 '\340' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 225 0xe1 '\341' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 226 0xe2 '\342' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 227 0xe3 '\343' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 228 0xe4 '\344' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 229 0xe5 '\345' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 230 0xe6 '\346' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 231 0xe7 '\347' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 232 0xe8 '\350' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 233 0xe9 '\351' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 234 0xea '\352' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 235 0xeb '\353' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 236 0xec '\354' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 237 0xed '\355' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 238 0xee '\356' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 239 0xef '\357' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 240 0xf0 '\360' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 241 0xf1 '\361' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 242 0xf2 '\362' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 243 0xf3 '\363' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 244 0xf4 '\364' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 245 0xf5 '\365' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 246 0xf6 '\366' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 247 0xf7 '\367' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 248 0xf8 '\370' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 249 0xf9 '\371' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 250 0xfa '\372' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 251 0xfb '\373' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 252 0xfc '\374' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 253 0xfd '\375' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 254 0xfe '\376' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 255 0xff '\377' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + +}; diff --git a/src/zm_image.cpp b/src/zm_image.cpp new file mode 100644 index 000000000..829303f29 --- /dev/null +++ b/src/zm_image.cpp @@ -0,0 +1,5463 @@ +// +// ZoneMinder Image Class Implementation, $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. +// +#include "zm.h" +#include "zm_font.h" +#include "zm_image.h" +#include "zm_utils.h" +#include "zm_rgb.h" + +#include +#include + +bool Image::initialised = false; +static unsigned char *y_table; +static signed char *uv_table; +static short *r_v_table; +static short *g_v_table; +static short *g_u_table; +static short *b_u_table; +__attribute__((aligned(16))) static const uint8_t movemask[16] = {0,4,8,12,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; + +jpeg_compress_struct *Image::jpg_ccinfo[101] = { 0 }; +jpeg_decompress_struct *Image::jpg_dcinfo = 0; +struct zm_error_mgr Image::jpg_err; + +/* Pointer to blend function. */ +static blend_fptr_t fptr_blend; + +/* Pointer to delta8 functions */ +static delta_fptr_t fptr_delta8_rgb; +static delta_fptr_t fptr_delta8_bgr; +static delta_fptr_t fptr_delta8_rgba; +static delta_fptr_t fptr_delta8_bgra; +static delta_fptr_t fptr_delta8_argb; +static delta_fptr_t fptr_delta8_abgr; +static delta_fptr_t fptr_delta8_gray8; + +/* Pointers to deinterlace_4field functions */ +static deinterlace_4field_fptr_t fptr_deinterlace_4field_rgba; +static deinterlace_4field_fptr_t fptr_deinterlace_4field_bgra; +static deinterlace_4field_fptr_t fptr_deinterlace_4field_argb; +static deinterlace_4field_fptr_t fptr_deinterlace_4field_abgr; +static deinterlace_4field_fptr_t fptr_deinterlace_4field_gray8; + +/* Pointer to image buffer memory copy function */ +imgbufcpy_fptr_t fptr_imgbufcpy; + +Image::Image() +{ + if ( !initialised ) + Initialise(); + width = 0; + height = 0; + pixels = 0; + colours = 0; + subpixelorder = 0; + size = 0; + allocation = 0; + buffer = 0; + buffertype = 0; + holdbuffer = 0; + text[0] = '\0'; +} + +Image::Image( const char *filename ) +{ + if ( !initialised ) + Initialise(); + width = 0; + height = 0; + pixels = 0; + colours = 0; + subpixelorder = 0; + size = 0; + allocation = 0; + buffer = 0; + buffertype = 0; + holdbuffer = 0; + ReadJpeg( filename, ZM_COLOUR_RGB24, ZM_SUBPIX_ORDER_RGB); + text[0] = '\0'; +} + +Image::Image( int p_width, int p_height, int p_colours, int p_subpixelorder, uint8_t *p_buffer ) +{ + if ( !initialised ) + Initialise(); + width = p_width; + height = p_height; + pixels = width*height; + colours = p_colours; + subpixelorder = p_subpixelorder; + size = (width*height)*colours; + buffer = 0; + holdbuffer = 0; + if ( p_buffer ) + { + allocation = size; + buffertype = ZM_BUFTYPE_DONTFREE; + buffer = p_buffer; + } + else + { + AllocImgBuffer(size); + } + text[0] = '\0'; +} + +Image::Image( const Image &p_image ) +{ + if ( !initialised ) + Initialise(); + width = p_image.width; + height = p_image.height; + pixels = p_image.pixels; + colours = p_image.colours; + subpixelorder = p_image.subpixelorder; + size = allocation = p_image.size; + buffer = 0; + holdbuffer = 0; + AllocImgBuffer(allocation); + (*fptr_imgbufcpy)(buffer, p_image.buffer, size); + strncpy( text, p_image.text, sizeof(text) ); +} + +Image::~Image() +{ + DumpImgBuffer(); +} + +void Image::Initialise() +{ + /* Assign the blend pointer to function */ + if(config.fast_image_blends) { + if(config.cpu_extensions && sseversion >= 20) { + fptr_blend = &sse2_fastblend; /* SSE2 fast blend */ + Debug(2,"Blend: Using SSE2 fast blend function"); + } else { + fptr_blend = &std_fastblend; /* standard fast blend */ + Debug(2,"Blend: Using fast blend function"); + } + } else { + fptr_blend = &std_blend; + Debug(2,"Blend: Using standard blend function"); + } + + __attribute__((aligned(16))) uint8_t blend1[16] = {142,255,159,91,88,227,0,52,37,80,152,97,104,252,90,82}; + __attribute__((aligned(16))) uint8_t blend2[16] = {129,56,136,96,119,149,94,29,96,176,1,144,230,203,111,172}; + __attribute__((aligned(16))) uint8_t blendres[16]; + __attribute__((aligned(16))) uint8_t blendexp[16] = {141,231,157,92,91,217,11,49,45,92,133,103,119,246,92,93}; /* Expected results for 12.5% blend */ + + (*fptr_blend)(blend1,blend2,blendres,16,12.5); + + /* Compare results with expected results */ + for(int i=0;i<16;i++) { + if(abs(blendexp[i] - blendres[i]) > 3) { + Panic("Blend function failed self-test: Results differ from the expected results"); + } + } + + fptr_delta8_rgb = &std_delta8_rgb; + fptr_delta8_bgr = &std_delta8_bgr; + + /* Assign the delta functions */ + if(config.cpu_extensions) { + if(sseversion >= 35) { + /* SSSE3 available */ + fptr_delta8_rgba = &ssse3_delta8_rgba; + fptr_delta8_bgra = &ssse3_delta8_bgra; + fptr_delta8_argb = &ssse3_delta8_argb; + fptr_delta8_abgr = &ssse3_delta8_abgr; + fptr_delta8_gray8 = &sse2_delta8_gray8; + Debug(2,"Delta: Using SSSE3 delta functions"); + } else if(sseversion >= 20) { + /* SSE2 available */ + fptr_delta8_rgba = &sse2_delta8_rgba; + fptr_delta8_bgra = &sse2_delta8_bgra; + fptr_delta8_argb = &sse2_delta8_argb; + fptr_delta8_abgr = &sse2_delta8_abgr; + /* + ** On some systems, the 4 SSE2 algorithms above might be a little slower than + ** the standard algorithms, especially on early Pentium 4 processors. + ** In that case, comment out the 4 lines above and uncomment the 4 lines below + */ + // fptr_delta8_rgba = &std_delta8_rgba; + // fptr_delta8_bgra = &std_delta8_bgra; + // fptr_delta8_argb = &std_delta8_argb; + // fptr_delta8_abgr = &std_delta8_abgr; + fptr_delta8_gray8 = &sse2_delta8_gray8; + Debug(2,"Delta: Using SSE2 delta functions"); + } else { + /* No suitable SSE version available */ + fptr_delta8_rgba = &std_delta8_rgba; + fptr_delta8_bgra = &std_delta8_bgra; + fptr_delta8_argb = &std_delta8_argb; + fptr_delta8_abgr = &std_delta8_abgr; + fptr_delta8_gray8 = &std_delta8_gray8; + Debug(2,"Delta: Using standard delta functions"); + } + } else { + /* CPU extensions disabled */ + fptr_delta8_rgba = &std_delta8_rgba; + fptr_delta8_bgra = &std_delta8_bgra; + fptr_delta8_argb = &std_delta8_argb; + fptr_delta8_abgr = &std_delta8_abgr; + fptr_delta8_gray8 = &std_delta8_gray8; + Debug(2,"Delta: CPU extensions disabled, using standard delta functions"); + } + + /* Use SSSE3 deinterlace functions? */ + if(config.cpu_extensions && sseversion >= 35) { + fptr_deinterlace_4field_rgba = &ssse3_deinterlace_4field_rgba; + fptr_deinterlace_4field_bgra = &ssse3_deinterlace_4field_bgra; + fptr_deinterlace_4field_argb = &ssse3_deinterlace_4field_argb; + fptr_deinterlace_4field_abgr = &ssse3_deinterlace_4field_abgr; + fptr_deinterlace_4field_gray8 = &ssse3_deinterlace_4field_gray8; + Debug(2,"Deinterlace: Using SSSE3 delta functions"); + } else { + fptr_deinterlace_4field_rgba = &std_deinterlace_4field_rgba; + fptr_deinterlace_4field_bgra = &std_deinterlace_4field_bgra; + fptr_deinterlace_4field_argb = &std_deinterlace_4field_argb; + fptr_deinterlace_4field_abgr = &std_deinterlace_4field_abgr; + fptr_deinterlace_4field_gray8 = &std_deinterlace_4field_gray8; + Debug(2,"Deinterlace: Using standard delta functions"); + } + + /* Use SSE2 aligned memory copy? */ + if(config.cpu_extensions && sseversion >= 20) { + fptr_imgbufcpy = &sse2_aligned_memcpy; + Debug(2,"Image buffer copy: Using SSE2 aligned memcpy"); + } else { + fptr_imgbufcpy = &memcpy; + Debug(2,"Image buffer copy: Using standard memcpy"); + } + + /* Code below relocated from zm_local_camera */ + Debug( 3, "Setting up static colour tables" ); + + y_table = new unsigned char[256]; + for ( int i = 0; i <= 255; i++ ) + { + unsigned char c = i; + if ( c <= 16 ) + y_table[c] = 0; + else if ( c >= 235 ) + y_table[c] = 255; + else + y_table[c] = (255*(c-16))/219; + } + + uv_table = new signed char[256]; + for ( int i = 0; i <= 255; i++ ) + { + unsigned char c = i; + if ( c <= 16 ) + uv_table[c] = -127; + else if ( c >= 240 ) + uv_table[c] = 127; + else + uv_table[c] = (127*(c-128))/112; + } + + r_v_table = new short[255]; + g_v_table = new short[255]; + g_u_table = new short[255]; + b_u_table = new short[255]; + for ( int i = 0; i < 255; i++ ) + { + r_v_table[i] = (1402*(i-128))/1000; + g_u_table[i] = (344*(i-128))/1000; + g_v_table[i] = (714*(i-128))/1000; + b_u_table[i] = (1772*(i-128))/1000; + } + + initialised = true; +} + +/* Requests a writeable buffer to the image. This is safer than buffer() because this way we can gurantee that a buffer of required size exists */ +uint8_t* Image::WriteBuffer(const int p_width, const int p_height, const int p_colours, const int p_subpixelorder) { + unsigned int newsize; + + if(p_colours != ZM_COLOUR_GRAY8 && p_colours != ZM_COLOUR_RGB24 && p_colours != ZM_COLOUR_RGB32) { + Error("WriteBuffer called with unexpected colours: %d",p_colours); + return NULL; + } + + if(!p_height || !p_width) { + Error("WriteBuffer called with invaid width or height: %d %d",p_width,p_height); + return NULL; + } + + if(p_width != width || p_height != height || p_colours != colours || p_subpixelorder != subpixelorder) { + newsize = (p_width * p_height) * p_colours; + + if(buffer == NULL) { + AllocImgBuffer(newsize); + } else { + if(allocation < newsize) { + if(holdbuffer) { + Error("Held buffer is undersized for requested buffer"); + return NULL; + } else { + /* Replace buffer with a bigger one */ + DumpImgBuffer(); + AllocImgBuffer(newsize); + } + } + } + + width = p_width; + height = p_height; + colours = p_colours; + subpixelorder = p_subpixelorder; + pixels = height*width; + size = newsize; + } + + return buffer; + +} + +/* Assign an existing buffer to the image instead of copying from a source buffer. The goal is to reduce the amount of memory copying and increase efficiency and buffer reusing. */ +void Image::AssignDirect( const int p_width, const int p_height, const int p_colours, const int p_subpixelorder, uint8_t *new_buffer, const size_t buffer_size, const int p_buffertype) { + if(new_buffer == NULL) { + Error("Attempt to directly assign buffer from a NULL pointer"); + return; + } + + if(buffer_size < (unsigned int)((p_width*p_height)*p_colours)) { + Error("Attempt to directly assign buffer from an undersized buffer of size: %zu",buffer_size); + return; + } + + if(!p_height || !p_width) { + Error("Attempt to directly assign buffer with invalid width or height: %d %d",p_width,p_height); + return; + } + + if(p_colours != ZM_COLOUR_GRAY8 && p_colours != ZM_COLOUR_RGB24 && p_colours != ZM_COLOUR_RGB32) { + Error("Attempt to directly assign buffer with unexpected colours per pixel: %d",p_colours); + return; + } + + if(holdbuffer && buffer) { + if((unsigned int)((p_height*p_width)*p_colours) > allocation) { + Error("Held buffer is undersized for assigned buffer"); + return; + } else { + width = p_width; + height = p_height; + colours = p_colours; + subpixelorder = p_subpixelorder; + pixels = height*width; + size = pixels*colours; + + /* Copy into the held buffer */ + if(new_buffer != buffer) + (*fptr_imgbufcpy)(buffer, new_buffer, size); + + /* Free the new buffer */ + DumpBuffer(new_buffer, p_buffertype); + } + } else { + /* Free an existing buffer if any */ + DumpImgBuffer(); + + width = p_width; + height = p_height; + colours = p_colours; + subpixelorder = p_subpixelorder; + pixels = height*width; + size = pixels*colours; + + allocation = buffer_size; + buffertype = p_buffertype; + buffer = new_buffer; + } + +} + +void Image::Assign(const int p_width, const int p_height, const int p_colours, const int p_subpixelorder, const uint8_t* new_buffer, const size_t buffer_size) { + unsigned int new_size = (p_width * p_height) * p_colours; + + if(new_buffer == NULL) { + Error("Attempt to assign buffer from a NULL pointer"); + return; + } + + if(buffer_size < new_size) { + Error("Attempt to assign buffer from an undersized buffer of size: %zu",buffer_size); + return; + } + + if(!p_height || !p_width) { + Error("Attempt to assign buffer with invalid width or height: %d %d",p_width,p_height); + return; + } + + if(p_colours != ZM_COLOUR_GRAY8 && p_colours != ZM_COLOUR_RGB24 && p_colours != ZM_COLOUR_RGB32) { + Error("Attempt to assign buffer with unexpected colours per pixel: %d",p_colours); + return; + } + + if ( !buffer || p_width != width || p_height != height || p_colours != colours || p_subpixelorder != subpixelorder) { + + if (holdbuffer && buffer) { + if (new_size > allocation) { + Error("Held buffer is undersized for assigned buffer"); + return; + } + } else { + if(new_size > allocation || !buffer) { + DumpImgBuffer(); + AllocImgBuffer(new_size); + } + } + + width = p_width; + height = p_height; + pixels = width*height; + colours = p_colours; + subpixelorder = p_subpixelorder; + size = new_size; + } + + if(new_buffer != buffer) + (*fptr_imgbufcpy)(buffer, new_buffer, size); + +} + +void Image::Assign( const Image &image ) { + unsigned int new_size = (image.width * image.height) * image.colours; + + if(image.buffer == NULL) { + Error("Attempt to assign image with an empty buffer"); + return; + } + + if(image.colours != ZM_COLOUR_GRAY8 && image.colours != ZM_COLOUR_RGB24 && image.colours != ZM_COLOUR_RGB32) { + Error("Attempt to assign image with unexpected colours per pixel: %d",image.colours); + return; + } + + if ( !buffer || image.width != width || image.height != height || image.colours != colours || image.subpixelorder != subpixelorder) { + + if (holdbuffer && buffer) { + if (new_size > allocation) { + Error("Held buffer is undersized for assigned buffer"); + return; + } + } else { + if(new_size > allocation || !buffer) { + DumpImgBuffer(); + AllocImgBuffer(new_size); + } + } + + width = image.width; + height = image.height; + pixels = width*height; + colours = image.colours; + subpixelorder = image.subpixelorder; + size = new_size; + } + + if(image.buffer != buffer) + (*fptr_imgbufcpy)(buffer, image.buffer, size); +} + +Image *Image::HighlightEdges( Rgb colour, int p_colours, int p_subpixelorder, const Box *limits ) +{ + if ( colours != ZM_COLOUR_GRAY8 ) + { + Panic( "Attempt to highlight image edges when colours = %d", colours ); + } + + /* Convert the colour's RGBA subpixel order into the image's subpixel order */ + colour = rgb_convert(colour,p_subpixelorder); + + /* Create a new image of the target format */ + Image *high_image = new Image( width, height, p_colours, p_subpixelorder ); + uint8_t* high_buff = high_image->WriteBuffer(width, height, p_colours, p_subpixelorder); + + /* Set image to all black */ + high_image->Clear(); + + int lo_x = limits?limits->Lo().X():0; + int lo_y = limits?limits->Lo().Y():0; + int hi_x = limits?limits->Hi().X():width-1; + int hi_y = limits?limits->Hi().Y():height-1; + + if ( p_colours == ZM_COLOUR_GRAY8 ) + { + for ( int y = lo_y; y <= hi_y; y++ ) + { + const uint8_t* p = buffer + (y * width) + lo_x; + uint8_t* phigh = high_buff + (y * width) + lo_x; + for ( int x = lo_x; x <= hi_x; x++, p++, phigh++ ) + { + bool edge = false; + if ( *p ) + { + if ( !edge && x > 0 && !*(p-1) ) edge = true; + if ( !edge && x < (width-1) && !*(p+1) ) edge = true; + if ( !edge && y > 0 && !*(p-width) ) edge = true; + if ( !edge && y < (height-1) && !*(p+width) ) edge = true; + } + if ( edge ) + { + *phigh = colour; + } + } + } + } + else if ( p_colours == ZM_COLOUR_RGB24 ) + { + for ( int y = lo_y; y <= hi_y; y++ ) + { + const uint8_t* p = buffer + (y * width) + lo_x; + uint8_t* phigh = high_buff + (((y * width) + lo_x) * 3); + for ( int x = lo_x; x <= hi_x; x++, p++, phigh += 3 ) + { + bool edge = false; + if ( *p ) + { + if ( !edge && x > 0 && !*(p-1) ) edge = true; + if ( !edge && x < (width-1) && !*(p+1) ) edge = true; + if ( !edge && y > 0 && !*(p-width) ) edge = true; + if ( !edge && y < (height-1) && !*(p+width) ) edge = true; + } + if ( edge ) + { + RED_PTR_RGBA(phigh) = RED_VAL_RGBA(colour); + GREEN_PTR_RGBA(phigh) = GREEN_VAL_RGBA(colour); + BLUE_PTR_RGBA(phigh) = BLUE_VAL_RGBA(colour); + } + } + } + } + else if ( p_colours == ZM_COLOUR_RGB32 ) + { + for ( int y = lo_y; y <= hi_y; y++ ) + { + const uint8_t* p = buffer + (y * width) + lo_x; + Rgb* phigh = (Rgb*)(high_buff + (((y * width) + lo_x) * 4)); + for ( int x = lo_x; x <= hi_x; x++, p++, phigh++ ) + { + bool edge = false; + if ( *p ) + { + if ( !edge && x > 0 && !*(p-1) ) edge = true; + if ( !edge && x < (width-1) && !*(p+1) ) edge = true; + if ( !edge && y > 0 && !*(p-width) ) edge = true; + if ( !edge && y < (height-1) && !*(p+width) ) edge = true; + } + if ( edge ) + { + *phigh = colour; + } + } + } + } + + return( high_image ); +} + +bool Image::ReadRaw( const char *filename ) +{ + FILE *infile; + if ( (infile = fopen( filename, "rb" )) == NULL ) + { + Error( "Can't open %s: %s", filename, strerror(errno) ); + return( false ); + } + + struct stat statbuf; + if ( fstat( fileno(infile), &statbuf ) < 0 ) + { + Error( "Can't fstat %s: %s", filename, strerror(errno) ); + return( false ); + } + + if ( statbuf.st_size != size ) + { + Error( "Raw file size mismatch, expected %d bytes, found %ld", size, statbuf.st_size ); + return( false ); + } + + if ( fread( buffer, size, 1, infile ) < 1 ) + { + Fatal( "Unable to read from '%s': %s", filename, strerror(errno) ); + return( false ); + } + + fclose( infile ); + + return( true ); +} + +bool Image::WriteRaw( const char *filename ) const +{ + FILE *outfile; + if ( (outfile = fopen( filename, "wb" )) == NULL ) + { + Error( "Can't open %s: %s", filename, strerror(errno) ); + return( false ); + } + + if ( fwrite( buffer, size, 1, outfile ) != 1 ) + { + Error( "Unable to write to '%s': %s", filename, strerror(errno) ); + return( false ); + } + + fclose( outfile ); + + return( true ); +} + +bool Image::ReadJpeg( const char *filename, int p_colours, int p_subpixelorder) +{ + struct jpeg_decompress_struct *cinfo = jpg_dcinfo; + + if ( !cinfo ) + { + cinfo = jpg_dcinfo = new jpeg_decompress_struct; + cinfo->err = jpeg_std_error( &jpg_err.pub ); + jpg_err.pub.error_exit = zm_jpeg_error_exit; + jpg_err.pub.emit_message = zm_jpeg_emit_message; + jpeg_create_decompress( cinfo ); + } + + FILE *infile; + if ( (infile = fopen( filename, "rb" )) == NULL ) + { + Error( "Can't open %s: %s", filename, strerror(errno) ); + return( false ); + } + + if ( setjmp( jpg_err.setjmp_buffer ) ) + { + jpeg_abort_decompress( cinfo ); + fclose( infile ); + return( false ); + } + + jpeg_stdio_src( cinfo, infile ); + + jpeg_read_header( cinfo, TRUE ); + + /* Check if the image has at least one huffman table defined. If not, use the standard ones */ + /* This is required for the MJPEG capture palette of USB devices */ + if(cinfo->dc_huff_tbl_ptrs[0] == NULL) { + zm_use_std_huff_tables(cinfo); + } + + if ( cinfo->image_width != (unsigned int)width || cinfo->image_height != (unsigned int)height) + { + width = cinfo->image_width; + height = cinfo->image_height; + pixels = width*height; + } + + if ( cinfo->num_components != 1 && cinfo->num_components != 3 ) + { + Error( "Unexpected colours when reading jpeg image: %d", colours ); + jpeg_abort_decompress( cinfo ); + fclose( infile ); + return( false ); + } + + switch(p_colours) { + case ZM_COLOUR_GRAY8: + { + cinfo->out_color_space = JCS_GRAYSCALE; + colours = ZM_COLOUR_GRAY8; + subpixelorder = ZM_SUBPIX_ORDER_NONE; + break; + } + case ZM_COLOUR_RGB32: + { +#ifdef JCS_EXTENSIONS + colours = ZM_COLOUR_RGB32; + if(p_subpixelorder == ZM_SUBPIX_ORDER_BGRA) { + cinfo->out_color_space = JCS_EXT_BGRX; + subpixelorder = ZM_SUBPIX_ORDER_BGRA; + } else if(p_subpixelorder == ZM_SUBPIX_ORDER_ARGB) { + cinfo->out_color_space = JCS_EXT_XRGB; + subpixelorder = ZM_SUBPIX_ORDER_ARGB; + } else if(p_subpixelorder == ZM_SUBPIX_ORDER_ABGR) { + cinfo->out_color_space = JCS_EXT_XBGR; + subpixelorder = ZM_SUBPIX_ORDER_ABGR; + } else { + /* Assume RGBA */ + cinfo->out_color_space = JCS_EXT_RGBX; + subpixelorder = ZM_SUBPIX_ORDER_RGBA; + } + break; +#else + Warning("libjpeg-turbo is required for reading a JPEG directly into a RGB32 buffer, reading into a RGB24 buffer instead."); +#endif + } + case ZM_COLOUR_RGB24: + default: + { + colours = ZM_COLOUR_RGB24; + if(p_subpixelorder == ZM_SUBPIX_ORDER_BGR) { +#ifdef JCS_EXTENSIONS + cinfo->out_color_space = JCS_EXT_BGR; + subpixelorder = ZM_SUBPIX_ORDER_BGR; +#else + Warning("libjpeg-turbo is required for reading a JPEG directly into a BGR24 buffer, reading into a RGB24 buffer instead."); + cinfo->out_color_space = JCS_RGB; + subpixelorder = ZM_SUBPIX_ORDER_RGB; +#endif + } else { + /* Assume RGB */ +/* +#ifdef JCS_EXTENSIONS + cinfo->out_color_space = JCS_EXT_RGB; +#else + cinfo->out_color_space = JCS_RGB; +#endif +*/ + cinfo->out_color_space = JCS_RGB; + subpixelorder = ZM_SUBPIX_ORDER_RGB; + } + break; + } + } + + size = pixels*colours; + + if(buffer == NULL) { + AllocImgBuffer(size); + } else { + if(allocation < (unsigned int)size) { + if(holdbuffer) { + Error("Held buffer is undersized for the requested image"); + return (false); + } else { + DumpImgBuffer(); + AllocImgBuffer(size); + } + } + } + + jpeg_start_decompress( cinfo ); + + JSAMPROW row_pointer; /* pointer to a single row */ + int row_stride = width * colours; /* physical row width in buffer */ + while ( cinfo->output_scanline < cinfo->output_height ) + { + row_pointer = &buffer[cinfo->output_scanline * row_stride]; + jpeg_read_scanlines( cinfo, &row_pointer, 1 ); + } + + jpeg_finish_decompress( cinfo ); + + fclose( infile ); + + return( true ); +} + +bool Image::WriteJpeg( const char *filename, int quality_override ) const +{ + if ( config.colour_jpeg_files && colours == ZM_COLOUR_GRAY8 ) + { + Image temp_image( *this ); + temp_image.Colourise( ZM_COLOUR_RGB24, ZM_SUBPIX_ORDER_RGB ); + return( temp_image.WriteJpeg( filename, quality_override ) ); + } + + int quality = quality_override?quality_override:config.jpeg_file_quality; + + struct jpeg_compress_struct *cinfo = jpg_ccinfo[quality]; + + if ( !cinfo ) + { + cinfo = jpg_ccinfo[quality] = new jpeg_compress_struct; + cinfo->err = jpeg_std_error( &jpg_err.pub ); + jpg_err.pub.error_exit = zm_jpeg_error_exit; + jpg_err.pub.emit_message = zm_jpeg_emit_message; + jpeg_create_compress( cinfo ); + } + + FILE *outfile; + if ( (outfile = fopen( filename, "wb" )) == NULL ) + { + Error( "Can't open %s: %s", filename, strerror(errno) ); + return( false ); + } + jpeg_stdio_dest( cinfo, outfile ); + + cinfo->image_width = width; /* image width and height, in pixels */ + cinfo->image_height = height; + + switch(colours) { + case ZM_COLOUR_GRAY8: + { + cinfo->input_components = 1; + cinfo->in_color_space = JCS_GRAYSCALE; + break; + } + case ZM_COLOUR_RGB32: + { +#ifdef JCS_EXTENSIONS + cinfo->input_components = 4; + if(subpixelorder == ZM_SUBPIX_ORDER_BGRA) { + cinfo->in_color_space = JCS_EXT_BGRX; + } else if(subpixelorder == ZM_SUBPIX_ORDER_ARGB) { + cinfo->in_color_space = JCS_EXT_XRGB; + } else if(subpixelorder == ZM_SUBPIX_ORDER_ABGR) { + cinfo->in_color_space = JCS_EXT_XBGR; + } else { + /* Assume RGBA */ + cinfo->in_color_space = JCS_EXT_RGBX; + } +#else + Error("libjpeg-turbo is required for JPEG encoding directly from RGB32 source"); + jpeg_abort_compress( cinfo ); + fclose(outfile); + return(false); +#endif + break; + } + case ZM_COLOUR_RGB24: + default: + { + cinfo->input_components = 3; + if(subpixelorder == ZM_SUBPIX_ORDER_BGR) { +#ifdef JCS_EXTENSIONS + cinfo->in_color_space = JCS_EXT_BGR; +#else + Error("libjpeg-turbo is required for JPEG encoding directly from BGR24 source"); + jpeg_abort_compress( cinfo ); + fclose(outfile); + return(false); +#endif + } else { + /* Assume RGB */ +/* +#ifdef JCS_EXTENSIONS + cinfo->out_color_space = JCS_EXT_RGB; +#else + cinfo->out_color_space = JCS_RGB; +#endif +*/ + cinfo->in_color_space = JCS_RGB; + } + break; + } + } + + jpeg_set_defaults( cinfo ); + jpeg_set_quality( cinfo, quality, false ); + cinfo->dct_method = JDCT_FASTEST; + + jpeg_start_compress( cinfo, TRUE ); + if ( config.add_jpeg_comments && text[0] ) + { + jpeg_write_marker( cinfo, JPEG_COM, (const JOCTET *)text, strlen(text) ); + } + + JSAMPROW row_pointer; /* pointer to a single row */ + int row_stride = cinfo->image_width * colours; /* physical row width in buffer */ + while ( cinfo->next_scanline < cinfo->image_height ) + { + row_pointer = &buffer[cinfo->next_scanline * row_stride]; + jpeg_write_scanlines( cinfo, &row_pointer, 1 ); + } + + jpeg_finish_compress( cinfo ); + + fclose( outfile ); + + return( true ); +} + +bool Image::DecodeJpeg( const JOCTET *inbuffer, int inbuffer_size, int p_colours, int p_subpixelorder) +{ + struct jpeg_decompress_struct *cinfo = jpg_dcinfo; + + if ( !cinfo ) + { + cinfo = jpg_dcinfo = new jpeg_decompress_struct; + cinfo->err = jpeg_std_error( &jpg_err.pub ); + jpg_err.pub.error_exit = zm_jpeg_error_exit; + jpg_err.pub.emit_message = zm_jpeg_emit_message; + jpeg_create_decompress( cinfo ); + } + + if ( setjmp( jpg_err.setjmp_buffer ) ) + { + jpeg_abort_decompress( cinfo ); + return( false ); + } + + zm_jpeg_mem_src( cinfo, inbuffer, inbuffer_size ); + + jpeg_read_header( cinfo, TRUE ); + + /* Check if the image has at least one huffman table defined. If not, use the standard ones */ + /* This is required for the MJPEG capture palette of USB devices */ + if(cinfo->dc_huff_tbl_ptrs[0] == NULL) { + zm_use_std_huff_tables(cinfo); + } + + if ( cinfo->image_width != (unsigned int)width || cinfo->image_height != (unsigned int)height) + { + width = cinfo->image_width; + height = cinfo->image_height; + pixels = width*height; + } + + if ( cinfo->num_components != 1 && cinfo->num_components != 3 ) + { + Error( "Unexpected colours when reading jpeg image: %d", colours ); + jpeg_abort_decompress( cinfo ); + return( false ); + } + + switch(p_colours) { + case ZM_COLOUR_GRAY8: + { + cinfo->out_color_space = JCS_GRAYSCALE; + colours = ZM_COLOUR_GRAY8; + subpixelorder = ZM_SUBPIX_ORDER_NONE; + break; + } + case ZM_COLOUR_RGB32: + { +#ifdef JCS_EXTENSIONS + colours = ZM_COLOUR_RGB32; + if(p_subpixelorder == ZM_SUBPIX_ORDER_BGRA) { + cinfo->out_color_space = JCS_EXT_BGRX; + subpixelorder = ZM_SUBPIX_ORDER_BGRA; + } else if(p_subpixelorder == ZM_SUBPIX_ORDER_ARGB) { + cinfo->out_color_space = JCS_EXT_XRGB; + subpixelorder = ZM_SUBPIX_ORDER_ARGB; + } else if(p_subpixelorder == ZM_SUBPIX_ORDER_ABGR) { + cinfo->out_color_space = JCS_EXT_XBGR; + subpixelorder = ZM_SUBPIX_ORDER_ABGR; + } else { + /* Assume RGBA */ + cinfo->out_color_space = JCS_EXT_RGBX; + subpixelorder = ZM_SUBPIX_ORDER_RGBA; + } + break; +#else + Warning("libjpeg-turbo is required for reading a JPEG directly into a RGB32 buffer, reading into a RGB24 buffer instead."); +#endif + } + case ZM_COLOUR_RGB24: + default: + { + colours = ZM_COLOUR_RGB24; + if(p_subpixelorder == ZM_SUBPIX_ORDER_BGR) { +#ifdef JCS_EXTENSIONS + cinfo->out_color_space = JCS_EXT_BGR; + subpixelorder = ZM_SUBPIX_ORDER_BGR; +#else + Warning("libjpeg-turbo is required for reading a JPEG directly into a BGR24 buffer, reading into a RGB24 buffer instead."); + cinfo->out_color_space = JCS_RGB; + subpixelorder = ZM_SUBPIX_ORDER_RGB; +#endif + } else { + /* Assume RGB */ +/* +#ifdef JCS_EXTENSIONS + cinfo->out_color_space = JCS_EXT_RGB; +#else + cinfo->out_color_space = JCS_RGB; +#endif +*/ + cinfo->out_color_space = JCS_RGB; + subpixelorder = ZM_SUBPIX_ORDER_RGB; + } + break; + } + } + + size = pixels*colours; + + if(buffer == NULL) { + AllocImgBuffer(size); + } else { + if(allocation < (unsigned int)size) { + if(holdbuffer) { + Error("Held buffer is undersized for the requested image"); + return (false); + } else { + DumpImgBuffer(); + AllocImgBuffer(size); + } + } + } + + jpeg_start_decompress( cinfo ); + + JSAMPROW row_pointer; /* pointer to a single row */ + int row_stride = width * colours; /* physical row width in buffer */ + while ( cinfo->output_scanline < cinfo->output_height ) + { + row_pointer = &buffer[cinfo->output_scanline * row_stride]; + jpeg_read_scanlines( cinfo, &row_pointer, 1 ); + } + + jpeg_finish_decompress( cinfo ); + + return( true ); +} + +bool Image::EncodeJpeg( JOCTET *outbuffer, int *outbuffer_size, int quality_override ) const +{ + if ( config.colour_jpeg_files && colours == ZM_COLOUR_GRAY8 ) + { + Image temp_image( *this ); + temp_image.Colourise(ZM_COLOUR_RGB24, ZM_SUBPIX_ORDER_RGB ); + return( temp_image.EncodeJpeg( outbuffer, outbuffer_size, quality_override ) ); + } + + int quality = quality_override?quality_override:config.jpeg_stream_quality; + + struct jpeg_compress_struct *cinfo = jpg_ccinfo[quality]; + + if ( !cinfo ) + { + cinfo = jpg_ccinfo[quality] = new jpeg_compress_struct; + cinfo->err = jpeg_std_error( &jpg_err.pub ); + jpg_err.pub.error_exit = zm_jpeg_error_exit; + jpg_err.pub.emit_message = zm_jpeg_emit_message; + jpeg_create_compress( cinfo ); + } + + zm_jpeg_mem_dest( cinfo, outbuffer, outbuffer_size ); + + cinfo->image_width = width; /* image width and height, in pixels */ + cinfo->image_height = height; + + switch(colours) { + case ZM_COLOUR_GRAY8: + { + cinfo->input_components = 1; + cinfo->in_color_space = JCS_GRAYSCALE; + break; + } + case ZM_COLOUR_RGB32: + { +#ifdef JCS_EXTENSIONS + cinfo->input_components = 4; + if(subpixelorder == ZM_SUBPIX_ORDER_BGRA) { + cinfo->in_color_space = JCS_EXT_BGRX; + } else if(subpixelorder == ZM_SUBPIX_ORDER_ARGB) { + cinfo->in_color_space = JCS_EXT_XRGB; + } else if(subpixelorder == ZM_SUBPIX_ORDER_ABGR) { + cinfo->in_color_space = JCS_EXT_XBGR; + } else { + /* Assume RGBA */ + cinfo->in_color_space = JCS_EXT_RGBX; + } +#else + Error("libjpeg-turbo is required for JPEG encoding directly from RGB32 source"); + jpeg_abort_compress( cinfo ); + return(false); +#endif + break; + } + case ZM_COLOUR_RGB24: + default: + { + cinfo->input_components = 3; + if(subpixelorder == ZM_SUBPIX_ORDER_BGR) { +#ifdef JCS_EXTENSIONS + cinfo->in_color_space = JCS_EXT_BGR; +#else + Error("libjpeg-turbo is required for JPEG encoding directly from BGR24 source"); + jpeg_abort_compress( cinfo ); + return(false); +#endif + } else { + /* Assume RGB */ +/* +#ifdef JCS_EXTENSIONS + cinfo->out_color_space = JCS_EXT_RGB; +#else + cinfo->out_color_space = JCS_RGB; +#endif +*/ + cinfo->in_color_space = JCS_RGB; + } + break; + } + } + + jpeg_set_defaults( cinfo ); + jpeg_set_quality( cinfo, quality, false ); + cinfo->dct_method = JDCT_FASTEST; + + jpeg_start_compress( cinfo, TRUE ); + + JSAMPROW row_pointer; /* pointer to a single row */ + int row_stride = cinfo->image_width * colours; /* physical row width in buffer */ + while ( cinfo->next_scanline < cinfo->image_height ) + { + row_pointer = &buffer[cinfo->next_scanline * row_stride]; + jpeg_write_scanlines( cinfo, &row_pointer, 1 ); + } + + jpeg_finish_compress( cinfo ); + + return( true ); +} + +#if HAVE_ZLIB_H +bool Image::Unzip( const Bytef *inbuffer, unsigned long inbuffer_size ) +{ + unsigned long zip_size = size; + int result = uncompress( buffer, &zip_size, inbuffer, inbuffer_size ); + if ( result != Z_OK ) + { + Error( "Unzip failed, result = %d", result ); + return( false ); + } + if ( zip_size != (unsigned int)size ) + { + Error( "Unzip failed, size mismatch, expected %d bytes, got %ld", size, zip_size ); + return( false ); + } + return( true ); +} + +bool Image::Zip( Bytef *outbuffer, unsigned long *outbuffer_size, int compression_level ) const +{ + int result = compress2( outbuffer, outbuffer_size, buffer, size, compression_level ); + if ( result != Z_OK ) + { + Error( "Zip failed, result = %d", result ); + return( false ); + } + return( true ); +} +#endif // HAVE_ZLIB_H + +bool Image::Crop( int lo_x, int lo_y, int hi_x, int hi_y ) +{ + int new_width = (hi_x-lo_x)+1; + int new_height = (hi_y-lo_y)+1; + + if ( lo_x > hi_x || lo_y > hi_y ) + { + Error( "Invalid or reversed crop region %d,%d -> %d,%d", lo_x, lo_y, hi_x, hi_y ); + return( false ); + } + if ( lo_x < 0 || hi_x > (width-1) || ( lo_y < 0 || hi_y > (height-1) ) ) + { + Error( "Attempting to crop outside image, %d,%d -> %d,%d not in %d,%d", lo_x, lo_y, hi_x, hi_y, width-1, height-1 ); + return( false ); + } + + if ( new_width == width && new_height == height ) + { + return( true ); + } + + int new_size = new_width*new_height*colours; + uint8_t *new_buffer = AllocBuffer(new_size); + + int new_stride = new_width*colours; + for ( int y = lo_y, ny = 0; y <= hi_y; y++, ny++ ) + { + unsigned char *pbuf = &buffer[((y*width)+lo_x)*colours]; + unsigned char *pnbuf = &new_buffer[(ny*new_width)*colours]; + memcpy( pnbuf, pbuf, new_stride ); + } + + AssignDirect(new_width, new_height, colours, subpixelorder, new_buffer, new_size, ZM_BUFTYPE_ZM); + + return( true ); +} + +bool Image::Crop( const Box &limits ) +{ + return( Crop( limits.LoX(), limits.LoY(), limits.HiX(), limits.HiY() ) ); +} + +/* Far from complete */ +/* Need to implement all possible of overlays possible */ +void Image::Overlay( const Image &image ) +{ + if ( !(width == image.width && height == image.height) ) + { + Panic( "Attempt to overlay different sized images, expected %dx%d, got %dx%d", width, height, image.width, image.height ); + } + + if( colours == image.colours && subpixelorder != image.subpixelorder ) { + Warning("Attempt to overlay images of same format but with different subpixel order."); + } + + /* Grayscale ontop of grayscale - complete */ + if ( colours == ZM_COLOUR_GRAY8 && image.colours == ZM_COLOUR_GRAY8 ) { + const uint8_t* const max_ptr = buffer+size; + const uint8_t* psrc = image.buffer; + uint8_t* pdest = buffer; + + while( pdest < max_ptr ) + { + if ( *psrc ) + { + *pdest = *psrc; + } + pdest++; + psrc++; + } + + /* RGB24 ontop of grayscale - convert to same format first - complete */ + } else if ( colours == ZM_COLOUR_GRAY8 && image.colours == ZM_COLOUR_RGB24 ) { + Colourise(image.colours, image.subpixelorder); + + const uint8_t* const max_ptr = buffer+size; + const uint8_t* psrc = image.buffer; + uint8_t* pdest = buffer; + + while( pdest < max_ptr ) + { + if ( RED_PTR_RGBA(psrc) || GREEN_PTR_RGBA(psrc) || BLUE_PTR_RGBA(psrc) ) + { + RED_PTR_RGBA(pdest) = RED_PTR_RGBA(psrc); + GREEN_PTR_RGBA(pdest) = GREEN_PTR_RGBA(psrc); + BLUE_PTR_RGBA(pdest) = BLUE_PTR_RGBA(psrc); + } + pdest += 3; + psrc += 3; + } + + /* RGB32 ontop of grayscale - convert to same format first - complete */ + } else if( colours == ZM_COLOUR_GRAY8 && image.colours == ZM_COLOUR_RGB32 ) { + Colourise(image.colours, image.subpixelorder); + + const Rgb* const max_ptr = (Rgb*)(buffer+size); + const Rgb* prsrc = (Rgb*)image.buffer; + Rgb* prdest = (Rgb*)buffer; + + if(subpixelorder == ZM_SUBPIX_ORDER_RGBA || subpixelorder == ZM_SUBPIX_ORDER_BGRA) { + /* RGB\BGR\RGBA\BGRA subpixel order - Alpha byte is last */ + while (prdest < max_ptr) { + if ( RED_PTR_RGBA(prsrc) || GREEN_PTR_RGBA(prsrc) || BLUE_PTR_RGBA(prsrc) ) + { + *prdest = *prsrc; + } + prdest++; + prsrc++; + } + } else { + /* ABGR\ARGB subpixel order - Alpha byte is first */ + while (prdest < max_ptr) { + if ( RED_PTR_ABGR(prsrc) || GREEN_PTR_ABGR(prsrc) || BLUE_PTR_ABGR(prsrc) ) + { + *prdest = *prsrc; + } + prdest++; + prsrc++; + } + } + + /* Grayscale ontop of RGB24 - complete */ + } else if ( colours == ZM_COLOUR_RGB24 && image.colours == ZM_COLOUR_GRAY8 ) { + const uint8_t* const max_ptr = buffer+size; + const uint8_t* psrc = image.buffer; + uint8_t* pdest = buffer; + + while( pdest < max_ptr ) + { + if ( *psrc ) + { + RED_PTR_RGBA(pdest) = GREEN_PTR_RGBA(pdest) = BLUE_PTR_RGBA(pdest) = *psrc; + } + pdest += 3; + psrc++; + } + + /* RGB24 ontop of RGB24 - not complete. need to take care of different subpixel orders */ + } else if ( colours == ZM_COLOUR_RGB24 && image.colours == ZM_COLOUR_RGB24 ) { + const uint8_t* const max_ptr = buffer+size; + const uint8_t* psrc = image.buffer; + uint8_t* pdest = buffer; + + while( pdest < max_ptr ) + { + if ( RED_PTR_RGBA(psrc) || GREEN_PTR_RGBA(psrc) || BLUE_PTR_RGBA(psrc) ) + { + RED_PTR_RGBA(pdest) = RED_PTR_RGBA(psrc); + GREEN_PTR_RGBA(pdest) = GREEN_PTR_RGBA(psrc); + BLUE_PTR_RGBA(pdest) = BLUE_PTR_RGBA(psrc); + } + pdest += 3; + psrc += 3; + } + + /* RGB32 ontop of RGB24 - TO BE DONE */ + } else if ( colours == ZM_COLOUR_RGB24 && image.colours == ZM_COLOUR_RGB32 ) { + Error("Overlay of RGB32 ontop of RGB24 is not supported."); + + /* Grayscale ontop of RGB32 - complete */ + } else if ( colours == ZM_COLOUR_RGB32 && image.colours == ZM_COLOUR_GRAY8 ) { + const Rgb* const max_ptr = (Rgb*)(buffer+size); + Rgb* prdest = (Rgb*)buffer; + const uint8_t* psrc = image.buffer; + + if(subpixelorder == ZM_SUBPIX_ORDER_RGBA || subpixelorder == ZM_SUBPIX_ORDER_BGRA) { + /* RGBA\BGRA subpixel order - Alpha byte is last */ + while (prdest < max_ptr) { + if ( *psrc ) + { + RED_PTR_RGBA(prdest) = GREEN_PTR_RGBA(prdest) = BLUE_PTR_RGBA(prdest) = *psrc; + } + prdest++; + psrc++; + } + } else { + /* ABGR\ARGB subpixel order - Alpha byte is first */ + while (prdest < max_ptr) { + if ( *psrc ) + { + RED_PTR_ABGR(prdest) = GREEN_PTR_ABGR(prdest) = BLUE_PTR_ABGR(prdest) = *psrc; + } + prdest++; + psrc++; + } + } + + /* RGB24 ontop of RGB32 - TO BE DONE */ + } else if ( colours == ZM_COLOUR_RGB32 && image.colours == ZM_COLOUR_RGB24 ) { + Error("Overlay of RGB24 ontop of RGB32 is not supported."); + + /* RGB32 ontop of RGB32 - not complete. need to take care of different subpixel orders */ + } else if ( colours == ZM_COLOUR_RGB32 && image.colours == ZM_COLOUR_RGB32 ) { + const Rgb* const max_ptr = (Rgb*)(buffer+size); + Rgb* prdest = (Rgb*)buffer; + const Rgb* prsrc = (Rgb*)image.buffer; + + if(image.subpixelorder == ZM_SUBPIX_ORDER_RGBA || image.subpixelorder == ZM_SUBPIX_ORDER_BGRA) { + /* RGB\BGR\RGBA\BGRA subpixel order - Alpha byte is last */ + while (prdest < max_ptr) { + if ( RED_PTR_RGBA(prsrc) || GREEN_PTR_RGBA(prsrc) || BLUE_PTR_RGBA(prsrc) ) + { + *prdest = *prsrc; + } + prdest++; + prsrc++; + } + } else { + /* ABGR\ARGB subpixel order - Alpha byte is first */ + while (prdest < max_ptr) { + if ( RED_PTR_ABGR(prsrc) || GREEN_PTR_ABGR(prsrc) || BLUE_PTR_ABGR(prsrc) ) + { + *prdest = *prsrc; + } + prdest++; + prsrc++; + } + } + } + +} + +/* RGB32 compatible: complete */ +void Image::Overlay( const Image &image, int x, int y ) +{ + if ( !(width < image.width || height < image.height) ) + { + Panic( "Attempt to overlay image too big for destination, %dx%d > %dx%d", image.width, image.height, width, height ); + } + + if ( !(width < (x+image.width) || height < (y+image.height)) ) + { + Panic( "Attempt to overlay image outside of destination bounds, %dx%d @ %dx%d > %dx%d", image.width, image.height, x, y, width, height ); + } + + if ( !(colours == image.colours) ) + { + Panic( "Attempt to partial overlay differently coloured images, expected %d, got %d", colours, image.colours ); + } + + int lo_x = x; + int lo_y = y; + int hi_x = (x+image.width)-1; + int hi_y = (y+image.height-1); + if ( colours == ZM_COLOUR_GRAY8 ) + { + const uint8_t *psrc = image.buffer; + for ( int y = lo_y; y <= hi_y; y++ ) + { + uint8_t *pdest = &buffer[(y*width)+lo_x]; + for ( int x = lo_x; x <= hi_x; x++ ) + { + *pdest++ = *psrc++; + } + } + } + else if ( colours == ZM_COLOUR_RGB24 ) + { + const uint8_t *psrc = image.buffer; + for ( int y = lo_y; y <= hi_y; y++ ) + { + uint8_t *pdest = &buffer[colours*((y*width)+lo_x)]; + for ( int x = lo_x; x <= hi_x; x++ ) + { + *pdest++ = *psrc++; + *pdest++ = *psrc++; + *pdest++ = *psrc++; + } + } + } + else if ( colours == ZM_COLOUR_RGB32 ) + { + const Rgb *psrc = (Rgb*)(image.buffer); + for ( int y = lo_y; y <= hi_y; y++ ) + { + Rgb *pdest = (Rgb*)&buffer[((y*width)+lo_x)<<2]; + for ( int x = lo_x; x <= hi_x; x++ ) + { + *pdest++ = *psrc++; + } + } + } else { + Error("Overlay called with unexpected colours: %d", colours); + } + +} + +void Image::Blend( const Image &image, int transparency ) +{ +#ifdef ZM_IMAGE_PROFILING + struct timespec start,end,diff; + unsigned long long executetime; + unsigned long milpixels; +#endif + uint8_t* new_buffer; + + if ( !(width == image.width && height == image.height && colours == image.colours && subpixelorder == image.subpixelorder) ) + { + Panic( "Attempt to blend different sized images, expected %dx%dx%d %d, got %dx%dx%d %d", width, height, colours, subpixelorder, image.width, image.height, image.colours, image.subpixelorder ); + } + + if(transparency <= 0) + return; + + new_buffer = AllocBuffer(size); + +#ifdef ZM_IMAGE_PROFILING + clock_gettime(CLOCK_THREAD_CPUTIME_ID,&start); +#endif + + /* Do the blending */ + (*fptr_blend)(buffer, image.buffer, new_buffer, size, transparency); + +#ifdef ZM_IMAGE_PROFILING + clock_gettime(CLOCK_THREAD_CPUTIME_ID,&end); + timespec_diff(&start,&end,&diff); + + executetime = (1000000000ull * diff.tv_sec) + diff.tv_nsec; + milpixels = (unsigned long)((long double)size)/((((long double)executetime)/1000)); + Debug(5, "Blend: %u colours blended in %llu nanoseconds, %lu million colours/s\n",size,executetime,milpixels); +#endif + + AssignDirect( width, height, colours, subpixelorder, new_buffer, size, ZM_BUFTYPE_ZM); +} + +Image *Image::Merge( int n_images, Image *images[] ) +{ + if ( n_images <= 0 ) return( 0 ); + if ( n_images == 1 ) return( new Image( *images[0] ) ); + + int width = images[0]->width; + int height = images[0]->height; + int colours = images[0]->colours; + for ( int i = 1; i < n_images; i++ ) + { + if ( !(width == images[i]->width && height == images[i]->height && colours == images[i]->colours) ) + { + Panic( "Attempt to merge different sized images, expected %dx%dx%d, got %dx%dx%d, for image %d", width, height, colours, images[i]->width, images[i]->height, images[i]->colours, i ); + } + } + + Image *result = new Image( width, height, images[0]->colours, images[0]->subpixelorder); + int size = result->size; + for ( int i = 0; i < size; i++ ) + { + int total = 0; + uint8_t *pdest = result->buffer; + for ( int j = 0; j < n_images; j++ ) + { + uint8_t *psrc = images[j]->buffer; + total += *psrc; + psrc++; + } + *pdest = total/n_images; + pdest++; + } + return( result ); +} + +Image *Image::Merge( int n_images, Image *images[], double weight ) +{ + if ( n_images <= 0 ) return( 0 ); + if ( n_images == 1 ) return( new Image( *images[0] ) ); + + int width = images[0]->width; + int height = images[0]->height; + int colours = images[0]->colours; + for ( int i = 1; i < n_images; i++ ) + { + if ( !(width == images[i]->width && height == images[i]->height && colours == images[i]->colours) ) + { + Panic( "Attempt to merge different sized images, expected %dx%dx%d, got %dx%dx%d, for image %d", width, height, colours, images[i]->width, images[i]->height, images[i]->colours, i ); + } + } + + Image *result = new Image( *images[0] ); + int size = result->size; + double factor = 1.0*weight; + for ( int i = 1; i < n_images; i++ ) + { + uint8_t *pdest = result->buffer; + uint8_t *psrc = images[i]->buffer; + for ( int j = 0; j < size; j++ ) + { + *pdest = (uint8_t)(((*pdest)*(1.0-factor))+((*psrc)*factor)); + pdest++; + psrc++; + } + factor *= weight; + } + return( result ); +} + +Image *Image::Highlight( int n_images, Image *images[], const Rgb threshold, const Rgb ref_colour ) +{ + if ( n_images <= 0 ) return( 0 ); + if ( n_images == 1 ) return( new Image( *images[0] ) ); + + int width = images[0]->width; + int height = images[0]->height; + int colours = images[0]->colours; + for ( int i = 1; i < n_images; i++ ) + { + if ( !(width == images[i]->width && height == images[i]->height && colours == images[i]->colours) ) + { + Panic( "Attempt to highlight different sized images, expected %dx%dx%d, got %dx%dx%d, for image %d", width, height, colours, images[i]->width, images[i]->height, images[i]->colours, i ); + } + } + + Image *result = new Image( width, height, images[0]->colours, images[0]->subpixelorder ); + int size = result->size; + for ( int c = 0; c < colours; c++ ) + { + for ( int i = 0; i < size; i++ ) + { + int count = 0; + uint8_t *pdest = result->buffer+c; + for ( int j = 0; j < n_images; j++ ) + { + uint8_t *psrc = images[j]->buffer+c; + + if ( (unsigned)abs((*psrc)-RGB_VAL(ref_colour,c)) >= RGB_VAL(threshold,c) ) + { + count++; + } + psrc += colours; + } + *pdest = (count*255)/n_images; + pdest += 3; + } + } + return( result ); +} + +/* New function to allow buffer re-using instead of allocationg memory for the delta image everytime */ +void Image::Delta( const Image &image, Image* targetimage) const +{ +#ifdef ZM_IMAGE_PROFILING + struct timespec start,end,diff; + unsigned long long executetime; + unsigned long milpixels; +#endif + + if ( !(width == image.width && height == image.height && colours == image.colours && subpixelorder == image.subpixelorder) ) + { + Panic( "Attempt to get delta of different sized images, expected %dx%dx%d %d, got %dx%dx%d %d", width, height, colours, subpixelorder, image.width, image.height, image.colours, image.subpixelorder); + } + + uint8_t *pdiff = targetimage->WriteBuffer(width, height, ZM_COLOUR_GRAY8, ZM_SUBPIX_ORDER_NONE); + + if(pdiff == NULL) { + Panic("Failed requesting writeable buffer for storing the delta image"); + } + +#ifdef ZM_IMAGE_PROFILING + clock_gettime(CLOCK_THREAD_CPUTIME_ID,&start); +#endif + + switch(colours) { + case ZM_COLOUR_RGB24: + { + if(subpixelorder == ZM_SUBPIX_ORDER_BGR) { + /* BGR subpixel order */ + (*fptr_delta8_bgr)(buffer, image.buffer, pdiff, pixels); + } else { + /* Assume RGB subpixel order */ + (*fptr_delta8_rgb)(buffer, image.buffer, pdiff, pixels); + } + break; + } + case ZM_COLOUR_RGB32: + { + if(subpixelorder == ZM_SUBPIX_ORDER_ARGB) { + /* ARGB subpixel order */ + (*fptr_delta8_argb)(buffer, image.buffer, pdiff, pixels); + } else if(subpixelorder == ZM_SUBPIX_ORDER_ABGR) { + /* ABGR subpixel order */ + (*fptr_delta8_abgr)(buffer, image.buffer, pdiff, pixels); + } else if(subpixelorder == ZM_SUBPIX_ORDER_BGRA) { + /* BGRA subpixel order */ + (*fptr_delta8_bgra)(buffer, image.buffer, pdiff, pixels); + } else { + /* Assume RGBA subpixel order */ + (*fptr_delta8_rgba)(buffer, image.buffer, pdiff, pixels); + } + break; + } + case ZM_COLOUR_GRAY8: + (*fptr_delta8_gray8)(buffer, image.buffer, pdiff, pixels); + break; + default: + Panic("Delta called with unexpected colours: %d",colours); + break; + } + +#ifdef ZM_IMAGE_PROFILING + clock_gettime(CLOCK_THREAD_CPUTIME_ID,&end); + timespec_diff(&start,&end,&diff); + + executetime = (1000000000ull * diff.tv_sec) + diff.tv_nsec; + milpixels = (unsigned long)((long double)pixels)/((((long double)executetime)/1000)); + Debug(5, "Delta: %u delta pixels generated in %llu nanoseconds, %lu million pixels/s\n",pixels,executetime,milpixels); +#endif +} + +const Coord Image::centreCoord( const char *text ) const +{ + int index = 0; + int line_no = 0; + int text_len = strlen( text ); + int line_len = 0; + int max_line_len = 0; + const char *line = text; + + while ( (index < text_len) && (line_len = strcspn( line, "\n" )) ) + { + if ( line_len > max_line_len ) + max_line_len = line_len; + + index += line_len; + while ( text[index] == '\n' ) + { + index++; + } + line = text+index; + line_no++; + } + int x = (width - (max_line_len * CHAR_WIDTH) ) / 2; + int y = (height - (line_no * LINE_HEIGHT) ) / 2; + return( Coord( x, y ) ); +} + +/* RGB32 compatible: complete */ +void Image::Annotate( const char *p_text, const Coord &coord, const Rgb fg_colour, const Rgb bg_colour ) +{ + strncpy( text, p_text, sizeof(text) ); + + int index = 0; + int line_no = 0; + int text_len = strlen( text ); + int line_len = 0; + const char *line = text; + + const uint8_t fg_r_col = RED_VAL_RGBA(fg_colour); + const uint8_t fg_g_col = GREEN_VAL_RGBA(fg_colour); + const uint8_t fg_b_col = BLUE_VAL_RGBA(fg_colour); + const uint8_t fg_bw_col = fg_colour & 0xff; + const Rgb fg_rgb_col = rgb_convert(fg_colour,subpixelorder); + const bool fg_trans = (fg_colour == RGB_TRANSPARENT); + + const uint8_t bg_r_col = RED_VAL_RGBA(bg_colour); + const uint8_t bg_g_col = GREEN_VAL_RGBA(bg_colour); + const uint8_t bg_b_col = BLUE_VAL_RGBA(bg_colour); + const uint8_t bg_bw_col = bg_colour & 0xff; + const Rgb bg_rgb_col = rgb_convert(bg_colour,subpixelorder); + const bool bg_trans = (bg_colour == RGB_TRANSPARENT); + + while ( (index < text_len) && (line_len = strcspn( line, "\n" )) ) + { + + int line_width = line_len * CHAR_WIDTH; + + int lo_line_x = coord.X(); + int lo_line_y = coord.Y() + (line_no * LINE_HEIGHT); + + int min_line_x = 0; + int max_line_x = width - line_width; + int min_line_y = 0; + int max_line_y = height - LINE_HEIGHT; + + if ( lo_line_x > max_line_x ) + lo_line_x = max_line_x; + if ( lo_line_x < min_line_x ) + lo_line_x = min_line_x; + if ( lo_line_y > max_line_y ) + lo_line_y = max_line_y; + if ( lo_line_y < min_line_y ) + lo_line_y = min_line_y; + + int hi_line_x = lo_line_x + line_width; + int hi_line_y = lo_line_y + LINE_HEIGHT; + + // Clip anything that runs off the right of the screen + if ( hi_line_x > width ) + hi_line_x = width; + if ( hi_line_y > height ) + hi_line_y = height; + + if ( colours == ZM_COLOUR_GRAY8 ) + { + unsigned char *ptr = &buffer[(lo_line_y*width)+lo_line_x]; + for ( int y = lo_line_y, r = 0; y < hi_line_y && r < CHAR_HEIGHT; y++, r++, ptr += width ) + { + unsigned char *temp_ptr = ptr; + for ( int x = lo_line_x, c = 0; x < hi_line_x && c < line_len; c++ ) + { + int f = fontdata[(line[c] * CHAR_HEIGHT) + r]; + for ( int i = 0; i < CHAR_WIDTH && x < hi_line_x; i++, x++, temp_ptr++ ) + { + if ( f & (0x80 >> i) ) + { + if ( !fg_trans ) + *temp_ptr = fg_bw_col; + } + else if ( !bg_trans ) + { + *temp_ptr = bg_bw_col; + } + } + } + } + } + else if ( colours == ZM_COLOUR_RGB24 ) + { + int wc = width * colours; + + unsigned char *ptr = &buffer[((lo_line_y*width)+lo_line_x)*colours]; + for ( int y = lo_line_y, r = 0; y < hi_line_y && r < CHAR_HEIGHT; y++, r++, ptr += wc ) + { + unsigned char *temp_ptr = ptr; + for ( int x = lo_line_x, c = 0; x < hi_line_x && c < line_len; c++ ) + { + int f = fontdata[(line[c] * CHAR_HEIGHT) + r]; + for ( int i = 0; i < CHAR_WIDTH && x < hi_line_x; i++, x++, temp_ptr += colours ) + { + if ( f & (0x80 >> i) ) + { + if ( !fg_trans ) + { + RED_PTR_RGBA(temp_ptr) = fg_r_col; + GREEN_PTR_RGBA(temp_ptr) = fg_g_col; + BLUE_PTR_RGBA(temp_ptr) = fg_b_col; + } + } + else if ( !bg_trans ) + { + RED_PTR_RGBA(temp_ptr) = bg_r_col; + GREEN_PTR_RGBA(temp_ptr) = bg_g_col; + BLUE_PTR_RGBA(temp_ptr) = bg_b_col; + } + } + } + } + } + else if ( colours == ZM_COLOUR_RGB32 ) + { + int wc = width * colours; + + uint8_t *ptr = &buffer[((lo_line_y*width)+lo_line_x)<<2]; + for ( int y = lo_line_y, r = 0; y < hi_line_y && r < CHAR_HEIGHT; y++, r++, ptr += wc ) + { + Rgb* temp_ptr = (Rgb*)ptr; + for ( int x = lo_line_x, c = 0; x < hi_line_x && c < line_len; c++ ) + { + int f = fontdata[(line[c] * CHAR_HEIGHT) + r]; + for ( int i = 0; i < CHAR_WIDTH && x < hi_line_x; i++, x++, temp_ptr++ ) + { + if ( f & (0x80 >> i) ) + { + if ( !fg_trans ) + { + *temp_ptr = fg_rgb_col; + } + } + else if ( !bg_trans ) + { + *temp_ptr = bg_rgb_col; + } + } + } + } + + } else { + Panic("Annontate called with unexpected colours: %d",colours); + return; + } + + index += line_len; + while ( text[index] == '\n' ) + { + index++; + } + line = text+index; + line_no++; + } +} + +void Image::Timestamp( const char *label, const time_t when, const Coord &coord ) +{ + char time_text[64]; + strftime( time_text, sizeof(time_text), "%y/%m/%d %H:%M:%S", localtime( &when ) ); + char text[64]; + if ( label ) + { + snprintf( text, sizeof(text), "%s - %s", label, time_text ); + Annotate( text, coord ); + } + else + { + Annotate( time_text, coord ); + } +} + +/* RGB32 compatible: complete */ +void Image::Colourise(const int p_reqcolours, const int p_reqsubpixelorder) +{ + Debug(9, "Colourise: Req colours: %u Req subpixel order: %u Current colours: %u Current subpixel order: %u",p_reqcolours,p_reqsubpixelorder,colours,subpixelorder); + + if ( colours != ZM_COLOUR_GRAY8) { + Warning("Target image is already colourised, colours: %u",colours); + return; + } + + if ( p_reqcolours == ZM_COLOUR_RGB32 ) { + /* RGB32 */ + Rgb* new_buffer = (Rgb*)AllocBuffer(pixels*sizeof(Rgb)); + + const uint8_t *psrc = buffer; + Rgb* pdest = new_buffer; + Rgb subpixel; + Rgb newpixel; + + if ( p_reqsubpixelorder == ZM_SUBPIX_ORDER_ABGR || p_reqsubpixelorder == ZM_SUBPIX_ORDER_ARGB) { + /* ARGB\ABGR subpixel order. alpha byte is first (mem+0), so we need to shift the pixel left in the end */ + for(int i=0;iLo().X():0; + int lo_y = limits?limits->Lo().Y():0; + int hi_x = limits?limits->Hi().X():width-1; + int hi_y = limits?limits->Hi().Y():height-1; + if ( colours == ZM_COLOUR_GRAY8 ) + { + for ( int y = lo_y; y <= hi_y; y++ ) + { + unsigned char *p = &buffer[(y*width)+lo_x]; + for ( int x = lo_x; x <= hi_x; x++, p++) + { + *p = colour; + } + } + } + else if ( colours == ZM_COLOUR_RGB24 ) + { + for ( int y = lo_y; y <= hi_y; y++ ) + { + unsigned char *p = &buffer[colours*((y*width)+lo_x)]; + for ( int x = lo_x; x <= hi_x; x++, p += 3) + { + RED_PTR_RGBA(p) = RED_VAL_RGBA(colour); + GREEN_PTR_RGBA(p) = GREEN_VAL_RGBA(colour); + BLUE_PTR_RGBA(p) = BLUE_VAL_RGBA(colour); + } + } + } + else if ( colours == ZM_COLOUR_RGB32 ) /* RGB32 */ + { + for ( unsigned int y = lo_y; y <= (unsigned int)hi_y; y++ ) + { + Rgb *p = (Rgb*)&buffer[((y*width)+lo_x)<<2]; + + for ( unsigned int x = lo_x; x <= (unsigned int)hi_x; x++, p++) + { + /* Fast, copies the entire pixel in a single pass */ + *p = colour; + } + } + } +} + +/* RGB32 compatible: complete */ +void Image::Fill( Rgb colour, int density, const Box *limits ) +{ + /* Allow the faster version to be used if density is not used (density=1) */ + if(density <= 1) + return Fill(colour,limits); + + if ( !(colours == ZM_COLOUR_GRAY8 || colours == ZM_COLOUR_RGB24 || colours == ZM_COLOUR_RGB32 ) ) + { + Panic( "Attempt to fill image with unexpected colours %d", colours ); + } + + /* Convert the colour's RGBA subpixel order into the image's subpixel order */ + colour = rgb_convert(colour,subpixelorder); + + int lo_x = limits?limits->Lo().X():0; + int lo_y = limits?limits->Lo().Y():0; + int hi_x = limits?limits->Hi().X():width-1; + int hi_y = limits?limits->Hi().Y():height-1; + if ( colours == ZM_COLOUR_GRAY8 ) + { + for ( int y = lo_y; y <= hi_y; y++ ) + { + unsigned char *p = &buffer[(y*width)+lo_x]; + for ( int x = lo_x; x <= hi_x; x++, p++) + { + if ( ( x == lo_x || x == hi_x || y == lo_y || y == hi_y ) || (!(x%density) && !(y%density) ) ) + *p = colour; + } + } + } + else if ( colours == ZM_COLOUR_RGB24 ) + { + for ( int y = lo_y; y <= hi_y; y++ ) + { + unsigned char *p = &buffer[colours*((y*width)+lo_x)]; + for ( int x = lo_x; x <= hi_x; x++, p += 3) + { + if ( ( x == lo_x || x == hi_x || y == lo_y || y == hi_y ) || (!(x%density) && !(y%density) ) ) { + RED_PTR_RGBA(p) = RED_VAL_RGBA(colour); + GREEN_PTR_RGBA(p) = GREEN_VAL_RGBA(colour); + BLUE_PTR_RGBA(p) = BLUE_VAL_RGBA(colour); + } + } + } + } + else if ( colours == ZM_COLOUR_RGB32 ) /* RGB32 */ + { + for ( int y = lo_y; y <= hi_y; y++ ) + { + Rgb* p = (Rgb*)&buffer[((y*width)+lo_x)<<2]; + + for ( int x = lo_x; x <= hi_x; x++, p++) + { + if ( ( x == lo_x || x == hi_x || y == lo_y || y == hi_y ) || (!(x%density) && !(y%density) ) ) + /* Fast, copies the entire pixel in a single pass */ + *p = colour; + } + } + } + +} + +/* RGB32 compatible: complete */ +void Image::Outline( Rgb colour, const Polygon &polygon ) +{ + if ( !(colours == ZM_COLOUR_GRAY8 || colours == ZM_COLOUR_RGB24 || colours == ZM_COLOUR_RGB32 ) ) + { + Panic( "Attempt to outline image with unexpected colours %d", colours ); + } + + /* Convert the colour's RGBA subpixel order into the image's subpixel order */ + colour = rgb_convert(colour,subpixelorder); + + int n_coords = polygon.getNumCoords(); + for ( int j = 0, i = n_coords-1; j < n_coords; i = j++ ) + { + const Coord &p1 = polygon.getCoord( i ); + const Coord &p2 = polygon.getCoord( j ); + + int x1 = p1.X(); + int x2 = p2.X(); + int y1 = p1.Y(); + int y2 = p2.Y(); + + double dx = x2 - x1; + double dy = y2 - y1; + + double grad; + + Debug( 9, "dx: %.2lf, dy: %.2lf", dx, dy ); + if ( fabs(dx) <= fabs(dy) ) + { + Debug( 9, "dx <= dy" ); + if ( y1 != y2 ) + grad = dx/dy; + else + grad = width; + + double x; + int y, yinc = (y1 dy" ); + if ( x1 != x2 ) + grad = dy/dx; + else + grad = height; + Debug( 9, "grad: %.2lf", grad ); + + double y; + int x, xinc = (x1= Logger::DEBUG9 ) + { + for ( int i = 0; i < n_global_edges; i++ ) + { + Debug( 9, "%d: min_y: %d, max_y:%d, min_x:%.2f, 1/m:%.2f", i, global_edges[i].min_y, global_edges[i].max_y, global_edges[i].min_x, global_edges[i]._1_m ); + } + } +#endif + + int n_active_edges = 0; + Edge active_edges[n_global_edges]; + int y = global_edges[0].min_y; + do + { + for ( int i = 0; i < n_global_edges; i++ ) + { + if ( global_edges[i].min_y == y ) + { + Debug( 9, "Moving global edge" ); + active_edges[n_active_edges++] = global_edges[i]; + if ( i < (n_global_edges-1) ) + { + //memcpy( &global_edges[i], &global_edges[i+1], sizeof(*global_edges)*(n_global_edges-i) ); + memmove( &global_edges[i], &global_edges[i+1], sizeof(*global_edges)*(n_global_edges-i) ); + i--; + } + n_global_edges--; + } + else + { + break; + } + } + qsort( active_edges, n_active_edges, sizeof(*active_edges), Edge::CompareX ); +#ifndef ZM_DBG_OFF + if ( logLevel() >= Logger::DEBUG9 ) + { + for ( int i = 0; i < n_active_edges; i++ ) + { + Debug( 9, "%d - %d: min_y: %d, max_y:%d, min_x:%.2f, 1/m:%.2f", y, i, active_edges[i].min_y, active_edges[i].max_y, active_edges[i].min_x, active_edges[i]._1_m ); + } + } +#endif + if ( !(y%density) ) + { + //Debug( 9, "%d", y ); + for ( int i = 0; i < n_active_edges; ) + { + int lo_x = int(round(active_edges[i++].min_x)); + int hi_x = int(round(active_edges[i++].min_x)); + if( colours == ZM_COLOUR_GRAY8 ) { + unsigned char *p = &buffer[(y*width)+lo_x]; + for ( int x = lo_x; x <= hi_x; x++, p++) + { + if ( !(x%density) ) + { + //Debug( 9, " %d", x ); + *p = colour; + } + } + } else if( colours == ZM_COLOUR_RGB24 ) { + unsigned char *p = &buffer[colours*((y*width)+lo_x)]; + for ( int x = lo_x; x <= hi_x; x++, p += 3) + { + if ( !(x%density) ) + { + RED_PTR_RGBA(p) = RED_VAL_RGBA(colour); + GREEN_PTR_RGBA(p) = GREEN_VAL_RGBA(colour); + BLUE_PTR_RGBA(p) = BLUE_VAL_RGBA(colour); + } + } + } else if( colours == ZM_COLOUR_RGB32 ) { + Rgb *p = (Rgb*)&buffer[((y*width)+lo_x)<<2]; + for ( int x = lo_x; x <= hi_x; x++, p++) + { + if ( !(x%density) ) + { + /* Fast, copies the entire pixel in a single pass */ + *p = colour; + } + } + } + } + } + y++; + for ( int i = n_active_edges-1; i >= 0; i-- ) + { + if ( y >= active_edges[i].max_y ) // Or >= as per sheets + { + Debug( 9, "Deleting active_edge" ); + if ( i < (n_active_edges-1) ) + { + //memcpy( &active_edges[i], &active_edges[i+1], sizeof(*active_edges)*(n_active_edges-i) ); + memmove( &active_edges[i], &active_edges[i+1], sizeof(*active_edges)*(n_active_edges-i) ); + } + n_active_edges--; + } + else + { + active_edges[i].min_x += active_edges[i]._1_m; + } + } + } while ( n_global_edges || n_active_edges ); +} + +void Image::Fill( Rgb colour, const Polygon &polygon ) +{ + Fill( colour, 1, polygon ); +} + +/* RGB32 compatible: complete */ +void Image::Rotate( int angle ) +{ + + angle %= 360; + + if ( !angle ) + { + return; + } + if ( angle%90 ) + { + return; + } + + unsigned int new_height = height; + unsigned int new_width = width; + uint8_t* rotate_buffer = AllocBuffer(size); + + switch( angle ) + { + case 90 : + { + new_height = width; + new_width = height; + + int line_bytes = new_width*colours; + unsigned char *s_ptr = buffer; + + if ( colours == ZM_COLOUR_GRAY8 ) + { + unsigned char *d_ptr; + for ( int i = new_width-1; i >= 0; i-- ) + { + d_ptr = rotate_buffer+i; + for ( int j = new_height-1; j >= 0; j-- ) + { + *d_ptr = *s_ptr++; + d_ptr += line_bytes; + } + } + } + else if ( colours == ZM_COLOUR_RGB32 ) + { + Rgb* s_rptr = (Rgb*)s_ptr; + Rgb* d_rptr; + for ( int i = new_width-1; i >= 0; i-- ) + { + d_rptr = (Rgb*)(rotate_buffer+(i<<2)); + for ( int j = new_height-1; j >= 0; j-- ) + { + *d_rptr = *s_rptr++; + d_rptr += new_width; + } + } + } + else /* Assume RGB24 */ + { + unsigned char *d_ptr; + for ( int i = new_width-1; i >= 0; i-- ) + { + d_ptr = rotate_buffer+(3*i); + for ( int j = new_height-1; j >= 0; j-- ) + { + *d_ptr = *s_ptr++; + *(d_ptr+1) = *s_ptr++; + *(d_ptr+2) = *s_ptr++; + d_ptr += line_bytes; + } + } + } + break; + } + case 180 : + { + unsigned char *s_ptr = buffer+size; + unsigned char *d_ptr = rotate_buffer; + + if ( colours == ZM_COLOUR_GRAY8 ) + { + while( s_ptr > buffer ) + { + s_ptr--; + *d_ptr++ = *s_ptr; + } + } + else if ( colours == ZM_COLOUR_RGB32 ) + { + Rgb* s_rptr = (Rgb*)s_ptr; + Rgb* d_rptr = (Rgb*)d_ptr; + while( s_rptr > (Rgb*)buffer ) + { + s_rptr--; + *d_rptr++ = *s_rptr; + } + } + else /* Assume RGB24 */ + { + while( s_ptr > buffer ) + { + s_ptr -= 3; + *d_ptr++ = *s_ptr; + *d_ptr++ = *(s_ptr+1); + *d_ptr++ = *(s_ptr+2); + } + } + break; + } + case 270 : + { + new_height = width; + new_width = height; + + int line_bytes = new_width*colours; + unsigned char *s_ptr = buffer+size; + + if ( colours == ZM_COLOUR_GRAY8 ) + { + unsigned char *d_ptr; + for ( int i = new_width-1; i >= 0; i-- ) + { + d_ptr = rotate_buffer+i; + for ( int j = new_height-1; j >= 0; j-- ) + { + s_ptr--; + *d_ptr = *s_ptr; + d_ptr += line_bytes; + } + } + } + else if ( colours == ZM_COLOUR_RGB32 ) + { + Rgb* s_rptr = (Rgb*)s_ptr; + Rgb* d_rptr; + for ( int i = new_width-1; i >= 0; i-- ) + { + d_rptr = (Rgb*)(rotate_buffer+(i<<2)); + for ( int j = new_height-1; j >= 0; j-- ) + { + s_rptr--; + *d_rptr = *s_rptr; + d_rptr += new_width; + } + } + } + else /* Assume RGB24 */ + { + unsigned char *d_ptr; + for ( int i = new_width-1; i >= 0; i-- ) + { + d_ptr = rotate_buffer+(3*i); + for ( int j = new_height-1; j >= 0; j-- ) + { + *(d_ptr+2) = *(--s_ptr); + *(d_ptr+1) = *(--s_ptr); + *d_ptr = *(--s_ptr); + d_ptr += line_bytes; + } + } + } + break; + } + } + + AssignDirect( new_width, new_height, colours, subpixelorder, rotate_buffer, size, ZM_BUFTYPE_ZM); + +} + +/* RGB32 compatible: complete */ +void Image::Flip( bool leftright ) +{ + uint8_t* flip_buffer = AllocBuffer(size); + + int line_bytes = width*colours; + int line_bytes2 = 2*line_bytes; + if ( leftright ) + { + // Horizontal flip, left to right + unsigned char *s_ptr = buffer+line_bytes; + unsigned char *d_ptr = flip_buffer; + unsigned char *max_d_ptr = flip_buffer + size; + + if ( colours == ZM_COLOUR_GRAY8 ) + { + while( d_ptr < max_d_ptr ) + { + for ( int j = 0; j < width; j++ ) + { + s_ptr--; + *d_ptr++ = *s_ptr; + } + s_ptr += line_bytes2; + } + } + else if ( colours == ZM_COLOUR_RGB32 ) + { + Rgb* s_rptr = (Rgb*)s_ptr; + Rgb* d_rptr = (Rgb*)flip_buffer; + Rgb* max_d_rptr = (Rgb*)max_d_ptr; + while( d_rptr < max_d_rptr ) + { + for ( int j = 0; j < width; j++ ) + { + s_rptr--; + *d_rptr++ = *s_rptr; + } + s_rptr += width * 2; + } + } + else /* Assume RGB24 */ + { + while( d_ptr < max_d_ptr ) + { + for ( int j = 0; j < width; j++ ) + { + s_ptr -= 3; + *d_ptr++ = *s_ptr; + *d_ptr++ = *(s_ptr+1); + *d_ptr++ = *(s_ptr+2); + } + s_ptr += line_bytes2; + } + } + } + else + { + // Vertical flip, top to bottom + unsigned char *s_ptr = buffer+(height*line_bytes); + unsigned char *d_ptr = flip_buffer; + + while( s_ptr > buffer ) + { + s_ptr -= line_bytes; + memcpy( d_ptr, s_ptr, line_bytes ); + d_ptr += line_bytes; + } + } + + AssignDirect( width, height, colours, subpixelorder, flip_buffer, size, ZM_BUFTYPE_ZM); + +} + +void Image::Scale( unsigned int factor ) +{ + if ( !factor ) + { + Error( "Bogus scale factor %d found", factor ); + return; + } + if ( factor == ZM_SCALE_BASE ) + { + return; + } + + unsigned int new_width = (width*factor)/ZM_SCALE_BASE; + unsigned int new_height = (height*factor)/ZM_SCALE_BASE; + + size_t scale_buffer_size = new_width * new_height * colours; + + uint8_t* scale_buffer = AllocBuffer(scale_buffer_size); + + if ( factor > ZM_SCALE_BASE ) + { + unsigned char *pd = scale_buffer; + unsigned int wc = width*colours; + unsigned int nwc = new_width*colours; + unsigned int h_count = ZM_SCALE_BASE/2; + unsigned int last_h_index = 0; + unsigned int last_w_index = 0; + unsigned int h_index; + for ( int y = 0; y < height; y++ ) + { + unsigned char *ps = &buffer[y*wc]; + unsigned int w_count = ZM_SCALE_BASE/2; + unsigned int w_index; + last_w_index = 0; + for ( int x = 0; x < width; x++ ) + { + w_count += factor; + w_index = w_count/ZM_SCALE_BASE; + for (unsigned int f = last_w_index; f < w_index; f++ ) + { + for ( int c = 0; c < colours; c++ ) + { + *pd++ = *(ps+c); + } + } + ps += colours; + last_w_index = w_index; + } + h_count += factor; + h_index = h_count/ZM_SCALE_BASE; + for ( unsigned int f = last_h_index+1; f < h_index; f++ ) + { + memcpy( pd, pd-nwc, nwc ); + pd += nwc; + } + last_h_index = h_index; + } + new_width = last_w_index; + new_height = last_h_index; + } + else + { + unsigned char *pd = scale_buffer; + unsigned int wc = width*colours; + unsigned int xstart = factor/2; + unsigned int ystart = factor/2; + unsigned int h_count = ystart; + unsigned int last_h_index = 0; + unsigned int last_w_index = 0; + unsigned int h_index; + for ( unsigned int y = 0; y < (unsigned int)height; y++ ) + { + h_count += factor; + h_index = h_count/ZM_SCALE_BASE; + if ( h_index > last_h_index ) + { + unsigned int w_count = xstart; + unsigned int w_index; + last_w_index = 0; + + unsigned char *ps = &buffer[y*wc]; + for ( unsigned int x = 0; x < (unsigned int)width; x++ ) + { + w_count += factor; + w_index = w_count/ZM_SCALE_BASE; + + if ( w_index > last_w_index ) + { + for ( int c = 0; c < colours; c++ ) + { + *pd++ = *ps++; + } + } + else + { + ps += colours; + } + last_w_index = w_index; + } + } + last_h_index = h_index; + } + new_width = last_w_index; + new_height = last_h_index; + } + + AssignDirect( new_width, new_height, colours, subpixelorder, scale_buffer, scale_buffer_size, ZM_BUFTYPE_ZM); + +} + +void Image::Deinterlace_Discard() +{ + /* Simple deinterlacing. Copy the even lines into the odd lines */ + + if ( colours == ZM_COLOUR_GRAY8 ) + { + const uint8_t *psrc; + uint8_t *pdest; + for (unsigned int y = 0; y < (unsigned int)height; y += 2) + { + psrc = buffer + (y * width); + pdest = buffer + ((y+1) * width); + for (unsigned int x = 0; x < (unsigned int)width; x++) { + *pdest++ = *psrc++; + } + } + } + else if ( colours == ZM_COLOUR_RGB24 ) + { + const uint8_t *psrc; + uint8_t *pdest; + for (unsigned int y = 0; y < (unsigned int)height; y += 2) + { + psrc = buffer + ((y * width) * 3); + pdest = buffer + (((y+1) * width) * 3); + for (unsigned int x = 0; x < (unsigned int)width; x++) { + *pdest++ = *psrc++; + *pdest++ = *psrc++; + *pdest++ = *psrc++; + } + } + } + else if ( colours == ZM_COLOUR_RGB32 ) + { + const Rgb *psrc; + Rgb *pdest; + for (unsigned int y = 0; y < (unsigned int)height; y += 2) + { + psrc = (Rgb*)(buffer + ((y * width) << 2)); + pdest = (Rgb*)(buffer + (((y+1) * width) << 2)); + for (unsigned int x = 0; x < (unsigned int)width; x++) { + *pdest++ = *psrc++; + } + } + } else { + Error("Deinterlace called with unexpected colours: %d", colours); + } + +} + +void Image::Deinterlace_Linear() +{ + /* Simple deinterlacing. The odd lines are average of the line above and line below */ + + const uint8_t *pbelow, *pabove; + uint8_t *pcurrent; + + if ( colours == ZM_COLOUR_GRAY8 ) + { + for (unsigned int y = 1; y < (unsigned int)(height-1); y += 2) + { + pabove = buffer + ((y-1) * width); + pbelow = buffer + ((y+1) * width); + pcurrent = buffer + (y * width); + for (unsigned int x = 0; x < (unsigned int)width; x++) { + *pcurrent++ = (*pabove++ + *pbelow++) >> 1; + } + } + /* Special case for the last line */ + pcurrent = buffer + ((height-1) * width); + pabove = buffer + ((height-2) * width); + for (unsigned int x = 0; x < (unsigned int)width; x++) { + *pcurrent++ = *pabove++; + } + } + else if ( colours == ZM_COLOUR_RGB24 ) + { + for (unsigned int y = 1; y < (unsigned int)(height-1); y += 2) + { + pabove = buffer + (((y-1) * width) * 3); + pbelow = buffer + (((y+1) * width) * 3); + pcurrent = buffer + ((y * width) * 3); + for (unsigned int x = 0; x < (unsigned int)width; x++) { + *pcurrent++ = (*pabove++ + *pbelow++) >> 1; + *pcurrent++ = (*pabove++ + *pbelow++) >> 1; + *pcurrent++ = (*pabove++ + *pbelow++) >> 1; + } + } + /* Special case for the last line */ + pcurrent = buffer + (((height-1) * width) * 3); + pabove = buffer + (((height-2) * width) * 3); + for (unsigned int x = 0; x < (unsigned int)width; x++) { + *pcurrent++ = *pabove++; + *pcurrent++ = *pabove++; + *pcurrent++ = *pabove++; + } + } + else if ( colours == ZM_COLOUR_RGB32 ) + { + for (unsigned int y = 1; y < (unsigned int)(height-1); y += 2) + { + pabove = buffer + (((y-1) * width) << 2); + pbelow = buffer + (((y+1) * width) << 2); + pcurrent = buffer + ((y * width) << 2); + for (unsigned int x = 0; x < (unsigned int)width; x++) { + *pcurrent++ = (*pabove++ + *pbelow++) >> 1; + *pcurrent++ = (*pabove++ + *pbelow++) >> 1; + *pcurrent++ = (*pabove++ + *pbelow++) >> 1; + *pcurrent++ = (*pabove++ + *pbelow++) >> 1; + } + } + /* Special case for the last line */ + pcurrent = buffer + (((height-1) * width) << 2); + pabove = buffer + (((height-2) * width) << 2); + for (unsigned int x = 0; x < (unsigned int)width; x++) { + *pcurrent++ = *pabove++; + *pcurrent++ = *pabove++; + *pcurrent++ = *pabove++; + *pcurrent++ = *pabove++; + } + } else { + Error("Deinterlace called with unexpected colours: %d", colours); + } + +} + +void Image::Deinterlace_Blend() +{ + /* Simple deinterlacing. Blend the fields together. 50% blend */ + + uint8_t *pabove, *pcurrent; + + if ( colours == ZM_COLOUR_GRAY8 ) + { + for (unsigned int y = 1; y < (unsigned int)height; y += 2) + { + pabove = buffer + ((y-1) * width); + pcurrent = buffer + (y * width); + for (unsigned int x = 0; x < (unsigned int)width; x++) { + *pabove = (*pabove + *pcurrent) >> 1; + *pcurrent++ = *pabove++; + } + } + } + else if ( colours == ZM_COLOUR_RGB24 ) + { + for (unsigned int y = 1; y < (unsigned int)height; y += 2) + { + pabove = buffer + (((y-1) * width) * 3); + pcurrent = buffer + ((y * width) * 3); + for (unsigned int x = 0; x < (unsigned int)width; x++) { + *pabove = (*pabove + *pcurrent) >> 1; + *pcurrent++ = *pabove++; + *pabove = (*pabove + *pcurrent) >> 1; + *pcurrent++ = *pabove++; + *pabove = (*pabove + *pcurrent) >> 1; + *pcurrent++ = *pabove++; + } + } + } + else if ( colours == ZM_COLOUR_RGB32 ) + { + for (unsigned int y = 1; y < (unsigned int)height; y += 2) + { + pabove = buffer + (((y-1) * width) << 2); + pcurrent = buffer + ((y * width) << 2); + for (unsigned int x = 0; x < (unsigned int)width; x++) { + *pabove = (*pabove + *pcurrent) >> 1; + *pcurrent++ = *pabove++; + *pabove = (*pabove + *pcurrent) >> 1; + *pcurrent++ = *pabove++; + *pabove = (*pabove + *pcurrent) >> 1; + *pcurrent++ = *pabove++; + *pabove = (*pabove + *pcurrent) >> 1; + *pcurrent++ = *pabove++; + } + } + } else { + Error("Deinterlace called with unexpected colours: %d", colours); + } + +} + +void Image::Deinterlace_Blend_CustomRatio(int divider) +{ + /* Simple deinterlacing. Blend the fields together at a custom ratio. */ + /* 1 = 50% blending */ + /* 2 = 25% blending */ + /* 3 = 12.% blending */ + /* 4 = 6.25% blending */ + + uint8_t *pabove, *pcurrent; + uint8_t subpix1, subpix2; + + if ( divider < 1 || divider > 4 ) { + Error("Deinterlace called with invalid blend ratio"); + } + + if ( colours == ZM_COLOUR_GRAY8 ) + { + for (unsigned int y = 1; y < (unsigned int)height; y += 2) + { + pabove = buffer + ((y-1) * width); + pcurrent = buffer + (y * width); + for (unsigned int x = 0; x < (unsigned int)width; x++) { + subpix1 = ((*pabove - *pcurrent)>>divider) + *pcurrent; + subpix2 = ((*pcurrent - *pabove)>>divider) + *pabove; + *pcurrent++ = subpix1; + *pabove++ = subpix2; + } + } + } + else if ( colours == ZM_COLOUR_RGB24 ) + { + for (unsigned int y = 1; y < (unsigned int)height; y += 2) + { + pabove = buffer + (((y-1) * width) * 3); + pcurrent = buffer + ((y * width) * 3); + for (unsigned int x = 0; x < (unsigned int)width; x++) { + subpix1 = ((*pabove - *pcurrent)>>divider) + *pcurrent; + subpix2 = ((*pcurrent - *pabove)>>divider) + *pabove; + *pcurrent++ = subpix1; + *pabove++ = subpix2; + subpix1 = ((*pabove - *pcurrent)>>divider) + *pcurrent; + subpix2 = ((*pcurrent - *pabove)>>divider) + *pabove; + *pcurrent++ = subpix1; + *pabove++ = subpix2; + subpix1 = ((*pabove - *pcurrent)>>divider) + *pcurrent; + subpix2 = ((*pcurrent - *pabove)>>divider) + *pabove; + *pcurrent++ = subpix1; + *pabove++ = subpix2; + } + } + } + else if ( colours == ZM_COLOUR_RGB32 ) + { + for (unsigned int y = 1; y < (unsigned int)height; y += 2) + { + pabove = buffer + (((y-1) * width) << 2); + pcurrent = buffer + ((y * width) << 2); + for (unsigned int x = 0; x < (unsigned int)width; x++) { + subpix1 = ((*pabove - *pcurrent)>>divider) + *pcurrent; + subpix2 = ((*pcurrent - *pabove)>>divider) + *pabove; + *pcurrent++ = subpix1; + *pabove++ = subpix2; + subpix1 = ((*pabove - *pcurrent)>>divider) + *pcurrent; + subpix2 = ((*pcurrent - *pabove)>>divider) + *pabove; + *pcurrent++ = subpix1; + *pabove++ = subpix2; + subpix1 = ((*pabove - *pcurrent)>>divider) + *pcurrent; + subpix2 = ((*pcurrent - *pabove)>>divider) + *pabove; + *pcurrent++ = subpix1; + *pabove++ = subpix2; + subpix1 = ((*pabove - *pcurrent)>>divider) + *pcurrent; + subpix2 = ((*pcurrent - *pabove)>>divider) + *pabove; + *pcurrent++ = subpix1; + *pabove++ = subpix2; + } + } + } else { + Error("Deinterlace called with unexpected colours: %d", colours); + } + +} + + +void Image::Deinterlace_4Field(const Image* next_image, unsigned int threshold) +{ + if ( !(width == next_image->width && height == next_image->height && colours == next_image->colours && subpixelorder == next_image->subpixelorder) ) + { + Panic( "Attempt to deinterlace different sized images, expected %dx%dx%d %d, got %dx%dx%d %d", width, height, colours, subpixelorder, next_image->width, next_image->height, next_image->colours, next_image->subpixelorder); + } + + switch(colours) { + case ZM_COLOUR_RGB24: + { + if(subpixelorder == ZM_SUBPIX_ORDER_BGR) { + /* BGR subpixel order */ + std_deinterlace_4field_bgr(buffer, next_image->buffer, threshold, width, height); + } else { + /* Assume RGB subpixel order */ + std_deinterlace_4field_rgb(buffer, next_image->buffer, threshold, width, height); + } + break; + } + case ZM_COLOUR_RGB32: + { + if(subpixelorder == ZM_SUBPIX_ORDER_ARGB) { + /* ARGB subpixel order */ + (*fptr_deinterlace_4field_argb)(buffer, next_image->buffer, threshold, width, height); + } else if(subpixelorder == ZM_SUBPIX_ORDER_ABGR) { + /* ABGR subpixel order */ + (*fptr_deinterlace_4field_abgr)(buffer, next_image->buffer, threshold, width, height); + } else if(subpixelorder == ZM_SUBPIX_ORDER_BGRA) { + /* BGRA subpixel order */ + (*fptr_deinterlace_4field_bgra)(buffer, next_image->buffer, threshold, width, height); + } else { + /* Assume RGBA subpixel order */ + (*fptr_deinterlace_4field_rgba)(buffer, next_image->buffer, threshold, width, height); + } + break; + } + case ZM_COLOUR_GRAY8: + (*fptr_deinterlace_4field_gray8)(buffer, next_image->buffer, threshold, width, height); + break; + default: + Panic("Deinterlace_4Field called with unexpected colours: %d",colours); + break; + } + +} + + +/************************************************* BLEND FUNCTIONS *************************************************/ + + +__attribute__((noinline,__target__("sse2"))) void sse2_fastblend(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count, double blendpercent) { +#if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE)) + static uint32_t divider = 0; + static uint32_t clearmask = 0; + static double current_blendpercent = 0.0; + + if(current_blendpercent != blendpercent) { + /* Attempt to match the blending percent to one of the possible values */ + if(blendpercent < 2.34375) { + // 1.5625% blending + divider = 6; + clearmask = 0x03030303; + } else if(blendpercent >= 2.34375 && blendpercent < 4.6875) { + // 3.125% blending + divider = 5; + clearmask = 0x07070707; + } else if(blendpercent >= 4.6875 && blendpercent < 9.375) { + // 6.25% blending + divider = 4; + clearmask = 0x0F0F0F0F; + } else if(blendpercent >= 9.375 && blendpercent < 18.75) { + // 12.5% blending + divider = 3; + clearmask = 0x1F1F1F1F; + } else if(blendpercent >= 18.75 && blendpercent < 37.5) { + // 25% blending + divider = 2; + clearmask = 0x3F3F3F3F; + } else if(blendpercent >= 37.5) { + // 50% blending + divider = 1; + clearmask = 0x7F7F7F7F; + } + current_blendpercent = blendpercent; + } + + __asm__ __volatile__( + "movd %4, %%xmm3\n\t" + "movd %5, %%xmm4\n\t" + "pshufd $0x0, %%xmm3, %%xmm3\n\t" + "sub $0x10, %0\n\t" + "sub $0x10, %1\n\t" + "sub $0x10, %2\n\t" + "sse2_fastblend_iter:\n\t" + "movdqa (%0,%3),%%xmm0\n\t" + "movdqa %%xmm0,%%xmm2\n\t" + "movdqa (%1,%3),%%xmm1\n\t" + "psrlq %%xmm4,%%xmm0\n\t" + "psrlq %%xmm4,%%xmm1\n\t" + "pand %%xmm3,%%xmm1\n\t" + "pand %%xmm3,%%xmm0\n\t" + "psubb %%xmm0,%%xmm1\n\t" + "paddb %%xmm2,%%xmm1\n\t" + "movntdq %%xmm1,(%2,%3)\n\t" + "sub $0x10, %3\n\t" + "jnz sse2_fastblend_iter\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count), "m" (clearmask), "m" (divider) + : "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "cc", "memory" + ); +#else + Panic("SSE function called on a non x86\\x86-64 platform"); +#endif +} + +__attribute__((noinline)) void std_fastblend(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count, double blendpercent) { + static int divider = 0; + static double current_blendpercent = 0.0; + const uint8_t* const max_ptr = result + count; + + if(current_blendpercent != blendpercent) { + /* Attempt to match the blending percent to one of the possible values */ + if(blendpercent < 2.34375) { + // 1.5625% blending + divider = 6; + } else if(blendpercent >= 2.34375 && blendpercent < 4.6875) { + // 3.125% blending + divider = 5; + } else if(blendpercent >= 4.6875 && blendpercent < 9.375) { + // 6.25% blending + divider = 4; + } else if(blendpercent >= 9.375 && blendpercent < 18.75) { + // 12.5% blending + divider = 3; + } else if(blendpercent >= 18.75 && blendpercent < 37.5) { + // 25% blending + divider = 2; + } else if(blendpercent >= 37.5) { + // 50% blending + divider = 1; + } + current_blendpercent = blendpercent; + } + + + while(result < max_ptr) { + result[0] = ((col2[0] - col1[0])>>divider) + col1[0]; + result[1] = ((col2[1] - col1[1])>>divider) + col1[1]; + result[2] = ((col2[2] - col1[2])>>divider) + col1[2]; + result[3] = ((col2[3] - col1[3])>>divider) + col1[3]; + result[4] = ((col2[4] - col1[4])>>divider) + col1[4]; + result[5] = ((col2[5] - col1[5])>>divider) + col1[5]; + result[6] = ((col2[6] - col1[6])>>divider) + col1[6]; + result[7] = ((col2[7] - col1[7])>>divider) + col1[7]; + result[8] = ((col2[8] - col1[8])>>divider) + col1[8]; + result[9] = ((col2[9] - col1[9])>>divider) + col1[9]; + result[10] = ((col2[10] - col1[10])>>divider) + col1[10]; + result[11] = ((col2[11] - col1[11])>>divider) + col1[11]; + result[12] = ((col2[12] - col1[12])>>divider) + col1[12]; + result[13] = ((col2[13] - col1[13])>>divider) + col1[13]; + result[14] = ((col2[14] - col1[14])>>divider) + col1[14]; + result[15] = ((col2[15] - col1[15])>>divider) + col1[15]; + + col1 += 16; + col2 += 16; + result += 16; + } +} + +__attribute__((noinline)) void std_blend(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count, double blendpercent) { + double divide = blendpercent / 100.0; + double opacity = 1.0 - divide; + const uint8_t* const max_ptr = result + count; + + while(result < max_ptr) { + *result++ = (*col1++ * opacity) + (*col2++ * divide); + + } +} + +/************************************************* DELTA FUNCTIONS *************************************************/ + +/* Grayscale */ +__attribute__((noinline)) void std_delta8_gray8(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count) { + /* Loop unrolling is used to work on 16 bytes (16 grayscale pixels) at a time */ + const uint8_t* const max_ptr = result + count; + + while(result < max_ptr) { + result[0] = abs(col1[0] - col2[0]); + result[1] = abs(col1[1] - col2[1]); + result[2] = abs(col1[2] - col2[2]); + result[3] = abs(col1[3] - col2[3]); + result[4] = abs(col1[4] - col2[4]); + result[5] = abs(col1[5] - col2[5]); + result[6] = abs(col1[6] - col2[6]); + result[7] = abs(col1[7] - col2[7]); + result[8] = abs(col1[8] - col2[8]); + result[9] = abs(col1[9] - col2[9]); + result[10] = abs(col1[10] - col2[10]); + result[11] = abs(col1[11] - col2[11]); + result[12] = abs(col1[12] - col2[12]); + result[13] = abs(col1[13] - col2[13]); + result[14] = abs(col1[14] - col2[14]); + result[15] = abs(col1[15] - col2[15]); + + col1 += 16; + col2 += 16; + result += 16; + } +} + +/* RGB24: RGB */ +__attribute__((noinline)) void std_delta8_rgb(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count) { + /* Loop unrolling is used to work on 12 bytes (4 rgb24 pixels) at a time */ + int r,g,b; + const uint8_t* const max_ptr = result + count; + + while(result < max_ptr) { + r = abs(col1[0] - col2[0]); + g = abs(col1[1] - col2[1]); + b = abs(col1[2] - col2[2]); + result[0] = (r + r + b + g + g + g + g + g)>>3; + r = abs(col1[3] - col2[3]); + g = abs(col1[4] - col2[4]); + b = abs(col1[5] - col2[5]); + result[1] = (r + r + b + g + g + g + g + g)>>3; + r = abs(col1[6] - col2[6]); + g = abs(col1[7] - col2[7]); + b = abs(col1[8] - col2[8]); + result[2] = (r + r + b + g + g + g + g + g)>>3; + r = abs(col1[9] - col2[9]); + g = abs(col1[10] - col2[10]); + b = abs(col1[11] - col2[11]); + result[3] = (r + r + b + g + g + g + g + g)>>3; + + col1 += 12; + col2 += 12; + result += 4; + } +} + +/* RGB24: BGR */ +__attribute__((noinline)) void std_delta8_bgr(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count) { + /* Loop unrolling is used to work on 12 bytes (4 rgb24 pixels) at a time */ + int r,g,b; + const uint8_t* const max_ptr = result + count; + + while(result < max_ptr) { + b = abs(col1[0] - col2[0]); + g = abs(col1[1] - col2[1]); + r = abs(col1[2] - col2[2]); + result[0] = (r + r + b + g + g + g + g + g)>>3; + b = abs(col1[3] - col2[3]); + g = abs(col1[4] - col2[4]); + r = abs(col1[5] - col2[5]); + result[1] = (r + r + b + g + g + g + g + g)>>3; + b = abs(col1[6] - col2[6]); + g = abs(col1[7] - col2[7]); + r = abs(col1[8] - col2[8]); + result[2] = (r + r + b + g + g + g + g + g)>>3; + b = abs(col1[9] - col2[9]); + g = abs(col1[10] - col2[10]); + r = abs(col1[11] - col2[11]); + result[3] = (r + r + b + g + g + g + g + g)>>3; + + col1 += 12; + col2 += 12; + result += 4; + } +} + +/* RGB32: RGBA */ +__attribute__((noinline)) void std_delta8_rgba(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count) { + /* Loop unrolling is used to work on 16 bytes (4 rgb32 pixels) at a time */ + int r,g,b; + const uint8_t* const max_ptr = result + count; + + while(result < max_ptr) { + r = abs(col1[0] - col2[0]); + g = abs(col1[1] - col2[1]); + b = abs(col1[2] - col2[2]); + result[0] = (r + r + b + g + g + g + g + g)>>3; + r = abs(col1[4] - col2[4]); + g = abs(col1[5] - col2[5]); + b = abs(col1[6] - col2[6]); + result[1] = (r + r + b + g + g + g + g + g)>>3; + r = abs(col1[8] - col2[8]); + g = abs(col1[9] - col2[9]); + b = abs(col1[10] - col2[10]); + result[2] = (r + r + b + g + g + g + g + g)>>3; + r = abs(col1[12] - col2[12]); + g = abs(col1[13] - col2[13]); + b = abs(col1[14] - col2[14]); + result[3] = (r + r + b + g + g + g + g + g)>>3; + + col1 += 16; + col2 += 16; + result += 4; + } +} + +/* RGB32: BGRA */ +__attribute__((noinline)) void std_delta8_bgra(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count) { + /* Loop unrolling is used to work on 16 bytes (4 rgb32 pixels) at a time */ + int r,g,b; + const uint8_t* const max_ptr = result + count; + + while(result < max_ptr) { + b = abs(col1[0] - col2[0]); + g = abs(col1[1] - col2[1]); + r = abs(col1[2] - col2[2]); + result[0] = (r + r + b + g + g + g + g + g)>>3; + b = abs(col1[4] - col2[4]); + g = abs(col1[5] - col2[5]); + r = abs(col1[6] - col2[6]); + result[1] = (r + r + b + g + g + g + g + g)>>3; + b = abs(col1[8] - col2[8]); + g = abs(col1[9] - col2[9]); + r = abs(col1[10] - col2[10]); + result[2] = (r + r + b + g + g + g + g + g)>>3; + b = abs(col1[12] - col2[12]); + g = abs(col1[13] - col2[13]); + r = abs(col1[14] - col2[14]); + result[3] = (r + r + b + g + g + g + g + g)>>3; + + col1 += 16; + col2 += 16; + result += 4; + } +} + +/* RGB32: ARGB */ +__attribute__((noinline)) void std_delta8_argb(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count) { + /* Loop unrolling is used to work on 16 bytes (4 rgb32 pixels) at a time */ + int r,g,b; + const uint8_t* const max_ptr = result + count; + + while(result < max_ptr) { + r = abs(col1[1] - col2[1]); + g = abs(col1[2] - col2[2]); + b = abs(col1[3] - col2[3]); + result[0] = (r + r + b + g + g + g + g + g)>>3; + r = abs(col1[5] - col2[5]); + g = abs(col1[6] - col2[6]); + b = abs(col1[7] - col2[7]); + result[1] = (r + r + b + g + g + g + g + g)>>3; + r = abs(col1[9] - col2[9]); + g = abs(col1[10] - col2[10]); + b = abs(col1[11] - col2[11]); + result[2] = (r + r + b + g + g + g + g + g)>>3; + r = abs(col1[13] - col2[13]); + g = abs(col1[14] - col2[14]); + b = abs(col1[15] - col2[15]); + result[3] = (r + r + b + g + g + g + g + g)>>3; + + col1 += 16; + col2 += 16; + result += 4; + } +} + +/* RGB32: ABGR */ +__attribute__((noinline)) void std_delta8_abgr(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count) { + /* Loop unrolling is used to work on 16 bytes (4 rgb32 pixels) at a time */ + int r,g,b; + const uint8_t* const max_ptr = result + count; + + while(result < max_ptr) { + b = abs(col1[1] - col2[1]); + g = abs(col1[2] - col2[2]); + r = abs(col1[3] - col2[3]); + result[0] = (r + r + b + g + g + g + g + g)>>3; + b = abs(col1[5] - col2[5]); + g = abs(col1[6] - col2[6]); + r = abs(col1[7] - col2[7]); + result[1] = (r + r + b + g + g + g + g + g)>>3; + b = abs(col1[9] - col2[9]); + g = abs(col1[10] - col2[10]); + r = abs(col1[11] - col2[11]); + result[2] = (r + r + b + g + g + g + g + g)>>3; + b = abs(col1[13] - col2[13]); + g = abs(col1[14] - col2[14]); + r = abs(col1[15] - col2[15]); + result[3] = (r + r + b + g + g + g + g + g)>>3; + + col1 += 16; + col2 += 16; + result += 4; + } +} + +/* Grayscale SSE2 */ +__attribute__((noinline,__target__("sse2"))) void sse2_delta8_gray8(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count) { +#if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE)) + + __asm__ __volatile__ ( + "sub $0x10, %0\n\t" + "sub $0x10, %1\n\t" + "sub $0x10, %2\n\t" + "sse2_delta8_gray8_iter:\n\t" + "movdqa (%0,%3), %%xmm1\n\t" + "movdqa (%1,%3), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm3\n\t" + "movdqa %%xmm2, %%xmm4\n\t" + "pmaxub %%xmm1, %%xmm2\n\t" + "pminub %%xmm3, %%xmm4\n\t" + "psubb %%xmm4, %%xmm2\n\t" + "movntdq %%xmm2, (%2,%3)\n\t" + "sub $0x10, %3\n\t" + "jnz sse2_delta8_gray8_iter\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count) + : "%xmm1", "%xmm2", "%xmm3", "%xmm4", "cc", "memory" + ); +#else + Panic("SSE function called on a non x86\\x86-64 platform"); +#endif +} + +/* RGB32: RGBA SSE2 */ +__attribute__((noinline,__target__("sse2"))) void sse2_delta8_rgba(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count) { +#if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE)) + + __asm__ __volatile__ ( + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "mov $0xff, %%eax\n\t" + "movd %%eax, %%xmm0\n\t" + "pshufd $0x0, %%xmm0, %%xmm0\n\t" + "sub $0x10, %0\n\t" + "sub $0x10, %1\n\t" + "sub $0x4, %2\n\t" + "sse2_delta8_rgba_iter:\n\t" + "movdqa (%0,%3,4), %%xmm1\n\t" + "movdqa (%1,%3,4), %%xmm2\n\t" + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "movdqa %%xmm1, %%xmm5\n\t" + "movdqa %%xmm2, %%xmm6\n\t" + "pmaxub %%xmm1, %%xmm2\n\t" + "pminub %%xmm5, %%xmm6\n\t" + "psubb %%xmm6, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm3\n\t" + "psrld $0x8, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "pslld $0x2, %%xmm2\n\t" + "paddd %%xmm1, %%xmm2\n\t" + "movdqa %%xmm3, %%xmm1\n\t" + "pand %%xmm0, %%xmm1\n\t" + "paddd %%xmm1, %%xmm1\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "movdqa %%xmm3, %%xmm2\n\t" + "psrld $0x10, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "packssdw %%xmm1, %%xmm1\n\t" + "packuswb %%xmm1, %%xmm1\n\t" + "movd %%xmm1, %%eax\n\t" + "movnti %%eax, (%2,%3)\n\t" + "sub $0x4, %3\n\t" + "jnz sse2_delta8_rgba_iter\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "cc", "memory" + ); +#else + Panic("SSE function called on a non x86\\x86-64 platform"); +#endif +} + +/* RGB32: BGRA SSE2 */ +__attribute__((noinline,__target__("sse2"))) void sse2_delta8_bgra(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count) { +#if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE)) + + __asm__ __volatile__ ( + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "mov $0xff, %%eax\n\t" + "movd %%eax, %%xmm0\n\t" + "pshufd $0x0, %%xmm0, %%xmm0\n\t" + "sub $0x10, %0\n\t" + "sub $0x10, %1\n\t" + "sub $0x4, %2\n\t" + "sse2_delta8_bgra_iter:\n\t" + "movdqa (%0,%3,4), %%xmm1\n\t" + "movdqa (%1,%3,4), %%xmm2\n\t" + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "movdqa %%xmm1, %%xmm5\n\t" + "movdqa %%xmm2, %%xmm6\n\t" + "pmaxub %%xmm1, %%xmm2\n\t" + "pminub %%xmm5, %%xmm6\n\t" + "psubb %%xmm6, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm3\n\t" + "psrld $0x8, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "pslld $0x2, %%xmm2\n\t" + "paddd %%xmm1, %%xmm2\n\t" + "movdqa %%xmm3, %%xmm1\n\t" + "pand %%xmm0, %%xmm1\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "movdqa %%xmm3, %%xmm2\n\t" + "psrld $0x10, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "paddd %%xmm2, %%xmm2\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "packssdw %%xmm1, %%xmm1\n\t" + "packuswb %%xmm1, %%xmm1\n\t" + "movd %%xmm1, %%eax\n\t" + "movnti %%eax, (%2,%3)\n\t" + "sub $0x4, %3\n\t" + "jnz sse2_delta8_bgra_iter\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "cc", "memory" + ); +#else + Panic("SSE function called on a non x86\\x86-64 platform"); +#endif +} + +/* RGB32: ARGB SSE2 */ +__attribute__((noinline,__target__("sse2"))) void sse2_delta8_argb(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count) { +#if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE)) + + __asm__ __volatile__ ( + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "mov $0xff, %%eax\n\t" + "movd %%eax, %%xmm0\n\t" + "pshufd $0x0, %%xmm0, %%xmm0\n\t" + "sub $0x10, %0\n\t" + "sub $0x10, %1\n\t" + "sub $0x4, %2\n\t" + "sse2_delta8_argb_iter:\n\t" + "movdqa (%0,%3,4), %%xmm1\n\t" + "movdqa (%1,%3,4), %%xmm2\n\t" + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "movdqa %%xmm1, %%xmm5\n\t" + "movdqa %%xmm2, %%xmm6\n\t" + "pmaxub %%xmm1, %%xmm2\n\t" + "pminub %%xmm5, %%xmm6\n\t" + "psubb %%xmm6, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm3\n\t" + "psrld $0x10, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "pslld $0x2, %%xmm2\n\t" + "paddd %%xmm1, %%xmm2\n\t" + "movdqa %%xmm3, %%xmm1\n\t" + "psrld $0x8, %%xmm1\n\t" + "pand %%xmm0, %%xmm1\n\t" + "paddd %%xmm1, %%xmm1\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "movdqa %%xmm3, %%xmm2\n\t" + "psrld $0x18, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "packssdw %%xmm1, %%xmm1\n\t" + "packuswb %%xmm1, %%xmm1\n\t" + "movd %%xmm1, %%eax\n\t" + "movnti %%eax, (%2,%3)\n\t" + "sub $0x4, %3\n\t" + "jnz sse2_delta8_argb_iter\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "cc", "memory" + ); +#else + Panic("SSE function called on a non x86\\x86-64 platform"); +#endif +} + +/* RGB32: ABGR SSE2 */ +__attribute__((noinline,__target__("sse2"))) void sse2_delta8_abgr(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count) { +#if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE)) + + __asm__ __volatile__ ( + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "mov $0xff, %%eax\n\t" + "movd %%eax, %%xmm0\n\t" + "pshufd $0x0, %%xmm0, %%xmm0\n\t" + "sub $0x10, %0\n\t" + "sub $0x10, %1\n\t" + "sub $0x4, %2\n\t" + "sse2_delta8_abgr_iter:\n\t" + "movdqa (%0,%3,4), %%xmm1\n\t" + "movdqa (%1,%3,4), %%xmm2\n\t" + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "movdqa %%xmm1, %%xmm5\n\t" + "movdqa %%xmm2, %%xmm6\n\t" + "pmaxub %%xmm1, %%xmm2\n\t" + "pminub %%xmm5, %%xmm6\n\t" + "psubb %%xmm6, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm3\n\t" + "psrld $0x10, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "pslld $0x2, %%xmm2\n\t" + "paddd %%xmm1, %%xmm2\n\t" + "movdqa %%xmm3, %%xmm1\n\t" + "psrld $0x8, %%xmm1\n\t" + "pand %%xmm0, %%xmm1\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "movdqa %%xmm3, %%xmm2\n\t" + "psrld $0x18, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "paddd %%xmm2, %%xmm2\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "packssdw %%xmm1, %%xmm1\n\t" + "packuswb %%xmm1, %%xmm1\n\t" + "movd %%xmm1, %%eax\n\t" + "movnti %%eax, (%2,%3)\n\t" + "sub $0x4, %3\n\t" + "jnz sse2_delta8_abgr_iter\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "cc", "memory" + ); +#else + Panic("SSE function called on a non x86\\x86-64 platform"); +#endif +} + +/* RGB32: RGBA SSSE3 */ +__attribute__((noinline,__target__("ssse3"))) void ssse3_delta8_rgba(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count) { +#if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE)) + + __asm__ __volatile__ ( + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "mov $0xff, %%eax\n\t" + "movd %%eax, %%xmm0\n\t" + "pshufd $0x0, %%xmm0, %%xmm0\n\t" + "movdqa %4, %%xmm5\n\t" + "sub $0x10, %0\n\t" + "sub $0x10, %1\n\t" + "sub $0x4, %2\n\t" + "ssse3_delta8_rgba_iter:\n\t" + "movdqa (%0,%3,4), %%xmm1\n\t" + "movdqa (%1,%3,4), %%xmm2\n\t" + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm3\n\t" + "movdqa %%xmm3, %%xmm2\n\t" + "psrld $0x8, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "pslld $0x2, %%xmm2\n\t" + "paddd %%xmm1, %%xmm2\n\t" + "movdqa %%xmm3, %%xmm1\n\t" + "pand %%xmm0, %%xmm1\n\t" + "paddd %%xmm1, %%xmm1\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "movdqa %%xmm3, %%xmm2\n\t" + "psrld $0x10, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "pshufb %%xmm5, %%xmm1\n\t" + "movd %%xmm1, %%eax\n\t" + "movnti %%eax, (%2,%3)\n\t" + "sub $0x4, %3\n\t" + "jnz ssse3_delta8_rgba_iter\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count), "m" (*movemask) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "cc", "memory" + ); +#else + Panic("SSE function called on a non x86\\x86-64 platform"); +#endif +} + +/* RGB32: BGRA SSSE3 */ +__attribute__((noinline,__target__("ssse3"))) void ssse3_delta8_bgra(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count) { +#if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE)) + + __asm__ __volatile__ ( + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "mov $0xff, %%eax\n\t" + "movd %%eax, %%xmm0\n\t" + "pshufd $0x0, %%xmm0, %%xmm0\n\t" + "movdqa %4, %%xmm5\n\t" + "sub $0x10, %0\n\t" + "sub $0x10, %1\n\t" + "sub $0x4, %2\n\t" + "ssse3_delta8_bgra_iter:\n\t" + "movdqa (%0,%3,4), %%xmm1\n\t" + "movdqa (%1,%3,4), %%xmm2\n\t" + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm3\n\t" + "movdqa %%xmm3, %%xmm2\n\t" + "psrld $0x8, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "pslld $0x2, %%xmm2\n\t" + "paddd %%xmm1, %%xmm2\n\t" + "movdqa %%xmm3, %%xmm1\n\t" + "pand %%xmm0, %%xmm1\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "movdqa %%xmm3, %%xmm2\n\t" + "psrld $0x10, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "paddd %%xmm2, %%xmm2\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "pshufb %%xmm5, %%xmm1\n\t" + "movd %%xmm1, %%eax\n\t" + "movnti %%eax, (%2,%3)\n\t" + "sub $0x4, %3\n\t" + "jnz ssse3_delta8_bgra_iter\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count), "m" (*movemask) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "cc", "memory" + ); +#else + Panic("SSE function called on a non x86\\x86-64 platform"); +#endif +} + +/* RGB32: ARGB SSSE3 */ +__attribute__((noinline,__target__("ssse3"))) void ssse3_delta8_argb(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count) { +#if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE)) + + __asm__ __volatile__ ( + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "mov $0xff, %%eax\n\t" + "movd %%eax, %%xmm0\n\t" + "pshufd $0x0, %%xmm0, %%xmm0\n\t" + "movdqa %4, %%xmm5\n\t" + "sub $0x10, %0\n\t" + "sub $0x10, %1\n\t" + "sub $0x4, %2\n\t" + "ssse3_delta8_argb_iter:\n\t" + "movdqa (%0,%3,4), %%xmm1\n\t" + "movdqa (%1,%3,4), %%xmm2\n\t" + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm3\n\t" + "movdqa %%xmm3, %%xmm2\n\t" + "psrld $0x10, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "pslld $0x2, %%xmm2\n\t" + "paddd %%xmm1, %%xmm2\n\t" + "movdqa %%xmm3, %%xmm1\n\t" + "psrld $0x8, %%xmm1\n\t" + "pand %%xmm0, %%xmm1\n\t" + "paddd %%xmm1, %%xmm1\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "movdqa %%xmm3, %%xmm2\n\t" + "psrld $0x18, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "pshufb %%xmm5, %%xmm1\n\t" + "movd %%xmm1, %%eax\n\t" + "movnti %%eax, (%2,%3)\n\t" + "sub $0x4, %3\n\t" + "jnz ssse3_delta8_argb_iter\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count), "m" (*movemask) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "cc", "memory" + ); +#else + Panic("SSE function called on a non x86\\x86-64 platform"); +#endif +} + +/* RGB32: ABGR SSSE3 */ +__attribute__((noinline,__target__("ssse3"))) void ssse3_delta8_abgr(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count) { +#if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE)) + + __asm__ __volatile__ ( + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "mov $0xff, %%eax\n\t" + "movd %%eax, %%xmm0\n\t" + "pshufd $0x0, %%xmm0, %%xmm0\n\t" + "movdqa %4, %%xmm5\n\t" + "sub $0x10, %0\n\t" + "sub $0x10, %1\n\t" + "sub $0x4, %2\n\t" + "ssse3_delta8_abgr_iter:\n\t" + "movdqa (%0,%3,4), %%xmm1\n\t" + "movdqa (%1,%3,4), %%xmm2\n\t" + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm3\n\t" + "movdqa %%xmm3, %%xmm2\n\t" + "psrld $0x10, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "pslld $0x2, %%xmm2\n\t" + "paddd %%xmm1, %%xmm2\n\t" + "movdqa %%xmm3, %%xmm1\n\t" + "psrld $0x8, %%xmm1\n\t" + "pand %%xmm0, %%xmm1\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "movdqa %%xmm3, %%xmm2\n\t" + "psrld $0x18, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "paddd %%xmm2, %%xmm2\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "pshufb %%xmm5, %%xmm1\n\t" + "movd %%xmm1, %%eax\n\t" + "movnti %%eax, (%2,%3)\n\t" + "sub $0x4, %3\n\t" + "jnz ssse3_delta8_abgr_iter\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count), "m" (*movemask) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "cc", "memory" + ); +#else + Panic("SSE function called on a non x86\\x86-64 platform"); +#endif +} + + +/************************************************* CONVERT FUNCTIONS *************************************************/ + +/* RGB24 to grayscale */ +__attribute__((noinline)) void std_convert_rgb_gray8(const uint8_t* col1, uint8_t* result, unsigned long count) { + unsigned int r,g,b; + const uint8_t* const max_ptr = result + count; + + while(result < max_ptr) { + r = col1[0]; + g = col1[1]; + b = col1[2]; + result[0] = (r + r + b + g + g + g + g + g)>>3; + r = col1[3]; + g = col1[4]; + b = col1[5]; + result[1] = (r + r + b + g + g + g + g + g)>>3; + r = col1[6]; + g = col1[7]; + b = col1[8]; + result[2] = (r + r + b + g + g + g + g + g)>>3; + r = col1[9]; + g = col1[10]; + b = col1[11]; + result[3] = (r + r + b + g + g + g + g + g)>>3; + + col1 += 12; + result += 4; + } +} + +/* BGR24 to grayscale */ +__attribute__((noinline)) void std_convert_bgr_gray8(const uint8_t* col1, uint8_t* result, unsigned long count) { + unsigned int r,g,b; + const uint8_t* const max_ptr = result + count; + + while(result < max_ptr) { + b = col1[0]; + g = col1[1]; + r = col1[2]; + result[0] = (r + r + b + g + g + g + g + g)>>3; + b = col1[3]; + g = col1[4]; + r = col1[5]; + result[1] = (r + r + b + g + g + g + g + g)>>3; + b = col1[6]; + g = col1[7]; + r = col1[8]; + result[2] = (r + r + b + g + g + g + g + g)>>3; + b = col1[9]; + g = col1[10]; + r = col1[11]; + result[3] = (r + r + b + g + g + g + g + g)>>3; + + col1 += 12; + result += 4; + } +} + +/* RGBA to grayscale */ +__attribute__((noinline)) void std_convert_rgba_gray8(const uint8_t* col1, uint8_t* result, unsigned long count) { + unsigned int r,g,b; + const uint8_t* const max_ptr = result + count; + + while(result < max_ptr) { + r = col1[0]; + g = col1[1]; + b = col1[2]; + result[0] = (r + r + b + g + g + g + g + g)>>3; + r = col1[4]; + g = col1[5]; + b = col1[6]; + result[1] = (r + r + b + g + g + g + g + g)>>3; + r = col1[8]; + g = col1[9]; + b = col1[10]; + result[2] = (r + r + b + g + g + g + g + g)>>3; + r = col1[12]; + g = col1[13]; + b = col1[14]; + result[3] = (r + r + b + g + g + g + g + g)>>3; + + col1 += 16; + result += 4; + } +} + +/* BGRA to grayscale */ +__attribute__((noinline)) void std_convert_bgra_gray8(const uint8_t* col1, uint8_t* result, unsigned long count) { + unsigned int r,g,b; + const uint8_t* const max_ptr = result + count; + + while(result < max_ptr) { + b = col1[0]; + g = col1[1]; + r = col1[2]; + result[0] = (r + r + b + g + g + g + g + g)>>3; + b = col1[4]; + g = col1[5]; + r = col1[6]; + result[1] = (r + r + b + g + g + g + g + g)>>3; + b = col1[8]; + g = col1[9]; + r = col1[10]; + result[2] = (r + r + b + g + g + g + g + g)>>3; + b = col1[12]; + g = col1[13]; + r = col1[14]; + result[3] = (r + r + b + g + g + g + g + g)>>3; + + col1 += 16; + result += 4; + } +} + +/* ARGB to grayscale */ +__attribute__((noinline)) void std_convert_argb_gray8(const uint8_t* col1, uint8_t* result, unsigned long count) { + unsigned int r,g,b; + const uint8_t* const max_ptr = result + count; + + while(result < max_ptr) { + r = col1[1]; + g = col1[2]; + b = col1[3]; + result[0] = (r + r + b + g + g + g + g + g)>>3; + r = col1[5]; + g = col1[6]; + b = col1[7]; + result[1] = (r + r + b + g + g + g + g + g)>>3; + r = col1[9]; + g = col1[10]; + b = col1[11]; + result[2] = (r + r + b + g + g + g + g + g)>>3; + r = col1[13]; + g = col1[14]; + b = col1[15]; + result[3] = (r + r + b + g + g + g + g + g)>>3; + + col1 += 16; + result += 4; + } +} + +/* ABGR to grayscale */ +__attribute__((noinline)) void std_convert_abgr_gray8(const uint8_t* col1, uint8_t* result, unsigned long count) { + unsigned int r,g,b; + const uint8_t* const max_ptr = result + count; + + while(result < max_ptr) { + b = col1[1]; + g = col1[2]; + r = col1[3]; + result[0] = (r + r + b + g + g + g + g + g)>>3; + b = col1[5]; + g = col1[6]; + r = col1[7]; + result[1] = (r + r + b + g + g + g + g + g)>>3; + b = col1[9]; + g = col1[10]; + r = col1[11]; + result[2] = (r + r + b + g + g + g + g + g)>>3; + b = col1[13]; + g = col1[14]; + r = col1[15]; + result[3] = (r + r + b + g + g + g + g + g)>>3; + + col1 += 16; + result += 4; + } +} + +/* Converts a YUYV image into grayscale by extracting the Y channel */ +__attribute__((noinline)) void std_convert_yuyv_gray8(const uint8_t* col1, uint8_t* result, unsigned long count) { + const uint16_t* yuvbuf = (const uint16_t*)col1; + const uint8_t* const max_ptr = result + count; + + while(result < max_ptr) { + result[0] = (uint8_t)yuvbuf[0]; + result[1] = (uint8_t)yuvbuf[1]; + result[2] = (uint8_t)yuvbuf[2]; + result[3] = (uint8_t)yuvbuf[3]; + result[4] = (uint8_t)yuvbuf[4]; + result[5] = (uint8_t)yuvbuf[5]; + result[6] = (uint8_t)yuvbuf[6]; + result[7] = (uint8_t)yuvbuf[7]; + result[8] = (uint8_t)yuvbuf[8]; + result[9] = (uint8_t)yuvbuf[9]; + result[10] = (uint8_t)yuvbuf[10]; + result[11] = (uint8_t)yuvbuf[11]; + result[12] = (uint8_t)yuvbuf[12]; + result[13] = (uint8_t)yuvbuf[13]; + result[14] = (uint8_t)yuvbuf[14]; + result[15] = (uint8_t)yuvbuf[15]; + + yuvbuf += 16; + result += 16; + } +} + +/* RGBA to grayscale SSSE3 */ +__attribute__((noinline,__target__("ssse3"))) void ssse3_convert_rgba_gray8(const uint8_t* col1, uint8_t* result, unsigned long count) { +#if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE)) + + __asm__ __volatile__ ( + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "mov $0xff, %%eax\n\t" + "movd %%eax, %%xmm0\n\t" + "pshufd $0x0, %%xmm0, %%xmm0\n\t" + "movdqa %3, %%xmm5\n\t" + "sub $0x10, %0\n\t" + "sub $0x4, %1\n\t" + "ssse3_convert_rgba_gray8_iter:\n\t" + "movdqa (%0,%2,4), %%xmm3\n\t" + "psrlq $0x3, %%xmm3\n\t" + "pand %%xmm4, %%xmm3\n\t" + "movdqa %%xmm3, %%xmm2\n\t" + "psrld $0x8, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "pslld $0x2, %%xmm2\n\t" + "paddd %%xmm1, %%xmm2\n\t" + "movdqa %%xmm3, %%xmm1\n\t" + "pand %%xmm0, %%xmm1\n\t" + "paddd %%xmm1, %%xmm1\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "movdqa %%xmm3, %%xmm2\n\t" + "psrld $0x10, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "pshufb %%xmm5, %%xmm1\n\t" + "movd %%xmm1, %%eax\n\t" + "movnti %%eax, (%1,%2)\n\t" + "sub $0x4, %2\n\t" + "jnz ssse3_delta8_abgr_iter\n\t" + : + : "r" (col1), "r" (result), "r" (count), "m" (*movemask) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "cc", "memory" + ); +#else + Panic("SSE function called on a non x86\\x86-64 platform"); +#endif +} + +/* Converts a YUYV image into grayscale by extracting the Y channel */ +__attribute__((noinline,__target__("ssse3"))) void ssse3_convert_yuyv_gray8(const uint8_t* col1, uint8_t* result, unsigned long count) { +#if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE)) + unsigned long i = 0; + + __attribute__((aligned(16))) static const uint8_t movemask1[16] = {0,2,4,6,8,10,12,14,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; + __attribute__((aligned(16))) static const uint8_t movemask2[16] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0,2,4,6,8,10,12,14}; + + /* XMM0 - General purpose */ + /* XMM1 - General purpose */ + /* XMM2 - unused */ + /* XMM3 - shift mask 1 */ + /* XMM4 - shift mask 2 */ + /* XMM5 - unused*/ + /* XMM6 - unused */ + /* XMM7 - unused */ + + __asm__ __volatile__ ( + "movdqa %4, %%xmm3\n\t" + "movdqa %5, %%xmm4\n\t" + "algo_ssse3_convert_yuyv_gray8:\n\t" + "movdqa (%0), %%xmm0\n\t" + "pshufb %%xmm3, %%xmm0\n\t" + "movdqa 0x10(%0), %%xmm1\n\t" + "pshufb %%xmm4, %%xmm1\n\t" + "por %%xmm1, %%xmm0\n\t" + "movntdq %%xmm0, (%1)\n\t" + "add $0x10, %3\n\t" + "add $0x10, %1\n\t" + "add $0x20, %0\n\t" + "cmp %2, %3\n\t" + "jb algo_ssse3_convert_yuyv_gray8\n\t" + : +#if (defined(_DEBUG) && !defined(__x86_64__)) /* Use one less register to allow compilation to success on 32bit with omit frame pointer disabled */ + : "r" (col1), "r" (result), "m" (count), "r" (i), "m" (*movemask1), "m" (*movemask2) +#else + : "r" (col1), "r" (result), "r" (count), "r" (i), "m" (*movemask1), "m" (*movemask2) +#endif + : "%xmm3", "%xmm4", "cc", "memory" + ); +#else + Panic("SSE function called on a non x86\\x86-64 platform"); +#endif +} + +/* YUYV to RGB24 - relocated from zm_local_camera.cpp */ +__attribute__((noinline)) void zm_convert_yuyv_rgb(const uint8_t* col1, uint8_t* result, unsigned long count) { + unsigned int r,g,b; + unsigned int y1,y2,u,v; + for(unsigned int i=0; i < count; i += 2, col1 += 4, result += 6) { + y1 = col1[0]; + u = col1[1]; + y2 = col1[2]; + v = col1[3]; + + r = y1 + r_v_table[v]; + g = y1 - (g_u_table[u]+g_v_table[v]); + b = y1 + b_u_table[u]; + + result[0] = r<0?0:(r>255?255:r); + result[1] = g<0?0:(g>255?255:g); + result[2] = b<0?0:(b>255?255:b); + + r = y2 + r_v_table[v]; + g = y2 - (g_u_table[u]+g_v_table[v]); + b = y2 + b_u_table[u]; + + result[3] = r<0?0:(r>255?255:r); + result[4] = g<0?0:(g>255?255:g); + result[5] = b<0?0:(b>255?255:b); + } + +} + +/* YUYV to RGBA - modified the one above */ +__attribute__((noinline)) void zm_convert_yuyv_rgba(const uint8_t* col1, uint8_t* result, unsigned long count) { + unsigned int r,g,b; + unsigned int y1,y2,u,v; + for(unsigned int i=0; i < count; i += 2, col1 += 4, result += 8) { + y1 = col1[0]; + u = col1[1]; + y2 = col1[2]; + v = col1[3]; + + r = y1 + r_v_table[v]; + g = y1 - (g_u_table[u]+g_v_table[v]); + b = y1 + b_u_table[u]; + + result[0] = r<0?0:(r>255?255:r); + result[1] = g<0?0:(g>255?255:g); + result[2] = b<0?0:(b>255?255:b); + + r = y2 + r_v_table[v]; + g = y2 - (g_u_table[u]+g_v_table[v]); + b = y2 + b_u_table[u]; + + result[4] = r<0?0:(r>255?255:r); + result[5] = g<0?0:(g>255?255:g); + result[6] = b<0?0:(b>255?255:b); + } + +} + +/* RGB555 to RGB24 - relocated from zm_local_camera.cpp */ +__attribute__((noinline)) void zm_convert_rgb555_rgb(const uint8_t* col1, uint8_t* result, unsigned long count) { + unsigned int r,g,b; + for(unsigned int i=0; i < count; i++, col1 += 2, result += 3) { + b = ((*col1)<<3)&0xf8; + g = (((*(col1+1))<<6)|((*col1)>>2))&0xf8; + r = ((*(col1+1))<<1)&0xf8; + result[0] = r; + result[1] = g; + result[2] = b; + } +} + +/* RGB555 to RGBA - modified the one above */ +__attribute__((noinline)) void zm_convert_rgb555_rgba(const uint8_t* col1, uint8_t* result, unsigned long count) { + unsigned int r,g,b; + for(unsigned int i=0; i < count; i++, col1 += 2, result += 4) { + b = ((*col1)<<3)&0xf8; + g = (((*(col1+1))<<6)|((*col1)>>2))&0xf8; + r = ((*(col1+1))<<1)&0xf8; + result[0] = r; + result[1] = g; + result[2] = b; + } +} + +/* RGB565 to RGB24 - relocated from zm_local_camera.cpp */ +__attribute__((noinline)) void zm_convert_rgb565_rgb(const uint8_t* col1, uint8_t* result, unsigned long count) { + unsigned int r,g,b; + for(unsigned int i=0; i < count; i++, col1 += 2, result += 3) { + b = ((*col1)<<3)&0xf8; + g = (((*(col1+1))<<5)|((*col1)>>3))&0xfc; + r = (*(col1+1))&0xf8; + result[0] = r; + result[1] = g; + result[2] = b; + } +} + +/* RGB565 to RGBA - modified the one above */ +__attribute__((noinline)) void zm_convert_rgb565_rgba(const uint8_t* col1, uint8_t* result, unsigned long count) { + unsigned int r,g,b; + for(unsigned int i=0; i < count; i++, col1 += 2, result += 4) { + b = ((*col1)<<3)&0xf8; + g = (((*(col1+1))<<5)|((*col1)>>3))&0xfc; + r = (*(col1+1))&0xf8; + result[0] = r; + result[1] = g; + result[2] = b; + } +} + +/************************************************* DEINTERLACE FUNCTIONS *************************************************/ + +/* Grayscale */ +__attribute__((noinline)) void std_deinterlace_4field_gray8(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height) +{ + uint8_t *pcurrent, *pabove, *pncurrent, *pnabove, *pbelow; + const uint8_t* const max_ptr = col1 + (width*(height-1)); + const uint8_t *max_ptr2; + + pcurrent = col1 + width; + pncurrent = col2 + width; + pabove = col1; + pnabove = col2; + pbelow = col1 + (width*2); + while(pcurrent < max_ptr) + { + max_ptr2 = pcurrent + width; + while(pcurrent < max_ptr2) { + if((unsigned int)((abs(*pnabove - *pabove) + abs(*pncurrent - *pcurrent)) >> 1) >= threshold) { + *pcurrent = (*pabove + *pbelow) >> 1; + } + pabove++; + pnabove++; + pcurrent++; + pncurrent++; + pbelow++; + } + pcurrent += width; + pncurrent += width; + pabove += width; + pnabove += width; + pbelow += width; + + } + + /* Special case for the last line */ + max_ptr2 = pcurrent + width; + while(pcurrent < max_ptr2) { + if((unsigned int)((abs(*pnabove - *pabove) + abs(*pncurrent - *pcurrent)) >> 1) >= threshold) { + *pcurrent = *pabove; + } + pabove++; + pnabove++; + pcurrent++; + pncurrent++; + } +} + +/* RGB */ +__attribute__((noinline)) void std_deinterlace_4field_rgb(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height) +{ + uint8_t *pcurrent, *pabove, *pncurrent, *pnabove, *pbelow; + const unsigned int row_width = width*3; + const uint8_t* const max_ptr = col1 + (row_width * (height-1)); + const uint8_t *max_ptr2; + unsigned int b, g, r; + unsigned int delta1, delta2; + + pcurrent = col1 + (width*3); + pncurrent = col2 + (width*3); + pabove = col1; + pnabove = col2; + pbelow = col1 + ((width*2)*3); + while(pcurrent < max_ptr) + { + max_ptr2 = pcurrent + row_width; + while(pcurrent < max_ptr2) { + r = abs(pnabove[0] - pabove[0]); + g = abs(pnabove[1] - pabove[1]); + b = abs(pnabove[2] - pabove[2]); + delta1 = (r + r + b + g + g + g + g + g)>>3; + r = abs(pncurrent[0] - pcurrent[0]); + g = abs(pncurrent[1] - pcurrent[1]); + b = abs(pncurrent[2] - pcurrent[2]); + delta2 = (r + r + b + g + g + g + g + g)>>3; + if(((delta1 + delta2) >> 1) >= threshold) { + pcurrent[0] = (pabove[0] + pbelow[0]) >> 1; + pcurrent[1] = (pabove[1] + pbelow[1]) >> 1; + pcurrent[2] = (pabove[2] + pbelow[2]) >> 1; + } + pabove += 3; + pnabove += 3; + pcurrent += 3; + pncurrent += 3; + pbelow += 3; + } + pcurrent += row_width; + pncurrent += row_width; + pabove += row_width; + pnabove += row_width; + pbelow += row_width; + + } + + /* Special case for the last line */ + max_ptr2 = pcurrent + row_width; + while(pcurrent < max_ptr2) { + r = abs(pnabove[0] - pabove[0]); + g = abs(pnabove[1] - pabove[1]); + b = abs(pnabove[2] - pabove[2]); + delta1 = (r + r + b + g + g + g + g + g)>>3; + r = abs(pncurrent[0] - pcurrent[0]); + g = abs(pncurrent[1] - pcurrent[1]); + b = abs(pncurrent[2] - pcurrent[2]); + delta2 = (r + r + b + g + g + g + g + g)>>3; + if(((delta1 + delta2) >> 1) >= threshold) { + pcurrent[0] = pabove[0]; + pcurrent[1] = pabove[1]; + pcurrent[2] = pabove[2]; + } + pabove += 3; + pnabove += 3; + pcurrent += 3; + pncurrent += 3; + } +} + +/* BGR */ +__attribute__((noinline)) void std_deinterlace_4field_bgr(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height) +{ + uint8_t *pcurrent, *pabove, *pncurrent, *pnabove, *pbelow; + const unsigned int row_width = width*3; + const uint8_t* const max_ptr = col1 + (row_width * (height-1)); + const uint8_t *max_ptr2; + unsigned int b, g, r; + unsigned int delta1, delta2; + + pcurrent = col1 + (width*3); + pncurrent = col2 + (width*3); + pabove = col1; + pnabove = col2; + pbelow = col1 + ((width*2)*3); + while(pcurrent < max_ptr) + { + max_ptr2 = pcurrent + row_width; + while(pcurrent < max_ptr2) { + b = abs(pnabove[0] - pabove[0]); + g = abs(pnabove[1] - pabove[1]); + r = abs(pnabove[2] - pabove[2]); + delta1 = (r + r + b + g + g + g + g + g)>>3; + b = abs(pncurrent[0] - pcurrent[0]); + g = abs(pncurrent[1] - pcurrent[1]); + r = abs(pncurrent[2] - pcurrent[2]); + delta2 = (r + r + b + g + g + g + g + g)>>3; + if(((delta1 + delta2) >> 1) >= threshold) { + pcurrent[0] = (pabove[0] + pbelow[0]) >> 1; + pcurrent[1] = (pabove[1] + pbelow[1]) >> 1; + pcurrent[2] = (pabove[2] + pbelow[2]) >> 1; + } + pabove += 3; + pnabove += 3; + pcurrent += 3; + pncurrent += 3; + pbelow += 3; + } + pcurrent += row_width; + pncurrent += row_width; + pabove += row_width; + pnabove += row_width; + pbelow += row_width; + + } + + /* Special case for the last line */ + max_ptr2 = pcurrent + row_width; + while(pcurrent < max_ptr2) { + b = abs(pnabove[0] - pabove[0]); + g = abs(pnabove[1] - pabove[1]); + r = abs(pnabove[2] - pabove[2]); + delta1 = (r + r + b + g + g + g + g + g)>>3; + b = abs(pncurrent[0] - pcurrent[0]); + g = abs(pncurrent[1] - pcurrent[1]); + r = abs(pncurrent[2] - pcurrent[2]); + delta2 = (r + r + b + g + g + g + g + g)>>3; + if(((delta1 + delta2) >> 1) >= threshold) { + pcurrent[0] = pabove[0]; + pcurrent[1] = pabove[1]; + pcurrent[2] = pabove[2]; + } + pabove += 3; + pnabove += 3; + pcurrent += 3; + pncurrent += 3; + } +} + +/* RGBA */ +__attribute__((noinline)) void std_deinterlace_4field_rgba(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height) +{ + uint8_t *pcurrent, *pabove, *pncurrent, *pnabove, *pbelow; + const unsigned int row_width = width*4; + const uint8_t* const max_ptr = col1 + (row_width * (height-1)); + const uint8_t *max_ptr2; + unsigned int b, g, r; + unsigned int delta1, delta2; + + pcurrent = col1 + row_width; + pncurrent = col2 + row_width; + pabove = col1; + pnabove = col2; + pbelow = col1 + (row_width*2); + while(pcurrent < max_ptr) + { + max_ptr2 = pcurrent + row_width; + while(pcurrent < max_ptr2) { + r = abs(pnabove[0] - pabove[0]); + g = abs(pnabove[1] - pabove[1]); + b = abs(pnabove[2] - pabove[2]); + delta1 = (r + r + b + g + g + g + g + g)>>3; + r = abs(pncurrent[0] - pcurrent[0]); + g = abs(pncurrent[1] - pcurrent[1]); + b = abs(pncurrent[2] - pcurrent[2]); + delta2 = (r + r + b + g + g + g + g + g)>>3; + if(((delta1 + delta2) >> 1) >= threshold) { + pcurrent[0] = (pabove[0] + pbelow[0]) >> 1; + pcurrent[1] = (pabove[1] + pbelow[1]) >> 1; + pcurrent[2] = (pabove[2] + pbelow[2]) >> 1; + } + pabove += 4; + pnabove += 4; + pcurrent += 4; + pncurrent += 4; + pbelow += 4; + } + pcurrent += row_width; + pncurrent += row_width; + pabove += row_width; + pnabove += row_width; + pbelow += row_width; + + } + + /* Special case for the last line */ + max_ptr2 = pcurrent + row_width; + while(pcurrent < max_ptr2) { + r = abs(pnabove[0] - pabove[0]); + g = abs(pnabove[1] - pabove[1]); + b = abs(pnabove[2] - pabove[2]); + delta1 = (r + r + b + g + g + g + g + g)>>3; + r = abs(pncurrent[0] - pcurrent[0]); + g = abs(pncurrent[1] - pcurrent[1]); + b = abs(pncurrent[2] - pcurrent[2]); + delta2 = (r + r + b + g + g + g + g + g)>>3; + if(((delta1 + delta2) >> 1) >= threshold) { + pcurrent[0] = pabove[0]; + pcurrent[1] = pabove[1]; + pcurrent[2] = pabove[2]; + } + pabove += 4; + pnabove += 4; + pcurrent += 4; + pncurrent += 4; + } +} + +/* BGRA */ +__attribute__((noinline)) void std_deinterlace_4field_bgra(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height) +{ + uint8_t *pcurrent, *pabove, *pncurrent, *pnabove, *pbelow; + const unsigned int row_width = width*4; + const uint8_t* const max_ptr = col1 + (row_width * (height-1)); + const uint8_t *max_ptr2; + unsigned int b, g, r; + unsigned int delta1, delta2; + + pcurrent = col1 + row_width; + pncurrent = col2 + row_width; + pabove = col1; + pnabove = col2; + pbelow = col1 + (row_width*2); + while(pcurrent < max_ptr) + { + max_ptr2 = pcurrent + row_width; + while(pcurrent < max_ptr2) { + b = abs(pnabove[0] - pabove[0]); + g = abs(pnabove[1] - pabove[1]); + r = abs(pnabove[2] - pabove[2]); + delta1 = (r + r + b + g + g + g + g + g)>>3; + b = abs(pncurrent[0] - pcurrent[0]); + g = abs(pncurrent[1] - pcurrent[1]); + r = abs(pncurrent[2] - pcurrent[2]); + delta2 = (r + r + b + g + g + g + g + g)>>3; + if(((delta1 + delta2) >> 1) >= threshold) { + pcurrent[0] = (pabove[0] + pbelow[0]) >> 1; + pcurrent[1] = (pabove[1] + pbelow[1]) >> 1; + pcurrent[2] = (pabove[2] + pbelow[2]) >> 1; + } + pabove += 4; + pnabove += 4; + pcurrent += 4; + pncurrent += 4; + pbelow += 4; + } + pcurrent += row_width; + pncurrent += row_width; + pabove += row_width; + pnabove += row_width; + pbelow += row_width; + + } + + /* Special case for the last line */ + max_ptr2 = pcurrent + row_width; + while(pcurrent < max_ptr2) { + b = abs(pnabove[0] - pabove[0]); + g = abs(pnabove[1] - pabove[1]); + r = abs(pnabove[2] - pabove[2]); + delta1 = (r + r + b + g + g + g + g + g)>>3; + b = abs(pncurrent[0] - pcurrent[0]); + g = abs(pncurrent[1] - pcurrent[1]); + r = abs(pncurrent[2] - pcurrent[2]); + delta2 = (r + r + b + g + g + g + g + g)>>3; + if(((delta1 + delta2) >> 1) >= threshold) { + pcurrent[0] = pabove[0]; + pcurrent[1] = pabove[1]; + pcurrent[2] = pabove[2]; + } + pabove += 4; + pnabove += 4; + pcurrent += 4; + pncurrent += 4; + } +} + +/* ARGB */ +__attribute__((noinline)) void std_deinterlace_4field_argb(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height) +{ + uint8_t *pcurrent, *pabove, *pncurrent, *pnabove, *pbelow; + const unsigned int row_width = width*4; + const uint8_t* const max_ptr = col1 + (row_width * (height-1)); + const uint8_t *max_ptr2; + unsigned int b, g, r; + unsigned int delta1, delta2; + + pcurrent = col1 + row_width; + pncurrent = col2 + row_width; + pabove = col1; + pnabove = col2; + pbelow = col1 + (row_width*2); + while(pcurrent < max_ptr) + { + max_ptr2 = pcurrent + row_width; + while(pcurrent < max_ptr2) { + r = abs(pnabove[1] - pabove[1]); + g = abs(pnabove[2] - pabove[2]); + b = abs(pnabove[3] - pabove[3]); + delta1 = (r + r + b + g + g + g + g + g)>>3; + r = abs(pncurrent[1] - pcurrent[1]); + g = abs(pncurrent[2] - pcurrent[2]); + b = abs(pncurrent[3] - pcurrent[3]); + delta2 = (r + r + b + g + g + g + g + g)>>3; + if(((delta1 + delta2) >> 1) >= threshold) { + pcurrent[1] = (pabove[1] + pbelow[1]) >> 1; + pcurrent[2] = (pabove[2] + pbelow[2]) >> 1; + pcurrent[3] = (pabove[3] + pbelow[3]) >> 1; + } + pabove += 4; + pnabove += 4; + pcurrent += 4; + pncurrent += 4; + pbelow += 4; + } + pcurrent += row_width; + pncurrent += row_width; + pabove += row_width; + pnabove += row_width; + pbelow += row_width; + + } + + /* Special case for the last line */ + max_ptr2 = pcurrent + row_width; + while(pcurrent < max_ptr2) { + r = abs(pnabove[1] - pabove[1]); + g = abs(pnabove[2] - pabove[2]); + b = abs(pnabove[3] - pabove[3]); + delta1 = (r + r + b + g + g + g + g + g)>>3; + r = abs(pncurrent[1] - pcurrent[1]); + g = abs(pncurrent[2] - pcurrent[2]); + b = abs(pncurrent[3] - pcurrent[3]); + delta2 = (r + r + b + g + g + g + g + g)>>3; + if(((delta1 + delta2) >> 1) >= threshold) { + pcurrent[1] = pabove[1]; + pcurrent[2] = pabove[2]; + pcurrent[3] = pabove[3]; + } + pabove += 4; + pnabove += 4; + pcurrent += 4; + pncurrent += 4; + } +} + +/* ABGR */ +__attribute__((noinline)) void std_deinterlace_4field_abgr(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height) +{ + uint8_t *pcurrent, *pabove, *pncurrent, *pnabove, *pbelow; + const unsigned int row_width = width*4; + const uint8_t* const max_ptr = col1 + (row_width * (height-1)); + const uint8_t *max_ptr2; + unsigned int b, g, r; + unsigned int delta1, delta2; + + pcurrent = col1 + row_width; + pncurrent = col2 + row_width; + pabove = col1; + pnabove = col2; + pbelow = col1 + (row_width*2); + while(pcurrent < max_ptr) + { + max_ptr2 = pcurrent + row_width; + while(pcurrent < max_ptr2) { + b = abs(pnabove[1] - pabove[1]); + g = abs(pnabove[2] - pabove[2]); + r = abs(pnabove[3] - pabove[3]); + delta1 = (r + r + b + g + g + g + g + g)>>3; + b = abs(pncurrent[1] - pcurrent[1]); + g = abs(pncurrent[2] - pcurrent[2]); + r = abs(pncurrent[3] - pcurrent[3]); + delta2 = (r + r + b + g + g + g + g + g)>>3; + if(((delta1 + delta2) >> 1) >= threshold) { + pcurrent[1] = (pabove[1] + pbelow[1]) >> 1; + pcurrent[2] = (pabove[2] + pbelow[2]) >> 1; + pcurrent[3] = (pabove[3] + pbelow[3]) >> 1; + } + pabove += 4; + pnabove += 4; + pcurrent += 4; + pncurrent += 4; + pbelow += 4; + } + pcurrent += row_width; + pncurrent += row_width; + pabove += row_width; + pnabove += row_width; + pbelow += row_width; + + } + + /* Special case for the last line */ + max_ptr2 = pcurrent + row_width; + while(pcurrent < max_ptr2) { + b = abs(pnabove[1] - pabove[1]); + g = abs(pnabove[2] - pabove[2]); + r = abs(pnabove[3] - pabove[3]); + delta1 = (r + r + b + g + g + g + g + g)>>3; + b = abs(pncurrent[1] - pcurrent[1]); + g = abs(pncurrent[2] - pcurrent[2]); + r = abs(pncurrent[3] - pcurrent[3]); + delta2 = (r + r + b + g + g + g + g + g)>>3; + if(((delta1 + delta2) >> 1) >= threshold) { + pcurrent[1] = pabove[1]; + pcurrent[2] = pabove[2]; + pcurrent[3] = pabove[3]; + } + pabove += 4; + pnabove += 4; + pcurrent += 4; + pncurrent += 4; + } +} + +/* Grayscale SSSE3 */ +__attribute__((noinline,__target__("ssse3"))) void ssse3_deinterlace_4field_gray8(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height) { + + union { + uint32_t int32; + uint8_t int8a[4]; + } threshold_mask; + threshold_mask.int8a[0] = threshold; + threshold_mask.int8a[1] = 0; + threshold_mask.int8a[2] = threshold; + threshold_mask.int8a[3] = 0; + + unsigned long row_width = width; + uint8_t* max_ptr = col1 + (row_width * (height-2)); + uint8_t* max_ptr2 = col1 + row_width; + + __asm__ __volatile__ ( + /* Load the threshold */ + "mov %5, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + /* Zero the temporary register */ + "pxor %%xmm0, %%xmm0\n\t" + + "algo_ssse3_deinterlace_4field_gray8:\n\t" + + /* Load pabove into xmm1 and pnabove into xmm2 */ + "movdqa (%0), %%xmm1\n\t" + "movdqa (%1), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm5\n\t" /* Keep backup of pabove in xmm5 */ + "pmaxub %%xmm2, %%xmm1\n\t" + "pminub %%xmm5, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "movdqa %%xmm1, %%xmm7\n\t" /* Backup of delta2 in xmm7 for now */ + + /* Next row */ + "add %4, %0\n\t" + "add %4, %1\n\t" + + /* Load pcurrent into xmm1 and pncurrent into xmm2 */ + "movdqa (%0), %%xmm1\n\t" + "movdqa (%1), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm6\n\t" /* Keep backup of pcurrent in xmm6 */ + "pmaxub %%xmm2, %%xmm1\n\t" + "pminub %%xmm6, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + + "pavgb %%xmm7, %%xmm1\n\t" // Average the two deltas together + "movdqa %%xmm1, %%xmm2\n\t" + + /* Do the comparison on words instead of bytes because we don't have unsigned comparison */ + "punpcklbw %%xmm0, %%xmm1\n\t" // Expand pixels 0-7 into words into xmm1 + "punpckhbw %%xmm0, %%xmm2\n\t" // Expand pixels 8-15 into words into xmm2 + "pcmpgtw %%xmm4, %%xmm1\n\t" // Compare average delta with threshold for pixels 0-7 + "pcmpgtw %%xmm4, %%xmm2\n\t" // Compare average delta with threshold for pixels 8-15 + "packsswb %%xmm2, %%xmm1\n\t" // Pack the comparison results into xmm1 + + "movdqa (%0,%4), %%xmm2\n\t" // Load pbelow + "pavgb %%xmm5, %%xmm2\n\t" // Average pabove and pbelow + "pand %%xmm1, %%xmm2\n\t" // Filter out pixels in avg that shouldn't be copied + "pandn %%xmm6, %%xmm1\n\t" // Filter out pixels in pcurrent that should be replaced + + "por %%xmm2, %%xmm1\n\t" // Put the new values in pcurrent + "movntdq %%xmm1, (%0)\n\t" // Write pcurrent + + "sub %4, %0\n\t" // Restore pcurrent to pabove + "sub %4, %1\n\t" // Restore pncurrent to pnabove + + /* Next pixels */ + "add $0x10, %0\n\t" // Add 16 to pcurrent + "add $0x10, %1\n\t" // Add 16 to pncurrent + + /* Check if we reached the row end */ + "cmp %2, %0\n\t" + "jb algo_ssse3_deinterlace_4field_gray8\n\t" // Go for another iteration + + /* Next row */ + "add %4, %0\n\t" // Add width to pcurrent + "add %4, %1\n\t" // Add width to pncurrent + "mov %0, %2\n\t" + "add %4, %2\n\t" // Add width to max_ptr2 + + /* Check if we reached the end */ + "cmp %3, %0\n\t" + "jb algo_ssse3_deinterlace_4field_gray8\n\t" // Go for another iteration + : + : "r" (col1), "r" (col2), "r" (max_ptr2), "r" (max_ptr), "r" (row_width), "m" (threshold_mask.int32) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "cc", "memory" + ); +} + +/* RGBA SSSE3 */ +__attribute__((noinline,__target__("ssse3"))) void ssse3_deinterlace_4field_rgba(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height) { + __attribute__((aligned(16))) static const uint8_t movemask2[16] = {1,1,1,1,1,0,0,2,9,9,9,9,9,8,8,10}; + + const uint32_t threshold_val = threshold; + + unsigned long row_width = width*4; + uint8_t* max_ptr = col1 + (row_width * (height-2)); + uint8_t* max_ptr2 = col1 + row_width; + + __asm__ __volatile__ ( + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "movdqa %6, %%xmm3\n\t" + "mov %5, %%eax\n\t" +#if defined(__x86_64__) + "movd %%eax, %%xmm8\n\t" + "pshufd $0x0, %%xmm8, %%xmm8\n\t" +#endif + /* Zero the temporary register */ + "pxor %%xmm0, %%xmm0\n\t" + + "algo_ssse3_deinterlace_4field_rgba:\n\t" + + /* Load pabove into xmm1 and pnabove into xmm2 */ + "movdqa (%0), %%xmm1\n\t" + "movdqa (%1), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm5\n\t" /* Keep backup of pabove in xmm5 */ + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "punpckldq %%xmm1, %%xmm1\n\t" + "pshufb %%xmm3, %%xmm1\n\t" + "psadbw %%xmm0, %%xmm1\n\t" + "punpckhdq %%xmm2, %%xmm2\n\t" + "pshufb %%xmm3, %%xmm2\n\t" + "psadbw %%xmm0, %%xmm2\n\t" + "packuswb %%xmm2, %%xmm1\n\t" + "movdqa %%xmm1, %%xmm7\n\t" /* Backup of delta2 in xmm7 for now */ + + /* Next row */ + "add %4, %0\n\t" + "add %4, %1\n\t" + + /* Load pcurrent into xmm1 and pncurrent into xmm2 */ + "movdqa (%0), %%xmm1\n\t" + "movdqa (%1), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm6\n\t" /* Keep backup of pcurrent in xmm6 */ + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "punpckldq %%xmm1, %%xmm1\n\t" + "pshufb %%xmm3, %%xmm1\n\t" + "psadbw %%xmm0, %%xmm1\n\t" + "punpckhdq %%xmm2, %%xmm2\n\t" + "pshufb %%xmm3, %%xmm2\n\t" + "psadbw %%xmm0, %%xmm2\n\t" + "packuswb %%xmm2, %%xmm1\n\t" + + "pavgb %%xmm7, %%xmm1\n\t" // Average the two deltas together + +#if defined(__x86_64__) + "pcmpgtd %%xmm8, %%xmm1\n\t" // Compare average delta with the threshold +#else + "movd %%eax, %%xmm7\n\t" // Setup the threshold + "pshufd $0x0, %%xmm7, %%xmm7\n\t" + + "pcmpgtd %%xmm7, %%xmm1\n\t" // Compare average delta with the threshold +#endif + "movdqa (%0,%4), %%xmm2\n\t" // Load pbelow + "pavgb %%xmm5, %%xmm2\n\t" // Average pabove and pbelow + "pand %%xmm1, %%xmm2\n\t" // Filter out pixels in avg that shouldn't be copied + "pandn %%xmm6, %%xmm1\n\t" // Filter out pixels in pcurrent that should be replaced + + "por %%xmm2, %%xmm1\n\t" // Put the new values in pcurrent + "movntdq %%xmm1, (%0)\n\t" // Write pcurrent + + "sub %4, %0\n\t" // Restore pcurrent to pabove + "sub %4, %1\n\t" // Restore pncurrent to pnabove + + /* Next pixels */ + "add $0x10, %0\n\t" // Add 16 to pcurrent + "add $0x10, %1\n\t" // Add 16 to pncurrent + + /* Check if we reached the row end */ + "cmp %2, %0\n\t" + "jb algo_ssse3_deinterlace_4field_rgba\n\t" // Go for another iteration + + /* Next row */ + "add %4, %0\n\t" // Add width to pcurrent + "add %4, %1\n\t" // Add width to pncurrent + "mov %0, %2\n\t" + "add %4, %2\n\t" // Add width to max_ptr2 + + /* Check if we reached the end */ + "cmp %3, %0\n\t" + "jb algo_ssse3_deinterlace_4field_rgba\n\t" // Go for another iteration + + /* Special case for the last line */ + /* Load pabove into xmm1 and pnabove into xmm2 */ + "movdqa (%0), %%xmm1\n\t" + "movdqa (%1), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm5\n\t" /* Keep backup of pabove in xmm5 */ + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "punpckldq %%xmm1, %%xmm1\n\t" + "pshufb %%xmm3, %%xmm1\n\t" + "psadbw %%xmm0, %%xmm1\n\t" + "punpckhdq %%xmm2, %%xmm2\n\t" + "pshufb %%xmm3, %%xmm2\n\t" + "psadbw %%xmm0, %%xmm2\n\t" + "packuswb %%xmm2, %%xmm1\n\t" + "movdqa %%xmm1, %%xmm7\n\t" /* Backup of delta2 in xmm7 for now */ + + /* Next row */ + "add %4, %0\n\t" + "add %4, %1\n\t" + + /* Load pcurrent into xmm1 and pncurrent into xmm2 */ + "movdqa (%0), %%xmm1\n\t" + "movdqa (%1), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm6\n\t" /* Keep backup of pcurrent in xmm6 */ + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "punpckldq %%xmm1, %%xmm1\n\t" + "pshufb %%xmm3, %%xmm1\n\t" + "psadbw %%xmm0, %%xmm1\n\t" + "punpckhdq %%xmm2, %%xmm2\n\t" + "pshufb %%xmm3, %%xmm2\n\t" + "psadbw %%xmm0, %%xmm2\n\t" + "packuswb %%xmm2, %%xmm1\n\t" + + "pavgb %%xmm7, %%xmm1\n\t" // Average the two deltas together + +#if defined(__x86_64__) + "pcmpgtd %%xmm8, %%xmm1\n\t" // Compare average delta with the threshold +#else + "movd %%eax, %%xmm7\n\t" // Setup the threshold + "pshufd $0x0, %%xmm7, %%xmm7\n\t" + + "pcmpgtd %%xmm7, %%xmm1\n\t" // Compare average delta with the threshold +#endif + "pand %%xmm1, %%xmm5\n\t" // Filter out pixels in pabove that shouldn't be copied + "pandn %%xmm6, %%xmm1\n\t" // Filter out pixels in pcurrent that should be replaced + + "por %%xmm5, %%xmm1\n\t" // Put the new values in pcurrent + "movntdq %%xmm1, (%0)\n\t" // Write pcurrent + : + : "r" (col1), "r" (col2), "r" (max_ptr2), "r" (max_ptr), "r" (row_width), "m" (threshold_val), "m" (*movemask2) +#if defined(__x86_64__) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "%xmm8", "cc", "memory" +#else + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "cc", "memory" +#endif + ); +} + +/* BGRA SSSE3 */ +__attribute__((noinline,__target__("ssse3"))) void ssse3_deinterlace_4field_bgra(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height) { + __attribute__((aligned(16))) static const uint8_t movemask2[16] = {1,1,1,1,1,2,2,0,9,9,9,9,9,10,10,8}; + + const uint32_t threshold_val = threshold; + + unsigned long row_width = width*4; + uint8_t* max_ptr = col1 + (row_width * (height-2)); + uint8_t* max_ptr2 = col1 + row_width; + + __asm__ __volatile__ ( + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "movdqa %6, %%xmm3\n\t" + "mov %5, %%eax\n\t" +#if defined(__x86_64__) + "movd %%eax, %%xmm8\n\t" + "pshufd $0x0, %%xmm8, %%xmm8\n\t" +#endif + /* Zero the temporary register */ + "pxor %%xmm0, %%xmm0\n\t" + + "algo_ssse3_deinterlace_4field_bgra:\n\t" + + /* Load pabove into xmm1 and pnabove into xmm2 */ + "movdqa (%0), %%xmm1\n\t" + "movdqa (%1), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm5\n\t" /* Keep backup of pabove in xmm5 */ + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "punpckldq %%xmm1, %%xmm1\n\t" + "pshufb %%xmm3, %%xmm1\n\t" + "psadbw %%xmm0, %%xmm1\n\t" + "punpckhdq %%xmm2, %%xmm2\n\t" + "pshufb %%xmm3, %%xmm2\n\t" + "psadbw %%xmm0, %%xmm2\n\t" + "packuswb %%xmm2, %%xmm1\n\t" + "movdqa %%xmm1, %%xmm7\n\t" /* Backup of delta2 in xmm7 for now */ + + /* Next row */ + "add %4, %0\n\t" + "add %4, %1\n\t" + + /* Load pcurrent into xmm1 and pncurrent into xmm2 */ + "movdqa (%0), %%xmm1\n\t" + "movdqa (%1), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm6\n\t" /* Keep backup of pcurrent in xmm6 */ + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "punpckldq %%xmm1, %%xmm1\n\t" + "pshufb %%xmm3, %%xmm1\n\t" + "psadbw %%xmm0, %%xmm1\n\t" + "punpckhdq %%xmm2, %%xmm2\n\t" + "pshufb %%xmm3, %%xmm2\n\t" + "psadbw %%xmm0, %%xmm2\n\t" + "packuswb %%xmm2, %%xmm1\n\t" + + "pavgb %%xmm7, %%xmm1\n\t" // Average the two deltas together + +#if defined(__x86_64__) + "pcmpgtd %%xmm8, %%xmm1\n\t" // Compare average delta with the threshold +#else + "movd %%eax, %%xmm7\n\t" // Setup the threshold + "pshufd $0x0, %%xmm7, %%xmm7\n\t" + + "pcmpgtd %%xmm7, %%xmm1\n\t" // Compare average delta with the threshold +#endif + "movdqa (%0,%4), %%xmm2\n\t" // Load pbelow + "pavgb %%xmm5, %%xmm2\n\t" // Average pabove and pbelow + "pand %%xmm1, %%xmm2\n\t" // Filter out pixels in avg that shouldn't be copied + "pandn %%xmm6, %%xmm1\n\t" // Filter out pixels in pcurrent that should be replaced + + "por %%xmm2, %%xmm1\n\t" // Put the new values in pcurrent + "movntdq %%xmm1, (%0)\n\t" // Write pcurrent + + "sub %4, %0\n\t" // Restore pcurrent to pabove + "sub %4, %1\n\t" // Restore pncurrent to pnabove + + /* Next pixels */ + "add $0x10, %0\n\t" // Add 16 to pcurrent + "add $0x10, %1\n\t" // Add 16 to pncurrent + + /* Check if we reached the row end */ + "cmp %2, %0\n\t" + "jb algo_ssse3_deinterlace_4field_bgra\n\t" // Go for another iteration + + /* Next row */ + "add %4, %0\n\t" // Add width to pcurrent + "add %4, %1\n\t" // Add width to pncurrent + "mov %0, %2\n\t" + "add %4, %2\n\t" // Add width to max_ptr2 + + /* Check if we reached the end */ + "cmp %3, %0\n\t" + "jb algo_ssse3_deinterlace_4field_bgra\n\t" // Go for another iteration + + /* Special case for the last line */ + /* Load pabove into xmm1 and pnabove into xmm2 */ + "movdqa (%0), %%xmm1\n\t" + "movdqa (%1), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm5\n\t" /* Keep backup of pabove in xmm5 */ + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "punpckldq %%xmm1, %%xmm1\n\t" + "pshufb %%xmm3, %%xmm1\n\t" + "psadbw %%xmm0, %%xmm1\n\t" + "punpckhdq %%xmm2, %%xmm2\n\t" + "pshufb %%xmm3, %%xmm2\n\t" + "psadbw %%xmm0, %%xmm2\n\t" + "packuswb %%xmm2, %%xmm1\n\t" + "movdqa %%xmm1, %%xmm7\n\t" /* Backup of delta2 in xmm7 for now */ + + /* Next row */ + "add %4, %0\n\t" + "add %4, %1\n\t" + + /* Load pcurrent into xmm1 and pncurrent into xmm2 */ + "movdqa (%0), %%xmm1\n\t" + "movdqa (%1), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm6\n\t" /* Keep backup of pcurrent in xmm6 */ + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "punpckldq %%xmm1, %%xmm1\n\t" + "pshufb %%xmm3, %%xmm1\n\t" + "psadbw %%xmm0, %%xmm1\n\t" + "punpckhdq %%xmm2, %%xmm2\n\t" + "pshufb %%xmm3, %%xmm2\n\t" + "psadbw %%xmm0, %%xmm2\n\t" + "packuswb %%xmm2, %%xmm1\n\t" + + "pavgb %%xmm7, %%xmm1\n\t" // Average the two deltas together + +#if defined(__x86_64__) + "pcmpgtd %%xmm8, %%xmm1\n\t" // Compare average delta with the threshold +#else + "movd %%eax, %%xmm7\n\t" // Setup the threshold + "pshufd $0x0, %%xmm7, %%xmm7\n\t" + + "pcmpgtd %%xmm7, %%xmm1\n\t" // Compare average delta with the threshold +#endif + "pand %%xmm1, %%xmm5\n\t" // Filter out pixels in pabove that shouldn't be copied + "pandn %%xmm6, %%xmm1\n\t" // Filter out pixels in pcurrent that should be replaced + + "por %%xmm5, %%xmm1\n\t" // Put the new values in pcurrent + "movntdq %%xmm1, (%0)\n\t" // Write pcurrent + : + : "r" (col1), "r" (col2), "r" (max_ptr2), "r" (max_ptr), "r" (row_width), "m" (threshold_val), "m" (*movemask2) +#if defined(__x86_64__) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "%xmm8", "cc", "memory" +#else + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "cc", "memory" +#endif + ); +} + +/* ARGB SSSE3 */ +__attribute__((noinline,__target__("ssse3"))) void ssse3_deinterlace_4field_argb(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height) { + __attribute__((aligned(16))) static const uint8_t movemask2[16] = {2,2,2,2,2,1,1,3,10,10,10,10,10,9,9,11}; + + const uint32_t threshold_val = threshold; + + unsigned long row_width = width*4; + uint8_t* max_ptr = col1 + (row_width * (height-2)); + uint8_t* max_ptr2 = col1 + row_width; + + __asm__ __volatile__ ( + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "movdqa %6, %%xmm3\n\t" + "mov %5, %%eax\n\t" +#if defined(__x86_64__) + "movd %%eax, %%xmm8\n\t" + "pshufd $0x0, %%xmm8, %%xmm8\n\t" +#endif + /* Zero the temporary register */ + "pxor %%xmm0, %%xmm0\n\t" + + "algo_ssse3_deinterlace_4field_argb:\n\t" + + /* Load pabove into xmm1 and pnabove into xmm2 */ + "movdqa (%0), %%xmm1\n\t" + "movdqa (%1), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm5\n\t" /* Keep backup of pabove in xmm5 */ + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "punpckldq %%xmm1, %%xmm1\n\t" + "pshufb %%xmm3, %%xmm1\n\t" + "psadbw %%xmm0, %%xmm1\n\t" + "punpckhdq %%xmm2, %%xmm2\n\t" + "pshufb %%xmm3, %%xmm2\n\t" + "psadbw %%xmm0, %%xmm2\n\t" + "packuswb %%xmm2, %%xmm1\n\t" + "movdqa %%xmm1, %%xmm7\n\t" /* Backup of delta2 in xmm7 for now */ + + /* Next row */ + "add %4, %0\n\t" + "add %4, %1\n\t" + + /* Load pcurrent into xmm1 and pncurrent into xmm2 */ + "movdqa (%0), %%xmm1\n\t" + "movdqa (%1), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm6\n\t" /* Keep backup of pcurrent in xmm6 */ + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "punpckldq %%xmm1, %%xmm1\n\t" + "pshufb %%xmm3, %%xmm1\n\t" + "psadbw %%xmm0, %%xmm1\n\t" + "punpckhdq %%xmm2, %%xmm2\n\t" + "pshufb %%xmm3, %%xmm2\n\t" + "psadbw %%xmm0, %%xmm2\n\t" + "packuswb %%xmm2, %%xmm1\n\t" + + "pavgb %%xmm7, %%xmm1\n\t" // Average the two deltas together + +#if defined(__x86_64__) + "pcmpgtd %%xmm8, %%xmm1\n\t" // Compare average delta with the threshold +#else + "movd %%eax, %%xmm7\n\t" // Setup the threshold + "pshufd $0x0, %%xmm7, %%xmm7\n\t" + + "pcmpgtd %%xmm7, %%xmm1\n\t" // Compare average delta with the threshold +#endif + "movdqa (%0,%4), %%xmm2\n\t" // Load pbelow + "pavgb %%xmm5, %%xmm2\n\t" // Average pabove and pbelow + "pand %%xmm1, %%xmm2\n\t" // Filter out pixels in avg that shouldn't be copied + "pandn %%xmm6, %%xmm1\n\t" // Filter out pixels in pcurrent that should be replaced + + "por %%xmm2, %%xmm1\n\t" // Put the new values in pcurrent + "movntdq %%xmm1, (%0)\n\t" // Write pcurrent + + "sub %4, %0\n\t" // Restore pcurrent to pabove + "sub %4, %1\n\t" // Restore pncurrent to pnabove + + /* Next pixels */ + "add $0x10, %0\n\t" // Add 16 to pcurrent + "add $0x10, %1\n\t" // Add 16 to pncurrent + + /* Check if we reached the row end */ + "cmp %2, %0\n\t" + "jb algo_ssse3_deinterlace_4field_argb\n\t" // Go for another iteration + + /* Next row */ + "add %4, %0\n\t" // Add width to pcurrent + "add %4, %1\n\t" // Add width to pncurrent + "mov %0, %2\n\t" + "add %4, %2\n\t" // Add width to max_ptr2 + + /* Check if we reached the end */ + "cmp %3, %0\n\t" + "jb algo_ssse3_deinterlace_4field_argb\n\t" // Go for another iteration + + /* Special case for the last line */ + /* Load pabove into xmm1 and pnabove into xmm2 */ + "movdqa (%0), %%xmm1\n\t" + "movdqa (%1), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm5\n\t" /* Keep backup of pabove in xmm5 */ + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "punpckldq %%xmm1, %%xmm1\n\t" + "pshufb %%xmm3, %%xmm1\n\t" + "psadbw %%xmm0, %%xmm1\n\t" + "punpckhdq %%xmm2, %%xmm2\n\t" + "pshufb %%xmm3, %%xmm2\n\t" + "psadbw %%xmm0, %%xmm2\n\t" + "packuswb %%xmm2, %%xmm1\n\t" + "movdqa %%xmm1, %%xmm7\n\t" /* Backup of delta2 in xmm7 for now */ + + /* Next row */ + "add %4, %0\n\t" + "add %4, %1\n\t" + + /* Load pcurrent into xmm1 and pncurrent into xmm2 */ + "movdqa (%0), %%xmm1\n\t" + "movdqa (%1), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm6\n\t" /* Keep backup of pcurrent in xmm6 */ + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "punpckldq %%xmm1, %%xmm1\n\t" + "pshufb %%xmm3, %%xmm1\n\t" + "psadbw %%xmm0, %%xmm1\n\t" + "punpckhdq %%xmm2, %%xmm2\n\t" + "pshufb %%xmm3, %%xmm2\n\t" + "psadbw %%xmm0, %%xmm2\n\t" + "packuswb %%xmm2, %%xmm1\n\t" + + "pavgb %%xmm7, %%xmm1\n\t" // Average the two deltas together + +#if defined(__x86_64__) + "pcmpgtd %%xmm8, %%xmm1\n\t" // Compare average delta with the threshold +#else + "movd %%eax, %%xmm7\n\t" // Setup the threshold + "pshufd $0x0, %%xmm7, %%xmm7\n\t" + + "pcmpgtd %%xmm7, %%xmm1\n\t" // Compare average delta with the threshold +#endif + "pand %%xmm1, %%xmm5\n\t" // Filter out pixels in pabove that shouldn't be copied + "pandn %%xmm6, %%xmm1\n\t" // Filter out pixels in pcurrent that should be replaced + + "por %%xmm5, %%xmm1\n\t" // Put the new values in pcurrent + "movntdq %%xmm1, (%0)\n\t" // Write pcurrent + : + : "r" (col1), "r" (col2), "r" (max_ptr2), "r" (max_ptr), "r" (row_width), "m" (threshold_val), "m" (*movemask2) +#if defined(__x86_64__) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "%xmm8", "cc", "memory" +#else + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "cc", "memory" +#endif + ); +} + +/* ABGR SSSE3 */ +__attribute__((noinline,__target__("ssse3"))) void ssse3_deinterlace_4field_abgr(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height) { + __attribute__((aligned(16))) static const uint8_t movemask2[16] = {2,2,2,2,2,3,3,1,10,10,10,10,10,11,11,9}; + + const uint32_t threshold_val = threshold; + + unsigned long row_width = width*4; + uint8_t* max_ptr = col1 + (row_width * (height-2)); + uint8_t* max_ptr2 = col1 + row_width; + + __asm__ __volatile__ ( + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "movdqa %6, %%xmm3\n\t" + "mov %5, %%eax\n\t" +#if defined(__x86_64__) + "movd %%eax, %%xmm8\n\t" + "pshufd $0x0, %%xmm8, %%xmm8\n\t" +#endif + /* Zero the temporary register */ + "pxor %%xmm0, %%xmm0\n\t" + + "algo_ssse3_deinterlace_4field_abgr:\n\t" + + /* Load pabove into xmm1 and pnabove into xmm2 */ + "movdqa (%0), %%xmm1\n\t" + "movdqa (%1), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm5\n\t" /* Keep backup of pabove in xmm5 */ + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "punpckldq %%xmm1, %%xmm1\n\t" + "pshufb %%xmm3, %%xmm1\n\t" + "psadbw %%xmm0, %%xmm1\n\t" + "punpckhdq %%xmm2, %%xmm2\n\t" + "pshufb %%xmm3, %%xmm2\n\t" + "psadbw %%xmm0, %%xmm2\n\t" + "packuswb %%xmm2, %%xmm1\n\t" + "movdqa %%xmm1, %%xmm7\n\t" /* Backup of delta2 in xmm7 for now */ + + /* Next row */ + "add %4, %0\n\t" + "add %4, %1\n\t" + + /* Load pcurrent into xmm1 and pncurrent into xmm2 */ + "movdqa (%0), %%xmm1\n\t" + "movdqa (%1), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm6\n\t" /* Keep backup of pcurrent in xmm6 */ + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "punpckldq %%xmm1, %%xmm1\n\t" + "pshufb %%xmm3, %%xmm1\n\t" + "psadbw %%xmm0, %%xmm1\n\t" + "punpckhdq %%xmm2, %%xmm2\n\t" + "pshufb %%xmm3, %%xmm2\n\t" + "psadbw %%xmm0, %%xmm2\n\t" + "packuswb %%xmm2, %%xmm1\n\t" + + "pavgb %%xmm7, %%xmm1\n\t" // Average the two deltas together + +#if defined(__x86_64__) + "pcmpgtd %%xmm8, %%xmm1\n\t" // Compare average delta with the threshold +#else + "movd %%eax, %%xmm7\n\t" // Setup the threshold + "pshufd $0x0, %%xmm7, %%xmm7\n\t" + + "pcmpgtd %%xmm7, %%xmm1\n\t" // Compare average delta with the threshold +#endif + "movdqa (%0,%4), %%xmm2\n\t" // Load pbelow + "pavgb %%xmm5, %%xmm2\n\t" // Average pabove and pbelow + "pand %%xmm1, %%xmm2\n\t" // Filter out pixels in avg that shouldn't be copied + "pandn %%xmm6, %%xmm1\n\t" // Filter out pixels in pcurrent that should be replaced + + "por %%xmm2, %%xmm1\n\t" // Put the new values in pcurrent + "movntdq %%xmm1, (%0)\n\t" // Write pcurrent + + "sub %4, %0\n\t" // Restore pcurrent to pabove + "sub %4, %1\n\t" // Restore pncurrent to pnabove + + /* Next pixels */ + "add $0x10, %0\n\t" // Add 16 to pcurrent + "add $0x10, %1\n\t" // Add 16 to pncurrent + + /* Check if we reached the row end */ + "cmp %2, %0\n\t" + "jb algo_ssse3_deinterlace_4field_abgr\n\t" // Go for another iteration + + /* Next row */ + "add %4, %0\n\t" // Add width to pcurrent + "add %4, %1\n\t" // Add width to pncurrent + "mov %0, %2\n\t" + "add %4, %2\n\t" // Add width to max_ptr2 + + /* Check if we reached the end */ + "cmp %3, %0\n\t" + "jb algo_ssse3_deinterlace_4field_abgr\n\t" // Go for another iteration + + /* Special case for the last line */ + /* Load pabove into xmm1 and pnabove into xmm2 */ + "movdqa (%0), %%xmm1\n\t" + "movdqa (%1), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm5\n\t" /* Keep backup of pabove in xmm5 */ + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "punpckldq %%xmm1, %%xmm1\n\t" + "pshufb %%xmm3, %%xmm1\n\t" + "psadbw %%xmm0, %%xmm1\n\t" + "punpckhdq %%xmm2, %%xmm2\n\t" + "pshufb %%xmm3, %%xmm2\n\t" + "psadbw %%xmm0, %%xmm2\n\t" + "packuswb %%xmm2, %%xmm1\n\t" + "movdqa %%xmm1, %%xmm7\n\t" /* Backup of delta2 in xmm7 for now */ + + /* Next row */ + "add %4, %0\n\t" + "add %4, %1\n\t" + + /* Load pcurrent into xmm1 and pncurrent into xmm2 */ + "movdqa (%0), %%xmm1\n\t" + "movdqa (%1), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm6\n\t" /* Keep backup of pcurrent in xmm6 */ + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "punpckldq %%xmm1, %%xmm1\n\t" + "pshufb %%xmm3, %%xmm1\n\t" + "psadbw %%xmm0, %%xmm1\n\t" + "punpckhdq %%xmm2, %%xmm2\n\t" + "pshufb %%xmm3, %%xmm2\n\t" + "psadbw %%xmm0, %%xmm2\n\t" + "packuswb %%xmm2, %%xmm1\n\t" + + "pavgb %%xmm7, %%xmm1\n\t" // Average the two deltas together + +#if defined(__x86_64__) + "pcmpgtd %%xmm8, %%xmm1\n\t" // Compare average delta with the threshold +#else + "movd %%eax, %%xmm7\n\t" // Setup the threshold + "pshufd $0x0, %%xmm7, %%xmm7\n\t" + + "pcmpgtd %%xmm7, %%xmm1\n\t" // Compare average delta with the threshold +#endif + "pand %%xmm1, %%xmm5\n\t" // Filter out pixels in pabove that shouldn't be copied + "pandn %%xmm6, %%xmm1\n\t" // Filter out pixels in pcurrent that should be replaced + + "por %%xmm5, %%xmm1\n\t" // Put the new values in pcurrent + "movntdq %%xmm1, (%0)\n\t" // Write pcurrent + : + : "r" (col1), "r" (col2), "r" (max_ptr2), "r" (max_ptr), "r" (row_width), "m" (threshold_val), "m" (*movemask2) +#if defined(__x86_64__) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "%xmm8", "cc", "memory" +#else + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "cc", "memory" +#endif + ); +} + diff --git a/src/zm_image.h b/src/zm_image.h new file mode 100644 index 000000000..c6ffd2a54 --- /dev/null +++ b/src/zm_image.h @@ -0,0 +1,308 @@ +// +// ZoneMinder Image Class Interface, $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. +// + +#ifndef ZM_IMAGE_H +#define ZM_IMAGE_H + +#include "zm.h" +extern "C" +{ +#include "zm_jpeg.h" +} +#include "zm_rgb.h" +#include "zm_coord.h" +#include "zm_box.h" +#include "zm_poly.h" +#include "zm_mem_utils.h" +#include "zm_utils.h" + +#include + +#if HAVE_ZLIB_H +#include +#endif // HAVE_ZLIB_H + +#define ZM_BUFTYPE_DONTFREE 0 +#define ZM_BUFTYPE_MALLOC 1 +#define ZM_BUFTYPE_NEW 2 +#define ZM_BUFTYPE_AVMALLOC 3 +#define ZM_BUFTYPE_ZM 4 + +typedef void (*blend_fptr_t)(const uint8_t*, const uint8_t*, uint8_t*, unsigned long, double); +typedef void (*delta_fptr_t)(const uint8_t*, const uint8_t*, uint8_t*, unsigned long); +typedef void (*convert_fptr_t)(const uint8_t*, uint8_t*, unsigned long); +typedef void (*deinterlace_4field_fptr_t)(uint8_t*, uint8_t*, unsigned int, unsigned int, unsigned int); +typedef void* (*imgbufcpy_fptr_t)(void*, const void*, size_t); + +extern imgbufcpy_fptr_t fptr_imgbufcpy; + +/* Should be called from Image class functions */ +inline static uint8_t* AllocBuffer(size_t p_bufsize) { + uint8_t* buffer = (uint8_t*)zm_mallocaligned(16,p_bufsize); + if(buffer == NULL) + Fatal("Memory allocation failed: %s",strerror(errno)); + + return buffer; +} + +inline static void DumpBuffer(uint8_t* buffer, int buffertype) { + if (buffer && buffertype != ZM_BUFTYPE_DONTFREE) { + if(buffertype == ZM_BUFTYPE_ZM) + zm_freealigned(buffer); + else if(buffertype == ZM_BUFTYPE_MALLOC) + free(buffer); + else if(buffertype == ZM_BUFTYPE_NEW) + delete buffer; + /*else if(buffertype == ZM_BUFTYPE_AVMALLOC) + av_free(buffer); + */ + } +} + + +// +// This is image class, and represents a frame captured from a +// camera in raw form. +// +class Image +{ +protected: + + struct Edge + { + int min_y; + int max_y; + double min_x; + double _1_m; + + static int CompareYX( const void *p1, const void *p2 ) + { + const Edge *e1 = (const Edge *)p1, *e2 = (const Edge *)p2; + if ( e1->min_y == e2->min_y ) + return( int(e1->min_x - e2->min_x) ); + else + return( int(e1->min_y - e2->min_y) ); + } + static int CompareX( const void *p1, const void *p2 ) + { + const Edge *e1 = (const Edge *)p1, *e2 = (const Edge *)p2; + return( int(e1->min_x - e2->min_x) ); + } + }; + + inline void DumpImgBuffer() { + DumpBuffer(buffer,buffertype); + buffer = NULL; + allocation = 0; + } + + inline void AllocImgBuffer(size_t p_bufsize) { + if(buffer) + DumpImgBuffer(); + + buffer = AllocBuffer(p_bufsize); + buffertype = ZM_BUFTYPE_ZM; + allocation = p_bufsize; + } + +public: + enum { CHAR_HEIGHT=11, CHAR_WIDTH=6 }; + enum { LINE_HEIGHT=CHAR_HEIGHT+0 }; + +protected: + static bool initialised; + static unsigned char *abs_table; + static unsigned char *y_r_table; + static unsigned char *y_g_table; + static unsigned char *y_b_table; + static jpeg_compress_struct *jpg_ccinfo[101]; + static jpeg_decompress_struct *jpg_dcinfo; + static struct zm_error_mgr jpg_err; + +protected: + int width; + int height; + int pixels; + int colours; + int size; + int subpixelorder; + unsigned long allocation; + uint8_t *buffer; + int buffertype; /* 0=not ours, no need to call free(), 1=malloc() buffer, 2=new buffer */ + int holdbuffer; /* Hold the buffer instead of replacing it with new one */ + char text[1024]; + +protected: + static void Initialise(); + +public: + Image(); + Image( const char *filename ); + Image( int p_width, int p_height, int p_colours, int p_subpixelorder, uint8_t *p_buffer=0); + Image( const Image &p_image ); + ~Image(); + + inline int Width() const { return( width ); } + inline int Height() const { return( height ); } + inline int Pixels() const { return( pixels ); } + inline int Colours() const { return( colours ); } + inline int SubpixelOrder() const { return( subpixelorder ); } + inline int Size() const { return( size ); } + + /* Internal buffer should not be modified from functions outside of this class */ + inline const uint8_t* Buffer() const { return( buffer ); } + inline const uint8_t* Buffer( unsigned int x, unsigned int y= 0 ) const { return( &buffer[colours*((y*width)+x)] ); } + /* Request writeable buffer */ + uint8_t* WriteBuffer(const int p_width, const int p_height, const int p_colours, const int p_subpixelorder); + + inline int IsBufferHeld() const { return holdbuffer; } + inline void HoldBuffer(int tohold) { holdbuffer = tohold; } + + inline void Empty() { + if(!holdbuffer) + DumpImgBuffer(); + + width = height = colours = size = pixels = subpixelorder = 0; + } + + void Assign( int p_width, int p_height, int p_colours, int p_subpixelorder, const uint8_t* new_buffer, const size_t buffer_size); + void Assign( const Image &image ); + void AssignDirect( const int p_width, const int p_height, const int p_colours, const int p_subpixelorder, uint8_t *new_buffer, const size_t buffer_size, const int p_buffertype); + + inline void CopyBuffer( const Image &image ) + { + if ( image.size != size ) + { + Panic( "Attempt to copy different size image buffers, expected %d, got %d", size, image.size ); + } + (*fptr_imgbufcpy)(buffer, image.buffer, size); + } + inline Image &operator=( const unsigned char *new_buffer ) + { + (*fptr_imgbufcpy)(buffer, new_buffer, size); + return( *this ); + } + + bool ReadRaw( const char *filename ); + bool WriteRaw( const char *filename ) const; + + bool ReadJpeg( const char *filename, int p_colours, int p_subpixelorder); + bool WriteJpeg( const char *filename, int quality_override=0 ) const; + bool DecodeJpeg( const JOCTET *inbuffer, int inbuffer_size, int p_colours, int p_subpixelorder); + bool EncodeJpeg( JOCTET *outbuffer, int *outbuffer_size, int quality_override=0 ) const; + +#if HAVE_ZLIB_H + bool Unzip( const Bytef *inbuffer, unsigned long inbuffer_size ); + bool Zip( Bytef *outbuffer, unsigned long *outbuffer_size, int compression_level=Z_BEST_SPEED ) const; +#endif // HAVE_ZLIB_H + + bool Crop( int lo_x, int lo_y, int hi_x, int hi_y ); + bool Crop( const Box &limits ); + + void Overlay( const Image &image ); + void Overlay( const Image &image, int x, int y ); + void Blend( const Image &image, int transparency=12 ); + static Image *Merge( int n_images, Image *images[] ); + static Image *Merge( int n_images, Image *images[], double weight ); + static Image *Highlight( int n_images, Image *images[], const Rgb threshold=RGB_BLACK, const Rgb ref_colour=RGB_RED ); + //Image *Delta( const Image &image ) const; + void Delta( const Image &image, Image* targetimage) const; + + const Coord centreCoord( const char *text ) const; + void Annotate( const char *p_text, const Coord &coord, const Rgb fg_colour=RGB_WHITE, const Rgb bg_colour=RGB_BLACK ); + Image *HighlightEdges( Rgb colour, int p_colours, int p_subpixelorder, const Box *limits=0 ); + //Image *HighlightEdges( Rgb colour, const Polygon &polygon ); + void Timestamp( const char *label, const time_t when, const Coord &coord ); + void Colourise(const int p_reqcolours, const int p_reqsubpixelorder); + void DeColourise(); + + void Clear() { memset( buffer, 0, size ); } + void Fill( Rgb colour, const Box *limits=0 ); + void Fill( Rgb colour, int density, const Box *limits=0 ); + void Outline( Rgb colour, const Polygon &polygon ); + void Fill( Rgb colour, const Polygon &polygon ); + void Fill( Rgb colour, int density, const Polygon &polygon ); + + void Rotate( int angle ); + void Flip( bool leftright ); + void Scale( unsigned int factor ); + + void Deinterlace_Discard(); + void Deinterlace_Linear(); + void Deinterlace_Blend(); + void Deinterlace_Blend_CustomRatio(int divider); + void Deinterlace_4Field(const Image* next_image, unsigned int threshold); + +}; + +#endif // ZM_IMAGE_H + +/* Blend functions */ +void sse2_fastblend(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count, double blendpercent); +void std_fastblend(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count, double blendpercent); +void std_blend(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count, double blendpercent); + +/* Delta functions */ +void std_delta8_gray8(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count); +void std_delta8_rgb(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count); +void std_delta8_bgr(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count); +void std_delta8_rgba(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count); +void std_delta8_bgra(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count); +void std_delta8_argb(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count); +void std_delta8_abgr(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count); +void sse2_delta8_gray8(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count); +void sse2_delta8_rgba(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count); +void sse2_delta8_bgra(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count); +void sse2_delta8_argb(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count); +void sse2_delta8_abgr(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count); +void ssse3_delta8_rgba(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count); +void ssse3_delta8_bgra(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count); +void ssse3_delta8_argb(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count); +void ssse3_delta8_abgr(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count); + +/* Convert functions */ +void std_convert_rgb_gray8(const uint8_t* col1, uint8_t* result, unsigned long count); +void std_convert_bgr_gray8(const uint8_t* col1, uint8_t* result, unsigned long count); +void std_convert_rgba_gray8(const uint8_t* col1, uint8_t* result, unsigned long count); +void std_convert_bgra_gray8(const uint8_t* col1, uint8_t* result, unsigned long count); +void std_convert_argb_gray8(const uint8_t* col1, uint8_t* result, unsigned long count); +void std_convert_abgr_gray8(const uint8_t* col1, uint8_t* result, unsigned long count); +void std_convert_yuyv_gray8(const uint8_t* col1, uint8_t* result, unsigned long count); +void ssse3_convert_rgba_gray8(const uint8_t* col1, uint8_t* result, unsigned long count); +void ssse3_convert_yuyv_gray8(const uint8_t* col1, uint8_t* result, unsigned long count); +void zm_convert_yuyv_rgb(const uint8_t* col1, uint8_t* result, unsigned long count); +void zm_convert_yuyv_rgba(const uint8_t* col1, uint8_t* result, unsigned long count); +void zm_convert_rgb555_rgb(const uint8_t* col1, uint8_t* result, unsigned long count); +void zm_convert_rgb555_rgba(const uint8_t* col1, uint8_t* result, unsigned long count); +void zm_convert_rgb565_rgb(const uint8_t* col1, uint8_t* result, unsigned long count); +void zm_convert_rgb565_rgba(const uint8_t* col1, uint8_t* result, unsigned long count); + +/* Deinterlace_4Field functions */ +void std_deinterlace_4field_gray8(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height); +void std_deinterlace_4field_rgb(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height); +void std_deinterlace_4field_bgr(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height); +void std_deinterlace_4field_rgba(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height); +void std_deinterlace_4field_bgra(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height); +void std_deinterlace_4field_argb(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height); +void std_deinterlace_4field_abgr(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height); +void ssse3_deinterlace_4field_gray8(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height); +void ssse3_deinterlace_4field_rgba(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height); +void ssse3_deinterlace_4field_bgra(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height); +void ssse3_deinterlace_4field_argb(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height); +void ssse3_deinterlace_4field_abgr(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height); diff --git a/src/zm_image_analyser.cpp b/src/zm_image_analyser.cpp new file mode 100644 index 000000000..ee598a5a6 --- /dev/null +++ b/src/zm_image_analyser.cpp @@ -0,0 +1,87 @@ +#include "zm_image_analyser.h" + + + +/*!\fn ImageAnalyser::ImageAnalyser(const ImageAnalyser& source) + * \param source is the object to copy + */ +ImageAnalyser::ImageAnalyser(const ImageAnalyser& source) +{ + m_Detectors = source.m_Detectors; +} + + + +/*!\fn ImageAnalyser::operator=(const ImageAnalyser& source) + * \param source is the object to copy + */ +ImageAnalyser& ImageAnalyser::operator=(const ImageAnalyser& source) +{ + m_Detectors = source.m_Detectors; + return *this; +} + + + +ImageAnalyser::~ImageAnalyser() +{ + for(DetectorsList::reverse_iterator It = m_Detectors.rbegin(); + It != m_Detectors.rend(); + ++It) + delete *It; +} + + + +/*!\fn ImageAnalyser::DoDetection(const Image &comp_image, Zone** zones, int n_numZones, Event::StringSetMap noteSetMap, std::string& det_cause) + * \param comp_image is the image to analyse + * \param zones is the zones array to analyse + * \param n_numZones is the number of zones + * \param noteSetMap is the map of events descriptions + * \param det_cause is a string describing detection cause + */ +int ImageAnalyser::DoDetection(const Image &comp_image, Zone** zones, int n_numZones, Event::StringSetMap noteSetMap, std::string& det_cause) +{ + Event::StringSet zoneSet; + int score = 0; + + for(DetectorsList::iterator It = m_Detectors.begin(); + It != m_Detectors.end(); + ++It) + { + int detect_score = (*It)->Detect(comp_image, zones, n_numZones, zoneSet); + if (detect_score) + { + score += detect_score; + noteSetMap[(*It)->getDetectionCause()] = zoneSet; + if (det_cause.length()) + det_cause += ", "; + det_cause += (*It)->getDetectionCause(); + } + } + return score; +} + + + +/*!\fn ImageAnalyser::configurePlugins(string sConfigFileName) + * \param sConfigFileName is the path to the configuration file, where parameters for all plugins are given. + */ +void ImageAnalyser::configurePlugins(string sConfigFileName) +{ + for(DetectorsList::iterator It = m_Detectors.begin(); + It != m_Detectors.end(); + ++It) + { + try + { + (*It)->loadConfig(sConfigFileName); + } + catch(...) + { + //Info("ERROR: Plugin \"%s\" couldn\'t load config file \"%s\".", (*It)->getDetectionCause().c_str(), sConfigFileName.c_str()); + Info("ERROR: Plugin couldn\'t load config file ."); + } + } + +} diff --git a/src/zm_image_analyser.h b/src/zm_image_analyser.h new file mode 100644 index 000000000..644e97fbf --- /dev/null +++ b/src/zm_image_analyser.h @@ -0,0 +1,65 @@ +#ifndef ZM_IMAGE_ANALYSER_H +#define ZM_IMAGE_ANALYSER_H + + + +#include +#include +#include +#include +#include + +#include "zm.h" +#include "zm_detector.h" +#include "zm_image.h" +#include "zm_zone.h" +#include "zm_event.h" + + + +using namespace std; + + +//! List of available detectors. +typedef std::list DetectorsList; + + +//! Class for handling image detection. +/*! Contains all detectors loaded from plugins. + */ +class ImageAnalyser { + public: + + //!Default constructor. + ImageAnalyser() {}; + + //! Destructor. + ~ImageAnalyser(); + + //! Copy constructor. + ImageAnalyser(const ImageAnalyser& source); + + //! Overloaded operator=. + ImageAnalyser& operator=(const ImageAnalyser& source); + + //! Adds new plugin's detector to the list of detectors. + void addDetector(std::auto_ptr Det) + { + m_Detectors.push_back(Det.release()); + } + + //! Do detection in an image by calling all available detectors. + int DoDetection(const Image &comp_image, Zone** zones, int n_numZones, Event::StringSetMap noteSetMap, std::string& det_cause); + + //! Configure all loaded plugins using given configuration file. + void configurePlugins(string sConfigFileName); + +private: + + //! All available detectors. + DetectorsList m_Detectors; +}; + + + +#endif //ZM_IMAGE_ANALYSER_H diff --git a/src/zm_jpeg.cpp b/src/zm_jpeg.cpp new file mode 100644 index 000000000..58c3ca5be --- /dev/null +++ b/src/zm_jpeg.cpp @@ -0,0 +1,466 @@ +/* + * ZoneMinder JPEG memory encoding/decoding, $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. +*/ + +#include "zm_jpeg.h" +#include "zm_logger.h" + +#include + +/* Overridden error handlers, mostly for decompression */ +extern "C" +{ + +#define MAX_JPEG_ERRS 25 + +static int jpeg_err_count = 0; + +void zm_jpeg_error_exit( j_common_ptr cinfo ) +{ + static char buffer[JMSG_LENGTH_MAX]; + zm_error_ptr zmerr = (zm_error_ptr)cinfo->err; + + (zmerr->pub.format_message)( cinfo, buffer ); + + Error( "%s", buffer ); + if ( ++jpeg_err_count == MAX_JPEG_ERRS ) + { + Fatal( "Maximum number (%d) of JPEG errors reached, exiting", jpeg_err_count ); + } + + longjmp( zmerr->setjmp_buffer, 1 ); +} + +void zm_jpeg_emit_message( j_common_ptr cinfo, int msg_level ) +{ + static char buffer[JMSG_LENGTH_MAX]; + zm_error_ptr zmerr = (zm_error_ptr)cinfo->err; + + if ( msg_level < 0 ) + { + /* It's a warning message. Since corrupt files may generate many warnings, + * the policy implemented here is to show only the first warning, + * unless trace_level >= 3. + */ + if ( zmerr->pub.num_warnings == 0 || zmerr->pub.trace_level >= 3 ) + { + (zmerr->pub.format_message)( cinfo, buffer ); + Warning( "%s", buffer ); + } + /* Always count warnings in num_warnings. */ + zmerr->pub.num_warnings++; + } + else + { + /* It's a trace message. Show it if trace_level >= msg_level. */ + if ( zmerr->pub.trace_level >= msg_level ) + { + (zmerr->pub.format_message)( cinfo, buffer ); + Debug( msg_level, "%s", buffer ); + } + } +} + +/* Expanded data destination object for memory */ + +typedef struct +{ + struct jpeg_destination_mgr pub; /* public fields */ + + JOCTET *outbuffer; /* target buffer */ + int *outbuffer_size; + JOCTET *buffer; /* start of buffer */ +} mem_destination_mgr; + +typedef mem_destination_mgr * mem_dest_ptr; + +#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */ + +/* + * Initialize destination --- called by jpeg_start_compress + * before any data is actually written. + */ + +static void init_destination (j_compress_ptr cinfo) +{ + mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest; + + /* Allocate the output buffer --- it will be released when done with image */ + dest->buffer = (JOCTET *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, OUTPUT_BUF_SIZE * SIZEOF(JOCTET)); + + dest->pub.next_output_byte = dest->buffer; + dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; + + *(dest->outbuffer_size) = 0; +} + + +/* + * Empty the output buffer --- called whenever buffer fills up. + * + * In typical applications, this should write the entire output buffer + * (ignoring the current state of next_output_byte & free_in_buffer), + * reset the pointer & count to the start of the buffer, and return TRUE + * indicating that the buffer has been dumped. + * + * In applications that need to be able to suspend compression due to output + * overrun, a FALSE return indicates that the buffer cannot be emptied now. + * In this situation, the compressor will return to its caller (possibly with + * an indication that it has not accepted all the supplied scanlines). The + * application should resume compression after it has made more room in the + * output buffer. Note that there are substantial restrictions on the use of + * suspension --- see the documentation. + * + * When suspending, the compressor will back up to a convenient restart point + * (typically the start of the current MCU). next_output_byte & free_in_buffer + * indicate where the restart point will be if the current call returns FALSE. + * Data beyond this point will be regenerated after resumption, so do not + * write it out when emptying the buffer externally. + */ + +static boolean empty_output_buffer (j_compress_ptr cinfo) +{ + mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest; + + memcpy( dest->outbuffer+*(dest->outbuffer_size), dest->buffer, OUTPUT_BUF_SIZE ); + *(dest->outbuffer_size) += OUTPUT_BUF_SIZE; + + dest->pub.next_output_byte = dest->buffer; + dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; + + return( TRUE ); +} + +/* + * Terminate destination --- called by jpeg_finish_compress + * after all data has been written. Usually needs to flush buffer. + * + * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding + * application must deal with any cleanup that should happen even + * for error exit. + */ + +static void term_destination (j_compress_ptr cinfo) +{ + mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest; + size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer; + + if ( datacount > 0 ) + { + memcpy( dest->outbuffer+*(dest->outbuffer_size), dest->buffer, datacount ); + *(dest->outbuffer_size) += datacount; + } +} + + +/* + * Prepare for output to a stdio stream. + * The caller must have already opened the stream, and is responsible + * for closing it after finishing compression. + */ + +void zm_jpeg_mem_dest (j_compress_ptr cinfo, JOCTET *outbuffer, int *outbuffer_size ) +{ + mem_dest_ptr dest; + + /* The destination object is made permanent so that multiple JPEG images + * can be written to the same file without re-executing jpeg_stdio_dest. + * This makes it dangerous to use this manager and a different destination + * manager serially with the same JPEG object, because their private object + * sizes may be different. Caveat programmer. + */ + if ( cinfo->dest == NULL ) + { + /* first time for this JPEG object? */ + cinfo->dest = (struct jpeg_destination_mgr *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(mem_destination_mgr)); + } + + dest = (mem_dest_ptr) cinfo->dest; + dest->pub.init_destination = init_destination; + dest->pub.empty_output_buffer = empty_output_buffer; + dest->pub.term_destination = term_destination; + dest->outbuffer = outbuffer; + dest->outbuffer_size = outbuffer_size; +} + +/* Expanded data source object for memory input */ + +typedef struct +{ + struct jpeg_source_mgr pub; /* public fields */ + + JOCTET * inbuffer; /* source stream */ + int inbuffer_size; + int inbuffer_size_hwm; /* High water mark */ + + JOCTET * buffer; /* start of buffer */ + boolean start_of_data; /* have we gotten any data yet? */ +} mem_source_mgr; + +typedef mem_source_mgr * mem_src_ptr; + +#define INPUT_BUF_SIZE 4096 /* choose an efficiently fread'able size */ + +/* + * Initialize source --- called by jpeg_read_header + * before any data is actually read. + */ + +static void init_source (j_decompress_ptr cinfo) +{ + mem_src_ptr src = (mem_src_ptr) cinfo->src; + + /* We reset the empty-input-file flag for each image, + * but we don't clear the input buffer. + * This is correct behavior for reading a series of images from one source. + */ + src->start_of_data = TRUE; + src->pub.bytes_in_buffer = 0; +} + + +/* + * Fill the input buffer --- called whenever buffer is emptied. + * + * In typical applications, this should read fresh data into the buffer + * (ignoring the current state of next_input_byte & bytes_in_buffer), + * reset the pointer & count to the start of the buffer, and return TRUE + * indicating that the buffer has been reloaded. It is not necessary to + * fill the buffer entirely, only to obtain at least one more byte. + * + * There is no such thing as an EOF return. If the end of the file has been + * reached, the routine has a choice of ERREXIT() or inserting fake data into + * the buffer. In most cases, generating a warning message and inserting a + * fake EOI marker is the best course of action --- this will allow the + * decompressor to output however much of the image is there. However, + * the resulting error message is misleading if the real problem is an empty + * input file, so we handle that case specially. + * + * In applications that need to be able to suspend compression due to input + * not being available yet, a FALSE return indicates that no more data can be + * obtained right now, but more may be forthcoming later. In this situation, + * the decompressor will return to its caller (with an indication of the + * number of scanlines it has read, if any). The application should resume + * decompression after it has loaded more data into the input buffer. Note + * that there are substantial restrictions on the use of suspension --- see + * the documentation. + * + * When suspending, the decompressor will back up to a convenient restart point + * (typically the start of the current MCU). next_input_byte & bytes_in_buffer + * indicate where the restart point will be if the current call returns FALSE. + * Data beyond this point must be rescanned after resumption, so move it to + * the front of the buffer rather than discarding it. + */ + +static boolean fill_input_buffer (j_decompress_ptr cinfo) +{ + mem_src_ptr src = (mem_src_ptr) cinfo->src; + size_t nbytes; + + memcpy( src->buffer, src->inbuffer, (size_t) src->inbuffer_size ); + nbytes = src->inbuffer_size; + + if ( nbytes <= 0 ) + { + if ( src->start_of_data ) /* Treat empty input file as fatal error */ + ERREXIT(cinfo, JERR_INPUT_EMPTY); + WARNMS(cinfo, JWRN_JPEG_EOF); + /* Insert a fake EOI marker */ + src->buffer[0] = (JOCTET) 0xFF; + src->buffer[1] = (JOCTET) JPEG_EOI; + nbytes = 2; + } + + src->pub.next_input_byte = src->buffer; + src->pub.bytes_in_buffer = nbytes; + src->start_of_data = FALSE; + + return( TRUE ); +} + + +/* + * Skip data --- used to skip over a potentially large amount of + * uninteresting data (such as an APPn marker). + * + * Writers of suspendable-input applications must note that skip_input_data + * is not granted the right to give a suspension return. If the skip extends + * beyond the data currently in the buffer, the buffer can be marked empty so + * that the next read will cause a fill_input_buffer call that can suspend. + * Arranging for additional bytes to be discarded before reloading the input + * buffer is the application writer's problem. + */ + +static void skip_input_data (j_decompress_ptr cinfo, long num_bytes) +{ + mem_src_ptr src = (mem_src_ptr) cinfo->src; + + /* Just a dumb implementation for now. Could use fseek() except + * it doesn't work on pipes. Not clear that being smart is worth + * any trouble anyway --- large skips are infrequent. + */ + if ( num_bytes > 0 ) + { + while ( num_bytes > (long) src->pub.bytes_in_buffer ) + { + num_bytes -= (long) src->pub.bytes_in_buffer; + (void) fill_input_buffer(cinfo); + /* note we assume that fill_input_buffer will never return FALSE, + * so suspension need not be handled. + */ + } + src->pub.next_input_byte += (size_t) num_bytes; + src->pub.bytes_in_buffer -= (size_t) num_bytes; + } +} + + +/* + * Terminate source --- called by jpeg_finish_decompress + * after all data has been read. Often a no-op. + * + * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding + * application must deal with any cleanup that should happen even + * for error exit. + */ + +static void term_source (j_decompress_ptr cinfo) +{ + /* no work necessary here */ +} + + +/* + * Prepare for input from a memory stream. + * The caller must have already opened the stream, and is responsible + * for closing it after finishing decompression. + */ + +void zm_jpeg_mem_src( j_decompress_ptr cinfo, const JOCTET *inbuffer, int inbuffer_size ) +{ + mem_src_ptr src; + + /* The source object and input buffer are made permanent so that a series + * of JPEG images can be read from the same file by calling zm_jpeg_mem_src + * only before the first one. (If we discarded the buffer at the end of + * one image, we'd likely lose the start of the next one.) + * This makes it unsafe to use this manager and a different source + * manager serially with the same JPEG object. Caveat programmer. + */ + if ( cinfo->src == NULL ) + { + /* first time for this JPEG object? */ + cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(mem_source_mgr)); + src = (mem_src_ptr) cinfo->src; + src->buffer = (JOCTET *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, inbuffer_size * SIZEOF(JOCTET)); + src->inbuffer_size_hwm = inbuffer_size; + } + else + { + src = (mem_src_ptr) cinfo->src; + if ( src->inbuffer_size_hwm < inbuffer_size ) + { + src->buffer = (JOCTET *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, inbuffer_size * SIZEOF(JOCTET)); + src->inbuffer_size_hwm = inbuffer_size; + } + } + + src = (mem_src_ptr) cinfo->src; + src->pub.init_source = init_source; + src->pub.fill_input_buffer = fill_input_buffer; + src->pub.skip_input_data = skip_input_data; + src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ + src->pub.term_source = term_source; + src->inbuffer = (JOCTET *)inbuffer; + src->inbuffer_size = inbuffer_size; + src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ + src->pub.next_input_byte = NULL; /* until buffer loaded */ +} + +void zm_use_std_huff_tables( j_decompress_ptr cinfo ) { + /* JPEG standard Huffman tables (cf. JPEG standard section K.3) */ + /* IMPORTANT: these are only valid for 8-bit data precision! */ + static const JHUFF_TBL dclumin = { + { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, + 0 + }; + static const JHUFF_TBL dcchrome = { + { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, + 0 + }; + static const JHUFF_TBL aclumin = { + { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d }, + { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, + 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, + 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, + 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, + 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, + 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, + 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, + 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, + 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, + 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, + 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, + 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, + 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, + 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, + 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, + 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, + 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, + 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, + 0xf9, 0xfa }, + 0 + }; + static const JHUFF_TBL acchrome = { + { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 }, + { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, + 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, + 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, + 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, + 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, + 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, + 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, + 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, + 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, + 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, + 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, + 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, + 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, + 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, + 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, + 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, + 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, + 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, + 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, + 0xf9, 0xfa }, + 0 + }; + + cinfo->dc_huff_tbl_ptrs[0] = (JHUFF_TBL*)&dclumin; + cinfo->dc_huff_tbl_ptrs[1] = (JHUFF_TBL*)&dcchrome; + cinfo->ac_huff_tbl_ptrs[0] = (JHUFF_TBL*)&aclumin; + cinfo->ac_huff_tbl_ptrs[1] = (JHUFF_TBL*)&acchrome; + +} + +} diff --git a/src/zm_jpeg.h b/src/zm_jpeg.h new file mode 100644 index 000000000..b4bec52b2 --- /dev/null +++ b/src/zm_jpeg.h @@ -0,0 +1,50 @@ +/* + * ZoneMinder Jpeg Interface, $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. +*/ + + +#include + +#include "jinclude.h" +#include "jpeglib.h" +#include "jerror.h" + +// Stop complaints about deuplicate definitions +#undef HAVE_STDLIB_H +#undef HAVE_STDDEF_H + +extern "C" +{ +/* Stuff for overriden error handlers */ +struct zm_error_mgr +{ + struct jpeg_error_mgr pub; + jmp_buf setjmp_buffer; +}; + +typedef struct zm_error_mgr *zm_error_ptr; + +void zm_jpeg_error_exit( j_common_ptr cinfo ); +void zm_jpeg_emit_message( j_common_ptr cinfo, int msg_level ); + +// Prototypes for memory compress/decompression object */ +void zm_jpeg_mem_src(j_decompress_ptr cinfo, const JOCTET *inbuffer, int inbuffer_size ); +void zm_jpeg_mem_dest(j_compress_ptr cinfo, JOCTET *outbuffer, int *outbuffer_size ); + +void zm_use_std_huff_tables( j_decompress_ptr cinfo ); +} diff --git a/src/zm_local_camera.cpp b/src/zm_local_camera.cpp new file mode 100644 index 000000000..73aff87aa --- /dev/null +++ b/src/zm_local_camera.cpp @@ -0,0 +1,2174 @@ +// +// ZoneMinder Local Camera Class Implementation, $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. +// + +#include "zm.h" + +#if ZM_HAS_V4L + +#include "zm_local_camera.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +static unsigned int BigEndian; + +static int vidioctl( int fd, int request, void *arg ) +{ + int result = -1; + do + { + result = ioctl( fd, request, arg ); + } while ( result == -1 && errno == EINTR ); + return( result ); +} + +#if HAVE_LIBSWSCALE +static PixelFormat getFfPixFormatFromV4lPalette( int v4l_version, int palette ) +{ + PixelFormat pixFormat = PIX_FMT_NONE; + +#if ZM_HAS_V4L2 + if ( v4l_version == 2 ) + { + switch( palette ) + { +#ifdef V4L2_PIX_FMT_RGB444 + case V4L2_PIX_FMT_RGB444 : + pixFormat = PIX_FMT_RGB444; + break; +#endif // V4L2_PIX_FMT_RGB444 + case V4L2_PIX_FMT_RGB555 : + pixFormat = PIX_FMT_RGB555; + break; + case V4L2_PIX_FMT_RGB565 : + pixFormat = PIX_FMT_RGB565; + break; + case V4L2_PIX_FMT_BGR24 : + pixFormat = PIX_FMT_BGR24; + break; + case V4L2_PIX_FMT_RGB24 : + pixFormat = PIX_FMT_RGB24; + break; + case V4L2_PIX_FMT_BGR32 : + pixFormat = PIX_FMT_BGRA; + break; + case V4L2_PIX_FMT_RGB32 : + pixFormat = PIX_FMT_ARGB; + break; + case V4L2_PIX_FMT_GREY : + pixFormat = PIX_FMT_GRAY8; + break; + case V4L2_PIX_FMT_YUYV : + pixFormat = PIX_FMT_YUYV422; + break; + case V4L2_PIX_FMT_YUV422P : + pixFormat = PIX_FMT_YUV422P; + break; + case V4L2_PIX_FMT_YUV411P : + pixFormat = PIX_FMT_YUV411P; + break; +#ifdef V4L2_PIX_FMT_YUV444 + case V4L2_PIX_FMT_YUV444 : + pixFormat = PIX_FMT_YUV444P; + break; +#endif // V4L2_PIX_FMT_YUV444 + case V4L2_PIX_FMT_YUV410 : + pixFormat = PIX_FMT_YUV410P; + break; + case V4L2_PIX_FMT_YUV420 : + pixFormat = PIX_FMT_YUV420P; + break; + case V4L2_PIX_FMT_JPEG : + case V4L2_PIX_FMT_MJPEG : + pixFormat = PIX_FMT_YUVJ444P; + break; + // These don't seem to have ffmpeg equivalents + // See if you can match any of the ones in the default clause below!? + case V4L2_PIX_FMT_UYVY : + case V4L2_PIX_FMT_RGB332 : + case V4L2_PIX_FMT_RGB555X : + case V4L2_PIX_FMT_RGB565X : + //case V4L2_PIX_FMT_Y16 : + //case V4L2_PIX_FMT_PAL8 : + case V4L2_PIX_FMT_YVU410 : + case V4L2_PIX_FMT_YVU420 : + case V4L2_PIX_FMT_Y41P : + //case V4L2_PIX_FMT_YUV555 : + //case V4L2_PIX_FMT_YUV565 : + //case V4L2_PIX_FMT_YUV32 : + case V4L2_PIX_FMT_NV12 : + case V4L2_PIX_FMT_NV21 : + case V4L2_PIX_FMT_YYUV : + case V4L2_PIX_FMT_HI240 : + case V4L2_PIX_FMT_HM12 : + //case V4L2_PIX_FMT_SBGGR8 : + //case V4L2_PIX_FMT_SGBRG8 : + //case V4L2_PIX_FMT_SBGGR16 : + case V4L2_PIX_FMT_DV : + case V4L2_PIX_FMT_MPEG : + case V4L2_PIX_FMT_WNVA : + case V4L2_PIX_FMT_SN9C10X : + case V4L2_PIX_FMT_PWC1 : + case V4L2_PIX_FMT_PWC2 : + case V4L2_PIX_FMT_ET61X251 : + //case V4L2_PIX_FMT_SPCA501 : + //case V4L2_PIX_FMT_SPCA505 : + //case V4L2_PIX_FMT_SPCA508 : + //case V4L2_PIX_FMT_SPCA561 : + //case V4L2_PIX_FMT_PAC207 : + //case V4L2_PIX_FMT_PJPG : + //case V4L2_PIX_FMT_YVYU : + default : + { + Fatal( "Can't find swscale format for palette %d", palette ); + break; + // These are all spare and may match some of the above + pixFormat = PIX_FMT_YUVJ420P; + pixFormat = PIX_FMT_YUVJ422P; + pixFormat = PIX_FMT_XVMC_MPEG2_MC; + pixFormat = PIX_FMT_XVMC_MPEG2_IDCT; + pixFormat = PIX_FMT_UYVY422; + pixFormat = PIX_FMT_UYYVYY411; + pixFormat = PIX_FMT_BGR565; + pixFormat = PIX_FMT_BGR555; + pixFormat = PIX_FMT_BGR8; + pixFormat = PIX_FMT_BGR4; + pixFormat = PIX_FMT_BGR4_BYTE; + pixFormat = PIX_FMT_RGB8; + pixFormat = PIX_FMT_RGB4; + pixFormat = PIX_FMT_RGB4_BYTE; + pixFormat = PIX_FMT_NV12; + pixFormat = PIX_FMT_NV21; + pixFormat = PIX_FMT_RGB32_1; + pixFormat = PIX_FMT_BGR32_1; + pixFormat = PIX_FMT_GRAY16BE; + pixFormat = PIX_FMT_GRAY16LE; + pixFormat = PIX_FMT_YUV440P; + pixFormat = PIX_FMT_YUVJ440P; + pixFormat = PIX_FMT_YUVA420P; + //pixFormat = PIX_FMT_VDPAU_H264; + //pixFormat = PIX_FMT_VDPAU_MPEG1; + //pixFormat = PIX_FMT_VDPAU_MPEG2; + } + } + } +#endif // ZM_HAS_V4L2 +#if ZM_HAS_V4L1 + if ( v4l_version == 1 ) + { + switch( palette ) + { + case VIDEO_PALETTE_RGB32 : + if(BigEndian) + pixFormat = PIX_FMT_ARGB; + else + pixFormat = PIX_FMT_BGRA; + break; + case VIDEO_PALETTE_RGB24 : + if(BigEndian) + pixFormat = PIX_FMT_RGB24; + else + pixFormat = PIX_FMT_BGR24; + break; + case VIDEO_PALETTE_GREY : + pixFormat = PIX_FMT_GRAY8; + break; + case VIDEO_PALETTE_RGB555 : + pixFormat = PIX_FMT_RGB555; + break; + case VIDEO_PALETTE_RGB565 : + pixFormat = PIX_FMT_RGB565; + break; + case VIDEO_PALETTE_YUYV : + case VIDEO_PALETTE_YUV422 : + pixFormat = PIX_FMT_YUYV422; + break; + case VIDEO_PALETTE_YUV422P : + pixFormat = PIX_FMT_YUV422P; + break; + case VIDEO_PALETTE_YUV420P : + pixFormat = PIX_FMT_YUV420P; + break; + default : + { + Fatal( "Can't find swscale format for palette %d", palette ); + break; + // These are all spare and may match some of the above + pixFormat = PIX_FMT_YUVJ420P; + pixFormat = PIX_FMT_YUVJ422P; + pixFormat = PIX_FMT_YUVJ444P; + pixFormat = PIX_FMT_XVMC_MPEG2_MC; + pixFormat = PIX_FMT_XVMC_MPEG2_IDCT; + pixFormat = PIX_FMT_UYVY422; + pixFormat = PIX_FMT_UYYVYY411; + pixFormat = PIX_FMT_BGR565; + pixFormat = PIX_FMT_BGR555; + pixFormat = PIX_FMT_BGR8; + pixFormat = PIX_FMT_BGR4; + pixFormat = PIX_FMT_BGR4_BYTE; + pixFormat = PIX_FMT_RGB8; + pixFormat = PIX_FMT_RGB4; + pixFormat = PIX_FMT_RGB4_BYTE; + pixFormat = PIX_FMT_NV12; + pixFormat = PIX_FMT_NV21; + pixFormat = PIX_FMT_RGB32_1; + pixFormat = PIX_FMT_BGR32_1; + pixFormat = PIX_FMT_GRAY16BE; + pixFormat = PIX_FMT_GRAY16LE; + pixFormat = PIX_FMT_YUV440P; + pixFormat = PIX_FMT_YUVJ440P; + pixFormat = PIX_FMT_YUVA420P; + //pixFormat = PIX_FMT_VDPAU_H264; + //pixFormat = PIX_FMT_VDPAU_MPEG1; + //pixFormat = PIX_FMT_VDPAU_MPEG2; + } + } + } +#endif // ZM_HAS_V4L1 + return( pixFormat ); +} +#endif // HAVE_LIBSWSCALE + +#if ZM_HAS_V4L2 +static char palette_desc[32]; +/* Automatic format selection prefered formats */ +static const uint32_t prefered_rgb32_formats[] = {V4L2_PIX_FMT_BGR32, V4L2_PIX_FMT_RGB32, V4L2_PIX_FMT_BGR24, V4L2_PIX_FMT_RGB24, V4L2_PIX_FMT_YUYV, V4L2_PIX_FMT_UYVY, V4L2_PIX_FMT_JPEG, V4L2_PIX_FMT_MJPEG, V4L2_PIX_FMT_YUV422P, V4L2_PIX_FMT_YUV420}; +static const uint32_t prefered_rgb24_formats[] = {V4L2_PIX_FMT_BGR24, V4L2_PIX_FMT_RGB24, V4L2_PIX_FMT_YUYV, V4L2_PIX_FMT_UYVY, V4L2_PIX_FMT_JPEG, V4L2_PIX_FMT_MJPEG, V4L2_PIX_FMT_YUV422P, V4L2_PIX_FMT_YUV420}; +static const uint32_t prefered_gray8_formats[] = {V4L2_PIX_FMT_GREY, V4L2_PIX_FMT_YUYV, V4L2_PIX_FMT_UYVY, V4L2_PIX_FMT_JPEG, V4L2_PIX_FMT_MJPEG, V4L2_PIX_FMT_YUV422P, V4L2_PIX_FMT_YUV420}; +#endif + + +int LocalCamera::camera_count = 0; +int LocalCamera::channel_count = 0; +int LocalCamera::channels[VIDEO_MAX_FRAME]; +int LocalCamera::standards[VIDEO_MAX_FRAME]; + +int LocalCamera::vid_fd = -1; + +int LocalCamera::v4l_version = 0; +#if ZM_HAS_V4L2 +LocalCamera::V4L2Data LocalCamera::v4l2_data; +#endif // ZM_HAS_V4L2 +#if ZM_HAS_V4L1 +LocalCamera::V4L1Data LocalCamera::v4l1_data; +#endif // ZM_HAS_V4L1 + +#if HAVE_LIBSWSCALE +AVFrame **LocalCamera::capturePictures = 0; +#endif // HAVE_LIBSWSCALE + +LocalCamera *LocalCamera::last_camera = NULL; + +LocalCamera::LocalCamera( int p_id, const std::string &p_device, int p_channel, int p_standard, const std::string &p_method, int p_width, int p_height, int p_colours, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture, unsigned int p_extras) : + Camera( p_id, LOCAL_SRC, p_width, p_height, p_colours, ZM_SUBPIX_ORDER_DEFAULT_FOR_COLOUR(p_colours), p_brightness, p_contrast, p_hue, p_colour, p_capture ), + device( p_device ), + channel( p_channel ), + standard( p_standard ), + palette( p_palette ), + channel_index( 0 ), + extras ( p_extras ) +{ + // If we are the first, or only, input on this device then + // do the initial opening etc + device_prime = (camera_count++ == 0); + v4l_version = (p_method=="v4l2"?2:1); + + if ( capture ) + { + if ( device_prime ) + { + Debug( 2, "V4L support enabled, using V4L%d api", v4l_version ); + } + + if ( !last_camera || channel != last_camera->channel ) + { + // We are the first, or only, input that uses this channel + channel_prime = true; + channel_index = channel_count++; + channels[channel_index] = channel; + standards[channel_index] = standard; + } + else + { + // We are the second, or subsequent, input using this channel + channel_prime = false; + } + + } + + /* The V4L1 API doesn't care about endianness, we need to check the endianness of the machine */ + uint32_t checkval = 0xAABBCCDD; + if(*(unsigned char*)&checkval == 0xDD) { + BigEndian = 0; + Debug(2,"little-endian processor detected"); + } else if(*(unsigned char*)&checkval == 0xAA) { + BigEndian = 1; + Debug(2,"Big-endian processor detected"); + } else { + Error("Unable to detect the processor's endianness. Assuming little-endian."); + BigEndian = 0; + } + +#if ZM_HAS_V4L2 + if( v4l_version == 2 && palette == 0 ) { + /* Use automatic format selection */ + Debug(2,"Using automatic format selection"); + palette = AutoSelectFormat(colours); + if(palette == 0) { + Error("Automatic format selection failed. Falling back to YUYV"); + palette = V4L2_PIX_FMT_YUYV; + } else { + if(capture) { + Info("Selected capture palette: %s (%c%c%c%c)", palette_desc, palette&0xff, (palette>>8)&0xff, (palette>>16)&0xff, (palette>>24)&0xff); + } + } + } +#endif + + if( capture ) { + if ( last_camera ) { + if ( (p_method == "v4l2" && v4l_version != 2) || (p_method == "v4l1" && v4l_version != 1) ) + Fatal( "Different Video For Linux version used for monitors sharing same device" ); + + if ( standard != last_camera->standard ) + Warning( "Different video standards defined for monitors sharing same device, results may be unpredictable or completely wrong" ); + + if ( palette != last_camera->palette ) + Warning( "Different video palettes defined for monitors sharing same device, results may be unpredictable or completely wrong" ); + + if ( width != last_camera->width || height != last_camera->height ) + Warning( "Different capture sizes defined for monitors sharing same device, results may be unpredictable or completely wrong" ); + } + } + +#if HAVE_LIBSWSCALE + if( capture ) { + /* Get ffmpeg pixel format based on capture palette and endianness */ + capturePixFormat = getFfPixFormatFromV4lPalette( v4l_version, palette ); + imagePixFormat = PIX_FMT_NONE; + } +#endif // HAVE_LIBSWSCALE + + /* V4L2 format matching */ +#if ZM_HAS_V4L2 + if ( v4l_version == 2 ) { + /* Try to find a match for the selected palette and target colourspace */ + + /* RGB32 palette and 32bit target colourspace */ + if(palette == V4L2_PIX_FMT_RGB32 && colours == ZM_COLOUR_RGB32) { + conversion_type = 0; + subpixelorder = ZM_SUBPIX_ORDER_ARGB; + + /* BGR32 palette and 32bit target colourspace */ + } else if(palette == V4L2_PIX_FMT_BGR32 && colours == ZM_COLOUR_RGB32) { + conversion_type = 0; + subpixelorder = ZM_SUBPIX_ORDER_BGRA; + + /* RGB24 palette and 24bit target colourspace */ + } else if(palette == V4L2_PIX_FMT_RGB24 && colours == ZM_COLOUR_RGB24) { + conversion_type = 0; + subpixelorder = ZM_SUBPIX_ORDER_RGB; + + /* BGR24 palette and 24bit target colourspace */ + } else if(palette == V4L2_PIX_FMT_BGR24 && colours == ZM_COLOUR_RGB24) { + conversion_type = 0; + subpixelorder = ZM_SUBPIX_ORDER_BGR; + + /* Grayscale palette and grayscale target colourspace */ + } else if(palette == V4L2_PIX_FMT_GREY && colours == ZM_COLOUR_GRAY8) { + conversion_type = 0; + subpixelorder = ZM_SUBPIX_ORDER_NONE; + /* Unable to find a solution for the selected palette and target colourspace. Conversion required. Notify the user of performance penalty */ + } else { + if( capture ) + Info("No direct match for the selected palette and target colorspace. Format conversion is required, performance penalty expected"); +#if HAVE_LIBSWSCALE + /* Try using swscale for the conversion */ + conversion_type = 1; + Debug(2,"Using swscale for image conversion"); + if(colours == ZM_COLOUR_RGB32) { + subpixelorder = ZM_SUBPIX_ORDER_RGBA; + imagePixFormat = PIX_FMT_RGBA; + } else if(colours == ZM_COLOUR_RGB24) { + subpixelorder = ZM_SUBPIX_ORDER_RGB; + imagePixFormat = PIX_FMT_RGB24; + } else if(colours == ZM_COLOUR_GRAY8) { + subpixelorder = ZM_SUBPIX_ORDER_NONE; + imagePixFormat = PIX_FMT_GRAY8; + } else { + Panic("Unexpected colours: %d",colours); + } + if( capture ) { + if(!sws_isSupportedInput(capturePixFormat)) { + Error("swscale does not support the used capture format: %c%c%c%c",(capturePixFormat)&0xff,((capturePixFormat>>8)&0xff),((capturePixFormat>>16)&0xff),((capturePixFormat>>24)&0xff)); + conversion_type = 2; /* Try ZM format conversions */ + } + if(!sws_isSupportedOutput(imagePixFormat)) { + Error("swscale does not support the target format: %c%c%c%c",(imagePixFormat)&0xff,((imagePixFormat>>8)&0xff),((imagePixFormat>>16)&0xff),((imagePixFormat>>24)&0xff)); + conversion_type = 2; /* Try ZM format conversions */ + } + } +#else + /* Don't have swscale, see what we can do */ + conversion_type = 2; +#endif + /* Our YUYV->Grayscale conversion is a lot faster than swscale's */ + if(colours == ZM_COLOUR_GRAY8 && palette == V4L2_PIX_FMT_YUYV) { + conversion_type = 2; + } + + /* JPEG */ + if(palette == V4L2_PIX_FMT_JPEG || palette == V4L2_PIX_FMT_MJPEG) { + Debug(2,"Using JPEG image decoding"); + conversion_type = 3; + } + + if(conversion_type == 2) { + Debug(2,"Using ZM for image conversion"); + if(palette == V4L2_PIX_FMT_RGB32 && colours == ZM_COLOUR_GRAY8) { + conversion_fptr = &std_convert_argb_gray8; + subpixelorder = ZM_SUBPIX_ORDER_NONE; + } else if(palette == V4L2_PIX_FMT_BGR32 && colours == ZM_COLOUR_GRAY8) { + conversion_fptr = &std_convert_bgra_gray8; + subpixelorder = ZM_SUBPIX_ORDER_NONE; + } else if(palette == V4L2_PIX_FMT_YUYV && colours == ZM_COLOUR_GRAY8) { + /* Fast YUYV->Grayscale conversion by extracting the Y channel */ + if(config.cpu_extensions && sseversion >= 35) { + conversion_fptr = &ssse3_convert_yuyv_gray8; + Debug(2,"Using SSSE3 YUYV->grayscale fast conversion"); + } else { + conversion_fptr = &std_convert_yuyv_gray8; + Debug(2,"Using standard YUYV->grayscale fast conversion"); + } + subpixelorder = ZM_SUBPIX_ORDER_NONE; + } else if(palette == V4L2_PIX_FMT_YUYV && colours == ZM_COLOUR_RGB24) { + conversion_fptr = &zm_convert_yuyv_rgb; + subpixelorder = ZM_SUBPIX_ORDER_RGB; + } else if(palette == V4L2_PIX_FMT_YUYV && colours == ZM_COLOUR_RGB32) { + conversion_fptr = &zm_convert_yuyv_rgba; + subpixelorder = ZM_SUBPIX_ORDER_RGBA; + } else if(palette == V4L2_PIX_FMT_RGB555 && colours == ZM_COLOUR_RGB24) { + conversion_fptr = &zm_convert_rgb555_rgb; + subpixelorder = ZM_SUBPIX_ORDER_RGB; + } else if(palette == V4L2_PIX_FMT_RGB555 && colours == ZM_COLOUR_RGB32) { + conversion_fptr = &zm_convert_rgb555_rgba; + subpixelorder = ZM_SUBPIX_ORDER_RGBA; + } else if(palette == V4L2_PIX_FMT_RGB565 && colours == ZM_COLOUR_RGB24) { + conversion_fptr = &zm_convert_rgb565_rgb; + subpixelorder = ZM_SUBPIX_ORDER_RGB; + } else if(palette == V4L2_PIX_FMT_RGB565 && colours == ZM_COLOUR_RGB32) { + conversion_fptr = &zm_convert_rgb565_rgba; + subpixelorder = ZM_SUBPIX_ORDER_RGBA; + } else { + Fatal("Unable to find a suitable format conversion for the selected palette and target colorspace."); + } + } + } + } +#endif // ZM_HAS_V4L2 + + /* V4L1 format matching */ +#if ZM_HAS_V4L1 + if ( v4l_version == 1) { + /* Try to find a match for the selected palette and target colourspace */ + + /* RGB32 palette and 32bit target colourspace */ + if(palette == VIDEO_PALETTE_RGB32 && colours == ZM_COLOUR_RGB32) { + conversion_type = 0; + if(BigEndian) { + subpixelorder = ZM_SUBPIX_ORDER_ARGB; + } else { + subpixelorder = ZM_SUBPIX_ORDER_BGRA; + } + + /* RGB24 palette and 24bit target colourspace */ + } else if(palette == VIDEO_PALETTE_RGB24 && colours == ZM_COLOUR_RGB24) { + conversion_type = 0; + if(BigEndian) { + subpixelorder = ZM_SUBPIX_ORDER_RGB; + } else { + subpixelorder = ZM_SUBPIX_ORDER_BGR; + } + + /* Grayscale palette and grayscale target colourspace */ + } else if(palette == VIDEO_PALETTE_GREY && colours == ZM_COLOUR_GRAY8) { + conversion_type = 0; + subpixelorder = ZM_SUBPIX_ORDER_NONE; + /* Unable to find a solution for the selected palette and target colourspace. Conversion required. Notify the user of performance penalty */ + } else { + if( capture ) + Info("No direct match for the selected palette and target colorspace. Format conversion is required, performance penalty expected"); +#if HAVE_LIBSWSCALE + /* Try using swscale for the conversion */ + conversion_type = 1; + Debug(2,"Using swscale for image conversion"); + if(colours == ZM_COLOUR_RGB32) { + subpixelorder = ZM_SUBPIX_ORDER_RGBA; + imagePixFormat = PIX_FMT_RGBA; + } else if(colours == ZM_COLOUR_RGB24) { + subpixelorder = ZM_SUBPIX_ORDER_RGB; + imagePixFormat = PIX_FMT_RGB24; + } else if(colours == ZM_COLOUR_GRAY8) { + subpixelorder = ZM_SUBPIX_ORDER_NONE; + imagePixFormat = PIX_FMT_GRAY8; + } else { + Panic("Unexpected colours: %d",colours); + } + if( capture ) { + if(!sws_isSupportedInput(capturePixFormat)) { + Error("swscale does not support the used capture format"); + conversion_type = 2; /* Try ZM format conversions */ + } + if(!sws_isSupportedOutput(imagePixFormat)) { + Error("swscale does not support the target format"); + conversion_type = 2; /* Try ZM format conversions */ + } + } +#else + /* Don't have swscale, see what we can do */ + conversion_type = 2; +#endif + /* Our YUYV->Grayscale conversion is a lot faster than swscale's */ + if(colours == ZM_COLOUR_GRAY8 && (palette == VIDEO_PALETTE_YUYV || palette == VIDEO_PALETTE_YUV422)) { + conversion_type = 2; + } + + if(conversion_type == 2) { + Debug(2,"Using ZM for image conversion"); + if(palette == VIDEO_PALETTE_RGB32 && colours == ZM_COLOUR_GRAY8) { + if(BigEndian) { + conversion_fptr = &std_convert_argb_gray8; + subpixelorder = ZM_SUBPIX_ORDER_NONE; + } else { + conversion_fptr = &std_convert_bgra_gray8; + subpixelorder = ZM_SUBPIX_ORDER_NONE; + } + } else if((palette == VIDEO_PALETTE_YUYV || palette == VIDEO_PALETTE_YUV422) && colours == ZM_COLOUR_GRAY8) { + /* Fast YUYV->Grayscale conversion by extracting the Y channel */ + if(config.cpu_extensions && sseversion >= 35) { + conversion_fptr = &ssse3_convert_yuyv_gray8; + Debug(2,"Using SSSE3 YUYV->grayscale fast conversion"); + } else { + conversion_fptr = &std_convert_yuyv_gray8; + Debug(2,"Using standard YUYV->grayscale fast conversion"); + } + subpixelorder = ZM_SUBPIX_ORDER_NONE; + } else if((palette == VIDEO_PALETTE_YUYV || palette == VIDEO_PALETTE_YUV422) && colours == ZM_COLOUR_RGB24) { + conversion_fptr = &zm_convert_yuyv_rgb; + subpixelorder = ZM_SUBPIX_ORDER_RGB; + } else if((palette == VIDEO_PALETTE_YUYV || palette == VIDEO_PALETTE_YUV422) && colours == ZM_COLOUR_RGB32) { + conversion_fptr = &zm_convert_yuyv_rgba; + subpixelorder = ZM_SUBPIX_ORDER_RGBA; + } else if(palette == VIDEO_PALETTE_RGB555 && colours == ZM_COLOUR_RGB24) { + conversion_fptr = &zm_convert_rgb555_rgb; + subpixelorder = ZM_SUBPIX_ORDER_RGB; + } else if(palette == VIDEO_PALETTE_RGB555 && colours == ZM_COLOUR_RGB32) { + conversion_fptr = &zm_convert_rgb555_rgba; + subpixelorder = ZM_SUBPIX_ORDER_RGBA; + } else if(palette == VIDEO_PALETTE_RGB565 && colours == ZM_COLOUR_RGB24) { + conversion_fptr = &zm_convert_rgb565_rgb; + subpixelorder = ZM_SUBPIX_ORDER_RGB; + } else if(palette == VIDEO_PALETTE_RGB565 && colours == ZM_COLOUR_RGB32) { + conversion_fptr = &zm_convert_rgb565_rgba; + subpixelorder = ZM_SUBPIX_ORDER_RGBA; + } else { + Fatal("Unable to find a suitable format conversion for the selected palette and target colorspace."); + } + } + } + } +#endif // ZM_HAS_V4L1 + + last_camera = this; + Debug(3,"Selected subpixelorder: %d",subpixelorder); + +#if HAVE_LIBSWSCALE + /* Initialize swscale stuff */ + if(capture && conversion_type == 1) { + tmpPicture = avcodec_alloc_frame(); + if ( !tmpPicture ) + Fatal( "Could not allocate temporary picture" ); + + int pSize = avpicture_get_size( imagePixFormat, width, height ); + if( (unsigned int)pSize != imagesize) { + Fatal("Image size mismatch. Required: %d Available: %d",pSize,imagesize); + } + + if(config.cpu_extensions && sseversion >= 20) { + imgConversionContext = sws_getContext(width, height, capturePixFormat, width, height, imagePixFormat, SWS_BICUBIC | SWS_CPU_CAPS_SSE2, NULL, NULL, NULL ); + } else { + imgConversionContext = sws_getContext(width, height, capturePixFormat, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL ); + } + + if ( !imgConversionContext ) + Fatal( "Unable to initialise image scaling context" ); + + } +#endif +} + +LocalCamera::~LocalCamera() +{ + if ( device_prime && capture ) + Terminate(); + +#if HAVE_LIBSWSCALE + /* Clean up swscale stuff */ + if(capture && conversion_type == 1) { + sws_freeContext(imgConversionContext); + imgConversionContext = NULL; + + av_free(tmpPicture); + tmpPicture = NULL; + } +#endif +} + +void LocalCamera::Initialise() +{ +#if HAVE_LIBSWSCALE + if ( logDebugging() ) + av_log_set_level( AV_LOG_DEBUG ); + else + av_log_set_level( AV_LOG_QUIET ); +#endif // HAVE_LIBSWSCALE + + struct stat st; + + if ( stat( device.c_str(), &st ) < 0 ) + Fatal( "Failed to stat video device %s: %s", device.c_str(), strerror(errno) ); + + if ( !S_ISCHR(st.st_mode) ) + Fatal( "File %s is not device file: %s", device.c_str(), strerror(errno) ); + + Debug( 3, "Opening video device %s", device.c_str() ); + //if ( (vid_fd = open( device.c_str(), O_RDWR|O_NONBLOCK, 0 )) < 0 ) + if ( (vid_fd = open( device.c_str(), O_RDWR, 0 )) < 0 ) + Fatal( "Failed to open video device %s: %s", device.c_str(), strerror(errno) ); + +#if ZM_HAS_V4L2 + Debug( 2, "V4L2 support enabled, using V4L%d api", v4l_version ); + if ( v4l_version == 2 ) + { + struct v4l2_capability vid_cap; + + Debug( 3, "Checking video device capabilities" ); + if ( vidioctl( vid_fd, VIDIOC_QUERYCAP, &vid_cap ) < 0 ) + Fatal( "Failed to query video device: %s", strerror(errno) ); + + if ( !(vid_cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) ) + Fatal( "Video device is not video capture device" ); + + if ( !(vid_cap.capabilities & V4L2_CAP_STREAMING) ) + Fatal( "Video device does not support streaming i/o" ); + + Debug( 3, "Setting up video format" ); + + memset( &v4l2_data.fmt, 0, sizeof(v4l2_data.fmt) ); + v4l2_data.fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + + if ( vidioctl( vid_fd, VIDIOC_G_FMT, &v4l2_data.fmt ) < 0 ) + Fatal( "Failed to get video format: %s", strerror(errno) ); + + Debug( 4, " v4l2_data.fmt.type = %08x", v4l2_data.fmt.type ); + Debug( 4, " v4l2_data.fmt.fmt.pix.width = %08x", v4l2_data.fmt.fmt.pix.width ); + Debug( 4, " v4l2_data.fmt.fmt.pix.height = %08x", v4l2_data.fmt.fmt.pix.height ); + Debug( 4, " v4l2_data.fmt.fmt.pix.pixelformat = %08x", v4l2_data.fmt.fmt.pix.pixelformat ); + Debug( 4, " v4l2_data.fmt.fmt.pix.field = %08x", v4l2_data.fmt.fmt.pix.field ); + Debug( 4, " v4l2_data.fmt.fmt.pix.bytesperline = %08x", v4l2_data.fmt.fmt.pix.bytesperline ); + Debug( 4, " v4l2_data.fmt.fmt.pix.sizeimage = %08x", v4l2_data.fmt.fmt.pix.sizeimage ); + Debug( 4, " v4l2_data.fmt.fmt.pix.colorspace = %08x", v4l2_data.fmt.fmt.pix.colorspace ); + Debug( 4, " v4l2_data.fmt.fmt.pix.priv = %08x", v4l2_data.fmt.fmt.pix.priv ); + + v4l2_data.fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + v4l2_data.fmt.fmt.pix.width = width; + v4l2_data.fmt.fmt.pix.height = height; + v4l2_data.fmt.fmt.pix.pixelformat = palette; + + if ( (extras & 0xff) != 0 ) + { + v4l2_data.fmt.fmt.pix.field = (v4l2_field)(extras & 0xff); + + if ( vidioctl( vid_fd, VIDIOC_S_FMT, &v4l2_data.fmt ) < 0 ) + { + Warning( "Failed to set V4L2 field to %d, falling back to auto", (extras & 0xff) ); + v4l2_data.fmt.fmt.pix.field = V4L2_FIELD_ANY; + if ( vidioctl( vid_fd, VIDIOC_S_FMT, &v4l2_data.fmt ) < 0 ) { + Fatal( "Failed to set video format: %s", strerror(errno) ); + } + } + } else { + if ( vidioctl( vid_fd, VIDIOC_S_FMT, &v4l2_data.fmt ) < 0 ) { + Fatal( "Failed to set video format: %s", strerror(errno) ); + } + } + + /* Note VIDIOC_S_FMT may change width and height. */ + Debug( 4, " v4l2_data.fmt.type = %08x", v4l2_data.fmt.type ); + Debug( 4, " v4l2_data.fmt.fmt.pix.width = %08x", v4l2_data.fmt.fmt.pix.width ); + Debug( 4, " v4l2_data.fmt.fmt.pix.height = %08x", v4l2_data.fmt.fmt.pix.height ); + Debug( 4, " v4l2_data.fmt.fmt.pix.pixelformat = %08x", v4l2_data.fmt.fmt.pix.pixelformat ); + Debug( 4, " v4l2_data.fmt.fmt.pix.field = %08x", v4l2_data.fmt.fmt.pix.field ); + Debug( 4, " v4l2_data.fmt.fmt.pix.bytesperline = %08x", v4l2_data.fmt.fmt.pix.bytesperline ); + Debug( 4, " v4l2_data.fmt.fmt.pix.sizeimage = %08x", v4l2_data.fmt.fmt.pix.sizeimage ); + Debug( 4, " v4l2_data.fmt.fmt.pix.colorspace = %08x", v4l2_data.fmt.fmt.pix.colorspace ); + Debug( 4, " v4l2_data.fmt.fmt.pix.priv = %08x", v4l2_data.fmt.fmt.pix.priv ); + + /* Buggy driver paranoia. */ + unsigned int min; + min = v4l2_data.fmt.fmt.pix.width * 2; + if (v4l2_data.fmt.fmt.pix.bytesperline < min) + v4l2_data.fmt.fmt.pix.bytesperline = min; + min = v4l2_data.fmt.fmt.pix.bytesperline * v4l2_data.fmt.fmt.pix.height; + if (v4l2_data.fmt.fmt.pix.sizeimage < min) + v4l2_data.fmt.fmt.pix.sizeimage = min; + + v4l2_jpegcompression jpeg_comp; + if(palette == V4L2_PIX_FMT_JPEG || palette == V4L2_PIX_FMT_MJPEG) { + if( vidioctl( vid_fd, VIDIOC_G_JPEGCOMP, &jpeg_comp ) < 0 ) { + if(errno == EINVAL) { + Debug(2, "JPEG compression options are not available"); + } else { + Warning("Failed to get JPEG compression options: %s", strerror(errno) ); + } + } else { + /* Set flags and quality. MJPEG should not have the huffman tables defined */ + if(palette == V4L2_PIX_FMT_MJPEG) { + jpeg_comp.jpeg_markers |= V4L2_JPEG_MARKER_DQT | V4L2_JPEG_MARKER_DRI; + } else { + jpeg_comp.jpeg_markers |= V4L2_JPEG_MARKER_DQT | V4L2_JPEG_MARKER_DRI | V4L2_JPEG_MARKER_DHT; + } + jpeg_comp.quality = 85; + + /* Update the JPEG options */ + if( vidioctl( vid_fd, VIDIOC_S_JPEGCOMP, &jpeg_comp ) < 0 ) { + Warning("Failed to set JPEG compression options: %s", strerror(errno) ); + } else { + if(vidioctl( vid_fd, VIDIOC_G_JPEGCOMP, &jpeg_comp ) < 0) { + Debug(3,"Failed to get updated JPEG compression options: %s", strerror(errno) ); + } else { + Debug(4, "JPEG quality: %d",jpeg_comp.quality); + Debug(4, "JPEG markers: %#x",jpeg_comp.jpeg_markers); + } + } + } + } + + Debug( 3, "Setting up request buffers" ); + + memset( &v4l2_data.reqbufs, 0, sizeof(v4l2_data.reqbufs) ); + if ( channel_count > 1 ) + if ( config.v4l_multi_buffer ) + v4l2_data.reqbufs.count = 2*channel_count; + else + v4l2_data.reqbufs.count = 1; + else + v4l2_data.reqbufs.count = 8; + v4l2_data.reqbufs.type = v4l2_data.fmt.type; + v4l2_data.reqbufs.memory = V4L2_MEMORY_MMAP; + + if ( vidioctl( vid_fd, VIDIOC_REQBUFS, &v4l2_data.reqbufs ) < 0 ) + { + if ( errno == EINVAL ) + { + Fatal( "Unable to initialise memory mapping, unsupported in device" ); + } + else + { + Fatal( "Unable to initialise memory mapping: %s", strerror(errno) ); + } + } + + if ( v4l2_data.reqbufs.count < (config.v4l_multi_buffer?2:1) ) + Fatal( "Insufficient buffer memory %d on video device", v4l2_data.reqbufs.count ); + + Debug( 3, "Setting up %d data buffers", v4l2_data.reqbufs.count ); + + v4l2_data.buffers = new V4L2MappedBuffer[v4l2_data.reqbufs.count]; +#if HAVE_LIBSWSCALE + capturePictures = new AVFrame *[v4l2_data.reqbufs.count]; +#endif // HAVE_LIBSWSCALE + for ( unsigned int i = 0; i < v4l2_data.reqbufs.count; i++ ) + { + struct v4l2_buffer vid_buf; + + memset( &vid_buf, 0, sizeof(vid_buf) ); + + //vid_buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + vid_buf.type = v4l2_data.fmt.type; + //vid_buf.memory = V4L2_MEMORY_MMAP; + vid_buf.memory = v4l2_data.reqbufs.memory; + vid_buf.index = i; + + if ( vidioctl( vid_fd, VIDIOC_QUERYBUF, &vid_buf ) < 0 ) + Fatal( "Unable to query video buffer: %s", strerror(errno) ); + + v4l2_data.buffers[i].length = vid_buf.length; + v4l2_data.buffers[i].start = mmap( NULL, vid_buf.length, PROT_READ|PROT_WRITE, MAP_SHARED, vid_fd, vid_buf.m.offset ); + + if ( v4l2_data.buffers[i].start == MAP_FAILED ) + Fatal( "Can't map video buffer %d (%d bytes) to memory: %s(%d)", i, vid_buf.length, strerror(errno), errno ); + +#if HAVE_LIBSWSCALE + capturePictures[i] = avcodec_alloc_frame(); + if ( !capturePictures[i] ) + Fatal( "Could not allocate picture" ); + avpicture_fill( (AVPicture *)capturePictures[i], (uint8_t*)v4l2_data.buffers[i].start, capturePixFormat, v4l2_data.fmt.fmt.pix.width, v4l2_data.fmt.fmt.pix.height ); +#endif // HAVE_LIBSWSCALE + } + + Debug( 3, "Configuring video source" ); + + if ( vidioctl( vid_fd, VIDIOC_S_INPUT, &channel ) < 0 ) + { + Fatal( "Failed to set camera source %d: %s", channel, strerror(errno) ); + } + + struct v4l2_input input; + v4l2_std_id stdId; + + memset( &input, 0, sizeof(input) ); + + if ( vidioctl( vid_fd, VIDIOC_ENUMINPUT, &input ) < 0 ) + { + Fatal( "Failed to enumerate input %d: %s", channel, strerror(errno) ); + } + + if ( (input.std != V4L2_STD_UNKNOWN) && ((input.std & standard) == V4L2_STD_UNKNOWN) ) + { + Fatal( "Device does not support video standard %d", standard ); + } + + stdId = standard; + if ( (input.std != V4L2_STD_UNKNOWN) && vidioctl( vid_fd, VIDIOC_S_STD, &stdId ) < 0 ) + { + Fatal( "Failed to set video standard %d: %s", standard, strerror(errno) ); + } + + Contrast(contrast); + Brightness(brightness); + Hue(hue); + Colour(colour); + } +#endif // ZM_HAS_V4L2 +#if ZM_HAS_V4L1 + if ( v4l_version == 1 ) + { + Debug( 3, "Configuring picture attributes" ); + + struct video_picture vid_pic; + memset( &vid_pic, 0, sizeof(vid_pic) ); + if ( ioctl( vid_fd, VIDIOCGPICT, &vid_pic) < 0 ) + Fatal( "Failed to get picture attributes: %s", strerror(errno) ); + + Debug( 4, "Old P:%d", vid_pic.palette ); + Debug( 4, "Old D:%d", vid_pic.depth ); + Debug( 4, "Old B:%d", vid_pic.brightness ); + Debug( 4, "Old h:%d", vid_pic.hue ); + Debug( 4, "Old Cl:%d", vid_pic.colour ); + Debug( 4, "Old Cn:%d", vid_pic.contrast ); + + switch (vid_pic.palette = palette) + { + case VIDEO_PALETTE_RGB32 : + { + vid_pic.depth = 32; + break; + } + case VIDEO_PALETTE_RGB24 : + { + vid_pic.depth = 24; + break; + } + case VIDEO_PALETTE_GREY : + { + vid_pic.depth = 8; + break; + } + case VIDEO_PALETTE_RGB565 : + case VIDEO_PALETTE_YUYV : + case VIDEO_PALETTE_YUV422 : + case VIDEO_PALETTE_YUV420P : + case VIDEO_PALETTE_YUV422P : + default: + { + vid_pic.depth = 16; + break; + } + } + + if ( brightness >= 0 ) vid_pic.brightness = brightness; + if ( hue >= 0 ) vid_pic.hue = hue; + if ( colour >= 0 ) vid_pic.colour = colour; + if ( contrast >= 0 ) vid_pic.contrast = contrast; + + if ( ioctl( vid_fd, VIDIOCSPICT, &vid_pic ) < 0 ) + { + Error( "Failed to set picture attributes: %s", strerror(errno) ); + if ( config.strict_video_config ) + exit(-1); + } + + Debug( 3, "Configuring window attributes" ); + + struct video_window vid_win; + memset( &vid_win, 0, sizeof(vid_win) ); + if ( ioctl( vid_fd, VIDIOCGWIN, &vid_win) < 0 ) + { + Error( "Failed to get window attributes: %s", strerror(errno) ); + exit(-1); + } + Debug( 4, "Old X:%d", vid_win.x ); + Debug( 4, "Old Y:%d", vid_win.y ); + Debug( 4, "Old W:%d", vid_win.width ); + Debug( 4, "Old H:%d", vid_win.height ); + + vid_win.x = 0; + vid_win.y = 0; + vid_win.width = width; + vid_win.height = height; + vid_win.flags &= ~VIDEO_WINDOW_INTERLACE; + + if ( ioctl( vid_fd, VIDIOCSWIN, &vid_win ) < 0 ) + { + Error( "Failed to set window attributes: %s", strerror(errno) ); + if ( config.strict_video_config ) + exit(-1); + } + + Info( "vid_win.width = %08x", vid_win.width ); + Info( "vid_win.height = %08x", vid_win.height ); + Info( "vid_win.flags = %08x", vid_win.flags ); + + Debug( 3, "Setting up request buffers" ); + if ( ioctl( vid_fd, VIDIOCGMBUF, &v4l1_data.frames ) < 0 ) + Fatal( "Failed to setup memory: %s", strerror(errno) ); + if ( channel_count > 1 && !config.v4l_multi_buffer ) + v4l1_data.frames.frames = 1; + v4l1_data.buffers = new video_mmap[v4l1_data.frames.frames]; + Debug( 4, "vmb.frames = %d", v4l1_data.frames.frames ); + Debug( 4, "vmb.size = %d", v4l1_data.frames.size ); + + Debug( 3, "Setting up %d frame buffers", v4l1_data.frames.frames ); + + v4l1_data.bufptr = (unsigned char *)mmap( 0, v4l1_data.frames.size, PROT_READ|PROT_WRITE, MAP_SHARED, vid_fd, 0 ); + if ( v4l1_data.bufptr == MAP_FAILED ) + Fatal( "Could not mmap video: %s", strerror(errno) ); + +#if HAVE_LIBSWSCALE + capturePictures = new AVFrame *[v4l1_data.frames.frames]; + for ( int i = 0; i < v4l1_data.frames.frames; i++ ) + { + v4l1_data.buffers[i].frame = i; + v4l1_data.buffers[i].width = width; + v4l1_data.buffers[i].height = height; + v4l1_data.buffers[i].format = palette; + + capturePictures[i] = avcodec_alloc_frame(); + if ( !capturePictures[i] ) + Fatal( "Could not allocate picture" ); + avpicture_fill( (AVPicture *)capturePictures[i], (unsigned char *)v4l1_data.bufptr+v4l1_data.frames.offsets[i], capturePixFormat, width, height ); + } +#endif // HAVE_LIBSWSCALE + + Debug( 3, "Configuring video source" ); + + struct video_channel vid_src; + memset( &vid_src, 0, sizeof(vid_src) ); + vid_src.channel = channel; + if ( ioctl( vid_fd, VIDIOCGCHAN, &vid_src) < 0 ) + Fatal( "Failed to get camera source: %s", strerror(errno) ); + + Debug( 4, "Old C:%d", vid_src.channel ); + Debug( 4, "Old F:%d", vid_src.norm ); + Debug( 4, "Old Fl:%x", vid_src.flags ); + Debug( 4, "Old T:%d", vid_src.type ); + + vid_src.norm = standard; + vid_src.flags = 0; + vid_src.type = VIDEO_TYPE_CAMERA; + if ( ioctl( vid_fd, VIDIOCSCHAN, &vid_src ) < 0 ) + { + Error( "Failed to set camera source %d: %s", channel, strerror(errno) ); + if ( config.strict_video_config ) + exit(-1); + } + + if ( ioctl( vid_fd, VIDIOCGWIN, &vid_win) < 0 ) + Fatal( "Failed to get window data: %s", strerror(errno) ); + + Info( "vid_win.width = %08x", vid_win.width ); + Info( "vid_win.height = %08x", vid_win.height ); + Info( "vid_win.flags = %08x", vid_win.flags ); + + Debug( 4, "New X:%d", vid_win.x ); + Debug( 4, "New Y:%d", vid_win.y ); + Debug( 4, "New W:%d", vid_win.width ); + Debug( 4, "New H:%d", vid_win.height ); + + if ( ioctl( vid_fd, VIDIOCGPICT, &vid_pic) < 0 ) + Fatal( "Failed to get window data: %s", strerror(errno) ); + + Debug( 4, "New P:%d", vid_pic.palette ); + Debug( 4, "New D:%d", vid_pic.depth ); + Debug( 4, "New B:%d", vid_pic.brightness ); + Debug( 4, "New h:%d", vid_pic.hue ); + Debug( 4, "New Cl:%d", vid_pic.colour ); + Debug( 4, "New Cn:%d", vid_pic.contrast ); + } +#endif // ZM_HAS_V4L1 +} + +void LocalCamera::Terminate() +{ +#if ZM_HAS_V4L2 + if ( v4l_version == 2 ) + { + Debug( 3, "Terminating video stream" ); + //enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + // enum v4l2_buf_type type = v4l2_data.fmt.type; + enum v4l2_buf_type type = (v4l2_buf_type)v4l2_data.fmt.type; + if ( vidioctl( vid_fd, VIDIOC_STREAMOFF, &type ) < 0 ) + Error( "Failed to stop capture stream: %s", strerror(errno) ); + + Debug( 3, "Unmapping video buffers" ); + for ( unsigned int i = 0; i < v4l2_data.reqbufs.count; i++ ) { +#if HAVE_LIBSWSCALE + /* Free capture pictures */ + av_free(capturePictures[i]); + capturePictures[i] = NULL; +#endif + if ( munmap( v4l2_data.buffers[i].start, v4l2_data.buffers[i].length ) < 0 ) + Error( "Failed to munmap buffer %d: %s", i, strerror(errno) ); + } + + } + else +#endif // ZM_HAS_V4L2 + + +#if ZM_HAS_V4L1 + if ( v4l_version == 1 ) + { +#if HAVE_LIBSWSCALE + for(unsigned int i=0; i < v4l1_data.frames.frames; i++) { + /* Free capture pictures */ + av_free(capturePictures[i]); + capturePictures[i] = NULL; + } +#endif + + Debug( 3, "Unmapping video buffers" ); + if ( munmap((char*)v4l1_data.bufptr, v4l1_data.frames.size) < 0 ) + Error( "Failed to munmap buffers: %s", strerror(errno) ); + + delete[] v4l1_data.buffers; + } +#endif // ZM_HAS_V4L1 + + close( vid_fd ); + +} + +uint32_t LocalCamera::AutoSelectFormat(int p_colours) { + /* Automatic format selection */ + uint32_t selected_palette = 0; +#if ZM_HAS_V4L2 + char fmt_desc[64][32]; + uint32_t fmt_fcc[64]; + v4l2_fmtdesc fmtinfo; + unsigned int nIndex = 0; + //int nRet = 0; // compiler say it isn't used + int enum_fd; + + /* Open the device */ + if ((enum_fd = open( device.c_str(), O_RDWR, 0 )) < 0) { + Error( "Automatic format selection failed to open video device %s: %s", device.c_str(), strerror(errno) ); + return selected_palette; + } + + /* Enumerate available formats */ + memset(&fmtinfo, 0, sizeof(fmtinfo)); + fmtinfo.index = nIndex; + fmtinfo.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + while(vidioctl( enum_fd, VIDIOC_ENUM_FMT, &fmtinfo ) >= 0) { + /* Got a format. Copy it to the array */ + strcpy(fmt_desc[nIndex], (const char*)(fmtinfo.description)); + fmt_fcc[nIndex] = fmtinfo.pixelformat; + + Debug(6, "Got format: %s (%c%c%c%c) at index %d",fmt_desc[nIndex],fmt_fcc[nIndex]&0xff, (fmt_fcc[nIndex]>>8)&0xff, (fmt_fcc[nIndex]>>16)&0xff, (fmt_fcc[nIndex]>>24)&0xff ,nIndex); + + /* Proceed to the next index */ + memset(&fmtinfo, 0, sizeof(fmtinfo)); + fmtinfo.index = ++nIndex; + fmtinfo.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + } + + /* Select format */ + int nIndexUsed = -1; + int n_preferedformats = 0; + const uint32_t* preferedformats; + if(p_colours == ZM_COLOUR_RGB32) { + /* 32bit */ + preferedformats = prefered_rgb32_formats; + n_preferedformats = sizeof(prefered_rgb32_formats) / sizeof(uint32_t); + } else if(p_colours == ZM_COLOUR_GRAY8) { + /* Grayscale */ + preferedformats = prefered_gray8_formats; + n_preferedformats = sizeof(prefered_gray8_formats) / sizeof(uint32_t); + } else { + /* Assume 24bit */ + preferedformats = prefered_rgb24_formats; + n_preferedformats = sizeof(prefered_rgb24_formats) / sizeof(uint32_t); + } + for( unsigned int i=0; i < (unsigned int)n_preferedformats && nIndexUsed < 0; i++ ) { + for( unsigned int j=0; j < nIndex; j++ ) { + if( preferedformats[i] == fmt_fcc[j] ) { + /* Found a format! */ + nIndexUsed = j; + break; + } + } + } + + /* Have we found a match? */ + if(nIndexUsed >= 0) { + /* Found a match */ + selected_palette = fmt_fcc[nIndexUsed]; + strcpy(palette_desc,fmt_desc[nIndexUsed]); + } + + /* Close the device */ + close(enum_fd); + +#endif /* ZM_HAS_V4L2 */ + return selected_palette; +} + + +#define capString(test,prefix,yesString,noString,capability) \ + (test) ? (prefix yesString " " capability "\n") : (prefix noString " " capability "\n") + +bool LocalCamera::GetCurrentSettings( const char *device, char *output, int version, bool verbose ) +{ + output[0] = 0; + + char queryDevice[PATH_MAX] = ""; + int devIndex = 0; + do + { + if ( device ) + strcpy( queryDevice, device ); + else + sprintf( queryDevice, "/dev/video%d", devIndex ); + if ( (vid_fd = open(queryDevice, O_RDWR)) <= 0 ) + { + if ( device ) + { + Error( "Failed to open video device %s: %s", queryDevice, strerror(errno) ); + if ( verbose ) + sprintf( output+strlen(output), "Error, failed to open video device %s: %s\n", queryDevice, strerror(errno) ); + else + sprintf( output+strlen(output), "error%d\n", errno ); + return( false ); + } + else + { + return( true ); + } + } + if ( verbose ) + sprintf( output+strlen(output), "Video Device: %s\n", queryDevice ); + else + sprintf( output+strlen(output), "d:%s|", queryDevice ); + +#if ZM_HAS_V4L2 + if ( version == 2 ) + { + struct v4l2_capability vid_cap; + if ( vidioctl( vid_fd, VIDIOC_QUERYCAP, &vid_cap ) < 0 ) + { + Error( "Failed to query video device: %s", strerror(errno) ); + if ( verbose ) + sprintf( output, "Error, failed to query video capabilities %s: %s\n", queryDevice, strerror(errno) ); + else + sprintf( output, "error%d\n", errno ); + return( false ); + } + + if ( verbose ) + { + sprintf( output+strlen(output), "General Capabilities\n" ); + sprintf( output+strlen(output), " Driver: %s\n", vid_cap.driver ); + sprintf( output+strlen(output), " Card: %s\n", vid_cap.card ); + sprintf( output+strlen(output), " Bus: %s\n", vid_cap.bus_info ); + sprintf( output+strlen(output), " Version: %u.%u.%u\n", (vid_cap.version>>16)&0xff, (vid_cap.version>>8)&0xff, vid_cap.version&0xff ); + sprintf( output+strlen(output), " Type: 0x%x\n%s%s%s%s%s%s%s%s%s%s%s%s%s%s", vid_cap.capabilities, + capString( vid_cap.capabilities&V4L2_CAP_VIDEO_CAPTURE, " ", "Supports", "Does not support", "video capture (X)" ), + capString( vid_cap.capabilities&V4L2_CAP_VIDEO_OUTPUT, " ", "Supports", "Does not support", "video output" ), + capString( vid_cap.capabilities&V4L2_CAP_VIDEO_OVERLAY, " ", "Supports", "Does not support", "frame buffer overlay" ), + capString( vid_cap.capabilities&V4L2_CAP_VBI_CAPTURE, " ", "Supports", "Does not support", "VBI capture" ), + capString( vid_cap.capabilities&V4L2_CAP_VBI_OUTPUT, " ", "Supports", "Does not support", "VBI output" ), + capString( vid_cap.capabilities&V4L2_CAP_SLICED_VBI_CAPTURE, " ", "Supports", "Does not support", "sliced VBI capture" ), + capString( vid_cap.capabilities&V4L2_CAP_SLICED_VBI_OUTPUT, " ", "Supports", "Does not support", "sliced VBI output" ), +#ifdef V4L2_CAP_VIDEO_OUTPUT_OVERLAY + capString( vid_cap.capabilities&V4L2_CAP_VIDEO_OUTPUT_OVERLAY, " ", "Supports", "Does not support", "video output overlay" ), +#else // V4L2_CAP_VIDEO_OUTPUT_OVERLAY + "", +#endif // V4L2_CAP_VIDEO_OUTPUT_OVERLAY + capString( vid_cap.capabilities&V4L2_CAP_TUNER, " ", "Has", "Does not have", "tuner" ), + capString( vid_cap.capabilities&V4L2_CAP_AUDIO, " ", "Has", "Does not have", "audio in and/or out" ), + capString( vid_cap.capabilities&V4L2_CAP_RADIO, " ", "Has", "Does not have", "radio" ), + capString( vid_cap.capabilities&V4L2_CAP_READWRITE, " ", "Supports", "Does not support", "read/write i/o (X)" ), + capString( vid_cap.capabilities&V4L2_CAP_ASYNCIO, " ", "Supports", "Does not support", "async i/o" ), + capString( vid_cap.capabilities&V4L2_CAP_STREAMING, " ", "Supports", "Does not support", "streaming i/o (X)" ) + ); + } + else + { + sprintf( output+strlen(output), "D:%s|", vid_cap.driver ); + sprintf( output+strlen(output), "C:%s|", vid_cap.card ); + sprintf( output+strlen(output), "B:%s|", vid_cap.bus_info ); + sprintf( output+strlen(output), "V:%u.%u.%u|", (vid_cap.version>>16)&0xff, (vid_cap.version>>8)&0xff, vid_cap.version&0xff ); + sprintf( output+strlen(output), "T:0x%x|", vid_cap.capabilities ); + } + + if ( verbose ) + sprintf( output+strlen(output), " Standards:\n" ); + else + sprintf( output+strlen(output), "S:" ); + struct v4l2_standard standard; + int standardIndex = 0; + do + { + memset( &standard, 0, sizeof(standard) ); + standard.index = standardIndex; + + if ( vidioctl( vid_fd, VIDIOC_ENUMSTD, &standard ) < 0 ) + { + if ( errno == EINVAL ) + { + standardIndex = -1; + break; + } + else + { + Error( "Failed to enumerate standard %d: %s", standard.index, strerror(errno) ); + if ( verbose ) + sprintf( output, "Error, failed to enumerate standard %d: %s\n", standard.index, strerror(errno) ); + else + sprintf( output, "error%d\n", errno ); + return( false ); + } + } + if ( verbose ) + sprintf( output+strlen(output), " %s\n", standard.name ); + else + sprintf( output+strlen(output), "%s/", standard.name ); + } + while ( standardIndex++ >= 0 ); + if ( !verbose && output[strlen(output)-1] == '/') + output[strlen(output)-1] = '|'; + + if ( verbose ) + sprintf( output+strlen(output), " Formats:\n" ); + else + sprintf( output+strlen(output), "F:" ); + struct v4l2_fmtdesc format; + int formatIndex = 0; + do + { + memset( &format, 0, sizeof(format) ); + format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + format.index = formatIndex; + + if ( vidioctl( vid_fd, VIDIOC_ENUM_FMT, &format ) < 0 ) + { + if ( errno == EINVAL ) + { + formatIndex = -1; + break; + } + else + { + Error( "Failed to enumerate format %d: %s", format.index, strerror(errno) ); + if ( verbose ) + sprintf( output, "Error, failed to enumerate format %d: %s\n", format.index, strerror(errno) ); + else + sprintf( output, "error%d\n", errno ); + return( false ); + } + } + if ( verbose ) + sprintf( output+strlen(output), " %s (%c%c%c%c)\n", format.description, format.pixelformat&0xff, (format.pixelformat>>8)&0xff, (format.pixelformat>>16)&0xff, (format.pixelformat>>24)&0xff ); + else + sprintf( output+strlen(output), "%c%c%c%c/", format.pixelformat&0xff, (format.pixelformat>>8)&0xff, (format.pixelformat>>16)&0xff, (format.pixelformat>>24)&0xff ); + } + while ( formatIndex++ >= 0 ); + if ( !verbose ) + output[strlen(output)-1] = '|'; + + if(verbose) + sprintf( output+strlen(output), "Crop Capabilities\n" ); + + struct v4l2_cropcap cropcap; + memset( &cropcap, 0, sizeof(cropcap) ); + cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + if ( vidioctl( vid_fd, VIDIOC_CROPCAP, &cropcap ) < 0 ) + { + if(errno != EINVAL) { + /* Failed querying crop capability, write error to the log and continue as if crop is not supported */ + Error( "Failed to query crop capabilities: %s", strerror(errno) ); + } + + if(verbose) { + sprintf( output+strlen(output), " Cropping is not supported\n"); + } else { + /* Send fake crop bounds to not confuse things parsing this, such as monitor probe */ + sprintf( output+strlen(output), "B:%dx%d|",0,0); + } + } else { + struct v4l2_crop crop; + memset( &crop, 0, sizeof(crop) ); + crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + + if ( vidioctl( vid_fd, VIDIOC_G_CROP, &crop ) < 0 ) + { + if ( errno != EINVAL ) + { + /* Failed querying crop sizes, write error to the log and continue as if crop is not supported */ + Error( "Failed to query crop: %s", strerror(errno) ); + } + + if ( verbose ) { + sprintf( output+strlen(output), " Cropping is not supported\n"); + } else { + /* Send fake crop bounds to not confuse things parsing this, such as monitor probe */ + sprintf( output+strlen(output), "B:%dx%d|",0,0); + } + } else { + /* Cropping supported */ + if ( verbose ) { + sprintf( output+strlen(output), " Bounds: %d x %d\n", cropcap.bounds.width, cropcap.bounds.height ); + sprintf( output+strlen(output), " Default: %d x %d\n", cropcap.defrect.width, cropcap.defrect.height ); + sprintf( output+strlen(output), " Current: %d x %d\n", crop.c.width, crop.c.height ); + } else { + sprintf( output+strlen(output), "B:%dx%d|", cropcap.bounds.width, cropcap.bounds.height ); + } + } + } /* Crop code */ + + struct v4l2_input input; + int inputIndex = 0; + do + { + memset( &input, 0, sizeof(input) ); + input.index = inputIndex; + + if ( vidioctl( vid_fd, VIDIOC_ENUMINPUT, &input ) < 0 ) + { + if ( errno == EINVAL ) + { + break; + } + else + { + Error( "Failed to enumerate input %d: %s", input.index, strerror(errno) ); + if ( verbose ) + sprintf( output, "Error, failed to enumerate input %d: %s\n", input.index, strerror(errno) ); + else + sprintf( output, "error%d\n", errno ); + return( false ); + } + } + } + while ( inputIndex++ >= 0 ); + + if ( verbose ) + sprintf( output+strlen(output), "Inputs: %d\n", inputIndex ); + else + sprintf( output+strlen(output), "I:%d|", inputIndex ); + + inputIndex = 0; + do + { + memset( &input, 0, sizeof(input) ); + input.index = inputIndex; + + if ( vidioctl( vid_fd, VIDIOC_ENUMINPUT, &input ) < 0 ) + { + if ( errno == EINVAL ) + { + inputIndex = -1; + break; + } + else + { + Error( "Failed to enumerate input %d: %s", input.index, strerror(errno) ); + if ( verbose ) + sprintf( output, "Error, failed to enumerate input %d: %s\n", input.index, strerror(errno) ); + else + sprintf( output, "error%d\n", errno ); + return( false ); + } + } + + if ( vidioctl( vid_fd, VIDIOC_S_INPUT, &input.index ) < 0 ) + { + Error( "Failed to set video input %d: %s", input.index, strerror(errno) ); + if ( verbose ) + sprintf( output, "Error, failed to switch to input %d: %s\n", input.index, strerror(errno) ); + else + sprintf( output, "error%d\n", errno ); + return( false ); + } + + if ( verbose ) + { + sprintf( output+strlen(output), " Input %d\n", input.index ); + sprintf( output+strlen(output), " Name: %s\n", input.name ); + sprintf( output+strlen(output), " Type: %s\n", input.type==V4L2_INPUT_TYPE_TUNER?"Tuner":(input.type==V4L2_INPUT_TYPE_CAMERA?"Camera":"Unknown") ); + sprintf( output+strlen(output), " Audioset: %08x\n", input.audioset ); + sprintf( output+strlen(output), " Standards: 0x%llx\n", input.std ); + } + else + { + sprintf( output+strlen(output), "i%d:%s|", input.index, input.name ); + sprintf( output+strlen(output), "i%dT:%s|", input.index, input.type==V4L2_INPUT_TYPE_TUNER?"Tuner":(input.type==V4L2_INPUT_TYPE_CAMERA?"Camera":"Unknown") ); + sprintf( output+strlen(output), "i%dS:%llx|", input.index, input.std ); + } + + if ( verbose ) + { + sprintf( output+strlen(output), " %s", capString( input.status&V4L2_IN_ST_NO_POWER, "Power ", "off", "on", " (X)" ) ); + sprintf( output+strlen(output), " %s", capString( input.status&V4L2_IN_ST_NO_SIGNAL, "Signal ", "not detected", "detected", " (X)" ) ); + sprintf( output+strlen(output), " %s", capString( input.status&V4L2_IN_ST_NO_COLOR, "Colour Signal ", "not detected", "detected", "" ) ); + sprintf( output+strlen(output), " %s", capString( input.status&V4L2_IN_ST_NO_H_LOCK, "Horizontal Lock ", "not detected", "detected", "" ) ); + } + else + { + sprintf( output+strlen(output), "i%dSP:%d|", input.index, input.status&V4L2_IN_ST_NO_POWER?0:1 ); + sprintf( output+strlen(output), "i%dSS:%d|", input.index, input.status&V4L2_IN_ST_NO_SIGNAL?0:1 ); + sprintf( output+strlen(output), "i%dSC:%d|", input.index, input.status&V4L2_IN_ST_NO_COLOR?0:1 ); + sprintf( output+strlen(output), "i%dHP:%d|", input.index, input.status&V4L2_IN_ST_NO_H_LOCK?0:1 ); + } + } + while ( inputIndex++ >= 0 ); + if ( !verbose ) + output[strlen(output)-1] = '\n'; + } +#endif // ZM_HAS_V4L2 +#if ZM_HAS_V4L1 + if ( version == 1 ) + { + struct video_capability vid_cap; + memset( &vid_cap, 0, sizeof(video_capability) ); + if ( ioctl( vid_fd, VIDIOCGCAP, &vid_cap ) < 0 ) + { + Error( "Failed to get video capabilities: %s", strerror(errno) ); + if ( verbose ) + sprintf( output, "Error, failed to get video capabilities %s: %s\n", queryDevice, strerror(errno) ); + else + sprintf( output, "error%d\n", errno ); + return( false ); + } + if ( verbose ) + { + sprintf( output+strlen(output), "Video Capabilities\n" ); + sprintf( output+strlen(output), " Name: %s\n", vid_cap.name ); + sprintf( output+strlen(output), " Type: %d\n%s%s%s%s%s%s%s%s%s%s%s%s%s%s", vid_cap.type, + vid_cap.type&VID_TYPE_CAPTURE?" Can capture\n":"", + vid_cap.type&VID_TYPE_TUNER?" Can tune\n":"", + vid_cap.type&VID_TYPE_TELETEXT?" Does teletext\n":"", + vid_cap.type&VID_TYPE_OVERLAY?" Overlay onto frame buffer\n":"", + vid_cap.type&VID_TYPE_CHROMAKEY?" Overlay by chromakey\n":"", + vid_cap.type&VID_TYPE_CLIPPING?" Can clip\n":"", + vid_cap.type&VID_TYPE_FRAMERAM?" Uses the frame buffer memory\n":"", + vid_cap.type&VID_TYPE_SCALES?" Scalable\n":"", + vid_cap.type&VID_TYPE_MONOCHROME?" Monochrome only\n":"", + vid_cap.type&VID_TYPE_SUBCAPTURE?" Can capture subareas of the image\n":"", + vid_cap.type&VID_TYPE_MPEG_DECODER?" Can decode MPEG streams\n":"", + vid_cap.type&VID_TYPE_MPEG_ENCODER?" Can encode MPEG streams\n":"", + vid_cap.type&VID_TYPE_MJPEG_DECODER?" Can decode MJPEG streams\n":"", + vid_cap.type&VID_TYPE_MJPEG_ENCODER?" Can encode MJPEG streams\n":"" + ); + sprintf( output+strlen(output), " Video Channels: %d\n", vid_cap.channels ); + sprintf( output+strlen(output), " Audio Channels: %d\n", vid_cap.audios ); + sprintf( output+strlen(output), " Maximum Width: %d\n", vid_cap.maxwidth ); + sprintf( output+strlen(output), " Maximum Height: %d\n", vid_cap.maxheight ); + sprintf( output+strlen(output), " Minimum Width: %d\n", vid_cap.minwidth ); + sprintf( output+strlen(output), " Minimum Height: %d\n", vid_cap.minheight ); + } + else + { + sprintf( output+strlen(output), "N:%s|", vid_cap.name ); + sprintf( output+strlen(output), "T:%d|", vid_cap.type ); + sprintf( output+strlen(output), "nC:%d|", vid_cap.channels ); + sprintf( output+strlen(output), "nA:%d|", vid_cap.audios ); + sprintf( output+strlen(output), "mxW:%d|", vid_cap.maxwidth ); + sprintf( output+strlen(output), "mxH:%d|", vid_cap.maxheight ); + sprintf( output+strlen(output), "mnW:%d|", vid_cap.minwidth ); + sprintf( output+strlen(output), "mnH:%d|", vid_cap.minheight ); + } + + struct video_window vid_win; + memset( &vid_win, 0, sizeof(video_window) ); + if ( ioctl( vid_fd, VIDIOCGWIN, &vid_win ) < 0 ) + { + Error( "Failed to get window attributes: %s", strerror(errno) ); + if ( verbose ) + sprintf( output, "Error, failed to get window attributes: %s\n", strerror(errno) ); + else + sprintf( output, "error%d\n", errno ); + return( false ); + } + if ( verbose ) + { + sprintf( output+strlen(output), "Window Attributes\n" ); + sprintf( output+strlen(output), " X Offset: %d\n", vid_win.x ); + sprintf( output+strlen(output), " Y Offset: %d\n", vid_win.y ); + sprintf( output+strlen(output), " Width: %d\n", vid_win.width ); + sprintf( output+strlen(output), " Height: %d\n", vid_win.height ); + } + else + { + sprintf( output+strlen(output), "X:%d|", vid_win.x ); + sprintf( output+strlen(output), "Y:%d|", vid_win.y ); + sprintf( output+strlen(output), "W:%d|", vid_win.width ); + sprintf( output+strlen(output), "H:%d|", vid_win.height ); + } + + struct video_picture vid_pic; + memset( &vid_cap, 0, sizeof(video_picture) ); + if ( ioctl( vid_fd, VIDIOCGPICT, &vid_pic ) < 0 ) + { + Error( "Failed to get picture attributes: %s", strerror(errno) ); + if ( verbose ) + sprintf( output, "Error, failed to get picture attributes: %s\n", strerror(errno) ); + else + sprintf( output, "error%d\n", errno ); + return( false ); + } + if ( verbose ) + { + sprintf( output+strlen(output), "Picture Attributes\n" ); + sprintf( output+strlen(output), " Palette: %d - %s\n", vid_pic.palette, + vid_pic.palette==VIDEO_PALETTE_GREY?"Linear greyscale":( + vid_pic.palette==VIDEO_PALETTE_HI240?"High 240 cube (BT848)":( + vid_pic.palette==VIDEO_PALETTE_RGB565?"565 16 bit RGB":( + vid_pic.palette==VIDEO_PALETTE_RGB24?"24bit RGB":( + vid_pic.palette==VIDEO_PALETTE_RGB32?"32bit RGB":( + vid_pic.palette==VIDEO_PALETTE_RGB555?"555 15bit RGB":( + vid_pic.palette==VIDEO_PALETTE_YUV422?"YUV422 capture":( + vid_pic.palette==VIDEO_PALETTE_YUYV?"YUYV":( + vid_pic.palette==VIDEO_PALETTE_UYVY?"UVYV":( + vid_pic.palette==VIDEO_PALETTE_YUV420?"YUV420":( + vid_pic.palette==VIDEO_PALETTE_YUV411?"YUV411 capture":( + vid_pic.palette==VIDEO_PALETTE_RAW?"RAW capture (BT848)":( + vid_pic.palette==VIDEO_PALETTE_YUYV?"YUYV":( + vid_pic.palette==VIDEO_PALETTE_YUV422?"YUV422":( + vid_pic.palette==VIDEO_PALETTE_YUV422P?"YUV 4:2:2 Planar":( + vid_pic.palette==VIDEO_PALETTE_YUV411P?"YUV 4:1:1 Planar":( + vid_pic.palette==VIDEO_PALETTE_YUV420P?"YUV 4:2:0 Planar":( + vid_pic.palette==VIDEO_PALETTE_YUV410P?"YUV 4:1:0 Planar":"Unknown" + )))))))))))))))))); + sprintf( output+strlen(output), " Colour Depth: %d\n", vid_pic.depth ); + sprintf( output+strlen(output), " Brightness: %d\n", vid_pic.brightness ); + sprintf( output+strlen(output), " Hue: %d\n", vid_pic.hue ); + sprintf( output+strlen(output), " Colour :%d\n", vid_pic.colour ); + sprintf( output+strlen(output), " Contrast: %d\n", vid_pic.contrast ); + sprintf( output+strlen(output), " Whiteness: %d\n", vid_pic.whiteness ); + } + else + { + sprintf( output+strlen(output), "P:%d|", vid_pic.palette ); + sprintf( output+strlen(output), "D:%d|", vid_pic.depth ); + sprintf( output+strlen(output), "B:%d|", vid_pic.brightness ); + sprintf( output+strlen(output), "h:%d|", vid_pic.hue ); + sprintf( output+strlen(output), "Cl:%d|", vid_pic.colour ); + sprintf( output+strlen(output), "Cn:%d|", vid_pic.contrast ); + sprintf( output+strlen(output), "w:%d|", vid_pic.whiteness ); + } + + for ( int chan = 0; chan < vid_cap.channels; chan++ ) + { + struct video_channel vid_src; + memset( &vid_src, 0, sizeof(video_channel) ); + vid_src.channel = chan; + if ( ioctl( vid_fd, VIDIOCGCHAN, &vid_src ) < 0 ) + { + Error( "Failed to get channel %d attributes: %s", chan, strerror(errno) ); + if ( verbose ) + sprintf( output, "Error, failed to get channel %d attributes: %s\n", chan, strerror(errno) ); + else + sprintf( output, "error%d\n", errno ); + return( false ); + } + if ( verbose ) + { + sprintf( output+strlen(output), "Channel %d Attributes\n", chan ); + sprintf( output+strlen(output), " Name: %s\n", vid_src.name ); + sprintf( output+strlen(output), " Channel: %d\n", vid_src.channel ); + sprintf( output+strlen(output), " Flags: %d\n%s%s", vid_src.flags, + vid_src.flags&VIDEO_VC_TUNER?" Channel has a tuner\n":"", + vid_src.flags&VIDEO_VC_AUDIO?" Channel has audio\n":"" + ); + sprintf( output+strlen(output), " Type: %d - %s\n", vid_src.type, + vid_src.type==VIDEO_TYPE_TV?"TV":( + vid_src.type==VIDEO_TYPE_CAMERA?"Camera":"Unknown" + )); + sprintf( output+strlen(output), " Format: %d - %s\n", vid_src.norm, + vid_src.norm==VIDEO_MODE_PAL?"PAL":( + vid_src.norm==VIDEO_MODE_NTSC?"NTSC":( + vid_src.norm==VIDEO_MODE_SECAM?"SECAM":( + vid_src.norm==VIDEO_MODE_AUTO?"AUTO":"Unknown" + )))); + } + else + { + sprintf( output+strlen(output), "n%d:%s|", chan, vid_src.name ); + sprintf( output+strlen(output), "C%d:%d|", chan, vid_src.channel ); + sprintf( output+strlen(output), "Fl%d:%x|", chan, vid_src.flags ); + sprintf( output+strlen(output), "T%d:%d|", chan, vid_src.type ); + sprintf( output+strlen(output), "F%d:%d%s|", chan, vid_src.norm, chan==(vid_cap.channels-1)?"":"," ); + } + } + if ( !verbose ) + output[strlen(output)-1] = '\n'; + } +#endif // ZM_HAS_V4L1 + close( vid_fd ); + if ( device ) + break; + } + while ( ++devIndex < 32 ); + return( true ); +} + +int LocalCamera::Brightness( int p_brightness ) +{ +#if ZM_HAS_V4L2 + if ( v4l_version == 2 ) + { + struct v4l2_control vid_control; + + memset( &vid_control, 0, sizeof(vid_control) ); + vid_control.id = V4L2_CID_BRIGHTNESS; + + if ( vidioctl( vid_fd, VIDIOC_G_CTRL, &vid_control ) < 0 ) + { + if ( errno != EINVAL ) + Error( "Unable to query brightness: %s", strerror(errno) ) + else + Warning( "Brightness control is not suppported" ) + //Info( "Brightness 1 %d", vid_control.value ); + } + else if ( p_brightness >= 0 ) + { + vid_control.value = p_brightness; + + //Info( "Brightness 2 %d", vid_control.value ); + /* The driver may clamp the value or return ERANGE, ignored here */ + if ( vidioctl ( vid_fd, VIDIOC_S_CTRL, &vid_control ) ) + { + if ( errno != ERANGE ) + Error( "Unable to set brightness: %s", strerror(errno) ) + else + Warning( "Given brightness value (%d) may be out-of-range", p_brightness ) + } + //Info( "Brightness 3 %d", vid_control.value ); + } + return( vid_control.value ); + } +#endif // ZM_HAS_V4L2 +#if ZM_HAS_V4L1 + if ( v4l_version == 1 ) + { + struct video_picture vid_pic; + memset( &vid_pic, 0, sizeof(video_picture) ); + if ( ioctl( vid_fd, VIDIOCGPICT, &vid_pic) < 0 ) + { + Error( "Failed to get picture attributes: %s", strerror(errno) ); + return( -1 ); + } + + if ( p_brightness >= 0 ) + { + vid_pic.brightness = p_brightness; + if ( ioctl( vid_fd, VIDIOCSPICT, &vid_pic ) < 0 ) + { + Error( "Failed to set picture attributes: %s", strerror(errno) ); + return( -1 ); + } + } + return( vid_pic.brightness ); + } +#endif // ZM_HAS_V4L1 + return( -1 ); +} + +int LocalCamera::Hue( int p_hue ) +{ +#if ZM_HAS_V4L2 + if ( v4l_version == 2 ) + { + struct v4l2_control vid_control; + + memset( &vid_control, 0, sizeof(vid_control) ); + vid_control.id = V4L2_CID_HUE; + + if ( vidioctl( vid_fd, VIDIOC_G_CTRL, &vid_control ) < 0 ) + { + if ( errno != EINVAL ) + Error( "Unable to query hue: %s", strerror(errno) ) + else + Warning( "Hue control is not suppported" ) + } + else if ( p_hue >= 0 ) + { + vid_control.value = p_hue; + + /* The driver may clamp the value or return ERANGE, ignored here */ + if ( vidioctl ( vid_fd, VIDIOC_S_CTRL, &vid_control ) < 0 ) + { + if ( errno != ERANGE ) + Error( "Unable to set hue: %s", strerror(errno) ) + else + Warning( "Given hue value (%d) may be out-of-range", p_hue ) + } + } + return( vid_control.value ); + } +#endif // ZM_HAS_V4L2 +#if ZM_HAS_V4L1 + if ( v4l_version == 1 ) + { + struct video_picture vid_pic; + memset( &vid_pic, 0, sizeof(video_picture) ); + if ( ioctl( vid_fd, VIDIOCGPICT, &vid_pic) < 0 ) + { + Error( "Failed to get picture attributes: %s", strerror(errno) ); + return( -1 ); + } + + if ( p_hue >= 0 ) + { + vid_pic.hue = p_hue; + if ( ioctl( vid_fd, VIDIOCSPICT, &vid_pic ) < 0 ) + { + Error( "Failed to set picture attributes: %s", strerror(errno) ); + return( -1 ); + } + } + return( vid_pic.hue ); + } +#endif // ZM_HAS_V4L1 + return( -1 ); +} + +int LocalCamera::Colour( int p_colour ) +{ +#if ZM_HAS_V4L2 + if ( v4l_version == 2 ) + { + struct v4l2_control vid_control; + + memset( &vid_control, 0, sizeof(vid_control) ); + vid_control.id = V4L2_CID_SATURATION; + + if ( vidioctl( vid_fd, VIDIOC_G_CTRL, &vid_control ) < 0 ) + { + if ( errno != EINVAL ) + Error( "Unable to query saturation: %s", strerror(errno) ) + else + Warning( "Saturation control is not suppported" ) + } + else if ( p_colour >= 0 ) + { + vid_control.value = p_colour; + + /* The driver may clamp the value or return ERANGE, ignored here */ + if ( vidioctl ( vid_fd, VIDIOC_S_CTRL, &vid_control ) < 0 ) + { + if ( errno != ERANGE ) + Error( "Unable to set saturation: %s", strerror(errno) ) + else + Warning( "Given saturation value (%d) may be out-of-range", p_colour ) + } + } + return( vid_control.value ); + } +#endif // ZM_HAS_V4L2 +#if ZM_HAS_V4L1 + if ( v4l_version == 1 ) + { + struct video_picture vid_pic; + memset( &vid_pic, 0, sizeof(video_picture) ); + if ( ioctl( vid_fd, VIDIOCGPICT, &vid_pic) < 0 ) + { + Error( "Failed to get picture attributes: %s", strerror(errno) ); + return( -1 ); + } + + if ( p_colour >= 0 ) + { + vid_pic.colour = p_colour; + if ( ioctl( vid_fd, VIDIOCSPICT, &vid_pic ) < 0 ) + { + Error( "Failed to set picture attributes: %s", strerror(errno) ); + return( -1 ); + } + } + return( vid_pic.colour ); + } +#endif // ZM_HAS_V4L1 + return( -1 ); +} + +int LocalCamera::Contrast( int p_contrast ) +{ +#if ZM_HAS_V4L2 + if ( v4l_version == 2 ) + { + struct v4l2_control vid_control; + + memset( &vid_control, 0, sizeof(vid_control) ); + vid_control.id = V4L2_CID_CONTRAST; + + if ( vidioctl( vid_fd, VIDIOC_G_CTRL, &vid_control ) < 0 ) + { + if ( errno != EINVAL ) + Error( "Unable to query contrast: %s", strerror(errno) ) + else + Warning( "Contrast control is not suppported" ) + } + else if ( p_contrast >= 0 ) + { + vid_control.value = p_contrast; + + /* The driver may clamp the value or return ERANGE, ignored here */ + if ( vidioctl ( vid_fd, VIDIOC_S_CTRL, &vid_control ) ) + { + if ( errno != ERANGE ) + Error( "Unable to set contrast: %s", strerror(errno) ) + else + Warning( "Given contrast value (%d) may be out-of-range", p_contrast ) + } + } + return( vid_control.value ); + } +#endif // ZM_HAS_V4L2 +#if ZM_HAS_V4L1 + if ( v4l_version == 1 ) + { + struct video_picture vid_pic; + memset( &vid_pic, 0, sizeof(video_picture) ); + if ( ioctl( vid_fd, VIDIOCGPICT, &vid_pic) < 0 ) + { + Error( "Failed to get picture attributes: %s", strerror(errno) ); + return( -1 ); + } + + if ( p_contrast >= 0 ) + { + vid_pic.contrast = p_contrast; + if ( ioctl( vid_fd, VIDIOCSPICT, &vid_pic ) < 0 ) + { + Error( "Failed to set picture attributes: %s", strerror(errno) ); + return( -1 ); + } + } + return( vid_pic.contrast ); + } +#endif // ZM_HAS_V4L1 + return( -1 ); +} + +int LocalCamera::PrimeCapture() +{ + Initialise(); + + Debug( 2, "Priming capture" ); +#if ZM_HAS_V4L2 + if ( v4l_version == 2 ) + { + Debug( 3, "Queueing buffers" ); + for ( unsigned int frame = 0; frame < v4l2_data.reqbufs.count; frame++ ) + { + struct v4l2_buffer vid_buf; + + memset( &vid_buf, 0, sizeof(vid_buf) ); + + vid_buf.type = v4l2_data.fmt.type; + vid_buf.memory = v4l2_data.reqbufs.memory; + vid_buf.index = frame; + + if ( vidioctl( vid_fd, VIDIOC_QBUF, &vid_buf ) < 0 ) + Fatal( "Failed to queue buffer %d: %s", frame, strerror(errno) ); + } + v4l2_data.bufptr = NULL; + + Debug( 3, "Starting video stream" ); + //enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + //enum v4l2_buf_type type = v4l2_data.fmt.type; + enum v4l2_buf_type type = (v4l2_buf_type)v4l2_data.fmt.type; + if ( vidioctl( vid_fd, VIDIOC_STREAMON, &type ) < 0 ) + Fatal( "Failed to start capture stream: %s", strerror(errno) ); + } +#endif // ZM_HAS_V4L2 +#if ZM_HAS_V4L1 + if ( v4l_version == 1 ) + { + for ( int frame = 0; frame < v4l1_data.frames.frames; frame++ ) + { + Debug( 3, "Queueing frame %d", frame ); + if ( ioctl( vid_fd, VIDIOCMCAPTURE, &v4l1_data.buffers[frame] ) < 0 ) + { + Error( "Capture failure for frame %d: %s", frame, strerror(errno) ); + return( -1 ); + } + } + } +#endif // ZM_HAS_V4L1 + + return( 0 ); +} + +int LocalCamera::PreCapture() +{ + Debug( 2, "Pre-capturing" ); + return( 0 ); +} + +int LocalCamera::Capture( Image &image ) +{ + Debug( 3, "Capturing" ); + static uint8_t* buffer = NULL; + static uint8_t* directbuffer = NULL; + static int capture_frame = -1; + int buffer_bytesused = 0; + + int captures_per_frame = 1; + if ( channel_count > 1 ) + captures_per_frame = config.captures_per_frame; + + + // Do the capture, unless we are the second or subsequent camera on a channel, in which case just reuse the buffer + if ( channel_prime ) + { +#if ZM_HAS_V4L2 + if ( v4l_version == 2 ) + { + static struct v4l2_buffer vid_buf; + + memset( &vid_buf, 0, sizeof(vid_buf) ); + + vid_buf.type = v4l2_data.fmt.type; + //vid_buf.memory = V4L2_MEMORY_MMAP; + vid_buf.memory = v4l2_data.reqbufs.memory; + + Debug( 3, "Capturing %d frames", captures_per_frame ); + while ( captures_per_frame ) + { + if ( vidioctl( vid_fd, VIDIOC_DQBUF, &vid_buf ) < 0 ) + { + if ( errno == EIO ) + Warning( "Capture failure, possible signal loss?: %s", strerror(errno) ) + else + Error( "Unable to capture frame %d: %s", vid_buf.index, strerror(errno) ) + return( -1 ); + } + + v4l2_data.bufptr = &vid_buf; + capture_frame = v4l2_data.bufptr->index; + if ( --captures_per_frame ) + { + if ( vidioctl( vid_fd, VIDIOC_QBUF, &vid_buf ) < 0 ) + { + Error( "Unable to requeue buffer %d: %s", vid_buf.index, strerror(errno) ); + return( -1 ); + } + } + } + + Debug( 3, "Captured frame %d/%d from channel %d", capture_frame, v4l2_data.bufptr->sequence, channel ); + + buffer = (unsigned char *)v4l2_data.buffers[v4l2_data.bufptr->index].start; + buffer_bytesused = v4l2_data.bufptr->bytesused; + + if((v4l2_data.fmt.fmt.pix.width * v4l2_data.fmt.fmt.pix.height) != (width * height)) { + Fatal("Captured image dimensions differ: V4L2: %dx%d monitor: %dx%d",v4l2_data.fmt.fmt.pix.width,v4l2_data.fmt.fmt.pix.height,width,height); + } + + } +#endif // ZM_HAS_V4L2 +#if ZM_HAS_V4L1 + if ( v4l_version == 1 ) + { + Debug( 3, "Capturing %d frames", captures_per_frame ); + while ( captures_per_frame ) + { + Debug( 3, "Syncing frame %d", v4l1_data.active_frame ); + if ( ioctl( vid_fd, VIDIOCSYNC, &v4l1_data.active_frame ) < 0 ) + { + Error( "Sync failure for frame %d buffer %d: %s", v4l1_data.active_frame, captures_per_frame, strerror(errno) ); + return( -1 ); + } + captures_per_frame--; + if ( captures_per_frame ) + { + Debug( 3, "Capturing frame %d", v4l1_data.active_frame ); + if ( ioctl( vid_fd, VIDIOCMCAPTURE, &v4l1_data.buffers[v4l1_data.active_frame] ) < 0 ) + { + Error( "Capture failure for buffer %d (%d): %s", v4l1_data.active_frame, captures_per_frame, strerror(errno) ); + return( -1 ); + } + } + } + capture_frame = v4l1_data.active_frame; + Debug( 3, "Captured %d for channel %d", capture_frame, channel ); + + buffer = v4l1_data.bufptr+v4l1_data.frames.offsets[capture_frame]; + } +#endif // ZM_HAS_V4L1 + } /* prime capture */ + + if(conversion_type != 0) { + + Debug( 3, "Performing format conversion" ); + + /* Request a writeable buffer of the target image */ + directbuffer = image.WriteBuffer(width, height, colours, subpixelorder); + if(directbuffer == NULL) { + Error("Failed requesting writeable buffer for the captured image."); + return (-1); + } +#if HAVE_LIBSWSCALE + if(conversion_type == 1) { + + Debug( 9, "Calling sws_scale to perform the conversion" ); + /* Use swscale to convert the image directly into the shared memory */ + avpicture_fill( (AVPicture *)tmpPicture, directbuffer, imagePixFormat, width, height ); + sws_scale( imgConversionContext, capturePictures[capture_frame]->data, capturePictures[capture_frame]->linesize, 0, height, tmpPicture->data, tmpPicture->linesize ); + } +#endif + if(conversion_type == 2) { + + Debug( 9, "Calling the conversion function" ); + /* Call the image conversion function and convert directly into the shared memory */ + (*conversion_fptr)(buffer, directbuffer, pixels); + } + else if(conversion_type == 3) { + + Debug( 9, "Decoding the JPEG image" ); + /* JPEG decoding */ + image.DecodeJpeg(buffer, buffer_bytesused, colours, subpixelorder); + } + + } else { + Debug( 3, "No format conversion performed. Assigning the image" ); + + /* No conversion was performed, the image is in the V4L buffers and needs to be copied into the shared memory */ + image.Assign( width, height, colours, subpixelorder, buffer, imagesize); + + } + + return( 0 ); +} + +int LocalCamera::PostCapture() +{ + Debug( 2, "Post-capturing" ); + // Requeue the buffer unless we need to switch or are a duplicate camera on a channel + if ( channel_count > 1 || channel_prime ) + { +#if ZM_HAS_V4L2 + if ( v4l_version == 2 ) + { + if ( channel_count > 1 ) + { + int next_channel = (channel_index+1)%channel_count; + Debug( 3, "Switching video source to %d", channels[next_channel] ); + if ( vidioctl( vid_fd, VIDIOC_S_INPUT, &channels[next_channel] ) < 0 ) + { + Error( "Failed to set camera source %d: %s", channels[next_channel], strerror(errno) ); + return( -1 ); + } + + v4l2_std_id stdId = standards[next_channel]; + if ( vidioctl( vid_fd, VIDIOC_S_STD, &stdId ) < 0 ) + { + Error( "Failed to set video format %d: %s", standards[next_channel], strerror(errno) ); + return( -1 ); + } + } + Debug( 3, "Requeueing buffer %d", v4l2_data.bufptr->index ); + if ( vidioctl( vid_fd, VIDIOC_QBUF, v4l2_data.bufptr ) < 0 ) + { + Error( "Unable to requeue buffer %d: %s", v4l2_data.bufptr->index, strerror(errno) ) + return( -1 ); + } + } +#endif // ZM_HAS_V4L2 +#if ZM_HAS_V4L1 + if ( v4l_version == 1 ) + { + if ( channel_count > 1 ) + { + Debug( 3, "Switching video source" ); + int next_channel = (channel_index+1)%channel_count; + struct video_channel vid_src; + memset( &vid_src, 0, sizeof(vid_src) ); + vid_src.channel = channel; + if ( ioctl( vid_fd, VIDIOCGCHAN, &vid_src) < 0 ) + { + Error( "Failed to get camera source %d: %s", channel, strerror(errno) ); + return(-1); + } + + vid_src.channel = channels[next_channel]; + vid_src.norm = standards[next_channel]; + vid_src.flags = 0; + vid_src.type = VIDEO_TYPE_CAMERA; + if ( ioctl( vid_fd, VIDIOCSCHAN, &vid_src ) < 0 ) + { + Error( "Failed to set camera source %d: %s", channel, strerror(errno) ); + return( -1 ); + } + } + Debug( 3, "Requeueing frame %d", v4l1_data.active_frame ); + if ( ioctl( vid_fd, VIDIOCMCAPTURE, &v4l1_data.buffers[v4l1_data.active_frame] ) < 0 ) + { + Error( "Capture failure for frame %d: %s", v4l1_data.active_frame, strerror(errno) ); + return( -1 ); + } + v4l1_data.active_frame = (v4l1_data.active_frame+1)%v4l1_data.frames.frames; + } +#endif // ZM_HAS_V4L1 + } + return( 0 ); +} + +#endif // ZM_HAS_V4L diff --git a/src/zm_local_camera.h b/src/zm_local_camera.h new file mode 100644 index 000000000..05f06fe44 --- /dev/null +++ b/src/zm_local_camera.h @@ -0,0 +1,143 @@ +// +// ZoneMinder Local Camera Class Interface, $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. +// + +#ifndef ZM_LOCAL_CAMERA_H +#define ZM_LOCAL_CAMERA_H + +#include "zm.h" +#include "zm_camera.h" +#include "zm_image.h" + +#if ZM_HAS_V4L + +#ifdef HAVE_LINUX_VIDEODEV_H +#include +#endif // HAVE_LINUX_VIDEODEV_H +#ifdef HAVE_LINUX_VIDEODEV2_H +#include +#endif // HAVE_LINUX_VIDEODEV2_H + +#include "zm_ffmpeg.h" + +// +// Class representing 'local' cameras, i.e. those which are +// directly connect to the host machine and which are accessed +// via a video interface. +// +class LocalCamera : public Camera +{ +protected: +#if ZM_HAS_V4L2 + struct V4L2MappedBuffer + { + void *start; + size_t length; + }; + + struct V4L2Data + { + v4l2_cropcap cropcap; + v4l2_crop crop; + v4l2_format fmt; + v4l2_requestbuffers reqbufs; + V4L2MappedBuffer *buffers; + v4l2_buffer *bufptr; + }; +#endif // ZM_HAS_V4L2 + +#if ZM_HAS_V4L1 + struct V4L1Data + { + int active_frame; + video_mbuf frames; + video_mmap *buffers; + unsigned char *bufptr; + }; +#endif // ZM_HAS_V4L1 + +protected: + std::string device; + int channel; + int standard; + int palette; + bool device_prime; + bool channel_prime; + int channel_index; + unsigned int extras; + + unsigned int conversion_type; /* 0 = no conversion needed, 1 = use libswscale, 2 = zm internal conversion, 3 = jpeg decoding */ + convert_fptr_t conversion_fptr; /* Pointer to conversion function used */ + + uint32_t AutoSelectFormat(int p_colours); + +protected: + static int camera_count; + static int channel_count; + static int channels[VIDEO_MAX_FRAME]; + static int standards[VIDEO_MAX_FRAME]; + static int vid_fd; + static int v4l_version; + +#if ZM_HAS_V4L2 + static V4L2Data v4l2_data; +#endif // ZM_HAS_V4L2 +#if ZM_HAS_V4L1 + static V4L1Data v4l1_data; +#endif // ZM_HAS_V4L1 + +#if HAVE_LIBSWSCALE + static AVFrame **capturePictures; + PixelFormat imagePixFormat; + PixelFormat capturePixFormat; + struct SwsContext *imgConversionContext; + AVFrame *tmpPicture; +#endif // HAVE_LIBSWSCALE + + static LocalCamera *last_camera; + +public: + LocalCamera( int p_id, const std::string &device, int p_channel, int p_format, const std::string &p_method, int p_width, int p_height, int p_colours, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture, unsigned int p_extras = 0); + ~LocalCamera(); + + void Initialise(); + void Terminate(); + + const std::string &Device() const { return( device ); } + + int Channel() const { return( channel ); } + int Standard() const { return( standard ); } + int Palette() const { return( palette ); } + int Extras() const { return( extras ); } + + int Brightness( int p_brightness=-1 ); + int Hue( int p_hue=-1 ); + int Colour( int p_colour=-1 ); + int Contrast( int p_contrast=-1 ); + + int PrimeCapture(); + int PreCapture(); + int Capture( Image &image ); + int PostCapture(); + + static bool GetCurrentSettings( const char *device, char *output, int version, bool verbose ); +}; + +#endif // ZM_HAS_V4L + +#endif // ZM_LOCAL_CAMERA_H diff --git a/src/zm_logger.cpp b/src/zm_logger.cpp new file mode 100644 index 000000000..512b6af1c --- /dev/null +++ b/src/zm_logger.cpp @@ -0,0 +1,610 @@ +/* + * ZoneMinder Logger Implementation, $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. +*/ + +#include "zm_logger.h" + +#include "zm_config.h" +#include "zm_utils.h" + +#include +#include +#include +#include +#include +#ifdef HAVE_SYSCALL_H +#include +#endif // HAVE_SYSCALL_H +#include +#include +#include + +bool Logger::smInitialised = false; +Logger *Logger::smInstance = 0; + +Logger::StringMap Logger::smCodes; +Logger::IntMap Logger::smSyslogPriorities; + +#if 0 +static void subtractTime( struct timeval * const tp1, struct timeval * const tp2 ) +{ + tp1->tv_sec -= tp2->tv_sec; + if ( tp1->tv_usec <= tp2->tv_usec ) + { + tp1->tv_sec--; + tp1->tv_usec = 1000000 - (tp2->tv_usec - tp1->tv_usec); + } + else + { + tp1->tv_usec = tp1->tv_usec - tp2->tv_usec; + } +} +#endif + +void Logger::usrHandler( int sig ) +{ + Logger *logger = fetch(); + if ( sig == SIGUSR1 ) + logger->level( logger->level()+1 ); + else if ( sig == SIGUSR2 ) + logger->level( logger->level()-1 ); + Info( "Logger - Level changed to %d", logger->level() ); +} + +Logger::Logger() : + mLevel( INFO ), + mTermLevel( NOLOG ), + mDatabaseLevel( NOLOG ), + mFileLevel( NOLOG ), + mSyslogLevel( NOLOG ), + mEffectiveLevel( NOLOG ), + //mLogPath( config.path_logs ), + //mLogFile( mLogPath+"/"+mId+".log" ), + mDbConnected( false ), + mLogFileFP( NULL ), + mHasTerm( false ), + mFlush( false ) +{ + if ( smInstance ) + { + Panic( "Attempt to create second instance of Logger class" ); + } + + if ( !smInitialised ) + { + smCodes[INFO] = "INF"; + smCodes[WARNING] = "WAR"; + smCodes[ERROR] = "ERR"; + smCodes[FATAL] = "FAT"; + smCodes[PANIC] = "PNC"; + smCodes[NOLOG] = "OFF"; + + smSyslogPriorities[INFO] = LOG_INFO; + smSyslogPriorities[WARNING] = LOG_WARNING; + smSyslogPriorities[ERROR] = LOG_ERR; + smSyslogPriorities[FATAL] = LOG_ERR; + smSyslogPriorities[PANIC] = LOG_ERR; + + char code[4] = ""; + for ( int i = DEBUG1; i <= DEBUG9; i++ ) + { + snprintf( code, sizeof(code), "DB%d", i ); + smCodes[i] = code; + smSyslogPriorities[i] = LOG_DEBUG; + } + + smInitialised = true; + } + + if ( fileno(stderr) && isatty(fileno(stderr)) ) + mHasTerm = true; +} + +Logger::~Logger() +{ + terminate(); +} + +void Logger::initialise( const std::string &id, const Options &options ) +{ + char *envPtr; + + if ( !id.empty() ) + this->id( id ); + + std::string tempLogFile; + if ( options.mLogPath.size() ) + { + mLogPath = options.mLogPath; + tempLogFile = mLogPath+"/"+mId+".log"; + } + if ( options.mLogFile.size() ) + tempLogFile = options.mLogFile; + else + tempLogFile = mLogPath+"/"+mId+".log"; + if ( (envPtr = getTargettedEnv( "LOG_FILE" )) ) + tempLogFile = envPtr; + + Level tempLevel = INFO; + Level tempTermLevel = mTermLevel; + Level tempDatabaseLevel = mDatabaseLevel; + Level tempFileLevel = mFileLevel; + Level tempSyslogLevel = mSyslogLevel; + + if ( options.mTermLevel != NOOPT ) + tempTermLevel = options.mTermLevel; + if ( options.mDatabaseLevel != NOOPT ) + tempDatabaseLevel = options.mDatabaseLevel; + else + tempDatabaseLevel = config.log_level_database >= DEBUG1 ? DEBUG9 : config.log_level_database; + if ( options.mFileLevel != NOOPT ) + tempFileLevel = options.mFileLevel; + else + tempFileLevel = config.log_level_file >= DEBUG1 ? DEBUG9 : config.log_level_file; + if ( options.mSyslogLevel != NOOPT ) + tempSyslogLevel = options.mSyslogLevel; + else + tempSyslogLevel = config.log_level_syslog >= DEBUG1 ? DEBUG9 : config.log_level_syslog; + + // Legacy + if ( (envPtr = getenv( "LOG_PRINT" )) ) + tempTermLevel = atoi(envPtr) ? DEBUG9 : NOLOG; + + if ( (envPtr = getTargettedEnv( "LOG_LEVEL" )) ) + tempLevel = atoi(envPtr); + + if ( (envPtr = getTargettedEnv( "LOG_LEVEL_TERM" )) ) + tempTermLevel = atoi(envPtr); + if ( (envPtr = getTargettedEnv( "LOG_LEVEL_DATABASE" )) ) + tempDatabaseLevel = atoi(envPtr); + if ( (envPtr = getTargettedEnv( "LOG_LEVEL_FILE" )) ) + tempFileLevel = atoi(envPtr); + if ( (envPtr = getTargettedEnv( "LOG_LEVEL_SYSLOG" )) ) + tempSyslogLevel = atoi(envPtr); + + if ( config.log_debug ) + { + StringVector targets = split( config.log_debug_target, "|" ); + for ( unsigned int i = 0; i < targets.size(); i++ ) + { + const std::string &target = targets[i]; + if ( target == mId || target == "_"+mId || target == "_"+mIdRoot || target == "_"+mIdRoot || target == "" ) + { + if ( config.log_debug_level > NOLOG ) + { + tempLevel = config.log_debug_level; + if ( config.log_debug_file[0] ) + { + tempLogFile = config.log_debug_file; + tempFileLevel = tempLevel; + } + } + } + } + } + + logFile( tempLogFile ); + + termLevel( tempTermLevel ); + databaseLevel( tempDatabaseLevel ); + fileLevel( tempFileLevel ); + syslogLevel( tempSyslogLevel ); + + level( tempLevel ); + + mFlush = (envPtr = getenv( "LOG_FLUSH")) ? atoi( envPtr ) : false; + + //mRuntime = (envPtr = getenv( "LOG_RUNTIME")) ? atoi( envPtr ) : false; + + { + struct sigaction action; + memset( &action, 0, sizeof(action) ); + action.sa_handler = usrHandler; + action.sa_flags = SA_RESTART; + + if ( sigaction( SIGUSR1, &action, 0 ) < 0 ) + { + Fatal( "sigaction(), error = %s", strerror(errno) ); + } + if ( sigaction( SIGUSR2, &action, 0 ) < 0) + { + Fatal( "sigaction(), error = %s", strerror(errno) ); + } + } + + mInitialised = true; + + Debug( 1, "LogOpts: level=%s/%s, screen=%s, database=%s, logfile=%s->%s, syslog=%s", smCodes[mLevel].c_str(), smCodes[mEffectiveLevel].c_str(), smCodes[mTermLevel].c_str(), smCodes[mDatabaseLevel].c_str(), smCodes[mFileLevel].c_str(), mLogFile.c_str(), smCodes[mSyslogLevel].c_str() ); +} + +void Logger::terminate() +{ + Info( "Terminating Logger" ); + + if ( mFileLevel > NOLOG ) + closeFile(); + + if ( mSyslogLevel > NOLOG ) + closeSyslog(); +} + +bool Logger::boolEnv( const std::string &name, bool defaultValue ) +{ + const char *envPtr = getenv( name.c_str() ); + return( envPtr ? atoi( envPtr ) : defaultValue ); +} + +int Logger::intEnv( const std::string &name, bool defaultValue ) +{ + const char *envPtr = getenv( name.c_str() ); + return( envPtr ? atoi( envPtr ) : defaultValue ); +} + +std::string Logger::strEnv( const std::string &name, const std::string defaultValue ) +{ + const char *envPtr = getenv( name.c_str() ); + return( envPtr ? envPtr : defaultValue ); +} + +char *Logger::getTargettedEnv( const std::string &name ) +{ + char *envPtr = NULL; + std::string envName; + + envName = name+"_"+mId; + envPtr = getenv( envName.c_str() ); + if ( !envPtr && mId != mIdRoot ) + { + envName = name+"_"+mIdRoot; + envPtr = getenv( envName.c_str() ); + } + if ( !envPtr ) + envPtr = getenv( name.c_str() ); + return( envPtr ); +} + +const std::string &Logger::id( const std::string &id ) +{ + std::string tempId = id; + + size_t pos; + // Remove whitespace + while ( (pos = tempId.find_first_of( " \t" )) != std::string::npos ) + { + tempId.replace( pos, 1, "" ); + } + // Replace non-alphanum with underscore + while ( (pos = tempId.find_first_not_of( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_" )) != std::string::npos ) + { + tempId.replace( pos, 1, "_" ); + } + if ( mId != tempId ) + { + mId = tempId; + pos = mId.find( '_' ); + if ( pos != std::string::npos ) + { + mIdRoot = mId.substr( 0, pos ); + if ( ++pos < mId.size() ) + mIdArgs = mId.substr( pos ); + } + } + return( mId ); +} + +Logger::Level Logger::level( Logger::Level level ) +{ + if ( level > NOOPT ) + { + level = limit(level); + if ( mLevel != level ) + mLevel = level; + + mEffectiveLevel = NOLOG; + if ( mTermLevel > mEffectiveLevel ) + mEffectiveLevel = mTermLevel; + if ( mDatabaseLevel > mEffectiveLevel ) + mEffectiveLevel = mDatabaseLevel; + if ( mFileLevel > mEffectiveLevel ) + mEffectiveLevel = mFileLevel; + if ( mSyslogLevel > mEffectiveLevel ) + mEffectiveLevel = mSyslogLevel; + if ( mEffectiveLevel > mLevel) + mEffectiveLevel = mLevel; + } + return( mLevel ); +} + +Logger::Level Logger::termLevel( Logger::Level termLevel ) +{ + if ( termLevel > NOOPT ) + { + if ( !mHasTerm ) + termLevel = NOLOG; + termLevel = limit(termLevel); + if ( mTermLevel != termLevel ) + mTermLevel = termLevel; + } + return( mTermLevel ); +} + +Logger::Level Logger::databaseLevel( Logger::Level databaseLevel ) +{ + if ( databaseLevel > NOOPT ) + { + databaseLevel = limit(databaseLevel); + if ( mDatabaseLevel != databaseLevel ) + { + if ( databaseLevel > NOLOG && mDatabaseLevel <= NOLOG ) + { + if ( !mDbConnected ) + { + if ( !mysql_init( &mDbConnection ) ) + { + Fatal( "Can't initialise database connection: %s", mysql_error( &mDbConnection ) ); + exit( mysql_errno( &mDbConnection ) ); + } + my_bool reconnect = 1; + if ( mysql_options( &mDbConnection, MYSQL_OPT_RECONNECT, &reconnect ) ) + Fatal( "Can't set database auto reconnect option: %s", mysql_error( &mDbConnection ) ); + std::string::size_type colonIndex = staticConfig.DB_HOST.find( ":/" ); + if ( colonIndex != std::string::npos ) + { + std::string dbHost = staticConfig.DB_HOST.substr( 0, colonIndex ); + std::string dbPort = staticConfig.DB_HOST.substr( colonIndex+1 ); + if ( !mysql_real_connect( &mDbConnection, dbHost.c_str(), staticConfig.DB_USER.c_str(), staticConfig.DB_PASS.c_str(), 0, atoi(dbPort.c_str()), 0, 0 ) ) + { + Fatal( "Can't connect to database: %s", mysql_error( &mDbConnection ) ); + exit( mysql_errno( &mDbConnection ) ); + } + } + else + { + if ( !mysql_real_connect( &mDbConnection, staticConfig.DB_HOST.c_str(), staticConfig.DB_USER.c_str(), staticConfig.DB_PASS.c_str(), 0, 0, 0, 0 ) ) + { + Fatal( "Can't connect to database: %s", mysql_error( &mDbConnection ) ); + exit( mysql_errno( &mDbConnection ) ); + } + } + unsigned long mysqlVersion = mysql_get_server_version( &mDbConnection ); + if ( mysqlVersion < 50019 ) + if ( mysql_options( &mDbConnection, MYSQL_OPT_RECONNECT, &reconnect ) ) + Fatal( "Can't set database auto reconnect option: %s", mysql_error( &mDbConnection ) ); + if ( mysql_select_db( &mDbConnection, staticConfig.DB_NAME.c_str() ) ) + { + Fatal( "Can't select database: %s", mysql_error( &mDbConnection ) ); + exit( mysql_errno( &mDbConnection ) ); + } + mDbConnected = true; + } + } + mDatabaseLevel = databaseLevel; + } + } + return( mDatabaseLevel ); +} + +Logger::Level Logger::fileLevel( Logger::Level fileLevel ) +{ + if ( fileLevel > NOOPT ) + { + fileLevel = limit(fileLevel); + if ( mFileLevel != fileLevel ) + { + if ( mFileLevel > NOLOG ) + closeFile(); + mFileLevel = fileLevel; + if ( mFileLevel > NOLOG ) + openFile(); + } + } + return( mFileLevel ); +} + +Logger::Level Logger::syslogLevel( Logger::Level syslogLevel ) +{ + if ( syslogLevel > NOOPT ) + { + syslogLevel = limit(syslogLevel); + if ( mSyslogLevel != syslogLevel ) + { + if ( mSyslogLevel > NOLOG ) + closeSyslog(); + mSyslogLevel = syslogLevel; + if ( mSyslogLevel > NOLOG ) + openSyslog(); + } + } + return( mSyslogLevel ); +} + +void Logger::logFile( const std::string &logFile ) +{ + bool addLogPid = false; + std::string tempLogFile = logFile; + if ( tempLogFile[tempLogFile.length()-1] == '+' ) + { + tempLogFile.resize(tempLogFile.length()-1); + addLogPid = true; + } + if ( addLogPid ) + mLogFile = stringtf( "%s.%05d", tempLogFile.c_str(), getpid() ); + else + mLogFile = tempLogFile; +} + +void Logger::openFile() +{ + if ( mLogFile.size() && (mLogFileFP = fopen( mLogFile.c_str() ,"w" )) == (FILE *)NULL ) + { + mFileLevel = NOLOG; + Fatal( "fopen() for %s, error = %s", mLogFile.c_str(), strerror(errno) ); + } +} + +void Logger::closeFile() +{ + if ( mLogFileFP ) + { + fflush( mLogFileFP ); + if ( fclose( mLogFileFP ) < 0 ) + { + Fatal( "fclose(), error = %s",strerror(errno) ); + } + mLogFileFP = (FILE *)NULL; + } +} + +void Logger::openSyslog() +{ + (void) openlog( mId.c_str(), LOG_PID|LOG_NDELAY, LOG_LOCAL1 ); +} + +void Logger::closeSyslog() +{ + (void) closelog(); +} + +void Logger::logPrint( bool hex, const char * const file, const int line, const int level, const char *fstring, ... ) +{ + if ( level <= mEffectiveLevel ) + { + char classString[4]; + char timeString[64]; + char logString[8192]; + va_list argPtr; + struct timeval timeVal; + + if ( level < PANIC || level > DEBUG9 ) + Panic( "Invalid logger level %d", level ); + + strncpy( classString, smCodes[level].c_str(), sizeof(classString) ); + + gettimeofday( &timeVal, NULL ); + + #if 0 + if ( logRuntime ) + { + static struct timeval logStart; + + subtractTime( &timeVal, &logStart ); + + snprintf( timeString, sizeof(timeString), "%ld.%03ld", timeVal.tv_sec, timeVal.tv_usec/1000 ); + } + else + { + #endif + char *timePtr = timeString; + timePtr += strftime( timePtr, sizeof(timeString), "%x %H:%M:%S", localtime(&timeVal.tv_sec) ); + snprintf( timePtr, sizeof(timeString)-(timePtr-timeString), ".%06ld", timeVal.tv_usec ); + #if 0 + } + #endif + + pid_t tid; +#ifdef HAVE_SYSCALL + if ( (tid = syscall(SYS_gettid)) < 0 ) // Thread/Process id +#endif // HAVE_SYSCALL + tid = getpid(); // Process id + + char *logPtr = logString; + logPtr += snprintf( logPtr, sizeof(logString), "%s %s[%d].%s-%s/%d [", + timeString, + mId.c_str(), + tid, + classString, + file, + line + ); + char *syslogStart = logPtr; + + va_start( argPtr, fstring ); + if ( hex ) + { + unsigned char *data = va_arg( argPtr, unsigned char * ); + int len = va_arg( argPtr, int ); + int i; + logPtr += snprintf( logPtr, sizeof(logString)-(logPtr-logString), "%d:", len ); + for ( i = 0; i < len; i++ ) + { + logPtr += snprintf( logPtr, sizeof(logString)-(logPtr-logString), " %02x", data[i] ); + } + } + else + { + logPtr += vsnprintf( logPtr, sizeof(logString)-(logPtr-logString), fstring, argPtr ); + } + va_end(argPtr); + char *syslogEnd = logPtr; + strncpy( logPtr, "]\n", sizeof(logString)-(logPtr-logString) ); + + if ( level <= mTermLevel ) + { + printf( "%s", logString ); + fflush( stdout ); + } + if ( level <= mFileLevel ) + { + fprintf( mLogFileFP, "%s", logString ); + if ( mFlush ) + fflush( mLogFileFP ); + } + *syslogEnd = '\0'; + if ( level <= mDatabaseLevel ) + { + char sql[ZM_SQL_MED_BUFSIZ]; + char escapedString[(strlen(syslogStart)*2)+1]; + + mysql_real_escape_string( &mDbConnection, escapedString, syslogStart, strlen(syslogStart) ); + snprintf( sql, sizeof(sql), "insert into Logs ( TimeKey, Component, Pid, Level, Code, Message, File, Line ) values ( %ld.%06ld, '%s', %d, %d, '%s', '%s', '%s', %d )", timeVal.tv_sec, timeVal.tv_usec, mId.c_str(), tid, level, classString, escapedString, file, line ); + if ( mysql_query( &mDbConnection, sql ) ) + { + databaseLevel( NOLOG ); + Fatal( "Can't insert log entry: %s", mysql_error( &mDbConnection ) ); + exit( mysql_errno( &mDbConnection ) ); + } + } + if ( level <= mSyslogLevel ) + { + int priority = smSyslogPriorities[level]; + //priority |= LOG_DAEMON; + syslog( priority, "%s [%s]", classString, syslogStart ); + } + + if ( level <= FATAL ) + { + if ( level <= PANIC ) + abort(); + exit( -1 ); + } + } +} + +void logInit( const char *name, const Logger::Options &options ) +{ + if ( !Logger::smInstance ) + Logger::smInstance = new Logger(); + Logger::Options tempOptions = options; + tempOptions.mLogPath = config.path_logs; + Logger::smInstance->initialise( name, tempOptions ); +} + +void logTerm() +{ + Logger::fetch()->terminate(); +} diff --git a/src/zm_logger.h b/src/zm_logger.h new file mode 100644 index 000000000..188aed518 --- /dev/null +++ b/src/zm_logger.h @@ -0,0 +1,239 @@ +/* + * ZoneMinder Logger Interface, $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. +*/ + +#ifndef ZM_LOGGER_H +#define ZM_LOGGER_H + +#include +#include +#include +#include + +class Logger +{ +public: + enum { + NOOPT=-6, + NOLOG, + PANIC, + FATAL, + ERROR, + WARNING, + INFO, + DEBUG1, + DEBUG2, + DEBUG3, + DEBUG4, + DEBUG5, + DEBUG6, + DEBUG7, + DEBUG8, + DEBUG9 + }; + + typedef int Level; + + typedef std::map StringMap; + typedef std::map IntMap; + + class Options + { + public: + int mTermLevel; + int mDatabaseLevel; + int mFileLevel; + int mSyslogLevel; + + std::string mLogPath; + std::string mLogFile; + + public: + Options( Level termLevel=NOOPT, Level databaseLevel=NOOPT, Level fileLevel=NOOPT, Level syslogLevel=NOOPT, const std::string &logPath=".", const std::string &logFile="" ) : + mTermLevel( termLevel ), + mDatabaseLevel( databaseLevel ), + mFileLevel( fileLevel ), + mSyslogLevel( syslogLevel ), + mLogPath( logPath ), + mLogFile( logFile ) + { + } + }; + +private: + static bool smInitialised; + static Logger *smInstance; + + static StringMap smCodes; + static IntMap smSyslogPriorities; + +private: + bool mInitialised; + + std::string mId; + std::string mIdRoot; + std::string mIdArgs; + + Level mLevel; // Level that is currently in operation + Level mTermLevel; // Maximum level output via terminal + Level mDatabaseLevel; // Maximum level output via database + Level mFileLevel; // Maximum level output via file + Level mSyslogLevel; // Maximum level output via syslog + Level mEffectiveLevel; // Level optimised to take account of maxima + + bool mDbConnected; + MYSQL mDbConnection; + std::string mLogPath; + std::string mLogFile; + FILE *mLogFileFP; + + bool mHasTerm; + bool mFlush; + +private: + static void usrHandler( int sig ); + +public: + friend void logInit( const char *name, const Options &options ); + + static Logger *fetch() + { + if ( !smInstance ) + { + smInstance = new Logger(); + Options options; + smInstance->initialise( "undef", options ); + } + return( smInstance ); + } + +private: + Logger(); + ~Logger(); + +public: + void initialise( const std::string &id, const Options &options ); + void terminate(); + +private: + int limit( int level ) + { + if ( level > DEBUG9 ) + return( DEBUG9 ); + if ( level < NOLOG ) + return( NOLOG ); + return( level ); + } + + bool boolEnv( const std::string &name, bool defaultValue=false ); + int intEnv( const std::string &name, bool defaultValue=0 ); + std::string strEnv( const std::string &name, const std::string defaultValue="" ); + char *getTargettedEnv( const std::string &name ); + + void loadEnv(); + +public: + const std::string &id() const + { + return( mId ); + } + + const std::string &id( const std::string &id ); + + Level level() const + { + return( mLevel ); + } + Level level( Level=NOOPT ); + + bool debugOn() + { + return( mEffectiveLevel >= DEBUG1 ); + } + + Level termLevel( Level=NOOPT ); + Level databaseLevel( Level=NOOPT ); + Level fileLevel( Level=NOOPT ); + Level syslogLevel( Level=NOOPT ); + +private: + void logFile( const std::string &logFile ); + void openFile(); + void closeFile(); + void openSyslog(); + void closeSyslog(); + +public: + void logPrint( bool hex, const char * const file, const int line, const int level, const char *fstring, ... ); +}; + +void logInit( const char *name, const Logger::Options &options=Logger::Options() ); +void logTerm(); +inline const std::string &logId() +{ + return( Logger::fetch()->id() ); +} +inline Logger::Level logLevel() +{ + return( Logger::fetch()->level() ); +} +inline void logCapLevel( Logger::Level level ) +{ + Logger::fetch()->level( level ); +} +inline Logger::Level logDebugging() +{ + return( Logger::fetch()->debugOn() ); +} + +#define logPrintf(logLevel,params...) {\ + if ( logLevel <= Logger::fetch()->level() )\ + Logger::fetch()->logPrint( false, __FILE__, __LINE__, logLevel, ##params );\ + } + +#define logHexdump(logLevel,data,len) {\ + if ( logLevel <= Logger::fetch()->level() )\ + Logger::fetch()->logPrint( true, __FILE__, __LINE__, logLevel, "%p (%d)", data, len );\ + } + +/* Debug compiled out */ +#ifndef DBG_OFF +#define Debug(level,params...) logPrintf(level,##params) +#define Hexdump(level,data,len) logHexdump(level,data,len) +#else +#define Debug(level,params...) +#define Hexdump(level,data,len) +#endif + +/* Standard debug calls */ +#define Info(params...) logPrintf(Logger::INFO,##params) +#define Warning(params...) logPrintf(Logger::WARNING,##params) +#define Error(params...) logPrintf(Logger::ERROR,##params) +#define Fatal(params...) logPrintf(Logger::FATAL,##params) +#define Panic(params...) logPrintf(Logger::PANIC,##params) +#define Mark() Info("Mark/%s/%d",__FILE__,__LINE__) +#define Log() Info("Log") +#ifdef __GNUC__ +#define Enter(level) logPrintf(level,("Entering %s",__PRETTY_FUNCTION__)) +#define Exit(level) logPrintf(level,("Exiting %s",__PRETTY_FUNCTION__)) +#else +#define Enter(level) +#define Exit(level) +#endif + +#endif // ZM_LOGGER_H diff --git a/src/zm_mem_utils.h b/src/zm_mem_utils.h new file mode 100644 index 000000000..8ce1ceea1 --- /dev/null +++ b/src/zm_mem_utils.h @@ -0,0 +1,161 @@ +// +// ZoneMinder Memory Utilities, $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. +// + +#ifndef ZM_MEM_UTILS_H +#define ZM_MEM_UTILS_H + +#include +#include "zm.h" + +inline void* zm_mallocaligned(unsigned int reqalignment, size_t reqsize) { + uint8_t* retptr; +#if HAVE_POSIX_MEMALIGN + if(posix_memalign((void**)&retptr,reqalignment,reqsize) != 0) + return NULL; + + return retptr; +#else + uint8_t* alloc; + retptr = (uint8_t*)malloc(reqsize+reqalignment+sizeof(void*)); + + if(retptr == NULL) + return NULL; + + alloc = retptr + sizeof(void*); + + if(((long)alloc % reqalignment) != 0) + alloc = alloc + (reqalignment - ((long)alloc % reqalignment)); + + /* Store a pointer before to the start of the block, just before returned aligned memory */ + *(void**)(alloc - sizeof(void*)) = retptr; + + return alloc; +#endif +} + +inline void zm_freealigned(void* ptr) { +#if HAVE_POSIX_MEMALIGN + free(ptr); +#else + /* Start of block is stored before the block if it was allocated by zm_mallocaligned */ + free(*(void**)((uint8_t*)ptr - sizeof(void*))); +#endif +} + +inline char *mempbrk( register const char *s, const char *accept, size_t limit ) +{ + if ( limit <= 0 || !s || !accept || !*accept ) + return( 0 ); + + register unsigned int i,j; + size_t acc_len = strlen( accept ); + + for ( i = 0; i < limit; s++, i++ ) + { + for ( j = 0; j < acc_len; j++ ) + { + if ( *s == accept[j] ) + { + return( (char *)s ); + } + } + } + return( 0 ); +} + +inline char *memstr( register const char *s, const char *n, size_t limit ) +{ + if ( limit <= 0 || !s || !n ) + return( 0 ); + + if ( !*n ) + return( (char *)s ); + + register unsigned int i,j,k; + size_t n_len = strlen( n ); + + for ( i = 0; i < limit; i++, s++ ) + { + if ( *s != *n ) + continue; + j = 1; + k = 1; + while ( true ) + { + if ( k >= n_len ) + return( (char *)s ); + if ( s[j++] != n[k++] ) + break; + } + } + return( 0 ); +} + +inline size_t memspn( register const char *s, const char *accept, size_t limit ) +{ + if ( limit <= 0 || !s || !accept || !*accept ) + return( 0 ); + + register unsigned int i,j; + size_t acc_len = strlen( accept ); + + for ( i = 0; i < limit; s++, i++ ) + { + register bool found = false; + for ( j = 0; j < acc_len; j++ ) + { + if ( *s == accept[j] ) + { + found = true; + break; + } + } + if ( !found ) + { + return( i ); + } + } + return( limit ); +} + +inline size_t memcspn( register const char *s, const char *reject, size_t limit ) +{ + if ( limit <= 0 || !s || !reject ) + return( 0 ); + + if ( !*reject ) + return( limit ); + + register unsigned int i,j; + size_t rej_len = strlen( reject ); + + for ( i = 0; i < limit; s++, i++ ) + { + for ( j = 0; j < rej_len; j++ ) + { + if ( *s == reject[j] ) + { + return( i ); + } + } + } + return( limit ); +} + +#endif // ZM_MEM_UTILS_H diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp new file mode 100644 index 000000000..66225a144 --- /dev/null +++ b/src/zm_monitor.cpp @@ -0,0 +1,4232 @@ +// +// ZoneMinder Monitor Class Implementation, $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. +// + +#include +#include +#include +#include + +#include "zm.h" +#include "zm_db.h" +#include "zm_time.h" +#include "zm_mpeg.h" +#include "zm_signal.h" +#include "zm_monitor.h" +#if ZM_HAS_V4L +#include "zm_local_camera.h" +#endif // ZM_HAS_V4L +#include "zm_remote_camera.h" +#include "zm_remote_camera_http.h" +#if HAVE_LIBAVFORMAT +#include "zm_remote_camera_rtsp.h" +#endif // HAVE_LIBAVFORMAT +#include "zm_file_camera.h" +#if HAVE_LIBAVFORMAT +#include "zm_ffmpeg_camera.h" +#endif // HAVE_LIBAVFORMAT + +#if ZM_MEM_MAPPED +#include +#include +#else // ZM_MEM_MAPPED +#include +#include +#endif // ZM_MEM_MAPPED + +//============================================================================= +std::string trimSpaces(std::string str) +{ + // Trim Both leading and trailing spaces + size_t startpos = str.find_first_not_of(" \t"); // Find the first character position after excluding leading blank spaces + size_t endpos = str.find_last_not_of(" \t"); // Find the first character position from reverse af + + // if all spaces or empty return an empty string + if(( std::string::npos == startpos ) || ( std::string::npos == endpos)) + { + return std::string(""); + } + else + return str.substr( startpos, endpos-startpos+1 ); +} + +std::vector split(const std::string &s, char delim) { + std::vector elems; + std::stringstream ss(s); + std::string item; + while(std::getline(ss, item, delim)) { + elems.push_back(trimSpaces(item)); + } + return elems; +} +//============================================================================= + + + +Monitor::MonitorLink::MonitorLink( int p_id, const char *p_name ) : id( p_id ) +{ + strncpy( name, p_name, sizeof(name) ); + +#if ZM_MEM_MAPPED + map_fd = -1; + snprintf( mem_file, sizeof(mem_file), "%s/zm.mmap.%d", config.path_map, id ); +#else // ZM_MEM_MAPPED + shm_id = 0; +#endif // ZM_MEM_MAPPED + mem_size = 0; + mem_ptr = 0; + + last_event = 0; + last_state = IDLE; + + last_connect_time = 0; + connected = false; +} + +Monitor::MonitorLink::~MonitorLink() +{ + disconnect(); +} + +bool Monitor::MonitorLink::connect() +{ + if ( !last_connect_time || (time( 0 ) - last_connect_time) > 60 ) + { + last_connect_time = time( 0 ); + + mem_size = sizeof(SharedData) + sizeof(TriggerData); + + Debug( 1, "link.mem.size=%d", mem_size ); +#if ZM_MEM_MAPPED + map_fd = open( mem_file, O_RDWR, (mode_t)0600 ); + if ( map_fd < 0 ) + { + Debug( 3, "Can't open linked memory map file %s: %s", mem_file, strerror(errno) ); + disconnect(); + return( false ); + } + + struct stat map_stat; + if ( fstat( map_fd, &map_stat ) < 0 ) + { + Error( "Can't stat linked memory map file %s: %s", mem_file, strerror(errno) ); + disconnect(); + return( false ); + } + + if ( map_stat.st_size == 0 ) + { + Error( "Linked memory map file %s is empty: %s", mem_file, strerror(errno) ); + disconnect(); + return( false ); + } + else if ( map_stat.st_size < mem_size ) + { + Error( "Got unexpected memory map file size %ld, expected %d", map_stat.st_size, mem_size ); + disconnect(); + return( false ); + } + + mem_ptr = (unsigned char *)mmap( NULL, mem_size, PROT_READ|PROT_WRITE, MAP_SHARED, map_fd, 0 ); + if ( mem_ptr == MAP_FAILED ) + { + Error( "Can't map file %s (%d bytes) to memory: %s", mem_file, mem_size, strerror(errno) ); + disconnect(); + return( false ); + } +#else // ZM_MEM_MAPPED + shm_id = shmget( (config.shm_key&0xffff0000)|id, mem_size, 0700 ); + if ( shm_id < 0 ) + { + Debug( 3, "Can't shmget link memory: %s", strerror(errno) ); + connected = false; + return( false ); + } + mem_ptr = (unsigned char *)shmat( shm_id, 0, 0 ); + if ( mem_ptr < 0 ) + { + Debug( 3, "Can't shmat link memory: %s", strerror(errno) ); + connected = false; + return( false ); + } +#endif // ZM_MEM_MAPPED + + shared_data = (SharedData *)mem_ptr; + trigger_data = (TriggerData *)((char *)shared_data + sizeof(SharedData)); + + if ( !shared_data->valid ) + { + Debug( 3, "Linked memory not initialised by capture daemon" ); + disconnect(); + return( false ); + } + + last_state = shared_data->state; + last_event = shared_data->last_event; + connected = true; + + return( true ); + } + return( false ); +} + +bool Monitor::MonitorLink::disconnect() +{ + if ( connected ) + { + connected = false; + +#if ZM_MEM_MAPPED + if ( mem_ptr > 0 ) + { + msync( mem_ptr, mem_size, MS_ASYNC ); + munmap( mem_ptr, mem_size ); + } + if ( map_fd >= 0 ) + close( map_fd ); + + map_fd = -1; +#else // ZM_MEM_MAPPED + struct shmid_ds shm_data; + if ( shmctl( shm_id, IPC_STAT, &shm_data ) < 0 ) + { + Debug( 3, "Can't shmctl: %s", strerror(errno) ); + return( false ); + } + + shm_id = 0; + + if ( shm_data.shm_nattch <= 1 ) + { + if ( shmctl( shm_id, IPC_RMID, 0 ) < 0 ) + { + Debug( 3, "Can't shmctl: %s", strerror(errno) ); + return( false ); + } + } + + if ( shmdt( mem_ptr ) < 0 ) + { + Debug( 3, "Can't shmdt: %s", strerror(errno) ); + return( false ); + } + +#endif // ZM_MEM_MAPPED + mem_size = 0; + mem_ptr = 0; + } + return( true ); +} + +bool Monitor::MonitorLink::isAlarmed() +{ + if ( !connected ) + { + return( false ); + } + return( shared_data->state == ALARM ); +} + +bool Monitor::MonitorLink::inAlarm() +{ + if ( !connected ) + { + return( false ); + } + return( shared_data->state == ALARM || shared_data->state == ALERT ); +} + +bool Monitor::MonitorLink::hasAlarmed() +{ + if ( shared_data->state == ALARM ) + { + return( true ); + } + else if( shared_data->last_event != (unsigned int)last_event ) + { + last_event = shared_data->last_event; + return( true ); + } + return( false ); +} + +Monitor::Monitor( + int p_id, + const char *p_name, + int p_function, + bool p_enabled, + const char *p_linked_monitors, + Camera *p_camera, + int p_orientation, + unsigned int p_deinterlacing, + const char *p_event_prefix, + const char *p_label_format, + const Coord &p_label_coord, + int p_image_buffer_count, + int p_warmup_count, + int p_pre_event_count, + int p_post_event_count, + int p_stream_replay_buffer, + int p_alarm_frame_count, + int p_section_length, + int p_frame_skip, + int p_capture_delay, + int p_alarm_capture_delay, + int p_fps_report_interval, + int p_ref_blend_perc, + bool p_track_motion, + Rgb p_signal_check_colour, + Purpose p_purpose, + int p_n_zones, + Zone *p_zones[], + std::string p_sPlugins, + int p_DoNativeMotDet +) : id( p_id ), + function( (Function)p_function ), + enabled( p_enabled ), + width( (p_orientation==ROTATE_90||p_orientation==ROTATE_270)?p_camera->Height():p_camera->Width() ), + height( (p_orientation==ROTATE_90||p_orientation==ROTATE_270)?p_camera->Width():p_camera->Height() ), + orientation( (Orientation)p_orientation ), + deinterlacing( p_deinterlacing ), + label_coord( p_label_coord ), + image_buffer_count( p_image_buffer_count ), + warmup_count( p_warmup_count ), + pre_event_count( p_pre_event_count ), + post_event_count( p_post_event_count ), + stream_replay_buffer( p_stream_replay_buffer ), + section_length( p_section_length ), + frame_skip( p_frame_skip ), + capture_delay( p_capture_delay ), + alarm_capture_delay( p_alarm_capture_delay ), + alarm_frame_count( p_alarm_frame_count ), + fps_report_interval( p_fps_report_interval ), + ref_blend_perc( p_ref_blend_perc ), + track_motion( p_track_motion ), + signal_check_colour( p_signal_check_colour ), + delta_image( width, height, ZM_COLOUR_GRAY8, ZM_SUBPIX_ORDER_NONE ), + ref_image( width, height, p_camera->Colours(), p_camera->SubpixelOrder() ), + purpose( p_purpose ), + camera( p_camera ), + n_zones( p_n_zones ), + zones( p_zones ), + iDoNativeMotDet(p_DoNativeMotDet) +{ + strncpy( name, p_name, sizeof(name) ); + + strncpy( event_prefix, p_event_prefix, sizeof(event_prefix) ); + strncpy( label_format, p_label_format, sizeof(label_format) ); + + // Change \n to actual line feeds + char *token_ptr = label_format; + const char *token_string = "\n"; + while( ( token_ptr = strstr( token_ptr, token_string ) ) ) + { + if ( *(token_ptr+1) ) + { + *token_ptr = '\n'; + token_ptr++; + strcpy( token_ptr, token_ptr+1 ); + } + else + { + *token_ptr = '\0'; + break; + } + } + + fps = 0.0; + event_count = 0; + image_count = 0; + ready_count = warmup_count; + first_alarm_count = 0; + last_alarm_count = 0; + state = IDLE; + + if ( alarm_frame_count < 1 ) + alarm_frame_count = 1; + else if ( alarm_frame_count > MAX_PRE_ALARM_FRAMES ) + alarm_frame_count = MAX_PRE_ALARM_FRAMES; + + auto_resume_time = 0; + + if ( strcmp( config.event_close_mode, "time" ) == 0 ) + event_close_mode = CLOSE_TIME; + else if ( strcmp( config.event_close_mode, "alarm" ) == 0 ) + event_close_mode = CLOSE_ALARM; + else + event_close_mode = CLOSE_IDLE; + + Debug( 1, "monitor purpose=%d", purpose ); + + mem_size = sizeof(SharedData) + + sizeof(TriggerData) + + (image_buffer_count*sizeof(struct timeval)) + + (image_buffer_count*camera->ImageSize()) + + 64; /* Padding used to permit aligning the images buffer to 16 byte boundary */ + + Debug( 1, "mem.size=%d", mem_size ); +#if ZM_MEM_MAPPED + snprintf( mem_file, sizeof(mem_file), "%s/zm.mmap.%d", config.path_map, id ); + map_fd = open( mem_file, O_RDWR|O_CREAT, (mode_t)0600 ); + if ( map_fd < 0 ) + Fatal( "Can't open memory map file %s, probably not enough space free: %s", mem_file, strerror(errno) ); + struct stat map_stat; + if ( fstat( map_fd, &map_stat ) < 0 ) + Fatal( "Can't stat memory map file %s: %s", mem_file, strerror(errno) ); + if ( map_stat.st_size != mem_size && purpose == CAPTURE ) + { + // Allocate the size + if ( ftruncate( map_fd, mem_size ) < 0 ) + Fatal( "Can't extend memory map file %s to %d bytes: %s", mem_file, mem_size, strerror(errno) ); + } + else if ( map_stat.st_size != mem_size ) + { + Error( "Got unexpected memory map file size %ld, expected %d", map_stat.st_size, mem_size ); + } + + mem_ptr = (unsigned char *)mmap( NULL, mem_size, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_LOCKED, map_fd, 0 ); + if ( mem_ptr == MAP_FAILED ) + if ( errno == EAGAIN ) + { + Debug( 1, "Unable to map file %s (%d bytes) to locked memory, trying unlocked", mem_file, mem_size ); + mem_ptr = (unsigned char *)mmap( NULL, mem_size, PROT_READ|PROT_WRITE, MAP_SHARED, map_fd, 0 ); + } + if ( mem_ptr == MAP_FAILED ) + Fatal( "Can't map file %s (%d bytes) to memory: %s(%d)", mem_file, mem_size, strerror(errno), errno ); +#else // ZM_MEM_MAPPED + shm_id = shmget( (config.shm_key&0xffff0000)|id, mem_size, IPC_CREAT|0700 ); + if ( shm_id < 0 ) + { + Error( "Can't shmget, probably not enough shared memory space free: %s", strerror(errno)); + exit( -1 ); + } + mem_ptr = (unsigned char *)shmat( shm_id, 0, 0 ); + if ( mem_ptr < 0 ) + { + Error( "Can't shmat: %s", strerror(errno)); + exit( -1 ); + } +#endif // ZM_MEM_MAPPED + + shared_data = (SharedData *)mem_ptr; + trigger_data = (TriggerData *)((char *)shared_data + sizeof(SharedData)); + struct timeval *shared_timestamps = (struct timeval *)((char *)trigger_data + sizeof(TriggerData)); + unsigned char *shared_images = (unsigned char *)((char *)shared_timestamps + (image_buffer_count*sizeof(struct timeval))); + + if(((unsigned long)shared_images % 16) != 0) { + /* Align images buffer to nearest 16 byte boundary */ + Debug(3,"Aligning shared memory images to the next 16 byte boundary"); + shared_images = (uint8_t*)((unsigned long)shared_images + (16 - ((unsigned long)shared_images % 16))); + } + + //======================================================================================== + // Get from string with plugins names particular names. + m_sPluginNames = split(p_sPlugins, ';'); + + //======================================================================================== + + + if ( purpose == CAPTURE ) + { + memset( mem_ptr, 0, mem_size ); + shared_data->size = sizeof(SharedData); + shared_data->active = enabled; + shared_data->signal = false; + shared_data->state = IDLE; + shared_data->last_write_index = image_buffer_count; + shared_data->last_read_index = image_buffer_count; + shared_data->last_write_time = 0; + shared_data->last_event = 0; + shared_data->action = (Action)0; + shared_data->brightness = -1; + shared_data->hue = -1; + shared_data->colour = -1; + shared_data->contrast = -1; + shared_data->alarm_x = -1; + shared_data->alarm_y = -1; + shared_data->format = camera->SubpixelOrder(); + shared_data->imagesize = camera->ImageSize(); + trigger_data->size = sizeof(TriggerData); + trigger_data->trigger_state = TRIGGER_CANCEL; + trigger_data->trigger_score = 0; + trigger_data->trigger_cause[0] = 0; + trigger_data->trigger_text[0] = 0; + trigger_data->trigger_showtext[0] = 0; + shared_data->valid = true; + } + else if ( purpose == ANALYSIS ) + { + shared_data->state = IDLE; + shared_data->last_read_time = 0; + shared_data->alarm_x = -1; + shared_data->alarm_y = -1; + //======================================================================================== + Info("In the constructor of Monitor class with ID=%d:", p_id); + if (config.load_plugins) + { + Info("Load plugins from the directory %s ... ", config.path_plugins); + std::string sPluginExt = std::string(config.plugin_extension); + ThePluginManager.setPluginExt(sPluginExt); + for (std::vector::iterator it = m_sPluginNames.begin() ; it < m_sPluginNames.end(); it++ ) + { + std::string sFullPluginPath = join_paths(config.path_plugins, *it + config.plugin_extension); + Info("Plugin path %s", sFullPluginPath.c_str()); + ThePluginManager.loadPlugin(sFullPluginPath); + } + +// int count_plugins = ThePluginManager.findPlugins(config.path_plugins); +// Info("Number of found plugins is %d", count_plugins); +// if (count_plugins > 0) +// { + std::string sPluginsConfig = std::string(config.plugins_config_path); + Info("Configure plugins with \'%s\' config file.", config.plugins_config_path); + ThePluginManager.configurePlugins(sPluginsConfig); +// } + + } + //======================================================================================== + + } + + if ( !shared_data->valid ) + { + if ( purpose != QUERY ) + { + Error( "Shared data not initialised by capture daemon" ); + exit( -1 ); + } + else + { + Warning( "Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results" ); + } + } + + image_buffer = new Snapshot[image_buffer_count]; + for ( int i = 0; i < image_buffer_count; i++ ) + { + image_buffer[i].timestamp = &(shared_timestamps[i]); + image_buffer[i].image = new Image( width, height, camera->Colours(), camera->SubpixelOrder(), &(shared_images[i*camera->ImageSize()]) ); + image_buffer[i].image->HoldBuffer(true); /* Don't release the internal buffer or replace it with another */ + } + if ( (deinterlacing & 0xff) == 4) + { + /* Four field motion adaptive deinterlacing in use */ + /* Allocate a buffer for the next image */ + next_buffer.image = new Image( width, height, camera->Colours(), camera->SubpixelOrder()); + next_buffer.timestamp = new struct timeval; + } + if ( !n_zones ) + { + n_zones = 1; + zones = new Zone *[1]; + Coord coords[4] = { Coord( 0, 0 ), Coord( width-1, 0 ), Coord( width-1, height-1 ), Coord( 0, height-1 ) }; + zones[0] = new Zone( this, 0, "All", Zone::ACTIVE, Polygon( sizeof(coords)/sizeof(*coords), coords ), RGB_RED, Zone::BLOBS ); + } + start_time = last_fps_time = time( 0 ); + + event = 0; + + Debug( 1, "Monitor %s has function %d", name, function ); + Debug( 1, "Monitor %s LBF = '%s', LBX = %d, LBY = %d", name, label_format, label_coord.X(), label_coord.Y() ); + Debug( 1, "Monitor %s IBC = %d, WUC = %d, pEC = %d, PEC = %d, EAF = %d, FRI = %d, RBP = %d, FM = %d", name, image_buffer_count, warmup_count, pre_event_count, post_event_count, alarm_frame_count, fps_report_interval, ref_blend_perc, track_motion ); + + if ( purpose == ANALYSIS ) + { + static char path[PATH_MAX]; + + strncpy( path, config.dir_events, sizeof(path) ); + + struct stat statbuf; + errno = 0; + stat( path, &statbuf ); + if ( errno == ENOENT || errno == ENOTDIR ) + { + if ( mkdir( path, 0755 ) ) + { + Error( "Can't make %s: %s", path, strerror(errno)); + } + } + + snprintf( path, sizeof(path), "%s/%d", config.dir_events, id ); + + errno = 0; + stat( path, &statbuf ); + if ( errno == ENOENT || errno == ENOTDIR ) + { + if ( mkdir( path, 0755 ) ) + { + Error( "Can't make %s: %s", path, strerror(errno)); + } + char temp_path[PATH_MAX]; + snprintf( temp_path, sizeof(temp_path), "%d", id ); + if ( chdir( config.dir_events ) < 0 ) + Fatal( "Can't change directory to '%s': %s", config.dir_events, strerror(errno) ); + if ( symlink( temp_path, name ) < 0 ) + Fatal( "Can't symlink '%s' to '%s': %s", temp_path, name, strerror(errno) ); + if ( chdir( ".." ) < 0 ) + Fatal( "Can't change to parent directory: %s", strerror(errno) ); + } + + while( shared_data->last_write_index == (unsigned int)image_buffer_count + && shared_data->last_write_time == 0) + { + Warning( "Waiting for capture daemon" ); + sleep( 1 ); + } + ref_image.Assign( width, height, camera->Colours(), camera->SubpixelOrder(), image_buffer[shared_data->last_write_index].image->Buffer(), camera->ImageSize()); + + n_linked_monitors = 0; + linked_monitors = 0; + ReloadLinkedMonitors( p_linked_monitors ); + } +} + +Monitor::~Monitor() +{ + if ( event ) + Info( "%s: %03d - Closing event %d, shutting down", name, image_count, event->Id() ); + closeEvent(); + + if ( (deinterlacing & 0xff) == 4) + { + delete next_buffer.image; + delete next_buffer.timestamp; + } + for ( int i = 0; i < image_buffer_count; i++ ) + { + delete image_buffer[i].image; + } + delete[] image_buffer; + + for ( int i = 0; i < n_zones; i++ ) + { + delete zones[i]; + } + delete[] zones; + + delete camera; + + if ( purpose == ANALYSIS ) + { + shared_data->state = state = IDLE; + shared_data->last_read_index = image_buffer_count; + shared_data->last_read_time = 0; + } + else if ( purpose == CAPTURE ) + { + shared_data->valid = false; + memset( mem_ptr, 0, mem_size ); + } + +#if ZM_MEM_MAPPED + if ( msync( mem_ptr, mem_size, MS_SYNC ) < 0 ) + Error( "Can't msync: %s", strerror(errno) ); + if ( munmap( mem_ptr, mem_size ) < 0 ) + Fatal( "Can't munmap: %s", strerror(errno) ); + close( map_fd ); +#else // ZM_MEM_MAPPED + struct shmid_ds shm_data; + if ( shmctl( shm_id, IPC_STAT, &shm_data ) < 0 ) + { + Error( "Can't shmctl: %s", strerror(errno) ); + exit( -1 ); + } + if ( shm_data.shm_nattch <= 1 ) + { + if ( shmctl( shm_id, IPC_RMID, 0 ) < 0 ) + { + Error( "Can't shmctl: %s", strerror(errno) ); + exit( -1 ); + } + } +#endif // ZM_MEM_MAPPED +} + +void Monitor::AddZones( int p_n_zones, Zone *p_zones[] ) +{ + for ( int i = 0; i < n_zones; i++ ) + delete zones[i]; + delete[] zones; + n_zones = p_n_zones; + zones = p_zones; +} + +Monitor::State Monitor::GetState() const +{ + return( (State)shared_data->state ); +} + +int Monitor::GetImage( int index, int scale ) const +{ + if ( index < 0 || index > image_buffer_count ) + { + index = shared_data->last_write_index; + } + + if ( index != image_buffer_count ) + { + Snapshot *snap = &image_buffer[index]; + Image snap_image( *(snap->image) ); + + if ( scale != ZM_SCALE_BASE ) + { + snap_image.Scale( scale ); + } + + static char filename[PATH_MAX]; + snprintf( filename, sizeof(filename), "Monitor%d.jpg", id ); + if ( !config.timestamp_on_capture ) + { + TimestampImage( &snap_image, snap->timestamp ); + } + snap_image.WriteJpeg( filename ); + } + else + { + Error( "Unable to generate image, no images in buffer" ); + } + return( 0 ); +} + +struct timeval Monitor::GetTimestamp( int index ) const +{ + if ( index < 0 || index > image_buffer_count ) + { + index = shared_data->last_write_index; + } + + if ( index != image_buffer_count ) + { + Snapshot *snap = &image_buffer[index]; + + return( *(snap->timestamp) ); + } + else + { + static struct timeval null_tv = { 0, 0 }; + + return( null_tv ); + } +} + +unsigned int Monitor::GetLastReadIndex() const +{ + return( shared_data->last_read_index!=(unsigned int)image_buffer_count?shared_data->last_read_index:-1 ); +} + +unsigned int Monitor::GetLastWriteIndex() const +{ + return( shared_data->last_write_index!=(unsigned int)image_buffer_count?shared_data->last_write_index:-1 ); +} + +unsigned int Monitor::GetLastEvent() const +{ + return( shared_data->last_event ); +} + +double Monitor::GetFPS() const +{ + int index1 = shared_data->last_write_index; + if ( index1 == image_buffer_count ) + { + return( 0.0 ); + } + Snapshot *snap1 = &image_buffer[index1]; + if ( !snap1->timestamp || !snap1->timestamp->tv_sec ) + { + return( 0.0 ); + } + struct timeval time1 = *snap1->timestamp; + + int image_count = image_buffer_count; + int index2 = (index1+1)%image_buffer_count; + if ( index2 == image_buffer_count ) + { + return( 0.0 ); + } + Snapshot *snap2 = &image_buffer[index2]; + while ( !snap2->timestamp || !snap2->timestamp->tv_sec ) + { + if ( index1 == index2 ) + { + return( 0.0 ); + } + index2 = (index2+1)%image_buffer_count; + snap2 = &image_buffer[index2]; + image_count--; + } + struct timeval time2 = *snap2->timestamp; + + double time_diff = tvDiffSec( time2, time1 ); + + double curr_fps = image_count/time_diff; + + if ( curr_fps < 0.0 ) + { + //Error( "Negative FPS %f, time_diff = %lf (%d:%ld.%ld - %d:%ld.%ld), ibc: %d", curr_fps, time_diff, index2, time2.tv_sec, time2.tv_usec, index1, time1.tv_sec, time1.tv_usec, image_buffer_count ); + return( 0.0 ); + } + return( curr_fps ); +} + +void Monitor::ForceAlarmOn( int force_score, const char *force_cause, const char *force_text ) +{ + trigger_data->trigger_state = TRIGGER_ON; + trigger_data->trigger_score = force_score; + strncpy( trigger_data->trigger_cause, force_cause, sizeof(trigger_data->trigger_cause) ); + strncpy( trigger_data->trigger_text, force_text, sizeof(trigger_data->trigger_text) ); +} + +void Monitor::ForceAlarmOff() +{ + trigger_data->trigger_state = TRIGGER_OFF; +} + +void Monitor::CancelForced() +{ + trigger_data->trigger_state = TRIGGER_CANCEL; +} + +void Monitor::actionReload() +{ + shared_data->action |= RELOAD; +} + +void Monitor::actionEnable() +{ + shared_data->action |= RELOAD; + + static char sql[ZM_SQL_SML_BUFSIZ]; + snprintf( sql, sizeof(sql), "update Monitors set Enabled = 1 where Id = '%d'", id ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } +} + +void Monitor::actionDisable() +{ + shared_data->action |= RELOAD; + + static char sql[ZM_SQL_SML_BUFSIZ]; + snprintf( sql, sizeof(sql), "update Monitors set Enabled = 0 where Id = '%d'", id ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } +} + +void Monitor::actionSuspend() +{ + shared_data->action |= SUSPEND; +} + +void Monitor::actionResume() +{ + shared_data->action |= RESUME; +} + +int Monitor::actionBrightness( int p_brightness ) +{ + if ( purpose != CAPTURE ) + { + if ( p_brightness >= 0 ) + { + shared_data->brightness = p_brightness; + shared_data->action |= SET_SETTINGS; + int wait_loops = 10; + while ( shared_data->action & SET_SETTINGS ) + { + if ( wait_loops-- ) + usleep( 100000 ); + else + { + Warning( "Timed out waiting to set brightness" ); + return( -1 ); + } + } + } + else + { + shared_data->action |= GET_SETTINGS; + int wait_loops = 10; + while ( shared_data->action & GET_SETTINGS ) + { + if ( wait_loops-- ) + usleep( 100000 ); + else + { + Warning( "Timed out waiting to get brightness" ); + return( -1 ); + } + } + } + return( shared_data->brightness ); + } + return( camera->Brightness( p_brightness ) ); +} + +int Monitor::actionContrast( int p_contrast ) +{ + if ( purpose != CAPTURE ) + { + if ( p_contrast >= 0 ) + { + shared_data->contrast = p_contrast; + shared_data->action |= SET_SETTINGS; + int wait_loops = 10; + while ( shared_data->action & SET_SETTINGS ) + { + if ( wait_loops-- ) + usleep( 100000 ); + else + { + Warning( "Timed out waiting to set contrast" ); + return( -1 ); + } + } + } + else + { + shared_data->action |= GET_SETTINGS; + int wait_loops = 10; + while ( shared_data->action & GET_SETTINGS ) + { + if ( wait_loops-- ) + usleep( 100000 ); + else + { + Warning( "Timed out waiting to get contrast" ); + return( -1 ); + } + } + } + return( shared_data->contrast ); + } + return( camera->Contrast( p_contrast ) ); +} + +int Monitor::actionHue( int p_hue ) +{ + if ( purpose != CAPTURE ) + { + if ( p_hue >= 0 ) + { + shared_data->hue = p_hue; + shared_data->action |= SET_SETTINGS; + int wait_loops = 10; + while ( shared_data->action & SET_SETTINGS ) + { + if ( wait_loops-- ) + usleep( 100000 ); + else + { + Warning( "Timed out waiting to set hue" ); + return( -1 ); + } + } + } + else + { + shared_data->action |= GET_SETTINGS; + int wait_loops = 10; + while ( shared_data->action & GET_SETTINGS ) + { + if ( wait_loops-- ) + usleep( 100000 ); + else + { + Warning( "Timed out waiting to get hue" ); + return( -1 ); + } + } + } + return( shared_data->hue ); + } + return( camera->Hue( p_hue ) ); +} + +int Monitor::actionColour( int p_colour ) +{ + if ( purpose != CAPTURE ) + { + if ( p_colour >= 0 ) + { + shared_data->colour = p_colour; + shared_data->action |= SET_SETTINGS; + int wait_loops = 10; + while ( shared_data->action & SET_SETTINGS ) + { + if ( wait_loops-- ) + usleep( 100000 ); + else + { + Warning( "Timed out waiting to set colour" ); + return( -1 ); + } + } + } + else + { + shared_data->action |= GET_SETTINGS; + int wait_loops = 10; + while ( shared_data->action & GET_SETTINGS ) + { + if ( wait_loops-- ) + usleep( 100000 ); + else + { + Warning( "Timed out waiting to get colour" ); + return( -1 ); + } + } + } + return( shared_data->colour ); + } + return( camera->Colour( p_colour ) ); +} + +void Monitor::DumpZoneImage( const char *zone_string ) +{ + int exclude_id = 0; + int extra_colour = 0; + Polygon extra_zone; + + if ( zone_string ) + { + if ( !Zone::ParseZoneString( zone_string, exclude_id, extra_colour, extra_zone ) ) + { + Error( "Failed to parse zone string, ignoring" ); + } + } + + int index = shared_data->last_write_index; + Snapshot *snap = &image_buffer[index]; + Image *snap_image = snap->image; + + Image zone_image( *snap_image ); + if(zone_image.Colours() == ZM_COLOUR_GRAY8) { + zone_image.Colourise(ZM_COLOUR_RGB24, ZM_SUBPIX_ORDER_RGB ); + } + + for( int i = 0; i < n_zones; i++ ) + { + if ( exclude_id && (!extra_colour || extra_zone.getNumCoords()) && zones[i]->Id() == exclude_id ) + continue; + + Rgb colour; + if ( exclude_id && !extra_zone.getNumCoords() && zones[i]->Id() == exclude_id ) + { + colour = extra_colour; + } + else + { + if ( zones[i]->IsActive() ) + { + colour = RGB_RED; + } + else if ( zones[i]->IsInclusive() ) + { + colour = RGB_ORANGE; + } + else if ( zones[i]->IsExclusive() ) + { + colour = RGB_PURPLE; + } + else if ( zones[i]->IsPreclusive() ) + { + colour = RGB_BLUE; + } + else + { + colour = RGB_WHITE; + } + } + zone_image.Fill( colour, 2, zones[i]->GetPolygon() ); + zone_image.Outline( colour, zones[i]->GetPolygon() ); + } + + if ( extra_zone.getNumCoords() ) + { + zone_image.Fill( extra_colour, 2, extra_zone ); + zone_image.Outline( extra_colour, extra_zone ); + } + + static char filename[PATH_MAX]; + snprintf( filename, sizeof(filename), "Zones%d.jpg", id ); + zone_image.WriteJpeg( filename ); +} + +void Monitor::DumpImage( Image *dump_image ) const +{ + if ( image_count && !(image_count%10) ) + { + static char filename[PATH_MAX]; + static char new_filename[PATH_MAX]; + snprintf( filename, sizeof(filename), "Monitor%d.jpg", id ); + snprintf( new_filename, sizeof(new_filename), "Monitor%d-new.jpg", id ); + dump_image->WriteJpeg( new_filename ); + rename( new_filename, filename ); + } +} + +bool Monitor::CheckSignal( const Image *image ) +{ + static bool static_undef = true; + /* RGB24 colors */ + static uint8_t red_val; + static uint8_t green_val; + static uint8_t blue_val; + static uint8_t grayscale_val; /* 8bit grayscale color */ + static Rgb colour_val; /* RGB32 color */ + static int usedsubpixorder; + + if ( config.signal_check_points > 0 ) + { + if ( static_undef ) + { + static_undef = false; + usedsubpixorder = camera->SubpixelOrder(); + colour_val = rgb_convert(signal_check_colour, ZM_SUBPIX_ORDER_BGR); /* HTML colour code is actually BGR in memory, we want RGB */ + colour_val = rgb_convert(colour_val, usedsubpixorder); + red_val = RED_VAL_BGRA(signal_check_colour); + green_val = GREEN_VAL_BGRA(signal_check_colour); + blue_val = BLUE_VAL_BGRA(signal_check_colour); + grayscale_val = signal_check_colour & 0xff; /* Clear all bytes but lowest byte */ + } + + const uint8_t *buffer = image->Buffer(); + int pixels = image->Pixels(); + int width = image->Width(); + int colours = image->Colours(); + + int index = 0; + for ( int i = 0; i < config.signal_check_points; i++ ) + { + while( true ) + { + index = (int)(((long long)rand()*(long long)(pixels-1))/RAND_MAX); + if ( !config.timestamp_on_capture || !label_format[0] ) + break; + // Avoid sampling the rows with timestamp in + if ( index < (label_coord.Y()*width) || index >= (label_coord.Y()+Image::LINE_HEIGHT)*width ) + break; + } + + if(colours == ZM_COLOUR_GRAY8) { + if ( *(buffer+index) != grayscale_val ) + return true; + + } else if(colours == ZM_COLOUR_RGB24) { + const uint8_t *ptr = buffer+(index*colours); + + if ( usedsubpixorder == ZM_SUBPIX_ORDER_BGR) { + if ( (RED_PTR_BGRA(ptr) != red_val) || (GREEN_PTR_BGRA(ptr) != green_val) || (BLUE_PTR_BGRA(ptr) != blue_val) ) + return true; + } else { + /* Assume RGB */ + if ( (RED_PTR_RGBA(ptr) != red_val) || (GREEN_PTR_RGBA(ptr) != green_val) || (BLUE_PTR_RGBA(ptr) != blue_val) ) + return true; + } + + } else if(colours == ZM_COLOUR_RGB32) { + if ( usedsubpixorder == ZM_SUBPIX_ORDER_ARGB || usedsubpixorder == ZM_SUBPIX_ORDER_ABGR) { + if ( ARGB_ABGR_ZEROALPHA(*(((const Rgb*)buffer)+index)) != ARGB_ABGR_ZEROALPHA(colour_val) ) + return true; + } else { + /* Assume RGBA or BGRA */ + if ( RGBA_BGRA_ZEROALPHA(*(((const Rgb*)buffer)+index)) != RGBA_BGRA_ZEROALPHA(colour_val) ) + return true; + } + } + + } + return( false ); + } + return( true ); +} + +bool Monitor::Analyse() +{ + if ( shared_data->last_read_index == shared_data->last_write_index ) + { + return( false ); + } + + struct timeval now; + gettimeofday( &now, NULL ); + + if ( image_count && fps_report_interval && !(image_count%fps_report_interval) ) + { + fps = double(fps_report_interval)/(now.tv_sec-last_fps_time); + Info( "%s: %d - Processing at %.2f fps", name, image_count, fps ); + last_fps_time = now.tv_sec; + } + + int index; + if ( config.opt_adaptive_skip ) + { + int read_margin = shared_data->last_read_index - shared_data->last_write_index; + if ( read_margin < 0 ) read_margin += image_buffer_count; + + int step = 1; + if ( read_margin > 0 ) + { + step = (9*image_buffer_count)/(5*read_margin); + } + + int pending_frames = shared_data->last_write_index - shared_data->last_read_index; + if ( pending_frames < 0 ) pending_frames += image_buffer_count; + + Debug( 4, "RI:%d, WI: %d, PF = %d, RM = %d, Step = %d", shared_data->last_read_index, shared_data->last_write_index, pending_frames, read_margin, step ); + if ( step <= pending_frames ) + { + index = (shared_data->last_read_index+step)%image_buffer_count; + } + else + { + if ( pending_frames ) + { + Warning( "Approaching buffer overrun, consider slowing capture, simplifying analysis or increasing ring buffer size" ); + } + index = shared_data->last_write_index%image_buffer_count; + } + } + else + { + index = shared_data->last_write_index%image_buffer_count; + } + + Snapshot *snap = &image_buffer[index]; + struct timeval *timestamp = snap->timestamp; + Image *snap_image = snap->image; + + if ( shared_data->action ) + { + if ( shared_data->action & RELOAD ) + { + Info( "Received reload indication at count %d", image_count ); + shared_data->action &= ~RELOAD; + Reload(); + } + if ( shared_data->action & SUSPEND ) + { + if ( Active() ) + { + Info( "Received suspend indication at count %d", image_count ); + shared_data->active = false; + //closeEvent(); + } + if ( config.max_suspend_time ) + { + auto_resume_time = now.tv_sec + config.max_suspend_time; + } + shared_data->action &= ~SUSPEND; + } + if ( shared_data->action & RESUME ) + { + if ( Enabled() && !Active() ) + { + Info( "Received resume indication at count %d", image_count ); + shared_data->active = true; + ref_image = *snap_image; + ready_count = image_count+(warmup_count/2); + shared_data->alarm_x = shared_data->alarm_y = -1; + } + shared_data->action &= ~RESUME; + } + } + if ( auto_resume_time && (now.tv_sec >= auto_resume_time) ) + { + Info( "Auto resuming at count %d", image_count ); + shared_data->active = true; + ref_image = *snap_image; + ready_count = image_count+(warmup_count/2); + auto_resume_time = 0; + } + + static bool static_undef = true; + static struct timeval **timestamps; + static Image **images; + static int last_section_mod = 0; + static bool last_signal; + + if ( static_undef ) + { + static_undef = false; + timestamps = new struct timeval *[pre_event_count]; + images = new Image *[pre_event_count]; + last_signal = shared_data->signal; + } + + if ( Enabled() ) + { + bool signal = shared_data->signal; + bool signal_change = (signal != last_signal); + if ( trigger_data->trigger_state != TRIGGER_OFF ) + { + unsigned int score = 0; + if ( Ready() ) + { + std::string cause; + Event::StringSetMap noteSetMap; + + if ( trigger_data->trigger_state == TRIGGER_ON ) + { + score += trigger_data->trigger_score; + if ( !event ) + { + if ( cause.length() ) + cause += ", "; + cause += trigger_data->trigger_cause; + } + Event::StringSet noteSet; + noteSet.insert( trigger_data->trigger_text ); + noteSetMap[trigger_data->trigger_cause] = noteSet; + } + if ( signal_change ) + { + const char *signalText; + if ( !signal ) + signalText = "Lost"; + else + { + signalText = "Reacquired"; + score += 100; + } + Warning( "%s: %s", SIGNAL_CAUSE, signalText ); + if ( event && !signal ) + { + Info( "%s: %03d - Closing event %d, signal loss", name, image_count, event->Id() ); + closeEvent(); + last_section_mod = 0; + } + if ( !event ) + { + if ( cause.length() ) + cause += ", "; + cause += SIGNAL_CAUSE; + } + Event::StringSet noteSet; + noteSet.insert( signalText ); + noteSetMap[SIGNAL_CAUSE] = noteSet; + shared_data->state = state = IDLE; + shared_data->active = signal; + ref_image = *snap_image; + } + else if ( signal && Active() && (function == MODECT || function == MOCORD) ) + { + if ((config.turnoff_native_analysis && !config.load_plugins) || (!config.turnoff_native_analysis && (iDoNativeMotDet || (!iDoNativeMotDet && !config.load_plugins))) ) + + { + Event::StringSet zoneSet; + int motion_score = DetectMotion( *snap_image, zoneSet ); + //int motion_score = DetectBlack( *snap_image, zoneSet ); + if ( motion_score ) + { + if ( !event ) + { + score += motion_score; + if ( cause.length() ) + cause += ", "; + cause += MOTION_CAUSE; + } + else + { + score += motion_score; + } + noteSetMap[MOTION_CAUSE] = zoneSet; + + } + } + //==================================================================== + else + { + + for ( int n_zone = 0; n_zone < n_zones; n_zone++ ) + { + zones[n_zone]->ResetStats(); + } + } + + if (config.load_plugins) + { + std::string det_cause; // detection cause to fill in plugin's detectors + score += ThePluginManager.getImageAnalyser().DoDetection(*snap_image, zones, n_zones, noteSetMap, det_cause); + if (!event) + { + if (det_cause.length()) + { + if (cause.length()) + cause += ", "; + cause += det_cause; + } + + } + } + //==================================================================== + + shared_data->active = signal; + } + if ( (!signal_change && signal) && n_linked_monitors > 0 ) + { + bool first_link = true; + Event::StringSet noteSet; + for ( int i = 0; i < n_linked_monitors; i++ ) + { + if ( linked_monitors[i]->isConnected() ) + { + if ( linked_monitors[i]->hasAlarmed() ) + { + if ( !event ) + { + if ( first_link ) + { + if ( cause.length() ) + cause += ", "; + cause += LINKED_CAUSE; + first_link = false; + } + } + noteSet.insert( linked_monitors[i]->Name() ); + score += 50; + } + } + else + { + linked_monitors[i]->connect(); + } + } + if ( noteSet.size() > 0 ) + noteSetMap[LINKED_CAUSE] = noteSet; + } + if ( (!signal_change && signal) && (function == RECORD || function == MOCORD) ) + { + if ( event ) + { + int section_mod = timestamp->tv_sec%section_length; + if ( section_mod < last_section_mod ) + { + if ( state == IDLE || state == TAPE || event_close_mode == CLOSE_TIME ) + { + if ( state == TAPE ) + { + shared_data->state = state = IDLE; + Info( "%s: %03d - Closing event %d, section end", name, image_count, event->Id() ) + } + else + Info( "%s: %03d - Closing event %d, section end forced ", name, image_count, event->Id() ); + closeEvent(); + last_section_mod = 0; + } + } + else + { + last_section_mod = section_mod; + } + } + if ( !event ) + { + + // Create event + event = new Event( this, *timestamp, "Continuous", noteSetMap ); + shared_data->last_event = event->Id(); + + Info( "%s: %03d - Opening new event %d, section start", name, image_count, event->Id() ); + + /* To prevent cancelling out an existing alert\prealarm\alarm state */ + if ( state == IDLE ) + { + shared_data->state = state = TAPE; + } + + //if ( config.overlap_timed_events ) + if ( false ) + { + int pre_index = ((index+image_buffer_count)-pre_event_count)%image_buffer_count; + int pre_event_images = pre_event_count; + while ( pre_event_images && !image_buffer[pre_index].timestamp->tv_sec ) + { + pre_index = (pre_index+1)%image_buffer_count; + pre_event_images--; + } + + if ( pre_event_images ) + { + for ( int i = 0; i < pre_event_images; i++ ) + { + timestamps[i] = image_buffer[pre_index].timestamp; + images[i] = image_buffer[pre_index].image; + + pre_index = (pre_index+1)%image_buffer_count; + } + event->AddFrames( pre_event_images, images, timestamps ); + } + } + } + } + if ( score ) + { + if ( (state == IDLE || state == TAPE || state == PREALARM ) ) + { + if ( Event::PreAlarmCount() >= (alarm_frame_count-1) ) + { + Info( "%s: %03d - Gone into alarm state", name, image_count ); + shared_data->state = state = ALARM; + if ( signal_change || (function != MOCORD && state != ALERT) ) + { + int pre_index; + if ( alarm_frame_count > 1 ) + pre_index = ((index+image_buffer_count)-((alarm_frame_count-1)+pre_event_count))%image_buffer_count; + else + pre_index = ((index+image_buffer_count)-pre_event_count)%image_buffer_count; + + int pre_event_images = pre_event_count; + while ( pre_event_images && !image_buffer[pre_index].timestamp->tv_sec ) + { + pre_index = (pre_index+1)%image_buffer_count; + pre_event_images--; + } + + event = new Event( this, *(image_buffer[pre_index].timestamp), cause, noteSetMap ); + shared_data->last_event = event->Id(); + + Info( "%s: %03d - Opening new event %d, alarm start", name, image_count, event->Id() ); + + if ( pre_event_images ) + { + for ( int i = 0; i < pre_event_images; i++ ) + { + timestamps[i] = image_buffer[pre_index].timestamp; + images[i] = image_buffer[pre_index].image; + + pre_index = (pre_index+1)%image_buffer_count; + } + event->AddFrames( pre_event_images, images, timestamps ); + } + if ( alarm_frame_count ) + { + event->SavePreAlarmFrames(); + } + } + } + else if ( state != PREALARM ) + { + Info( "%s: %03d - Gone into prealarm state", name, image_count ); + shared_data->state = state = PREALARM; + } + } + else if ( state == ALERT ) + { + Info( "%s: %03d - Gone back into alarm state", name, image_count ); + shared_data->state = state = ALARM; + } + last_alarm_count = image_count; + } + else + { + if ( state == ALARM ) + { + Info( "%s: %03d - Gone into alert state", name, image_count ); + shared_data->state = state = ALERT; + } + else if ( state == ALERT ) + { + if ( image_count-last_alarm_count > post_event_count ) + { + Info( "%s: %03d - Left alarm state (%d) - %d(%d) images", name, image_count, event->Id(), event->Frames(), event->AlarmFrames() ); + //if ( function != MOCORD || event_close_mode == CLOSE_ALARM || event->Cause() == SIGNAL_CAUSE ) + if ( function != MOCORD || event_close_mode == CLOSE_ALARM ) + { + shared_data->state = state = IDLE; + Info( "%s: %03d - Closing event %d, alarm end%s", name, image_count, event->Id(), (function==MOCORD)?", section truncated":"" ); + closeEvent(); + } + else + { + shared_data->state = state = TAPE; + } + } + } + if ( state == PREALARM ) + { + if ( function != MOCORD ) + { + shared_data->state = state = IDLE; + } + else + { + shared_data->state = state = TAPE; + } + } + if ( Event::PreAlarmCount() ) + Event::EmptyPreAlarmFrames(); + } + if ( state != IDLE ) + { + if ( state == PREALARM || state == ALARM ) + { + if ( config.create_analysis_images ) + { + bool got_anal_image = false; + Image alarm_image( *snap_image ); + for( int i = 0; i < n_zones; i++ ) + { + if ( zones[i]->Alarmed() ) + { + if ( zones[i]->AlarmImage() ) + { + alarm_image.Overlay( *(zones[i]->AlarmImage()) ); + got_anal_image = true; + } + if ( config.record_event_stats && state == ALARM ) + { + zones[i]->RecordStats( event ); + } + } + } + if ( got_anal_image ) + { + if ( state == PREALARM ) + Event::AddPreAlarmFrame( snap_image, *timestamp, score, &alarm_image ); + else + event->AddFrame( snap_image, *timestamp, score, &alarm_image ); + } + else + { + if ( state == PREALARM ) + Event::AddPreAlarmFrame( snap_image, *timestamp, score ); + else + event->AddFrame( snap_image, *timestamp, score ); + } + } + else + { + for( int i = 0; i < n_zones; i++ ) + { + if ( zones[i]->Alarmed() ) + { + if ( config.record_event_stats && state == ALARM ) + { + zones[i]->RecordStats( event ); + } + } + } + if ( state == PREALARM ) + Event::AddPreAlarmFrame( snap_image, *timestamp, score ); + else + event->AddFrame( snap_image, *timestamp, score ); + } + if ( event && noteSetMap.size() > 0 ) + event->updateNotes( noteSetMap ); + } + else if ( state == ALERT ) + { + event->AddFrame( snap_image, *timestamp ); + if ( noteSetMap.size() > 0 ) + event->updateNotes( noteSetMap ); + } + else if ( state == TAPE ) + { + if ( !(image_count%(frame_skip+1)) ) + { + if ( config.bulk_frame_interval > 1 ) + { + event->AddFrame( snap_image, *timestamp, (event->Frames()AddFrame( snap_image, *timestamp ); + } + } + } + } + } + } + else + { + if ( event ) + { + Info( "%s: %03d - Closing event %d, trigger off", name, image_count, event->Id() ); + closeEvent(); + } + shared_data->state = state = IDLE; + last_section_mod = 0; + } + if ( (!signal_change && signal) && (function == MODECT || function == MOCORD) && (config.blend_alarmed_images || state != ALARM) ) + { + ref_image.Blend( *snap_image, ref_blend_perc ); + } + last_signal = signal; + } + + shared_data->last_read_index = index%image_buffer_count; + //shared_data->last_read_time = image_buffer[index].timestamp->tv_sec; + shared_data->last_read_time = now.tv_sec; + image_count++; + + return( true ); +} + +void Monitor::Reload() +{ + Debug( 1, "Reloading monitor %s", name ); + + if ( event ) + Info( "%s: %03d - Closing event %d, reloading", name, image_count, event->Id() ); + + closeEvent(); + + static char sql[ZM_SQL_MED_BUFSIZ]; + snprintf( sql, sizeof(sql), "select Function+0, Enabled, LinkedMonitors, EventPrefix, LabelFormat, LabelX, LabelY, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion, UsedPl, DoNativeMotDet, SignalCheckColour from Monitors where Id = '%d'", id ); + + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_monitors = mysql_num_rows( result ); + if ( n_monitors != 1 ) + { + Error( "Bogus number of monitors, %d, returned. Can't reload", n_monitors ); + return; + } + + if ( MYSQL_ROW dbrow = mysql_fetch_row( result ) ) + { + int index = 0; + function = (Function)atoi(dbrow[index++]); + enabled = atoi(dbrow[index++]); + const char *p_linked_monitors = dbrow[index++]; + strncpy( event_prefix, dbrow[index++], sizeof(event_prefix) ); + strncpy( label_format, dbrow[index++], sizeof(label_format) ); + label_coord = Coord( atoi(dbrow[index]), atoi(dbrow[index+1]) ); index += 2; + warmup_count = atoi(dbrow[index++]); + pre_event_count = atoi(dbrow[index++]); + post_event_count = atoi(dbrow[index++]); + alarm_frame_count = atoi(dbrow[index++]); + section_length = atoi(dbrow[index++]); + frame_skip = atoi(dbrow[index++]); + capture_delay = (dbrow[index]&&atof(dbrow[index])>0.0)?int(DT_PREC_3/atof(dbrow[index])):0; index++; + alarm_capture_delay = (dbrow[index]&&atof(dbrow[index])>0.0)?int(DT_PREC_3/atof(dbrow[index])):0; index++; + fps_report_interval = atoi(dbrow[index++]); + ref_blend_perc = atoi(dbrow[index++]); + track_motion = atoi(dbrow[index++]); + + //============================================================================ + std::string plugins = dbrow[index]; index++; + m_sPluginNames = split(plugins ,';'); + iDoNativeMotDet = atoi(dbrow[index++]); + //============================================================================ + + + if ( dbrow[index][0] == '#' ) + signal_check_colour = strtol(dbrow[index]+1,0,16); + else + signal_check_colour = strtol(dbrow[index],0,16); + index++; + + shared_data->state = state = IDLE; + shared_data->alarm_x = shared_data->alarm_y = -1; + if ( enabled ) + shared_data->active = true; + ready_count = image_count+warmup_count; + + ReloadLinkedMonitors( p_linked_monitors ); + } + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + mysql_free_result( result ); + + ReloadZones(); +} + +void Monitor::ReloadZones() +{ + Debug( 1, "Reloading zones for monitor %s", name ); + for( int i = 0; i < n_zones; i++ ) + { + delete zones[i]; + } + delete[] zones; + zones = 0; + n_zones = Zone::Load( this, zones ); + //DumpZoneImage(); +} + +void Monitor::ReloadLinkedMonitors( const char *p_linked_monitors ) +{ + Debug( 1, "Reloading linked monitors for monitor %s, '%s'", name, p_linked_monitors ); + if ( n_linked_monitors ) + { + for( int i = 0; i < n_linked_monitors; i++ ) + { + delete linked_monitors[i]; + } + delete[] linked_monitors; + linked_monitors = 0; + } + + n_linked_monitors = 0; + if ( p_linked_monitors ) + { + int n_link_ids = 0; + unsigned int link_ids[256]; + + char link_id_str[8]; + char *dest_ptr = link_id_str; + const char *src_ptr = p_linked_monitors; + while( 1 ) + { + dest_ptr = link_id_str; + while( *src_ptr >= '0' && *src_ptr <= '9' ) + { + if ( (dest_ptr-link_id_str) < (unsigned int)(sizeof(link_id_str)-1) ) + { + *dest_ptr++ = *src_ptr++; + } + else + { + break; + } + } + // Add the link monitor + if ( dest_ptr != link_id_str ) + { + *dest_ptr = '\0'; + unsigned int link_id = atoi(link_id_str); + if ( link_id > 0 && link_id != id) + { + Debug( 3, "Found linked monitor id %d", link_id ); + int j; + for ( j = 0; j < n_link_ids; j++ ) + { + if ( link_ids[j] == link_id ) + break; + } + if ( j == n_link_ids ) // Not already found + { + link_ids[n_link_ids++] = link_id; + } + } + } + if ( !*src_ptr ) + break; + while( *src_ptr && (*src_ptr < '0' || *src_ptr > '9') ) + src_ptr++; + if ( !*src_ptr ) + break; + } + if ( n_link_ids > 0 ) + { + Debug( 1, "Linking to %d monitors", n_link_ids ); + linked_monitors = new MonitorLink *[n_link_ids]; + int count = 0; + for ( int i = 0; i < n_link_ids; i++ ) + { + Debug( 1, "Checking linked monitor %d", link_ids[i] ); + + static char sql[ZM_SQL_SML_BUFSIZ]; + snprintf( sql, sizeof(sql), "select Id, Name from Monitors where Id = %d and Function != 'None' and Function != 'Monitor' and Enabled = 1", link_ids[i] ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_monitors = mysql_num_rows( result ); + if ( n_monitors == 1 ) + { + MYSQL_ROW dbrow = mysql_fetch_row( result ); + Debug( 1, "Linking to monitor %d", link_ids[i] ); + linked_monitors[count++] = new MonitorLink( link_ids[i], dbrow[1] ); + } + else + { + Warning( "Can't link to monitor %d, invalid id, function or not enabled", link_ids[i] ); + } + mysql_free_result( result ); + } + n_linked_monitors = count; + } + } +} + +#if ZM_HAS_V4L +int Monitor::LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose purpose ) +{ + static char sql[ZM_SQL_MED_BUFSIZ]; + if ( !device[0] ) + { + strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion, UsedPl, DoNativeMotDet, SignalCheckColour from Monitors where Function != 'None' and Type = 'Local' order by Device, Channel", sizeof(sql) ); + } + else + { + snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion, UsedPl, DoNativeMotDet, SignalCheckColour from Monitors where Function != 'None' and Type = 'Local' and Device = '%s' order by Channel", device ); + } + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_monitors = mysql_num_rows( result ); + Debug( 1, "Got %d monitors", n_monitors ); + delete[] monitors; + monitors = new Monitor *[n_monitors]; + for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) + { + int col = 0; + + int id = atoi(dbrow[col]); col++; + const char *name = dbrow[col]; col++; + int function = atoi(dbrow[col]); col++; + int enabled = atoi(dbrow[col]); col++; + const char *linked_monitors = dbrow[col]; col++; + + const char *device = dbrow[col]; col++; + int channel = atoi(dbrow[col]); col++; + int format = atoi(dbrow[col]); col++; + const char *method = dbrow[col]; col++; + + int width = atoi(dbrow[col]); col++; + int height = atoi(dbrow[col]); col++; + int colours = atoi(dbrow[col]); col++; + int palette = atoi(dbrow[col]); col++; + Orientation orientation = (Orientation)atoi(dbrow[col]); col++; + unsigned int deinterlacing = atoi(dbrow[col]); col++; + int brightness = atoi(dbrow[col]); col++; + int contrast = atoi(dbrow[col]); col++; + int hue = atoi(dbrow[col]); col++; + int colour = atoi(dbrow[col]); col++; + + const char *event_prefix = dbrow[col]; col++; + const char *label_format = dbrow[col]; col++; + + int label_x = atoi(dbrow[col]); col++; + int label_y = atoi(dbrow[col]); col++; + + int image_buffer_count = atoi(dbrow[col]); col++; + int warmup_count = atoi(dbrow[col]); col++; + int pre_event_count = atoi(dbrow[col]); col++; + int post_event_count = atoi(dbrow[col]); col++; + int stream_replay_buffer = atoi(dbrow[col]); col++; + int alarm_frame_count = atoi(dbrow[col]); col++; + int section_length = atoi(dbrow[col]); col++; + int frame_skip = atoi(dbrow[col]); col++; + int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int fps_report_interval = atoi(dbrow[col]); col++; + int ref_blend_perc = atoi(dbrow[col]); col++; + int track_motion = atoi(dbrow[col]); col++; + //============================================================================ + std::string plugins = dbrow[col]; col++; + int doNativeMotDet = atoi(dbrow[col]); col++; + //============================================================================ + + int signal_check_colour; + if ( dbrow[col][0] == '#' ) + signal_check_colour = strtol(dbrow[col]+1,0,16); + else + signal_check_colour = strtol(dbrow[col],0,16); + col++; + + int cam_width = ((orientation==ROTATE_90||orientation==ROTATE_270)?height:width); + int cam_height = ((orientation==ROTATE_90||orientation==ROTATE_270)?width:height); + + int extras = (deinterlacing>>24)&0xff; + + Camera *camera = new LocalCamera( + id, + device, + channel, + format, + method, + cam_width, + cam_height, + colours, + palette, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE, + extras + ); + + monitors[i] = new Monitor( + id, + name, + function, + enabled, + linked_monitors, + camera, + orientation, + deinterlacing, + event_prefix, + label_format, + Coord( label_x, label_y ), + image_buffer_count, + warmup_count, + pre_event_count, + post_event_count, + stream_replay_buffer, + alarm_frame_count, + section_length, + frame_skip, + capture_delay, + alarm_capture_delay, + fps_report_interval, + ref_blend_perc, + track_motion, + signal_check_colour, + purpose, + 0, + 0, + plugins, + doNativeMotDet + ); + Zone **zones = 0; + int n_zones = Zone::Load( monitors[i], zones ); + monitors[i]->AddZones( n_zones, zones ); + Debug( 1, "Loaded monitor %d(%s), %d zones", id, name, n_zones ); + } + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + // Yadda yadda + mysql_free_result( result ); + + return( n_monitors ); +} +#endif // ZM_HAS_V4L + +int Monitor::LoadRemoteMonitors( const char *protocol, const char *host, const char *port, const char *path, Monitor **&monitors, Purpose purpose ) +{ + static char sql[ZM_SQL_MED_BUFSIZ]; + if ( !protocol ) + { + strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Protocol, Method, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion, UsedPl, DoNativeMotDet from Monitors where Function != 'None' and Type = 'Remote'", sizeof(sql) ); + } + else + { + snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Protocol, Method, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion, UsedPl, DoNativeMotDet from Monitors where Function != 'None' and Type = 'Remote' and Protocol = '%s' and Host = '%s' and Port = '%s' and Path = '%s'", protocol, host, port, path ); + } + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_monitors = mysql_num_rows( result ); + Debug( 1, "Got %d monitors", n_monitors ); + delete[] monitors; + monitors = new Monitor *[n_monitors]; + for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) + { + int col = 0; + + int id = atoi(dbrow[col]); col++; + std::string name = dbrow[col]; col++; + int function = atoi(dbrow[col]); col++; + int enabled = atoi(dbrow[col]); col++; + const char *linked_monitors = dbrow[col]; col++; + + std::string protocol = dbrow[col]; col++; + std::string method = dbrow[col]; col++; + std::string host = dbrow[col]; col++; + std::string port = dbrow[col]; col++; + std::string path = dbrow[col]; col++; + + int width = atoi(dbrow[col]); col++; + int height = atoi(dbrow[col]); col++; + int colours = atoi(dbrow[col]); col++; + /* int palette = atoi(dbrow[col]); */ col++; + Orientation orientation = (Orientation)atoi(dbrow[col]); col++; + unsigned int deinterlacing = atoi(dbrow[col]); col++; + int brightness = atoi(dbrow[col]); col++; + int contrast = atoi(dbrow[col]); col++; + int hue = atoi(dbrow[col]); col++; + int colour = atoi(dbrow[col]); col++; + + std::string event_prefix = dbrow[col]; col++; + std::string label_format = dbrow[col]; col++; + + int label_x = atoi(dbrow[col]); col++; + int label_y = atoi(dbrow[col]); col++; + + int image_buffer_count = atoi(dbrow[col]); col++; + int warmup_count = atoi(dbrow[col]); col++; + int pre_event_count = atoi(dbrow[col]); col++; + int post_event_count = atoi(dbrow[col]); col++; + int stream_replay_buffer = atoi(dbrow[col]); col++; + int alarm_frame_count = atoi(dbrow[col]); col++; + int section_length = atoi(dbrow[col]); col++; + int frame_skip = atoi(dbrow[col]); col++; + int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int fps_report_interval = atoi(dbrow[col]); col++; + int ref_blend_perc = atoi(dbrow[col]); col++; + int track_motion = atoi(dbrow[col]); col++; + + //============================================================================ + std::string plugins = dbrow[col]; col++; + int doNativeMotDet = atoi(dbrow[col]); col++; + //============================================================================ + + + int cam_width = ((orientation==ROTATE_90||orientation==ROTATE_270)?height:width); + int cam_height = ((orientation==ROTATE_90||orientation==ROTATE_270)?width:height); + + Camera *camera = 0; + if ( protocol == "http" ) + { + camera = new RemoteCameraHttp( + id, + method, + host, // Host + port, // Port + path, // Path + cam_width, + cam_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE + ); + } +#if HAVE_LIBAVFORMAT + else if ( protocol == "rtsp" ) + { + camera = new RemoteCameraRtsp( + id, + method, + host, // Host + port, // Port + path, // Path + cam_width, + cam_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE + ); + } +#endif // HAVE_LIBAVFORMAT + else + { + Fatal( "Unexpected remote camera protocol '%s'", protocol.c_str() ); + } + + monitors[i] = new Monitor( + id, + name.c_str(), + function, + enabled, + linked_monitors, + camera, + orientation, + deinterlacing, + event_prefix.c_str(), + label_format.c_str(), + Coord( label_x, label_y ), + image_buffer_count, + warmup_count, + pre_event_count, + post_event_count, + stream_replay_buffer, + alarm_frame_count, + section_length, + frame_skip, + capture_delay, + alarm_capture_delay, + fps_report_interval, + ref_blend_perc, + track_motion, + RGB_WHITE, + purpose, + 0, + 0, + plugins, + doNativeMotDet + + ); + Zone **zones = 0; + int n_zones = Zone::Load( monitors[i], zones ); + monitors[i]->AddZones( n_zones, zones ); + Debug( 1, "Loaded monitor %d(%s), %d zones", id, name.c_str(), n_zones ); + } + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + // Yadda yadda + mysql_free_result( result ); + + return( n_monitors ); +} + +int Monitor::LoadFileMonitors( const char *file, Monitor **&monitors, Purpose purpose ) +{ + static char sql[ZM_SQL_MED_BUFSIZ]; + if ( !file[0] ) + { + strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion, UsedPl, DoNativeMotDet from Monitors where Function != 'None' and Type = 'File'", sizeof(sql) ); + } + else + { + snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion, UsedPl, DoNativeMotDet from Monitors where Function != 'None' and Type = 'File' and Path = '%s'", file ); + } + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_monitors = mysql_num_rows( result ); + Debug( 1, "Got %d monitors", n_monitors ); + delete[] monitors; + monitors = new Monitor *[n_monitors]; + for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) + { + int col = 0; + + int id = atoi(dbrow[col]); col++; + const char *name = dbrow[col]; col++; + int function = atoi(dbrow[col]); col++; + int enabled = atoi(dbrow[col]); col++; + const char *linked_monitors = dbrow[col]; col++; + + const char *path = dbrow[col]; col++; + + int width = atoi(dbrow[col]); col++; + int height = atoi(dbrow[col]); col++; + int colours = atoi(dbrow[col]); col++; + /* int palette = atoi(dbrow[col]); */ col++; + Orientation orientation = (Orientation)atoi(dbrow[col]); col++; + unsigned int deinterlacing = atoi(dbrow[col]); col++; + int brightness = atoi(dbrow[col]); col++; + int contrast = atoi(dbrow[col]); col++; + int hue = atoi(dbrow[col]); col++; + int colour = atoi(dbrow[col]); col++; + + const char *event_prefix = dbrow[col]; col++; + const char *label_format = dbrow[col]; col++; + + int label_x = atoi(dbrow[col]); col++; + int label_y = atoi(dbrow[col]); col++; + + int image_buffer_count = atoi(dbrow[col]); col++; + int warmup_count = atoi(dbrow[col]); col++; + int pre_event_count = atoi(dbrow[col]); col++; + int post_event_count = atoi(dbrow[col]); col++; + int stream_replay_buffer = atoi(dbrow[col]); col++; + int alarm_frame_count = atoi(dbrow[col]); col++; + int section_length = atoi(dbrow[col]); col++; + int frame_skip = atoi(dbrow[col]); col++; + int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int fps_report_interval = atoi(dbrow[col]); col++; + int ref_blend_perc = atoi(dbrow[col]); col++; + int track_motion = atoi(dbrow[col]); col++; + //============================================================================ + std::string plugins = dbrow[col]; col++; + int doNativeMotDet = atoi(dbrow[col]); col++; + + //============================================================================ + + int cam_width = ((orientation==ROTATE_90||orientation==ROTATE_270)?height:width); + int cam_height = ((orientation==ROTATE_90||orientation==ROTATE_270)?width:height); + + Camera *camera = new FileCamera( + id, + path, // File + cam_width, + cam_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE + ); + + monitors[i] = new Monitor( + id, + name, + function, + enabled, + linked_monitors, + camera, + orientation, + deinterlacing, + event_prefix, + label_format, + Coord( label_x, label_y ), + image_buffer_count, + warmup_count, + pre_event_count, + post_event_count, + stream_replay_buffer, + alarm_frame_count, + section_length, + frame_skip, + capture_delay, + alarm_capture_delay, + fps_report_interval, + ref_blend_perc, + track_motion, + RGB_WHITE, + purpose, + 0, + 0, + plugins, + doNativeMotDet + + ); + Zone **zones = 0; + int n_zones = Zone::Load( monitors[i], zones ); + monitors[i]->AddZones( n_zones, zones ); + Debug( 1, "Loaded monitor %d(%s), %d zones", id, name, n_zones ); + } + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + // Yadda yadda + mysql_free_result( result ); + + return( n_monitors ); +} + +#if HAVE_LIBAVFORMAT +int Monitor::LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose purpose ) +{ + static char sql[ZM_SQL_MED_BUFSIZ]; + if ( !file[0] ) + { + strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion, UsedPl, DoNativeMotDet from Monitors where Function != 'None' and Type = 'Ffmpeg'", sizeof(sql) ); + } + else + { + snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion, UsedPl, DoNativeMotDet from Monitors where Function != 'None' and Type = 'Ffmpeg' and Path = '%s'", file ); + } + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_monitors = mysql_num_rows( result ); + Debug( 1, "Got %d monitors", n_monitors ); + delete[] monitors; + monitors = new Monitor *[n_monitors]; + for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) + { + int col = 0; + + int id = atoi(dbrow[col]); col++; + const char *name = dbrow[col]; col++; + int function = atoi(dbrow[col]); col++; + int enabled = atoi(dbrow[col]); col++; + const char *linked_monitors = dbrow[col]; col++; + + const char *path = dbrow[col]; col++; + + int width = atoi(dbrow[col]); col++; + int height = atoi(dbrow[col]); col++; + int colours = atoi(dbrow[col]); col++; + /* int palette = atoi(dbrow[col]); */ col++; + Orientation orientation = (Orientation)atoi(dbrow[col]); col++; + unsigned int deinterlacing = atoi(dbrow[col]); col++; + int brightness = atoi(dbrow[col]); col++; + int contrast = atoi(dbrow[col]); col++; + int hue = atoi(dbrow[col]); col++; + int colour = atoi(dbrow[col]); col++; + + const char *event_prefix = dbrow[col]; col++; + const char *label_format = dbrow[col]; col++; + + int label_x = atoi(dbrow[col]); col++; + int label_y = atoi(dbrow[col]); col++; + + int image_buffer_count = atoi(dbrow[col]); col++; + int warmup_count = atoi(dbrow[col]); col++; + int pre_event_count = atoi(dbrow[col]); col++; + int post_event_count = atoi(dbrow[col]); col++; + int stream_replay_buffer = atoi(dbrow[col]); col++; + int alarm_frame_count = atoi(dbrow[col]); col++; + int section_length = atoi(dbrow[col]); col++; + int frame_skip = atoi(dbrow[col]); col++; + int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int fps_report_interval = atoi(dbrow[col]); col++; + int ref_blend_perc = atoi(dbrow[col]); col++; + int track_motion = atoi(dbrow[col]); col++; + //============================================================================ + std::string plugins = dbrow[col]; col++; + int doNativeMotDet = atoi(dbrow[col]); col++; + + //============================================================================ + + int cam_width = ((orientation==ROTATE_90||orientation==ROTATE_270)?height:width); + int cam_height = ((orientation==ROTATE_90||orientation==ROTATE_270)?width:height); + + Camera *camera = new FfmpegCamera( + id, + path, // File + cam_width, + cam_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE + ); + + monitors[i] = new Monitor( + id, + name, + function, + enabled, + linked_monitors, + camera, + orientation, + deinterlacing, + event_prefix, + label_format, + Coord( label_x, label_y ), + image_buffer_count, + warmup_count, + pre_event_count, + post_event_count, + stream_replay_buffer, + alarm_frame_count, + section_length, + frame_skip, + capture_delay, + alarm_capture_delay, + fps_report_interval, + ref_blend_perc, + track_motion, + RGB_WHITE, + purpose, + 0, + 0, + plugins, + doNativeMotDet + ); + Zone **zones = 0; + int n_zones = Zone::Load( monitors[i], zones ); + monitors[i]->AddZones( n_zones, zones ); + Debug( 1, "Loaded monitor %d(%s), %d zones", id, name, n_zones ); + } + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + // Yadda yadda + mysql_free_result( result ); + + return( n_monitors ); +} +#endif // HAVE_LIBAVFORMAT + +Monitor *Monitor::Load( int id, bool load_zones, Purpose purpose ) +{ + static char sql[ZM_SQL_MED_BUFSIZ]; + snprintf( sql, sizeof(sql), "select Id, Name, Type, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, Protocol, Method, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion, UsedPl, DoNativeMotDet, SignalCheckColour from Monitors where Id = %d", id ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_monitors = mysql_num_rows( result ); + Debug( 1, "Got %d monitors", n_monitors ); + Monitor *monitor = 0; + for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) + { + int col = 0; + + int id = atoi(dbrow[col]); col++; + std::string name = dbrow[col]; col++; + std::string type = dbrow[col]; col++; + int function = atoi(dbrow[col]); col++; + int enabled = atoi(dbrow[col]); col++; + std::string linked_monitors = dbrow[col]; col++; + + std::string device = dbrow[col]; col++; + int channel = atoi(dbrow[col]); col++; + int format = atoi(dbrow[col]); col++; + + std::string protocol = dbrow[col]; col++; + std::string method = dbrow[col]; col++; + std::string host = dbrow[col]; col++; + std::string port = dbrow[col]; col++; + std::string path = dbrow[col]; col++; + + int width = atoi(dbrow[col]); col++; + int height = atoi(dbrow[col]); col++; + int colours = atoi(dbrow[col]); col++; + int palette = atoi(dbrow[col]); col++; + Orientation orientation = (Orientation)atoi(dbrow[col]); col++; + unsigned int deinterlacing = atoi(dbrow[col]); col++; + int brightness = atoi(dbrow[col]); col++; + int contrast = atoi(dbrow[col]); col++; + int hue = atoi(dbrow[col]); col++; + int colour = atoi(dbrow[col]); col++; + + std::string event_prefix = dbrow[col]; col++; + std::string label_format = dbrow[col]; col++; + + int label_x = atoi(dbrow[col]); col++; + int label_y = atoi(dbrow[col]); col++; + + int image_buffer_count = atoi(dbrow[col]); col++; + int warmup_count = atoi(dbrow[col]); col++; + int pre_event_count = atoi(dbrow[col]); col++; + int post_event_count = atoi(dbrow[col]); col++; + int stream_replay_buffer = atoi(dbrow[col]); col++; + int alarm_frame_count = atoi(dbrow[col]); col++; + int section_length = atoi(dbrow[col]); col++; + int frame_skip = atoi(dbrow[col]); col++; + int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int fps_report_interval = atoi(dbrow[col]); col++; + int ref_blend_perc = atoi(dbrow[col]); col++; + int track_motion = atoi(dbrow[col]); col++; + //============================================================================ + std::string plugins = dbrow[col]; col++; + int doNativeMotDet = atoi(dbrow[col]); col++; + + //============================================================================ + + int signal_check_colour; + if ( dbrow[col][0] == '#' ) + signal_check_colour = strtol(dbrow[col]+1,0,16); + else + signal_check_colour = strtol(dbrow[col],0,16); + + int cam_width = ((orientation==ROTATE_90||orientation==ROTATE_270)?height:width); + int cam_height = ((orientation==ROTATE_90||orientation==ROTATE_270)?width:height); + + int extras = (deinterlacing>>24)&0xff; + + Camera *camera = 0; + if ( type == "Local" ) + { +#if ZM_HAS_V4L + camera = new LocalCamera( + id, + device.c_str(), + channel, + format, + method, + cam_width, + cam_height, + colours, + palette, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE, + extras + ); +#else // ZM_HAS_V4L + Fatal( "You must have video4linux libraries and headers installed to use local analog or USB cameras for monitor %d", id ); +#endif // ZM_HAS_V4L + } + else if ( type == "Remote" ) + { + if ( protocol == "http" ) + { + camera = new RemoteCameraHttp( + id, + method.c_str(), + host.c_str(), + port.c_str(), + path.c_str(), + cam_width, + cam_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE + ); + } + else if ( protocol == "rtsp" ) + { +#if HAVE_LIBAVFORMAT + camera = new RemoteCameraRtsp( + id, + method.c_str(), + host.c_str(), + port.c_str(), + path.c_str(), + cam_width, + cam_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE + ); +#else // HAVE_LIBAVFORMAT + Fatal( "You must have ffmpeg libraries installed to use remote camera protocol '%s' for monitor %d", protocol.c_str(), id ); +#endif // HAVE_LIBAVFORMAT + } + else + { + Fatal( "Unexpected remote camera protocol '%s' for monitor %d", protocol.c_str(), id ); + } + } + else if ( type == "File" ) + { + camera = new FileCamera( + id, + path.c_str(), + cam_width, + cam_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE + ); + } + else if ( type == "Ffmpeg" ) + { +#if HAVE_LIBAVFORMAT + camera = new FfmpegCamera( + id, + path.c_str(), + cam_width, + cam_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE + ); +#else // HAVE_LIBAVFORMAT + Fatal( "You must have ffmpeg libraries installed to use ffmpeg cameras for monitor %d", id ); +#endif // HAVE_LIBAVFORMAT + } + else + { + Fatal( "Bogus monitor type '%s' for monitor %d", type.c_str(), id ); + } + monitor = new Monitor( + id, + name.c_str(), + function, + enabled, + linked_monitors.c_str(), + camera, + orientation, + deinterlacing, + event_prefix.c_str(), + label_format.c_str(), + Coord( label_x, label_y ), + image_buffer_count, + warmup_count, + pre_event_count, + post_event_count, + stream_replay_buffer, + alarm_frame_count, + section_length, + frame_skip, + capture_delay, + alarm_capture_delay, + fps_report_interval, + ref_blend_perc, + track_motion, + signal_check_colour, + purpose, + 0, + 0, + plugins, + doNativeMotDet + + ); + + int n_zones = 0; + if ( load_zones ) + { + Zone **zones = 0; + n_zones = Zone::Load( monitor, zones ); + monitor->AddZones( n_zones, zones ); + } + Debug( 1, "Loaded monitor %d(%s), %d zones", id, name.c_str(), n_zones ); + } + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + // Yadda yadda + mysql_free_result( result ); + + return( monitor ); +} + +int Monitor::Capture() +{ + static int FirstCapture = 1; + int captureResult; + + int index = image_count%image_buffer_count; + Image* capture_image = image_buffer[index].image; + + if ( (deinterlacing & 0xff) == 4) { + if ( FirstCapture != 1 ) { + /* Copy the next image into the shared memory */ + capture_image->CopyBuffer(*(next_buffer.image)); + } + + /* Capture a new next image */ + captureResult = camera->Capture(*(next_buffer.image)); + + if ( FirstCapture ) { + FirstCapture = 0; + return 0; + } + + } else { + /* Capture directly into image buffer, avoiding the need to memcpy() */ + captureResult = camera->Capture(*capture_image); + } + + if ( captureResult != 0 ) + { + // Unable to capture image for temporary reason + // Fake a signal loss image + capture_image->Fill( signal_check_colour ); + captureResult = 0; + } else { + captureResult = 1; + } + + if ( captureResult == 1 ) + { + + /* Deinterlacing */ + if ( (deinterlacing & 0xff) == 1 ) { + capture_image->Deinterlace_Discard(); + } else if ( (deinterlacing & 0xff) == 2 ) { + capture_image->Deinterlace_Linear(); + } else if ( (deinterlacing & 0xff) == 3 ) { + capture_image->Deinterlace_Blend(); + } else if ( (deinterlacing & 0xff) == 4 ) { + capture_image->Deinterlace_4Field( next_buffer.image, (deinterlacing>>8)&0xff ); + } else if ( (deinterlacing & 0xff) == 5 ) { + capture_image->Deinterlace_Blend_CustomRatio( (deinterlacing>>8)&0xff ); + } + + + if ( orientation != ROTATE_0 ) + { + switch ( orientation ) + { + case ROTATE_0 : + { + // No action required + break; + } + case ROTATE_90 : + case ROTATE_180 : + case ROTATE_270 : + { + capture_image->Rotate( (orientation-1)*90 ); + break; + } + case FLIP_HORI : + case FLIP_VERT : + { + capture_image->Flip( orientation==FLIP_HORI ); + break; + } + } + } + + } + if ( true ) { + + if ( (unsigned int)capture_image->Size() != camera->ImageSize() ) + { + Error( "Captured image does not match expected size, check width, height and colour depth" ); + return( -1 ); + } + + if ( ((unsigned int)index == shared_data->last_read_index) && (function > MONITOR) ) + { + Warning( "Buffer overrun at index %d, image %d, slow down capture, speed up analysis or increase ring buffer size", index, image_count ); + time_t now = time(0); + double approxFps = double(image_buffer_count)/double(now-image_buffer[index].timestamp->tv_sec); + time_t last_read_delta = now - shared_data->last_read_time; + if ( last_read_delta > (image_buffer_count/approxFps) ) + { + Warning( "Last image read from shared memory %ld seconds ago, zma may have gone away", last_read_delta ) + shared_data->last_read_index = image_buffer_count; + } + } + + gettimeofday( image_buffer[index].timestamp, NULL ); + if ( config.timestamp_on_capture ) + { + TimestampImage( capture_image, image_buffer[index].timestamp ); + } + shared_data->signal = CheckSignal(capture_image); + shared_data->last_write_index = index; + shared_data->last_write_time = image_buffer[index].timestamp->tv_sec; + + image_count++; + + if ( image_count && fps_report_interval && !(image_count%fps_report_interval) ) + { + time_t now = image_buffer[index].timestamp->tv_sec; + fps = double(fps_report_interval)/(now-last_fps_time); + //Info( "%d -> %d -> %d", fps_report_interval, now, last_fps_time ); + //Info( "%d -> %d -> %lf -> %lf", now-last_fps_time, fps_report_interval/(now-last_fps_time), double(fps_report_interval)/(now-last_fps_time), fps ); + Info( "%s: %d - Capturing at %.2lf fps", name, image_count, fps ); + last_fps_time = now; + } + + if ( shared_data->action & GET_SETTINGS ) + { + shared_data->brightness = camera->Brightness(); + shared_data->hue = camera->Hue(); + shared_data->colour = camera->Colour(); + shared_data->contrast = camera->Contrast(); + shared_data->action &= ~GET_SETTINGS; + } + if ( shared_data->action & SET_SETTINGS ) + { + camera->Brightness( shared_data->brightness ); + camera->Hue( shared_data->hue ); + camera->Colour( shared_data->colour ); + camera->Contrast( shared_data->contrast ); + shared_data->action &= ~SET_SETTINGS; + } + return( 0 ); + } + shared_data->signal = false; + return( -1 ); +} + +void Monitor::TimestampImage( Image *ts_image, const struct timeval *ts_time ) const +{ + if ( label_format[0] ) + { + // Expand the strftime macros first + char label_time_text[256]; + strftime( label_time_text, sizeof(label_time_text), label_format, localtime( &ts_time->tv_sec ) ); + + char label_text[1024]; + const char *s_ptr = label_time_text; + char *d_ptr = label_text; + while ( *s_ptr && ((d_ptr-label_text) < (unsigned int)sizeof(label_text)) ) + { + if ( *s_ptr == '%' ) + { + bool found_macro = false; + switch ( *(s_ptr+1) ) + { + case 'N' : + d_ptr += snprintf( d_ptr, sizeof(label_text)-(d_ptr-label_text), "%s", name ); + found_macro = true; + break; + case 'Q' : + d_ptr += snprintf( d_ptr, sizeof(label_text)-(d_ptr-label_text), "%s", trigger_data->trigger_showtext ); + found_macro = true; + break; + case 'f' : + d_ptr += snprintf( d_ptr, sizeof(label_text)-(d_ptr-label_text), "%02ld", ts_time->tv_usec/10000 ); + found_macro = true; + break; + } + if ( found_macro ) + { + s_ptr += 2; + continue; + } + } + *d_ptr++ = *s_ptr++; + } + *d_ptr = '\0'; + ts_image->Annotate( label_text, label_coord ); + } +} + +bool Monitor::closeEvent() +{ + if ( event ) + { + if ( function == RECORD || function == MOCORD ) + { + gettimeofday( &(event->EndTime()), NULL ); + } + delete event; + event = 0; + return( true ); + } + return( false ); +} + +//----------------------------------------- + +/* + * NOTE Nextime's comment: + * + * OurCheckAlarms seems to be called only by DetectBlack method, and DetectBlack + * method is only called in a commented line instead of DetectMotion in zm_monitor.cpp. + * + * Probably this is just a dead code used for debugghing purpose, so, instead of fixing it + * it seems to be safe to just comment it out. + * + * Anyway, the issues with this code is that it assumes the image to be an RGB24 image, + * so, as i've discussed on IRC with mastertheknife, changes needed are: + * + * Check if the image is 24 or 32 bits ( pImage->Colours() says 3 for 24 and 4 for 32 bits, + * comparing it with ZM_COLOUR_RGB24 or ZM_COLOUR_RGB32 is the way ), and then + * manage che check using RGB_VAL_RED() and so on macros instead of just RED(). + * + * Be carefull that in 32 bit images we need to check also where the alpha channel is, so, + * (RGBA and BGRA) or (ABGR and ARGB) aren't the same! + * + * To check black pixels in 32 bit images i can do a more efficient way using + * RGBA_ZERO_ALPHA(pixel) == RGBA_ZERO_ALPHA(RGB_BLACK), but before of that i need to + * check where the alpha channel is and maybe convert it. + * Maybe this won't work as they assign "23" to black_thr, so, they are not checking + * if the pixel is black, but just "quasi" black is enough. + * + * Anyway, for the moment, comment out whole part. + */ + +/* +bool Monitor::OurCheckAlarms( Zone *zone, const Image *pImage ) +{ + Info("Entering OurCheckAlarms >>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + unsigned char black_thr = 23; + int min_alarm_score = 10; + int max_alarm_score = 99; + //bool alarm = false; + unsigned int score; + Polygon zone_polygon = zone->GetPolygon(); + Info("Got polygon of a zone. It has %d vertices.", zone_polygon.getNumCoords()); + + zone->ResetStats(); + Info("ResetStats done."); + + if ( !zone->CheckOverloadCount() ) + { + Info("CheckOverloadCount() return false, we'll return false."); + return( false ); + } + + Image *pMaskImage = new Image(pImage->Width(), pImage->Height(), ZM_COLOUR_GRAY8, pImage->SubpixelOrder()); + Info("Mask image created."); + + pMaskImage->Fill(BLACK); + Info("Mask image filled with BLACK."); + if (pImage->Colours() == ZM_COLOUR_GRAY8) + { + Info("Analysed image is not colored! Set score = 0."); + score = 0; + } + else + { + Info("Start processing image."); + //Process image + unsigned char *buffer = (unsigned char*)pImage->Buffer(); + unsigned char *mask_buffer = (unsigned char*)pMaskImage->Buffer(); + + int black_pixels_count = 0; + Info("Loop for black pixels counting and mask filling."); + while (buffer < (pImage->Buffer() + pImage->Size())) + { + if ( (RED(buffer) < black_thr) && (GREEN(buffer) < black_thr) && (BLUE(buffer) < black_thr) ) + { + *mask_buffer = WHITE; + black_pixels_count++; + } + buffer += pImage->Colours(); + mask_buffer++; + } + + if ( !black_pixels_count ) + { + delete pMaskImage; + return( false ); + } + score = (100*black_pixels_count)/zone_polygon.Area(); + Info("Number of black pixels is %d, zone polygon area is %d, score is %d", black_pixels_count, zone_polygon.Area(), score); + + if ( min_alarm_score && ( score < min_alarm_score) ) + { + delete pMaskImage; + return( false ); + } + if ( max_alarm_score && (score > max_alarm_score) ) + { + zone->SetOverloadCount(zone->GetOverloadFrames()); + delete pMaskImage; + return( false ); + } + } + + zone->SetScore(score); + Info("Score have been set in zone."); + //Get mask + Rgb alarm_colour = RGB_RED; + Image *tempImage = pMaskImage->HighlightEdges(alarm_colour, &zone_polygon.Extent() ); + Info("After HighlightEdges"); + + zone->SetAlarmImage(tempImage); + Info("After SetAlarmImage"); + delete pMaskImage; + Info("After Delete pMaskImage"); + delete tempImage; + + Info("Leaving OurCheckAlarms >>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + return true; +} + +unsigned int Monitor::DetectBlack(const Image &comp_image, Event::StringSet &zoneSet ) +{ + Info("Entering DetectBlack >>>>>>>>>>>>>>>>>>>>>>>>>>"); + bool alarm = false; + unsigned int score = 0; + + if ( n_zones <= 0 ) return( alarm ); + +// Coord alarm_centre; +// int top_score = -1; + + // Find all alarm pixels in active zones + Info("Number of zones to process %d", n_zones); + for ( int n_zone = 0; n_zone < n_zones; n_zone++ ) + { + Zone *zone = zones[n_zone]; + if ( !zone->IsActive() ) + { + continue; + } + Debug( 3, "Checking active zone %s", zone->Label() ); + Info( "Checking active zone %s", zone->Label() ); + if ( OurCheckAlarms( zone, &comp_image ) ) + { + Info("OurCheckAlarm is TRUE!!!!!!"); + alarm = true; + score += zone->Score(); + zone->SetAlarm(); + Debug( 3, "Zone is alarmed, zone score = %d", zone->Score() ); + Info( "Zone is alarmed, zone score = %d", zone->Score() ); + zoneSet.insert( zone->Label() ); +// if ( config.opt_control && track_motion ) +// { +// if ( (int)zone->Score() > top_score ) +// { +// top_score = zone->Score(); +// alarm_centre = zone->GetAlarmCentre(); +// } +// } + } + Info( "Finish checking active zone %s", zone->Label() ); + } + + +// if ( top_score > 0 ) +// { +// shared_data->alarm_x = alarm_centre.X(); +// shared_data->alarm_y = alarm_centre.Y(); +// +// Info( "Got alarm centre at %d,%d, at count %d", shared_data->alarm_x, shared_data->alarm_y, image_count ); +// } +// else +// { +// shared_data->alarm_x = shared_data->alarm_y = -1; +// } + + // This is a small and innocent hack to prevent scores of 0 being returned in alarm state + Info("Leaving DetectBlack <<<<<<<<<<<<<<<<<<<<<<<<<<<"); + return( score?score:alarm ); +} + +*/ +//----------------------------------------------------------------------------------------------- + + + +unsigned int Monitor::DetectMotion( const Image &comp_image, Event::StringSet &zoneSet ) +{ + bool alarm = false; + unsigned int score = 0; + + if ( n_zones <= 0 ) return( alarm ); + + if ( config.record_diag_images ) + { + static char diag_path[PATH_MAX] = ""; + if ( !diag_path[0] ) + { + snprintf( diag_path, sizeof(diag_path), "%s/%d/diag-r.jpg", config.dir_events, id ); + } + ref_image.WriteJpeg( diag_path ); + } + + ref_image.Delta( comp_image, &delta_image); + + if ( config.record_diag_images ) + { + static char diag_path[PATH_MAX] = ""; + if ( !diag_path[0] ) + { + snprintf( diag_path, sizeof(diag_path), "%s/%d/diag-d.jpg", config.dir_events, id ); + } + delta_image.WriteJpeg( diag_path ); + } + + // Blank out all exclusion zones + for ( int n_zone = 0; n_zone < n_zones; n_zone++ ) + { + Zone *zone = zones[n_zone]; + zone->ClearAlarm(); + if ( !zone->IsInactive() ) + { + continue; + } + Debug( 3, "Blanking inactive zone %s", zone->Label() ); + delta_image.Fill( RGB_BLACK, zone->GetPolygon() ); + } + + // Check preclusive zones first + for ( int n_zone = 0; n_zone < n_zones; n_zone++ ) + { + Zone *zone = zones[n_zone]; + if ( !zone->IsPreclusive() ) + { + continue; + } + Debug( 3, "Checking preclusive zone %s", zone->Label() ); + if ( zone->CheckAlarms( &delta_image ) ) + { + alarm = true; + score += zone->Score(); + Debug( 3, "Zone is alarmed, zone score = %d", zone->Score() ); + zoneSet.insert( zone->Label() ); + //zone->ResetStats(); + } + } + + Coord alarm_centre; + int top_score = -1; + + if ( alarm ) + { + alarm = false; + score = 0; + } + else + { + // Find all alarm pixels in active zones + for ( int n_zone = 0; n_zone < n_zones; n_zone++ ) + { + Zone *zone = zones[n_zone]; + if ( !zone->IsActive() ) + { + continue; + } + Debug( 3, "Checking active zone %s", zone->Label() ); + if ( zone->CheckAlarms( &delta_image ) ) + { + alarm = true; + score += zone->Score(); + zone->SetAlarm(); + Debug( 3, "Zone is alarmed, zone score = %d", zone->Score() ); + zoneSet.insert( zone->Label() ); + if ( config.opt_control && track_motion ) + { + if ( (int)zone->Score() > top_score ) + { + top_score = zone->Score(); + alarm_centre = zone->GetAlarmCentre(); + } + } + } + } + + if ( alarm ) + { + for ( int n_zone = 0; n_zone < n_zones; n_zone++ ) + { + Zone *zone = zones[n_zone]; + if ( !zone->IsInclusive() ) + { + continue; + } + Debug( 3, "Checking inclusive zone %s", zone->Label() ); + if ( zone->CheckAlarms( &delta_image ) ) + { + alarm = true; + score += zone->Score(); + zone->SetAlarm(); + Debug( 3, "Zone is alarmed, zone score = %d", zone->Score() ); + zoneSet.insert( zone->Label() ); + if ( config.opt_control && track_motion ) + { + if ( zone->Score() > (unsigned int)top_score ) + { + top_score = zone->Score(); + alarm_centre = zone->GetAlarmCentre(); + } + } + } + } + } + else + { + // Find all alarm pixels in exclusive zones + for ( int n_zone = 0; n_zone < n_zones; n_zone++ ) + { + Zone *zone = zones[n_zone]; + if ( !zone->IsExclusive() ) + { + continue; + } + Debug( 3, "Checking exclusive zone %s", zone->Label() ); + if ( zone->CheckAlarms( &delta_image ) ) + { + alarm = true; + score += zone->Score(); + zone->SetAlarm(); + Debug( 3, "Zone is alarmed, zone score = %d", zone->Score() ); + zoneSet.insert( zone->Label() ); + } + } + } + } + + if ( top_score > 0 ) + { + shared_data->alarm_x = alarm_centre.X(); + shared_data->alarm_y = alarm_centre.Y(); + + Info( "Got alarm centre at %d,%d, at count %d", shared_data->alarm_x, shared_data->alarm_y, image_count ); + } + else + { + shared_data->alarm_x = shared_data->alarm_y = -1; + } + + // This is a small and innocent hack to prevent scores of 0 being returned in alarm state + return( score?score:alarm ); +} + +bool Monitor::DumpSettings( char *output, bool verbose ) +{ + output[0] = 0; + + sprintf( output+strlen(output), "Id : %d\n", id ); + sprintf( output+strlen(output), "Name : %s\n", name ); + sprintf( output+strlen(output), "Type : %s\n", camera->IsLocal()?"Local":(camera->IsRemote()?"Remote":"File") ); +#if ZM_HAS_V4L + if ( camera->IsLocal() ) + { + sprintf( output+strlen(output), "Device : %s\n", ((LocalCamera *)camera)->Device().c_str() ); + sprintf( output+strlen(output), "Channel : %d\n", ((LocalCamera *)camera)->Channel() ); + sprintf( output+strlen(output), "Standard : %d\n", ((LocalCamera *)camera)->Standard() ); + } + else +#endif // ZM_HAS_V4L + if ( camera->IsRemote() ) + { + sprintf( output+strlen(output), "Protocol : %s\n", ((RemoteCamera *)camera)->Protocol().c_str() ); + sprintf( output+strlen(output), "Host : %s\n", ((RemoteCamera *)camera)->Host().c_str() ); + sprintf( output+strlen(output), "Port : %s\n", ((RemoteCamera *)camera)->Port().c_str() ); + sprintf( output+strlen(output), "Path : %s\n", ((RemoteCamera *)camera)->Path().c_str() ); + } + else if ( camera->IsFile() ) + { + sprintf( output+strlen(output), "Path : %s\n", ((FileCamera *)camera)->Path() ); + } +#if HAVE_LIBAVFORMAT + else if ( camera->IsFfmpeg() ) + { + sprintf( output+strlen(output), "Path : %s\n", ((FfmpegCamera *)camera)->Path().c_str() ); + } +#endif // HAVE_LIBAVFORMAT + sprintf( output+strlen(output), "Width : %d\n", camera->Width() ); + sprintf( output+strlen(output), "Height : %d\n", camera->Height() ); +#if ZM_HAS_V4L + if ( camera->IsLocal() ) + { + sprintf( output+strlen(output), "Palette : %d\n", ((LocalCamera *)camera)->Palette() ); + } +#endif // ZM_HAS_V4L + sprintf( output+strlen(output), "Colours : %d\n", camera->Colours() ); + sprintf( output+strlen(output), "Subpixel Order : %d\n", camera->SubpixelOrder() ); + sprintf( output+strlen(output), "Event Prefix : %s\n", event_prefix ); + sprintf( output+strlen(output), "Label Format : %s\n", label_format ); + sprintf( output+strlen(output), "Label Coord : %d,%d\n", label_coord.X(), label_coord.Y() ); + sprintf( output+strlen(output), "Image Buffer Count : %d\n", image_buffer_count ); + sprintf( output+strlen(output), "Warmup Count : %d\n", warmup_count ); + sprintf( output+strlen(output), "Pre Event Count : %d\n", pre_event_count ); + sprintf( output+strlen(output), "Post Event Count : %d\n", post_event_count ); + sprintf( output+strlen(output), "Stream Replay Buffer : %d\n", stream_replay_buffer ); + sprintf( output+strlen(output), "Alarm Frame Count : %d\n", alarm_frame_count ); + sprintf( output+strlen(output), "Section Length : %d\n", section_length ); + sprintf( output+strlen(output), "Maximum FPS : %.2f\n", capture_delay?DT_PREC_3/capture_delay:0.0 ); + sprintf( output+strlen(output), "Alarm Maximum FPS : %.2f\n", alarm_capture_delay?DT_PREC_3/alarm_capture_delay:0.0 ); + sprintf( output+strlen(output), "Reference Blend %%ge : %d\n", ref_blend_perc ); + sprintf( output+strlen(output), "Track Motion : %d\n", track_motion ); + sprintf( output+strlen(output), "Function: %d - %s\n", function, + function==NONE?"None":( + function==MONITOR?"Monitor Only":( + function==MODECT?"Motion Detection":( + function==RECORD?"Continuous Record":( + function==MOCORD?"Continuous Record with Motion Detection":( + function==NODECT?"Externally Triggered only, no Motion Detection":"Unknown" + )))))); + sprintf( output+strlen(output), "Zones : %d\n", n_zones ); + for ( int i = 0; i < n_zones; i++ ) + { + zones[i]->DumpSettings( output+strlen(output), verbose ); + } + return( true ); +} + +bool MonitorStream::checkSwapPath( const char *path, bool create_path ) +{ + uid_t uid = getuid(); + gid_t gid = getgid(); + + struct stat stat_buf; + if ( stat( path, &stat_buf ) < 0 ) + { + if ( create_path && errno == ENOENT ) + { + Debug( 3, "Swap path '%s' missing, creating", path ); + if ( mkdir( path, 0755 ) ) + { + Error( "Can't mkdir %s: %s", path, strerror(errno)); + return( false ); + } + if ( stat( path, &stat_buf ) < 0 ) + { + Error( "Can't stat '%s': %s", path, strerror(errno) ); + return( false ); + } + } + else + { + Error( "Can't stat '%s': %s", path, strerror(errno) ); + return( false ); + } + } + if ( !S_ISDIR(stat_buf.st_mode) ) + { + Error( "Swap image path '%s' is not a directory", path ); + return( false ); + } + + mode_t mask = 0; + if ( uid == stat_buf.st_uid ) + { + // If we are the owner + mask = 00700; + } + else if ( gid == stat_buf.st_gid ) + { + // If we are in the owner group + mask = 00070; + } + else + { + // We are neither the owner nor in the group + mask = 00007; + } + + if ( (stat_buf.st_mode & mask) != mask ) + { + Error( "Insufficient permissions on swap image path '%s'", path ); + return( false ); + } + return( true ); +} + +void MonitorStream::processCommand( const CmdMsg *msg ) +{ + Debug( 2, "Got message, type %d, msg %d", msg->msg_type, msg->msg_data[0] ); + // Check for incoming command + switch( (MsgCommand)msg->msg_data[0] ) + { + case CMD_PAUSE : + { + Debug( 1, "Got PAUSE command" ); + + // Set paused flag + paused = true; + // Set delayed flag + delayed = true; + last_frame_sent = TV_2_FLOAT( now ); + break; + } + case CMD_PLAY : + { + Debug( 1, "Got PLAY command" ); + if ( paused ) + { + // Clear paused flag + paused = false; + // Set delayed_play flag + delayed = true; + } + replay_rate = ZM_RATE_BASE; + break; + } + case CMD_VARPLAY : + { + Debug( 1, "Got VARPLAY command" ); + if ( paused ) + { + // Clear paused flag + paused = false; + // Set delayed_play flag + delayed = true; + } + replay_rate = ntohs(((unsigned char)msg->msg_data[2]<<8)|(unsigned char)msg->msg_data[1])-32768; + break; + } + case CMD_STOP : + { + Debug( 1, "Got STOP command" ); + + // Clear paused flag + paused = false; + // Clear delayed_play flag + delayed = false; + break; + } + case CMD_FASTFWD : + { + Debug( 1, "Got FAST FWD command" ); + if ( paused ) + { + // Clear paused flag + paused = false; + // Set delayed_play flag + delayed = true; + } + // Set play rate + switch ( replay_rate ) + { + case 2 * ZM_RATE_BASE : + replay_rate = 5 * ZM_RATE_BASE; + break; + case 5 * ZM_RATE_BASE : + replay_rate = 10 * ZM_RATE_BASE; + break; + case 10 * ZM_RATE_BASE : + replay_rate = 25 * ZM_RATE_BASE; + break; + case 25 * ZM_RATE_BASE : + case 50 * ZM_RATE_BASE : + replay_rate = 50 * ZM_RATE_BASE; + break; + default : + replay_rate = 2 * ZM_RATE_BASE; + break; + } + break; + } + case CMD_SLOWFWD : + { + Debug( 1, "Got SLOW FWD command" ); + // Set paused flag + paused = true; + // Set delayed flag + delayed = true; + // Set play rate + replay_rate = ZM_RATE_BASE; + // Set step + step = 1; + break; + } + case CMD_SLOWREV : + { + Debug( 1, "Got SLOW REV command" ); + // Set paused flag + paused = true; + // Set delayed flag + delayed = true; + // Set play rate + replay_rate = ZM_RATE_BASE; + // Set step + step = -1; + break; + } + case CMD_FASTREV : + { + Debug( 1, "Got FAST REV command" ); + if ( paused ) + { + // Clear paused flag + paused = false; + // Set delayed_play flag + delayed = true; + } + // Set play rate + switch ( replay_rate ) + { + case -2 * ZM_RATE_BASE : + replay_rate = -5 * ZM_RATE_BASE; + break; + case -5 * ZM_RATE_BASE : + replay_rate = -10 * ZM_RATE_BASE; + break; + case -10 * ZM_RATE_BASE : + replay_rate = -25 * ZM_RATE_BASE; + break; + case -25 * ZM_RATE_BASE : + case -50 * ZM_RATE_BASE : + replay_rate = -50 * ZM_RATE_BASE; + break; + default : + replay_rate = -2 * ZM_RATE_BASE; + break; + } + break; + } + case CMD_ZOOMIN : + { + x = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; + y = ((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; + Debug( 1, "Got ZOOM IN command, to %d,%d", x, y ); + switch ( zoom ) + { + case 100: + zoom = 150; + break; + case 150: + zoom = 200; + break; + case 200: + zoom = 300; + break; + case 300: + zoom = 400; + break; + case 400: + default : + zoom = 500; + break; + } + break; + } + case CMD_ZOOMOUT : + { + Debug( 1, "Got ZOOM OUT command" ); + switch ( zoom ) + { + case 500: + zoom = 400; + break; + case 400: + zoom = 300; + break; + case 300: + zoom = 200; + break; + case 200: + zoom = 150; + break; + case 150: + default : + zoom = 100; + break; + } + break; + } + case CMD_PAN : + { + x = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; + y = ((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; + Debug( 1, "Got PAN command, to %d,%d", x, y ); + break; + } + case CMD_SCALE : + { + scale = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; + Debug( 1, "Got SCALE command, to %d", scale ); + break; + } + case CMD_QUERY : + { + Debug( 1, "Got QUERY command, sending STATUS" ); + break; + } + default : + { + Error( "Got unexpected command %d", msg->msg_data[0] ); + break; + } + } + + struct { + int id; + int state; + double fps; + int buffer_level; + int rate; + double delay; + int zoom; + bool delayed; + bool paused; + bool enabled; + bool forced; + } status_data; + + status_data.id = monitor->Id(); + status_data.fps = monitor->GetFPS(); + status_data.state = monitor->shared_data->state; + if ( playback_buffer > 0 ) + status_data.buffer_level = (MOD_ADD( (temp_write_index-temp_read_index), 0, temp_image_buffer_count )*100)/temp_image_buffer_count; + else + status_data.buffer_level = 0; + status_data.delayed = delayed; + status_data.paused = paused; + status_data.rate = replay_rate; + status_data.delay = TV_2_FLOAT( now ) - TV_2_FLOAT( last_frame_timestamp ); + status_data.zoom = zoom; + //status_data.enabled = monitor->shared_data->active; + status_data.enabled = monitor->trigger_data->trigger_state!=Monitor::TRIGGER_OFF; + status_data.forced = monitor->trigger_data->trigger_state==Monitor::TRIGGER_ON; + Debug( 2, "L:%d, D:%d, P:%d, R:%d, d:%.3f, Z:%d, E:%d F:%d", + status_data.buffer_level, + status_data.delayed, + status_data.paused, + status_data.rate, + status_data.delay, + status_data.zoom, + status_data.enabled, + status_data.forced + ); + + DataMsg status_msg; + status_msg.msg_type = MSG_DATA_WATCH; + memcpy( &status_msg.msg_data, &status_data, sizeof(status_msg.msg_data) ); + int nbytes = 0; + if ( (nbytes = sendto( sd, &status_msg, sizeof(status_msg), MSG_DONTWAIT, (sockaddr *)&rem_addr, sizeof(rem_addr) )) < 0 ) + { + //if ( errno != EAGAIN ) + { + Error( "Can't sendto on sd %d: %s", sd, strerror(errno) ); + //exit( -1 ); + } + } + + updateFrameRate( monitor->GetFPS() ); +} + +bool MonitorStream::sendFrame( const char *filepath, struct timeval *timestamp ) +{ + bool send_raw = ((scale>=ZM_SCALE_BASE)&&(zoom==ZM_SCALE_BASE)); + + if ( type != STREAM_JPEG ) + send_raw = false; + if ( !config.timestamp_on_capture && timestamp ) + send_raw = false; + + if ( !send_raw ) + { + Image temp_image( filepath ); + + return( sendFrame( &temp_image, timestamp ) ); + } + else + { + int img_buffer_size = 0; + static unsigned char img_buffer[ZM_MAX_IMAGE_SIZE]; + + FILE *fdj = NULL; + if ( (fdj = fopen( filepath, "r" )) ) + { + img_buffer_size = fread( img_buffer, 1, sizeof(img_buffer), fdj ); + fclose( fdj ); + } + else + { + Error( "Can't open %s: %s", filepath, strerror(errno) ); + return( false ); + } + + // Calculate how long it takes to actually send the frame + struct timeval frameStartTime; + gettimeofday( &frameStartTime, NULL ); + + fprintf( stdout, "--ZoneMinderFrame\r\n" ); + fprintf( stdout, "Content-Length: %d\r\n", img_buffer_size ); + fprintf( stdout, "Content-Type: image/jpeg\r\n\r\n" ); + if ( fwrite( img_buffer, img_buffer_size, 1, stdout ) != 1 ) + { + if ( !zm_terminate ) + Error( "Unable to send stream frame: %s", strerror(errno) ); + return( false ); + } + fprintf( stdout, "\r\n\r\n" ); + fflush( stdout ); + + struct timeval frameEndTime; + gettimeofday( &frameEndTime, NULL ); + + int frameSendTime = tvDiffMsec( frameStartTime, frameEndTime ); + if ( frameSendTime > 1000/maxfps ) + { + maxfps /= 2; + Error( "Frame send time %d msec too slow, throttling maxfps to %.2f", frameSendTime, maxfps ); + } + + last_frame_sent = TV_2_FLOAT( now ); + + return( true ); + } + return( false ); +} + +bool MonitorStream::sendFrame( Image *image, struct timeval *timestamp ) +{ + Image *send_image = prepareImage( image ); + if ( !config.timestamp_on_capture && timestamp ) + monitor->TimestampImage( send_image, timestamp ); + +#if HAVE_LIBAVCODEC + if ( type == STREAM_MPEG ) + { + if ( !vid_stream ) + { + vid_stream = new VideoStream( "pipe:", format, bitrate, effective_fps, send_image->Colours(), send_image->SubpixelOrder(), send_image->Width(), send_image->Height() ); + fprintf( stdout, "Content-type: %s\r\n\r\n", vid_stream->MimeType() ); + vid_stream->OpenStream(); + } + static struct timeval base_time; + struct DeltaTimeval delta_time; + if ( !frame_count ) + base_time = *timestamp; + DELTA_TIMEVAL( delta_time, *timestamp, base_time, DT_PREC_3 ); + /* double pts = */ vid_stream->EncodeFrame( send_image->Buffer(), send_image->Size(), config.mpeg_timed_frames, delta_time.delta ); + } + else +#endif // HAVE_LIBAVCODEC + { + static unsigned char temp_img_buffer[ZM_MAX_IMAGE_SIZE]; + + int img_buffer_size = 0; + unsigned char *img_buffer = temp_img_buffer; + + // Calculate how long it takes to actually send the frame + struct timeval frameStartTime; + gettimeofday( &frameStartTime, NULL ); + + fprintf( stdout, "--ZoneMinderFrame\r\n" ); + switch( type ) + { + case STREAM_JPEG : + send_image->EncodeJpeg( img_buffer, &img_buffer_size ); + fprintf( stdout, "Content-Type: image/jpeg\r\n" ); + break; + case STREAM_RAW : + fprintf( stdout, "Content-Type: image/x-rgb\r\n" ); + img_buffer = (uint8_t*)send_image->Buffer(); + img_buffer_size = send_image->Size(); + break; + case STREAM_ZIP : + fprintf( stdout, "Content-Type: image/x-rgbz\r\n" ); + unsigned long zip_buffer_size; + send_image->Zip( img_buffer, &zip_buffer_size ); + img_buffer_size = zip_buffer_size; + break; + default : + Fatal( "Unexpected frame type %d", type ); + break; + } + fprintf( stdout, "Content-Length: %d\r\n\r\n", img_buffer_size ); + if ( fwrite( img_buffer, img_buffer_size, 1, stdout ) != 1 ) + { + if ( !zm_terminate ) + Error( "Unable to send stream frame: %s", strerror(errno) ); + return( false ); + } + fprintf( stdout, "\r\n\r\n" ); + fflush( stdout ); + + struct timeval frameEndTime; + gettimeofday( &frameEndTime, NULL ); + + int frameSendTime = tvDiffMsec( frameStartTime, frameEndTime ); + if ( frameSendTime > 1000/maxfps ) + { + maxfps /= 1.5; + Error( "Frame send time %d msec too slow, throttling maxfps to %.2f", frameSendTime, maxfps ); + } + } + last_frame_sent = TV_2_FLOAT( now ); + return( true ); +} + +void MonitorStream::runStream() +{ + if ( type == STREAM_SINGLE ) + { + // Not yet migrated over to stream class + monitor->SingleImage( scale ); + return; + } + + openComms(); + + checkInitialised(); + + updateFrameRate( monitor->GetFPS() ); + + if ( type == STREAM_JPEG ) + fprintf( stdout, "Content-Type: multipart/x-mixed-replace;boundary=ZoneMinderFrame\r\n\r\n" ); + + int last_read_index = monitor->image_buffer_count; + + time_t stream_start_time; + time( &stream_start_time ); + + frame_count = 0; + + temp_image_buffer = 0; + temp_image_buffer_count = playback_buffer; + temp_read_index = temp_image_buffer_count; + temp_write_index = temp_image_buffer_count; + + char swap_path[PATH_MAX] = ""; + bool buffered_playback = false; + + if ( connkey && playback_buffer > 0 ) + { + Debug( 2, "Checking swap image location" ); + Debug( 3, "Checking swap image path" ); + strncpy( swap_path, config.path_swap, sizeof(swap_path) ); + if ( checkSwapPath( swap_path, false ) ) + { + snprintf( &(swap_path[strlen(swap_path)]), sizeof(swap_path)-strlen(swap_path), "/zmswap-m%d", monitor->Id() ); + if ( checkSwapPath( swap_path, true ) ) + { + snprintf( &(swap_path[strlen(swap_path)]), sizeof(swap_path)-strlen(swap_path), "/zmswap-q%06d", connkey ); + if ( checkSwapPath( swap_path, true ) ) + { + buffered_playback = true; + } + } + } + + if ( !buffered_playback ) + { + Error( "Unable to validate swap image path, disabling buffered playback" ); + } + else + { + Debug( 2, "Assigning temporary buffer" ); + temp_image_buffer = new SwapImage[temp_image_buffer_count]; + memset( temp_image_buffer, 0, sizeof(*temp_image_buffer)*temp_image_buffer_count ); + Debug( 2, "Assigned temporary buffer" ); + } + } + + float max_secs_since_last_sent_frame = 10.0; //should be > keep alive amount (5 secs) + while ( !zm_terminate ) + { + bool got_command = false; + if ( feof( stdout ) || ferror( stdout ) || !monitor->ShmValid() ) + { + break; + } + + gettimeofday( &now, NULL ); + + if ( connkey ) + { + while(checkCommandQueue()) { + got_command = true; + } + } + + //bool frame_sent = false; + if ( buffered_playback && delayed ) + { + if ( temp_read_index == temp_write_index ) + { + // Go back to live viewing + Debug( 1, "Exceeded temporary streaming buffer" ); + // Clear paused flag + paused = false; + // Clear delayed_play flag + delayed = false; + replay_rate = ZM_RATE_BASE; + } + else + { + if ( !paused ) + { + int temp_index = MOD_ADD( temp_read_index, 0, temp_image_buffer_count ); + //Debug( 3, "tri: %d, ti: %d", temp_read_index, temp_index ); + SwapImage *swap_image = &temp_image_buffer[temp_index]; + + if ( !swap_image->valid ) + { + paused = true; + delayed = true; + temp_read_index = MOD_ADD( temp_read_index, (replay_rate>=0?-1:1), temp_image_buffer_count ); + } + else + { + //Debug( 3, "siT: %f, lfT: %f", TV_2_FLOAT( swap_image->timestamp ), TV_2_FLOAT( last_frame_timestamp ) ); + double expected_delta_time = ((TV_2_FLOAT( swap_image->timestamp ) - TV_2_FLOAT( last_frame_timestamp )) * ZM_RATE_BASE)/replay_rate; + double actual_delta_time = TV_2_FLOAT( now ) - last_frame_sent; + + //Debug( 3, "eDT: %.3lf, aDT: %.3f, lFS:%.3f, NOW:%.3f", expected_delta_time, actual_delta_time, last_frame_sent, TV_2_FLOAT( now ) ); + // If the next frame is due + if ( actual_delta_time > expected_delta_time ) + { + //Debug( 2, "eDT: %.3lf, aDT: %.3f", expected_delta_time, actual_delta_time ); + if ( temp_index%frame_mod == 0 ) + { + Debug( 2, "Sending delayed frame %d", temp_index ); + // Send the next frame + if ( !sendFrame( temp_image_buffer[temp_index].file_name, &temp_image_buffer[temp_index].timestamp ) ) + zm_terminate = true; + memcpy( &last_frame_timestamp, &(swap_image->timestamp), sizeof(last_frame_timestamp) ); + //frame_sent = true; + } + temp_read_index = MOD_ADD( temp_read_index, (replay_rate>0?1:-1), temp_image_buffer_count ); + } + } + } + else if ( step != 0 ) + { + temp_read_index = MOD_ADD( temp_read_index, (step>0?1:-1), temp_image_buffer_count ); + + SwapImage *swap_image = &temp_image_buffer[temp_read_index]; + + // Send the next frame + if ( !sendFrame( temp_image_buffer[temp_read_index].file_name, &temp_image_buffer[temp_read_index].timestamp ) ) + zm_terminate = true; + memcpy( &last_frame_timestamp, &(swap_image->timestamp), sizeof(last_frame_timestamp) ); + //frame_sent = true; + step = 0; + } + else + { + int temp_index = MOD_ADD( temp_read_index, 0, temp_image_buffer_count ); + + double actual_delta_time = TV_2_FLOAT( now ) - last_frame_sent; + if ( got_command || actual_delta_time > 5 ) + { + // Send keepalive + Debug( 2, "Sending keepalive frame %d", temp_index ); + // Send the next frame + if ( !sendFrame( temp_image_buffer[temp_index].file_name, &temp_image_buffer[temp_index].timestamp ) ) + zm_terminate = true; + //frame_sent = true; + } + } + } + if ( temp_read_index == temp_write_index ) + { + // Go back to live viewing + Warning( "Rewound over write index, resuming live play" ); + // Clear paused flag + paused = false; + // Clear delayed_play flag + delayed = false; + replay_rate = ZM_RATE_BASE; + } + } + if ( (unsigned int)last_read_index != monitor->shared_data->last_write_index ) + { + int index = monitor->shared_data->last_write_index%monitor->image_buffer_count; + last_read_index = monitor->shared_data->last_write_index; + //Debug( 1, "%d: %x - %x", index, image_buffer[index].image, image_buffer[index].image->buffer ); + if ( (frame_mod == 1) || ((frame_count%frame_mod) == 0) ) + { + if ( !paused && !delayed ) + { + // Send the next frame + Monitor::Snapshot *snap = &monitor->image_buffer[index]; + + if ( !sendFrame( snap->image, snap->timestamp ) ) + zm_terminate = true; + memcpy( &last_frame_timestamp, snap->timestamp, sizeof(last_frame_timestamp) ); + //frame_sent = true; + + temp_read_index = temp_write_index; + } + } + if ( buffered_playback ) + { + if ( monitor->shared_data->valid ) + { + if ( monitor->image_buffer[index].timestamp->tv_sec ) + { + int temp_index = temp_write_index%temp_image_buffer_count; + Debug( 2, "Storing frame %d", temp_index ); + if ( !temp_image_buffer[temp_index].valid ) + { + snprintf( temp_image_buffer[temp_index].file_name, sizeof(temp_image_buffer[0].file_name), "%s/zmswap-i%05d.jpg", swap_path, temp_index ); + temp_image_buffer[temp_index].valid = true; + } + memcpy( &(temp_image_buffer[temp_index].timestamp), monitor->image_buffer[index].timestamp, sizeof(temp_image_buffer[0].timestamp) ); + monitor->image_buffer[index].image->WriteJpeg( temp_image_buffer[temp_index].file_name, config.jpeg_file_quality ); + temp_write_index = MOD_ADD( temp_write_index, 1, temp_image_buffer_count ); + if ( temp_write_index == temp_read_index ) + { + // Go back to live viewing + Warning( "Exceeded temporary buffer, resuming live play" ); + // Clear paused flag + paused = false; + // Clear delayed_play flag + delayed = false; + replay_rate = ZM_RATE_BASE; + } + } + else + { + Warning( "Unable to store frame as timestamp invalid" ); + } + } + else + { + Warning( "Unable to store frame as shared memory invalid" ); + } + } + frame_count++; + } + usleep( (unsigned long)((1000000 * ZM_RATE_BASE)/((base_fps?base_fps:1)*abs(replay_rate*2))) ); + if ( ttl ) + { + if ( (now.tv_sec - stream_start_time) > ttl ) + { + break; + } + } + if ( (TV_2_FLOAT( now ) - last_frame_sent) > max_secs_since_last_sent_frame ) + { + Error( "Terminating, last frame sent time %f secs more than maximum of %f", TV_2_FLOAT( now ) - last_frame_sent, max_secs_since_last_sent_frame ); + break; + } + } + if ( buffered_playback ) + { + char swap_path[PATH_MAX] = ""; + + snprintf( swap_path, sizeof(swap_path), "%s/zmswap-m%d/zmswap-q%06d", config.path_swap, monitor->Id(), connkey ); + Debug( 1, "Cleaning swap files from %s", swap_path ); + struct stat stat_buf; + if ( stat( swap_path, &stat_buf ) < 0 ) + { + if ( errno != ENOENT ) + { + Error( "Can't stat '%s': %s", swap_path, strerror(errno) ); + } + } + else if ( !S_ISDIR(stat_buf.st_mode) ) + { + Error( "Swap image path '%s' is not a directory", swap_path ); + } + else + { + char glob_pattern[PATH_MAX] = ""; + + snprintf( glob_pattern, sizeof(glob_pattern), "%s/*.*", swap_path ); + glob_t pglob; + int glob_status = glob( glob_pattern, 0, 0, &pglob ); + if ( glob_status != 0 ) + { + if ( glob_status < 0 ) + { + Error( "Can't glob '%s': %s", glob_pattern, strerror(errno) ); + } + else + { + Debug( 1, "Can't glob '%s': %d", glob_pattern, glob_status ); + } + } + else + { + for ( unsigned int i = 0; i < pglob.gl_pathc; i++ ) + { + if ( unlink( pglob.gl_pathv[i] ) < 0 ) + { + Error( "Can't unlink '%s': %s", pglob.gl_pathv[i], strerror(errno) ); + } + } + } + globfree( &pglob ); + if ( rmdir( swap_path ) < 0 ) + { + Error( "Can't rmdir '%s': %s", swap_path, strerror(errno) ); + } + } + } + closeComms(); +} + +void Monitor::SingleImage( int scale) +{ + int img_buffer_size = 0; + static JOCTET img_buffer[ZM_MAX_IMAGE_SIZE]; + Image scaled_image; + int index = shared_data->last_write_index%image_buffer_count; + Snapshot *snap = &image_buffer[index]; + Image *snap_image = snap->image; + + if ( scale != ZM_SCALE_BASE ) + { + scaled_image.Assign( *snap_image ); + scaled_image.Scale( scale ); + snap_image = &scaled_image; + } + if ( !config.timestamp_on_capture ) + { + TimestampImage( snap_image, snap->timestamp ); + } + snap_image->EncodeJpeg( img_buffer, &img_buffer_size ); + + fprintf( stdout, "Content-Length: %d\r\n", img_buffer_size ); + fprintf( stdout, "Content-Type: image/jpeg\r\n\r\n" ); + fwrite( img_buffer, img_buffer_size, 1, stdout ); +} + +void Monitor::SingleImageRaw( int scale) +{ + Image scaled_image; + int index = shared_data->last_write_index%image_buffer_count; + Snapshot *snap = &image_buffer[index]; + Image *snap_image = snap->image; + + if ( scale != ZM_SCALE_BASE ) + { + scaled_image.Assign( *snap_image ); + scaled_image.Scale( scale ); + snap_image = &scaled_image; + } + if ( !config.timestamp_on_capture ) + { + TimestampImage( snap_image, snap->timestamp ); + } + + fprintf( stdout, "Content-Length: %d\r\n", snap_image->Size() ); + fprintf( stdout, "Content-Type: image/x-rgb\r\n\r\n" ); + fwrite( snap_image->Buffer(), snap_image->Size(), 1, stdout ); +} + +void Monitor::SingleImageZip( int scale) +{ + unsigned long img_buffer_size = 0; + static Bytef img_buffer[ZM_MAX_IMAGE_SIZE]; + Image scaled_image; + int index = shared_data->last_write_index%image_buffer_count; + Snapshot *snap = &image_buffer[index]; + Image *snap_image = snap->image; + + if ( scale != ZM_SCALE_BASE ) + { + scaled_image.Assign( *snap_image ); + scaled_image.Scale( scale ); + snap_image = &scaled_image; + } + if ( !config.timestamp_on_capture ) + { + TimestampImage( snap_image, snap->timestamp ); + } + snap_image->Zip( img_buffer, &img_buffer_size ); + + fprintf( stdout, "Content-Length: %ld\r\n", img_buffer_size ); + fprintf( stdout, "Content-Type: image/x-rgbz\r\n\r\n" ); + fwrite( img_buffer, img_buffer_size, 1, stdout ); +} diff --git a/src/zm_monitor.cpp.orig b/src/zm_monitor.cpp.orig new file mode 100644 index 000000000..298ad2b3a --- /dev/null +++ b/src/zm_monitor.cpp.orig @@ -0,0 +1,3889 @@ +// +// ZoneMinder Monitor Class Implementation, $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. +// + +#include +#include +#include +#include + +#include "zm.h" +#include "zm_db.h" +#include "zm_time.h" +#include "zm_mpeg.h" +#include "zm_signal.h" +#include "zm_monitor.h" +#if ZM_HAS_V4L +#include "zm_local_camera.h" +#endif // ZM_HAS_V4L +#include "zm_remote_camera.h" +#include "zm_remote_camera_http.h" +#if HAVE_LIBAVFORMAT +#include "zm_remote_camera_rtsp.h" +#endif // HAVE_LIBAVFORMAT +#include "zm_file_camera.h" +#if HAVE_LIBAVFORMAT +#include "zm_ffmpeg_camera.h" +#endif // HAVE_LIBAVFORMAT + +#if ZM_MEM_MAPPED +#include +#include +#else // ZM_MEM_MAPPED +#include +#include +#endif // ZM_MEM_MAPPED + +Monitor::MonitorLink::MonitorLink( int p_id, const char *p_name ) : id( p_id ) +{ + strncpy( name, p_name, sizeof(name) ); + +#if ZM_MEM_MAPPED + map_fd = -1; + snprintf( mem_file, sizeof(mem_file), "%s/zm.mmap.%d", config.path_map, id ); +#else // ZM_MEM_MAPPED + shm_id = 0; +#endif // ZM_MEM_MAPPED + mem_size = 0; + mem_ptr = 0; + + last_event = 0; + last_state = IDLE; + + last_connect_time = 0; + connected = false; +} + +Monitor::MonitorLink::~MonitorLink() +{ + disconnect(); +} + +bool Monitor::MonitorLink::connect() +{ + if ( !last_connect_time || (time( 0 ) - last_connect_time) > 60 ) + { + last_connect_time = time( 0 ); + + mem_size = sizeof(SharedData) + sizeof(TriggerData); + + Debug( 1, "link.mem.size=%d", mem_size ); +#if ZM_MEM_MAPPED + map_fd = open( mem_file, O_RDWR, (mode_t)0600 ); + if ( map_fd < 0 ) + { + Debug( 3, "Can't open linked memory map file %s: %s", mem_file, strerror(errno) ); + disconnect(); + return( false ); + } + + struct stat map_stat; + if ( fstat( map_fd, &map_stat ) < 0 ) + { + Error( "Can't stat linked memory map file %s: %s", mem_file, strerror(errno) ); + disconnect(); + return( false ); + } + + if ( map_stat.st_size == 0 ) + { + Error( "Linked memory map file %s is empty: %s", mem_file, strerror(errno) ); + disconnect(); + return( false ); + } + else if ( map_stat.st_size < mem_size ) + { + Error( "Got unexpected memory map file size %ld, expected %d", map_stat.st_size, mem_size ); + disconnect(); + return( false ); + } + + mem_ptr = (unsigned char *)mmap( NULL, mem_size, PROT_READ|PROT_WRITE, MAP_SHARED, map_fd, 0 ); + if ( mem_ptr == MAP_FAILED ) + { + Error( "Can't map file %s (%d bytes) to memory: %s", mem_file, mem_size, strerror(errno) ); + disconnect(); + return( false ); + } +#else // ZM_MEM_MAPPED + shm_id = shmget( (config.shm_key&0xffff0000)|id, mem_size, 0700 ); + if ( shm_id < 0 ) + { + Debug( 3, "Can't shmget link memory: %s", strerror(errno) ); + connected = false; + return( false ); + } + mem_ptr = (unsigned char *)shmat( shm_id, 0, 0 ); + if ( mem_ptr < 0 ) + { + Debug( 3, "Can't shmat link memory: %s", strerror(errno) ); + connected = false; + return( false ); + } +#endif // ZM_MEM_MAPPED + + shared_data = (SharedData *)mem_ptr; + trigger_data = (TriggerData *)((char *)shared_data + sizeof(SharedData)); + + if ( !shared_data->valid ) + { + Debug( 3, "Linked memory not initialised by capture daemon" ); + disconnect(); + return( false ); + } + + last_state = shared_data->state; + last_event = shared_data->last_event; + connected = true; + + return( true ); + } + return( false ); +} + +bool Monitor::MonitorLink::disconnect() +{ + if ( connected ) + { + connected = false; + +#if ZM_MEM_MAPPED + if ( mem_ptr > 0 ) + { + msync( mem_ptr, mem_size, MS_ASYNC ); + munmap( mem_ptr, mem_size ); + } + if ( map_fd >= 0 ) + close( map_fd ); + + map_fd = -1; +#else // ZM_MEM_MAPPED + struct shmid_ds shm_data; + if ( shmctl( shm_id, IPC_STAT, &shm_data ) < 0 ) + { + Debug( 3, "Can't shmctl: %s", strerror(errno) ); + return( false ); + } + + shm_id = 0; + + if ( shm_data.shm_nattch <= 1 ) + { + if ( shmctl( shm_id, IPC_RMID, 0 ) < 0 ) + { + Debug( 3, "Can't shmctl: %s", strerror(errno) ); + return( false ); + } + } + + if ( shmdt( mem_ptr ) < 0 ) + { + Debug( 3, "Can't shmdt: %s", strerror(errno) ); + return( false ); + } + +#endif // ZM_MEM_MAPPED + mem_size = 0; + mem_ptr = 0; + } + return( true ); +} + +bool Monitor::MonitorLink::isAlarmed() +{ + if ( !connected ) + { + return( false ); + } + return( shared_data->state == ALARM ); +} + +bool Monitor::MonitorLink::inAlarm() +{ + if ( !connected ) + { + return( false ); + } + return( shared_data->state == ALARM || shared_data->state == ALERT ); +} + +bool Monitor::MonitorLink::hasAlarmed() +{ + if ( shared_data->state == ALARM ) + { + return( true ); + } + else if( shared_data->last_event != last_event ) + { + last_event = shared_data->last_event; + return( true ); + } + return( false ); +} + +Monitor::Monitor( + int p_id, + const char *p_name, + int p_function, + bool p_enabled, + const char *p_linked_monitors, + Camera *p_camera, + int p_orientation, + unsigned int p_deinterlacing, + const char *p_event_prefix, + const char *p_label_format, + const Coord &p_label_coord, + int p_image_buffer_count, + int p_warmup_count, + int p_pre_event_count, + int p_post_event_count, + int p_stream_replay_buffer, + int p_alarm_frame_count, + int p_section_length, + int p_frame_skip, + int p_capture_delay, + int p_alarm_capture_delay, + int p_fps_report_interval, + int p_ref_blend_perc, + bool p_track_motion, + Rgb p_signal_check_colour, + Purpose p_purpose, + int p_n_zones, + Zone *p_zones[] +) : id( p_id ), + function( (Function)p_function ), + enabled( p_enabled ), + width( (p_orientation==ROTATE_90||p_orientation==ROTATE_270)?p_camera->Height():p_camera->Width() ), + height( (p_orientation==ROTATE_90||p_orientation==ROTATE_270)?p_camera->Width():p_camera->Height() ), + orientation( (Orientation)p_orientation ), + deinterlacing( p_deinterlacing ), + label_coord( p_label_coord ), + image_buffer_count( p_image_buffer_count ), + warmup_count( p_warmup_count ), + pre_event_count( p_pre_event_count ), + post_event_count( p_post_event_count ), + stream_replay_buffer( p_stream_replay_buffer ), + section_length( p_section_length ), + frame_skip( p_frame_skip ), + capture_delay( p_capture_delay ), + alarm_capture_delay( p_alarm_capture_delay ), + alarm_frame_count( p_alarm_frame_count ), + fps_report_interval( p_fps_report_interval ), + ref_blend_perc( p_ref_blend_perc ), + track_motion( p_track_motion ), + signal_check_colour( p_signal_check_colour ), + delta_image( width, height, ZM_COLOUR_GRAY8, ZM_SUBPIX_ORDER_NONE ), + ref_image( width, height, p_camera->Colours(), p_camera->SubpixelOrder() ), + purpose( p_purpose ), + camera( p_camera ), + n_zones( p_n_zones ), + zones( p_zones ) +{ + strncpy( name, p_name, sizeof(name) ); + + strncpy( event_prefix, p_event_prefix, sizeof(event_prefix) ); + strncpy( label_format, p_label_format, sizeof(label_format) ); + + // Change \n to actual line feeds + char *token_ptr = label_format; + const char *token_string = "\n"; + while( ( token_ptr = strstr( token_ptr, token_string ) ) ) + { + if ( *(token_ptr+1) ) + { + *token_ptr = '\n'; + token_ptr++; + strcpy( token_ptr, token_ptr+1 ); + } + else + { + *token_ptr = '\0'; + break; + } + } + + fps = 0.0; + event_count = 0; + image_count = 0; + ready_count = warmup_count; + first_alarm_count = 0; + last_alarm_count = 0; + state = IDLE; + + if ( alarm_frame_count < 1 ) + alarm_frame_count = 1; + else if ( alarm_frame_count > MAX_PRE_ALARM_FRAMES ) + alarm_frame_count = MAX_PRE_ALARM_FRAMES; + + auto_resume_time = 0; + + if ( strcmp( config.event_close_mode, "time" ) == 0 ) + event_close_mode = CLOSE_TIME; + else if ( strcmp( config.event_close_mode, "alarm" ) == 0 ) + event_close_mode = CLOSE_ALARM; + else + event_close_mode = CLOSE_IDLE; + + Debug( 1, "monitor purpose=%d", purpose ); + + mem_size = sizeof(SharedData) + + sizeof(TriggerData) + + (image_buffer_count*sizeof(struct timeval)) + + (image_buffer_count*camera->ImageSize()) + + 64; /* Padding used to permit aligning the images buffer to 16 byte boundary */ + + Debug( 1, "mem.size=%d", mem_size ); +#if ZM_MEM_MAPPED + snprintf( mem_file, sizeof(mem_file), "%s/zm.mmap.%d", config.path_map, id ); + map_fd = open( mem_file, O_RDWR|O_CREAT, (mode_t)0600 ); + if ( map_fd < 0 ) + Fatal( "Can't open memory map file %s, probably not enough space free: %s", mem_file, strerror(errno) ); + struct stat map_stat; + if ( fstat( map_fd, &map_stat ) < 0 ) + Fatal( "Can't stat memory map file %s: %s", mem_file, strerror(errno) ); + if ( map_stat.st_size != mem_size && purpose == CAPTURE ) + { + // Allocate the size + if ( ftruncate( map_fd, mem_size ) < 0 ) + Fatal( "Can't extend memory map file %s to %d bytes: %s", mem_file, mem_size, strerror(errno) ); + } + else if ( map_stat.st_size != mem_size ) + { + Error( "Got unexpected memory map file size %ld, expected %d", map_stat.st_size, mem_size ); + } + + mem_ptr = (unsigned char *)mmap( NULL, mem_size, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_LOCKED, map_fd, 0 ); + if ( mem_ptr == MAP_FAILED ) + if ( errno == EAGAIN ) + { + Debug( 1, "Unable to map file %s (%d bytes) to locked memory, trying unlocked", mem_file, mem_size ); + mem_ptr = (unsigned char *)mmap( NULL, mem_size, PROT_READ|PROT_WRITE, MAP_SHARED, map_fd, 0 ); + } + if ( mem_ptr == MAP_FAILED ) + Fatal( "Can't map file %s (%d bytes) to memory: %s(%d)", mem_file, mem_size, strerror(errno), errno ); +#else // ZM_MEM_MAPPED + shm_id = shmget( (config.shm_key&0xffff0000)|id, mem_size, IPC_CREAT|0700 ); + if ( shm_id < 0 ) + { + Error( "Can't shmget, probably not enough shared memory space free: %s", strerror(errno)); + exit( -1 ); + } + mem_ptr = (unsigned char *)shmat( shm_id, 0, 0 ); + if ( mem_ptr < 0 ) + { + Error( "Can't shmat: %s", strerror(errno)); + exit( -1 ); + } +#endif // ZM_MEM_MAPPED + + shared_data = (SharedData *)mem_ptr; + trigger_data = (TriggerData *)((char *)shared_data + sizeof(SharedData)); + struct timeval *shared_timestamps = (struct timeval *)((char *)trigger_data + sizeof(TriggerData)); + unsigned char *shared_images = (unsigned char *)((char *)shared_timestamps + (image_buffer_count*sizeof(struct timeval))); + + if(((unsigned long)shared_images % 16) != 0) { + /* Align images buffer to nearest 16 byte boundary */ + Debug(3,"Aligning shared memory images to the next 16 byte boundary"); + shared_images = (uint8_t*)((unsigned long)shared_images + (16 - ((unsigned long)shared_images % 16))); + } + + if ( purpose == CAPTURE ) + { + memset( mem_ptr, 0, mem_size ); + shared_data->size = sizeof(SharedData); + shared_data->active = enabled; + shared_data->signal = false; + shared_data->state = IDLE; + shared_data->last_write_index = image_buffer_count; + shared_data->last_read_index = image_buffer_count; + shared_data->last_write_time = 0; + shared_data->last_event = 0; + shared_data->action = (Action)0; + shared_data->brightness = -1; + shared_data->hue = -1; + shared_data->colour = -1; + shared_data->contrast = -1; + shared_data->alarm_x = -1; + shared_data->alarm_y = -1; + shared_data->format = camera->SubpixelOrder(); + shared_data->imagesize = camera->ImageSize(); + trigger_data->size = sizeof(TriggerData); + trigger_data->trigger_state = TRIGGER_CANCEL; + trigger_data->trigger_score = 0; + trigger_data->trigger_cause[0] = 0; + trigger_data->trigger_text[0] = 0; + trigger_data->trigger_showtext[0] = 0; + shared_data->valid = true; + } + else if ( purpose == ANALYSIS ) + { + shared_data->state = IDLE; + shared_data->last_read_time = 0; + shared_data->alarm_x = -1; + shared_data->alarm_y = -1; + } + + if ( !shared_data->valid ) + { + if ( purpose != QUERY ) + { + Error( "Shared data not initialised by capture daemon" ); + exit( -1 ); + } + else + { + Warning( "Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results" ); + } + } + + image_buffer = new Snapshot[image_buffer_count]; + for ( int i = 0; i < image_buffer_count; i++ ) + { + image_buffer[i].timestamp = &(shared_timestamps[i]); + image_buffer[i].image = new Image( width, height, camera->Colours(), camera->SubpixelOrder(), &(shared_images[i*camera->ImageSize()]) ); + image_buffer[i].image->HoldBuffer(true); /* Don't release the internal buffer or replace it with another */ + } + if ( (deinterlacing & 0xff) == 4) + { + /* Four field motion adaptive deinterlacing in use */ + /* Allocate a buffer for the next image */ + next_buffer.image = new Image( width, height, camera->Colours(), camera->SubpixelOrder()); + next_buffer.timestamp = new struct timeval; + } + if ( !n_zones ) + { + n_zones = 1; + zones = new Zone *[1]; + Coord coords[4] = { Coord( 0, 0 ), Coord( width-1, 0 ), Coord( width-1, height-1 ), Coord( 0, height-1 ) }; + zones[0] = new Zone( this, 0, "All", Zone::ACTIVE, Polygon( sizeof(coords)/sizeof(*coords), coords ), RGB_RED, Zone::BLOBS ); + } + start_time = last_fps_time = time( 0 ); + + event = 0; + + Debug( 1, "Monitor %s has function %d", name, function ); + Debug( 1, "Monitor %s LBF = '%s', LBX = %d, LBY = %d", name, label_format, label_coord.X(), label_coord.Y() ); + Debug( 1, "Monitor %s IBC = %d, WUC = %d, pEC = %d, PEC = %d, EAF = %d, FRI = %d, RBP = %d, FM = %d", name, image_buffer_count, warmup_count, pre_event_count, post_event_count, alarm_frame_count, fps_report_interval, ref_blend_perc, track_motion ); + + if ( purpose == ANALYSIS ) + { + static char path[PATH_MAX]; + + strncpy( path, config.dir_events, sizeof(path) ); + + struct stat statbuf; + errno = 0; + stat( path, &statbuf ); + if ( errno == ENOENT || errno == ENOTDIR ) + { + if ( mkdir( path, 0755 ) ) + { + Error( "Can't make %s: %s", path, strerror(errno)); + } + } + + snprintf( path, sizeof(path), "%s/%d", config.dir_events, id ); + + errno = 0; + stat( path, &statbuf ); + if ( errno == ENOENT || errno == ENOTDIR ) + { + if ( mkdir( path, 0755 ) ) + { + Error( "Can't make %s: %s", path, strerror(errno)); + } + char temp_path[PATH_MAX]; + snprintf( temp_path, sizeof(temp_path), "%d", id ); + if ( chdir( config.dir_events ) < 0 ) + Fatal( "Can't change directory to '%s': %s", config.dir_events, strerror(errno) ); + if ( symlink( temp_path, name ) < 0 ) + Fatal( "Can't symlink '%s' to '%s': %s", temp_path, name, strerror(errno) ); + if ( chdir( ".." ) < 0 ) + Fatal( "Can't change to parent directory: %s", strerror(errno) ); + } + + while( shared_data->last_write_index == image_buffer_count && shared_data->last_write_time == 0) + { + Warning( "Waiting for capture daemon" ); + sleep( 1 ); + } + ref_image.Assign( width, height, camera->Colours(), camera->SubpixelOrder(), image_buffer[shared_data->last_write_index].image->Buffer(), camera->ImageSize()); + + n_linked_monitors = 0; + linked_monitors = 0; + ReloadLinkedMonitors( p_linked_monitors ); + } +} + +Monitor::~Monitor() +{ + if ( event ) + Info( "%s: %03d - Closing event %d, shutting down", name, image_count, event->Id() ); + closeEvent(); + + if ( (deinterlacing & 0xff) == 4) + { + delete next_buffer.image; + delete next_buffer.timestamp; + } + for ( int i = 0; i < image_buffer_count; i++ ) + { + delete image_buffer[i].image; + } + delete[] image_buffer; + + for ( int i = 0; i < n_zones; i++ ) + { + delete zones[i]; + } + delete[] zones; + + delete camera; + + if ( purpose == ANALYSIS ) + { + shared_data->state = state = IDLE; + shared_data->last_read_index = image_buffer_count; + shared_data->last_read_time = 0; + } + else if ( purpose == CAPTURE ) + { + shared_data->valid = false; + memset( mem_ptr, 0, mem_size ); + } + +#if ZM_MEM_MAPPED + if ( msync( mem_ptr, mem_size, MS_SYNC ) < 0 ) + Error( "Can't msync: %s", strerror(errno) ); + if ( munmap( mem_ptr, mem_size ) < 0 ) + Fatal( "Can't munmap: %s", strerror(errno) ); + close( map_fd ); +#else // ZM_MEM_MAPPED + struct shmid_ds shm_data; + if ( shmctl( shm_id, IPC_STAT, &shm_data ) < 0 ) + { + Error( "Can't shmctl: %s", strerror(errno) ); + exit( -1 ); + } + if ( shm_data.shm_nattch <= 1 ) + { + if ( shmctl( shm_id, IPC_RMID, 0 ) < 0 ) + { + Error( "Can't shmctl: %s", strerror(errno) ); + exit( -1 ); + } + } +#endif // ZM_MEM_MAPPED +} + +void Monitor::AddZones( int p_n_zones, Zone *p_zones[] ) +{ + for ( int i = 0; i < n_zones; i++ ) + delete zones[i]; + delete[] zones; + n_zones = p_n_zones; + zones = p_zones; +} + +Monitor::State Monitor::GetState() const +{ + return( (State)shared_data->state ); +} + +int Monitor::GetImage( int index, int scale ) const +{ + if ( index < 0 || index > image_buffer_count ) + { + index = shared_data->last_write_index; + } + + if ( index != image_buffer_count ) + { + Snapshot *snap = &image_buffer[index]; + Image snap_image( *(snap->image) ); + + if ( scale != ZM_SCALE_BASE ) + { + snap_image.Scale( scale ); + } + + static char filename[PATH_MAX]; + snprintf( filename, sizeof(filename), "Monitor%d.jpg", id ); + if ( !config.timestamp_on_capture ) + { + TimestampImage( &snap_image, snap->timestamp ); + } + snap_image.WriteJpeg( filename ); + } + else + { + Error( "Unable to generate image, no images in buffer" ); + } + return( 0 ); +} + +struct timeval Monitor::GetTimestamp( int index ) const +{ + if ( index < 0 || index > image_buffer_count ) + { + index = shared_data->last_write_index; + } + + if ( index != image_buffer_count ) + { + Snapshot *snap = &image_buffer[index]; + + return( *(snap->timestamp) ); + } + else + { + static struct timeval null_tv = { 0, 0 }; + + return( null_tv ); + } +} + +unsigned int Monitor::GetLastReadIndex() const +{ + return( shared_data->last_read_index!=image_buffer_count?shared_data->last_read_index:-1 ); +} + +unsigned int Monitor::GetLastWriteIndex() const +{ + return( shared_data->last_write_index!=image_buffer_count?shared_data->last_write_index:-1 ); +} + +unsigned int Monitor::GetLastEvent() const +{ + return( shared_data->last_event ); +} + +double Monitor::GetFPS() const +{ + int index1 = shared_data->last_write_index; + if ( index1 == image_buffer_count ) + { + return( 0.0 ); + } + Snapshot *snap1 = &image_buffer[index1]; + if ( !snap1->timestamp || !snap1->timestamp->tv_sec ) + { + return( 0.0 ); + } + struct timeval time1 = *snap1->timestamp; + + int image_count = image_buffer_count; + int index2 = (index1+1)%image_buffer_count; + if ( index2 == image_buffer_count ) + { + return( 0.0 ); + } + Snapshot *snap2 = &image_buffer[index2]; + while ( !snap2->timestamp || !snap2->timestamp->tv_sec ) + { + if ( index1 == index2 ) + { + return( 0.0 ); + } + index2 = (index2+1)%image_buffer_count; + snap2 = &image_buffer[index2]; + image_count--; + } + struct timeval time2 = *snap2->timestamp; + + double time_diff = tvDiffSec( time2, time1 ); + + double curr_fps = image_count/time_diff; + + if ( curr_fps < 0.0 ) + { + //Error( "Negative FPS %f, time_diff = %lf (%d:%ld.%ld - %d:%ld.%ld), ibc: %d", curr_fps, time_diff, index2, time2.tv_sec, time2.tv_usec, index1, time1.tv_sec, time1.tv_usec, image_buffer_count ); + return( 0.0 ); + } + return( curr_fps ); +} + +void Monitor::ForceAlarmOn( int force_score, const char *force_cause, const char *force_text ) +{ + trigger_data->trigger_state = TRIGGER_ON; + trigger_data->trigger_score = force_score; + strncpy( trigger_data->trigger_cause, force_cause, sizeof(trigger_data->trigger_cause) ); + strncpy( trigger_data->trigger_text, force_text, sizeof(trigger_data->trigger_text) ); +} + +void Monitor::ForceAlarmOff() +{ + trigger_data->trigger_state = TRIGGER_OFF; +} + +void Monitor::CancelForced() +{ + trigger_data->trigger_state = TRIGGER_CANCEL; +} + +void Monitor::actionReload() +{ + shared_data->action |= RELOAD; +} + +void Monitor::actionEnable() +{ + shared_data->action |= RELOAD; + + static char sql[ZM_SQL_SML_BUFSIZ]; + snprintf( sql, sizeof(sql), "update Monitors set Enabled = 1 where Id = '%d'", id ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } +} + +void Monitor::actionDisable() +{ + shared_data->action |= RELOAD; + + static char sql[ZM_SQL_SML_BUFSIZ]; + snprintf( sql, sizeof(sql), "update Monitors set Enabled = 0 where Id = '%d'", id ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } +} + +void Monitor::actionSuspend() +{ + shared_data->action |= SUSPEND; +} + +void Monitor::actionResume() +{ + shared_data->action |= RESUME; +} + +int Monitor::actionBrightness( int p_brightness ) +{ + if ( purpose != CAPTURE ) + { + if ( p_brightness >= 0 ) + { + shared_data->brightness = p_brightness; + shared_data->action |= SET_SETTINGS; + int wait_loops = 10; + while ( shared_data->action & SET_SETTINGS ) + { + if ( wait_loops-- ) + usleep( 100000 ); + else + { + Warning( "Timed out waiting to set brightness" ); + return( -1 ); + } + } + } + else + { + shared_data->action |= GET_SETTINGS; + int wait_loops = 10; + while ( shared_data->action & GET_SETTINGS ) + { + if ( wait_loops-- ) + usleep( 100000 ); + else + { + Warning( "Timed out waiting to get brightness" ); + return( -1 ); + } + } + } + return( shared_data->brightness ); + } + return( camera->Brightness( p_brightness ) ); +} + +int Monitor::actionContrast( int p_contrast ) +{ + if ( purpose != CAPTURE ) + { + if ( p_contrast >= 0 ) + { + shared_data->contrast = p_contrast; + shared_data->action |= SET_SETTINGS; + int wait_loops = 10; + while ( shared_data->action & SET_SETTINGS ) + { + if ( wait_loops-- ) + usleep( 100000 ); + else + { + Warning( "Timed out waiting to set contrast" ); + return( -1 ); + } + } + } + else + { + shared_data->action |= GET_SETTINGS; + int wait_loops = 10; + while ( shared_data->action & GET_SETTINGS ) + { + if ( wait_loops-- ) + usleep( 100000 ); + else + { + Warning( "Timed out waiting to get contrast" ); + return( -1 ); + } + } + } + return( shared_data->contrast ); + } + return( camera->Contrast( p_contrast ) ); +} + +int Monitor::actionHue( int p_hue ) +{ + if ( purpose != CAPTURE ) + { + if ( p_hue >= 0 ) + { + shared_data->hue = p_hue; + shared_data->action |= SET_SETTINGS; + int wait_loops = 10; + while ( shared_data->action & SET_SETTINGS ) + { + if ( wait_loops-- ) + usleep( 100000 ); + else + { + Warning( "Timed out waiting to set hue" ); + return( -1 ); + } + } + } + else + { + shared_data->action |= GET_SETTINGS; + int wait_loops = 10; + while ( shared_data->action & GET_SETTINGS ) + { + if ( wait_loops-- ) + usleep( 100000 ); + else + { + Warning( "Timed out waiting to get hue" ); + return( -1 ); + } + } + } + return( shared_data->hue ); + } + return( camera->Hue( p_hue ) ); +} + +int Monitor::actionColour( int p_colour ) +{ + if ( purpose != CAPTURE ) + { + if ( p_colour >= 0 ) + { + shared_data->colour = p_colour; + shared_data->action |= SET_SETTINGS; + int wait_loops = 10; + while ( shared_data->action & SET_SETTINGS ) + { + if ( wait_loops-- ) + usleep( 100000 ); + else + { + Warning( "Timed out waiting to set colour" ); + return( -1 ); + } + } + } + else + { + shared_data->action |= GET_SETTINGS; + int wait_loops = 10; + while ( shared_data->action & GET_SETTINGS ) + { + if ( wait_loops-- ) + usleep( 100000 ); + else + { + Warning( "Timed out waiting to get colour" ); + return( -1 ); + } + } + } + return( shared_data->colour ); + } + return( camera->Colour( p_colour ) ); +} + +void Monitor::DumpZoneImage( const char *zone_string ) +{ + int exclude_id = 0; + int extra_colour = 0; + Polygon extra_zone; + + if ( zone_string ) + { + if ( !Zone::ParseZoneString( zone_string, exclude_id, extra_colour, extra_zone ) ) + { + Error( "Failed to parse zone string, ignoring" ); + } + } + + int index = shared_data->last_write_index; + Snapshot *snap = &image_buffer[index]; + Image *snap_image = snap->image; + + Image zone_image( *snap_image ); + if(zone_image.Colours() == ZM_COLOUR_GRAY8) { + zone_image.Colourise(ZM_COLOUR_RGB24, ZM_SUBPIX_ORDER_RGB ); + } + + for( int i = 0; i < n_zones; i++ ) + { + if ( exclude_id && (!extra_colour || extra_zone.getNumCoords()) && zones[i]->Id() == exclude_id ) + continue; + + Rgb colour; + if ( exclude_id && !extra_zone.getNumCoords() && zones[i]->Id() == exclude_id ) + { + colour = extra_colour; + } + else + { + if ( zones[i]->IsActive() ) + { + colour = RGB_RED; + } + else if ( zones[i]->IsInclusive() ) + { + colour = RGB_ORANGE; + } + else if ( zones[i]->IsExclusive() ) + { + colour = RGB_PURPLE; + } + else if ( zones[i]->IsPreclusive() ) + { + colour = RGB_BLUE; + } + else + { + colour = RGB_WHITE; + } + } + zone_image.Fill( colour, 2, zones[i]->GetPolygon() ); + zone_image.Outline( colour, zones[i]->GetPolygon() ); + } + + if ( extra_zone.getNumCoords() ) + { + zone_image.Fill( extra_colour, 2, extra_zone ); + zone_image.Outline( extra_colour, extra_zone ); + } + + static char filename[PATH_MAX]; + snprintf( filename, sizeof(filename), "Zones%d.jpg", id ); + zone_image.WriteJpeg( filename ); +} + +void Monitor::DumpImage( Image *dump_image ) const +{ + if ( image_count && !(image_count%10) ) + { + static char filename[PATH_MAX]; + static char new_filename[PATH_MAX]; + snprintf( filename, sizeof(filename), "Monitor%d.jpg", id ); + snprintf( new_filename, sizeof(new_filename), "Monitor%d-new.jpg", id ); + dump_image->WriteJpeg( new_filename ); + rename( new_filename, filename ); + } +} + +bool Monitor::CheckSignal( const Image *image ) +{ + static bool static_undef = true; + /* RGB24 colors */ + static uint8_t red_val; + static uint8_t green_val; + static uint8_t blue_val; + static uint8_t grayscale_val; /* 8bit grayscale color */ + static Rgb colour_val; /* RGB32 color */ + static int usedsubpixorder; + + if ( config.signal_check_points > 0 ) + { + if ( static_undef ) + { + static_undef = false; + usedsubpixorder = camera->SubpixelOrder(); + colour_val = rgb_convert(signal_check_colour, ZM_SUBPIX_ORDER_BGR); /* HTML colour code is actually BGR in memory, we want RGB */ + colour_val = rgb_convert(colour_val, usedsubpixorder); + red_val = RED_VAL_BGRA(signal_check_colour); + green_val = GREEN_VAL_BGRA(signal_check_colour); + blue_val = BLUE_VAL_BGRA(signal_check_colour); + grayscale_val = signal_check_colour & 0xff; /* Clear all bytes but lowest byte */ + } + + const uint8_t *buffer = image->Buffer(); + int pixels = image->Pixels(); + int width = image->Width(); + int colours = image->Colours(); + + int index = 0; + for ( int i = 0; i < config.signal_check_points; i++ ) + { + while( true ) + { + index = (int)(((long long)rand()*(long long)(pixels-1))/RAND_MAX); + if ( !config.timestamp_on_capture || !label_format[0] ) + break; + // Avoid sampling the rows with timestamp in + if ( index < (label_coord.Y()*width) || index >= (label_coord.Y()+Image::LINE_HEIGHT)*width ) + break; + } + + if(colours == ZM_COLOUR_GRAY8) { + if ( *(buffer+index) != grayscale_val ) + return true; + + } else if(colours == ZM_COLOUR_RGB24) { + const uint8_t *ptr = buffer+(index*colours); + + if ( usedsubpixorder == ZM_SUBPIX_ORDER_BGR) { + if ( (RED_PTR_BGRA(ptr) != red_val) || (GREEN_PTR_BGRA(ptr) != green_val) || (BLUE_PTR_BGRA(ptr) != blue_val) ) + return true; + } else { + /* Assume RGB */ + if ( (RED_PTR_RGBA(ptr) != red_val) || (GREEN_PTR_RGBA(ptr) != green_val) || (BLUE_PTR_RGBA(ptr) != blue_val) ) + return true; + } + + } else if(colours == ZM_COLOUR_RGB32) { + if ( usedsubpixorder == ZM_SUBPIX_ORDER_ARGB || usedsubpixorder == ZM_SUBPIX_ORDER_ABGR) { + if ( ARGB_ABGR_ZEROALPHA(*(((const Rgb*)buffer)+index)) != ARGB_ABGR_ZEROALPHA(colour_val) ) + return true; + } else { + /* Assume RGBA or BGRA */ + if ( RGBA_BGRA_ZEROALPHA(*(((const Rgb*)buffer)+index)) != RGBA_BGRA_ZEROALPHA(colour_val) ) + return true; + } + } + + } + return( false ); + } + return( true ); +} + +bool Monitor::Analyse() +{ + if ( shared_data->last_read_index == shared_data->last_write_index ) + { + return( false ); + } + + struct timeval now; + gettimeofday( &now, NULL ); + + if ( image_count && fps_report_interval && !(image_count%fps_report_interval) ) + { + fps = double(fps_report_interval)/(now.tv_sec-last_fps_time); + Info( "%s: %d - Processing at %.2f fps", name, image_count, fps ); + last_fps_time = now.tv_sec; + } + + int index; + if ( config.opt_adaptive_skip ) + { + int read_margin = shared_data->last_read_index - shared_data->last_write_index; + if ( read_margin < 0 ) read_margin += image_buffer_count; + + int step = 1; + if ( read_margin > 0 ) + { + step = (9*image_buffer_count)/(5*read_margin); + } + + int pending_frames = shared_data->last_write_index - shared_data->last_read_index; + if ( pending_frames < 0 ) pending_frames += image_buffer_count; + + Debug( 4, "RI:%d, WI: %d, PF = %d, RM = %d, Step = %d", shared_data->last_read_index, shared_data->last_write_index, pending_frames, read_margin, step ); + if ( step <= pending_frames ) + { + index = (shared_data->last_read_index+step)%image_buffer_count; + } + else + { + if ( pending_frames ) + { + Warning( "Approaching buffer overrun, consider slowing capture, simplifying analysis or increasing ring buffer size" ); + } + index = shared_data->last_write_index%image_buffer_count; + } + } + else + { + index = shared_data->last_write_index%image_buffer_count; + } + + Snapshot *snap = &image_buffer[index]; + struct timeval *timestamp = snap->timestamp; + Image *snap_image = snap->image; + + if ( shared_data->action ) + { + if ( shared_data->action & RELOAD ) + { + Info( "Received reload indication at count %d", image_count ); + shared_data->action &= ~RELOAD; + Reload(); + } + if ( shared_data->action & SUSPEND ) + { + if ( Active() ) + { + Info( "Received suspend indication at count %d", image_count ); + shared_data->active = false; + //closeEvent(); + } + if ( config.max_suspend_time ) + { + auto_resume_time = now.tv_sec + config.max_suspend_time; + } + shared_data->action &= ~SUSPEND; + } + if ( shared_data->action & RESUME ) + { + if ( Enabled() && !Active() ) + { + Info( "Received resume indication at count %d", image_count ); + shared_data->active = true; + ref_image = *snap_image; + ready_count = image_count+(warmup_count/2); + shared_data->alarm_x = shared_data->alarm_y = -1; + } + shared_data->action &= ~RESUME; + } + } + if ( auto_resume_time && (now.tv_sec >= auto_resume_time) ) + { + Info( "Auto resuming at count %d", image_count ); + shared_data->active = true; + ref_image = *snap_image; + ready_count = image_count+(warmup_count/2); + auto_resume_time = 0; + } + + static bool static_undef = true; + static struct timeval **timestamps; + static Image **images; + static int last_section_mod = 0; + static bool last_signal; + + if ( static_undef ) + { + static_undef = false; + timestamps = new struct timeval *[pre_event_count]; + images = new Image *[pre_event_count]; + last_signal = shared_data->signal; + } + + if ( Enabled() ) + { + bool signal = shared_data->signal; + bool signal_change = (signal != last_signal); + if ( trigger_data->trigger_state != TRIGGER_OFF ) + { + unsigned int score = 0; + if ( Ready() ) + { + std::string cause; + Event::StringSetMap noteSetMap; + + if ( trigger_data->trigger_state == TRIGGER_ON ) + { + score += trigger_data->trigger_score; + if ( !event ) + { + if ( cause.length() ) + cause += ", "; + cause += trigger_data->trigger_cause; + } + Event::StringSet noteSet; + noteSet.insert( trigger_data->trigger_text ); + noteSetMap[trigger_data->trigger_cause] = noteSet; + } + if ( signal_change ) + { + const char *signalText; + if ( !signal ) + signalText = "Lost"; + else + { + signalText = "Reacquired"; + score += 100; + } + Warning( "%s: %s", SIGNAL_CAUSE, signalText ); + if ( event && !signal ) + { + Info( "%s: %03d - Closing event %d, signal loss", name, image_count, event->Id() ); + closeEvent(); + last_section_mod = 0; + } + if ( !event ) + { + if ( cause.length() ) + cause += ", "; + cause += SIGNAL_CAUSE; + } + Event::StringSet noteSet; + noteSet.insert( signalText ); + noteSetMap[SIGNAL_CAUSE] = noteSet; + shared_data->state = state = IDLE; + shared_data->active = signal; + ref_image = *snap_image; + } + else if ( signal && Active() && (function == MODECT || function == MOCORD) ) + { + Event::StringSet zoneSet; + int motion_score = DetectMotion( *snap_image, zoneSet ); + if ( motion_score ) + { + if ( !event ) + { + score += motion_score; + if ( cause.length() ) + cause += ", "; + cause += MOTION_CAUSE; + } + else + { + score += motion_score; + } + noteSetMap[MOTION_CAUSE] = zoneSet; + } + shared_data->active = signal; + } + if ( (!signal_change && signal) && n_linked_monitors > 0 ) + { + bool first_link = true; + Event::StringSet noteSet; + for ( int i = 0; i < n_linked_monitors; i++ ) + { + if ( linked_monitors[i]->isConnected() ) + { + if ( linked_monitors[i]->hasAlarmed() ) + { + if ( !event ) + { + if ( first_link ) + { + if ( cause.length() ) + cause += ", "; + cause += LINKED_CAUSE; + first_link = false; + } + } + noteSet.insert( linked_monitors[i]->Name() ); + score += 50; + } + } + else + { + linked_monitors[i]->connect(); + } + } + if ( noteSet.size() > 0 ) + noteSetMap[LINKED_CAUSE] = noteSet; + } + if ( (!signal_change && signal) && (function == RECORD || function == MOCORD) ) + { + if ( event ) + { + int section_mod = timestamp->tv_sec%section_length; + if ( section_mod < last_section_mod ) + { + if ( state == IDLE || state == TAPE || event_close_mode == CLOSE_TIME ) + { + if ( state == TAPE ) + { + shared_data->state = state = IDLE; + Info( "%s: %03d - Closing event %d, section end", name, image_count, event->Id() ) + } + else + Info( "%s: %03d - Closing event %d, section end forced ", name, image_count, event->Id() ); + closeEvent(); + last_section_mod = 0; + } + } + else + { + last_section_mod = section_mod; + } + } + if ( !event ) + { + + // Create event + event = new Event( this, *timestamp, "Continuous", noteSetMap ); + shared_data->last_event = event->Id(); + + Info( "%s: %03d - Opening new event %d, section start", name, image_count, event->Id() ); + + /* To prevent cancelling out an existing alert\prealarm\alarm state */ + if ( state == IDLE ) + { + shared_data->state = state = TAPE; + } + + //if ( config.overlap_timed_events ) + if ( false ) + { + int pre_index = ((index+image_buffer_count)-pre_event_count)%image_buffer_count; + int pre_event_images = pre_event_count; + while ( pre_event_images && !image_buffer[pre_index].timestamp->tv_sec ) + { + pre_index = (pre_index+1)%image_buffer_count; + pre_event_images--; + } + + if ( pre_event_images ) + { + for ( int i = 0; i < pre_event_images; i++ ) + { + timestamps[i] = image_buffer[pre_index].timestamp; + images[i] = image_buffer[pre_index].image; + + pre_index = (pre_index+1)%image_buffer_count; + } + event->AddFrames( pre_event_images, images, timestamps ); + } + } + } + } + if ( score ) + { + if ( (state == IDLE || state == TAPE || state == PREALARM ) ) + { + if ( Event::PreAlarmCount() >= (alarm_frame_count-1) ) + { + Info( "%s: %03d - Gone into alarm state", name, image_count ); + shared_data->state = state = ALARM; + if ( signal_change || (function != MOCORD && state != ALERT) ) + { + int pre_index; + if ( alarm_frame_count > 1 ) + pre_index = ((index+image_buffer_count)-((alarm_frame_count-1)+pre_event_count))%image_buffer_count; + else + pre_index = ((index+image_buffer_count)-pre_event_count)%image_buffer_count; + + int pre_event_images = pre_event_count; + while ( pre_event_images && !image_buffer[pre_index].timestamp->tv_sec ) + { + pre_index = (pre_index+1)%image_buffer_count; + pre_event_images--; + } + + event = new Event( this, *(image_buffer[pre_index].timestamp), cause, noteSetMap ); + shared_data->last_event = event->Id(); + + Info( "%s: %03d - Opening new event %d, alarm start", name, image_count, event->Id() ); + + if ( pre_event_images ) + { + for ( int i = 0; i < pre_event_images; i++ ) + { + timestamps[i] = image_buffer[pre_index].timestamp; + images[i] = image_buffer[pre_index].image; + + pre_index = (pre_index+1)%image_buffer_count; + } + event->AddFrames( pre_event_images, images, timestamps ); + } + if ( alarm_frame_count ) + { + event->SavePreAlarmFrames(); + } + } + } + else if ( state != PREALARM ) + { + Info( "%s: %03d - Gone into prealarm state", name, image_count ); + shared_data->state = state = PREALARM; + } + } + else if ( state == ALERT ) + { + Info( "%s: %03d - Gone back into alarm state", name, image_count ); + shared_data->state = state = ALARM; + } + last_alarm_count = image_count; + } + else + { + if ( state == ALARM ) + { + Info( "%s: %03d - Gone into alert state", name, image_count ); + shared_data->state = state = ALERT; + } + else if ( state == ALERT ) + { + if ( image_count-last_alarm_count > post_event_count ) + { + Info( "%s: %03d - Left alarm state (%d) - %d(%d) images", name, image_count, event->Id(), event->Frames(), event->AlarmFrames() ); + //if ( function != MOCORD || event_close_mode == CLOSE_ALARM || event->Cause() == SIGNAL_CAUSE ) + if ( function != MOCORD || event_close_mode == CLOSE_ALARM ) + { + shared_data->state = state = IDLE; + Info( "%s: %03d - Closing event %d, alarm end%s", name, image_count, event->Id(), (function==MOCORD)?", section truncated":"" ); + closeEvent(); + } + else + { + shared_data->state = state = TAPE; + } + } + } + if ( state == PREALARM ) + { + if ( function != MOCORD ) + { + shared_data->state = state = IDLE; + } + else + { + shared_data->state = state = TAPE; + } + } + if ( Event::PreAlarmCount() ) + Event::EmptyPreAlarmFrames(); + } + if ( state != IDLE ) + { + if ( state == PREALARM || state == ALARM ) + { + if ( config.create_analysis_images ) + { + bool got_anal_image = false; + Image alarm_image( *snap_image ); + for( int i = 0; i < n_zones; i++ ) + { + if ( zones[i]->Alarmed() ) + { + if ( zones[i]->AlarmImage() ) + { + alarm_image.Overlay( *(zones[i]->AlarmImage()) ); + got_anal_image = true; + } + if ( config.record_event_stats && state == ALARM ) + { + zones[i]->RecordStats( event ); + } + } + } + if ( got_anal_image ) + { + if ( state == PREALARM ) + Event::AddPreAlarmFrame( snap_image, *timestamp, score, &alarm_image ); + else + event->AddFrame( snap_image, *timestamp, score, &alarm_image ); + } + else + { + if ( state == PREALARM ) + Event::AddPreAlarmFrame( snap_image, *timestamp, score ); + else + event->AddFrame( snap_image, *timestamp, score ); + } + } + else + { + for( int i = 0; i < n_zones; i++ ) + { + if ( zones[i]->Alarmed() ) + { + if ( config.record_event_stats && state == ALARM ) + { + zones[i]->RecordStats( event ); + } + } + } + if ( state == PREALARM ) + Event::AddPreAlarmFrame( snap_image, *timestamp, score ); + else + event->AddFrame( snap_image, *timestamp, score ); + } + if ( event && noteSetMap.size() > 0 ) + event->updateNotes( noteSetMap ); + } + else if ( state == ALERT ) + { + event->AddFrame( snap_image, *timestamp ); + if ( noteSetMap.size() > 0 ) + event->updateNotes( noteSetMap ); + } + else if ( state == TAPE ) + { + if ( !(image_count%(frame_skip+1)) ) + { + if ( config.bulk_frame_interval > 1 ) + { + event->AddFrame( snap_image, *timestamp, (event->Frames()AddFrame( snap_image, *timestamp ); + } + } + } + } + } + } + else + { + if ( event ) + { + Info( "%s: %03d - Closing event %d, trigger off", name, image_count, event->Id() ); + closeEvent(); + } + shared_data->state = state = IDLE; + last_section_mod = 0; + } + if ( (!signal_change && signal) && (function == MODECT || function == MOCORD) && (config.blend_alarmed_images || state != ALARM) ) + { + ref_image.Blend( *snap_image, ref_blend_perc ); + } + last_signal = signal; + } + + shared_data->last_read_index = index%image_buffer_count; + //shared_data->last_read_time = image_buffer[index].timestamp->tv_sec; + shared_data->last_read_time = now.tv_sec; + image_count++; + + return( true ); +} + +void Monitor::Reload() +{ + Debug( 1, "Reloading monitor %s", name ); + + if ( event ) + Info( "%s: %03d - Closing event %d, reloading", name, image_count, event->Id() ); + + closeEvent(); + + static char sql[ZM_SQL_MED_BUFSIZ]; + snprintf( sql, sizeof(sql), "select Function+0, Enabled, LinkedMonitors, EventPrefix, LabelFormat, LabelX, LabelY, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Id = '%d'", id ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_monitors = mysql_num_rows( result ); + if ( n_monitors != 1 ) + { + Error( "Bogus number of monitors, %d, returned. Can't reload", n_monitors ); + return; + } + + if ( MYSQL_ROW dbrow = mysql_fetch_row( result ) ) + { + int index = 0; + function = (Function)atoi(dbrow[index++]); + enabled = atoi(dbrow[index++]); + const char *p_linked_monitors = dbrow[index++]; + strncpy( event_prefix, dbrow[index++], sizeof(event_prefix) ); + strncpy( label_format, dbrow[index++], sizeof(label_format) ); + label_coord = Coord( atoi(dbrow[index]), atoi(dbrow[index+1]) ); index += 2; + warmup_count = atoi(dbrow[index++]); + pre_event_count = atoi(dbrow[index++]); + post_event_count = atoi(dbrow[index++]); + alarm_frame_count = atoi(dbrow[index++]); + section_length = atoi(dbrow[index++]); + frame_skip = atoi(dbrow[index++]); + capture_delay = (dbrow[index]&&atof(dbrow[index])>0.0)?int(DT_PREC_3/atof(dbrow[index])):0; index++; + alarm_capture_delay = (dbrow[index]&&atof(dbrow[index])>0.0)?int(DT_PREC_3/atof(dbrow[index])):0; index++; + fps_report_interval = atoi(dbrow[index++]); + ref_blend_perc = atoi(dbrow[index++]); + track_motion = atoi(dbrow[index++]); + if ( dbrow[index][0] == '#' ) + signal_check_colour = strtol(dbrow[index]+1,0,16); + else + signal_check_colour = strtol(dbrow[index],0,16); + index++; + + shared_data->state = state = IDLE; + shared_data->alarm_x = shared_data->alarm_y = -1; + if ( enabled ) + shared_data->active = true; + ready_count = image_count+warmup_count; + + ReloadLinkedMonitors( p_linked_monitors ); + } + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + mysql_free_result( result ); + + ReloadZones(); +} + +void Monitor::ReloadZones() +{ + Debug( 1, "Reloading zones for monitor %s", name ); + for( int i = 0; i < n_zones; i++ ) + { + delete zones[i]; + } + delete[] zones; + zones = 0; + n_zones = Zone::Load( this, zones ); + //DumpZoneImage(); +} + +void Monitor::ReloadLinkedMonitors( const char *p_linked_monitors ) +{ + Debug( 1, "Reloading linked monitors for monitor %s, '%s'", name, p_linked_monitors ); + if ( n_linked_monitors ) + { + for( int i = 0; i < n_linked_monitors; i++ ) + { + delete linked_monitors[i]; + } + delete[] linked_monitors; + linked_monitors = 0; + } + + n_linked_monitors = 0; + if ( p_linked_monitors ) + { + int n_link_ids = 0; + int link_ids[256]; + + char link_id_str[8]; + char *dest_ptr = link_id_str; + const char *src_ptr = p_linked_monitors; + while( 1 ) + { + dest_ptr = link_id_str; + while( *src_ptr >= '0' && *src_ptr <= '9' ) + { + if ( (dest_ptr-link_id_str) < (sizeof(link_id_str)-1) ) + { + *dest_ptr++ = *src_ptr++; + } + else + { + break; + } + } + // Add the link monitor + if ( dest_ptr != link_id_str ) + { + *dest_ptr = '\0'; + int link_id = atoi(link_id_str); + if ( link_id > 0 && link_id != id) + { + Debug( 3, "Found linked monitor id %d", link_id ); + int j; + for ( j = 0; j < n_link_ids; j++ ) + { + if ( link_ids[j] == link_id ) + break; + } + if ( j == n_link_ids ) // Not already found + { + link_ids[n_link_ids++] = link_id; + } + } + } + if ( !*src_ptr ) + break; + while( *src_ptr && (*src_ptr < '0' || *src_ptr > '9') ) + src_ptr++; + if ( !*src_ptr ) + break; + } + if ( n_link_ids > 0 ) + { + Debug( 1, "Linking to %d monitors", n_link_ids ); + linked_monitors = new MonitorLink *[n_link_ids]; + int count = 0; + for ( int i = 0; i < n_link_ids; i++ ) + { + Debug( 1, "Checking linked monitor %d", link_ids[i] ); + + static char sql[ZM_SQL_SML_BUFSIZ]; + snprintf( sql, sizeof(sql), "select Id, Name from Monitors where Id = %d and Function != 'None' and Function != 'Monitor' and Enabled = 1", link_ids[i] ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_monitors = mysql_num_rows( result ); + if ( n_monitors == 1 ) + { + MYSQL_ROW dbrow = mysql_fetch_row( result ); + Debug( 1, "Linking to monitor %d", link_ids[i] ); + linked_monitors[count++] = new MonitorLink( link_ids[i], dbrow[1] ); + } + else + { + Warning( "Can't link to monitor %d, invalid id, function or not enabled", link_ids[i] ); + } + mysql_free_result( result ); + } + n_linked_monitors = count; + } + } +} + +#if ZM_HAS_V4L +int Monitor::LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose purpose ) +{ + static char sql[ZM_SQL_MED_BUFSIZ]; + if ( !device[0] ) + { + strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Function != 'None' and Type = 'Local' order by Device, Channel", sizeof(sql) ); + } + else + { + snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Function != 'None' and Type = 'Local' and Device = '%s' order by Channel", device ); + } + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_monitors = mysql_num_rows( result ); + Debug( 1, "Got %d monitors", n_monitors ); + delete[] monitors; + monitors = new Monitor *[n_monitors]; + for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) + { + int col = 0; + + int id = atoi(dbrow[col]); col++; + const char *name = dbrow[col]; col++; + int function = atoi(dbrow[col]); col++; + int enabled = atoi(dbrow[col]); col++; + const char *linked_monitors = dbrow[col]; col++; + + const char *device = dbrow[col]; col++; + int channel = atoi(dbrow[col]); col++; + int format = atoi(dbrow[col]); col++; + const char *method = dbrow[col]; col++; + + int width = atoi(dbrow[col]); col++; + int height = atoi(dbrow[col]); col++; + int colours = atoi(dbrow[col]); col++; + int palette = atoi(dbrow[col]); col++; + Orientation orientation = (Orientation)atoi(dbrow[col]); col++; + unsigned int deinterlacing = atoi(dbrow[col]); col++; + int brightness = atoi(dbrow[col]); col++; + int contrast = atoi(dbrow[col]); col++; + int hue = atoi(dbrow[col]); col++; + int colour = atoi(dbrow[col]); col++; + + const char *event_prefix = dbrow[col]; col++; + const char *label_format = dbrow[col]; col++; + + int label_x = atoi(dbrow[col]); col++; + int label_y = atoi(dbrow[col]); col++; + + int image_buffer_count = atoi(dbrow[col]); col++; + int warmup_count = atoi(dbrow[col]); col++; + int pre_event_count = atoi(dbrow[col]); col++; + int post_event_count = atoi(dbrow[col]); col++; + int stream_replay_buffer = atoi(dbrow[col]); col++; + int alarm_frame_count = atoi(dbrow[col]); col++; + int section_length = atoi(dbrow[col]); col++; + int frame_skip = atoi(dbrow[col]); col++; + int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int fps_report_interval = atoi(dbrow[col]); col++; + int ref_blend_perc = atoi(dbrow[col]); col++; + int track_motion = atoi(dbrow[col]); col++; + int signal_check_colour; + if ( dbrow[col][0] == '#' ) + signal_check_colour = strtol(dbrow[col]+1,0,16); + else + signal_check_colour = strtol(dbrow[col],0,16); + col++; + + int cam_width = ((orientation==ROTATE_90||orientation==ROTATE_270)?height:width); + int cam_height = ((orientation==ROTATE_90||orientation==ROTATE_270)?width:height); + + int extras = (deinterlacing>>24)&0xff; + + Camera *camera = new LocalCamera( + id, + device, + channel, + format, + method, + cam_width, + cam_height, + colours, + palette, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE, + extras + ); + + monitors[i] = new Monitor( + id, + name, + function, + enabled, + linked_monitors, + camera, + orientation, + deinterlacing, + event_prefix, + label_format, + Coord( label_x, label_y ), + image_buffer_count, + warmup_count, + pre_event_count, + post_event_count, + stream_replay_buffer, + alarm_frame_count, + section_length, + frame_skip, + capture_delay, + alarm_capture_delay, + fps_report_interval, + ref_blend_perc, + track_motion, + signal_check_colour, + purpose + ); + Zone **zones = 0; + int n_zones = Zone::Load( monitors[i], zones ); + monitors[i]->AddZones( n_zones, zones ); + Debug( 1, "Loaded monitor %d(%s), %d zones", id, name, n_zones ); + } + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + // Yadda yadda + mysql_free_result( result ); + + return( n_monitors ); +} +#endif // ZM_HAS_V4L + +int Monitor::LoadRemoteMonitors( const char *protocol, const char *host, const char *port, const char *path, Monitor **&monitors, Purpose purpose ) +{ + static char sql[ZM_SQL_MED_BUFSIZ]; + if ( !protocol ) + { + strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Protocol, Method, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion from Monitors where Function != 'None' and Type = 'Remote'", sizeof(sql) ); + } + else + { + snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Protocol, Method, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion from Monitors where Function != 'None' and Type = 'Remote' and Protocol = '%s' and Host = '%s' and Port = '%s' and Path = '%s'", protocol, host, port, path ); + } + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_monitors = mysql_num_rows( result ); + Debug( 1, "Got %d monitors", n_monitors ); + delete[] monitors; + monitors = new Monitor *[n_monitors]; + for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) + { + int col = 0; + + int id = atoi(dbrow[col]); col++; + std::string name = dbrow[col]; col++; + int function = atoi(dbrow[col]); col++; + int enabled = atoi(dbrow[col]); col++; + const char *linked_monitors = dbrow[col]; col++; + + std::string protocol = dbrow[col]; col++; + std::string method = dbrow[col]; col++; + std::string host = dbrow[col]; col++; + std::string port = dbrow[col]; col++; + std::string path = dbrow[col]; col++; + + int width = atoi(dbrow[col]); col++; + int height = atoi(dbrow[col]); col++; + int colours = atoi(dbrow[col]); col++; + /* int palette = atoi(dbrow[col]); */ col++; + Orientation orientation = (Orientation)atoi(dbrow[col]); col++; + unsigned int deinterlacing = atoi(dbrow[col]); col++; + int brightness = atoi(dbrow[col]); col++; + int contrast = atoi(dbrow[col]); col++; + int hue = atoi(dbrow[col]); col++; + int colour = atoi(dbrow[col]); col++; + + std::string event_prefix = dbrow[col]; col++; + std::string label_format = dbrow[col]; col++; + + int label_x = atoi(dbrow[col]); col++; + int label_y = atoi(dbrow[col]); col++; + + int image_buffer_count = atoi(dbrow[col]); col++; + int warmup_count = atoi(dbrow[col]); col++; + int pre_event_count = atoi(dbrow[col]); col++; + int post_event_count = atoi(dbrow[col]); col++; + int stream_replay_buffer = atoi(dbrow[col]); col++; + int alarm_frame_count = atoi(dbrow[col]); col++; + int section_length = atoi(dbrow[col]); col++; + int frame_skip = atoi(dbrow[col]); col++; + int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int fps_report_interval = atoi(dbrow[col]); col++; + int ref_blend_perc = atoi(dbrow[col]); col++; + int track_motion = atoi(dbrow[col]); col++; + + int cam_width = ((orientation==ROTATE_90||orientation==ROTATE_270)?height:width); + int cam_height = ((orientation==ROTATE_90||orientation==ROTATE_270)?width:height); + + Camera *camera = 0; + if ( protocol == "http" ) + { + camera = new RemoteCameraHttp( + id, + method, + host, // Host + port, // Port + path, // Path + cam_width, + cam_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE + ); + } +#if HAVE_LIBAVFORMAT + else if ( protocol == "rtsp" ) + { + camera = new RemoteCameraRtsp( + id, + method, + host, // Host + port, // Port + path, // Path + cam_width, + cam_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE + ); + } +#endif // HAVE_LIBAVFORMAT + else + { + Fatal( "Unexpected remote camera protocol '%s'", protocol.c_str() ); + } + + monitors[i] = new Monitor( + id, + name.c_str(), + function, + enabled, + linked_monitors, + camera, + orientation, + deinterlacing, + event_prefix.c_str(), + label_format.c_str(), + Coord( label_x, label_y ), + image_buffer_count, + warmup_count, + pre_event_count, + post_event_count, + stream_replay_buffer, + alarm_frame_count, + section_length, + frame_skip, + capture_delay, + alarm_capture_delay, + fps_report_interval, + ref_blend_perc, + track_motion, + RGB_WHITE, + purpose + ); + Zone **zones = 0; + int n_zones = Zone::Load( monitors[i], zones ); + monitors[i]->AddZones( n_zones, zones ); + Debug( 1, "Loaded monitor %d(%s), %d zones", id, name.c_str(), n_zones ); + } + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + // Yadda yadda + mysql_free_result( result ); + + return( n_monitors ); +} + +int Monitor::LoadFileMonitors( const char *file, Monitor **&monitors, Purpose purpose ) +{ + static char sql[ZM_SQL_MED_BUFSIZ]; + if ( !file[0] ) + { + strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion from Monitors where Function != 'None' and Type = 'File'", sizeof(sql) ); + } + else + { + snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion from Monitors where Function != 'None' and Type = 'File' and Path = '%s'", file ); + } + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_monitors = mysql_num_rows( result ); + Debug( 1, "Got %d monitors", n_monitors ); + delete[] monitors; + monitors = new Monitor *[n_monitors]; + for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) + { + int col = 0; + + int id = atoi(dbrow[col]); col++; + const char *name = dbrow[col]; col++; + int function = atoi(dbrow[col]); col++; + int enabled = atoi(dbrow[col]); col++; + const char *linked_monitors = dbrow[col]; col++; + + const char *path = dbrow[col]; col++; + + int width = atoi(dbrow[col]); col++; + int height = atoi(dbrow[col]); col++; + int colours = atoi(dbrow[col]); col++; + /* int palette = atoi(dbrow[col]); */ col++; + Orientation orientation = (Orientation)atoi(dbrow[col]); col++; + unsigned int deinterlacing = atoi(dbrow[col]); col++; + int brightness = atoi(dbrow[col]); col++; + int contrast = atoi(dbrow[col]); col++; + int hue = atoi(dbrow[col]); col++; + int colour = atoi(dbrow[col]); col++; + + const char *event_prefix = dbrow[col]; col++; + const char *label_format = dbrow[col]; col++; + + int label_x = atoi(dbrow[col]); col++; + int label_y = atoi(dbrow[col]); col++; + + int image_buffer_count = atoi(dbrow[col]); col++; + int warmup_count = atoi(dbrow[col]); col++; + int pre_event_count = atoi(dbrow[col]); col++; + int post_event_count = atoi(dbrow[col]); col++; + int stream_replay_buffer = atoi(dbrow[col]); col++; + int alarm_frame_count = atoi(dbrow[col]); col++; + int section_length = atoi(dbrow[col]); col++; + int frame_skip = atoi(dbrow[col]); col++; + int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int fps_report_interval = atoi(dbrow[col]); col++; + int ref_blend_perc = atoi(dbrow[col]); col++; + int track_motion = atoi(dbrow[col]); col++; + + int cam_width = ((orientation==ROTATE_90||orientation==ROTATE_270)?height:width); + int cam_height = ((orientation==ROTATE_90||orientation==ROTATE_270)?width:height); + + Camera *camera = new FileCamera( + id, + path, // File + cam_width, + cam_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE + ); + + monitors[i] = new Monitor( + id, + name, + function, + enabled, + linked_monitors, + camera, + orientation, + deinterlacing, + event_prefix, + label_format, + Coord( label_x, label_y ), + image_buffer_count, + warmup_count, + pre_event_count, + post_event_count, + stream_replay_buffer, + alarm_frame_count, + section_length, + frame_skip, + capture_delay, + alarm_capture_delay, + fps_report_interval, + ref_blend_perc, + track_motion, + RGB_WHITE, + purpose + ); + Zone **zones = 0; + int n_zones = Zone::Load( monitors[i], zones ); + monitors[i]->AddZones( n_zones, zones ); + Debug( 1, "Loaded monitor %d(%s), %d zones", id, name, n_zones ); + } + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + // Yadda yadda + mysql_free_result( result ); + + return( n_monitors ); +} + +#if HAVE_LIBAVFORMAT +int Monitor::LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose purpose ) +{ + static char sql[ZM_SQL_MED_BUFSIZ]; + if ( !file[0] ) + { + strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion from Monitors where Function != 'None' and Type = 'Ffmpeg'", sizeof(sql) ); + } + else + { + snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion from Monitors where Function != 'None' and Type = 'Ffmpeg' and Path = '%s'", file ); + } + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_monitors = mysql_num_rows( result ); + Debug( 1, "Got %d monitors", n_monitors ); + delete[] monitors; + monitors = new Monitor *[n_monitors]; + for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) + { + int col = 0; + + int id = atoi(dbrow[col]); col++; + const char *name = dbrow[col]; col++; + int function = atoi(dbrow[col]); col++; + int enabled = atoi(dbrow[col]); col++; + const char *linked_monitors = dbrow[col]; col++; + + const char *path = dbrow[col]; col++; + + int width = atoi(dbrow[col]); col++; + int height = atoi(dbrow[col]); col++; + int colours = atoi(dbrow[col]); col++; + /* int palette = atoi(dbrow[col]); */ col++; + Orientation orientation = (Orientation)atoi(dbrow[col]); col++; + unsigned int deinterlacing = atoi(dbrow[col]); col++; + int brightness = atoi(dbrow[col]); col++; + int contrast = atoi(dbrow[col]); col++; + int hue = atoi(dbrow[col]); col++; + int colour = atoi(dbrow[col]); col++; + + const char *event_prefix = dbrow[col]; col++; + const char *label_format = dbrow[col]; col++; + + int label_x = atoi(dbrow[col]); col++; + int label_y = atoi(dbrow[col]); col++; + + int image_buffer_count = atoi(dbrow[col]); col++; + int warmup_count = atoi(dbrow[col]); col++; + int pre_event_count = atoi(dbrow[col]); col++; + int post_event_count = atoi(dbrow[col]); col++; + int stream_replay_buffer = atoi(dbrow[col]); col++; + int alarm_frame_count = atoi(dbrow[col]); col++; + int section_length = atoi(dbrow[col]); col++; + int frame_skip = atoi(dbrow[col]); col++; + int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int fps_report_interval = atoi(dbrow[col]); col++; + int ref_blend_perc = atoi(dbrow[col]); col++; + int track_motion = atoi(dbrow[col]); col++; + + int cam_width = ((orientation==ROTATE_90||orientation==ROTATE_270)?height:width); + int cam_height = ((orientation==ROTATE_90||orientation==ROTATE_270)?width:height); + + Camera *camera = new FfmpegCamera( + id, + path, // File + cam_width, + cam_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE + ); + + monitors[i] = new Monitor( + id, + name, + function, + enabled, + linked_monitors, + camera, + orientation, + deinterlacing, + event_prefix, + label_format, + Coord( label_x, label_y ), + image_buffer_count, + warmup_count, + pre_event_count, + post_event_count, + stream_replay_buffer, + alarm_frame_count, + section_length, + frame_skip, + capture_delay, + alarm_capture_delay, + fps_report_interval, + ref_blend_perc, + track_motion, + RGB_WHITE, + purpose + ); + Zone **zones = 0; + int n_zones = Zone::Load( monitors[i], zones ); + monitors[i]->AddZones( n_zones, zones ); + Debug( 1, "Loaded monitor %d(%s), %d zones", id, name, n_zones ); + } + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + // Yadda yadda + mysql_free_result( result ); + + return( n_monitors ); +} +#endif // HAVE_LIBAVFORMAT + +Monitor *Monitor::Load( int id, bool load_zones, Purpose purpose ) +{ + static char sql[ZM_SQL_MED_BUFSIZ]; + snprintf( sql, sizeof(sql), "select Id, Name, Type, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, Protocol, Method, Host, Port, Path, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Id = %d", id ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_monitors = mysql_num_rows( result ); + Debug( 1, "Got %d monitors", n_monitors ); + Monitor *monitor = 0; + for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) + { + int col = 0; + + int id = atoi(dbrow[col]); col++; + std::string name = dbrow[col]; col++; + std::string type = dbrow[col]; col++; + int function = atoi(dbrow[col]); col++; + int enabled = atoi(dbrow[col]); col++; + std::string linked_monitors = dbrow[col]; col++; + + std::string device = dbrow[col]; col++; + int channel = atoi(dbrow[col]); col++; + int format = atoi(dbrow[col]); col++; + + std::string protocol = dbrow[col]; col++; + std::string method = dbrow[col]; col++; + std::string host = dbrow[col]; col++; + std::string port = dbrow[col]; col++; + std::string path = dbrow[col]; col++; + + int width = atoi(dbrow[col]); col++; + int height = atoi(dbrow[col]); col++; + int colours = atoi(dbrow[col]); col++; + int palette = atoi(dbrow[col]); col++; + Orientation orientation = (Orientation)atoi(dbrow[col]); col++; + unsigned int deinterlacing = atoi(dbrow[col]); col++; + int brightness = atoi(dbrow[col]); col++; + int contrast = atoi(dbrow[col]); col++; + int hue = atoi(dbrow[col]); col++; + int colour = atoi(dbrow[col]); col++; + + std::string event_prefix = dbrow[col]; col++; + std::string label_format = dbrow[col]; col++; + + int label_x = atoi(dbrow[col]); col++; + int label_y = atoi(dbrow[col]); col++; + + int image_buffer_count = atoi(dbrow[col]); col++; + int warmup_count = atoi(dbrow[col]); col++; + int pre_event_count = atoi(dbrow[col]); col++; + int post_event_count = atoi(dbrow[col]); col++; + int stream_replay_buffer = atoi(dbrow[col]); col++; + int alarm_frame_count = atoi(dbrow[col]); col++; + int section_length = atoi(dbrow[col]); col++; + int frame_skip = atoi(dbrow[col]); col++; + int capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int alarm_capture_delay = (dbrow[col]&&atof(dbrow[col])>0.0)?int(DT_PREC_3/atof(dbrow[col])):0; col++; + int fps_report_interval = atoi(dbrow[col]); col++; + int ref_blend_perc = atoi(dbrow[col]); col++; + int track_motion = atoi(dbrow[col]); col++; + int signal_check_colour; + if ( dbrow[col][0] == '#' ) + signal_check_colour = strtol(dbrow[col]+1,0,16); + else + signal_check_colour = strtol(dbrow[col],0,16); + + int cam_width = ((orientation==ROTATE_90||orientation==ROTATE_270)?height:width); + int cam_height = ((orientation==ROTATE_90||orientation==ROTATE_270)?width:height); + + int extras = (deinterlacing>>24)&0xff; + + Camera *camera = 0; + if ( type == "Local" ) + { +#if ZM_HAS_V4L + camera = new LocalCamera( + id, + device.c_str(), + channel, + format, + method, + cam_width, + cam_height, + colours, + palette, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE, + extras + ); +#else // ZM_HAS_V4L + Fatal( "You must have video4linux libraries and headers installed to use local analog or USB cameras for monitor %d", id ); +#endif // ZM_HAS_V4L + } + else if ( type == "Remote" ) + { + if ( protocol == "http" ) + { + camera = new RemoteCameraHttp( + id, + method.c_str(), + host.c_str(), + port.c_str(), + path.c_str(), + cam_width, + cam_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE + ); + } + else if ( protocol == "rtsp" ) + { +#if HAVE_LIBAVFORMAT + camera = new RemoteCameraRtsp( + id, + method.c_str(), + host.c_str(), + port.c_str(), + path.c_str(), + cam_width, + cam_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE + ); +#else // HAVE_LIBAVFORMAT + Fatal( "You must have ffmpeg libraries installed to use remote camera protocol '%s' for monitor %d", protocol.c_str(), id ); +#endif // HAVE_LIBAVFORMAT + } + else + { + Fatal( "Unexpected remote camera protocol '%s' for monitor %d", protocol.c_str(), id ); + } + } + else if ( type == "File" ) + { + camera = new FileCamera( + id, + path.c_str(), + cam_width, + cam_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE + ); + } + else if ( type == "Ffmpeg" ) + { +#if HAVE_LIBAVFORMAT + camera = new FfmpegCamera( + id, + path.c_str(), + cam_width, + cam_height, + colours, + brightness, + contrast, + hue, + colour, + purpose==CAPTURE + ); +#else // HAVE_LIBAVFORMAT + Fatal( "You must have ffmpeg libraries installed to use ffmpeg cameras for monitor %d", id ); +#endif // HAVE_LIBAVFORMAT + } + else + { + Fatal( "Bogus monitor type '%s' for monitor %d", type.c_str(), id ); + } + monitor = new Monitor( + id, + name.c_str(), + function, + enabled, + linked_monitors.c_str(), + camera, + orientation, + deinterlacing, + event_prefix.c_str(), + label_format.c_str(), + Coord( label_x, label_y ), + image_buffer_count, + warmup_count, + pre_event_count, + post_event_count, + stream_replay_buffer, + alarm_frame_count, + section_length, + frame_skip, + capture_delay, + alarm_capture_delay, + fps_report_interval, + ref_blend_perc, + track_motion, + signal_check_colour, + purpose + ); + + int n_zones = 0; + if ( load_zones ) + { + Zone **zones = 0; + n_zones = Zone::Load( monitor, zones ); + monitor->AddZones( n_zones, zones ); + } + Debug( 1, "Loaded monitor %d(%s), %d zones", id, name.c_str(), n_zones ); + } + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + // Yadda yadda + mysql_free_result( result ); + + return( monitor ); +} + +int Monitor::Capture() +{ + static int FirstCapture = 1; + int captureResult; + + int index = image_count%image_buffer_count; + Image* capture_image = image_buffer[index].image; + + if ( (deinterlacing & 0xff) == 4) { + if ( FirstCapture != 1 ) { + /* Copy the next image into the shared memory */ + capture_image->CopyBuffer(*(next_buffer.image)); + } + + /* Capture a new next image */ + captureResult = camera->Capture(*(next_buffer.image)); + + if ( FirstCapture ) { + FirstCapture = 0; + return 0; + } + + } else { + /* Capture directly into image buffer, avoiding the need to memcpy() */ + captureResult = camera->Capture(*capture_image); + } + + if ( captureResult != 0 ) + { + // Unable to capture image for temporary reason + // Fake a signal loss image + capture_image->Fill( signal_check_colour ); + captureResult = 0; + } else { + captureResult = 1; + } + + if ( captureResult == 1 ) + { + + /* Deinterlacing */ + if ( (deinterlacing & 0xff) == 1 ) { + capture_image->Deinterlace_Discard(); + } else if ( (deinterlacing & 0xff) == 2 ) { + capture_image->Deinterlace_Linear(); + } else if ( (deinterlacing & 0xff) == 3 ) { + capture_image->Deinterlace_Blend(); + } else if ( (deinterlacing & 0xff) == 4 ) { + capture_image->Deinterlace_4Field( next_buffer.image, (deinterlacing>>8)&0xff ); + } else if ( (deinterlacing & 0xff) == 5 ) { + capture_image->Deinterlace_Blend_CustomRatio( (deinterlacing>>8)&0xff ); + } + + + if ( orientation != ROTATE_0 ) + { + switch ( orientation ) + { + case ROTATE_0 : + { + // No action required + break; + } + case ROTATE_90 : + case ROTATE_180 : + case ROTATE_270 : + { + capture_image->Rotate( (orientation-1)*90 ); + break; + } + case FLIP_HORI : + case FLIP_VERT : + { + capture_image->Flip( orientation==FLIP_HORI ); + break; + } + } + } + + } + if ( true ) { + + if ( capture_image->Size() != camera->ImageSize() ) + { + Error( "Captured image does not match expected size, check width, height and colour depth" ); + return( -1 ); + } + + if ( (index == shared_data->last_read_index) && (function > MONITOR) ) + { + Warning( "Buffer overrun at index %d, image %d, slow down capture, speed up analysis or increase ring buffer size", index, image_count ); + time_t now = time(0); + double approxFps = double(image_buffer_count)/double(now-image_buffer[index].timestamp->tv_sec); + time_t last_read_delta = now - shared_data->last_read_time; + if ( last_read_delta > (image_buffer_count/approxFps) ) + { + Warning( "Last image read from shared memory %ld seconds ago, zma may have gone away", last_read_delta ) + shared_data->last_read_index = image_buffer_count; + } + } + + gettimeofday( image_buffer[index].timestamp, NULL ); + if ( config.timestamp_on_capture ) + { + TimestampImage( capture_image, image_buffer[index].timestamp ); + } + shared_data->signal = CheckSignal(capture_image); + shared_data->last_write_index = index; + shared_data->last_write_time = image_buffer[index].timestamp->tv_sec; + + image_count++; + + if ( image_count && fps_report_interval && !(image_count%fps_report_interval) ) + { + time_t now = image_buffer[index].timestamp->tv_sec; + fps = double(fps_report_interval)/(now-last_fps_time); + //Info( "%d -> %d -> %d", fps_report_interval, now, last_fps_time ); + //Info( "%d -> %d -> %lf -> %lf", now-last_fps_time, fps_report_interval/(now-last_fps_time), double(fps_report_interval)/(now-last_fps_time), fps ); + Info( "%s: %d - Capturing at %.2lf fps", name, image_count, fps ); + last_fps_time = now; + } + + if ( shared_data->action & GET_SETTINGS ) + { + shared_data->brightness = camera->Brightness(); + shared_data->hue = camera->Hue(); + shared_data->colour = camera->Colour(); + shared_data->contrast = camera->Contrast(); + shared_data->action &= ~GET_SETTINGS; + } + if ( shared_data->action & SET_SETTINGS ) + { + camera->Brightness( shared_data->brightness ); + camera->Hue( shared_data->hue ); + camera->Colour( shared_data->colour ); + camera->Contrast( shared_data->contrast ); + shared_data->action &= ~SET_SETTINGS; + } + return( 0 ); + } + shared_data->signal = false; + return( -1 ); +} + +void Monitor::TimestampImage( Image *ts_image, const struct timeval *ts_time ) const +{ + if ( label_format[0] ) + { + // Expand the strftime macros first + char label_time_text[256]; + strftime( label_time_text, sizeof(label_time_text), label_format, localtime( &ts_time->tv_sec ) ); + + char label_text[1024]; + const char *s_ptr = label_time_text; + char *d_ptr = label_text; + while ( *s_ptr && ((d_ptr-label_text) < sizeof(label_text)) ) + { + if ( *s_ptr == '%' ) + { + bool found_macro = false; + switch ( *(s_ptr+1) ) + { + case 'N' : + d_ptr += snprintf( d_ptr, sizeof(label_text)-(d_ptr-label_text), "%s", name ); + found_macro = true; + break; + case 'Q' : + d_ptr += snprintf( d_ptr, sizeof(label_text)-(d_ptr-label_text), "%s", trigger_data->trigger_showtext ); + found_macro = true; + break; + case 'f' : + d_ptr += snprintf( d_ptr, sizeof(label_text)-(d_ptr-label_text), "%02ld", ts_time->tv_usec/10000 ); + found_macro = true; + break; + } + if ( found_macro ) + { + s_ptr += 2; + continue; + } + } + *d_ptr++ = *s_ptr++; + } + *d_ptr = '\0'; + ts_image->Annotate( label_text, label_coord ); + } +} + +bool Monitor::closeEvent() +{ + if ( event ) + { + if ( function == RECORD || function == MOCORD ) + { + gettimeofday( &(event->EndTime()), NULL ); + } + delete event; + event = 0; + return( true ); + } + return( false ); +} + +unsigned int Monitor::DetectMotion( const Image &comp_image, Event::StringSet &zoneSet ) +{ + bool alarm = false; + unsigned int score = 0; + + if ( n_zones <= 0 ) return( alarm ); + + if ( config.record_diag_images ) + { + static char diag_path[PATH_MAX] = ""; + if ( !diag_path[0] ) + { + snprintf( diag_path, sizeof(diag_path), "%s/%d/diag-r.jpg", config.dir_events, id ); + } + ref_image.WriteJpeg( diag_path ); + } + + ref_image.Delta( comp_image, &delta_image); + + if ( config.record_diag_images ) + { + static char diag_path[PATH_MAX] = ""; + if ( !diag_path[0] ) + { + snprintf( diag_path, sizeof(diag_path), "%s/%d/diag-d.jpg", config.dir_events, id ); + } + delta_image.WriteJpeg( diag_path ); + } + + // Blank out all exclusion zones + for ( int n_zone = 0; n_zone < n_zones; n_zone++ ) + { + Zone *zone = zones[n_zone]; + zone->ClearAlarm(); + if ( !zone->IsInactive() ) + { + continue; + } + Debug( 3, "Blanking inactive zone %s", zone->Label() ); + delta_image.Fill( RGB_BLACK, zone->GetPolygon() ); + } + + // Check preclusive zones first + for ( int n_zone = 0; n_zone < n_zones; n_zone++ ) + { + Zone *zone = zones[n_zone]; + if ( !zone->IsPreclusive() ) + { + continue; + } + Debug( 3, "Checking preclusive zone %s", zone->Label() ); + if ( zone->CheckAlarms( &delta_image ) ) + { + alarm = true; + score += zone->Score(); + Debug( 3, "Zone is alarmed, zone score = %d", zone->Score() ); + zoneSet.insert( zone->Label() ); + //zone->ResetStats(); + } + } + + Coord alarm_centre; + int top_score = -1; + + if ( alarm ) + { + alarm = false; + score = 0; + } + else + { + // Find all alarm pixels in active zones + for ( int n_zone = 0; n_zone < n_zones; n_zone++ ) + { + Zone *zone = zones[n_zone]; + if ( !zone->IsActive() ) + { + continue; + } + Debug( 3, "Checking active zone %s", zone->Label() ); + if ( zone->CheckAlarms( &delta_image ) ) + { + alarm = true; + score += zone->Score(); + zone->SetAlarm(); + Debug( 3, "Zone is alarmed, zone score = %d", zone->Score() ); + zoneSet.insert( zone->Label() ); + if ( config.opt_control && track_motion ) + { + if ( (int)zone->Score() > top_score ) + { + top_score = zone->Score(); + alarm_centre = zone->GetAlarmCentre(); + } + } + } + } + + if ( alarm ) + { + for ( int n_zone = 0; n_zone < n_zones; n_zone++ ) + { + Zone *zone = zones[n_zone]; + if ( !zone->IsInclusive() ) + { + continue; + } + Debug( 3, "Checking inclusive zone %s", zone->Label() ); + if ( zone->CheckAlarms( &delta_image ) ) + { + alarm = true; + score += zone->Score(); + zone->SetAlarm(); + Debug( 3, "Zone is alarmed, zone score = %d", zone->Score() ); + zoneSet.insert( zone->Label() ); + if ( config.opt_control && track_motion ) + { + if ( zone->Score() > top_score ) + { + top_score = zone->Score(); + alarm_centre = zone->GetAlarmCentre(); + } + } + } + } + } + else + { + // Find all alarm pixels in exclusive zones + for ( int n_zone = 0; n_zone < n_zones; n_zone++ ) + { + Zone *zone = zones[n_zone]; + if ( !zone->IsExclusive() ) + { + continue; + } + Debug( 3, "Checking exclusive zone %s", zone->Label() ); + if ( zone->CheckAlarms( &delta_image ) ) + { + alarm = true; + score += zone->Score(); + zone->SetAlarm(); + Debug( 3, "Zone is alarmed, zone score = %d", zone->Score() ); + zoneSet.insert( zone->Label() ); + } + } + } + } + + if ( top_score > 0 ) + { + shared_data->alarm_x = alarm_centre.X(); + shared_data->alarm_y = alarm_centre.Y(); + + Info( "Got alarm centre at %d,%d, at count %d", shared_data->alarm_x, shared_data->alarm_y, image_count ); + } + else + { + shared_data->alarm_x = shared_data->alarm_y = -1; + } + + // This is a small and innocent hack to prevent scores of 0 being returned in alarm state + return( score?score:alarm ); +} + +bool Monitor::DumpSettings( char *output, bool verbose ) +{ + output[0] = 0; + + sprintf( output+strlen(output), "Id : %d\n", id ); + sprintf( output+strlen(output), "Name : %s\n", name ); + sprintf( output+strlen(output), "Type : %s\n", camera->IsLocal()?"Local":(camera->IsRemote()?"Remote":"File") ); +#if ZM_HAS_V4L + if ( camera->IsLocal() ) + { + sprintf( output+strlen(output), "Device : %s\n", ((LocalCamera *)camera)->Device().c_str() ); + sprintf( output+strlen(output), "Channel : %d\n", ((LocalCamera *)camera)->Channel() ); + sprintf( output+strlen(output), "Standard : %d\n", ((LocalCamera *)camera)->Standard() ); + } + else +#endif // ZM_HAS_V4L + if ( camera->IsRemote() ) + { + sprintf( output+strlen(output), "Protocol : %s\n", ((RemoteCamera *)camera)->Protocol().c_str() ); + sprintf( output+strlen(output), "Host : %s\n", ((RemoteCamera *)camera)->Host().c_str() ); + sprintf( output+strlen(output), "Port : %s\n", ((RemoteCamera *)camera)->Port().c_str() ); + sprintf( output+strlen(output), "Path : %s\n", ((RemoteCamera *)camera)->Path().c_str() ); + } + else if ( camera->IsFile() ) + { + sprintf( output+strlen(output), "Path : %s\n", ((FileCamera *)camera)->Path() ); + } +#if HAVE_LIBAVFORMAT + else if ( camera->IsFfmpeg() ) + { + sprintf( output+strlen(output), "Path : %s\n", ((FfmpegCamera *)camera)->Path().c_str() ); + } +#endif // HAVE_LIBAVFORMAT + sprintf( output+strlen(output), "Width : %d\n", camera->Width() ); + sprintf( output+strlen(output), "Height : %d\n", camera->Height() ); +#if ZM_HAS_V4L + if ( camera->IsLocal() ) + { + sprintf( output+strlen(output), "Palette : %d\n", ((LocalCamera *)camera)->Palette() ); + } +#endif // ZM_HAS_V4L + sprintf( output+strlen(output), "Colours : %d\n", camera->Colours() ); + sprintf( output+strlen(output), "Subpixel Order : %d\n", camera->SubpixelOrder() ); + sprintf( output+strlen(output), "Event Prefix : %s\n", event_prefix ); + sprintf( output+strlen(output), "Label Format : %s\n", label_format ); + sprintf( output+strlen(output), "Label Coord : %d,%d\n", label_coord.X(), label_coord.Y() ); + sprintf( output+strlen(output), "Image Buffer Count : %d\n", image_buffer_count ); + sprintf( output+strlen(output), "Warmup Count : %d\n", warmup_count ); + sprintf( output+strlen(output), "Pre Event Count : %d\n", pre_event_count ); + sprintf( output+strlen(output), "Post Event Count : %d\n", post_event_count ); + sprintf( output+strlen(output), "Stream Replay Buffer : %d\n", stream_replay_buffer ); + sprintf( output+strlen(output), "Alarm Frame Count : %d\n", alarm_frame_count ); + sprintf( output+strlen(output), "Section Length : %d\n", section_length ); + sprintf( output+strlen(output), "Maximum FPS : %.2f\n", capture_delay?DT_PREC_3/capture_delay:0.0 ); + sprintf( output+strlen(output), "Alarm Maximum FPS : %.2f\n", alarm_capture_delay?DT_PREC_3/alarm_capture_delay:0.0 ); + sprintf( output+strlen(output), "Reference Blend %%ge : %d\n", ref_blend_perc ); + sprintf( output+strlen(output), "Track Motion : %d\n", track_motion ); + sprintf( output+strlen(output), "Function: %d - %s\n", function, + function==NONE?"None":( + function==MONITOR?"Monitor Only":( + function==MODECT?"Motion Detection":( + function==RECORD?"Continuous Record":( + function==MOCORD?"Continuous Record with Motion Detection":( + function==NODECT?"Externally Triggered only, no Motion Detection":"Unknown" + )))))); + sprintf( output+strlen(output), "Zones : %d\n", n_zones ); + for ( int i = 0; i < n_zones; i++ ) + { + zones[i]->DumpSettings( output+strlen(output), verbose ); + } + return( true ); +} + +bool MonitorStream::checkSwapPath( const char *path, bool create_path ) +{ + uid_t uid = getuid(); + gid_t gid = getgid(); + + struct stat stat_buf; + if ( stat( path, &stat_buf ) < 0 ) + { + if ( create_path && errno == ENOENT ) + { + Debug( 3, "Swap path '%s' missing, creating", path ); + if ( mkdir( path, 0755 ) ) + { + Error( "Can't mkdir %s: %s", path, strerror(errno)); + return( false ); + } + if ( stat( path, &stat_buf ) < 0 ) + { + Error( "Can't stat '%s': %s", path, strerror(errno) ); + return( false ); + } + } + else + { + Error( "Can't stat '%s': %s", path, strerror(errno) ); + return( false ); + } + } + if ( !S_ISDIR(stat_buf.st_mode) ) + { + Error( "Swap image path '%s' is not a directory", path ); + return( false ); + } + + mode_t mask = 0; + if ( uid == stat_buf.st_uid ) + { + // If we are the owner + mask = 00700; + } + else if ( gid == stat_buf.st_gid ) + { + // If we are in the owner group + mask = 00070; + } + else + { + // We are neither the owner nor in the group + mask = 00007; + } + + if ( (stat_buf.st_mode & mask) != mask ) + { + Error( "Insufficient permissions on swap image path '%s'", path ); + return( false ); + } + return( true ); +} + +void MonitorStream::processCommand( const CmdMsg *msg ) +{ + Debug( 2, "Got message, type %d, msg %d", msg->msg_type, msg->msg_data[0] ); + // Check for incoming command + switch( (MsgCommand)msg->msg_data[0] ) + { + case CMD_PAUSE : + { + Debug( 1, "Got PAUSE command" ); + + // Set paused flag + paused = true; + // Set delayed flag + delayed = true; + last_frame_sent = TV_2_FLOAT( now ); + break; + } + case CMD_PLAY : + { + Debug( 1, "Got PLAY command" ); + if ( paused ) + { + // Clear paused flag + paused = false; + // Set delayed_play flag + delayed = true; + } + replay_rate = ZM_RATE_BASE; + break; + } + case CMD_VARPLAY : + { + Debug( 1, "Got VARPLAY command" ); + if ( paused ) + { + // Clear paused flag + paused = false; + // Set delayed_play flag + delayed = true; + } + replay_rate = ntohs(((unsigned char)msg->msg_data[2]<<8)|(unsigned char)msg->msg_data[1])-32768; + break; + } + case CMD_STOP : + { + Debug( 1, "Got STOP command" ); + + // Clear paused flag + paused = false; + // Clear delayed_play flag + delayed = false; + break; + } + case CMD_FASTFWD : + { + Debug( 1, "Got FAST FWD command" ); + if ( paused ) + { + // Clear paused flag + paused = false; + // Set delayed_play flag + delayed = true; + } + // Set play rate + switch ( replay_rate ) + { + case 2 * ZM_RATE_BASE : + replay_rate = 5 * ZM_RATE_BASE; + break; + case 5 * ZM_RATE_BASE : + replay_rate = 10 * ZM_RATE_BASE; + break; + case 10 * ZM_RATE_BASE : + replay_rate = 25 * ZM_RATE_BASE; + break; + case 25 * ZM_RATE_BASE : + case 50 * ZM_RATE_BASE : + replay_rate = 50 * ZM_RATE_BASE; + break; + default : + replay_rate = 2 * ZM_RATE_BASE; + break; + } + break; + } + case CMD_SLOWFWD : + { + Debug( 1, "Got SLOW FWD command" ); + // Set paused flag + paused = true; + // Set delayed flag + delayed = true; + // Set play rate + replay_rate = ZM_RATE_BASE; + // Set step + step = 1; + break; + } + case CMD_SLOWREV : + { + Debug( 1, "Got SLOW REV command" ); + // Set paused flag + paused = true; + // Set delayed flag + delayed = true; + // Set play rate + replay_rate = ZM_RATE_BASE; + // Set step + step = -1; + break; + } + case CMD_FASTREV : + { + Debug( 1, "Got FAST REV command" ); + if ( paused ) + { + // Clear paused flag + paused = false; + // Set delayed_play flag + delayed = true; + } + // Set play rate + switch ( replay_rate ) + { + case -2 * ZM_RATE_BASE : + replay_rate = -5 * ZM_RATE_BASE; + break; + case -5 * ZM_RATE_BASE : + replay_rate = -10 * ZM_RATE_BASE; + break; + case -10 * ZM_RATE_BASE : + replay_rate = -25 * ZM_RATE_BASE; + break; + case -25 * ZM_RATE_BASE : + case -50 * ZM_RATE_BASE : + replay_rate = -50 * ZM_RATE_BASE; + break; + default : + replay_rate = -2 * ZM_RATE_BASE; + break; + } + break; + } + case CMD_ZOOMIN : + { + x = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; + y = ((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; + Debug( 1, "Got ZOOM IN command, to %d,%d", x, y ); + switch ( zoom ) + { + case 100: + zoom = 150; + break; + case 150: + zoom = 200; + break; + case 200: + zoom = 300; + break; + case 300: + zoom = 400; + break; + case 400: + default : + zoom = 500; + break; + } + break; + } + case CMD_ZOOMOUT : + { + Debug( 1, "Got ZOOM OUT command" ); + switch ( zoom ) + { + case 500: + zoom = 400; + break; + case 400: + zoom = 300; + break; + case 300: + zoom = 200; + break; + case 200: + zoom = 150; + break; + case 150: + default : + zoom = 100; + break; + } + break; + } + case CMD_PAN : + { + x = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; + y = ((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; + Debug( 1, "Got PAN command, to %d,%d", x, y ); + break; + } + case CMD_SCALE : + { + scale = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; + Debug( 1, "Got SCALE command, to %d", scale ); + break; + } + case CMD_QUERY : + { + Debug( 1, "Got QUERY command, sending STATUS" ); + break; + } + default : + { + Error( "Got unexpected command %d", msg->msg_data[0] ); + break; + } + } + + struct { + int id; + int state; + double fps; + int buffer_level; + int rate; + double delay; + int zoom; + bool delayed; + bool paused; + bool enabled; + bool forced; + } status_data; + + status_data.id = monitor->Id(); + status_data.fps = monitor->GetFPS(); + status_data.state = monitor->shared_data->state; + if ( playback_buffer > 0 ) + status_data.buffer_level = (MOD_ADD( (temp_write_index-temp_read_index), 0, temp_image_buffer_count )*100)/temp_image_buffer_count; + else + status_data.buffer_level = 0; + status_data.delayed = delayed; + status_data.paused = paused; + status_data.rate = replay_rate; + status_data.delay = TV_2_FLOAT( now ) - TV_2_FLOAT( last_frame_timestamp ); + status_data.zoom = zoom; + //status_data.enabled = monitor->shared_data->active; + status_data.enabled = monitor->trigger_data->trigger_state!=Monitor::TRIGGER_OFF; + status_data.forced = monitor->trigger_data->trigger_state==Monitor::TRIGGER_ON; + Debug( 2, "L:%d, D:%d, P:%d, R:%d, d:%.3f, Z:%d, E:%d F:%d", + status_data.buffer_level, + status_data.delayed, + status_data.paused, + status_data.rate, + status_data.delay, + status_data.zoom, + status_data.enabled, + status_data.forced + ); + + DataMsg status_msg; + status_msg.msg_type = MSG_DATA_WATCH; + memcpy( &status_msg.msg_data, &status_data, sizeof(status_msg.msg_data) ); + int nbytes = 0; + if ( (nbytes = sendto( sd, &status_msg, sizeof(status_msg), MSG_DONTWAIT, (sockaddr *)&rem_addr, sizeof(rem_addr) )) < 0 ) + { + //if ( errno != EAGAIN ) + { + Error( "Can't sendto on sd %d: %s", sd, strerror(errno) ); + //exit( -1 ); + } + } + + updateFrameRate( monitor->GetFPS() ); +} + +bool MonitorStream::sendFrame( const char *filepath, struct timeval *timestamp ) +{ + bool send_raw = ((scale>=ZM_SCALE_BASE)&&(zoom==ZM_SCALE_BASE)); + + if ( type != STREAM_JPEG ) + send_raw = false; + if ( !config.timestamp_on_capture && timestamp ) + send_raw = false; + + if ( !send_raw ) + { + Image temp_image( filepath ); + + return( sendFrame( &temp_image, timestamp ) ); + } + else + { + int img_buffer_size = 0; + static unsigned char img_buffer[ZM_MAX_IMAGE_SIZE]; + + FILE *fdj = NULL; + if ( (fdj = fopen( filepath, "r" )) ) + { + img_buffer_size = fread( img_buffer, 1, sizeof(img_buffer), fdj ); + fclose( fdj ); + } + else + { + Error( "Can't open %s: %s", filepath, strerror(errno) ); + return( false ); + } + + // Calculate how long it takes to actually send the frame + struct timeval frameStartTime; + gettimeofday( &frameStartTime, NULL ); + + fprintf( stdout, "--ZoneMinderFrame\r\n" ); + fprintf( stdout, "Content-Length: %d\r\n", img_buffer_size ); + fprintf( stdout, "Content-Type: image/jpeg\r\n\r\n" ); + if ( fwrite( img_buffer, img_buffer_size, 1, stdout ) != 1 ) + { + if ( !zm_terminate ) + Error( "Unable to send stream frame: %s", strerror(errno) ); + return( false ); + } + fprintf( stdout, "\r\n\r\n" ); + fflush( stdout ); + + struct timeval frameEndTime; + gettimeofday( &frameEndTime, NULL ); + + int frameSendTime = tvDiffMsec( frameStartTime, frameEndTime ); + if ( frameSendTime > 1000/maxfps ) + { + maxfps /= 2; + Error( "Frame send time %d msec too slow, throttling maxfps to %.2f", frameSendTime, maxfps ); + } + + last_frame_sent = TV_2_FLOAT( now ); + + return( true ); + } + return( false ); +} + +bool MonitorStream::sendFrame( Image *image, struct timeval *timestamp ) +{ + Image *send_image = prepareImage( image ); + if ( !config.timestamp_on_capture && timestamp ) + monitor->TimestampImage( send_image, timestamp ); + +#if HAVE_LIBAVCODEC + if ( type == STREAM_MPEG ) + { + if ( !vid_stream ) + { + vid_stream = new VideoStream( "pipe:", format, bitrate, effective_fps, send_image->Colours(), send_image->SubpixelOrder(), send_image->Width(), send_image->Height() ); + fprintf( stdout, "Content-type: %s\r\n\r\n", vid_stream->MimeType() ); + vid_stream->OpenStream(); + } + static struct timeval base_time; + struct DeltaTimeval delta_time; + if ( !frame_count ) + base_time = *timestamp; + DELTA_TIMEVAL( delta_time, *timestamp, base_time, DT_PREC_3 ); + /* double pts = */ vid_stream->EncodeFrame( send_image->Buffer(), send_image->Size(), config.mpeg_timed_frames, delta_time.delta ); + } + else +#endif // HAVE_LIBAVCODEC + { + static unsigned char temp_img_buffer[ZM_MAX_IMAGE_SIZE]; + + int img_buffer_size = 0; + unsigned char *img_buffer = temp_img_buffer; + + // Calculate how long it takes to actually send the frame + struct timeval frameStartTime; + gettimeofday( &frameStartTime, NULL ); + + fprintf( stdout, "--ZoneMinderFrame\r\n" ); + switch( type ) + { + case STREAM_JPEG : + send_image->EncodeJpeg( img_buffer, &img_buffer_size ); + fprintf( stdout, "Content-Type: image/jpeg\r\n" ); + break; + case STREAM_RAW : + fprintf( stdout, "Content-Type: image/x-rgb\r\n" ); + img_buffer = (uint8_t*)send_image->Buffer(); + img_buffer_size = send_image->Size(); + break; + case STREAM_ZIP : + fprintf( stdout, "Content-Type: image/x-rgbz\r\n" ); + unsigned long zip_buffer_size; + send_image->Zip( img_buffer, &zip_buffer_size ); + img_buffer_size = zip_buffer_size; + break; + default : + Fatal( "Unexpected frame type %d", type ); + break; + } + fprintf( stdout, "Content-Length: %d\r\n\r\n", img_buffer_size ); + if ( fwrite( img_buffer, img_buffer_size, 1, stdout ) != 1 ) + { + if ( !zm_terminate ) + Error( "Unable to send stream frame: %s", strerror(errno) ); + return( false ); + } + fprintf( stdout, "\r\n\r\n" ); + fflush( stdout ); + + struct timeval frameEndTime; + gettimeofday( &frameEndTime, NULL ); + + int frameSendTime = tvDiffMsec( frameStartTime, frameEndTime ); + if ( frameSendTime > 1000/maxfps ) + { + maxfps /= 1.5; + Error( "Frame send time %d msec too slow, throttling maxfps to %.2f", frameSendTime, maxfps ); + } + } + last_frame_sent = TV_2_FLOAT( now ); + return( true ); +} + +void MonitorStream::runStream() +{ + if ( type == STREAM_SINGLE ) + { + // Not yet migrated over to stream class + monitor->SingleImage( scale ); + return; + } + + openComms(); + + checkInitialised(); + + updateFrameRate( monitor->GetFPS() ); + + if ( type == STREAM_JPEG ) + fprintf( stdout, "Content-Type: multipart/x-mixed-replace;boundary=ZoneMinderFrame\r\n\r\n" ); + + int last_read_index = monitor->image_buffer_count; + + time_t stream_start_time; + time( &stream_start_time ); + + frame_count = 0; + + temp_image_buffer = 0; + temp_image_buffer_count = playback_buffer; + temp_read_index = temp_image_buffer_count; + temp_write_index = temp_image_buffer_count; + + char swap_path[PATH_MAX] = ""; + bool buffered_playback = false; + + if ( connkey && playback_buffer > 0 ) + { + Debug( 2, "Checking swap image location" ); + Debug( 3, "Checking swap image path" ); + strncpy( swap_path, config.path_swap, sizeof(swap_path) ); + if ( checkSwapPath( swap_path, false ) ) + { + snprintf( &(swap_path[strlen(swap_path)]), sizeof(swap_path)-strlen(swap_path), "/zmswap-m%d", monitor->Id() ); + if ( checkSwapPath( swap_path, true ) ) + { + snprintf( &(swap_path[strlen(swap_path)]), sizeof(swap_path)-strlen(swap_path), "/zmswap-q%06d", connkey ); + if ( checkSwapPath( swap_path, true ) ) + { + buffered_playback = true; + } + } + } + + if ( !buffered_playback ) + { + Error( "Unable to validate swap image path, disabling buffered playback" ); + } + else + { + Debug( 2, "Assigning temporary buffer" ); + temp_image_buffer = new SwapImage[temp_image_buffer_count]; + memset( temp_image_buffer, 0, sizeof(*temp_image_buffer)*temp_image_buffer_count ); + Debug( 2, "Assigned temporary buffer" ); + } + } + + float max_secs_since_last_sent_frame = 10.0; //should be > keep alive amount (5 secs) + while ( !zm_terminate ) + { + bool got_command = false; + if ( feof( stdout ) || ferror( stdout ) || !monitor->ShmValid() ) + { + break; + } + + gettimeofday( &now, NULL ); + + if ( connkey ) + { + while(checkCommandQueue()) { + got_command = true; + } + } + + bool frame_sent = false; + if ( buffered_playback && delayed ) + { + if ( temp_read_index == temp_write_index ) + { + // Go back to live viewing + Debug( 1, "Exceeded temporary streaming buffer" ); + // Clear paused flag + paused = false; + // Clear delayed_play flag + delayed = false; + replay_rate = ZM_RATE_BASE; + } + else + { + if ( !paused ) + { + int temp_index = MOD_ADD( temp_read_index, 0, temp_image_buffer_count ); + //Debug( 3, "tri: %d, ti: %d", temp_read_index, temp_index ); + SwapImage *swap_image = &temp_image_buffer[temp_index]; + + if ( !swap_image->valid ) + { + paused = true; + delayed = true; + temp_read_index = MOD_ADD( temp_read_index, (replay_rate>=0?-1:1), temp_image_buffer_count ); + } + else + { + //Debug( 3, "siT: %f, lfT: %f", TV_2_FLOAT( swap_image->timestamp ), TV_2_FLOAT( last_frame_timestamp ) ); + double expected_delta_time = ((TV_2_FLOAT( swap_image->timestamp ) - TV_2_FLOAT( last_frame_timestamp )) * ZM_RATE_BASE)/replay_rate; + double actual_delta_time = TV_2_FLOAT( now ) - last_frame_sent; + + //Debug( 3, "eDT: %.3lf, aDT: %.3f, lFS:%.3f, NOW:%.3f", expected_delta_time, actual_delta_time, last_frame_sent, TV_2_FLOAT( now ) ); + // If the next frame is due + if ( actual_delta_time > expected_delta_time ) + { + //Debug( 2, "eDT: %.3lf, aDT: %.3f", expected_delta_time, actual_delta_time ); + if ( temp_index%frame_mod == 0 ) + { + Debug( 2, "Sending delayed frame %d", temp_index ); + // Send the next frame + if ( !sendFrame( temp_image_buffer[temp_index].file_name, &temp_image_buffer[temp_index].timestamp ) ) + zm_terminate = true; + memcpy( &last_frame_timestamp, &(swap_image->timestamp), sizeof(last_frame_timestamp) ); + frame_sent = true; + } + temp_read_index = MOD_ADD( temp_read_index, (replay_rate>0?1:-1), temp_image_buffer_count ); + } + } + } + else if ( step != 0 ) + { + temp_read_index = MOD_ADD( temp_read_index, (step>0?1:-1), temp_image_buffer_count ); + + SwapImage *swap_image = &temp_image_buffer[temp_read_index]; + + // Send the next frame + if ( !sendFrame( temp_image_buffer[temp_read_index].file_name, &temp_image_buffer[temp_read_index].timestamp ) ) + zm_terminate = true; + memcpy( &last_frame_timestamp, &(swap_image->timestamp), sizeof(last_frame_timestamp) ); + frame_sent = true; + step = 0; + } + else + { + int temp_index = MOD_ADD( temp_read_index, 0, temp_image_buffer_count ); + + double actual_delta_time = TV_2_FLOAT( now ) - last_frame_sent; + if ( got_command || actual_delta_time > 5 ) + { + // Send keepalive + Debug( 2, "Sending keepalive frame %d", temp_index ); + // Send the next frame + if ( !sendFrame( temp_image_buffer[temp_index].file_name, &temp_image_buffer[temp_index].timestamp ) ) + zm_terminate = true; + frame_sent = true; + } + } + } + if ( temp_read_index == temp_write_index ) + { + // Go back to live viewing + Warning( "Rewound over write index, resuming live play" ); + // Clear paused flag + paused = false; + // Clear delayed_play flag + delayed = false; + replay_rate = ZM_RATE_BASE; + } + } + if ( last_read_index != monitor->shared_data->last_write_index ) + { + int index = monitor->shared_data->last_write_index%monitor->image_buffer_count; + last_read_index = monitor->shared_data->last_write_index; + //Debug( 1, "%d: %x - %x", index, image_buffer[index].image, image_buffer[index].image->buffer ); + if ( (frame_mod == 1) || ((frame_count%frame_mod) == 0) ) + { + if ( !paused && !delayed ) + { + // Send the next frame + Monitor::Snapshot *snap = &monitor->image_buffer[index]; + + if ( !sendFrame( snap->image, snap->timestamp ) ) + zm_terminate = true; + memcpy( &last_frame_timestamp, snap->timestamp, sizeof(last_frame_timestamp) ); + frame_sent = true; + + temp_read_index = temp_write_index; + } + } + if ( buffered_playback ) + { + if ( monitor->shared_data->valid ) + { + if ( monitor->image_buffer[index].timestamp->tv_sec ) + { + int temp_index = temp_write_index%temp_image_buffer_count; + Debug( 2, "Storing frame %d", temp_index ); + if ( !temp_image_buffer[temp_index].valid ) + { + snprintf( temp_image_buffer[temp_index].file_name, sizeof(temp_image_buffer[0].file_name), "%s/zmswap-i%05d.jpg", swap_path, temp_index ); + temp_image_buffer[temp_index].valid = true; + } + memcpy( &(temp_image_buffer[temp_index].timestamp), monitor->image_buffer[index].timestamp, sizeof(temp_image_buffer[0].timestamp) ); + monitor->image_buffer[index].image->WriteJpeg( temp_image_buffer[temp_index].file_name, config.jpeg_file_quality ); + temp_write_index = MOD_ADD( temp_write_index, 1, temp_image_buffer_count ); + if ( temp_write_index == temp_read_index ) + { + // Go back to live viewing + Warning( "Exceeded temporary buffer, resuming live play" ); + // Clear paused flag + paused = false; + // Clear delayed_play flag + delayed = false; + replay_rate = ZM_RATE_BASE; + } + } + else + { + Warning( "Unable to store frame as timestamp invalid" ); + } + } + else + { + Warning( "Unable to store frame as shared memory invalid" ); + } + } + frame_count++; + } + usleep( (unsigned long)((1000000 * ZM_RATE_BASE)/((base_fps?base_fps:1)*abs(replay_rate*2))) ); + if ( ttl ) + { + if ( (now.tv_sec - stream_start_time) > ttl ) + { + break; + } + } + if ( (TV_2_FLOAT( now ) - last_frame_sent) > max_secs_since_last_sent_frame ) + { + Error( "Terminating, last frame sent time %f secs more than maximum of %f", TV_2_FLOAT( now ) - last_frame_sent, max_secs_since_last_sent_frame ); + break; + } + } + if ( buffered_playback ) + { + char swap_path[PATH_MAX] = ""; + + snprintf( swap_path, sizeof(swap_path), "%s/zmswap-m%d/zmswap-q%06d", config.path_swap, monitor->Id(), connkey ); + Debug( 1, "Cleaning swap files from %s", swap_path ); + struct stat stat_buf; + if ( stat( swap_path, &stat_buf ) < 0 ) + { + if ( errno != ENOENT ) + { + Error( "Can't stat '%s': %s", swap_path, strerror(errno) ); + } + } + else if ( !S_ISDIR(stat_buf.st_mode) ) + { + Error( "Swap image path '%s' is not a directory", swap_path ); + } + else + { + char glob_pattern[PATH_MAX] = ""; + + snprintf( glob_pattern, sizeof(glob_pattern), "%s/*.*", swap_path ); + glob_t pglob; + int glob_status = glob( glob_pattern, 0, 0, &pglob ); + if ( glob_status != 0 ) + { + if ( glob_status < 0 ) + { + Error( "Can't glob '%s': %s", glob_pattern, strerror(errno) ); + } + else + { + Debug( 1, "Can't glob '%s': %d", glob_pattern, glob_status ); + } + } + else + { + for ( int i = 0; i < pglob.gl_pathc; i++ ) + { + if ( unlink( pglob.gl_pathv[i] ) < 0 ) + { + Error( "Can't unlink '%s': %s", pglob.gl_pathv[i], strerror(errno) ); + } + } + } + globfree( &pglob ); + if ( rmdir( swap_path ) < 0 ) + { + Error( "Can't rmdir '%s': %s", swap_path, strerror(errno) ); + } + } + } + closeComms(); +} + +void Monitor::SingleImage( int scale) +{ + int img_buffer_size = 0; + static JOCTET img_buffer[ZM_MAX_IMAGE_SIZE]; + Image scaled_image; + int index = shared_data->last_write_index%image_buffer_count; + Snapshot *snap = &image_buffer[index]; + Image *snap_image = snap->image; + + if ( scale != ZM_SCALE_BASE ) + { + scaled_image.Assign( *snap_image ); + scaled_image.Scale( scale ); + snap_image = &scaled_image; + } + if ( !config.timestamp_on_capture ) + { + TimestampImage( snap_image, snap->timestamp ); + } + snap_image->EncodeJpeg( img_buffer, &img_buffer_size ); + + fprintf( stdout, "Content-Length: %d\r\n", img_buffer_size ); + fprintf( stdout, "Content-Type: image/jpeg\r\n\r\n" ); + fwrite( img_buffer, img_buffer_size, 1, stdout ); +} + +void Monitor::SingleImageRaw( int scale) +{ + Image scaled_image; + int index = shared_data->last_write_index%image_buffer_count; + Snapshot *snap = &image_buffer[index]; + Image *snap_image = snap->image; + + if ( scale != ZM_SCALE_BASE ) + { + scaled_image.Assign( *snap_image ); + scaled_image.Scale( scale ); + snap_image = &scaled_image; + } + if ( !config.timestamp_on_capture ) + { + TimestampImage( snap_image, snap->timestamp ); + } + + fprintf( stdout, "Content-Length: %d\r\n", snap_image->Size() ); + fprintf( stdout, "Content-Type: image/x-rgb\r\n\r\n" ); + fwrite( snap_image->Buffer(), snap_image->Size(), 1, stdout ); +} + +void Monitor::SingleImageZip( int scale) +{ + unsigned long img_buffer_size = 0; + static Bytef img_buffer[ZM_MAX_IMAGE_SIZE]; + Image scaled_image; + int index = shared_data->last_write_index%image_buffer_count; + Snapshot *snap = &image_buffer[index]; + Image *snap_image = snap->image; + + if ( scale != ZM_SCALE_BASE ) + { + scaled_image.Assign( *snap_image ); + scaled_image.Scale( scale ); + snap_image = &scaled_image; + } + if ( !config.timestamp_on_capture ) + { + TimestampImage( snap_image, snap->timestamp ); + } + snap_image->Zip( img_buffer, &img_buffer_size ); + + fprintf( stdout, "Content-Length: %ld\r\n", img_buffer_size ); + fprintf( stdout, "Content-Type: image/x-rgbz\r\n\r\n" ); + fwrite( img_buffer, img_buffer_size, 1, stdout ); +} diff --git a/src/zm_monitor.h b/src/zm_monitor.h new file mode 100644 index 000000000..8fdcea8cd --- /dev/null +++ b/src/zm_monitor.h @@ -0,0 +1,477 @@ +// +// ZoneMinder Monitor Class Interfaces, $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. +// + +#ifndef ZM_MONITOR_H +#define ZM_MONITOR_H + +#include +#include + + +#include "zm.h" +#include "zm_coord.h" +#include "zm_image.h" +#include "zm_rgb.h" +#include "zm_zone.h" +#include "zm_event.h" +#include "zm_camera.h" +#include "zm_plugin_manager.h" +#include "zm_image_analyser.h" + +#include +#include + +#define SIGNAL_CAUSE "Signal" +#define MOTION_CAUSE "Motion" +#define LINKED_CAUSE "Linked" + +// +// This is the main class for monitors. Each monitor is associated +// with a camera and is effectively a collector for events. +// +class Monitor +{ +friend class MonitorStream; + +public: + typedef enum + { + QUERY=0, + CAPTURE, + ANALYSIS + } Purpose; + + typedef enum + { + NONE=1, + MONITOR, + MODECT, + RECORD, + MOCORD, + NODECT + } Function; + + typedef enum + { + ROTATE_0=1, + ROTATE_90, + ROTATE_180, + ROTATE_270, + FLIP_HORI, + FLIP_VERT + } Orientation; + + typedef enum + { + IDLE, + PREALARM, + ALARM, + ALERT, + TAPE + } State; + +protected: + typedef std::set ZoneSet; + + typedef enum { GET_SETTINGS=0x1, SET_SETTINGS=0x2, RELOAD=0x4, SUSPEND=0x10, RESUME=0x20 } Action; + + typedef enum { CLOSE_TIME, CLOSE_IDLE, CLOSE_ALARM } EventCloseMode; + + /* sizeof(SharedData) expected to be 336 bytes on 32bit and 64bit */ + typedef struct + { + uint32_t size; /* +0 */ + uint32_t last_write_index; /* +4 */ + uint32_t last_read_index; /* +8 */ + uint32_t state; /* +12 */ + uint32_t last_event; /* +16 */ + uint32_t action; /* +20 */ + int32_t brightness; /* +24 */ + int32_t hue; /* +28 */ + int32_t colour; /* +32 */ + int32_t contrast; /* +36 */ + int32_t alarm_x; /* +40 */ + int32_t alarm_y; /* +44 */ + uint8_t valid; /* +48 */ + uint8_t active; /* +49 */ + uint8_t signal; /* +50 */ + uint8_t format; /* +51 */ + uint32_t imagesize; /* +52 */ + uint32_t epadding1; /* +56 */ + uint32_t epadding2; /* +60 */ + /* + ** This keeps 32bit time_t and 64bit time_t identical and compatible as long as time is before 2038. + ** Shared memory layout should be identical for both 32bit and 64bit and is multiples of 16. + */ + union { /* +64 */ + time_t last_write_time; + uint64_t extrapad1; + }; + union { /* +72 */ + time_t last_read_time; + uint64_t extrapad2; + }; + uint8_t control_state[256]; /* +80 */ + + } SharedData; + + typedef enum { TRIGGER_CANCEL, TRIGGER_ON, TRIGGER_OFF } TriggerState; + + /* sizeof(TriggerData) expected to be 560 on 32bit & and 64bit */ + typedef struct + { + uint32_t size; + uint32_t trigger_state; + uint32_t trigger_score; + uint32_t padding; + char trigger_cause[32]; + char trigger_text[256]; + char trigger_showtext[256]; + } TriggerData; + + /* sizeof(Snapshot) expected to be 16 bytes on 32bit and 32 bytes on 64bit */ + struct Snapshot + { + struct timeval *timestamp; + Image *image; + void* padding; + }; + + //========================================================================= + PluginManager ThePluginManager; + std::vector m_sPluginNames; + //int iDoNativeMotDet; + + + class MonitorLink + { + protected: + unsigned int id; + char name[64]; + + bool connected; + time_t last_connect_time; + +#if ZM_MEM_MAPPED + int map_fd; + char mem_file[PATH_MAX]; +#else // ZM_MEM_MAPPED + int shm_id; +#endif // ZM_MEM_MAPPED + int mem_size; + unsigned char *mem_ptr; + + volatile SharedData *shared_data; + volatile TriggerData *trigger_data; + + int last_state; + int last_event; + + public: + MonitorLink( int p_id, const char *p_name ); + ~MonitorLink(); + + inline int Id() const + { + return( id ); + } + inline const char *Name() const + { + return( name ); + } + + inline bool isConnected() const + { + return( connected ); + } + inline time_t getLastConnectTime() const + { + return( last_connect_time ); + } + + bool connect(); + bool disconnect(); + + bool isAlarmed(); + bool inAlarm(); + bool hasAlarmed(); + }; + +protected: + // These are read from the DB and thereafter remain unchanged + unsigned int id; + char name[64]; + Function function; // What the monitor is doing + bool enabled; // Whether the monitor is enabled or asleep + unsigned int width; // Normally the same as the camera, but not if partly rotated + unsigned int height; // Normally the same as the camera, but not if partly rotated + Orientation orientation; // Whether the image has to be rotated at all + unsigned int deinterlacing; + int brightness; // The statically saved brightness of the camera + int contrast; // The statically saved contrast of the camera + int hue; // The statically saved hue of the camera + int colour; // The statically saved colour of the camera + char event_prefix[64]; // The prefix applied to event names as they are created + char label_format[64]; // The format of the timestamp on the images + Coord label_coord; // The coordinates of the timestamp on the images + int image_buffer_count; // Size of circular image buffer, at least twice the size of the pre_event_count + int warmup_count; // How many images to process before looking for events + int pre_event_count; // How many images to hold and prepend to an alarm event + int post_event_count; // How many unalarmed images must occur before the alarm state is reset + int stream_replay_buffer; // How many frames to store to support DVR functions, IGNORED from this object, passed directly into zms now + int section_length; // How long events should last in continuous modes + int frame_skip; // How many frames to skip in continuous modes + int capture_delay; // How long we wait between capture frames + int alarm_capture_delay; // How long we wait between capture frames when in alarm state + int alarm_frame_count; // How many alarm frames are required before an event is triggered + int fps_report_interval; // How many images should be captured/processed between reporting the current FPS + int ref_blend_perc; // Percentage of new image going into reference image. + bool track_motion; // Whether this monitor tries to track detected motion + Rgb signal_check_colour; // The colour that the camera will emit when no video signal detected + + double fps; + Image delta_image; + Image ref_image; + + Purpose purpose; // What this monitor has been created to do + int event_count; + int image_count; + int ready_count; + int first_alarm_count; + int last_alarm_count; + int buffer_count; + int prealarm_count; + State state; + time_t start_time; + time_t last_fps_time; + time_t auto_resume_time; + + EventCloseMode event_close_mode; + +#if ZM_MEM_MAPPED + int map_fd; + char mem_file[PATH_MAX]; +#else // ZM_MEM_MAPPED + int shm_id; +#endif // ZM_MEM_MAPPED + int mem_size; + unsigned char *mem_ptr; + + SharedData *shared_data; + TriggerData *trigger_data; + + Snapshot *image_buffer; + Snapshot next_buffer; /* Used by four field deinterlacing */ + + Camera *camera; + + Event *event; + + int n_zones; + Zone **zones; + + int iDoNativeMotDet; + + + int n_linked_monitors; + MonitorLink **linked_monitors; + +public: +// OurCheckAlarms seems to be unused. Check it on zm_monitor.cpp for more info. +//bool OurCheckAlarms( Zone *zone, const Image *pImage ); + Monitor( int p_id, const char *p_name, int p_function, bool p_enabled, const char *p_linked_monitors, Camera *p_camera, int p_orientation, unsigned int p_deinterlacing, const char *p_event_prefix, const char *p_label_format, const Coord &p_label_coord, int p_image_buffer_count, int p_warmup_count, int p_pre_event_count, int p_post_event_count, int p_stream_replay_buffer, int p_alarm_frame_count, int p_section_length, int p_frame_skip, int p_capture_delay, int p_alarm_capture_delay, int p_fps_report_interval, int p_ref_blend_perc, bool p_track_motion, Rgb p_signal_check_colour, Purpose p_purpose, int p_n_zones=0, Zone *p_zones[]=0, std::string plugins = "", int p_DoNativeMotDect = 1 ); + ~Monitor(); + + void AddZones( int p_n_zones, Zone *p_zones[] ); + + inline int ShmValid() const + { + return( shared_data->valid ); + } + + inline int Id() const + { + return( id ); + } + inline const char *Name() const + { + return( name ); + } + inline Function GetFunction() const + { + return( function ); + } + inline bool Enabled() + { + if ( function <= MONITOR ) + return( false ); + return( enabled ); + } + inline const char *EventPrefix() const + { + return( event_prefix ); + } + inline bool Ready() + { + if ( function <= MONITOR ) + return( false ); + return( image_count > ready_count ); + } + inline bool Active() + { + if ( function <= MONITOR ) + return( false ); + return( enabled && shared_data->active ); + } + + unsigned int Width() const { return( width ); } + unsigned int Height() const { return( height ); } + unsigned int Colours() const { return( camera->Colours() ); } + unsigned int SubpixelOrder() const { return( camera->SubpixelOrder() ); } + + + State GetState() const; + int GetImage( int index=-1, int scale=100 ) const; + struct timeval GetTimestamp( int index=-1 ) const; + int GetCaptureDelay() const { return( capture_delay ); } + int GetAlarmCaptureDelay() const { return( alarm_capture_delay ); } + unsigned int GetLastReadIndex() const; + unsigned int GetLastWriteIndex() const; + unsigned int GetLastEvent() const; + double GetFPS() const; + void ForceAlarmOn( int force_score, const char *force_case, const char *force_text="" ); + void ForceAlarmOff(); + void CancelForced(); + TriggerState GetTriggerState() const { return( (TriggerState)(trigger_data?trigger_data->trigger_state:TRIGGER_CANCEL )); } + + void actionReload(); + void actionEnable(); + void actionDisable(); + void actionSuspend(); + void actionResume(); + + int actionBrightness( int p_brightness=-1 ); + int actionHue( int p_hue=-1 ); + int actionColour( int p_colour=-1 ); + int actionContrast( int p_contrast=-1 ); + + inline int PrimeCapture() + { + return( camera->PrimeCapture() ); + } + inline int PreCapture() + { + return( camera->PreCapture() ); + } + int Capture(); + int PostCapture() + { + return( camera->PostCapture() ); + } + + unsigned int DetectMotion( const Image &comp_image, Event::StringSet &zoneSet ); + // DetectBlack seems to be unused. Check it on zm_monitor.cpp for more info. + //unsigned int DetectBlack( const Image &comp_image, Event::StringSet &zoneSet ); + bool CheckSignal( const Image *image ); + bool Analyse(); + void DumpImage( Image *dump_image ) const; + void TimestampImage( Image *ts_image, const struct timeval *ts_time ) const; + bool closeEvent(); + + void Reload(); + void ReloadZones(); + void ReloadLinkedMonitors( const char * ); + + bool DumpSettings( char *output, bool verbose ); + void DumpZoneImage( const char *zone_string=0 ); + +#if ZM_HAS_V4L + static int LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose purpose ); +#endif // ZM_HAS_V4L + static int LoadRemoteMonitors( const char *protocol, const char *host, const char*port, const char*path, Monitor **&monitors, Purpose purpose ); + static int LoadFileMonitors( const char *file, Monitor **&monitors, Purpose purpose ); +#if HAVE_LIBAVFORMAT + static int LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose purpose ); +#endif // HAVE_LIBAVFORMAT + static Monitor *Load( int id, bool load_zones, Purpose purpose ); + //void writeStreamImage( Image *image, struct timeval *timestamp, int scale, int mag, int x, int y ); + //void StreamImages( int scale=100, int maxfps=10, time_t ttl=0, int msq_id=0 ); + //void StreamImagesRaw( int scale=100, int maxfps=10, time_t ttl=0 ); + //void StreamImagesZip( int scale=100, int maxfps=10, time_t ttl=0 ); + void SingleImage( int scale=100 ); + void SingleImageRaw( int scale=100 ); + void SingleImageZip( int scale=100 ); +#if HAVE_LIBAVCODEC + //void StreamMpeg( const char *format, int scale=100, int maxfps=10, int bitrate=100000 ); +#endif // HAVE_LIBAVCODEC +}; + +#define MOD_ADD( var, delta, limit ) (((var)+(limit)+(delta))%(limit)) + +class MonitorStream : public StreamBase +{ +protected: + typedef struct SwapImage { + bool valid; + struct timeval timestamp; + char file_name[PATH_MAX]; + } SwapImage; + +private: + SwapImage *temp_image_buffer; + int temp_image_buffer_count; + int temp_read_index; + int temp_write_index; + +protected: + time_t ttl; + +protected: + int playback_buffer; + bool delayed; + + int frame_count; + +protected: + bool checkSwapPath( const char *path, bool create_path ); + + bool sendFrame( const char *filepath, struct timeval *timestamp ); + bool sendFrame( Image *image, struct timeval *timestamp ); + void processCommand( const CmdMsg *msg ); + +public: + MonitorStream() : playback_buffer( 0 ), delayed( false ), frame_count( 0 ) + { + } + void setStreamBuffer( int p_playback_buffer ) + { + playback_buffer = p_playback_buffer; + } + void setStreamTTL( time_t p_ttl ) + { + ttl = p_ttl; + } + void setStreamStart( int monitor_id ) + { + loadMonitor( monitor_id ); + } + void runStream(); +}; + +#endif // ZM_MONITOR_H diff --git a/src/zm_monitor.h.orig b/src/zm_monitor.h.orig new file mode 100644 index 000000000..cbc5d75ff --- /dev/null +++ b/src/zm_monitor.h.orig @@ -0,0 +1,458 @@ +// +// ZoneMinder Monitor Class Interfaces, $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. +// + +#ifndef ZM_MONITOR_H +#define ZM_MONITOR_H + +#include "zm.h" +#include "zm_coord.h" +#include "zm_image.h" +#include "zm_rgb.h" +#include "zm_zone.h" +#include "zm_event.h" +#include "zm_camera.h" + +#include +#include + +#define SIGNAL_CAUSE "Signal" +#define MOTION_CAUSE "Motion" +#define LINKED_CAUSE "Linked" + +// +// This is the main class for monitors. Each monitor is associated +// with a camera and is effectively a collector for events. +// +class Monitor +{ +friend class MonitorStream; + +public: + typedef enum + { + QUERY=0, + CAPTURE, + ANALYSIS + } Purpose; + + typedef enum + { + NONE=1, + MONITOR, + MODECT, + RECORD, + MOCORD, + NODECT + } Function; + + typedef enum + { + ROTATE_0=1, + ROTATE_90, + ROTATE_180, + ROTATE_270, + FLIP_HORI, + FLIP_VERT + } Orientation; + + typedef enum + { + IDLE, + PREALARM, + ALARM, + ALERT, + TAPE + } State; + +protected: + typedef std::set ZoneSet; + + typedef enum { GET_SETTINGS=0x1, SET_SETTINGS=0x2, RELOAD=0x4, SUSPEND=0x10, RESUME=0x20 } Action; + + typedef enum { CLOSE_TIME, CLOSE_IDLE, CLOSE_ALARM } EventCloseMode; + + /* sizeof(SharedData) expected to be 336 bytes on 32bit and 64bit */ + typedef struct + { + uint32_t size; /* +0 */ + uint32_t last_write_index; /* +4 */ + uint32_t last_read_index; /* +8 */ + uint32_t state; /* +12 */ + uint32_t last_event; /* +16 */ + uint32_t action; /* +20 */ + int32_t brightness; /* +24 */ + int32_t hue; /* +28 */ + int32_t colour; /* +32 */ + int32_t contrast; /* +36 */ + int32_t alarm_x; /* +40 */ + int32_t alarm_y; /* +44 */ + uint8_t valid; /* +48 */ + uint8_t active; /* +49 */ + uint8_t signal; /* +50 */ + uint8_t format; /* +51 */ + uint32_t imagesize; /* +52 */ + uint32_t epadding1; /* +56 */ + uint32_t epadding2; /* +60 */ + /* + ** This keeps 32bit time_t and 64bit time_t identical and compatible as long as time is before 2038. + ** Shared memory layout should be identical for both 32bit and 64bit and is multiples of 16. + */ + union { /* +64 */ + time_t last_write_time; + uint64_t extrapad1; + }; + union { /* +72 */ + time_t last_read_time; + uint64_t extrapad2; + }; + uint8_t control_state[256]; /* +80 */ + + } SharedData; + + typedef enum { TRIGGER_CANCEL, TRIGGER_ON, TRIGGER_OFF } TriggerState; + + /* sizeof(TriggerData) expected to be 560 on 32bit & and 64bit */ + typedef struct + { + uint32_t size; + uint32_t trigger_state; + uint32_t trigger_score; + uint32_t padding; + char trigger_cause[32]; + char trigger_text[256]; + char trigger_showtext[256]; + } TriggerData; + + /* sizeof(Snapshot) expected to be 16 bytes on 32bit and 32 bytes on 64bit */ + struct Snapshot + { + struct timeval *timestamp; + Image *image; + void* padding; + }; + + class MonitorLink + { + protected: + unsigned int id; + char name[64]; + + bool connected; + time_t last_connect_time; + +#if ZM_MEM_MAPPED + int map_fd; + char mem_file[PATH_MAX]; +#else // ZM_MEM_MAPPED + int shm_id; +#endif // ZM_MEM_MAPPED + int mem_size; + unsigned char *mem_ptr; + + volatile SharedData *shared_data; + volatile TriggerData *trigger_data; + + int last_state; + int last_event; + + public: + MonitorLink( int p_id, const char *p_name ); + ~MonitorLink(); + + inline int Id() const + { + return( id ); + } + inline const char *Name() const + { + return( name ); + } + + inline bool isConnected() const + { + return( connected ); + } + inline time_t getLastConnectTime() const + { + return( last_connect_time ); + } + + bool connect(); + bool disconnect(); + + bool isAlarmed(); + bool inAlarm(); + bool hasAlarmed(); + }; + +protected: + // These are read from the DB and thereafter remain unchanged + unsigned int id; + char name[64]; + Function function; // What the monitor is doing + bool enabled; // Whether the monitor is enabled or asleep + unsigned int width; // Normally the same as the camera, but not if partly rotated + unsigned int height; // Normally the same as the camera, but not if partly rotated + Orientation orientation; // Whether the image has to be rotated at all + unsigned int deinterlacing; + int brightness; // The statically saved brightness of the camera + int contrast; // The statically saved contrast of the camera + int hue; // The statically saved hue of the camera + int colour; // The statically saved colour of the camera + char event_prefix[64]; // The prefix applied to event names as they are created + char label_format[64]; // The format of the timestamp on the images + Coord label_coord; // The coordinates of the timestamp on the images + int image_buffer_count; // Size of circular image buffer, at least twice the size of the pre_event_count + int warmup_count; // How many images to process before looking for events + int pre_event_count; // How many images to hold and prepend to an alarm event + int post_event_count; // How many unalarmed images must occur before the alarm state is reset + int stream_replay_buffer; // How many frames to store to support DVR functions, IGNORED from this object, passed directly into zms now + int section_length; // How long events should last in continuous modes + int frame_skip; // How many frames to skip in continuous modes + int capture_delay; // How long we wait between capture frames + int alarm_capture_delay; // How long we wait between capture frames when in alarm state + int alarm_frame_count; // How many alarm frames are required before an event is triggered + int fps_report_interval; // How many images should be captured/processed between reporting the current FPS + int ref_blend_perc; // Percentage of new image going into reference image. + bool track_motion; // Whether this monitor tries to track detected motion + Rgb signal_check_colour; // The colour that the camera will emit when no video signal detected + + double fps; + Image delta_image; + Image ref_image; + + Purpose purpose; // What this monitor has been created to do + int event_count; + int image_count; + int ready_count; + int first_alarm_count; + int last_alarm_count; + int buffer_count; + int prealarm_count; + State state; + time_t start_time; + time_t last_fps_time; + time_t auto_resume_time; + + EventCloseMode event_close_mode; + +#if ZM_MEM_MAPPED + int map_fd; + char mem_file[PATH_MAX]; +#else // ZM_MEM_MAPPED + int shm_id; +#endif // ZM_MEM_MAPPED + int mem_size; + unsigned char *mem_ptr; + + SharedData *shared_data; + TriggerData *trigger_data; + + Snapshot *image_buffer; + Snapshot next_buffer; /* Used by four field deinterlacing */ + + Camera *camera; + + Event *event; + + int n_zones; + Zone **zones; + + int n_linked_monitors; + MonitorLink **linked_monitors; + +public: + Monitor( int p_id, const char *p_name, int p_function, bool p_enabled, const char *p_linked_monitors, Camera *p_camera, int p_orientation, unsigned int p_deinterlacing, const char *p_event_prefix, const char *p_label_format, const Coord &p_label_coord, int p_image_buffer_count, int p_warmup_count, int p_pre_event_count, int p_post_event_count, int p_stream_replay_buffer, int p_alarm_frame_count, int p_section_length, int p_frame_skip, int p_capture_delay, int p_alarm_capture_delay, int p_fps_report_interval, int p_ref_blend_perc, bool p_track_motion, Rgb p_signal_check_colour, Purpose p_purpose, int p_n_zones=0, Zone *p_zones[]=0 ); + ~Monitor(); + + void AddZones( int p_n_zones, Zone *p_zones[] ); + + inline int ShmValid() const + { + return( shared_data->valid ); + } + + inline int Id() const + { + return( id ); + } + inline const char *Name() const + { + return( name ); + } + inline Function GetFunction() const + { + return( function ); + } + inline bool Enabled() + { + if ( function <= MONITOR ) + return( false ); + return( enabled ); + } + inline const char *EventPrefix() const + { + return( event_prefix ); + } + inline bool Ready() + { + if ( function <= MONITOR ) + return( false ); + return( image_count > ready_count ); + } + inline bool Active() + { + if ( function <= MONITOR ) + return( false ); + return( enabled && shared_data->active ); + } + + unsigned int Width() const { return( width ); } + unsigned int Height() const { return( height ); } + unsigned int Colours() const { return( camera->Colours() ); } + unsigned int SubpixelOrder() const { return( camera->SubpixelOrder() ); } + + + State GetState() const; + int GetImage( int index=-1, int scale=100 ) const; + struct timeval GetTimestamp( int index=-1 ) const; + int GetCaptureDelay() const { return( capture_delay ); } + int GetAlarmCaptureDelay() const { return( alarm_capture_delay ); } + unsigned int GetLastReadIndex() const; + unsigned int GetLastWriteIndex() const; + unsigned int GetLastEvent() const; + double GetFPS() const; + void ForceAlarmOn( int force_score, const char *force_case, const char *force_text="" ); + void ForceAlarmOff(); + void CancelForced(); + TriggerState GetTriggerState() const { return( (TriggerState)(trigger_data?trigger_data->trigger_state:TRIGGER_CANCEL )); } + + void actionReload(); + void actionEnable(); + void actionDisable(); + void actionSuspend(); + void actionResume(); + + int actionBrightness( int p_brightness=-1 ); + int actionHue( int p_hue=-1 ); + int actionColour( int p_colour=-1 ); + int actionContrast( int p_contrast=-1 ); + + inline int PrimeCapture() + { + return( camera->PrimeCapture() ); + } + inline int PreCapture() + { + return( camera->PreCapture() ); + } + int Capture(); + int PostCapture() + { + return( camera->PostCapture() ); + } + + unsigned int DetectMotion( const Image &comp_image, Event::StringSet &zoneSet ); + bool CheckSignal( const Image *image ); + bool Analyse(); + void DumpImage( Image *dump_image ) const; + void TimestampImage( Image *ts_image, const struct timeval *ts_time ) const; + bool closeEvent(); + + void Reload(); + void ReloadZones(); + void ReloadLinkedMonitors( const char * ); + + bool DumpSettings( char *output, bool verbose ); + void DumpZoneImage( const char *zone_string=0 ); + +#if ZM_HAS_V4L + static int LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose purpose ); +#endif // ZM_HAS_V4L + static int LoadRemoteMonitors( const char *protocol, const char *host, const char*port, const char*path, Monitor **&monitors, Purpose purpose ); + static int LoadFileMonitors( const char *file, Monitor **&monitors, Purpose purpose ); +#if HAVE_LIBAVFORMAT + static int LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose purpose ); +#endif // HAVE_LIBAVFORMAT + static Monitor *Load( int id, bool load_zones, Purpose purpose ); + //void writeStreamImage( Image *image, struct timeval *timestamp, int scale, int mag, int x, int y ); + //void StreamImages( int scale=100, int maxfps=10, time_t ttl=0, int msq_id=0 ); + //void StreamImagesRaw( int scale=100, int maxfps=10, time_t ttl=0 ); + //void StreamImagesZip( int scale=100, int maxfps=10, time_t ttl=0 ); + void SingleImage( int scale=100 ); + void SingleImageRaw( int scale=100 ); + void SingleImageZip( int scale=100 ); +#if HAVE_LIBAVCODEC + //void StreamMpeg( const char *format, int scale=100, int maxfps=10, int bitrate=100000 ); +#endif // HAVE_LIBAVCODEC +}; + +#define MOD_ADD( var, delta, limit ) (((var)+(limit)+(delta))%(limit)) + +class MonitorStream : public StreamBase +{ +protected: + typedef struct SwapImage { + bool valid; + struct timeval timestamp; + char file_name[PATH_MAX]; + } SwapImage; + +private: + SwapImage *temp_image_buffer; + int temp_image_buffer_count; + int temp_read_index; + int temp_write_index; + +protected: + time_t ttl; + +protected: + int playback_buffer; + bool delayed; + + int frame_count; + +protected: + bool checkSwapPath( const char *path, bool create_path ); + + bool sendFrame( const char *filepath, struct timeval *timestamp ); + bool sendFrame( Image *image, struct timeval *timestamp ); + void processCommand( const CmdMsg *msg ); + +public: + MonitorStream() : playback_buffer( 0 ), delayed( false ), frame_count( 0 ) + { + } + void setStreamBuffer( int p_playback_buffer ) + { + playback_buffer = p_playback_buffer; + } + void setStreamTTL( time_t p_ttl ) + { + ttl = p_ttl; + } + void setStreamStart( int monitor_id ) + { + loadMonitor( monitor_id ); + } + void runStream(); +}; + +#endif // ZM_MONITOR_H diff --git a/src/zm_mpeg.cpp b/src/zm_mpeg.cpp new file mode 100644 index 000000000..3c453ba39 --- /dev/null +++ b/src/zm_mpeg.cpp @@ -0,0 +1,486 @@ +/* + * ZoneMinder MPEG class implementation, $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. +*/ + +#include +#include + +#include "zm.h" +#include "zm_rgb.h" +#include "zm_mpeg.h" + +#if HAVE_LIBAVCODEC + + +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(54, 1, 0) +static int encode_frame(AVCodecContext *c, AVFrame *frame) +{ + AVPacket pkt = { 0 }; + int ret, got_output; + + av_init_packet(&pkt); + av_init_packet(&pkt); + ret = avcodec_encode_video2(c, &pkt, frame, &got_output); + if (ret < 0) + return ret; + + ret = pkt.size; + av_free_packet(&pkt); + return ret; +} +#endif + +bool VideoStream::initialised = false; + +VideoStream::MimeData VideoStream::mime_data[] = { + { "asf", "video/x-ms-asf" }, + { "swf", "application/x-shockwave-flash" }, + { "flv", "video/x-flv" }, + { "mp4", "video/mp4" }, + { "move", "video/quicktime" } +}; + +void VideoStream::Initialise() +{ + av_register_all(); + initialised = true; +} + +void VideoStream::SetupFormat( const char *p_filename, const char *p_format ) +{ + filename = p_filename; + format = p_format; + + /* auto detect the output format from the name. default is mpeg. */ + of = av_guess_format( format, NULL, NULL); + if ( !of ) + { + Warning( "Could not deduce output format from file extension: using mpeg" ); + of = av_guess_format("mpeg", NULL, NULL); + } + if ( !of ) + { + Fatal( "Could not find suitable output format" ); + } + + /* allocate the output media context */ + ofc = (AVFormatContext *)av_mallocz(sizeof(AVFormatContext)); + if ( !ofc ) + { + Panic( "Memory error" ); + } + ofc->oformat = of; + snprintf( ofc->filename, sizeof(ofc->filename), "%s", filename ); +} + +void VideoStream::SetupCodec( int colours, int subpixelorder, int width, int height, int bitrate, double frame_rate ) +{ + /* ffmpeg format matching */ + switch(colours) { + case ZM_COLOUR_RGB24: + { + if(subpixelorder == ZM_SUBPIX_ORDER_BGR) { + /* BGR subpixel order */ + pf = PIX_FMT_BGR24; + } else { + /* Assume RGB subpixel order */ + pf = PIX_FMT_RGB24; + } + break; + } + case ZM_COLOUR_RGB32: + { + if(subpixelorder == ZM_SUBPIX_ORDER_ARGB) { + /* ARGB subpixel order */ + pf = PIX_FMT_ARGB; + } else if(subpixelorder == ZM_SUBPIX_ORDER_ABGR) { + /* ABGR subpixel order */ + pf = PIX_FMT_ABGR; + } else if(subpixelorder == ZM_SUBPIX_ORDER_BGRA) { + /* BGRA subpixel order */ + pf = PIX_FMT_BGRA; + } else { + /* Assume RGBA subpixel order */ + pf = PIX_FMT_RGBA; + } + break; + } + case ZM_COLOUR_GRAY8: + pf = PIX_FMT_GRAY8; + break; + default: + Panic("Unexpected colours: %d",colours); + break; + } + + /* add the video streams using the default format codecs + and initialize the codecs */ + ost = NULL; + if (of->video_codec != CODEC_ID_NONE) + { +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 4, 0) + ost = av_new_stream(ofc, 0); +#else + ost = avformat_new_stream(ofc, 0); +#endif + if (!ost) + { + Panic( "Could not alloc stream" ); + } + +#if ZM_FFMPEG_SVN + AVCodecContext *c = ost->codec; +#else + AVCodecContext *c = &ost->codec; +#endif + + c->codec_id = of->video_codec; +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1) + c->codec_type = AVMEDIA_TYPE_VIDEO; +#else + c->codec_type = CODEC_TYPE_VIDEO; +#endif + + /* put sample parameters */ + c->bit_rate = bitrate; + c->pix_fmt = PIX_FMT_YUV420P; + /* resolution must be a multiple of two */ + c->width = width; + c->height = height; +#if ZM_FFMPEG_SVN + /* time base: this is the fundamental unit of time (in seconds) in terms + of which frame timestamps are represented. for fixed-fps content, + timebase should be 1/framerate and timestamp increments should be + identically 1. */ + //c->time_base.den = (int)(frame_rate*100); + //c->time_base.num = 100; + c->time_base.den = frame_rate; + c->time_base.num = 1; +#else + /* frames per second */ + c->frame_rate = frame_rate; + c->frame_rate_base = 1; +#endif + //c->gop_size = frame_rate/2; /* emit one intra frame every half second or so */ + c->gop_size = 12; + if ( c->gop_size < 3 ) + c->gop_size = 3; + // some formats want stream headers to be seperate + if(!strcmp(ofc->oformat->name, "mp4") || !strcmp(ofc->oformat->name, "mov") || !strcmp(ofc->oformat->name, "3gp")) + c->flags |= CODEC_FLAG_GLOBAL_HEADER; + } +} + +void VideoStream::SetParameters() +{ + /* set the output parameters (must be done even if no + parameters). */ +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 4, 0) + if ( av_set_parameters(ofc, NULL) < 0 ) +#else + if ( avformat_write_header(ofc, NULL) < 0 ) +#endif + { + Panic( "Invalid output format parameters" ); + } + //dump_format(ofc, 0, filename, 1); +} + +const char *VideoStream::MimeType() const +{ + for ( unsigned int i = 0; i < sizeof(mime_data)/sizeof(*mime_data); i++ ) + { + if ( strcmp( format, mime_data[i].format ) == 0 ) + { + return( mime_data[i].mime_type ); + } + } + const char *mime_type = of->mime_type; + if ( !mime_type ) + { + mime_type = "video/mpeg"; + Warning( "Unable to determine mime type for '%s' format, using '%s' as default", format, mime_type ); + } + + return( mime_type ); +} + +void VideoStream::OpenStream() +{ + /* now that all the parameters are set, we can open the + video codecs and allocate the necessary encode buffers */ + if ( ost ) + { +#if ZM_FFMPEG_SVN + AVCodecContext *c = ost->codec; +#else + AVCodecContext *c = &ost->codec; +#endif + + /* find the video encoder */ + AVCodec *codec = avcodec_find_encoder(c->codec_id); + if ( !codec ) + { + Panic( "codec not found" ); + } + + /* open the codec */ +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 7, 0) + if ( avcodec_open(c, codec) < 0 ) +#else + if ( avcodec_open2(c, codec, 0) < 0 ) +#endif + { + Panic( "Could not open codec" ); + } + + /* allocate the encoded raw picture */ + opicture = avcodec_alloc_frame(); + if ( !opicture ) + { + Panic( "Could not allocate opicture" ); + } + int size = avpicture_get_size( c->pix_fmt, c->width, c->height); + uint8_t *opicture_buf = (uint8_t *)av_malloc(size); + if ( !opicture_buf ) + { + av_free(opicture); + Panic( "Could not allocate opicture" ); + } + avpicture_fill( (AVPicture *)opicture, opicture_buf, c->pix_fmt, c->width, c->height ); + + /* if the output format is not identical to the input format, then a temporary + picture is needed too. It is then converted to the required + output format */ + tmp_opicture = NULL; + if ( c->pix_fmt != pf ) + { + tmp_opicture = avcodec_alloc_frame(); + if ( !tmp_opicture ) + { + Panic( "Could not allocate temporary opicture" ); + } + int size = avpicture_get_size( pf, c->width, c->height); + uint8_t *tmp_opicture_buf = (uint8_t *)av_malloc(size); + if (!tmp_opicture_buf) + { + av_free( tmp_opicture ); + Panic( "Could not allocate temporary opicture" ); + } + avpicture_fill( (AVPicture *)tmp_opicture, tmp_opicture_buf, pf, c->width, c->height ); + } + } + + /* open the output file, if needed */ + if ( !(of->flags & AVFMT_NOFILE) ) + { +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1) + if ( avio_open(&ofc->pb, filename, AVIO_FLAG_WRITE) < 0 ) +#else + if ( url_fopen(&ofc->pb, filename, AVIO_FLAG_WRITE) < 0 ) +#endif + { + Fatal( "Could not open '%s'", filename ); + } + } + + video_outbuf = NULL; + if ( !(ofc->oformat->flags & AVFMT_RAWPICTURE) ) + { + /* allocate output buffer */ + /* XXX: API change will be done */ + video_outbuf_size = 200000; + video_outbuf = (uint8_t *)malloc(video_outbuf_size); + } + + /* write the stream header, if any */ +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 4, 0) + av_write_header(ofc); +#else + avformat_write_header(ofc, NULL); +#endif +} + +VideoStream::VideoStream( const char *filename, const char *format, int bitrate, double frame_rate, int colours, int subpixelorder, int width, int height ) +{ + if ( !initialised ) + { + Initialise(); + } + + SetupFormat( filename, format ); + SetupCodec( colours, subpixelorder, width, height, bitrate, frame_rate ); + SetParameters(); +} + +VideoStream::~VideoStream() +{ + /* close each codec */ + if (ost) + { +#if ZM_FFMPEG_SVN + avcodec_close(ost->codec); +#else + avcodec_close(&ost->codec); +#endif + av_free(opicture->data[0]); + av_free(opicture); + if (tmp_opicture) + { + av_free(tmp_opicture->data[0]); + av_free(tmp_opicture); + } + av_free(video_outbuf); + } + + /* write the trailer, if any */ + av_write_trailer(ofc); + + /* free the streams */ + for( unsigned int i = 0; i < ofc->nb_streams; i++) + { + av_freep(&ofc->streams[i]); + } + + if (!(of->flags & AVFMT_NOFILE)) + { + /* close the output file */ +#if ZM_FFMPEG_SVN +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1) + avio_close(ofc->pb); +#else + url_fclose(ofc->pb); +#endif +#else + url_fclose(&ofc->pb); +#endif + } + + /* free the stream */ + av_free(ofc); +} + +double VideoStream::EncodeFrame( const uint8_t *buffer, int buffer_size, bool add_timestamp, unsigned int timestamp ) +{ +#ifdef HAVE_LIBSWSCALE + static struct SwsContext *img_convert_ctx = 0; +#endif // HAVE_LIBSWSCALE + double pts = 0.0; + + + if (ost) + { +#if ZM_FFMPEG_048 + pts = (double)ost->pts.val * ofc->pts_num / ofc->pts_den; +#else + pts = (double)ost->pts.val * ost->time_base.num / ost->time_base.den; +#endif + } + +#if ZM_FFMPEG_SVN + AVCodecContext *c = ost->codec; +#else + AVCodecContext *c = &ost->codec; +#endif + if ( c->pix_fmt != pf ) + { + memcpy( tmp_opicture->data[0], buffer, buffer_size ); +#ifdef HAVE_LIBSWSCALE + if ( !img_convert_ctx ) + { + img_convert_ctx = sws_getCachedContext( NULL, c->width, c->height, pf, c->width, c->height, c->pix_fmt, SWS_BICUBIC, NULL, NULL, NULL ); + if ( !img_convert_ctx ) + Panic( "Unable to initialise image scaling context" ); + } + sws_scale( img_convert_ctx, tmp_opicture->data, tmp_opicture->linesize, 0, c->height, opicture->data, opicture->linesize ); +#else // HAVE_LIBSWSCALE + Fatal("swscale is required for MPEG mode"); +#endif // HAVE_LIBSWSCALE + } + else + { + memcpy( opicture->data[0], buffer, buffer_size ); + } + AVFrame *opicture_ptr = opicture; + + int ret = 0; + if ( ofc->oformat->flags & AVFMT_RAWPICTURE ) + { +#if ZM_FFMPEG_048 + ret = av_write_frame( ofc, ost->index, (uint8_t *)opicture_ptr, sizeof(AVPicture) ); +#else + AVPacket pkt; + av_init_packet( &pkt ); + +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1) + pkt.flags |= AV_PKT_FLAG_KEY; +#else + pkt.flags |= PKT_FLAG_KEY; +#endif + pkt.stream_index = ost->index; + pkt.data = (uint8_t *)opicture_ptr; + pkt.size = sizeof(AVPicture); + + ret = av_write_frame(ofc, &pkt); +#endif + } + else + { + if ( add_timestamp ) + ost->pts.val = timestamp; +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(54, 1, 0) // NEXTIME + int out_size = avcodec_encode_video(c, video_outbuf, video_outbuf_size, opicture_ptr); +#else + int out_size = encode_frame(c, opicture_ptr); + +#endif + if ( out_size > 0 ) + { +#if ZM_FFMPEG_048 + ret = av_write_frame(ofc, ost->index, video_outbuf, out_size); +#else + AVPacket pkt; + av_init_packet(&pkt); + +#if ZM_FFMPEG_049 + pkt.pts = c->coded_frame->pts; +#else + pkt.pts= av_rescale_q( c->coded_frame->pts, c->time_base, ost->time_base ); +#endif + if(c->coded_frame->key_frame) +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1) + pkt.flags |= AV_PKT_FLAG_KEY; +#else + pkt.flags |= PKT_FLAG_KEY; +#endif + pkt.stream_index = ost->index; + pkt.data = video_outbuf; + pkt.size = out_size; + + ret = av_write_frame( ofc, &pkt ); +#endif + } + } + if ( ret != 0 ) + { + Fatal( "Error %d while writing video frame: %s", ret, strerror( errno ) ); + } + return( pts ); +} + +#endif // HAVE_LIBAVCODEC diff --git a/src/zm_mpeg.h b/src/zm_mpeg.h new file mode 100644 index 000000000..c7cb4d26f --- /dev/null +++ b/src/zm_mpeg.h @@ -0,0 +1,70 @@ +/* + * ZoneMinder MPEG Interface, $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. +*/ + +#ifndef ZM_MPEG_H +#define ZM_MPEG_H + +#include "zm_ffmpeg.h" + +#if HAVE_LIBAVCODEC + +class VideoStream +{ +protected: + struct MimeData + { + const char *format; + const char *mime_type; + }; + +protected: + static bool initialised; + static struct MimeData mime_data[]; + +protected: + const char *filename; + const char *format; + enum PixelFormat pf; + AVOutputFormat *of; + AVFormatContext *ofc; + AVStream *ost; + AVFrame *opicture; + AVFrame *tmp_opicture; + uint8_t *video_outbuf; + int video_outbuf_size; + double pts; + +protected: + static void Initialise(); + + void SetupFormat( const char *p_filename, const char *format ); + void SetupCodec( int colours, int subpixelorder, int width, int height, int bitrate, double frame_rate ); + void SetParameters(); + +public: + VideoStream( const char *filename, const char *format, int bitrate, double frame_rate, int colours, int subpixelorder, int width, int height ); + ~VideoStream(); + const char *MimeType() const; + void OpenStream(); + double EncodeFrame( const uint8_t *buffer, int buffer_size, bool add_timestamp=false, unsigned int timestamp=0 ); +}; + +#endif // HAVE_LIBAVCODEC + +#endif // ZM_MPEG_H diff --git a/src/zm_plugin.cpp b/src/zm_plugin.cpp new file mode 100644 index 000000000..29a068135 --- /dev/null +++ b/src/zm_plugin.cpp @@ -0,0 +1,105 @@ +#include "zm_plugin.h" + + + +/*!\fn Plugin::Plugin(const std::string &sFilename) + * \param sFilename is the name of plugin file to load + */ +Plugin::Plugin(const std::string &sFilename) + : m_sPluginFileName(sFilename), + m_hDLL(0), + m_pDLLRefCount(0), + m_pfnGetEngineVersion(0), + m_pfnRegisterPlugin(0) +{ + + // Try to load the plugin as a dynamic library + m_hDLL = dlopen(sFilename.c_str(), RTLD_LAZY|RTLD_GLOBAL); + + if(!m_hDLL) // if library hasn't been loaded successfully + { + throw runtime_error(string("Could not load '") + sFilename + "'"); + } + + // Locate the plugin's exported functions + try + { + m_pfnGetEngineVersion = reinterpret_cast(dlsym(m_hDLL, "getEngineVersion")); + m_pfnRegisterPlugin = reinterpret_cast(dlsym(m_hDLL, "registerPlugin")); + + // If the functions aren't found, we're going to assume this is + // a plain simple DLL and not one of our plugins + if(!m_pfnGetEngineVersion || ! m_pfnRegisterPlugin) + throw runtime_error(string("'") + sFilename + "' is not a valid plugin"); + + // Initialize a new DLL reference counter + m_pDLLRefCount = new size_t(1); + } + catch(runtime_error &ex) + { + dlclose(m_hDLL); + throw ex; + } + catch(...) + { + dlclose(m_hDLL); + throw runtime_error(string("Unknown exception while loading plugin '") + sFilename + string("'")); + } +} + + + +/*!\fn Plugin::Plugin(const Plugin &Other) + * \param Other is the other plugin instance to copy + */ +Plugin::Plugin(const Plugin &Other) + : m_sPluginFileName(Other.m_sPluginFileName), + m_hDLL(Other.m_hDLL), + m_pDLLRefCount(Other.m_pDLLRefCount), + m_pfnGetEngineVersion(Other.m_pfnGetEngineVersion), + m_pfnRegisterPlugin(Other.m_pfnRegisterPlugin) +{ + // Increase DLL reference counter + ++*m_pDLLRefCount; +} + + + +/*!\fn Plugin::operator=(const Plugin &Other) + * \param Other is the other plugin instance to copy + * return copy of object + */ +Plugin& Plugin::operator=(const Plugin &Other) +{ + m_hDLL = Other.m_hDLL; + m_pfnGetEngineVersion = Other.m_pfnGetEngineVersion; + m_pfnRegisterPlugin = Other.m_pfnRegisterPlugin; + m_pDLLRefCount = Other.m_pDLLRefCount; + m_sPluginFileName = Other.m_sPluginFileName; + // Increase DLL reference counter + ++*m_pDLLRefCount; + return *this; + +} + + + +Plugin::~Plugin() +{ + // Only unload the DLL if there are no more references to it + if(!--*m_pDLLRefCount) + { + delete m_pDLLRefCount; + dlclose(m_hDLL); + } +} + + + +/*!\fn Plugin::registerPlugin(PluginManager &K) + * \param K is the pointer to plugin manager + */ +void Plugin::registerPlugin(PluginManager &K) +{ + m_pfnRegisterPlugin(K, m_sPluginFileName); +} diff --git a/src/zm_plugin.h b/src/zm_plugin.h new file mode 100644 index 000000000..a9247d646 --- /dev/null +++ b/src/zm_plugin.h @@ -0,0 +1,78 @@ +#ifndef ZM_PLUGIN_H +#define ZM_PLUGIN_H + + + +#include +#include +#include + +#include +#include "zm.h" + + + +using namespace std; + + + +class PluginManager; + + + +//! Signature for the version query function +typedef int fnGetEngineVersion(); + +//! Signature for the plugin's registration function +typedef void fnRegisterPlugin(PluginManager &, string); + + + +//! Representation of a plugin. +/*! Use for loading plugin's shared library + * and registration of it to the PluginManager. + */ +class Plugin +{ + +public: + + //! Initialize and load plugin + Plugin(const std::string &sFilename); + + //! Copy existing plugin instance + Plugin(const Plugin &Other); + + //! Operator =. + Plugin &operator =(const Plugin &Other); + + //! Unload a plugin + ~Plugin(); + + //! Query the plugin for its expected engine version + int getEngineVersion() const { return m_pfnGetEngineVersion();} + + //! Register the plugin to a PluginManager + void registerPlugin(PluginManager &K); + +private: + + //! Shared file name. + string m_sPluginFileName; + + //! DLL handle + void* m_hDLL; + + //! Number of references to the DLL + size_t *m_pDLLRefCount; + + //! Version query function + fnGetEngineVersion *m_pfnGetEngineVersion; + + //! Plugin registration function + fnRegisterPlugin *m_pfnRegisterPlugin; +}; + + + +#endif //ZM_PLUGIN_H diff --git a/src/zm_plugin_manager.cpp b/src/zm_plugin_manager.cpp new file mode 100644 index 000000000..5b9701957 --- /dev/null +++ b/src/zm_plugin_manager.cpp @@ -0,0 +1,118 @@ +#include "zm_plugin_manager.h" + + + +/*! \fn file_select(const struct direct *entry) + * A functor for selection of files with specified extension. + * \param entry is file structure + * \return 1 if file match selection criteria and + * 0 otherwise. + * NOTE: file extension is specified by PluginManager::m_sPluginExt + * static variable. + */ +int file_select(const struct direct *entry) +{ + char *ptr; + + if ((strcmp(entry->d_name, ".")== 0) || (strcmp(entry->d_name, "..") == 0)) + return 0; + + // Check for filename extensions. + ptr = rindex((char*)entry->d_name, '.'); + if ((ptr != NULL) && (strcmp(ptr, (PluginManager::m_sPluginExt).c_str()) == 0)) + return 1; + else + return 0; +} + + + + +/*! \fn join_paths(const string& p1, const string& p2) + * \param p1 is the first part of desired path + * \param p2 is the second part of desired path + * \return joined path string. + */ +string join_paths(const string& p1, const string& p2) +{ + char sep = '/'; + string tmp = p1; + +#ifdef _WIN32 + sep = '\\'; +#endif + + if (p1[p1.length()] != sep) + { // Need to add a path separator + tmp += sep; + return(tmp + p2); + } + else + return(p1 + p2); +} + + + +string PluginManager::m_sPluginExt = DEFAULT_PLUGIN_EXT; + + +PluginManager::PluginManager() +{ +} + + + +/*!\fn PluginManager::loadPlugin(const string &sFilename)) + * \param sFilename is the name of plugin file to load + */ +void PluginManager::loadPlugin(const string &sFilename) +{ + try + { + if(m_LoadedPlugins.find(sFilename) == m_LoadedPlugins.end()) + m_LoadedPlugins.insert(PluginMap::value_type(sFilename, Plugin(sFilename))).first->second.registerPlugin(*this); + } + catch(runtime_error &ex) + { + Info("Runtime error: %s", ex.what()); + } + catch(...) + { + Info("Unknown exception. Could not load %s.", sFilename.c_str()); + } +} + + + +/*!\fn PluginManager::findPlugins(const string &sPath) + * \param sPath is the path to folder to search plugins + * return count of found plugins + */ +int PluginManager::findPlugins(const string &sPath) +{ + + struct direct **files; + + int count = scandir(sPath.c_str(), &files, file_select, alphasort); + + for (int i = 1; i < count + 1; ++i) + { + string sFileName = files[i-1]->d_name; + string sFullPath = join_paths(sPath, sFileName); + + Info("Loading plugin %s ... ", sFullPath.c_str()); + + loadPlugin(sFullPath); + } + + return count; +} + + +/*!\fn PluginManager::configurePlugins(string sConfigFileName) + * \param sConfigFileName is the path to the configuration file, where parameters for all plugins are given. + */ +void PluginManager::configurePlugins(string sConfigFileName) +{ + m_ImageAnalyser.configurePlugins(sConfigFileName); +} diff --git a/src/zm_plugin_manager.h b/src/zm_plugin_manager.h new file mode 100644 index 000000000..b108dd74a --- /dev/null +++ b/src/zm_plugin_manager.h @@ -0,0 +1,85 @@ +#ifndef ZM_PLUGIN_MANAGER_H +#define ZM_PLUGIN_MANAGER_H + + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "zm.h" +#include "zm_image_analyser.h" +#include "zm_detector.h" +#include "zm_plugin.h" + + + +using namespace std; + + +#define ZM_ENGINE_VERSION 24 +#define DEFAULT_PLUGIN_EXT ".zmpl" + + + +//! Map of plugins by their associated file names. +typedef std::map PluginMap; + + +//! External function for sorting of files in directory. +extern int alphasort(); + + +//! Function to select files with plugins by extension. +int file_select(const struct direct *entry); + + +//! Join two path strings. +string join_paths(const string& p1, const string& p2); + + + +//! Class for managing all loaded plugins. +class PluginManager +{ + +public: + + //! Default constructor. + PluginManager(); + + //! Access the image analyser. + ImageAnalyser &getImageAnalyser() {return m_ImageAnalyser;} + + //! Loads a plugin. + void loadPlugin(const string &sFilename); + + //! Find and load all plugins from given directory, returns number of found plugins. + int findPlugins(const string &sPath); + + //! Configure all loaded plugins using given configuration file. + void configurePlugins(string sConfigFileName); + + //! Set plugin extension. + void setPluginExt(string sPluginExt) { m_sPluginExt = sPluginExt; } + + //! Extension for zm plugins. + static string m_sPluginExt; + +private: + + //! All plugins currently loaded. + PluginMap m_LoadedPlugins; + + //! The image analyser. + ImageAnalyser m_ImageAnalyser; +}; + + + +#endif //ZM_PLUGIN_MANAGER_H diff --git a/src/zm_poly.cpp b/src/zm_poly.cpp new file mode 100644 index 000000000..eef5dd56a --- /dev/null +++ b/src/zm_poly.cpp @@ -0,0 +1,118 @@ +// +// ZoneMinder Polygon Class Implementation, $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. +// + +#include "zm.h" +#include "zm_poly.h" + +#include + +void Polygon::calcArea() +{ + double float_area = 0.0L; + for ( int i = 0, j = n_coords-1; i < n_coords; j = i++ ) + { + double trap_area = ((coords[i].X()-coords[j].X())*((coords[i].Y()+coords[j].Y())))/2.0L; + float_area += trap_area; + //printf( "%.2f (%.2f)\n", float_area, trap_area ); + } + area = (int)round(fabs(float_area)); +} + +void Polygon::calcCentre() +{ + if ( !area && n_coords ) + calcArea(); + double float_x = 0.0L, float_y = 0.0L; + for ( int i = 0, j = n_coords-1; i < n_coords; j = i++ ) + { + float_x += ((coords[i].Y()-coords[j].Y())*((coords[i].X()*2)+(coords[i].X()*coords[j].X())+(coords[j].X()*2))); + float_y += ((coords[j].X()-coords[i].X())*((coords[i].Y()*2)+(coords[i].Y()*coords[j].Y())+(coords[j].Y()*2))); + } + float_x /= (6*area); + float_y /= (6*area); + //printf( "%.2f,%.2f\n", float_x, float_y ); + centre = Coord( (int)round(float_x), (int)round(float_y) ); +} + +Polygon::Polygon( int p_n_coords, const Coord *p_coords ) : n_coords( p_n_coords ) +{ + coords = new Coord[n_coords]; + + int min_x = -1; + int max_x = -1; + int min_y = -1; + int max_y = -1; + for( int i = 0; i < n_coords; i++ ) + { + coords[i] = p_coords[i]; + if ( min_x == -1 || coords[i].X() < min_x ) + min_x = coords[i].X(); + if ( max_x == -1 || coords[i].X() > max_x ) + max_x = coords[i].X(); + if ( min_y == -1 || coords[i].Y() < min_y ) + min_y = coords[i].Y(); + if ( max_y == -1 || coords[i].Y() > max_y ) + max_y = coords[i].Y(); + } + extent = Box( min_x, min_y, max_x, max_y ); + calcArea(); + calcCentre(); +} + +Polygon::Polygon( const Polygon &p_polygon ) : n_coords( p_polygon.n_coords ), extent( p_polygon.extent ), area( p_polygon.area ), centre( p_polygon.centre ) +{ + coords = new Coord[n_coords]; + for( int i = 0; i < n_coords; i++ ) + { + coords[i] = p_polygon.coords[i]; + } +} + +Polygon &Polygon::operator=( const Polygon &p_polygon ) +{ + if ( n_coords < p_polygon.n_coords ) + { + delete[] coords; + coords = new Coord[p_polygon.n_coords]; + } + n_coords = p_polygon.n_coords; + for( int i = 0; i < n_coords; i++ ) + { + coords[i] = p_polygon.coords[i]; + } + extent = p_polygon.extent; + area = p_polygon.area; + centre = p_polygon.centre; + return( *this ); +} + +bool Polygon::isInside( const Coord &coord ) const +{ + bool inside = false; + for ( int i = 0, j = n_coords-1; i < n_coords; j = i++ ) + { + if ( (((coords[i].Y() <= coord.Y()) && (coord.Y() < coords[j].Y()) ) + || ((coords[j].Y() <= coord.Y()) && (coord.Y() < coords[i].Y()))) + && (coord.X() < (coords[j].X() - coords[i].X()) * (coord.Y() - coords[i].Y()) / (coords[j].Y() - coords[i].Y()) + coords[i].X())) + { + inside = !inside; + } + } + return( inside ); +} diff --git a/src/zm_poly.h b/src/zm_poly.h new file mode 100644 index 000000000..854a3c322 --- /dev/null +++ b/src/zm_poly.h @@ -0,0 +1,125 @@ +// +// ZoneMinder Polygon Class Interfaces, $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. +// + +#ifndef ZM_POLY_H +#define ZM_POLY_H + +#include "zm.h" +#include "zm_coord.h" +#include "zm_box.h" + +#include + +// +// Class used for storing a box, which is defined as a region +// defined by two coordinates +// +class Polygon +{ +protected: + struct Edge + { + int min_y; + int max_y; + double min_x; + double _1_m; + + static int CompareYX( const void *p1, const void *p2 ) + { + const Edge *e1 = (const Edge *)p1, *e2 = (const Edge *)p2; + if ( e1->min_y == e2->min_y ) + return( int(e1->min_x - e2->min_x) ); + else + return( int(e1->min_y - e2->min_y) ); + } + static int CompareX( const void *p1, const void *p2 ) + { + const Edge *e1 = (const Edge *)p1, *e2 = (const Edge *)p2; + return( int(e1->min_x - e2->min_x) ); + } + }; + + struct Slice + { + int min_x; + int max_x; + int n_edges; + int *edges; + + Slice() + { + n_edges = 0; + edges = 0; + } + ~Slice() + { + delete edges; + } + }; + +protected: + int n_coords; + Coord *coords; + Box extent; + int area; + Coord centre; + Edge *edges; + Slice *slices; + +protected: + void initialiseEdges(); + void calcArea(); + void calcCentre(); + +public: + inline Polygon() : n_coords( 0 ), coords( 0 ), area( 0 ) + { + } + Polygon( int p_n_coords, const Coord *p_coords ); + Polygon( const Polygon &p_polygon ); + ~Polygon() + { + delete[] coords; + } + + Polygon &operator=( const Polygon &p_polygon ); + + inline int getNumCoords() const { return( n_coords ); } + inline const Coord &getCoord( int index ) const + { + return( coords[index] ); + } + + inline const Box &Extent() const { return( extent ); } + inline int LoX() const { return( extent.LoX() ); } + inline int HiX() const { return( extent.HiX() ); } + inline int LoY() const { return( extent.LoY() ); } + inline int HiY() const { return( extent.HiY() ); } + inline int Width() const { return( extent.Width() ); } + inline int Height() const { return( extent.Height() ); } + + inline int Area() const { return( area ); } + inline const Coord &Centre() const + { + return( centre ); + } + bool isInside( const Coord &coord ) const; +}; + +#endif // ZM_POLY_H diff --git a/src/zm_regexp.cpp b/src/zm_regexp.cpp new file mode 100644 index 000000000..43f738217 --- /dev/null +++ b/src/zm_regexp.cpp @@ -0,0 +1,124 @@ +/* + * ZoneMinder regular expression class implementation, $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. +*/ + +#include + +#include "zm.h" +#include "zm_regexp.h" + +#if HAVE_LIBPCRE + +RegExpr::RegExpr( const char *pattern, int flags, int p_max_matches ) : max_matches( p_max_matches ), match_buffers( 0 ), match_lengths( 0 ), match_valid( 0 ) +{ + const char *errstr; + int erroffset = 0; + if ( !(regex = pcre_compile( pattern, flags, &errstr, &erroffset, 0 )) ) + { + Panic( "pcre_compile(%s): %s at %d", pattern, errstr, erroffset ); + } + + regextra = pcre_study( regex, 0, &errstr ); + if ( errstr ) + { + Panic( "pcre_study(%s): %s", pattern, errstr ); + } + + if ( (ok = (bool)regex) ) + { + match_vectors = new int[3*max_matches]; + memset( match_vectors, 0, sizeof(*match_vectors)*3*max_matches ); + match_buffers = new char *[max_matches]; + memset( match_buffers, 0, sizeof(*match_buffers)*max_matches ); + match_lengths = new int[max_matches]; + memset( match_lengths, 0, sizeof(*match_lengths)*max_matches ); + match_valid = new bool[max_matches]; + memset( match_valid, 0, sizeof(*match_valid)*max_matches ); + } + n_matches = 0; +} + +RegExpr::~RegExpr() +{ + for ( int i = 0; i < max_matches; i++ ) + { + if ( match_buffers[i] ) + { + delete[] match_buffers[i]; + } + } + delete[] match_valid; + delete[] match_lengths; + delete[] match_buffers; + delete[] match_vectors; +} + +int RegExpr::Match( const char *subject_string, int subject_length, int flags ) +{ + match_string = subject_string; + + n_matches = pcre_exec( regex, regextra, subject_string, subject_length, 0, flags, match_vectors, 2*max_matches ); + + if ( n_matches <= 0 ) + { + if ( n_matches < PCRE_ERROR_NOMATCH ) + { + Error( "Error %d executing regular expression", n_matches ); + } + return( n_matches = 0 ); + } + + for( int i = 0; i < max_matches; i++ ) + { + match_valid[i] = false; + } + return( n_matches ); +} + +const char *RegExpr::MatchString( int match_index ) const +{ + if ( match_index > n_matches ) + { + return( 0 ); + } + if ( !match_valid[match_index] ) + { + int match_len = match_vectors[(2*match_index)+1]-match_vectors[2*match_index]; + if ( match_lengths[match_index] < (match_len+1) ) + { + delete[] match_buffers[match_index]; + match_buffers[match_index] = new char[match_len+1]; + match_lengths[match_index] = match_len+1; + } + memcpy( match_buffers[match_index], match_string+match_vectors[2*match_index], match_len ); + match_buffers[match_index][match_len] = '\0'; + match_valid[match_index] = true; + } + return( match_buffers[match_index] ); +} + +int RegExpr::MatchLength( int match_index ) const +{ + if ( match_index > n_matches ) + { + return( 0 ); + } + return( match_vectors[(2*match_index)+1]-match_vectors[2*match_index] ); +} + +#endif // HAVE_LIBPCRE diff --git a/src/zm_regexp.h b/src/zm_regexp.h new file mode 100644 index 000000000..f1c9d705d --- /dev/null +++ b/src/zm_regexp.h @@ -0,0 +1,65 @@ +/* + * ZoneMinder Regular Expression Interface, $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. +*/ + +#include "zm.h" + +#ifndef ZM_REGEXP_H +#define ZM_REGEXP_H + +#if HAVE_LIBPCRE + +#if HAVE_PCRE_H +#include +#elif HAVE_PCRE_PCRE_H +#include +#else +#error Unable to locate pcre.h, please do 'locate pcre.h' and report location to zoneminder.com +#endif + +class RegExpr +{ +protected: + pcre *regex; + pcre_extra *regextra; + int max_matches; + int *match_vectors; + mutable char **match_buffers; + int *match_lengths; + bool *match_valid; + +protected: + const char *match_string; + int n_matches; + +protected: + bool ok; + +public: + RegExpr( const char *pattern, int cflags=0, int p_max_matches=32 ); + ~RegExpr(); + bool Ok() const { return( ok ); } + int MatchCount() const { return( n_matches ); } + int Match( const char *subject_string, int subject_length, int flags=0 ); + const char *MatchString( int match_index ) const; + int MatchLength( int match_index ) const; +}; + +#endif // HAVE_LIBPCRE + +#endif // ZM_REGEXP_H diff --git a/src/zm_remote_camera.cpp b/src/zm_remote_camera.cpp new file mode 100644 index 000000000..8c54c0ad7 --- /dev/null +++ b/src/zm_remote_camera.cpp @@ -0,0 +1,75 @@ +// +// ZoneMinder Remote Camera Class Implementation, $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. +// + +#include "zm_remote_camera.h" + +#include "zm_utils.h" + +RemoteCamera::RemoteCamera( int p_id, const std::string &p_protocol, const std::string &p_host, const std::string &p_port, const std::string &p_path, int p_width, int p_height, int p_colours, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ) : + Camera( p_id, REMOTE_SRC, p_width, p_height, p_colours, ZM_SUBPIX_ORDER_DEFAULT_FOR_COLOUR(p_colours), p_brightness, p_contrast, p_hue, p_colour, p_capture ), + protocol( p_protocol ), + host( p_host ), + port( p_port ), + path( p_path ), + hp( 0 ) +{ + if ( path[0] != '/' ) + path = '/'+path; +} + +RemoteCamera::~RemoteCamera() +{ +} + +void RemoteCamera::Initialise() +{ + if( protocol.empty() ) + Fatal( "No protocol specified for remote camera" ); + + if( host.empty() ) + Fatal( "No host specified for remote camera" ); + + if( port.empty() ) + Fatal( "No port specified for remote camera" ); + + //if( path.empty() ) + //Fatal( "No path specified for remote camera" ); + + // Cache as much as we can to speed things up + std::string::size_type authIndex = host.find( '@' ); + + if ( authIndex != std::string::npos ) + { + auth = host.substr( 0, authIndex ); + host.erase( 0, authIndex+1 ); + auth64 = base64Encode( auth ); + } + + if ( !hp ) + { + if ( !(hp = gethostbyname(host.c_str())) ) + { + Fatal( "Can't gethostbyname(%s): %s", host.c_str(), strerror(h_errno) ); + } + memcpy((char *)&sa.sin_addr, (char *)hp->h_addr, hp->h_length); + sa.sin_family = hp->h_addrtype; + sa.sin_port = htons(atoi(port.c_str())); + } +} + diff --git a/src/zm_remote_camera.h b/src/zm_remote_camera.h new file mode 100644 index 000000000..32a331136 --- /dev/null +++ b/src/zm_remote_camera.h @@ -0,0 +1,65 @@ +// +// ZoneMinder Remote Camera Class Interface, $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. +// + +#ifndef ZM_REMOTE_CAMERA_H +#define ZM_REMOTE_CAMERA_H + +#include "zm_camera.h" + +#include +#include + +// +// Class representing 'remote' cameras, i.e. those which are +// accessed over a network connection. +// +class RemoteCamera : public Camera +{ +protected: + std::string protocol; + std::string host; + std::string port; + std::string path; + std::string auth; + std::string auth64; + +protected: + struct hostent *hp; + struct sockaddr_in sa; + +public: + RemoteCamera( int p_id, const std::string &p_proto, const std::string &p_host, const std::string &p_port, const std::string &p_path, int p_width, int p_height, int p_colours, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ); + virtual ~RemoteCamera(); + + const std::string &Protocol() const { return( protocol ); } + const std::string &Host() const { return( host ); } + const std::string &Port() const { return( port ); } + const std::string &Path() const { return( path ); } + const std::string &Auth() const { return( auth ); } + + virtual void Initialise(); + virtual void Terminate() = 0; + virtual int Connect() = 0; + virtual int Disconnect() = 0; + virtual int PreCapture() = 0; + virtual int Capture( Image &image ) = 0; + virtual int PostCapture() = 0; +}; + +#endif // ZM_REMOTE_CAMERA_H diff --git a/src/zm_remote_camera_http.cpp b/src/zm_remote_camera_http.cpp new file mode 100644 index 000000000..e609fc08e --- /dev/null +++ b/src/zm_remote_camera_http.cpp @@ -0,0 +1,1150 @@ +// +// ZoneMinder Remote Camera Class Implementation, $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. +// + +#include "zm_remote_camera_http.h" + +#include "zm_mem_utils.h" + +#include +#include +#include + +RemoteCameraHttp::RemoteCameraHttp( int p_id, const std::string &p_method, const std::string &p_host, const std::string &p_port, const std::string &p_path, int p_width, int p_height, int p_colours, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ) : + RemoteCamera( p_id, "http", p_host, p_port, p_path, p_width, p_height, p_colours, p_brightness, p_contrast, p_hue, p_colour, p_capture ) +{ + sd = -1; + + timeout.tv_sec = 0; + timeout.tv_usec = 0; + + if ( p_method == "simple" ) + method = SIMPLE; + else if ( p_method == "regexp" ) + method = REGEXP; + else + Fatal( "Unrecognised method '%s' when creating HTTP camera %d", p_method.c_str(), id ); + if ( capture ) + { + Initialise(); + } +} + +RemoteCameraHttp::~RemoteCameraHttp() +{ + if ( capture ) + { + Terminate(); + } +} + +void RemoteCameraHttp::Initialise() +{ + RemoteCamera::Initialise(); + + if ( request.empty() ) + { + request = stringtf( "GET %s HTTP/%s\r\n", path.c_str(), config.http_version ); + request += stringtf( "User-Agent: %s/%s\r\n", config.http_ua, ZM_VERSION ); + request += stringtf( "Host: %s\r\n", host .c_str()); + if ( strcmp( config.http_version, "1.0" ) == 0 ) + request += stringtf( "Connection: Keep-Alive\r\n" ); + if ( !auth.empty() ) + request += stringtf( "Authorization: Basic %s\r\n", auth64.c_str() ); + request += "\r\n"; + Debug( 2, "Request: %s", request.c_str() ); + } + + if ( !timeout.tv_sec ) + { + timeout.tv_sec = config.http_timeout/1000; + timeout.tv_usec = (config.http_timeout%1000)*1000; + } + + int max_size = width*height*colours; + + buffer.size( max_size ); + + mode = SINGLE_IMAGE; + format = UNDEF; + state = HEADER; +} + +int RemoteCameraHttp::Connect() +{ + if ( sd < 0 ) + { + sd = socket( hp->h_addrtype, SOCK_STREAM, 0 ); + if ( sd < 0 ) + { + Error( "Can't create socket: %s", strerror(errno) ); + return( -1 ); + } + + if ( connect( sd, (struct sockaddr *)&sa, sizeof(sa) ) < 0 ) + { + Error( "Can't connect to remote camera: %s", strerror(errno) ); + Disconnect(); + return( -1 ); + } + } + Debug( 3, "Connected to host, socket = %d", sd ); + return( sd ); +} + +int RemoteCameraHttp::Disconnect() +{ + close( sd ); + sd = -1; + Debug( 3, "Disconnected from host" ); + return( 0 ); +} + +int RemoteCameraHttp::SendRequest() +{ + if ( write( sd, request.data(), request.length() ) < 0 ) + { + Error( "Can't write: %s", strerror(errno) ); + Disconnect(); + return( -1 ); + } + format = UNDEF; + state = HEADER; + Debug( 3, "Request sent" ); + return( 0 ); +} + +int RemoteCameraHttp::ReadData( Buffer &buffer, int bytes_expected ) +{ + fd_set rfds; + FD_ZERO(&rfds); + FD_SET(sd, &rfds); + + struct timeval temp_timeout = timeout; + + int n_found = select( sd+1, &rfds, NULL, NULL, &temp_timeout ); + if( n_found == 0 ) + { + Warning( "Select timed out" ); + Disconnect(); + return( 0 ); + } + else if ( n_found < 0) + { + Error( "Select error: %s", strerror(errno) ); + return( -1 ); + } + + int total_bytes_to_read = 0; + + if ( bytes_expected ) + { + total_bytes_to_read = bytes_expected; + } + else + { + if ( ioctl( sd, FIONREAD, &total_bytes_to_read ) < 0 ) + { + Error( "Can't ioctl(): %s", strerror(errno) ); + return( -1 ); + } + + if ( total_bytes_to_read == 0 ) + { + Debug( 3, "Socket closed" ); + Disconnect(); + return( 0 ); + } + } + Debug( 3, "Expecting %d bytes", total_bytes_to_read ); + + int total_bytes_read = 0; + do + { + static unsigned char temp_buffer[ZM_NETWORK_BUFSIZ]; + int bytes_to_read = (unsigned int)total_bytes_to_read>(unsigned int)sizeof(temp_buffer)?sizeof(temp_buffer):total_bytes_to_read; + int bytes_read = read( sd, temp_buffer, bytes_to_read ); + + if ( bytes_read < 0) + { + Error( "Read error: %s", strerror(errno) ); + return( -1 ); + } + else if ( bytes_read == 0) + { + Debug( 3, "Socket closed" ); + Disconnect(); + return( 0 ); + } + else if ( bytes_read < bytes_to_read ) + { + Error( "Incomplete read, expected %d, got %d", bytes_to_read, bytes_read ); + return( -1 ); + } + Debug( 3, "Read %d bytes", bytes_read ); + buffer.append( temp_buffer, bytes_read ); + total_bytes_read += bytes_read; + total_bytes_to_read -= bytes_read; + } + while ( total_bytes_to_read ); + + return( total_bytes_read ); +} + +int RemoteCameraHttp::GetResponse() +{ +#if HAVE_LIBPCRE + if ( method == REGEXP ) + { + const char *header = 0; + int header_len = 0; + const char *http_version = 0; + int status_code = 0; + const char *status_mesg = 0; + const char *connection_type = ""; + int content_length = 0; + const char *content_type = ""; + const char *content_boundary = ""; + const char *subheader = 0; + int subheader_len = 0; + //int subcontent_length = 0; + //const char *subcontent_type = ""; + + while ( true ) + { + switch( state ) + { + case HEADER : + { + static RegExpr *header_expr = 0; + static RegExpr *status_expr = 0; + static RegExpr *connection_expr = 0; + static RegExpr *content_length_expr = 0; + static RegExpr *content_type_expr = 0; + + int buffer_len = ReadData( buffer ); + if ( buffer_len == 0 ) + { + Error( "Connection dropped by remote end" ); + return( 0 ); + } + else if ( buffer_len < 0 ) + { + Error( "Unable to read header data" ); + return( -1 ); + } + if ( !header_expr ) + header_expr = new RegExpr( "^(.+?\r?\n\r?\n)", PCRE_DOTALL ); + if ( header_expr->Match( (char*)buffer, buffer.size() ) == 2 ) + { + header = header_expr->MatchString( 1 ); + header_len = header_expr->MatchLength( 1 ); + Debug( 4, "Captured header (%d bytes):\n'%s'", header_len, header ); + + if ( !status_expr ) + status_expr = new RegExpr( "^HTTP/(1\\.[01]) +([0-9]+) +(.+?)\r?\n", PCRE_CASELESS ); + if ( status_expr->Match( header, header_len ) < 4 ) + { + Error( "Unable to extract HTTP status from header" ); + return( -1 ); + } + http_version = status_expr->MatchString( 1 ); + status_code = atoi( status_expr->MatchString( 2 ) ); + status_mesg = status_expr->MatchString( 3 ); + + if ( status_code < 200 || status_code > 299 ) + { + Error( "Invalid response status %d: %s", status_code, status_mesg ); + return( -1 ); + } + Debug( 3, "Got status '%d' (%s), http version %s", status_code, status_mesg, http_version ); + + if ( !connection_expr ) + connection_expr = new RegExpr( "Connection: ?(.+?)\r?\n", PCRE_CASELESS ); + if ( connection_expr->Match( header, header_len ) == 2 ) + { + connection_type = connection_expr->MatchString( 1 ); + Debug( 3, "Got connection '%s'", connection_type ); + } + + if ( !content_length_expr ) + content_length_expr = new RegExpr( "Content-length: ?([0-9]+)\r?\n", PCRE_CASELESS ); + if ( content_length_expr->Match( header, header_len ) == 2 ) + { + content_length = atoi( content_length_expr->MatchString( 1 ) ); + Debug( 3, "Got content length '%d'", content_length ); + } + + if ( !content_type_expr ) + content_type_expr = new RegExpr( "Content-type: ?(.+?)(?:; ?boundary=(.+?))?\r?\n", PCRE_CASELESS ); + if ( content_type_expr->Match( header, header_len ) >= 2 ) + { + content_type = content_type_expr->MatchString( 1 ); + Debug( 3, "Got content type '%s'\n", content_type ); + if ( content_type_expr->MatchCount() > 2 ) + { + content_boundary = content_type_expr->MatchString( 2 ); + Debug( 3, "Got content boundary '%s'", content_boundary ); + } + } + + if ( !strcasecmp( content_type, "image/jpeg" ) || !strcasecmp( content_type, "image/jpg" ) ) + { + // Single image + mode = SINGLE_IMAGE; + format = JPEG; + state = CONTENT; + } + else if ( !strcasecmp( content_type, "image/x-rgb" ) ) + { + // Single image + mode = SINGLE_IMAGE; + format = X_RGB; + state = CONTENT; + } + else if ( !strcasecmp( content_type, "image/x-rgbz" ) ) + { + // Single image + mode = SINGLE_IMAGE; + format = X_RGBZ; + state = CONTENT; + } + else if ( !strcasecmp( content_type, "multipart/x-mixed-replace" ) ) + { + // Image stream, so start processing + if ( !content_boundary[0] ) + { + Error( "No content boundary found in header '%s'", header ); + return( -1 ); + } + mode = MULTI_IMAGE; + state = SUBHEADER; + } + //else if ( !strcasecmp( content_type, "video/mpeg" ) || !strcasecmp( content_type, "video/mpg" ) ) + //{ + //// MPEG stream, coming soon! + //} + else + { + Error( "Unrecognised content type '%s'", content_type ); + return( -1 ); + } + buffer.consume( header_len ); + } + else + { + Debug( 3, "Unable to extract header from stream, retrying" ); + //return( -1 ); + } + break; + } + case SUBHEADER : + { + static RegExpr *subheader_expr = 0; + static RegExpr *subcontent_length_expr = 0; + static RegExpr *subcontent_type_expr = 0; + + if ( !subheader_expr ) + { + char subheader_pattern[256] = ""; + snprintf( subheader_pattern, sizeof(subheader_pattern), "^((?:\r?\n){0,2}?(?:--)?%s\r?\n.+?\r?\n\r?\n)", content_boundary ); + subheader_expr = new RegExpr( subheader_pattern, PCRE_DOTALL ); + } + if ( subheader_expr->Match( (char *)buffer, (int)buffer ) == 2 ) + { + subheader = subheader_expr->MatchString( 1 ); + subheader_len = subheader_expr->MatchLength( 1 ); + Debug( 4, "Captured subheader (%d bytes):'%s'", subheader_len, subheader ); + + if ( !subcontent_length_expr ) + subcontent_length_expr = new RegExpr( "Content-length: ?([0-9]+)\r?\n", PCRE_CASELESS ); + if ( subcontent_length_expr->Match( subheader, subheader_len ) == 2 ) + { + content_length = atoi( subcontent_length_expr->MatchString( 1 ) ); + Debug( 3, "Got subcontent length '%d'", content_length ); + } + + if ( !subcontent_type_expr ) + subcontent_type_expr = new RegExpr( "Content-type: ?(.+?)\r?\n", PCRE_CASELESS ); + if ( subcontent_type_expr->Match( subheader, subheader_len ) == 2 ) + { + content_type = subcontent_type_expr->MatchString( 1 ); + Debug( 3, "Got subcontent type '%s'", content_type ); + } + + buffer.consume( subheader_len ); + state = CONTENT; + } + else + { + Debug( 3, "Unable to extract subheader from stream, retrying" ); + int buffer_len = ReadData( buffer ); + if ( buffer_len == 0 ) + { + Error( "Connection dropped by remote end" ); + return( 0 ); + } + else if ( buffer_len < 0 ) + { + return( -1 ); + } + } + break; + } + case CONTENT : + { + if ( !strcasecmp( content_type, "image/jpeg" ) || !strcasecmp( content_type, "image/jpg" ) ) + { + format = JPEG; + } + else if ( !strcasecmp( content_type, "image/x-rgb" ) ) + { + format = X_RGB; + } + else if ( !strcasecmp( content_type, "image/x-rgbz" ) ) + { + format = X_RGBZ; + } + else + { + Error( "Found unsupported content type '%s'", content_type ); + return( -1 ); + } + + if ( content_length ) + { + while ( buffer.size() < (unsigned int)content_length ) + { + int buffer_len = ReadData( buffer ); + if ( buffer_len == 0 ) + { + Error( "Connection dropped by remote end" ); + return( 0 ); + } + else if ( buffer_len < 0 ) + { + Error( "Unable to read content" ); + return( -1 ); + } + } + Debug( 3, "Got end of image by length, content-length = %d", content_length ); + } + else + { + while ( !content_length ) + { + int buffer_len = ReadData( buffer ); + if ( buffer_len == 0 ) + { + if ( mode == MULTI_IMAGE ) + { + Error( "Connection dropped by remote end" ); + return( 0 ); + } + } + else if ( buffer_len < 0 ) + { + Error( "Unable to read content" ); + return( -1 ); + } + static RegExpr *content_expr = 0; + if ( buffer_len ) + { + if ( mode == MULTI_IMAGE ) + { + if ( !content_expr ) + { + char content_pattern[256] = ""; + snprintf( content_pattern, sizeof(content_pattern), "^(.+?)(?:\r?\n)*(?:--)?%s\r?\n", content_boundary ); + content_expr = new RegExpr( content_pattern, PCRE_DOTALL ); + } + if ( content_expr->Match( buffer, buffer.size() ) == 2 ) + { + content_length = content_expr->MatchLength( 1 ); + Debug( 3, "Got end of image by pattern, content-length = %d", content_length ); + } + } + } + else + { + content_length = buffer.size(); + Debug( 3, "Got end of image by closure, content-length = %d", content_length ); + if ( mode == SINGLE_IMAGE ) + { + if ( !content_expr ) + { + content_expr = new RegExpr( "^(.+?)(?:\r?\n){1,2}?$", PCRE_DOTALL ); + } + if ( content_expr->Match( buffer, buffer.size() ) == 2 ) + { + content_length = content_expr->MatchLength( 1 ); + Debug( 3, "Trimmed end of image, new content-length = %d", content_length ); + } + } + } + } + } + if ( mode == SINGLE_IMAGE ) + { + state = HEADER; + Disconnect(); + } + else + { + state = SUBHEADER; + } + Debug( 3, "Returning %d (%d) bytes of captured content", content_length, buffer.size() ); + return( content_length ); + } + case HEADERCONT : + case SUBHEADERCONT : + { + // Ignore + break; + } + } + } + } + else +#endif // HAVE_LIBPCRE + { + if ( method == REGEXP ) + { + Warning( "Unable to use netcam regexps as not compiled with libpcre" ); + } + static const char *http_match = "HTTP/"; + static const char *connection_match = "Connection:"; + static const char *content_length_match = "Content-length:"; + static const char *content_type_match = "Content-type:"; + static const char *boundary_match = "boundary="; + static int http_match_len = 0; + static int connection_match_len = 0; + static int content_length_match_len = 0; + static int content_type_match_len = 0; + static int boundary_match_len = 0; + + if ( !http_match_len ) + http_match_len = strlen( http_match ); + if ( !connection_match_len ) + connection_match_len = strlen( connection_match ); + if ( !content_length_match_len ) + content_length_match_len = strlen( content_length_match ); + if ( !content_type_match_len ) + content_type_match_len = strlen( content_type_match ); + if ( !boundary_match_len ) + boundary_match_len = strlen( boundary_match ); + + static int n_headers; + //static char *headers[32]; + + static int n_subheaders; + //static char *subheaders[32]; + + static char *http_header; + static char *connection_header; + static char *content_length_header; + static char *content_type_header; + static char *boundary_header; + static char subcontent_length_header[32]; + static char subcontent_type_header[64]; + + static char http_version[16]; + static char status_code[16]; + //static int status; + static char status_mesg[256]; + static char connection_type[32]; + static int content_length; + static char content_type[32]; + static char content_boundary[64]; + static int content_boundary_len; + + while ( true ) + { + switch( state ) + { + case HEADER : + { + n_headers = 0; + http_header = 0; + connection_header = 0; + content_length_header = 0; + content_type_header = 0; + + http_version[0] = '\0'; + status_code [0]= '\0'; + //status = 0; + status_mesg [0]= '\0'; + connection_type [0]= '\0'; + content_length = 0; + content_type[0] = '\0'; + content_boundary[0] = '\0'; + content_boundary_len = 0; + } + case HEADERCONT : + { + int buffer_len = ReadData( buffer ); + if ( buffer_len == 0 ) + { + Error( "Connection dropped by remote end" ); + return( 0 ); + } + else if ( buffer_len < 0 ) + { + Error( "Unable to read header" ); + return( -1 ); + } + + char *crlf = 0; + char *header_ptr = (char *)buffer; + int header_len = buffer.size(); + bool all_headers = false; + + while( true ) + { + int crlf_len = memspn( header_ptr, "\r\n", header_len ); + if ( n_headers ) + { + if ( (crlf_len == 2 && !strncmp( header_ptr, "\n\n", crlf_len )) || (crlf_len == 4 && !strncmp( header_ptr, "\r\n\r\n", crlf_len )) ) + { + *header_ptr = '\0'; + header_ptr += crlf_len; + header_len -= buffer.consume( header_ptr-(char *)buffer ); + all_headers = true; + break; + } + } + if ( crlf_len ) + { + if ( header_len == crlf_len ) + { + break; + } + else + { + *header_ptr = '\0'; + header_ptr += crlf_len; + header_len -= buffer.consume( header_ptr-(char *)buffer ); + } + } + + Debug( 6, "%s", header_ptr ); + if ( (crlf = mempbrk( header_ptr, "\r\n", header_len )) ) + { + //headers[n_headers++] = header_ptr; + n_headers++; + + if ( !http_header && (strncasecmp( header_ptr, http_match, http_match_len ) == 0) ) + { + http_header = header_ptr+http_match_len; + Debug( 6, "Got http header '%s'", header_ptr ); + } + else if ( !connection_header && (strncasecmp( header_ptr, connection_match, connection_match_len) == 0) ) + { + connection_header = header_ptr+connection_match_len; + Debug( 6, "Got connection header '%s'", header_ptr ); + } + else if ( !content_length_header && (strncasecmp( header_ptr, content_length_match, content_length_match_len) == 0) ) + { + content_length_header = header_ptr+content_length_match_len; + Debug( 6, "Got content length header '%s'", header_ptr ); + } + else if ( !content_type_header && (strncasecmp( header_ptr, content_type_match, content_type_match_len) == 0) ) + { + content_type_header = header_ptr+content_type_match_len; + Debug( 6, "Got content type header '%s'", header_ptr ); + } + else + { + Debug( 6, "Got ignored header '%s'", header_ptr ); + } + header_ptr = crlf; + header_len -= buffer.consume( header_ptr-(char *)buffer ); + } + else + { + // No end of line found + break; + } + } + + if ( all_headers ) + { + char *start_ptr, *end_ptr; + + if ( !http_header ) + { + Error( "Unable to extract HTTP status from header" ); + return( -1 ); + } + + start_ptr = http_header; + end_ptr = start_ptr+strspn( start_ptr, "10." ); + + memset( http_version, 0, sizeof(http_version) ); + strncpy( http_version, start_ptr, end_ptr-start_ptr ); + + start_ptr = end_ptr; + start_ptr += strspn( start_ptr, " " ); + end_ptr = start_ptr+strspn( start_ptr, "0123456789" ); + + memset( status_code, 0, sizeof(status_code) ); + strncpy( status_code, start_ptr, end_ptr-start_ptr ); + int status = atoi( status_code ); + + start_ptr = end_ptr; + start_ptr += strspn( start_ptr, " " ); + strcpy( status_mesg, start_ptr ); + + if ( status < 200 || status > 299 ) + { + Error( "Invalid response status %s: %s", status_code, status_mesg ); + return( -1 ); + } + Debug( 3, "Got status '%d' (%s), http version %s", status, status_mesg, http_version ); + + if ( connection_header ) + { + memset( connection_type, 0, sizeof(connection_type) ); + start_ptr = connection_header + strspn( connection_header, " " ); + strcpy( connection_type, start_ptr ); + Debug( 3, "Got connection '%s'", connection_type ); + } + if ( content_length_header ) + { + start_ptr = content_length_header + strspn( content_length_header, " " ); + content_length = atoi( start_ptr ); + Debug( 3, "Got content length '%d'", content_length ); + } + if ( content_type_header ) + { + memset( content_type, 0, sizeof(content_type) ); + start_ptr = content_type_header + strspn( content_type_header, " " ); + if ( (end_ptr = strchr( start_ptr, ';' )) ) + { + strncpy( content_type, start_ptr, end_ptr-start_ptr ); + Debug( 3, "Got content type '%s'", content_type ); + + start_ptr = end_ptr + strspn( end_ptr, "; " ); + + if ( strncasecmp( start_ptr, boundary_match, boundary_match_len ) == 0 ) + { + start_ptr += boundary_match_len; + start_ptr += strspn( start_ptr, "-" ); + content_boundary_len = sprintf( content_boundary, "--%s", start_ptr ); + Debug( 3, "Got content boundary '%s'", content_boundary ); + } + else + { + Error( "No content boundary found in header '%s'", content_type_header ); + } + } + else + { + strcpy( content_type, start_ptr ); + Debug( 3, "Got content type '%s'", content_type ); + } + } + + if ( !strcasecmp( content_type, "image/jpeg" ) || !strcasecmp( content_type, "image/jpg" ) ) + { + // Single image + mode = SINGLE_IMAGE; + format = JPEG; + state = CONTENT; + } + else if ( !strcasecmp( content_type, "image/x-rgb" ) ) + { + // Single image + mode = SINGLE_IMAGE; + format = X_RGB; + state = CONTENT; + } + else if ( !strcasecmp( content_type, "image/x-rgbz" ) ) + { + // Single image + mode = SINGLE_IMAGE; + format = X_RGBZ; + state = CONTENT; + } + else if ( !strcasecmp( content_type, "multipart/x-mixed-replace" ) ) + { + // Image stream, so start processing + if ( !content_boundary[0] ) + { + Error( "No content boundary found in header '%s'", content_type_header ); + return( -1 ); + } + mode = MULTI_IMAGE; + state = SUBHEADER; + } + //else if ( !strcasecmp( content_type, "video/mpeg" ) || !strcasecmp( content_type, "video/mpg" ) ) + //{ + //// MPEG stream, coming soon! + //} + else + { + Error( "Unrecognised content type '%s'", content_type ); + return( -1 ); + } + } + else + { + Debug( 3, "Unable to extract entire header from stream, continuing" ); + state = HEADERCONT; + //return( -1 ); + } + break; + } + case SUBHEADER : + { + n_subheaders = 0; + boundary_header = 0; + subcontent_length_header[0] = '\0'; + subcontent_type_header[0] = '\0'; + content_length = 0; + content_type[0] = '\0'; + } + case SUBHEADERCONT : + { + char *crlf = 0; + char *subheader_ptr = (char *)buffer; + int subheader_len = buffer.size(); + bool all_headers = false; + + while( true ) + { + int crlf_len = memspn( subheader_ptr, "\r\n", subheader_len ); + if ( n_subheaders ) + { + if ( (crlf_len == 2 && !strncmp( subheader_ptr, "\n\n", crlf_len )) || (crlf_len == 4 && !strncmp( subheader_ptr, "\r\n\r\n", crlf_len )) ) + { + *subheader_ptr = '\0'; + subheader_ptr += crlf_len; + subheader_len -= buffer.consume( subheader_ptr-(char *)buffer ); + all_headers = true; + break; + } + } + if ( crlf_len ) + { + if ( subheader_len == crlf_len ) + { + break; + } + else + { + *subheader_ptr = '\0'; + subheader_ptr += crlf_len; + subheader_len -= buffer.consume( subheader_ptr-(char *)buffer ); + } + } + + Debug( 6, "%d: %s", subheader_len, subheader_ptr ); + + if ( (crlf = mempbrk( subheader_ptr, "\r\n", subheader_len )) ) + { + //subheaders[n_subheaders++] = subheader_ptr; + n_subheaders++; + + if ( !boundary_header && (strncasecmp( subheader_ptr, content_boundary, content_boundary_len ) == 0) ) + { + boundary_header = subheader_ptr; + Debug( 4, "Got boundary subheader '%s'", subheader_ptr ); + } + else if ( !subcontent_length_header[0] && (strncasecmp( subheader_ptr, content_length_match, content_length_match_len) == 0) ) + { + strncpy( subcontent_length_header, subheader_ptr+content_length_match_len, sizeof(subcontent_length_header) ); + *(subcontent_length_header+strcspn( subcontent_length_header, "\r\n" )) = '\0'; + Debug( 4, "Got content length subheader '%s'", subcontent_length_header ); + } + else if ( !subcontent_type_header[0] && (strncasecmp( subheader_ptr, content_type_match, content_type_match_len) == 0) ) + { + strncpy( subcontent_type_header, subheader_ptr+content_type_match_len, sizeof(subcontent_type_header) ); + *(subcontent_type_header+strcspn( subcontent_type_header, "\r\n" )) = '\0'; + Debug( 4, "Got content type subheader '%s'", subcontent_type_header ); + } + else + { + Debug( 6, "Got ignored subheader '%s' found", subheader_ptr ); + } + subheader_ptr = crlf; + subheader_len -= buffer.consume( subheader_ptr-(char *)buffer ); + } + else + { + // No line end found + break; + } + } + + if ( all_headers && boundary_header ) + { + char *start_ptr/*, *end_ptr*/; + + Debug( 3, "Got boundary '%s'", boundary_header ); + + if ( subcontent_length_header[0] ) + { + start_ptr = subcontent_length_header + strspn( subcontent_length_header, " " ); + content_length = atoi( start_ptr ); + Debug( 3, "Got subcontent length '%d'", content_length ); + } + if ( subcontent_type_header[0] ) + { + memset( content_type, 0, sizeof(content_type) ); + start_ptr = subcontent_type_header + strspn( subcontent_type_header, " " ); + strcpy( content_type, start_ptr ); + Debug( 3, "Got subcontent type '%s'", content_type ); + } + state = CONTENT; + } + else + { + Debug( 3, "Unable to extract subheader from stream, retrying" ); + int buffer_len = ReadData( buffer ); + if ( buffer_len == 0 ) + { + Error( "Connection dropped by remote end" ); + return( 0 ); + } + else if ( buffer_len < 0 ) + { + Error( "Unable to read subheader" ); + return( -1 ); + } + state = SUBHEADERCONT; + } + break; + } + case CONTENT : + { + if ( !strcasecmp( content_type, "image/jpeg" ) || !strcasecmp( content_type, "image/jpg" ) ) + { + format = JPEG; + } + else if ( !strcasecmp( content_type, "image/x-rgb" ) ) + { + format = X_RGB; + } + else if ( !strcasecmp( content_type, "image/x-rgbz" ) ) + { + format = X_RGBZ; + } + else + { + Error( "Found unsupported content type '%s'", content_type ); + return( -1 ); + } + + if ( format == JPEG && buffer.size() >= 2 ) + { + if ( buffer[0] != 0xff || buffer[1] != 0xd8 ) + { + Error( "Found bogus jpeg header '%02x%02x'", buffer[0], buffer[1] ); + return( -1 ); + } + } + + if ( content_length ) + { + while ( buffer.size() < (unsigned int)content_length ) + { + //int buffer_len = ReadData( buffer, content_length-buffer.size() ); + int buffer_len = ReadData( buffer ); + if ( buffer_len == 0 ) + { + Error( "Connection dropped by remote end" ); + return( 0 ); + } + else if ( buffer_len < 0 ) + { + Error( "Unable to read content" ); + return( -1 ); + } + } + Debug( 3, "Got end of image by length, content-length = %d", content_length ); + } + else + { + int content_pos = 0; + while ( !content_length ) + { + int buffer_len = ReadData( buffer ); + if ( buffer_len == 0 ) + { + if ( mode == MULTI_IMAGE ) + { + Error( "Connection dropped by remote end" ); + return( 0 ); + } + } + else if ( buffer_len < 0 ) + { + Error( "Unable to read content" ); + return( -1 ); + } + int buffer_size = buffer.size(); + if ( buffer_len ) + { + if ( mode == MULTI_IMAGE ) + { + while ( char *start_ptr = (char *)memstr( (char *)buffer+content_pos, "\r\n--", buffer_size-content_pos ) ) + { + content_length = start_ptr - (char *)buffer; + Debug( 3, "Got end of image by pattern (crlf--), content-length = %d", content_length ); + break; + } + } + } + else + { + content_length = buffer_size; + Debug( 3, "Got end of image by closure, content-length = %d", content_length ); + if ( mode == SINGLE_IMAGE ) + { + char *end_ptr = (char *)buffer+buffer_size; + + while( *end_ptr == '\r' || *end_ptr == '\n' ) + { + content_length--; + end_ptr--; + } + + if ( end_ptr != ((char *)buffer+buffer_size) ) + { + Debug( 3, "Trimmed end of image, new content-length = %d", content_length ); + } + } + } + } + } + if ( mode == SINGLE_IMAGE ) + { + state = HEADER; + Disconnect(); + } + else + { + state = SUBHEADER; + } + + if ( format == JPEG && buffer.size() >= 2 ) + { + if ( buffer[0] != 0xff || buffer[1] != 0xd8 ) + { + Error( "Found bogus jpeg header '%02x%02x'", buffer[0], buffer[1] ); + return( -1 ); + } + } + + Debug( 3, "Returning %d (%d) bytes of captured content", content_length, buffer.size() ); + return( content_length ); + } + } + } + } + return( 0 ); +} + +int RemoteCameraHttp::PreCapture() +{ + if ( sd < 0 ) + { + Connect(); + if ( sd < 0 ) + { + Error( "Unable to connect to camera" ); + return( -1 ); + } + mode = SINGLE_IMAGE; + buffer.clear(); + } + if ( mode == SINGLE_IMAGE ) + { + if ( SendRequest() < 0 ) + { + Error( "Unable to send request" ); + Disconnect(); + return( -1 ); + } + } + return( 0 ); +} + +int RemoteCameraHttp::Capture( Image &image ) +{ + int content_length = GetResponse(); + if ( content_length == 0 ) + { + Warning( "Unable to capture image, retrying" ); + return( 1 ); + } + if ( content_length < 0 ) + { + Error( "Unable to get response" ); + Disconnect(); + return( -1 ); + } + switch( format ) + { + case JPEG : + { + if ( !image.DecodeJpeg( buffer.extract( content_length ), content_length, colours, subpixelorder ) ) + { + Error( "Unable to decode jpeg" ); + Disconnect(); + return( -1 ); + } + break; + } + case X_RGB : + { + if ( content_length != image.Size() ) + { + Error( "Image length mismatch, expected %d bytes, content length was %d", image.Size(), content_length ); + Disconnect(); + return( -1 ); + } + image.Assign( width, height, colours, subpixelorder, buffer, imagesize ); + break; + } + case X_RGBZ : + { + if ( !image.Unzip( buffer.extract( content_length ), content_length ) ) + { + Error( "Unable to unzip RGB image" ); + Disconnect(); + return( -1 ); + } + image.Assign( width, height, colours, subpixelorder, buffer, imagesize ); + break; + } + default : + { + Error( "Unexpected image format encountered" ); + Disconnect(); + return( -1 ); + } + } + return( 0 ); +} + +int RemoteCameraHttp::PostCapture() +{ + return( 0 ); +} diff --git a/src/zm_remote_camera_http.h b/src/zm_remote_camera_http.h new file mode 100644 index 000000000..0b161247a --- /dev/null +++ b/src/zm_remote_camera_http.h @@ -0,0 +1,63 @@ +// +// ZoneMinder Remote HTTP Camera Class Interface, $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. +// + +#ifndef ZM_REMOTE_CAMERA_HTTP_H +#define ZM_REMOTE_CAMERA_HTTP_H + +#include "zm_remote_camera.h" + +#include "zm_buffer.h" +#include "zm_regexp.h" +#include "zm_utils.h" + +// +// Class representing 'remote' cameras, i.e. those which are +// accessed over a network connection. +// +class RemoteCameraHttp : public RemoteCamera +{ +protected: + std::string request; + struct timeval timeout; + //struct hostent *hp; + //struct sockaddr_in sa; + int sd; + Buffer buffer; + enum { SINGLE_IMAGE, MULTI_IMAGE } mode; + enum { UNDEF, JPEG, X_RGB, X_RGBZ } format; + enum { HEADER, HEADERCONT, SUBHEADER, SUBHEADERCONT, CONTENT } state; + enum { SIMPLE, REGEXP } method; + +public: + RemoteCameraHttp( int p_id, const std::string &method, const std::string &host, const std::string &port, const std::string &path, int p_width, int p_height, int p_colours, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ); + ~RemoteCameraHttp(); + + void Initialise(); + void Terminate() { Disconnect(); } + int Connect(); + int Disconnect(); + int SendRequest(); + int ReadData( Buffer &buffer, int bytes_expected=0 ); + int GetResponse(); + int PreCapture(); + int Capture( Image &image ); + int PostCapture(); +}; + +#endif // ZM_REMOTE_CAMERA_HTTP_H diff --git a/src/zm_remote_camera_rtsp.cpp b/src/zm_remote_camera_rtsp.cpp new file mode 100644 index 000000000..e352589f6 --- /dev/null +++ b/src/zm_remote_camera_rtsp.cpp @@ -0,0 +1,326 @@ +// +// ZoneMinder Remote Camera Class Implementation, $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. +// + +#include "zm.h" + +#if HAVE_LIBAVFORMAT + +#include "zm_remote_camera_rtsp.h" +#include "zm_ffmpeg.h" +#include "zm_mem_utils.h" + +#include +#include + +RemoteCameraRtsp::RemoteCameraRtsp( int p_id, const std::string &p_method, const std::string &p_host, const std::string &p_port, const std::string &p_path, int p_width, int p_height, int p_colours, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ) : + RemoteCamera( p_id, "rtsp", p_host, p_port, p_path, p_width, p_height, p_colours, p_brightness, p_contrast, p_hue, p_colour, p_capture ), + rtspThread( 0 ) +{ + if ( p_method == "rtpUni" ) + method = RtspThread::RTP_UNICAST; + else if ( p_method == "rtpMulti" ) + method = RtspThread::RTP_MULTICAST; + else if ( p_method == "rtpRtsp" ) + method = RtspThread::RTP_RTSP; + else if ( p_method == "rtpRtspHttp" ) + method = RtspThread::RTP_RTSP_HTTP; + else + Fatal( "Unrecognised method '%s' when creating RTSP camera %d", p_method.c_str(), id ); + + if ( capture ) + { + Initialise(); + } + + mFormatContext = NULL; + mVideoStreamId = -1; + mCodecContext = NULL; + mCodec = NULL; + mRawFrame = NULL; + mFrame = NULL; + frameCount = 0; + +#if HAVE_LIBSWSCALE + mConvertContext = NULL; +#endif + /* Has to be located inside the constructor so other components such as zma will receive correct colours and subpixel order */ + if(colours == ZM_COLOUR_RGB32) { + subpixelorder = ZM_SUBPIX_ORDER_RGBA; + imagePixFormat = PIX_FMT_RGBA; + } else if(colours == ZM_COLOUR_RGB24) { + subpixelorder = ZM_SUBPIX_ORDER_RGB; + imagePixFormat = PIX_FMT_RGB24; + } else if(colours == ZM_COLOUR_GRAY8) { + subpixelorder = ZM_SUBPIX_ORDER_NONE; + imagePixFormat = PIX_FMT_GRAY8; + } else { + Panic("Unexpected colours: %d",colours); + } + +} + +RemoteCameraRtsp::~RemoteCameraRtsp() +{ + av_freep( &mFrame ); + av_freep( &mRawFrame ); + +#if HAVE_LIBSWSCALE + if ( mConvertContext ) + { + sws_freeContext( mConvertContext ); + mConvertContext = NULL; + } +#endif + + if ( mCodecContext ) + { + avcodec_close( mCodecContext ); + mCodecContext = NULL; // Freed by av_close_input_file + } + + if ( capture ) + { + Terminate(); + } +} + +void RemoteCameraRtsp::Initialise() +{ + RemoteCamera::Initialise(); + + int max_size = width*height*colours; + + buffer.size( max_size ); + + if ( logDebugging() ) + av_log_set_level( AV_LOG_DEBUG ); + else + av_log_set_level( AV_LOG_QUIET ); + + av_register_all(); + + Connect(); +} + +void RemoteCameraRtsp::Terminate() +{ + Disconnect(); +} + +int RemoteCameraRtsp::Connect() +{ + rtspThread = new RtspThread( id, method, protocol, host, port, path, auth ); + + rtspThread->start(); + + return( 0 ); +} + +int RemoteCameraRtsp::Disconnect() +{ + if ( rtspThread ) + { + rtspThread->stop(); + rtspThread->join(); + delete rtspThread; + rtspThread = 0; + } + return( 0 ); +} + +int RemoteCameraRtsp::PrimeCapture() +{ + Debug( 2, "Waiting for sources" ); + for ( int i = 0; i < 100 && !rtspThread->hasSources(); i++ ) + { + usleep( 100000 ); + } + if ( !rtspThread->hasSources() ) + Fatal( "No RTSP sources" ); + + Debug( 2, "Got sources" ); + + mFormatContext = rtspThread->getFormatContext(); + + // Find first video stream present + mVideoStreamId = -1; + + for ( unsigned int i = 0; i < mFormatContext->nb_streams; i++ ) +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1) + if ( mFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO ) +#else + if ( mFormatContext->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO ) +#endif + { + mVideoStreamId = i; + break; + } + if ( mVideoStreamId == -1 ) + Fatal( "Unable to locate video stream" ); + + // Get a pointer to the codec context for the video stream + mCodecContext = mFormatContext->streams[mVideoStreamId]->codec; + + // Find the decoder for the video stream + mCodec = avcodec_find_decoder( mCodecContext->codec_id ); + if ( mCodec == NULL ) + Panic( "Unable to locate codec %d decoder", mCodecContext->codec_id ); + + // Open codec +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 7, 0) + if ( avcodec_open( mCodecContext, mCodec ) < 0 ) +#else + if ( avcodec_open2( mCodecContext, mCodec, 0 ) < 0 ) +#endif + Panic( "Can't open codec" ); + + // Allocate space for the native video frame + mRawFrame = avcodec_alloc_frame(); + + // Allocate space for the converted video frame + mFrame = avcodec_alloc_frame(); + + if(mRawFrame == NULL || mFrame == NULL) + Fatal( "Unable to allocate frame(s)"); + + int pSize = avpicture_get_size( imagePixFormat, width, height ); + if( (unsigned int)pSize != imagesize) { + Fatal("Image size mismatch. Required: %d Available: %d",pSize,imagesize); + } + +#if HAVE_LIBSWSCALE + if(!sws_isSupportedInput(mCodecContext->pix_fmt)) { + Fatal("swscale does not support the codec format: %c%c%c%c",(mCodecContext->pix_fmt)&0xff,((mCodecContext->pix_fmt>>8)&0xff),((mCodecContext->pix_fmt>>16)&0xff),((mCodecContext->pix_fmt>>24)&0xff)); + } + + if(!sws_isSupportedOutput(imagePixFormat)) { + Fatal("swscale does not support the target format: %c%c%c%c",(imagePixFormat)&0xff,((imagePixFormat>>8)&0xff),((imagePixFormat>>16)&0xff),((imagePixFormat>>24)&0xff)); + } + +#else // HAVE_LIBSWSCALE + Fatal( "You must compile ffmpeg with the --enable-swscale option to use RTSP cameras" ); +#endif // HAVE_LIBSWSCALE + + + return( 0 ); +} + +int RemoteCameraRtsp::PreCapture() +{ + if ( !rtspThread->isRunning() ) + return( -1 ); + if ( !rtspThread->hasSources() ) + { + Error( "Cannot precapture, no RTP sources" ); + return( -1 ); + } + return( 0 ); +} + +int RemoteCameraRtsp::Capture( Image &image ) +{ + AVPacket packet; + uint8_t* directbuffer; + int frameComplete = false; + + /* Request a writeable buffer of the target image */ + directbuffer = image.WriteBuffer(width, height, colours, subpixelorder); + if(directbuffer == NULL) { + Error("Failed requesting writeable buffer for the captured image."); + return (-1); + } + + while ( true ) + { + buffer.clear(); + if ( !rtspThread->isRunning() ) + return (-1); + + if ( rtspThread->getFrame( buffer ) ) + { + Debug( 3, "Read frame %d bytes", buffer.size() ); + Debug( 4, "Address %p", buffer.head() ); + Hexdump( 4, buffer.head(), 16 ); + + if ( !buffer.size() ) + return( -1 ); + + av_init_packet( &packet ); + + while ( !frameComplete && buffer.size() > 0 ) + { + packet.data = buffer.head(); + packet.size = buffer.size(); + int len = avcodec_decode_video2( mCodecContext, mRawFrame, &frameComplete, &packet ); + if ( len < 0 ) + { + Error( "Error while decoding frame %d", frameCount ); + Hexdump( Logger::ERROR, buffer.head(), buffer.size()>256?256:buffer.size() ); + buffer.clear(); + continue; + } + Debug( 2, "Frame: %d - %d/%d", frameCount, len, buffer.size() ); + //if ( buffer.size() < 400 ) + //Hexdump( 0, buffer.head(), buffer.size() ); + + buffer -= len; + + } + if ( frameComplete ) { + + Debug( 3, "Got frame %d", frameCount ); + + avpicture_fill( (AVPicture *)mFrame, directbuffer, imagePixFormat, width, height); + +#if HAVE_LIBSWSCALE + if(mConvertContext == NULL) { + if(config.cpu_extensions && sseversion >= 20) { + mConvertContext = sws_getContext( mCodecContext->width, mCodecContext->height, mCodecContext->pix_fmt, width, height, imagePixFormat, SWS_BICUBIC | SWS_CPU_CAPS_SSE2, NULL, NULL, NULL ); + } else { + mConvertContext = sws_getContext( mCodecContext->width, mCodecContext->height, mCodecContext->pix_fmt, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL ); + } + if(mConvertContext == NULL) + Fatal( "Unable to create conversion context"); + } + + if ( sws_scale( mConvertContext, mRawFrame->data, mRawFrame->linesize, 0, mCodecContext->height, mFrame->data, mFrame->linesize ) < 0 ) + Fatal( "Unable to convert raw format %u to target format %u at frame %d", mCodecContext->pix_fmt, imagePixFormat, frameCount ); +#else // HAVE_LIBSWSCALE + Fatal( "You must compile ffmpeg with the --enable-swscale option to use RTSP cameras" ); +#endif // HAVE_LIBSWSCALE + + frameCount++; + + } /* frame complete */ + + av_free_packet( &packet ); + } /* getFrame() */ + + if(frameComplete) + return (0); + + } + return (0) ; +} + +int RemoteCameraRtsp::PostCapture() +{ + return( 0 ); +} +#endif // HAVE_LIBAVFORMAT diff --git a/src/zm_remote_camera_rtsp.h b/src/zm_remote_camera_rtsp.h new file mode 100644 index 000000000..3295c9363 --- /dev/null +++ b/src/zm_remote_camera_rtsp.h @@ -0,0 +1,80 @@ +// +// ZoneMinder Remote RTSP Camera Class Interface, $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. +// + +#ifndef ZM_REMOTE_CAMERA_RTSP_H +#define ZM_REMOTE_CAMERA_RTSP_H + +#include "zm_remote_camera.h" + +#include "zm_buffer.h" +#include "zm_utils.h" +#include "zm_rtsp.h" +#include "zm_ffmpeg.h" + +// +// Class representing 'remote' cameras, i.e. those which are +// accessed over a network connection. +// +class RemoteCameraRtsp : public RemoteCamera +{ +protected: + struct sockaddr_in rtsp_sa; + struct sockaddr_in rtcp_sa; + int rtsp_sd; + int rtp_sd; + int rtcp_sd; + + Buffer buffer; + + RtspThread::RtspMethod method; + + RtspThread *rtspThread; + + int frameCount; + +#if HAVE_LIBAVFORMAT + AVFormatContext *mFormatContext; + int mVideoStreamId; + AVCodecContext *mCodecContext; + AVCodec *mCodec; + AVFrame *mRawFrame; + AVFrame *mFrame; + PixelFormat imagePixFormat; +#endif // HAVE_LIBAVFORMAT + +#if HAVE_LIBSWSCALE + struct SwsContext *mConvertContext; +#endif + +public: + RemoteCameraRtsp( int p_id, const std::string &method, const std::string &host, const std::string &port, const std::string &path, int p_width, int p_height, int p_colours, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ); + ~RemoteCameraRtsp(); + + void Initialise(); + void Terminate(); + int Connect(); + int Disconnect(); + + int PrimeCapture(); + int PreCapture(); + int Capture( Image &image ); + int PostCapture(); +}; + +#endif // ZM_REMOTE_CAMERA_RTSP_H diff --git a/src/zm_rgb.h b/src/zm_rgb.h new file mode 100644 index 000000000..bfef10501 --- /dev/null +++ b/src/zm_rgb.h @@ -0,0 +1,157 @@ +// +// ZoneMinder RGB Interface, $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. +// + +#ifndef ZM_RGB_H +#define ZM_RGB_H + +typedef uint32_t Rgb; // RGB colour type + +#define WHITE 0xff +#define WHITE_R 0xff +#define WHITE_G 0xff +#define WHITE_B 0xff + +#define BLACK 0x00 +#define BLACK_R 0x00 +#define BLACK_G 0x00 +#define BLACK_B 0x00 + +#define RGB_WHITE (0x00ffffff) +#define RGB_BLACK (0x00000000) +#define RGB_RED (0x000000ff) +#define RGB_GREEN (0x0000ff00) +#define RGB_BLUE (0x00ff0000) +#define RGB_ORANGE (0x0000a5ff) +#define RGB_PURPLE (0x00800080) +#define RGB_TRANSPARENT (0x01000000) + +#define RGB_VAL(v,c) (((v)>>(16-((c)*8)))&0xff) + +/* RGB or RGBA macros */ +#define BLUE_VAL_RGBA(v) (((v)>>16)&0xff) +#define GREEN_VAL_RGBA(v) (((v)>>8)&0xff) +#define RED_VAL_RGBA(v) ((v)&0xff) +#define ALPHA_VAL_RGBA(v) ((v)>>24)&0xff) +#define RED_PTR_RGBA(ptr) (*((uint8_t*)ptr)) +#define GREEN_PTR_RGBA(ptr) (*((uint8_t*)ptr+1)) +#define BLUE_PTR_RGBA(ptr) (*((uint8_t*)ptr+2)) +#define ALPHA_PTR_RGBA(ptr) (*((uint8_t*)ptr+3)) + +/* BGR or BGRA */ +#define RED_VAL_BGRA(v) (((v)>>16)&0xff) +#define GREEN_VAL_BGRA(v) (((v)>>8)&0xff) +#define BLUE_VAL_BGRA(v) ((v)&0xff) +#define ALPHA_VAL_BGRA(v) ((v)>>24)&0xff) +#define RED_PTR_BGRA(ptr) (*((uint8_t*)ptr+2)) +#define GREEN_PTR_BGRA(ptr) (*((uint8_t*)ptr+1)) +#define BLUE_PTR_BGRA(ptr) (*((uint8_t*)ptr)) +#define ALPHA_PTR_BGRA(ptr) (*((uint8_t*)ptr+3)) + +/* ARGB */ +#define BLUE_VAL_ARGB(v) (((v)>>24)&0xff) +#define GREEN_VAL_ARGB(v) (((v)>>16)&0xff) +#define RED_VAL_ARGB(v) (((v)>>8)&0xff) +#define ALPHA_VAL_ARGB(v) ((v)&0xff) +#define RED_PTR_ARGB(ptr) (*((uint8_t*)ptr+1)) +#define GREEN_PTR_ARGB(ptr) (*((uint8_t*)ptr+2)) +#define BLUE_PTR_ARGB(ptr) (*((uint8_t*)ptr+3)) +#define ALPHA_PTR_ARGB(ptr) (*((uint8_t*)ptr)) + +/* ABGR */ +#define BLUE_VAL_ABGR(v) (((v)>>8)&0xff) +#define GREEN_VAL_ABGR(v) (((v)>>16)&0xff) +#define RED_VAL_ABGR(v) (((v)>>24)&0xff) +#define ALPHA_VAL_ABGR(v) ((v)&0xff) +#define RED_PTR_ABGR(ptr) (*((uint8_t*)ptr+3)) +#define GREEN_PTR_ABGR(ptr) (*((uint8_t*)ptr+2)) +#define BLUE_PTR_ABGR(ptr) (*((uint8_t*)ptr+1)) +#define ALPHA_PTR_ABGR(ptr) (*((uint8_t*)ptr)) + + +#define RGBA_BGRA_ZEROALPHA(v) ((v)&0x00ffffff) +#define ARGB_ABGR_ZEROALPHA(v) ((v)&0xffffff00) + +/* ITU-R BT.709: Y = (0.2126 * R) + (0.7152 * G) + (0.0722 * B) */ +/* ITU-R BT.601: Y = (0.299 * R) + (0.587 * G) + (0.114 * B) */ +/* The formulas below produce an almost identical result to the weighted algorithms from the ITU-R BT.601 standard and the newer ITU-R BT.709 standard, but a lot faster */ +// #define RGB_FASTLUM_SINGLE_ITU709(v) ((RED(v)+RED(v)+BLUE(v)+GREEN(v)+GREEN(v)+GREEN(v)+GREEN(v)+GREEN(v))>>3) +// #define RGB_FASTLUM_VALUES_ITU709(ra,ga,ba) (((ra)+(ra)+(ba)+(ga)+(ga)+(ga)+(ga)+(ga))>>3) +// #define RGB_FASTLUM_SINGLE_ITU601(v) ((RED(v)+RED(v)+RED(v)+BLUE(v)+GREEN(v)+GREEN(v)+GREEN(v)+GREEN(v))>>3) +// #define RGB_FASTLUM_VALUES_ITU601(ra,ga,ba) (((ra)+(ra)+(ra)+(ba)+(ga)+(ga)+(ga)+(ga))>>3) + +/* ZM colours */ +#define ZM_COLOUR_RGB32 4 +#define ZM_COLOUR_RGB24 3 +#define ZM_COLOUR_GRAY8 1 + +/* Subpixel ordering */ +/* Based on byte order naming. For example, for ARGB (on both little endian or big endian) byte+0 should be alpha, byte+1 should be red, and so on. */ +#define ZM_SUBPIX_ORDER_NONE 2 +#define ZM_SUBPIX_ORDER_RGB 6 +#define ZM_SUBPIX_ORDER_BGR 5 +#define ZM_SUBPIX_ORDER_BGRA 7 +#define ZM_SUBPIX_ORDER_RGBA 8 +#define ZM_SUBPIX_ORDER_ABGR 9 +#define ZM_SUBPIX_ORDER_ARGB 10 + +/* A macro to use default subpixel order for a specified colour. */ +/* for grayscale it will use NONE, for 3 colours it will use R,G,B, for 4 colours it will use R,G,B,A */ +#define ZM_SUBPIX_ORDER_DEFAULT_FOR_COLOUR(c) ((c)<<1) + +/* Convert RGB colour value into BGR\ARGB\ABGR */ +inline Rgb rgb_convert(Rgb p_col, int p_subpixorder) { + Rgb result; + + switch(p_subpixorder) { + + case ZM_SUBPIX_ORDER_BGR: + case ZM_SUBPIX_ORDER_BGRA: + { + BLUE_PTR_BGRA(&result) = BLUE_VAL_RGBA(p_col); + GREEN_PTR_BGRA(&result) = GREEN_VAL_RGBA(p_col); + RED_PTR_BGRA(&result) = RED_VAL_RGBA(p_col); + } + break; + case ZM_SUBPIX_ORDER_ARGB: + { + BLUE_PTR_ARGB(&result) = BLUE_VAL_RGBA(p_col); + GREEN_PTR_ARGB(&result) = GREEN_VAL_RGBA(p_col); + RED_PTR_ARGB(&result) = RED_VAL_RGBA(p_col); + } + break; + case ZM_SUBPIX_ORDER_ABGR: + { + BLUE_PTR_ABGR(&result) = BLUE_VAL_RGBA(p_col); + GREEN_PTR_ABGR(&result) = GREEN_VAL_RGBA(p_col); + RED_PTR_ABGR(&result) = RED_VAL_RGBA(p_col); + } + break; + /* Grayscale */ + case ZM_SUBPIX_ORDER_NONE: + result = p_col & 0xff; + break; + default: + return p_col; + break; + } + + return result; +} + +#endif // ZM_RGB_H diff --git a/src/zm_rtp.cpp b/src/zm_rtp.cpp new file mode 100644 index 000000000..2ce21db5a --- /dev/null +++ b/src/zm_rtp.cpp @@ -0,0 +1,22 @@ +// +// ZoneMinder RTP/RTCP Class Implementation, $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. +// + +#include "zm_rtp.h" + +// Blank diff --git a/src/zm_rtp.h b/src/zm_rtp.h new file mode 100644 index 000000000..6fbeeabe6 --- /dev/null +++ b/src/zm_rtp.h @@ -0,0 +1,27 @@ +// +// ZoneMinder RTP/RTCP Class Interface, $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. +// + +#ifndef ZM_RTP_H +#define ZM_RTP_H + +#include "zm.h" + +#define RTP_VERSION 2 + +#endif // ZM_RTP_H diff --git a/src/zm_rtp_ctrl.cpp b/src/zm_rtp_ctrl.cpp new file mode 100644 index 000000000..1d88482d4 --- /dev/null +++ b/src/zm_rtp_ctrl.cpp @@ -0,0 +1,344 @@ +// +// ZoneMinder RTCP Class Implementation, $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. +// + +#include "zm.h" + +#if HAVE_LIBAVFORMAT + +#include "zm_rtp_ctrl.h" + +#include "zm_time.h" +#include "zm_rtsp.h" + +#include + +RtpCtrlThread::RtpCtrlThread( RtspThread &rtspThread, RtpSource &rtpSource ) : mRtspThread( rtspThread ), mRtpSource( rtpSource ), mStop( false ) +{ +} + +int RtpCtrlThread::recvPacket( const unsigned char *packet, ssize_t packetLen ) +{ + const RtcpPacket *rtcpPacket; + rtcpPacket = (RtcpPacket *)packet; + + int consumed = 0; + + //printf( "C: " ); + //for ( int i = 0; i < packetLen; i++ ) + //printf( "%02x ", (unsigned char)packet[i] ); + //printf( "\n" ); + int ver = rtcpPacket->header.version; + int count = rtcpPacket->header.count; + int pt = rtcpPacket->header.pt; + int len = ntohs(rtcpPacket->header.lenN); + + Debug( 5, "RTCP Ver: %d", ver ); + Debug( 5, "RTCP Count: %d", count ); + Debug( 5, "RTCP Pt: %d", pt ); + Debug( 5, "RTCP len: %d", len ); + + switch( pt ) + { + case RTCP_SR : + { + uint32_t ssrc = ntohl(rtcpPacket->body.sr.ssrcN); + + Debug( 5, "RTCP Got SR (%x)", ssrc ); + if ( mRtpSource.getSsrc() ) + { + if ( ssrc != mRtpSource.getSsrc() ) + { + Warning( "Discarding packet for unrecognised ssrc %x", ssrc ); + return( -1 ); + } + } + else if ( ssrc ) + { + mRtpSource.setSsrc( ssrc ); + } + + if ( len > 1 ) + { + //printf( "NTPts:%d.%d, RTPts:%d\n", $ntptsmsb, $ntptslsb, $rtpts ); + uint16_t ntptsmsb = ntohl(rtcpPacket->body.sr.ntpSecN); + uint16_t ntptslsb = ntohl(rtcpPacket->body.sr.ntpFracN); + //printf( "NTPts:%x.%04x, RTPts:%x\n", $ntptsmsb, $ntptslsb, $rtpts ); + //printf( "Pkts:$sendpkts, Octs:$sendocts\n" ); + uint32_t rtpTime = ntohl(rtcpPacket->body.sr.rtpTsN); + + mRtpSource.updateRtcpData( ntptsmsb, ntptslsb, rtpTime ); + } + break; + } + case RTCP_SDES : + { + ssize_t contentLen = packetLen - sizeof(rtcpPacket->header); + while ( contentLen ) + { + Debug( 5, "RTCP CL: %zd", contentLen ); + uint32_t ssrc = ntohl(rtcpPacket->body.sdes.srcN); + + Debug( 5, "RTCP Got SDES (%x), %d items", ssrc, count ); + if ( mRtpSource.getSsrc() && (ssrc != mRtpSource.getSsrc()) ) + { + Warning( "Discarding packet for unrecognised ssrc %x", ssrc ); + return( -1 ); + } + + unsigned char *sdesPtr = (unsigned char *)&rtcpPacket->body.sdes.item; + for ( int i = 0; i < count; i++ ) + { + RtcpSdesItem *item = (RtcpSdesItem *)sdesPtr; + Debug( 5, "RTCP Item length %d", item->len ); + switch( item->type ) + { + case RTCP_SDES_CNAME : + { + std::string cname( item->data, item->len ); + Debug( 5, "RTCP Got CNAME %s", cname.c_str() ); + break; + } + case RTCP_SDES_END : + case RTCP_SDES_NAME : + case RTCP_SDES_EMAIL : + case RTCP_SDES_PHONE : + case RTCP_SDES_LOC : + case RTCP_SDES_TOOL : + case RTCP_SDES_NOTE : + case RTCP_SDES_PRIV : + default : + { + Error( "Received unexpected SDES item type %d, ignoring", item->type ); + return( -1 ); + } + } + int paddedLen = 4+2+item->len+1; // Add null byte + paddedLen = (((paddedLen-1)/4)+1)*4; + Debug( 5, "RTCP PL:%d", paddedLen ); + sdesPtr += paddedLen; + contentLen -= paddedLen; + } + } + break; + } + case RTCP_BYE : + { + Debug( 5, "RTCP Got BYE" ); + mStop = true; + break; + } + case RTCP_RR : + case RTCP_APP : + default : + { + Error( "Received unexpected packet type %d, ignoring", pt ); + return( -1 ); + } + } + consumed = sizeof(uint32_t)*(len+1); + return( consumed ); +} + +int RtpCtrlThread::generateRr( const unsigned char *packet, ssize_t packetLen ) +{ + RtcpPacket *rtcpPacket = (RtcpPacket *)packet; + + int byteLen = sizeof(rtcpPacket->header)+sizeof(rtcpPacket->body.rr)+sizeof(rtcpPacket->body.rr.rr[0]); + int wordLen = ((byteLen-1)/sizeof(uint32_t))+1; + + rtcpPacket->header.version = RTP_VERSION; + rtcpPacket->header.p = 0; + rtcpPacket->header.pt = RTCP_RR; + rtcpPacket->header.count = 1; + rtcpPacket->header.lenN = htons(wordLen-1); + + mRtpSource.updateRtcpStats(); + + Debug( 5, "Ssrc = %d", mRtspThread.getSsrc() ); + Debug( 5, "Ssrc_1 = %d", mRtpSource.getSsrc() ); + Debug( 5, "Last Seq = %d", mRtpSource.getMaxSeq() ); + Debug( 5, "Jitter = %d", mRtpSource.getJitter() ); + Debug( 5, "Last SR = %d", mRtpSource.getLastSrTimestamp() ); + + rtcpPacket->body.rr.ssrcN = htonl(mRtspThread.getSsrc()); + rtcpPacket->body.rr.rr[0].ssrcN = htonl(mRtpSource.getSsrc()); + rtcpPacket->body.rr.rr[0].lost = mRtpSource.getLostPackets(); + rtcpPacket->body.rr.rr[0].fraction = mRtpSource.getLostFraction(); + rtcpPacket->body.rr.rr[0].lastSeqN = htonl(mRtpSource.getMaxSeq()); + rtcpPacket->body.rr.rr[0].jitterN = htonl(mRtpSource.getJitter()); + rtcpPacket->body.rr.rr[0].lsrN = htonl(mRtpSource.getLastSrTimestamp()); + rtcpPacket->body.rr.rr[0].dlsrN = 0; + + return( wordLen*sizeof(uint32_t) ); +} + +int RtpCtrlThread::generateSdes( const unsigned char *packet, ssize_t packetLen ) +{ + RtcpPacket *rtcpPacket = (RtcpPacket *)packet; + + const std::string &cname = mRtpSource.getCname(); + + int byteLen = sizeof(rtcpPacket->header)+sizeof(rtcpPacket->body.sdes)+sizeof(rtcpPacket->body.sdes.item[0])+cname.size(); + int wordLen = ((byteLen-1)/sizeof(uint32_t))+1; + + rtcpPacket->header.version = RTP_VERSION; + rtcpPacket->header.p = 0; + rtcpPacket->header.pt = RTCP_SDES; + rtcpPacket->header.count = 1; + rtcpPacket->header.lenN = htons(wordLen-1); + + rtcpPacket->body.sdes.srcN = htonl(mRtpSource.getSsrc()); + rtcpPacket->body.sdes.item[0].type = RTCP_SDES_CNAME; + rtcpPacket->body.sdes.item[0].len = cname.size(); + memcpy( rtcpPacket->body.sdes.item[0].data, cname.data(), cname.size() ); + + return( wordLen*sizeof(uint32_t) ); +} + +int RtpCtrlThread::generateBye( const unsigned char *packet, ssize_t packetLen ) +{ + RtcpPacket *rtcpPacket = (RtcpPacket *)packet; + + int byteLen = sizeof(rtcpPacket->header)+sizeof(rtcpPacket->body.bye)+sizeof(rtcpPacket->body.bye.srcN[0]); + int wordLen = ((byteLen-1)/sizeof(uint32_t))+1; + + rtcpPacket->header.version = RTP_VERSION; + rtcpPacket->header.p = 0; + rtcpPacket->header.pt = RTCP_BYE; + rtcpPacket->header.count = 1; + rtcpPacket->header.lenN = htons(wordLen-1); + + rtcpPacket->body.bye.srcN[0] = htonl(mRtpSource.getSsrc()); + + return( wordLen*sizeof(uint32_t) ); +} + +int RtpCtrlThread::recvPackets( unsigned char *buffer, ssize_t nBytes ) +{ + unsigned char *bufferPtr = buffer; + + // u_int32 len; /* length of compound RTCP packet in words */ + // rtcp_t *r; /* RTCP header */ + // rtcp_t *end; /* end of compound RTCP packet */ + + // if ((*(u_int16 *)r & RTCP_VALID_MASK) != RTCP_VALID_VALUE) { + // /* something wrong with packet format */ + // } + // end = (rtcp_t *)((u_int32 *)r + len); + + // do r = (rtcp_t *)((u_int32 *)r + r->common.length + 1); + // while (r < end && r->common.version == 2); + + // if (r != end) { + // /* something wrong with packet format */ + // } + + while ( nBytes > 0 ) + { + int consumed = recvPacket( bufferPtr, nBytes ); + if ( consumed <= 0 ) + break; + bufferPtr += consumed; + nBytes -= consumed; + } + return( nBytes ); +} + +int RtpCtrlThread::run() +{ + Debug( 2, "Starting control thread %x on port %d", mRtpSource.getSsrc(), mRtpSource.getLocalCtrlPort() ); + SockAddrInet localAddr, remoteAddr; + + bool sendReports; + UdpInetSocket rtpCtrlServer; + if ( mRtpSource.getLocalHost() != "" ) + { + localAddr.resolve( mRtpSource.getLocalHost().c_str(), mRtpSource.getLocalCtrlPort(), "udp" ); + if ( !rtpCtrlServer.bind( localAddr ) ) + Fatal( "Failed to bind RTCP server" ); + sendReports = false; + Debug( 3, "Bound to %s:%d", mRtpSource.getLocalHost().c_str(), mRtpSource.getLocalCtrlPort() ); + } + else + { + localAddr.resolve( mRtpSource.getLocalCtrlPort(), "udp" ); + if ( !rtpCtrlServer.bind( localAddr ) ) + Fatal( "Failed to bind RTCP server" ); + Debug( 3, "Bound to %s:%d", mRtpSource.getLocalHost().c_str(), mRtpSource.getLocalCtrlPort() ); + remoteAddr.resolve( mRtpSource.getRemoteHost().c_str(), mRtpSource.getRemoteCtrlPort(), "udp" ); + if ( !rtpCtrlServer.connect( remoteAddr ) ) + Fatal( "Failed to connect RTCP server" ); + Debug( 3, "Connected to %s:%d", mRtpSource.getRemoteHost().c_str(), mRtpSource.getRemoteCtrlPort() ); + sendReports = true; + } + + Select select( 10 ); + select.addReader( &rtpCtrlServer ); + + unsigned char buffer[ZM_NETWORK_BUFSIZ]; + while ( !mStop && select.wait() >= 0 ) + { + if ( mStop ) + break; + Select::CommsList readable = select.getReadable(); + if ( readable.size() == 0 ) + { + Error( "RTCP timed out" ); + break; + } + for ( Select::CommsList::iterator iter = readable.begin(); iter != readable.end(); iter++ ) + { + if ( UdpInetSocket *socket = dynamic_cast(*iter) ) + { + ssize_t nBytes = socket->recv( buffer, sizeof(buffer) ); + Debug( 4, "Read %zd bytes on sd %d", nBytes, socket->getReadDesc() ); + + if ( nBytes ) + { + recvPackets( buffer, nBytes ); + + if ( sendReports ) + { + unsigned char *bufferPtr = buffer; + bufferPtr += generateRr( bufferPtr, sizeof(buffer)-(bufferPtr-buffer) ); + bufferPtr += generateSdes( bufferPtr, sizeof(buffer)-(bufferPtr-buffer) ); + Debug( 4, "Sending %zd bytes on sd %d", bufferPtr-buffer, rtpCtrlServer.getWriteDesc() ); + if ( (nBytes = rtpCtrlServer.send( buffer, bufferPtr-buffer )) < 0 ) + Error( "Unable to send: %s", strerror( errno ) ); + //Debug( 4, "Sent %d bytes on sd %d", nBytes, rtpCtrlServer.getWriteDesc() ); + } + } + else + { + mStop = true; + break; + } + } + else + { + Panic( "Barfed" ); + } + } + } + rtpCtrlServer.close(); + mRtspThread.stop(); + return( 0 ); +} + +#endif // HAVE_LIBAVFORMAT diff --git a/src/zm_rtp_ctrl.h b/src/zm_rtp_ctrl.h new file mode 100644 index 000000000..9b44b752b --- /dev/null +++ b/src/zm_rtp_ctrl.h @@ -0,0 +1,157 @@ +// +// ZoneMinder RTCP Class Interface, $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. +// + +#ifndef ZM_RTP_CTRL_H +#define ZM_RTP_CTRL_H + +#include "zm_rtp.h" +#include "zm_comms.h" +#include "zm_thread.h" + +// Defined in ffmpeg rtp.h +//#define RTP_MAX_SDES 255 // maximum text length for SDES + +// Big-endian mask for version, padding bit and packet type pair +#define RTCP_VALID_MASK (0xc000 | 0x2000 | 0xfe) +#define RTCP_VALID_VALUE ((RTP_VERSION << 14) | RTCP_SR) + +class RtspThread; +class RtpSource; + +class RtpCtrlThread : public Thread +{ +friend class RtspThread; + +private: + typedef enum + { + RTCP_SR = 200, + RTCP_RR = 201, + RTCP_SDES = 202, + RTCP_BYE = 203, + RTCP_APP = 204 + } RtcpType; + + typedef enum + { + RTCP_SDES_END = 0, + RTCP_SDES_CNAME = 1, + RTCP_SDES_NAME = 2, + RTCP_SDES_EMAIL = 3, + RTCP_SDES_PHONE = 4, + RTCP_SDES_LOC = 5, + RTCP_SDES_TOOL = 6, + RTCP_SDES_NOTE = 7, + RTCP_SDES_PRIV = 8 + } RtcpSdesType; + + struct RtcpCommonHeader + { + uint8_t count:5; // varies by packet type + uint8_t p:1; // padding flag + uint8_t version:2; // protocol version + uint8_t pt; // RTCP packet type + uint16_t lenN; // pkt len in words, w/o this word, network order + }; + + // Reception report block + struct RtcpRr + { + uint32_t ssrcN; // data source being reported + int32_t lost:24; // cumul. no. pkts lost (signed!) + uint32_t fraction:8; // fraction lost since last SR/RR + uint32_t lastSeqN; // extended last seq. no. received, network order + uint32_t jitterN; // interarrival jitter, network order + uint32_t lsrN; // last SR packet from this source, network order + uint32_t dlsrN; // delay since last SR packet, network order + }; + + // SDES item + struct RtcpSdesItem + { + uint8_t type; // type of item (rtcp_sdes_type_t) + uint8_t len; // length of item (in octets) + char data[]; // text, not null-terminated + }; + + // RTCP packet + struct RtcpPacket + { + RtcpCommonHeader header; // common header + union + { + // Sender Report (SR) + struct Sr + { + uint32_t ssrcN; // sender generating this report, network order + uint32_t ntpSecN; // NTP timestamp, network order + uint32_t ntpFracN; + uint32_t rtpTsN; // RTP timestamp, network order + uint32_t pSentN; // packets sent, network order + uint32_t oSentN; // octets sent, network order + RtcpRr rr[]; // variable-length list + } sr; + + // Reception Report (RR) + struct Rr + { + uint32_t ssrcN; // receiver generating this report + RtcpRr rr[]; // variable-length list + } rr; + + // source description (SDES) + struct Sdes + { + uint32_t srcN; // first SSRC/CSRC + RtcpSdesItem item[]; // list of SDES items + } sdes; + + // BYE + struct Bye + { + uint32_t srcN[]; // list of sources + // can't express trailing text for reason (what does this mean? it's not even english!) + } bye; + } body; + }; + +private: + RtspThread &mRtspThread; + RtpSource &mRtpSource; + int mPort; + bool mStop; + +private: + int recvPacket( const unsigned char *packet, ssize_t packetLen ); + int generateRr( const unsigned char *packet, ssize_t packetLen ); + int generateSdes( const unsigned char *packet, ssize_t packetLen ); + int generateBye( const unsigned char *packet, ssize_t packetLen ); + int recvPackets( unsigned char *buffer, ssize_t nBytes ); + int run(); + +public: + RtpCtrlThread( RtspThread &rtspThread, RtpSource &rtpSource ); + + void stop() + { + mStop = true; + } +}; + +#endif // ZM_RTP_CTRL_H diff --git a/src/zm_rtp_data.cpp b/src/zm_rtp_data.cpp new file mode 100644 index 000000000..257f46947 --- /dev/null +++ b/src/zm_rtp_data.cpp @@ -0,0 +1,120 @@ +// +// ZoneMinder RTP Data Class Implementation, $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. +// + +#include "zm.h" + +#if HAVE_LIBAVFORMAT + +#include "zm_rtp_data.h" + +#include "zm_rtsp.h" + +#include + +RtpDataThread::RtpDataThread( RtspThread &rtspThread, RtpSource &rtpSource ) : mRtspThread( rtspThread ), mRtpSource( rtpSource ), mStop( false ) +{ +} + +bool RtpDataThread::recvPacket( const unsigned char *packet, size_t packetLen ) +{ + const RtpDataHeader *rtpHeader; + rtpHeader = (RtpDataHeader *)packet; + + //printf( "D: " ); + //for ( int i = 0; i < 32; i++ ) + //printf( "%02x ", (unsigned char)packet[i] ); + //printf( "\n" ); + + Debug( 5, "Ver: %d", rtpHeader->version ); + Debug( 5, "P: %d", rtpHeader->p ); + Debug( 5, "Pt: %d", rtpHeader->pt ); + Debug( 5, "Mk: %d", rtpHeader->m ); + Debug( 5, "Seq: %d", ntohs(rtpHeader->seqN) ); + Debug( 5, "T/S: %x", ntohl(rtpHeader->timestampN) ); + Debug( 5, "SSRC: %x", ntohl(rtpHeader->ssrcN) ); + + //unsigned short seq = ntohs(rtpHeader->seqN); + unsigned long ssrc = ntohl(rtpHeader->ssrcN); + + if ( mRtpSource.getSsrc() && (ssrc != mRtpSource.getSsrc()) ) + { + Warning( "Discarding packet for unrecognised ssrc %lx", ssrc ); + return( false ); + } + + return( mRtpSource.handlePacket( packet, packetLen ) ); +} + +int RtpDataThread::run() +{ + Debug( 2, "Starting data thread %d on port %d", mRtpSource.getSsrc(), mRtpSource.getLocalDataPort() ); + + SockAddrInet localAddr; + UdpInetServer rtpDataSocket; + if ( mRtpSource.getLocalHost() != "" ) + localAddr.resolve( mRtpSource.getLocalHost().c_str(), mRtpSource.getLocalDataPort(), "udp" ); + else + localAddr.resolve( mRtpSource.getLocalDataPort(), "udp" ); + if ( !rtpDataSocket.bind( localAddr ) ) + Fatal( "Failed to bind RTP server" ); + Debug( 3, "Bound to %s:%d", mRtpSource.getLocalHost().c_str(), mRtpSource.getLocalDataPort() ); + + Select select( 3 ); + select.addReader( &rtpDataSocket ); + + unsigned char buffer[ZM_NETWORK_BUFSIZ]; + while ( !mStop && select.wait() >= 0 ) + { + if ( mStop ) + break; + Select::CommsList readable = select.getReadable(); + if ( readable.size() == 0 ) + { + Error( "RTP timed out" ); + mStop = true; + break; + } + for ( Select::CommsList::iterator iter = readable.begin(); iter != readable.end(); iter++ ) + { + if ( UdpInetServer *socket = dynamic_cast(*iter) ) + { + int nBytes = socket->recv( buffer, sizeof(buffer) ); + Debug( 4, "Got %d bytes on sd %d", nBytes, socket->getReadDesc() ); + if ( nBytes ) + { + recvPacket( buffer, nBytes ); + } + else + { + mStop = true; + break; + } + } + else + { + Panic( "Barfed" ); + } + } + } + rtpDataSocket.close(); + mRtspThread.stop(); + return( 0 ); +} + +#endif // HAVE_LIBAVFORMAT diff --git a/src/zm_rtp_data.h b/src/zm_rtp_data.h new file mode 100644 index 000000000..6c957a3ad --- /dev/null +++ b/src/zm_rtp_data.h @@ -0,0 +1,67 @@ +// +// ZoneMinder RTP Data Class Interface, $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. +// + +#ifndef ZM_RTP_DATA_H +#define ZM_RTP_DATA_H + +#include "zm_thread.h" +#include "zm_buffer.h" + +#include + +class RtspThread; +class RtpSource; + +struct RtpDataHeader +{ + uint8_t cc:4; // CSRC count + uint8_t x:1; // header extension flag + uint8_t p:1; // padding flag + uint8_t version:2; // protocol version + uint8_t pt:7; // payload type + uint8_t m:1; // marker bit + uint16_t seqN; // sequence number, network order + uint32_t timestampN; // timestamp, network order + uint32_t ssrcN; // synchronization source, network order + uint32_t csrc[]; // optional CSRC list +}; + +class RtpDataThread : public Thread +{ +friend class RtspThread; + +private: + RtspThread &mRtspThread; + RtpSource &mRtpSource; + bool mStop; + +private: + bool recvPacket( const unsigned char *packet, size_t packetLen ); + int run(); + +public: + RtpDataThread( RtspThread &rtspThread, RtpSource &rtpSource ); + + void stop() + { + mStop = true; + } +}; + +#endif // ZM_RTP_DATA_H diff --git a/src/zm_rtp_source.cpp b/src/zm_rtp_source.cpp new file mode 100644 index 000000000..4f53327df --- /dev/null +++ b/src/zm_rtp_source.cpp @@ -0,0 +1,325 @@ +// +// ZoneMinder RTP Source Class Implementation, $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. +// + +#include "zm_rtp_source.h" + +#include "zm_time.h" +#include "zm_rtp_data.h" + +#include + +RtpSource::RtpSource( int id, const std::string &localHost, int localPortBase, const std::string &remoteHost, int remotePortBase, uint32_t ssrc, uint16_t seq, uint32_t rtpClock, uint32_t rtpTime ) : + mId( id ), + mSsrc( ssrc ), + mLocalHost( localHost ), + mRemoteHost( remoteHost ), + mRtpClock( rtpClock ), + mFrame( 65536 ), + mFrameCount( 0 ), + mFrameGood( true ), + mFrameReady( false ), + mFrameProcessed( false ) +{ + char hostname[256] = ""; + gethostname( hostname, sizeof(hostname) ); + + mCname = stringtf( "zm-%d@%s", mId, hostname ); + Debug( 3, "RTP CName = %s", mCname.c_str() ); + + init( seq ); + mMaxSeq = seq - 1; + mProbation = MIN_SEQUENTIAL; + + mLocalPortChans[0] = localPortBase; + mLocalPortChans[1] = localPortBase+1; + + mRemotePortChans[0] = remotePortBase; + mRemotePortChans[1] = remotePortBase+1; + + mRtpFactor = mRtpClock; + + mBaseTimeReal = tvNow(); + mBaseTimeNtp = tvZero(); + mBaseTimeRtp = rtpTime; + + mLastSrTimeReal = tvZero(); + mLastSrTimeNtp = tvZero(); + mLastSrTimeRtp = 0; +} + +void RtpSource::init( uint16_t seq ) +{ + Debug( 3, "Initialising sequence" ); + mBaseSeq = seq; + mMaxSeq = seq; + mBadSeq = RTP_SEQ_MOD + 1; // so seq == mBadSeq is false + mCycles = 0; + mReceivedPackets = 0; + mReceivedPrior = 0; + mExpectedPrior = 0; + // other initialization + mJitter = 0; + mTransit = 0; +} + +bool RtpSource::updateSeq( uint16_t seq ) +{ + uint16_t uDelta = seq - mMaxSeq; + + // Source is not valid until MIN_SEQUENTIAL packets with + // sequential sequence numbers have been received. + Debug( 5, "Seq: %d", seq ); + + if ( mProbation) + { + // packet is in sequence + if ( seq == mMaxSeq + 1) + { + Debug( 3, "Sequence in probation %d, in sequence", mProbation ); + mProbation--; + mMaxSeq = seq; + if ( mProbation == 0 ) + { + init( seq ); + mReceivedPackets++; + return( true ); + } + } + else + { + Warning( "Sequence in probation %d, out of sequence", mProbation ); + mProbation = MIN_SEQUENTIAL - 1; + mMaxSeq = seq; + return( false ); + } + return( true ); + } + else if ( uDelta < MAX_DROPOUT ) + { + if ( uDelta == 1 ) + { + Debug( 3, "Packet in sequence, gap %d", uDelta ); + } + else + { + Warning( "Packet in sequence, gap %d", uDelta ); + } + + // in order, with permissible gap + if ( seq < mMaxSeq ) + { + // Sequence number wrapped - count another 64K cycle. + mCycles += RTP_SEQ_MOD; + } + mMaxSeq = seq; + } + else if ( uDelta <= RTP_SEQ_MOD - MAX_MISORDER ) + { + Warning( "Packet out of sequence, gap %d", uDelta ); + // the sequence number made a very large jump + if ( seq == mBadSeq ) + { + Debug( 3, "Restarting sequence" ); + // Two sequential packets -- assume that the other side + // restarted without telling us so just re-sync + // (i.e., pretend this was the first packet). + init( seq ); + } + else + { + mBadSeq = (seq + 1) & (RTP_SEQ_MOD-1); + return( false ); + } + } + else + { + Warning( "Packet duplicate or reordered, gap %d", uDelta ); + // duplicate or reordered packet + return( false ); + } + mReceivedPackets++; + return( uDelta==1?true:false ); +} + +void RtpSource::updateJitter( const RtpDataHeader *header ) +{ + if ( mRtpFactor > 0 ) + { + Debug( 5, "Delta rtp = %.6f", tvDiffSec( mBaseTimeReal ) ); + uint32_t localTimeRtp = mBaseTimeRtp + uint32_t( tvDiffSec( mBaseTimeReal ) * mRtpFactor ); + Debug( 5, "Local RTP time = %x", localTimeRtp ); + Debug( 5, "Packet RTP time = %x", ntohl(header->timestampN) ); + uint32_t packetTransit = localTimeRtp - ntohl(header->timestampN); + Debug( 5, "Packet transit RTP time = %x", packetTransit ); + + if ( mTransit > 0 ) + { + // Jitter + int d = packetTransit - mTransit; + Debug( 5, "Jitter D = %d", d ); + if ( d < 0 ) + d = -d; + //mJitter += (1./16.) * ((double)d - mJitter); + mJitter += d - ((mJitter + 8) >> 4); + } + mTransit = packetTransit; + } + else + { + mJitter = 0; + } + Debug( 5, "RTP Jitter: %d", mJitter ); +} + +void RtpSource::updateRtcpData( uint32_t ntpTimeSecs, uint32_t ntpTimeFrac, uint32_t rtpTime ) +{ + struct timeval ntpTime = tvMake( ntpTimeSecs, suseconds_t((USEC_PER_SEC*(ntpTimeFrac>>16))/(1<<16)) ); + + Debug( 5, "ntpTime: %ld.%06ld, rtpTime: %x", ntpTime.tv_sec, ntpTime.tv_usec, rtpTime ); + + if ( mBaseTimeNtp.tv_sec == 0 ) + { + mBaseTimeReal = tvNow(); + mBaseTimeNtp = ntpTime; + mBaseTimeRtp = rtpTime; + } + else if ( !mRtpClock ) + { + Debug( 5, "lastSrNtpTime: %ld.%06ld, rtpTime: %x", mLastSrTimeNtp.tv_sec, mLastSrTimeNtp.tv_usec, rtpTime ); + Debug( 5, "ntpTime: %ld.%06ld, rtpTime: %x", ntpTime.tv_sec, ntpTime.tv_usec, rtpTime ); + + double diffNtpTime = tvDiffSec( mBaseTimeNtp, ntpTime ); + uint32_t diffRtpTime = rtpTime - mBaseTimeRtp; + + //Debug( 5, "Real-diff: %.6f", diffRealTime ); + Debug( 5, "NTP-diff: %.6f", diffNtpTime ); + Debug( 5, "RTP-diff: %d", diffRtpTime ); + + mRtpFactor = (uint32_t)(diffRtpTime / diffNtpTime); + + Debug( 5, "RTPfactor: %d", mRtpFactor ); + } + mLastSrTimeNtpSecs = ntpTimeSecs; + mLastSrTimeNtpFrac = ntpTimeFrac; + mLastSrTimeNtp = ntpTime; + mLastSrTimeRtp = rtpTime; +} + +void RtpSource::updateRtcpStats() +{ + uint32_t extendedMax = mCycles + mMaxSeq; + mExpectedPackets = extendedMax - mBaseSeq + 1; + + Debug( 5, "Expected packets = %d", mExpectedPackets ); + + // The number of packets lost is defined to be the number of packets + // expected less the number of packets actually received: + mLostPackets = mExpectedPackets - mReceivedPackets; + Debug( 5, "Lost packets = %d", mLostPackets ); + + uint32_t expectedInterval = mExpectedPackets - mExpectedPrior; + Debug( 5, "Expected interval = %d", expectedInterval ); + mExpectedPrior = mExpectedPackets; + uint32_t receivedInterval = mReceivedPackets - mReceivedPrior; + Debug( 5, "Received interval = %d", receivedInterval ); + mReceivedPrior = mReceivedPackets; + uint32_t lostInterval = expectedInterval - receivedInterval; + Debug( 5, "Lost interval = %d", lostInterval ); + + if ( expectedInterval == 0 || lostInterval <= 0 ) + mLostFraction = 0; + else + mLostFraction = (lostInterval << 8) / expectedInterval; + Debug( 5, "Lost fraction = %d", mLostFraction ); +} + +bool RtpSource::handlePacket( const unsigned char *packet, size_t packetLen ) +{ + const RtpDataHeader *rtpHeader; + rtpHeader = (RtpDataHeader *)packet; + + if ( updateSeq( ntohs(rtpHeader->seqN) ) ) + { + Hexdump( 4, packet+sizeof(RtpDataHeader), 16 ); + if ( mFrameGood ) + mFrame.append( packet+sizeof(RtpDataHeader), packetLen-sizeof(RtpDataHeader) ); + Hexdump( 4, mFrame.head(), 16 ); + + if ( rtpHeader->m ) + { + if ( mFrameGood ) + { + Debug( 2, "Got new frame %d, %d bytes", mFrameCount, mFrame.size() ); + + mFrameProcessed.setValueImmediate( false ); + mFrameReady.updateValueSignal( true ); + if ( !mFrameProcessed.getValueImmediate() ) + { + for ( int count = 0; !mFrameProcessed.getUpdatedValue( 1 ); count++ ) + if( count > 1 ) + return( false ); + } + mFrameCount++; + } + else + { + Warning( "Discarding incomplete frame %d, %d bytes", mFrameCount, mFrame.size() ); + } + mFrame.clear(); + } + } + else + { + if ( mFrame.size() ) + { + Warning( "Discarding partial frame %d, %d bytes", mFrameCount, mFrame.size() ); + } + else + { + Warning( "Discarding frame %d", mFrameCount ); + } + mFrameGood = false; + mFrame.clear(); + } + if ( rtpHeader->m ) + { + mFrameGood = true; + } + + updateJitter( rtpHeader ); + + return( true ); +} + +bool RtpSource::getFrame( Buffer &buffer ) +{ + Debug( 3, "Getting frame" ); + if ( !mFrameReady.getValueImmediate() ) + { + // Allow for a couple of spurious returns + for ( int count = 0; !mFrameReady.getUpdatedValue( 1 ); count++ ) + if ( count > 1 ) + return( false ); + } + buffer = mFrame; + mFrameReady.setValueImmediate( false ); + mFrameProcessed.updateValueSignal( true ); + Debug( 3, "Copied %d bytes", buffer.size() ); + return( true ); +} diff --git a/src/zm_rtp_source.h b/src/zm_rtp_source.h new file mode 100644 index 000000000..7d4143697 --- /dev/null +++ b/src/zm_rtp_source.h @@ -0,0 +1,179 @@ +// +// ZoneMinder RTP Source Class Interface, $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. +// + +#ifndef ZM_RTP_SOURCE_H +#define ZM_RTP_SOURCE_H + +#include "zm_buffer.h" +#include "zm_thread.h" + +#include +#include +#include + +struct RtpDataHeader; + +class RtpSource +{ +public: + typedef enum { EMPTY, FILLING, READY } FrameState; +private: + static const int RTP_SEQ_MOD = 1<<16; + static const int MAX_DROPOUT = 3000; + static const int MAX_MISORDER = 100; + static const int MIN_SEQUENTIAL = 2; + +private: + // Identity + int mId; // General id (usually monitor id) + std::string mCname; // Canonical name, for SDES + + // RTP/RTCP fields + uint32_t mSsrc; + uint16_t mMaxSeq; // highest seq. number seen + uint32_t mCycles; // shifted count of seq. number cycles + uint32_t mBaseSeq; // base seq number + uint32_t mBadSeq; // last 'bad' seq number + 1 + uint32_t mProbation; // sequ. packets till source is valid + uint32_t mReceivedPackets; // packets received + uint32_t mExpectedPrior; // packet expected at last interval + uint32_t mReceivedPrior; // packet received at last interval + uint32_t mTransit; // relative trans time for prev pkt + uint32_t mJitter; // estimated jitter + + // Ports/Channels + std::string mLocalHost; + int mLocalPortChans[2]; + std::string mRemoteHost; + int mRemotePortChans[2]; + + // Time keys + uint32_t mRtpClock; + uint32_t mRtpFactor; + struct timeval mBaseTimeReal; + struct timeval mBaseTimeNtp; + uint32_t mBaseTimeRtp; + + struct timeval mLastSrTimeReal; + uint32_t mLastSrTimeNtpSecs; + uint32_t mLastSrTimeNtpFrac; + struct timeval mLastSrTimeNtp; + uint32_t mLastSrTimeRtp; + + // Stats, intermittently updated + uint32_t mExpectedPackets; + uint32_t mLostPackets; + uint8_t mLostFraction; + + Buffer mFrame; + int mFrameCount; + bool mFrameGood; + ThreadData mFrameReady; + ThreadData mFrameProcessed; + +private: + void init( uint16_t seq ); + +public: + RtpSource( int id, const std::string &localHost, int localPortBase, const std::string &remoteHost, int remotePortBase, uint32_t ssrc, uint16_t seq, uint32_t rtpClock, uint32_t rtpTime ); + bool updateSeq( uint16_t seq ); + void updateJitter( const RtpDataHeader *header ); + void updateRtcpData( uint32_t ntpTimeSecs, uint32_t ntpTimeFrac, uint32_t rtpTime ); + void updateRtcpStats(); + + bool handlePacket( const unsigned char *packet, size_t packetLen ); + + uint32_t getSsrc() const + { + return( mSsrc ); + } + void setSsrc( uint32_t ssrc ) + { + mSsrc = ssrc; + } + + bool getFrame( Buffer &buffer ); + + const std::string &getCname() const + { + return( mCname ); + } + + const std::string &getLocalHost() const + { + return( mLocalHost ); + } + + int getLocalDataPort() const + { + return( mLocalPortChans[0] ); + } + + int getLocalCtrlPort() const + { + return( mLocalPortChans[1] ); + } + + const std::string &getRemoteHost() const + { + return( mRemoteHost ); + } + + int getRemoteDataPort() const + { + return( mRemotePortChans[0] ); + } + + int getRemoteCtrlPort() const + { + return( mRemotePortChans[1] ); + } + + uint32_t getMaxSeq() const + { + return( mCycles + mMaxSeq ); + } + + uint32_t getExpectedPackets() const + { + return( mExpectedPackets ); + } + + uint32_t getLostPackets() const + { + return( mLostPackets ); + } + + uint8_t getLostFraction() const + { + return( mLostFraction ); + } + + uint32_t getJitter() const + { + return( mJitter >> 4 ); + } + + uint32_t getLastSrTimestamp() const + { + return( ((mLastSrTimeNtpSecs&0xffff)<<16)|(mLastSrTimeNtpFrac>>16) ); + } +}; + +#endif // ZM_RTP_SOURCE_H diff --git a/src/zm_rtsp.cpp b/src/zm_rtsp.cpp new file mode 100644 index 000000000..a86c8bbb0 --- /dev/null +++ b/src/zm_rtsp.cpp @@ -0,0 +1,719 @@ +// +// ZoneMinder RTSP Class Implementation, $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. +// + +#include "zm.h" + +#if HAVE_LIBAVFORMAT + +#include "zm_rtsp.h" + +#include "zm_rtp_data.h" +#include "zm_rtp_ctrl.h" +#include "zm_db.h" +#include "zm_sdp.h" + +#include +#include +#include +#include + +int RtspThread::smMinDataPort = 0; +int RtspThread::smMaxDataPort = 0; +RtspThread::PortSet RtspThread::smAssignedPorts; + +bool RtspThread::sendCommand( std::string message ) +{ + if ( !mAuth.empty() ) + message += stringtf( "Authorization: Basic %s\r\n", mAuth64.c_str() ); + message += stringtf( "User-Agent: ZoneMinder/%s\r\n", ZM_VERSION ); + message += stringtf( "CSeq: %d\r\n\r\n", ++mSeq ); + Debug( 2, "Sending RTSP message: %s", message.c_str() ); + if ( mMethod == RTP_RTSP_HTTP ) + { + message = base64Encode( message ); + Debug( 2, "Sending encoded RTSP message: %s", message.c_str() ); + if ( mRtspSocket2.send( message.c_str(), message.size() ) != (int)message.length() ) + { + Error( "Unable to send message '%s': %s", message.c_str(), strerror(errno) ); + return( false ); + } + } + else + { + if ( mRtspSocket.send( message.c_str(), message.size() ) != (int)message.length() ) + { + Error( "Unable to send message '%s': %s", message.c_str(), strerror(errno) ); + return( false ); + } + } + return( true ); +} + +bool RtspThread::recvResponse( std::string &response ) +{ + if ( mRtspSocket.recv( response ) < 0 ) + Error( "Recv failed; %s", strerror(errno) ); + Debug( 2, "Received RTSP response: %s (%zd bytes)", response.c_str(), response.size() ); + float respVer = 0; + int respCode = -1; + char respText[ZM_NETWORK_BUFSIZ]; + if ( sscanf( response.c_str(), "RTSP/%f %3d %[^\r\n]\r\n", &respVer, &respCode, respText ) != 3 ) + { + if ( isalnum(response[0]) ) + { + Error( "Response parse failure in '%s'", response.c_str() ); + } + else + { + Error( "Response parse failure, %zd bytes follow", response.size() ); + if ( response.size() ) + Hexdump( Logger::ERROR, response.data(), min(response.size(),16) ); + } + return( false ); + } + if ( respCode != 200 ) + { + Error( "Unexpected response code %d, text is '%s'", respCode, respText ); + return( false ); + } + return( true ); +} + +int RtspThread::requestPorts() +{ + if ( !smMinDataPort ) + { + char sql[ZM_SQL_SML_BUFSIZ]; + strncpy( sql, "select Id from Monitors where Function != 'None' and Type = 'Remote' and Protocol = 'rtsp' and Method = 'rtpUni' order by Id asc", sizeof(sql) ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int nMonitors = mysql_num_rows( result ); + int position = 0; + if ( nMonitors ) + { + for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) + { + int id = atoi(dbrow[0]); + if ( mId == id ) + { + position = i; + break; + } + } + } + else + { + // Minor hack for testing when not strictly enabled + nMonitors = 1; + position = 0; + } + int portRange = int(((config.max_rtp_port-config.min_rtp_port)+1)/nMonitors); + smMinDataPort = config.min_rtp_port + (position * portRange); + smMaxDataPort = smMinDataPort + portRange - 1; + Debug( 2, "Assigned RTP port range is %d-%d", smMinDataPort, smMaxDataPort ); + } + for ( int i = smMinDataPort; i <= smMaxDataPort; i++ ) + { + PortSet::const_iterator iter = smAssignedPorts.find( i ); + if ( iter == smAssignedPorts.end() ) + { + smAssignedPorts.insert( i ); + return( i ); + } + } + Panic( "Can assign RTP port, no ports left in pool" ); + return( -1 ); +} + +void RtspThread::releasePorts( int port ) +{ + if ( port > 0 ) + smAssignedPorts.erase( port ); +} + +RtspThread::RtspThread( int id, RtspMethod method, const std::string &protocol, const std::string &host, const std::string &port, const std::string &path, const std::string &auth ) : + mId( id ), + mMethod( method ), + mProtocol( protocol ), + mHost( host ), + mPort( port ), + mPath( path ), + mAuth( auth ), + mFormatContext( 0 ), + mSeq( 0 ), + mSession( 0 ), + mSsrc( 0 ), + mDist( UNDEFINED ), + mRtpTime( 0 ), + mStop( false ) +{ + mUrl = mProtocol+"://"+mHost+":"+mPort; + if ( !mPath.empty() ) + { + if ( mPath[0] == '/' ) + mUrl += mPath; + else + mUrl += '/'+mPath; + } + + mSsrc = rand(); + + Debug( 2, "RTSP Local SSRC is %x", mSsrc ); + + if ( mMethod == RTP_RTSP_HTTP ) + mHttpSession = stringtf( "%d", rand() ); + + if ( !mAuth.empty() ) + mAuth64 = base64Encode( mAuth ); +} + +RtspThread::~RtspThread() +{ +} + +int RtspThread::run() +{ + std::string message; + std::string response; + + response.reserve( ZM_NETWORK_BUFSIZ ); + + if ( !mRtspSocket.connect( mHost.c_str(), strtol( mPort.c_str(), NULL, 10 ) ) ) + Fatal( "Unable to connect RTSP socket" ); + //Select select( 0.25 ); + //select.addReader( &mRtspSocket ); + //while ( select.wait() ) + //{ + //mRtspSocket.recv( response ); + //Debug( 4, "Drained %d bytes from RTSP socket", response.size() ); + //} + + if ( mMethod == RTP_RTSP_HTTP ) + { + if ( !mRtspSocket2.connect( mHost.c_str(), strtol( mPort.c_str(), NULL, 10 ) ) ) + Fatal( "Unable to connect auxiliary RTSP/HTTP socket" ); + //Select select( 0.25 ); + //select.addReader( &mRtspSocket2 ); + //while ( select.wait() ) + //{ + //mRtspSocket2.recv( response ); + //Debug( 4, "Drained %d bytes from HTTP socket", response.size() ); + //} + + message = "GET "+mPath+" HTTP/1.0\r\n"; + message += "X-SessionCookie: "+mHttpSession+"\r\n"; + if ( !mAuth.empty() ) + message += stringtf( "Authorization: Basic %s\r\n", mAuth64.c_str() ); + message += "\r\n"; + Debug( 2, "Sending HTTP message: %s", message.c_str() ); + if ( mRtspSocket.send( message.c_str(), message.size() ) != (int)message.length() ) + { + Error( "Unable to send message '%s': %s", message.c_str(), strerror(errno) ); + return( -1 ); + } + if ( mRtspSocket.recv( response ) < 0 ) + { + Error( "Recv failed; %s", strerror(errno) ); + return( -1 ); + } + + Debug( 2, "Received HTTP response: %s (%zd bytes)", response.c_str(), response.size() ); + float respVer = 0; + int respCode = -1; + char respText[256]; + if ( sscanf( response.c_str(), "HTTP/%f %3d %[^\r\n]\r\n", &respVer, &respCode, respText ) != 3 ) + { + if ( isalnum(response[0]) ) + { + Error( "Response parse failure in '%s'", response.c_str() ); + } + else + { + Error( "Response parse failure, %zd bytes follow", response.size() ); + if ( response.size() ) + Hexdump( Logger::ERROR, response.data(), min(response.size(),16) ); + } + return( -1 ); + } + if ( respCode != 200 ) + { + Error( "Unexpected response code %d, text is '%s'", respCode, respText ); + return( -1 ); + } + + message = "POST "+mPath+" HTTP/1.0\r\n"; + message += "X-SessionCookie: "+mHttpSession+"\r\n"; + if ( !mAuth.empty() ) + message += stringtf( "Authorization: Basic %s\r\n", mAuth64.c_str() ); + message += "Content-Length: 32767\r\n"; + message += "Content-Type: application/x-rtsp-tunnelled\r\n"; + message += "\r\n"; + Debug( 2, "Sending HTTP message: %s", message.c_str() ); + if ( mRtspSocket2.send( message.c_str(), message.size() ) != (int)message.length() ) + { + Error( "Unable to send message '%s': %s", message.c_str(), strerror(errno) ); + return( -1 ); + } + } + + std::string localHost = ""; + int localPorts[2] = { 0, 0 }; + + //message = "OPTIONS * RTSP/1.0\r\n"; + //sendCommand( message ); + //recvResponse( response ); + + message = "DESCRIBE "+mUrl+" RTSP/1.0\r\n"; + sendCommand( message ); + sleep( 1 ); + recvResponse( response ); + + const std::string endOfHeaders = "\r\n\r\n"; + size_t sdpStart = response.find( endOfHeaders ); + if( sdpStart == std::string::npos ) + return( -1 ); + sdpStart += endOfHeaders.length(); + + std::string sdp = response.substr( sdpStart ); + Debug( 1, "Processing SDP '%s'", sdp.c_str() ); + + SessionDescriptor *sessDesc = 0; + try + { + sessDesc = new SessionDescriptor( mUrl, sdp ); + mFormatContext = sessDesc->generateFormatContext(); + } + catch( const Exception &e ) + { + Error( e.getMessage().c_str() ); + return( -1 ); + } + +#if 0 + // New method using ffmpeg native functions + std::string authUrl = mUrl; + if ( !mAuth.empty() ) + authUrl.insert( authUrl.find( "://" )+3, mAuth+"@" ); + + if ( av_open_input_file( &mFormatContext, authUrl.c_str(), NULL, 0, NULL ) != 0 ) + { + Error( "Unable to open input '%s'", authUrl.c_str() ); + return( -1 ); + } +#endif + + uint32_t rtpClock = 0; + std::string trackUrl = mUrl; + if ( mFormatContext->nb_streams >= 1 ) + { + for ( unsigned int i = 0; i < mFormatContext->nb_streams; i++ ) + { + SessionDescriptor::MediaDescriptor *mediaDesc = sessDesc->getStream( i ); +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1) + if ( mFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO ) +#else + if ( mFormatContext->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO ) +#endif + { + trackUrl += "/"+mediaDesc->getControlUrl(); + rtpClock = mediaDesc->getClock(); + // Hackery pokery + //rtpClock = mFormatContext->streams[i]->codec->sample_rate; + break; + } + } + } + + switch( mMethod ) + { + case RTP_UNICAST : + { + localPorts[0] = requestPorts(); + localPorts[1] = localPorts[0]+1; + + message = "SETUP "+trackUrl+" RTSP/1.0\r\nTransport: RTP/AVP;unicast;client_port="+stringtf( "%d", localPorts[0] )+"-"+stringtf( "%d", localPorts[1] )+"\r\n"; + break; + } + case RTP_MULTICAST : + { + message = "SETUP "+trackUrl+" RTSP/1.0\r\nTransport: RTP/AVP;multicast\r\n"; + break; + } + case RTP_RTSP : + case RTP_RTSP_HTTP : + { + message = "SETUP "+trackUrl+" RTSP/1.0\r\nTransport: RTP/AVP/TCP;unicast\r\n"; + break; + } + default: + { + Panic( "Got unexpected method %d", mMethod ); + break; + } + } + + if ( !sendCommand( message ) ) + return( -1 ); + if ( !recvResponse( response ) ) + return( -1 ); + + StringVector lines = split( response, "\r\n" ); + char *session = 0; + int timeout = 0; + char transport[256] = ""; + + for ( size_t i = 0; i < lines.size(); i++ ) + { + sscanf( lines[i].c_str(), "Session: %a[0-9a-fA-F]; timeout=%d", &session, &timeout ); + sscanf( lines[i].c_str(), "Transport: %s", transport ); + } + + if ( !session ) + Fatal( "Unable to get session identifier from response '%s'", response.c_str() ); + + Debug( 2, "Got RTSP session %s, timeout %d secs", session, timeout ); + + if ( !transport[0] ) + Fatal( "Unable to get transport details from response '%s'", response.c_str() ); + + Debug( 2, "Got RTSP transport %s", transport ); + + std::string method = ""; + int remotePorts[2] = { 0, 0 }; + int remoteChannels[2] = { 0, 0 }; + std::string distribution = ""; + unsigned long ssrc = 0; + StringVector parts = split( transport, ";" ); + for ( size_t i = 0; i < parts.size(); i++ ) + { + if ( parts[i] == "unicast" || parts[i] == "multicast" ) + distribution = parts[i]; + else if ( startsWith( parts[i], "server_port=" ) ) + { + method = "RTP/UNICAST"; + StringVector subparts = split( parts[i], "=" ); + StringVector ports = split( subparts[1], "-" ); + remotePorts[0] = strtol( ports[0].c_str(), NULL, 10 ); + remotePorts[1] = strtol( ports[1].c_str(), NULL, 10 ); + } + else if ( startsWith( parts[i], "interleaved=" ) ) + { + method = "RTP/RTSP"; + StringVector subparts = split( parts[i], "=" ); + StringVector channels = split( subparts[1], "-" ); + remoteChannels[0] = strtol( channels[0].c_str(), NULL, 10 ); + remoteChannels[1] = strtol( channels[1].c_str(), NULL, 10 ); + } + else if ( startsWith( parts[i], "port=" ) ) + { + method = "RTP/MULTICAST"; + StringVector subparts = split( parts[i], "=" ); + StringVector ports = split( subparts[1], "-" ); + localPorts[0] = strtol( ports[0].c_str(), NULL, 10 ); + localPorts[1] = strtol( ports[1].c_str(), NULL, 10 ); + } + else if ( startsWith( parts[i], "destination=" ) ) + { + StringVector subparts = split( parts[i], "=" ); + localHost = subparts[1]; + } + else if ( startsWith( parts[i], "ssrc=" ) ) + { + StringVector subparts = split( parts[i], "=" ); + ssrc = strtoll( subparts[1].c_str(), NULL, 16 ); + } + } + + Debug( 2, "RTSP Method is %s", method.c_str() ); + Debug( 2, "RTSP Distribution is %s", distribution.c_str() ); + Debug( 2, "RTSP SSRC is %lx", ssrc ); + Debug( 2, "RTSP Local Host is %s", localHost.c_str() ); + Debug( 2, "RTSP Local Ports are %d/%d", localPorts[0], localPorts[1] ); + Debug( 2, "RTSP Remote Ports are %d/%d", remotePorts[0], remotePorts[1] ); + Debug( 2, "RTSP Remote Channels are %d/%d", remoteChannels[0], remoteChannels[1] ); + + message = "PLAY "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\nRange: npt=0.000-\r\n"; + if ( !sendCommand( message ) ) + return( -1 ); + if ( !recvResponse( response ) ) + return( -1 ); + + lines = split( response, "\r\n" ); + char *rtpInfo = 0; + for ( size_t i = 0; i < lines.size(); i++ ) + { + sscanf( lines[i].c_str(), "RTP-Info: %as", &rtpInfo ); + } + + if ( !rtpInfo ) + Fatal( "Unable to get RTP Info identifier from response '%s'", response.c_str() ); + + Debug( 2, "Got RTP Info %s", rtpInfo ); + + int seq = 0; + unsigned long rtpTime = 0; + parts = split( rtpInfo, ";" ); + for ( size_t i = 0; i < parts.size(); i++ ) + { + if ( startsWith( parts[i], "seq=" ) ) + { + StringVector subparts = split( parts[i], "=" ); + seq = strtol( subparts[1].c_str(), NULL, 10 ); + } + else if ( startsWith( parts[i], "rtptime=" ) ) + { + StringVector subparts = split( parts[i], "=" ); + rtpTime = strtol( subparts[1].c_str(), NULL, 10 ); + } + } + + Debug( 2, "RTSP Seq is %d", seq ); + Debug( 2, "RTSP Rtptime is %ld", rtpTime ); + + switch( mMethod ) + { + case RTP_UNICAST : + { + RtpSource *source = new RtpSource( mId, "", localPorts[0], mHost, remotePorts[0], ssrc, seq, rtpClock, rtpTime ); + mSources[ssrc] = source; + RtpDataThread rtpDataThread( *this, *source ); + RtpCtrlThread rtpCtrlThread( *this, *source ); + + rtpDataThread.start(); + rtpCtrlThread.start(); + + while( !mStop ) + { + usleep( 100000 ); + } +#if 0 + message = "PAUSE "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; + if ( !sendCommand( message ) ) + return( -1 ); + if ( !recvResponse( response ) ) + return( -1 ); +#endif + + message = "TEARDOWN "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; + if ( !sendCommand( message ) ) + return( -1 ); + if ( !recvResponse( response ) ) + return( -1 ); + + rtpDataThread.stop(); + rtpCtrlThread.stop(); + + //rtpDataThread.kill( SIGTERM ); + //rtpCtrlThread.kill( SIGTERM ); + + rtpDataThread.join(); + rtpCtrlThread.join(); + + delete mSources[ssrc]; + mSources.clear(); + + releasePorts( localPorts[0] ); + + break; + } + case RTP_RTSP : + case RTP_RTSP_HTTP : + { + RtpSource *source = new RtpSource( mId, "", remoteChannels[0], mHost, remoteChannels[0], ssrc, seq, rtpClock, rtpTime ); + mSources[ssrc] = source; + // These never actually run + RtpDataThread rtpDataThread( *this, *source ); + RtpCtrlThread rtpCtrlThread( *this, *source ); + + Select select( double(config.http_timeout)/1000.0 ); + select.addReader( &mRtspSocket ); + + Buffer buffer( ZM_NETWORK_BUFSIZ ); + time_t lastKeepalive = time(NULL); + std::string keepaliveMessage = "OPTIONS * RTSP/1.0\r\n"; + std::string keepaliveResponse = "RTSP/1.0 200 OK\r\n"; + while ( !mStop && select.wait() >= 0 ) + { + Select::CommsList readable = select.getReadable(); + if ( readable.size() == 0 ) + { + Error( "RTSP timed out" ); + break; + } + + static char tempBuffer[ZM_NETWORK_BUFSIZ]; + ssize_t nBytes = mRtspSocket.recv( tempBuffer, sizeof(tempBuffer) ); + buffer.append( tempBuffer, nBytes ); + Debug( 4, "Read %zd bytes on sd %d, %d total", nBytes, mRtspSocket.getReadDesc(), buffer.size() ); + + while( buffer.size() > 0 ) + { + if ( buffer[0] == '$' ) + { + unsigned char channel = buffer[1]; + unsigned short len = ntohs( *((unsigned short *)(buffer+2)) ); + + Debug( 4, "Got %d bytes left, expecting %d byte packet on channel %d", buffer.size(), len, channel ); + if ( (unsigned short)buffer.size() < (len+4) ) + { + Debug( 4, "Missing %zd bytes, rereading", (len+4)-nBytes ); + break; + } + if ( channel == remoteChannels[0] ) + { + Debug( 4, "Got %d bytes on data channel %d, packet length is %d", buffer.size(), channel, len ); + Hexdump( 4, (char *)buffer, 16 ); + rtpDataThread.recvPacket( buffer+4, len ); + Debug( 4, "Received" ); + } + else if ( channel == remoteChannels[1] ) + { + len = ntohs( *((unsigned short *)(buffer+2)) ); + Debug( 4, "Got %zd bytes on control channel %d", nBytes, channel ); + rtpCtrlThread.recvPackets( buffer+4, len ); + } + else + { + Error( "Unexpected channel selector %d in RTSP interleaved data", buffer[1] ); + buffer.clear(); + break; + } + buffer.consume( len+4 ); + nBytes -= len+4; + } + else + { + if ( keepaliveResponse.compare( 0, keepaliveResponse.size(), (char *)buffer, keepaliveResponse.size() ) == 0 ) + { + Debug( 4, "Got keepalive response '%s'", (char *)buffer ); + //buffer.consume( keepaliveResponse.size() ); + if ( char *charPtr = (char *)memchr( (char *)buffer, '$', buffer.size() ) ) + { + int discardBytes = charPtr-(char *)buffer; + buffer -= discardBytes; + } + else + { + buffer.clear(); + } + } + else + { + if ( char *charPtr = (char *)memchr( (char *)buffer, '$', buffer.size() ) ) + { + int discardBytes = charPtr-(char *)buffer; + Warning( "Unexpected format RTSP interleaved data, resyncing by %d bytes", discardBytes ); + Hexdump( -1, (char *)buffer, discardBytes ); + buffer -= discardBytes; + } + else + { + Warning( "Unexpected format RTSP interleaved data, dumping %d bytes", buffer.size() ); + Hexdump( -1, (char *)buffer, 32 ); + buffer.clear(); + } + } + } + } + if ( (timeout > 0) && ((time(NULL)-lastKeepalive) > (timeout-5)) ) + { + if ( !sendCommand( message ) ) + return( -1 ); + lastKeepalive = time(NULL); + } + buffer.tidy( 1 ); + } +#if 0 + message = "PAUSE "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; + if ( !sendCommand( message ) ) + return( -1 ); + if ( !recvResponse( response ) ) + return( -1 ); +#endif + message = "TEARDOWN "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; + if ( !sendCommand( message ) ) + return( -1 ); + if ( !recvResponse( response ) ) + return( -1 ); + + delete mSources[ssrc]; + mSources.clear(); + + break; + } + case RTP_MULTICAST : + { + RtpSource *source = new RtpSource( mId, localHost, localPorts[0], mHost, remotePorts[0], ssrc, seq, rtpClock, rtpTime ); + mSources[ssrc] = source; + RtpDataThread rtpDataThread( *this, *source ); + RtpCtrlThread rtpCtrlThread( *this, *source ); + + rtpDataThread.start(); + rtpCtrlThread.start(); + + while( !mStop ) + { + usleep( 100000 ); + } +#if 0 + message = "PAUSE "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; + if ( !sendCommand( message ) ) + return( -1 ); + if ( !recvResponse( response ) ) + return( -1 ); +#endif + message = "TEARDOWN "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; + if ( !sendCommand( message ) ) + return( -1 ); + if ( !recvResponse( response ) ) + return( -1 ); + + rtpDataThread.stop(); + rtpCtrlThread.stop(); + + rtpDataThread.join(); + rtpCtrlThread.join(); + + delete mSources[ssrc]; + mSources.clear(); + + releasePorts( localPorts[0] ); + break; + } + default: + { + Panic( "Got unexpected method %d", mMethod ); + break; + } + } + + return( 0 ); +} + +#endif // HAVE_LIBAVFORMAT diff --git a/src/zm_rtsp.h b/src/zm_rtsp.h new file mode 100644 index 000000000..3f4621fa3 --- /dev/null +++ b/src/zm_rtsp.h @@ -0,0 +1,129 @@ +// +// ZoneMinder RTSP Class Interface, $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. +// + +#ifndef ZM_RTSP_H +#define ZM_RTSP_H + +#include "zm.h" +#include "zm_ffmpeg.h" +#include "zm_comms.h" +#include "zm_thread.h" +#include "zm_rtp_source.h" + +#include +#include + +class RtspThread : public Thread +{ +public: + typedef enum { RTP_UNICAST, RTP_MULTICAST, RTP_RTSP, RTP_RTSP_HTTP } RtspMethod; + typedef enum { UNDEFINED, UNICAST, MULTICAST } RtspDist; + +private: + typedef std::set PortSet; + typedef std::set SsrcSet; + typedef std::map SourceMap; + +private: + static int smMinDataPort; + static int smMaxDataPort; + static PortSet smLocalSsrcs; + static PortSet smAssignedPorts; + +private: + int mId; + RtspMethod mMethod; + std::string mProtocol; + std::string mHost; + std::string mPort; + std::string mPath; + std::string mUrl; + std::string mAuth; + std::string mAuth64; + + std::string mHttpSession; ///< Only for RTSP over HTTP sessions + + TcpInetClient mRtspSocket; + TcpInetClient mRtspSocket2; + + SourceMap mSources; + + AVFormatContext *mFormatContext; + + uint16_t mSeq; + uint32_t mSession; + uint32_t mSsrc; + + int mRemotePorts[2]; + int mRemoteChannels[2]; + RtspDist mDist; + + unsigned long mRtpTime; + + bool mStop; + +private: + bool sendCommand( std::string message ); + bool recvResponse( std::string &response ); + +public: + RtspThread( int id, RtspMethod method, const std::string &protocol, const std::string &host, const std::string &port, const std::string &path, const std::string &auth ); + ~RtspThread(); + +public: + int requestPorts(); + void releasePorts( int port ); + + bool isValidSsrc( uint32_t ssrc ); + bool updateSsrc( uint32_t ssrc, const RtpDataHeader *header ); + + uint32_t getSsrc() const + { + return( mSsrc ); + } + + bool hasSources() const + { + return( !mSources.empty() ); + } + + AVFormatContext *getFormatContext() + { + return( mFormatContext ); + } + + bool getFrame( Buffer &frame ) + { + SourceMap::iterator iter = mSources.begin(); + if ( iter == mSources.end() ) + return( false ); + return( iter->second->getFrame( frame ) ); + } + int run(); + void stop() + { + mStop = true; + } + bool stopped() const + { + return( mStop ); + } +}; + +#endif // ZM_RTSP_H diff --git a/src/zm_sdp.cpp b/src/zm_sdp.cpp new file mode 100644 index 000000000..aa33206c5 --- /dev/null +++ b/src/zm_sdp.cpp @@ -0,0 +1,403 @@ +// +// ZoneMinder SDP Class Implementation, $Date: 2009-04-14 21:20:02 +0100 (Tue, 14 Apr 2009) $, $Revision: 2850 $ +// 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. +// + +#include "zm.h" + +#if HAVE_LIBAVFORMAT + +#include "zm_sdp.h" + +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1) +SessionDescriptor::StaticPayloadDesc SessionDescriptor::smStaticPayloads[] = { + { 0, "PCMU", AVMEDIA_TYPE_AUDIO, CODEC_ID_PCM_MULAW, 8000, 1 }, + { 3, "GSM", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1 }, + { 4, "G723", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1 }, + { 5, "DVI4", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1 }, + { 6, "DVI4", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 16000, 1 }, + { 7, "LPC", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1 }, + { 8, "PCMA", AVMEDIA_TYPE_AUDIO, CODEC_ID_PCM_ALAW, 8000, 1 }, + { 9, "G722", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1 }, + { 10, "L16", AVMEDIA_TYPE_AUDIO, CODEC_ID_PCM_S16BE, 44100, 2 }, + { 11, "L16", AVMEDIA_TYPE_AUDIO, CODEC_ID_PCM_S16BE, 44100, 1 }, + { 12, "QCELP", AVMEDIA_TYPE_AUDIO, CODEC_ID_QCELP, 8000, 1 }, + { 13, "CN", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1 }, + { 14, "MPA", AVMEDIA_TYPE_AUDIO, CODEC_ID_MP2, -1, -1 }, + { 14, "MPA", AVMEDIA_TYPE_AUDIO, CODEC_ID_MP3, -1, -1 }, + { 15, "G728", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1 }, + { 16, "DVI4", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 11025, 1 }, + { 17, "DVI4", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 22050, 1 }, + { 18, "G729", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1 }, + { 25, "CelB", AVMEDIA_TYPE_VIDEO, CODEC_ID_NONE, 90000, -1 }, + { 26, "JPEG", AVMEDIA_TYPE_VIDEO, CODEC_ID_MJPEG, 90000, -1 }, + { 28, "nv", AVMEDIA_TYPE_VIDEO, CODEC_ID_NONE, 90000, -1 }, + { 31, "H261", AVMEDIA_TYPE_VIDEO, CODEC_ID_H261, 90000, -1 }, + { 32, "MPV", AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG1VIDEO, 90000, -1 }, + { 32, "MPV", AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO, 90000, -1 }, + { 33, "MP2T", AVMEDIA_TYPE_DATA, CODEC_ID_MPEG2TS, 90000, -1 }, + { 34, "H263", AVMEDIA_TYPE_VIDEO, CODEC_ID_H263, 90000, -1 }, + { -1, "", AVMEDIA_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1 } +}; + +SessionDescriptor::DynamicPayloadDesc SessionDescriptor::smDynamicPayloads[] = { + { "MP4V-ES", AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG4 }, + { "mpeg4-generic", AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC }, + { "H264", AVMEDIA_TYPE_VIDEO, CODEC_ID_H264 }, + { "AMR", AVMEDIA_TYPE_AUDIO, CODEC_ID_AMR_NB } +}; +#else +SessionDescriptor::StaticPayloadDesc SessionDescriptor::smStaticPayloads[] = { + { 0, "PCMU", CODEC_TYPE_AUDIO, CODEC_ID_PCM_MULAW, 8000, 1 }, + { 3, "GSM", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1 }, + { 4, "G723", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1 }, + { 5, "DVI4", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1 }, + { 6, "DVI4", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 16000, 1 }, + { 7, "LPC", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1 }, + { 8, "PCMA", CODEC_TYPE_AUDIO, CODEC_ID_PCM_ALAW, 8000, 1 }, + { 9, "G722", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1 }, + { 10, "L16", CODEC_TYPE_AUDIO, CODEC_ID_PCM_S16BE, 44100, 2 }, + { 11, "L16", CODEC_TYPE_AUDIO, CODEC_ID_PCM_S16BE, 44100, 1 }, + { 12, "QCELP", CODEC_TYPE_AUDIO, CODEC_ID_QCELP, 8000, 1 }, + { 13, "CN", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1 }, + { 14, "MPA", CODEC_TYPE_AUDIO, CODEC_ID_MP2, -1, -1 }, + { 14, "MPA", CODEC_TYPE_AUDIO, CODEC_ID_MP3, -1, -1 }, + { 15, "G728", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1 }, + { 16, "DVI4", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 11025, 1 }, + { 17, "DVI4", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 22050, 1 }, + { 18, "G729", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1 }, + { 25, "CelB", CODEC_TYPE_VIDEO, CODEC_ID_NONE, 90000, -1 }, + { 26, "JPEG", CODEC_TYPE_VIDEO, CODEC_ID_MJPEG, 90000, -1 }, + { 28, "nv", CODEC_TYPE_VIDEO, CODEC_ID_NONE, 90000, -1 }, + { 31, "H261", CODEC_TYPE_VIDEO, CODEC_ID_H261, 90000, -1 }, + { 32, "MPV", CODEC_TYPE_VIDEO, CODEC_ID_MPEG1VIDEO, 90000, -1 }, + { 32, "MPV", CODEC_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO, 90000, -1 }, + { 33, "MP2T", CODEC_TYPE_DATA, CODEC_ID_MPEG2TS, 90000, -1 }, + { 34, "H263", CODEC_TYPE_VIDEO, CODEC_ID_H263, 90000, -1 }, + { -1, "", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1 } +}; + +SessionDescriptor::DynamicPayloadDesc SessionDescriptor::smDynamicPayloads[] = { + { "MP4V-ES", CODEC_TYPE_VIDEO, CODEC_ID_MPEG4 }, + { "mpeg4-generic", CODEC_TYPE_AUDIO, CODEC_ID_AAC }, + { "H264", CODEC_TYPE_VIDEO, CODEC_ID_H264 }, + { "AMR", CODEC_TYPE_AUDIO, CODEC_ID_AMR_NB } +}; +#endif + +SessionDescriptor::ConnInfo::ConnInfo( const std::string &connInfo ) : + mTtl( 16 ), + mNoAddresses( 0 ) +{ + StringVector tokens = split( connInfo, " " ); + if ( tokens.size() < 3 ) + throw Exception( "Unable to parse SDP connection info from '"+connInfo+"'" ); + mNetworkType = tokens[0]; + if ( mNetworkType != "IN" ) + throw Exception( "Invalid SDP network type '"+mNetworkType+"' in connection info '"+connInfo+"'" ); + mAddressType = tokens[1]; + if ( mAddressType != "IP4" ) + throw Exception( "Invalid SDP address type '"+mAddressType+"' in connection info '"+connInfo+"'" ); + StringVector addressTokens = split( tokens[2], "/" ); + if ( addressTokens.size() < 1 ) + throw Exception( "Invalid SDP address '"+tokens[2]+"' in connection info '"+connInfo+"'" ); + mAddress = addressTokens[0]; + if ( addressTokens.size() >= 2 ) + mTtl = atoi(addressTokens[1].c_str()); + if ( addressTokens.size() >= 3 ) + mNoAddresses = atoi(addressTokens[2].c_str()); +} + +SessionDescriptor::BandInfo::BandInfo( const std::string &bandInfo ) : + mValue( 0 ) +{ + StringVector tokens = split( bandInfo, ":" ); + if ( tokens.size() < 2 ) + throw Exception( "Unable to parse SDP bandwidth info from '"+bandInfo+"'" ); + mType = tokens[0]; + //if ( mNetworkType != "IN" ) + //throw Exception( "Invalid SDP network type '"+mNetworkType+"' in connection info '"+connInfo+"'" ); + mValue = atoi(tokens[1].c_str()); +} + +SessionDescriptor::MediaDescriptor::MediaDescriptor( const std::string &type, int port, int numPorts, const std::string &transport, int payloadType ) : + mType( type ), + mPort( port ), + mNumPorts( numPorts ), + mTransport( transport ), + mPayloadType( payloadType ), + mFrameRate( 0.0 ), + mClock( 0 ), + mWidth( 0 ), + mHeight( 0 ), + mConnInfo( 0 ) +{ +} + +SessionDescriptor::SessionDescriptor( const std::string &url, const std::string &sdp ) : + mUrl( url ), + mConnInfo( 0 ), + mBandInfo( 0 ) +{ + MediaDescriptor *currMedia = 0; + + StringVector lines = split( sdp, "\r\n" ); + for ( StringVector::const_iterator iter = lines.begin(); iter != lines.end(); iter++ ) + { + std::string line = *iter; + if ( line.empty() ) + break; + + Debug( 3, "Processing SDP line '%s'", line.c_str() ); + const char sdpType = line[0]; + if ( line[1] != '=' ) + throw Exception( "Invalid SDP format at '"+line+"'" ); + + line.erase( 0, 2 ); + switch( sdpType ) + { + case 'v' : + mVersion = line; + break; + case 'o' : + mOwner = line; + break; + case 's' : + mName = line; + break; + case 'i' : + mInfo = line; + break; + case 'c' : + mConnInfo = new ConnInfo( line ); + break; + case 'b' : + mBandInfo = new BandInfo( line ); + break; + case 't' : + mTimeInfo = line; + break; + case 'a' : + { + mAttributes.push_back( line ); + StringVector tokens = split( line, ":", 2 ); + std::string attrName = tokens[0]; + if ( currMedia ) + { + if ( attrName == "control" ) + { + if ( tokens.size() < 2 ) + throw Exception( "Unable to parse SDP control attribute '"+line+"' for media '"+currMedia->getType()+"'" ); + currMedia->setControlUrl( tokens[1] ); + } + else if ( attrName == "range" ) + { + } + else if ( attrName == "rtpmap" ) + { + // a=rtpmap:96 MP4V-ES/90000 + if ( tokens.size() < 2 ) + throw Exception( "Unable to parse SDP rtpmap attribute '"+line+"' for media '"+currMedia->getType()+"'" ); + StringVector attrTokens = split( tokens[1], " " ); + int payloadType = atoi(attrTokens[0].c_str()); + if ( payloadType != currMedia->getPayloadType() ) + throw Exception( stringtf( "Payload type mismatch, expected %d, got %d in '%s'", currMedia->getPayloadType(), payloadType, line.c_str() ) ); + std::string payloadDesc = attrTokens[1]; + //currMedia->setPayloadType( payloadType ); + if ( attrTokens.size() > 1 ) + { + StringVector payloadTokens = split( attrTokens[1], "/" ); + std::string payloadDesc = payloadTokens[0]; + int payloadClock = atoi(payloadTokens[1].c_str()); + currMedia->setPayloadDesc( payloadDesc ); + currMedia->setClock( payloadClock ); + } + } + else if ( attrName == "framesize" ) + { + // a=framesize:96 320-240 + if ( tokens.size() < 2 ) + throw Exception( "Unable to parse SDP framesize attribute '"+line+"' for media '"+currMedia->getType()+"'" ); + StringVector attrTokens = split( tokens[1], " " ); + int payloadType = atoi(attrTokens[0].c_str()); + if ( payloadType != currMedia->getPayloadType() ) + throw Exception( stringtf( "Payload type mismatch, expected %d, got %d in '%s'", currMedia->getPayloadType(), payloadType, line.c_str() ) ); + //currMedia->setPayloadType( payloadType ); + StringVector sizeTokens = split( attrTokens[1], "-" ); + int width = atoi(sizeTokens[0].c_str()); + int height = atoi(sizeTokens[1].c_str()); + currMedia->setFrameSize( width, height ); + } + else if ( attrName == "framerate" ) + { + // a=framerate:5.0 + if ( tokens.size() < 2 ) + throw Exception( "Unable to parse SDP framerate attribute '"+line+"' for media '"+currMedia->getType()+"'" ); + double frameRate = atof(tokens[1].c_str()); + currMedia->setFrameRate( frameRate ); + } + else if ( attrName == "fmtp" ) + { + // a=fmtp:96 profile-level-id=247; config=000001B0F7000001B509000001000000012008D48D8803250F042D14440F + if ( tokens.size() < 2 ) + throw Exception( "Unable to parse SDP fmtp attribute '"+line+"' for media '"+currMedia->getType()+"'" ); + StringVector attrTokens = split( tokens[1], " ", 2 ); + int payloadType = atoi(attrTokens[0].c_str()); + if ( payloadType != currMedia->getPayloadType() ) + throw Exception( stringtf( "Payload type mismatch, expected %d, got %d in '%s'", currMedia->getPayloadType(), payloadType, line.c_str() ) ); + //currMedia->setPayloadType( payloadType ); + if ( attrTokens.size() > 1 ) + { + StringVector attr2Tokens = split( attrTokens[1], "; " ); + for ( unsigned int i = 0; i < attr2Tokens.size(); i++ ) + { + StringVector attr3Tokens = split( attr2Tokens[i], "=" ); + //Info( "Name = %s, Value = %s", attr3Tokens[0].c_str(), attr3Tokens[1].c_str() ); + if ( attr3Tokens[0] == "profile-level-id" ) + { + } + else if ( attr3Tokens[0] == "config" ) + { + } + else + { + Debug( 3, "Ignoring SDP fmtp attribute '%s' for media '%s'", attr3Tokens[0].c_str(), currMedia->getType().c_str() ) + } + } + } + } + else if ( attrName == "mpeg4-iod" ) + { + // a=mpeg4-iod: "data:application/mpeg4-iod;base64,AoEAAE8BAf73AQOAkwABQHRkYXRhOmFwcGxpY2F0aW9uL21wZWc0LW9kLWF1O2Jhc2U2NCxBVGdCR3dVZkF4Y0F5U1FBWlFRTklCRUVrK0FBQWEyd0FBR3RzQVlCQkFFWkFwOERGUUJsQlFRTlFCVUFDN2dBQVBvQUFBRDZBQVlCQXc9PQQNAQUABAAAAAAAAAAAAAYJAQAAAAAAAAAAA0IAAkA+ZGF0YTphcHBsaWNhdGlvbi9tcGVnNC1iaWZzLWF1O2Jhc2U2NCx3QkFTZ1RBcUJYSmhCSWhRUlFVL0FBPT0EEgINAAACAAAAAAAAAAAFAwAAQAYJAQAAAAAAAAAA" + } + else if ( attrName == "mpeg4-esid" ) + { + // a=mpeg4-esid:201 + } + else + { + Debug( 3, "Ignoring SDP attribute '%s' for media '%s'", line.c_str(), currMedia->getType().c_str() ) + } + } + else + { + Debug( 3, "Ignoring general SDP attribute '%s'", line.c_str() ); + } + break; + } + case 'm' : + { + StringVector tokens = split( line, " " ); + if ( tokens.size() < 4 ) + throw Exception( "Can't parse SDP media description '"+line+"'" ); + std::string mediaType = tokens[0]; + if ( mediaType != "audio" && mediaType != "video" ) + throw Exception( "Unsupported media type '"+mediaType+"' in SDP media attribute '"+line+"'" ); + StringVector portTokens = split( tokens[1], "/" ); + int mediaPort = atoi(portTokens[0].c_str()); + int mediaNumPorts = 1; + if ( portTokens.size() > 1 ) + mediaNumPorts = atoi(portTokens[1].c_str()); + std::string mediaTransport = tokens[2]; + if ( mediaTransport != "RTP/AVP" ) + throw Exception( "Unsupported media transport '"+mediaTransport+"' in SDP media attribute '"+line+"'" ); + int payloadType = atoi(tokens[3].c_str()); + currMedia = new MediaDescriptor( mediaType, mediaPort, mediaNumPorts, mediaTransport, payloadType ); + mMediaList.push_back( currMedia ); + break; + } + } + } +} + +AVFormatContext *SessionDescriptor::generateFormatContext() const +{ + AVFormatContext *formatContext = avformat_alloc_context(); + + strncpy( formatContext->filename, mUrl.c_str(), sizeof(formatContext->filename) ); + + //formatContext->nb_streams = mMediaList.size(); + for ( unsigned int i = 0; i < mMediaList.size(); i++ ) + { + const MediaDescriptor *mediaDesc = mMediaList[i]; +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 8, 0) + AVStream *stream = av_new_stream( formatContext, i ); +#else + AVStream *stream = avformat_new_stream( formatContext, NULL ); + stream->id = i; +#endif + + Debug( 1, "Looking for codec for %s payload type %d / %s", mediaDesc->getType().c_str(), mediaDesc->getPayloadType(), mediaDesc->getPayloadDesc().c_str() ); +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1) + if ( mediaDesc->getType() == "video" ) + stream->codec->codec_type = AVMEDIA_TYPE_VIDEO; + else if ( mediaDesc->getType() == "audio" ) + stream->codec->codec_type = AVMEDIA_TYPE_AUDIO; +#else + if ( mediaDesc->getType() == "video" ) + stream->codec->codec_type = CODEC_TYPE_VIDEO; + else if ( mediaDesc->getType() == "audio" ) + stream->codec->codec_type = CODEC_TYPE_AUDIO; +#endif + + if ( mediaDesc->getPayloadType() < PAYLOAD_TYPE_DYNAMIC ) + { + // Look in static table + for ( unsigned int i = 0; i < (sizeof(smStaticPayloads)/sizeof(*smStaticPayloads)); i++ ) + { + if ( smStaticPayloads[i].payloadType == mediaDesc->getPayloadType() ) + { + Debug( 1, "Got static payload type %d, %s", smStaticPayloads[i].payloadType, smStaticPayloads[i].payloadName ); + strncpy( stream->codec->codec_name, smStaticPayloads[i].payloadName, sizeof(stream->codec->codec_name) );; + stream->codec->codec_type = smStaticPayloads[i].codecType; + stream->codec->codec_id = smStaticPayloads[i].codecId; + stream->codec->sample_rate = smStaticPayloads[i].clockRate; + break; + } + } + } + else + { + // Look in dynamic table + for ( unsigned int i = 0; i < (sizeof(smDynamicPayloads)/sizeof(*smDynamicPayloads)); i++ ) + { + if ( smDynamicPayloads[i].payloadName == mediaDesc->getPayloadDesc() ) + { + Debug( 1, "Got dynamic payload type %d, %s", mediaDesc->getPayloadType(), smDynamicPayloads[i].payloadName ); + strncpy( stream->codec->codec_name, smDynamicPayloads[i].payloadName, sizeof(stream->codec->codec_name) );; + stream->codec->codec_type = smDynamicPayloads[i].codecType; + stream->codec->codec_id = smDynamicPayloads[i].codecId; + stream->codec->sample_rate = mediaDesc->getClock(); + break; + } + } + } + if ( !stream->codec->codec_name[0] ) + { + Warning( "Can't find payload details for %s payload type %d, name %s", mediaDesc->getType().c_str(), mediaDesc->getPayloadType(), mediaDesc->getPayloadDesc().c_str() ); + //return( 0 ); + } + if ( mediaDesc->getWidth() ) + stream->codec->width = mediaDesc->getWidth(); + if ( mediaDesc->getHeight() ) + stream->codec->height = mediaDesc->getHeight(); + } + + return( formatContext ); +} + +#endif // HAVE_LIBAVFORMAT diff --git a/src/zm_sdp.h b/src/zm_sdp.h new file mode 100644 index 000000000..6d4291f45 --- /dev/null +++ b/src/zm_sdp.h @@ -0,0 +1,241 @@ +// +// ZoneMinder SDP Class Interface, $Date: 2009-02-16 18:21:50 +0000 (Mon, 16 Feb 2009) $, $Revision: 2765 $ +// 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. +// + +#ifndef ZM_SDP_H +#define ZM_SDP_H + +#include "zm.h" + +#include "zm_utils.h" +#include "zm_exception.h" +#include "zm_ffmpeg.h" + +#include + +#include +#include + +class SessionDescriptor +{ +protected: + enum { PAYLOAD_TYPE_DYNAMIC=96 }; + + struct StaticPayloadDesc + { + int payloadType; + const char payloadName[6]; + enum AVMediaType codecType; + enum CodecID codecId; + int clockRate; + int autoChannels; + }; + + struct DynamicPayloadDesc + { + const char payloadName[32]; + enum AVMediaType codecType; + enum CodecID codecId; + //int clockRate; + //int autoChannels; + }; + +public: + class ConnInfo + { + protected: + std::string mNetworkType; + std::string mAddressType; + std::string mAddress; + int mTtl; + int mNoAddresses; + + public: + ConnInfo( const std::string &connInfo ); + }; + + class BandInfo + { + protected: + std::string mType; + int mValue; + + public: + BandInfo( const std::string &bandInfo ); + }; + + class MediaDescriptor + { + protected: + std::string mType; + int mPort; + int mNumPorts; + std::string mTransport; + int mPayloadType; + + std::string mPayloadDesc; + std::string mControlUrl; + double mFrameRate; + int mClock; + int mWidth; + int mHeight; + + ConnInfo *mConnInfo; + + public: + MediaDescriptor( const std::string &type, int port, int numPorts, const std::string &transport, int payloadType ); + + const std::string &getType() const + { + return( mType ); + } + int getPort() const + { + return( mPort ); + } + int getNumPorts() const + { + return( mNumPorts ); + } + const std::string &getTransport() const + { + return( mTransport ); + } + const int getPayloadType() const + { + return( mPayloadType ); + } + + const std::string &getPayloadDesc() const + { + return( mPayloadDesc ); + } + void setPayloadDesc( const std::string &payloadDesc ) + { + mPayloadDesc = payloadDesc; + } + + const std::string &getControlUrl() const + { + return( mControlUrl ); + } + void setControlUrl( const std::string &controlUrl ) + { + mControlUrl = controlUrl; + } + + const int getClock() const + { + return( mClock ); + } + void setClock( int clock ) + { + mClock = clock; + } + + void setFrameSize( int width, int height ) + { + mWidth = width; + mHeight = height; + } + int getWidth() const + { + return( mWidth ); + } + int getHeight() const + { + return( mHeight ); + } + + const double getFrameRate() const + { + return( mFrameRate ); + } + void setFrameRate( double frameRate ) + { + mFrameRate = frameRate; + } + }; + + typedef std::vector MediaList; + +protected: + static StaticPayloadDesc smStaticPayloads[]; + static DynamicPayloadDesc smDynamicPayloads[]; + +protected: + std::string mUrl; + + std::string mVersion; + std::string mOwner; + std::string mName; + std::string mInfo; + + ConnInfo *mConnInfo; + BandInfo *mBandInfo; + std::string mTimeInfo; + StringVector mAttributes; + + MediaList mMediaList; + +public: + SessionDescriptor( const std::string &url, const std::string &sdp ); + + const std::string &getUrl() const + { + return( mUrl ); + } + + int getNumStreams() const + { + return( mMediaList.size() ); + } + MediaDescriptor *getStream( int index ) + { + if ( index < 0 || (unsigned int)index >= mMediaList.size() ) + return( 0 ); + return( mMediaList[index] ); + } + + AVFormatContext *generateFormatContext() const; +}; +#if 0 +v=0 +o=- 1239719297054659 1239719297054674 IN IP4 192.168.1.11 +s=Media Presentation +e=NONE +c=IN IP4 0.0.0.0 +b=AS:174 +t=0 0 +a=control:* +a=range:npt=now- +a=mpeg4-iod: "data:application/mpeg4-iod;base64,AoEAAE8BAf73AQOAkwABQHRkYXRhOmFwcGxpY2F0aW9uL21wZWc0LW9kLWF1O2Jhc2U2NCxBVGdCR3dVZkF4Y0F5U1FBWlFRTklCRUVrK0FBQWEyd0FBR3RzQVlCQkFFWkFwOERGUUJsQlFRTlFCVUFDN2dBQVBvQUFBRDZBQVlCQXc9PQQNAQUABAAAAAAAAAAAAAYJAQAAAAAAAAAAA0IAAkA+ZGF0YTphcHBsaWNhdGlvbi9tcGVnNC1iaWZzLWF1O2Jhc2U2NCx3QkFTZ1RBcUJYSmhCSWhRUlFVL0FBPT0EEgINAAACAAAAAAAAAAAFAwAAQAYJAQAAAAAAAAAA" +m=video 0 RTP/AVP 96 +b=AS:110 +a=framerate:5.0 +a=control:trackID=1 +a=rtpmap:96 MP4V-ES/90000 +a=fmtp:96 profile-level-id=247; config=000001B0F7000001B509000001000000012008D48D8803250F042D14440F +a=mpeg4-esid:201 +m=audio 0 RTP/AVP 0 +b=AS:64 +a=control:trackID=2 + +#endif + +#endif // ZM_SDP_H diff --git a/src/zm_signal.cpp b/src/zm_signal.cpp new file mode 100644 index 000000000..5bb000f0b --- /dev/null +++ b/src/zm_signal.cpp @@ -0,0 +1,197 @@ +// +// ZoneMinder Signal Handling Implementation, $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. +// + +#include "zm.h" +#include "zm_signal.h" + +#include +#include +#include + +bool zm_reload = false; + +RETSIGTYPE zm_hup_handler( int signal ) +{ +#if HAVE_STRSIGNAL + Info( "Got signal %d (%s), reloading", signal, strsignal(signal) ); +#else // HAVE_STRSIGNAL + Info( "Got HUP signal, reloading" ); +#endif // HAVE_STRSIGNAL + zm_reload = true; +} + +bool zm_terminate = false; + +RETSIGTYPE zm_term_handler( int signal ) +{ +#if HAVE_STRSIGNAL + Info( "Got signal %d (%s), exiting", signal, strsignal(signal) ); +#else // HAVE_STRSIGNAL + Info( "Got TERM signal, exiting" ); +#endif // HAVE_STRSIGNAL + zm_terminate = true; +} + +#define TRACE_SIZE 16 + +#if HAVE_STRUCT_SIGCONTEXT +RETSIGTYPE zm_die_handler( int signal, struct sigcontext context ) +#elif ( HAVE_SIGINFO_T && HAVE_UCONTEXT_T ) +#include +RETSIGTYPE zm_die_handler( int signal, siginfo_t *info, void *context ) +#else +RETSIGTYPE zm_die_handler( int signal ) +#endif +{ + if ( signal == SIGABRT ) + { +#if HAVE_STRSIGNAL + Info( "Got signal %d (%s), exiting and forcing backtrace", signal, strsignal(signal) ); +#else // HAVE_STRSIGNAL + Error( "Got signal %d, exiting and forcing backtrace", signal ); +#endif // HAVE_STRSIGNAL + } + else + { +#if HAVE_STRSIGNAL + Info( "Got signal %d (%s), crashing", signal, strsignal(signal) ); +#else // HAVE_STRSIGNAL + Error( "Got signal %d, crashing", signal ); +#endif // HAVE_STRSIGNAL + } + +#ifndef ZM_NO_CRASHTRACE +#if ( ( HAVE_SIGINFO_T && HAVE_UCONTEXT_T ) || HAVE_STRUCT_SIGCONTEXT ) + void *trace[TRACE_SIZE]; + int trace_size = 0; + +#if HAVE_STRUCT_SIGCONTEXT_EIP + Error( "Signal address is %p, from %p", (void *)context.cr2, (void *)context.eip ); + + trace_size = backtrace( trace, TRACE_SIZE ); + // overwrite sigaction with caller's address + trace[1] = (void *)context.eip; +#elif HAVE_STRUCT_SIGCONTEXT + Error( "Signal address is %p, no eip", (void *)context.cr2 ); + + trace_size = backtrace( trace, TRACE_SIZE ); +#else // HAVE_STRUCT_SIGCONTEXT + if ( info && context ) + { + ucontext_t *uc = (ucontext_t *)context; + + Error( "Signal address is %p, from %p", info->si_addr, uc->uc_mcontext.gregs[REG_EIP] ); + + trace_size = backtrace( trace, TRACE_SIZE ); + // overwrite sigaction with caller's address + trace[1] = (void *) uc->uc_mcontext.gregs[REG_EIP]; + } +#endif // HAVE_STRUCT_SIGCONTEXT +#if HAVE_DECL_BACKTRACE + char cmd[1024] = "addr2line -e "; + char *cmd_ptr = cmd+strlen(cmd); + // Try and extract the binary path from the last backtrace frame + char **messages = backtrace_symbols( trace, trace_size ); + if ( size_t offset = strcspn( messages[trace_size-1], " " ) ) + { + snprintf( cmd_ptr, sizeof(cmd)-(cmd_ptr-cmd), messages[trace_size-1] ); + cmd_ptr += offset; + } + else + { + cmd_ptr += snprintf( cmd_ptr, sizeof(cmd)-(cmd_ptr-cmd), "/path/to/%s", logId().c_str() ); + } + // skip first stack frame (points here) + for ( int i=1; i < trace_size; i++ ) + { + Error( "Backtrace: %s", messages[i] ); + cmd_ptr += snprintf( cmd_ptr, sizeof(cmd)-(cmd_ptr-cmd), " %p", trace[i] ); + } + Info( "Backtrace complete, please execute the following command for more information" ); + Info( cmd ); +#endif // HAVE_DECL_BACKTRACE +#endif // ( HAVE_SIGINFO_T && HAVE_UCONTEXT_T ) || HAVE_STRUCT_SIGCONTEXT +#endif // ZM_NO_CRASHTRACE + + exit( signal ); +} + +void zmSetHupHandler( SigHandler *handler ) +{ + sigset_t block_set; + sigemptyset( &block_set ); + struct sigaction action, old_action; + + action.sa_handler = (SigHandler *)handler; + action.sa_mask = block_set; + action.sa_flags = 0; + sigaction( SIGHUP, &action, &old_action ); +} + +void zmSetTermHandler( SigHandler *handler ) +{ + sigset_t block_set; + sigemptyset( &block_set ); + struct sigaction action, old_action; + + action.sa_handler = (SigHandler *)handler; + action.sa_mask = block_set; + action.sa_flags = 0; + sigaction( SIGTERM, &action, &old_action ); +} + +void zmSetDieHandler( SigHandler *handler ) +{ + sigset_t block_set; + sigemptyset( &block_set ); + struct sigaction action, old_action; + + action.sa_handler = (SigHandler *)handler; + action.sa_mask = block_set; + action.sa_flags = 0; + + sigaction( SIGBUS, &action, &old_action ); + sigaction( SIGSEGV, &action, &old_action ); + sigaction( SIGABRT, &action, &old_action ); + sigaction( SIGILL, &action, &old_action ); + sigaction( SIGFPE, &action, &old_action ); +} + +void zmSetDefaultHupHandler() +{ + zmSetHupHandler( (SigHandler *)zm_hup_handler ); +} + +void zmSetDefaultTermHandler() +{ + zmSetTermHandler( (SigHandler *)zm_term_handler ); +} + +void zmSetDefaultDieHandler() +{ + if ( config.dump_cores ) + { + // Do nothing + } + else + { + zmSetDieHandler( (SigHandler *)zm_die_handler ); + } +} + diff --git a/src/zm_signal.h b/src/zm_signal.h new file mode 100644 index 000000000..f899e19fc --- /dev/null +++ b/src/zm_signal.h @@ -0,0 +1,52 @@ +/* + * ZoneMinder Signal Handling Interface, $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. +*/ + +#ifndef ZM_SIGNAL_H +#define ZM_SIGNAL_H + +#include +#include + +#include "zm.h" + +typedef RETSIGTYPE (SigHandler)( int ); + +extern bool zm_reload; +extern bool zm_terminate; + +RETSIGTYPE zmc_hup_handler( int signal ); +RETSIGTYPE zmc_term_handler( int signal ); +#if HAVE_STRUCT_SIGCONTEXT +RETSIGTYPE zmc_die_handler( int signal, struct sigcontext context ); +#elif ( HAVE_SIGINFO_T && HAVE_UCONTEXT_T ) +#include +RETSIGTYPE zmc_die_handler( int signal, siginfo_t *info, void *context ); +#else +RETSIGTYPE zmc_die_handler( int signal ); +#endif + +void zmSetHupHandler( SigHandler *handler ); +void zmSetTermHandler( SigHandler *handler ); +void zmSetDieHandler( SigHandler *handler ); + +void zmSetDefaultHupHandler(); +void zmSetDefaultTermHandler(); +void zmSetDefaultDieHandler(); + +#endif // ZM_SIGNAL_H diff --git a/src/zm_stream.cpp b/src/zm_stream.cpp new file mode 100644 index 000000000..2cea2f10b --- /dev/null +++ b/src/zm_stream.cpp @@ -0,0 +1,318 @@ +// +// ZoneMinder Stream Class Implementation, $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. +// + +#include + +#include "zm.h" +#include "zm_mpeg.h" +#include "zm_monitor.h" + +#include "zm_stream.h" + +StreamBase::~StreamBase() +{ + closeComms(); +} + +bool StreamBase::loadMonitor( int monitor_id ) +{ + if ( !(monitor = Monitor::Load( monitor_id, false, Monitor::QUERY )) ) + { + Fatal( "Unable to load monitor id %d for streaming", monitor_id ); + return( false ); + } + return( true ); +} + +bool StreamBase::checkInitialised() +{ + if ( !monitor ) + { + Fatal( "Cannot stream, not initialised" ); + return( false ); + } + return( true ); +} + +void StreamBase::updateFrameRate( double fps ) +{ + base_fps = fps; + effective_fps = (base_fps*abs(replay_rate))/ZM_RATE_BASE; + frame_mod = 1; + Debug( 3, "FPS:%.2f, MXFPS:%.2f, BFPS:%.2f, EFPS:%.2f, FM:%d", fps, maxfps, base_fps, effective_fps, frame_mod ); + // Min frame repeat? + while( effective_fps > maxfps ) + { + effective_fps /= 2.0; + frame_mod *= 2; + } + Debug( 3, "aEFPS:%.2f, aFM:%d", effective_fps, frame_mod ); +} + +bool StreamBase::checkCommandQueue() +{ + if ( sd >= 0 ) + { + CmdMsg msg; + memset( &msg, 0, sizeof(msg) ); + int nbytes = recvfrom( sd, &msg, sizeof(msg), MSG_DONTWAIT, 0, 0 ); + if ( nbytes < 0 ) + { + if ( errno != EAGAIN ) + { + Fatal( "recvfrom(), errno = %d, error = %s", errno, strerror(errno) ); + } + } + //else if ( (nbytes != sizeof(msg)) ) + //{ + //Error( "Partial message received, expected %d bytes, got %d", sizeof(msg), nbytes ); + //} + else + { + processCommand( &msg ); + return( true ); + } + } + return( false ); +} + +Image *StreamBase::prepareImage( Image *image ) +{ + static int last_scale = 0; + static int last_zoom = 0; + static int last_x = 0; + static int last_y = 0; + + if ( !last_scale ) + last_scale = scale; + if ( !last_zoom ) + last_zoom = zoom; + + // Do not bother to scale zoomed in images, just crop them and let the browser scale + // Works in FF2 but breaks FF3 which doesn't like image sizes changing in mid stream. + bool optimisedScaling = false; + + bool image_copied = false; + + int mag = (scale * zoom) / ZM_SCALE_BASE; + int act_mag = optimisedScaling?(mag > ZM_SCALE_BASE?ZM_SCALE_BASE:mag):mag; + Debug( 3, "Scaling by %d, zooming by %d = magnifying by %d(%d)", scale, zoom, mag, act_mag ); + + int last_mag = (last_scale * last_zoom) / ZM_SCALE_BASE; + int last_act_mag = last_mag > ZM_SCALE_BASE?ZM_SCALE_BASE:last_mag; + Debug( 3, "Last scaling by %d, zooming by %d = magnifying by %d(%d)", last_scale, last_zoom, last_mag, last_act_mag ); + + int base_image_width = image->Width(), base_image_height = image->Height(); + Debug( 3, "Base image width = %d, height = %d", base_image_width, base_image_height ); + + int virt_image_width = (base_image_width * mag) / ZM_SCALE_BASE, virt_image_height = (base_image_height * mag) / ZM_SCALE_BASE; + Debug( 3, "Virtual image width = %d, height = %d", virt_image_width, virt_image_height ); + + int last_virt_image_width = (base_image_width * last_mag) / ZM_SCALE_BASE, last_virt_image_height = (base_image_height * last_mag) / ZM_SCALE_BASE; + Debug( 3, "Last virtual image width = %d, height = %d", last_virt_image_width, last_virt_image_height ); + + int act_image_width = (base_image_width * act_mag ) / ZM_SCALE_BASE, act_image_height = (base_image_height * act_mag ) / ZM_SCALE_BASE; + Debug( 3, "Actual image width = %d, height = %d", act_image_width, act_image_height ); + + int last_act_image_width = (base_image_width * last_act_mag ) / ZM_SCALE_BASE, last_act_image_height = (base_image_height * last_act_mag ) / ZM_SCALE_BASE; + Debug( 3, "Last actual image width = %d, height = %d", last_act_image_width, last_act_image_height ); + + int disp_image_width = (image->Width() * scale) / ZM_SCALE_BASE, disp_image_height = (image->Height() * scale) / ZM_SCALE_BASE; + Debug( 3, "Display image width = %d, height = %d", disp_image_width, disp_image_height ); + + int last_disp_image_width = (image->Width() * last_scale) / ZM_SCALE_BASE, last_disp_image_height = (image->Height() * last_scale) / ZM_SCALE_BASE; + Debug( 3, "Last display image width = %d, height = %d", last_disp_image_width, last_disp_image_height ); + + int send_image_width = (disp_image_width * act_mag ) / mag, send_image_height = (disp_image_height * act_mag ) / mag; + Debug( 3, "Send image width = %d, height = %d", send_image_width, send_image_height ); + + int last_send_image_width = (last_disp_image_width * last_act_mag ) / last_mag, last_send_image_height = (last_disp_image_height * last_act_mag ) / last_mag; + Debug( 3, "Last send image width = %d, height = %d", last_send_image_width, last_send_image_height ); + + if ( mag != ZM_SCALE_BASE ) + { + if ( act_mag != ZM_SCALE_BASE ) + { + Debug( 3, "Magnifying by %d", mag ); + if ( !image_copied ) + { + static Image copy_image; + copy_image.Assign( *image ); + image = ©_image; + image_copied = true; + } + image->Scale( mag ); + } + } + + Debug( 3, "Real image width = %d, height = %d", image->Width(), image->Height() ); + + if ( disp_image_width < virt_image_width || disp_image_height < virt_image_height ) + { + static Box last_crop; + + if ( mag != last_mag || x != last_x || y != last_y ) + { + Debug( 3, "Got click at %d,%d x %d", x, y, mag ); + + //if ( !last_mag ) + //last_mag = mag; + + if ( !(last_disp_image_width < last_virt_image_width || last_disp_image_height < last_virt_image_height) ) + last_crop = Box(); + + Debug( 3, "Recalculating crop" ); + // Recalculate crop parameters, as %ges + int click_x = (last_crop.LoX() * 100 ) / last_act_image_width; // Initial crop offset from last image + click_x += ( x * 100 ) / last_virt_image_width; + int click_y = (last_crop.LoY() * 100 ) / last_act_image_height; // Initial crop offset from last image + click_y += ( y * 100 ) / last_virt_image_height; + Debug( 3, "Got adjusted click at %d%%,%d%%", click_x, click_y ); + + // Convert the click locations to the current image pixels + click_x = ( click_x * act_image_width ) / 100; + click_y = ( click_y * act_image_height ) / 100; + Debug( 3, "Got readjusted click at %d,%d", click_x, click_y ); + + int lo_x = click_x - (send_image_width/2); + if ( lo_x < 0 ) + lo_x = 0; + int hi_x = lo_x + (send_image_width-1); + if ( hi_x >= act_image_width ) + { + hi_x = act_image_width - 1; + lo_x = hi_x - (send_image_width - 1); + } + + int lo_y = click_y - (send_image_height/2); + if ( lo_y < 0 ) + lo_y = 0; + int hi_y = lo_y + (send_image_height-1); + if ( hi_y >= act_image_height ) + { + hi_y = act_image_height - 1; + lo_y = hi_y - (send_image_height - 1); + } + last_crop = Box( lo_x, lo_y, hi_x, hi_y ); + } + Debug( 3, "Cropping to %d,%d -> %d,%d", last_crop.LoX(), last_crop.LoY(), last_crop.HiX(), last_crop.HiY() ); + if ( !image_copied ) + { + static Image copy_image; + copy_image.Assign( *image ); + image = ©_image; + image_copied = true; + } + image->Crop( last_crop ); + } + last_scale = scale; + last_zoom = zoom; + last_x = x; + last_y = y; + + return( image ); +} + +bool StreamBase::sendTextFrame( const char *frame_text ) +{ + Debug( 2, "Sending text frame '%s'", frame_text ); + + Image image( monitor->Width(), monitor->Height(), monitor->Colours(), monitor->SubpixelOrder() ); + image.Annotate( frame_text, image.centreCoord( frame_text ) ); + + if ( scale != 100 ) + { + image.Scale( scale ); + } +#if HAVE_LIBAVCODEC + if ( type == STREAM_MPEG ) + { + if ( !vid_stream ) + { + vid_stream = new VideoStream( "pipe:", format, bitrate, effective_fps, image.Colours(), image.SubpixelOrder(), image.Width(), image.Height() ); + fprintf( stdout, "Content-type: %s\r\n\r\n", vid_stream->MimeType() ); + vid_stream->OpenStream(); + } + /* double pts = */ vid_stream->EncodeFrame( image.Buffer(), image.Size() ); + } + else +#endif // HAVE_LIBAVCODEC + { + static unsigned char buffer[ZM_MAX_IMAGE_SIZE]; + int n_bytes = 0; + + image.EncodeJpeg( buffer, &n_bytes ); + + fprintf( stdout, "--ZoneMinderFrame\r\n" ); + fprintf( stdout, "Content-Length: %d\r\n", n_bytes ); + fprintf( stdout, "Content-Type: image/jpeg\r\n\r\n" ); + if ( fwrite( buffer, n_bytes, 1, stdout ) != 1 ) + { + Error( "Unable to send stream text frame: %s", strerror(errno) ); + return( false ); + } + fprintf( stdout, "\r\n\r\n" ); + fflush( stdout ); + } + last_frame_sent = TV_2_FLOAT( now ); + return( true ); +} + +void StreamBase::openComms() +{ + if ( connkey > 0 ) + { + sd = socket( AF_UNIX, SOCK_DGRAM, 0 ); + if ( sd < 0 ) + { + Fatal( "Can't create socket: %s", strerror(errno) ); + } + + snprintf( loc_sock_path, sizeof(loc_sock_path), "%s/zms-%06ds.sock", config.path_socks, connkey ); + unlink( loc_sock_path ); + + strncpy( loc_addr.sun_path, loc_sock_path, sizeof(loc_addr.sun_path) ); + loc_addr.sun_family = AF_UNIX; + if ( bind( sd, (struct sockaddr *)&loc_addr, strlen(loc_addr.sun_path)+sizeof(loc_addr.sun_family)) < 0 ) + { + Fatal( "Can't bind: %s", strerror(errno) ); + } + + snprintf( rem_sock_path, sizeof(rem_sock_path), "%s/zms-%06dw.sock", config.path_socks, connkey ); + strncpy( rem_addr.sun_path, rem_sock_path, sizeof(rem_addr.sun_path) ); + rem_addr.sun_family = AF_UNIX; + } +} + +void StreamBase::closeComms() +{ + if ( connkey > 0 ) + { + if ( sd >= 0 ) + { + close( sd ); + sd = -1; + } + if ( loc_sock_path[0] ) + { + unlink( loc_sock_path ); + } + } +} + diff --git a/src/zm_stream.h b/src/zm_stream.h new file mode 100644 index 000000000..22f8b153d --- /dev/null +++ b/src/zm_stream.h @@ -0,0 +1,178 @@ +// +// ZoneMinder Stream Interfaces, $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. +// + +#ifndef ZM_STREAM_H +#define ZM_STREAM_H + +#include +#include + +#include "zm.h" +#include "zm_mpeg.h" + +class Monitor; + +#define TV_2_FLOAT( tv ) ( double((tv).tv_sec) + (double((tv).tv_usec) / 1000000.0) ) + +class StreamBase +{ +public: + typedef enum { STREAM_JPEG, STREAM_RAW, STREAM_ZIP, STREAM_SINGLE, STREAM_MPEG } StreamType; + +protected: + static const int MAX_STREAM_DELAY = 5; // Seconds + + static const StreamType DEFAULT_TYPE = STREAM_JPEG; + enum { DEFAULT_RATE=ZM_RATE_BASE }; + enum { DEFAULT_SCALE=ZM_SCALE_BASE }; + enum { DEFAULT_ZOOM=ZM_SCALE_BASE }; + enum { DEFAULT_MAXFPS=10 }; + enum { DEFAULT_BITRATE=100000 }; + +protected: + typedef struct { + int msg_type; + char msg_data[16]; + } CmdMsg; + + typedef struct { + int msg_type; + char msg_data[256]; + } DataMsg; + + typedef enum { MSG_CMD=1, MSG_DATA_WATCH, MSG_DATA_EVENT } MsgType; + typedef enum { CMD_NONE=0, CMD_PAUSE, CMD_PLAY, CMD_STOP, CMD_FASTFWD, CMD_SLOWFWD, CMD_SLOWREV, CMD_FASTREV, CMD_ZOOMIN, CMD_ZOOMOUT, CMD_PAN, CMD_SCALE, CMD_PREV, CMD_NEXT, CMD_SEEK, CMD_VARPLAY, CMD_QUERY=99 } MsgCommand; + +protected: + Monitor *monitor; + + StreamType type; + const char *format; + int replay_rate; + int scale; + int zoom; + double maxfps; + int bitrate; + unsigned short x, y; + +protected: + int connkey; + int sd; + char loc_sock_path[PATH_MAX]; + struct sockaddr_un loc_addr; + char rem_sock_path[PATH_MAX]; + struct sockaddr_un rem_addr; + +protected: + bool paused; + int step; + + struct timeval now; + + double base_fps; + double effective_fps; + int frame_mod; + + double last_frame_sent; + struct timeval last_frame_timestamp; + +#if HAVE_LIBAVCODEC + VideoStream *vid_stream; +#endif // HAVE_LIBAVCODEC + + CmdMsg msg; + +protected: + bool loadMonitor( int monitor_id ); + bool checkInitialised(); + void updateFrameRate( double fps ); + Image *prepareImage( Image *image ); + bool sendTextFrame( const char *text ); + bool checkCommandQueue(); + virtual void processCommand( const CmdMsg *msg )=0; + +public: + StreamBase() + { + monitor = 0; + + type = DEFAULT_TYPE; + format = ""; + replay_rate = DEFAULT_RATE; + scale = DEFAULT_SCALE; + zoom = DEFAULT_ZOOM; + maxfps = DEFAULT_MAXFPS; + bitrate = DEFAULT_BITRATE; + + paused = false; + step = 0; + x = 0; + y = 0; + + connkey = 0; + sd = -1; + memset( &loc_sock_path, 0, sizeof(loc_sock_path) ); + memset( &loc_addr, 0, sizeof(loc_addr) ); + memset( &rem_sock_path, 0, sizeof(rem_sock_path) ); + memset( &rem_addr, 0, sizeof(rem_addr) ); + + base_fps = 0.0; + effective_fps = 0.0; + frame_mod = 1; + +#if HAVE_LIBAVCODEC + vid_stream = 0; +#endif // HAVE_LIBAVCODEC + } + virtual ~StreamBase(); + + void setStreamType( StreamType p_type ) + { + type = p_type; + } + void setStreamFormat( const char *p_format ) + { + format = p_format; + } + void setStreamScale( int p_scale ) + { + scale = p_scale; + } + void setStreamReplayRate( int p_rate ) + { + replay_rate = p_rate; + } + void setStreamMaxFPS( double p_maxfps ) + { + maxfps = p_maxfps; + } + void setStreamBitrate( int p_bitrate ) + { + bitrate = p_bitrate; + } + void setStreamQueue( int p_connkey ) + { + connkey = p_connkey; + } + virtual void openComms(); + virtual void closeComms(); + virtual void runStream()=0; +}; + +#endif // ZM_STREAM_H diff --git a/src/zm_thread.cpp b/src/zm_thread.cpp new file mode 100644 index 000000000..09cf0da3f --- /dev/null +++ b/src/zm_thread.cpp @@ -0,0 +1,340 @@ +// +// ZoneMinder Thread Class Implementation, $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. +// + +#include "zm_thread.h" + +#include "zm_logger.h" +#include "zm_utils.h" + +#include +#include +#include +#include + +struct timespec getTimeout( int secs ) +{ + struct timespec timeout; + struct timeval temp_timeout; + gettimeofday( &temp_timeout, 0 ); + timeout.tv_sec = temp_timeout.tv_sec + secs; + timeout.tv_nsec = temp_timeout.tv_usec*1000; + return( timeout ); +} + +struct timespec getTimeout( double secs ) +{ + struct timespec timeout; + struct timeval temp_timeout; + gettimeofday( &temp_timeout, 0 ); + timeout.tv_sec = temp_timeout.tv_sec + int(secs); + timeout.tv_nsec = temp_timeout.tv_usec += (long int)(1000000000.0*(secs-int(secs))); + if ( timeout.tv_nsec > 1000000000 ) + { + timeout.tv_sec += 1; + timeout.tv_nsec -= 1000000000; + } + return( timeout ); +} + +Mutex::Mutex() +{ + if ( pthread_mutex_init( &mMutex, NULL ) < 0 ) + throw ThreadException( stringtf( "Unable to create pthread mutex: %s", strerror(errno) ) ); +} + +Mutex::~Mutex() +{ + if ( locked() ) + Warning( "Destroying mutex when locked" ); + if ( pthread_mutex_destroy( &mMutex ) < 0 ) + throw ThreadException( stringtf( "Unable to destroy pthread mutex: %s", strerror(errno) ) ); +} + +void Mutex::lock() +{ + if ( pthread_mutex_lock( &mMutex ) < 0 ) + throw ThreadException( stringtf( "Unable to lock pthread mutex: %s", strerror(errno) ) ); +} + +void Mutex::lock( int secs ) +{ + struct timespec timeout = getTimeout( secs ); + if ( pthread_mutex_timedlock( &mMutex, &timeout ) < 0 ) + throw ThreadException( stringtf( "Unable to timedlock pthread mutex: %s", strerror(errno) ) ); +} + +void Mutex::lock( double secs ) +{ + struct timespec timeout = getTimeout( secs ); + if ( pthread_mutex_timedlock( &mMutex, &timeout ) < 0 ) + throw ThreadException( stringtf( "Unable to timedlock pthread mutex: %s", strerror(errno) ) ); +} + +void Mutex::unlock() +{ + if ( pthread_mutex_unlock( &mMutex ) < 0 ) + throw ThreadException( stringtf( "Unable to unlock pthread mutex: %s", strerror(errno) ) ); +} + +bool Mutex::locked() +{ + int state = pthread_mutex_trylock( &mMutex ); + if ( state != 0 && state != EBUSY ) + throw ThreadException( stringtf( "Unable to trylock pthread mutex: %s", strerror(errno) ) ); + if ( state != EBUSY ) + unlock(); + return( state == EBUSY ); +} + +Condition::Condition( Mutex &mutex ) : mMutex( mutex ) +{ + if ( pthread_cond_init( &mCondition, NULL ) < 0 ) + throw ThreadException( stringtf( "Unable to create pthread condition: %s", strerror(errno) ) ); +} + +Condition::~Condition() +{ + if ( pthread_cond_destroy( &mCondition ) < 0 ) + throw ThreadException( stringtf( "Unable to destroy pthread condition: %s", strerror(errno) ) ); +} + +void Condition::wait() +{ + // Locking done outside of this function + if ( pthread_cond_wait( &mCondition, mMutex.getMutex() ) < 0 ) + throw ThreadException( stringtf( "Unable to wait pthread condition: %s", strerror(errno) ) ); +} + +bool Condition::wait( int secs ) +{ + // Locking done outside of this function + Debug( 8, "Waiting for %d seconds", secs ); + struct timespec timeout = getTimeout( secs ); + if ( pthread_cond_timedwait( &mCondition, mMutex.getMutex(), &timeout ) < 0 && errno != ETIMEDOUT ) + throw ThreadException( stringtf( "Unable to timedwait pthread condition: %s", strerror(errno) ) ); + return( errno != ETIMEDOUT ); +} + +bool Condition::wait( double secs ) +{ + // Locking done outside of this function + struct timespec timeout = getTimeout( secs ); + if ( pthread_cond_timedwait( &mCondition, mMutex.getMutex(), &timeout ) < 0 && errno != ETIMEDOUT ) + throw ThreadException( stringtf( "Unable to timedwait pthread condition: %s", strerror(errno) ) ); + return( errno != ETIMEDOUT ); +} + +void Condition::signal() +{ + if ( pthread_cond_signal( &mCondition ) < 0 ) + throw ThreadException( stringtf( "Unable to signal pthread condition: %s", strerror(errno) ) ); +} + +void Condition::broadcast() +{ + if ( pthread_cond_broadcast( &mCondition ) < 0 ) + throw ThreadException( stringtf( "Unable to broadcast pthread condition: %s", strerror(errno) ) ); +} + +template const T ThreadData::getValue() const +{ + mMutex.lock(); + const T valueCopy = mValue; + mMutex.unlock(); + return( valueCopy ); +} + +template T ThreadData::setValue( const T value ) +{ + mMutex.lock(); + const T valueCopy = mValue = value; + mMutex.unlock(); + return( valueCopy ); +} + +template const T ThreadData::getUpdatedValue() const +{ + Debug( 8, "Waiting for value update, %p", this ); + mMutex.lock(); + mChanged = false; + //do { + mCondition.wait(); + //} while ( !mChanged ); + const T valueCopy = mValue; + mMutex.unlock(); + Debug( 9, "Got value update, %p", this ); + return( valueCopy ); +} + +template const T ThreadData::getUpdatedValue( double secs ) const +{ + Debug( 8, "Waiting for value update, %.2f secs, %p", secs, this ); + mMutex.lock(); + mChanged = false; + //do { + mCondition.wait( secs ); + //} while ( !mChanged ); + const T valueCopy = mValue; + mMutex.unlock(); + Debug( 9, "Got value update, %p", this ); + return( valueCopy ); +} + +template const T ThreadData::getUpdatedValue( int secs ) const +{ + Debug( 8, "Waiting for value update, %d secs, %p", secs, this ); + mMutex.lock(); + mChanged = false; + //do { + mCondition.wait( secs ); + //} while ( !mChanged ); + const T valueCopy = mValue; + mMutex.unlock(); + Debug( 9, "Got value update, %p", this ); + return( valueCopy ); +} + +template void ThreadData::updateValueSignal( const T value ) +{ + Debug( 8, "Updating value with signal, %p", this ); + mMutex.lock(); + mValue = value; + mChanged = true; + mCondition.signal(); + mMutex.unlock(); + Debug( 9, "Updated value, %p", this ); +} + +template void ThreadData::updateValueBroadcast( const T value ) +{ + Debug( 8, "Updating value with broadcast, %p", this ); + mMutex.lock(); + mValue = value; + mChanged = true; + mCondition.broadcast(); + mMutex.unlock(); + Debug( 9, "Updated value, %p", this ); +} + +Thread::Thread() : + mThreadCondition( mThreadMutex ), + mPid( -1 ), + mStarted( false ), + mRunning( false ) +{ + Debug( 1, "Creating thread" ); +} + +Thread::~Thread() +{ + Debug( 1, "Destroying thread %d", mPid ); + if ( mStarted ) + join(); +} + +void *Thread::mThreadFunc( void *arg ) +{ + Debug( 2, "Invoking thread" ); + + Thread *thisPtr = (Thread *)arg; + void *status = 0; + try + { + thisPtr->mThreadMutex.lock(); + thisPtr->mPid = thisPtr->id(); + thisPtr->mThreadCondition.signal(); + thisPtr->mThreadMutex.unlock(); + thisPtr->mRunning = true; + int run=(thisPtr->run()); + status = (void *)&run; + thisPtr->mRunning = false; + Debug( 2, "Exiting thread, status %p", status ); + } + catch ( const ThreadException &e ) + { + Error( "%s", e.getMessage().c_str() ); + thisPtr->mRunning = false; + status = (void *)-1; + Debug( 2, "Exiting thread after exception, status %p", status ); + } + return( status ); +} + +void Thread::start() +{ + Debug( 1, "Starting thread" ); + if ( isThread() ) + throw ThreadException( "Can't self start thread" ); + mThreadMutex.lock(); + if ( !mStarted ) + { + pthread_attr_t threadAttrs; + pthread_attr_init( &threadAttrs ); + pthread_attr_setscope( &threadAttrs, PTHREAD_SCOPE_SYSTEM ); + + mStarted = true; + if ( pthread_create( &mThread, &threadAttrs, mThreadFunc, this ) < 0 ) + throw ThreadException( stringtf( "Can't create thread: %s", strerror(errno) ) ); + pthread_attr_destroy( &threadAttrs ); + } + else + { + Error( "Attempt to start already running thread %d", mPid ); + } + mThreadCondition.wait(); + mThreadMutex.unlock(); + Debug( 1, "Started thread %d", mPid ); +} + +void Thread::join() +{ + Debug( 1, "Joining thread %d", mPid ); + if ( isThread() ) + throw ThreadException( "Can't self join thread" ); + mThreadMutex.lock(); + if ( mPid >= 0 ) + { + if ( mStarted ) + { + void *threadStatus = 0; + if ( pthread_join( mThread, &threadStatus ) < 0 ) + throw ThreadException( stringtf( "Can't join sender thread: %s", strerror(errno) ) ); + mStarted = false; + Debug( 1, "Thread %d exited, status %p", mPid, threadStatus ); + } + else + { + Warning( "Attempt to join already finished thread %d", mPid ); + } + } + else + { + Warning( "Attempt to join non-started thread %d", mPid ); + } + mThreadMutex.unlock(); + Debug( 1, "Joined thread %d", mPid ); +} + +void Thread::kill( int signal ) +{ + pthread_kill( mThread, signal ); +} + +// Some explicit template instantiations +#include "zm_threaddata.cpp" diff --git a/src/zm_thread.h b/src/zm_thread.h new file mode 100644 index 000000000..a4ba71edd --- /dev/null +++ b/src/zm_thread.h @@ -0,0 +1,227 @@ +// +// ZoneMinder Thread Class Interface, $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. +// + +#ifndef ZM_THREAD_H +#define ZM_THREAD_H + +#include +#include +#include "zm_exception.h" +#include "zm_utils.h" + +class ThreadException : public Exception +{ +public: + ThreadException( const std::string &message ) : Exception( stringtf( "(%d) "+message, (long int)syscall(224) ) ) + { + } +}; + +class Mutex +{ +friend class Condition; + +private: + pthread_mutex_t mMutex; + +public: + Mutex(); + ~Mutex(); + +private: + pthread_mutex_t *getMutex() + { + return( &mMutex ); + } + +public: + void lock(); + void lock( int secs ); + void lock( double secs ); + void unlock(); + bool locked(); +}; + +class ScopedMutex +{ +private: + Mutex &mMutex; + +public: + ScopedMutex( Mutex &mutex ) : mMutex( mutex ) + { + mMutex.lock(); + } + ~ScopedMutex() + { + mMutex.unlock(); + } + +private: + ScopedMutex( const ScopedMutex & ); +}; + +class Condition +{ +private: + Mutex &mMutex; + pthread_cond_t mCondition; + +public: + Condition( Mutex &mutex ); + ~Condition(); + + void wait(); + bool wait( int secs ); + bool wait( double secs ); + void signal(); + void broadcast(); +}; + +class Semaphore : public Condition +{ +private: + Mutex mMutex; + +public: + Semaphore() : Condition( mMutex ) + { + } + + void wait() + { + mMutex.lock(); + Condition::wait(); + mMutex.unlock(); + } + bool wait( int secs ) + { + mMutex.lock(); + bool result = Condition::wait( secs ); + mMutex.unlock(); + return( result ); + } + bool wait( double secs ) + { + mMutex.lock(); + bool result = Condition::wait( secs ); + mMutex.unlock(); + return( result ); + } + void signal() + { + mMutex.lock(); + Condition::signal(); + mMutex.unlock(); + } + void broadcast() + { + mMutex.lock(); + Condition::broadcast(); + mMutex.unlock(); + } +}; + +template class ThreadData +{ +private: + T mValue; + mutable bool mChanged; + mutable Mutex mMutex; + mutable Condition mCondition; + +public: + __attribute__((used)) ThreadData() : mCondition( mMutex ) + { + } + __attribute__((used)) ThreadData( T value ) : mValue( value ), mCondition( mMutex ) + { + } + //~ThreadData() {} + + __attribute__((used)) operator T() const + { + return( getValue() ); + } + __attribute__((used)) const T operator=( const T value ) + { + return( setValue( value ) ); + } + + __attribute__((used)) const T getValueImmediate() const + { + return( mValue ); + } + __attribute__((used)) T setValueImmediate( const T value ) + { + return( mValue = value ); + } + __attribute__((used)) const T getValue() const; + __attribute__((used)) T setValue( const T value ); + __attribute__((used)) const T getUpdatedValue() const; + __attribute__((used)) const T getUpdatedValue( double secs ) const; + __attribute__((used)) const T getUpdatedValue( int secs ) const; + __attribute__((used)) void updateValueSignal( const T value ); + __attribute__((used)) void updateValueBroadcast( const T value ); +}; + +class Thread +{ +public: + typedef void *(*ThreadFunc)( void * ); + +protected: + pthread_t mThread; + + Mutex mThreadMutex; + Condition mThreadCondition; + pid_t mPid; + bool mStarted; + bool mRunning; + +protected: + Thread(); + virtual ~Thread(); + + pid_t id() const + { + return( (pid_t)syscall(224) ); + } + void exit( int status = 0 ) + { + //INFO( "Exiting" ); + pthread_exit( (void *)&status ); + } + static void *mThreadFunc( void *arg ); + +public: + virtual int run() = 0; + + void start(); + void join(); + void kill( int signal ); + bool isThread() + { + return( mPid > -1 && pthread_equal( pthread_self(), mThread ) ); + } + bool isStarted() const { return( mStarted ); } + bool isRunning() const { return( mRunning ); } +}; + +#endif // ZM_THREAD_H diff --git a/src/zm_threaddata.cpp b/src/zm_threaddata.cpp new file mode 100644 index 000000000..0742063c9 --- /dev/null +++ b/src/zm_threaddata.cpp @@ -0,0 +1,22 @@ +// +// ZoneMinder Explicit Thread Template Class Instantiations, $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. +// + +template class ThreadData; +template class ThreadData; + diff --git a/src/zm_time.cpp b/src/zm_time.cpp new file mode 100644 index 000000000..08b673469 --- /dev/null +++ b/src/zm_time.cpp @@ -0,0 +1,22 @@ +// +// ZoneMinder Time Functions & Definitions Implementation, $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. +// + +#include "zm_time.h" + +// Blank diff --git a/src/zm_time.h b/src/zm_time.h new file mode 100644 index 000000000..646133feb --- /dev/null +++ b/src/zm_time.h @@ -0,0 +1,209 @@ +// +// ZoneMinder Time Functions & Definitions, $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. +// + +#ifndef ZM_TIME_H +#define ZM_TIME_H + +#include "zm.h" + +#include + +// Structure used for storing the results of the subtraction +// of one struct timeval from another + +struct DeltaTimeval +{ + bool positive; + unsigned long delta; + unsigned long sec; + unsigned long fsec; + unsigned long prec; +}; + +#define DT_GRAN_1000000 1000000 +#define DT_PREC_6 DT_GRAN_1000000 +#define DT_GRAN_100000 100000 +#define DT_PREC_5 DT_GRAN_100000 +#define DT_GRAN_10000 10000 +#define DT_PREC_4 DT_GRAN_10000 +#define DT_GRAN_1000 1000 +#define DT_PREC_3 DT_GRAN_1000 +#define DT_GRAN_100 100 +#define DT_PREC_2 DT_GRAN_100 +#define DT_GRAN_10 10 +#define DT_PREC_1 DT_GRAN_10 + +#define DT_MAXGRAN DT_GRAN_1000000 + +// This obviously wouldn't work for massive deltas but as it's mostly +// for frames it will only usually be a fraction of a second or so +#define DELTA_TIMEVAL( result, time1, time2, precision ) \ +{ \ + int delta = (((time1).tv_sec-(time2).tv_sec)*(precision))+(((time1).tv_usec-(time2).tv_usec)/(DT_MAXGRAN/(precision))); \ + result.positive = (delta>=0); \ + result.delta = abs(delta); \ + result.sec = result.delta/(precision); \ + result.fsec = result.delta%(precision); \ + result.prec = (precision); \ +} + +#define TIMEVAL_INTERVAL( result, time1, time2, precision ) \ +{ \ + int delta = (((time1).tv_sec-(time2).tv_sec)*(precision))+(((time1).tv_usec-(time2).tv_usec)/(DT_MAXGRAN/(precision))); \ + result.positive = (delta>=0); \ + result.delta = abs(delta); \ + result.sec = result.delta/(precision); \ + result.fsec = result.delta%(precision); \ + result.prec = (precision); \ +} + +#define USEC_PER_SEC 1000000 +#define MSEC_PER_SEC 1000 + +extern struct timeval tv; +typedef typeof(tv.tv_sec) ast_time_t; +typedef typeof(tv.tv_usec) ast_suseconds_t; + +inline int tvDiffUsec( struct timeval first, struct timeval last ) +{ + return( (last.tv_sec - first.tv_sec) * USEC_PER_SEC) + ((USEC_PER_SEC + last.tv_usec - first.tv_usec) - USEC_PER_SEC ); +} + +inline int tvDiffUsec( struct timeval first ) +{ + struct timeval now; + gettimeofday( &now, NULL ); + return( tvDiffUsec( first, now ) ); +} + +inline int tvDiffMsec( struct timeval first, struct timeval last ) +{ + return( (last.tv_sec - first.tv_sec) * MSEC_PER_SEC) + (((MSEC_PER_SEC + last.tv_usec - first.tv_usec) / MSEC_PER_SEC) - MSEC_PER_SEC ); +} + +inline int tvDiffMsec( struct timeval first ) +{ + struct timeval now; + gettimeofday( &now, NULL ); + return( tvDiffMsec( first, now ) ); +} + +inline double tvDiffSec( struct timeval first, struct timeval last ) +{ + return( double(last.tv_sec - first.tv_sec) + double(((USEC_PER_SEC + last.tv_usec - first.tv_usec) - USEC_PER_SEC) / (1.0*USEC_PER_SEC) ) ); +} + +inline double tvDiffSec( struct timeval first ) +{ + struct timeval now; + gettimeofday( &now, NULL ); + return( tvDiffSec( first, now ) ); +} + +inline struct timeval tvZero() +{ + struct timeval t = { 0, 0 }; + return( t ); +} + +inline int tvIsZero( const struct timeval t ) +{ + return( t.tv_sec == 0 && t.tv_usec == 0 ); +} + +inline int tvCmp( struct timeval t1, struct timeval t2 ) +{ + if ( t1.tv_sec < t2.tv_sec ) + return( -1 ); + if ( t1.tv_sec > t2.tv_sec ) + return( 1 ); + if ( t1.tv_usec < t2.tv_usec ) + return( -1 ); + if ( t1.tv_usec > t2.tv_usec ) + return( 1 ); + return( 0 ); +} + +inline int tvEq( struct timeval t1, struct timeval t2 ) +{ + return( t1.tv_sec == t2.tv_sec && t1.tv_usec == t2.tv_usec ); +} + +inline struct timeval tvNow( void ) +{ + struct timeval t; + gettimeofday( &t, NULL ); + return( t ); +} + +inline struct timeval tvCheck( struct timeval &t ) +{ + if ( t.tv_usec >= USEC_PER_SEC ) + { + Warning( "Timestamp too large %ld.%ld\n", t.tv_sec, (long int) t.tv_usec ); + t.tv_sec += t.tv_usec / USEC_PER_SEC; + t.tv_usec %= USEC_PER_SEC; + } + else if ( t.tv_usec < 0 ) + { + Warning( "Got negative timestamp %ld.%ld\n", t.tv_sec, (long int)t.tv_usec ); + t.tv_usec = 0; + } + return( t ); +} + +// Add t2 to t1 +inline struct timeval tvAdd( struct timeval t1, struct timeval t2 ) +{ + tvCheck(t1); + tvCheck(t2); + t1.tv_sec += t2.tv_sec; + t1.tv_usec += t2.tv_usec; + if ( t1.tv_usec >= USEC_PER_SEC ) + { + t1.tv_sec++; + t1.tv_usec -= USEC_PER_SEC; + } + return( t1 ); +} + +// Subtract t2 from t1 +inline struct timeval tvSub( struct timeval t1, struct timeval t2 ) +{ + tvCheck(t1); + tvCheck(t2); + t1.tv_sec -= t2.tv_sec; + t1.tv_usec -= t2.tv_usec; + if ( t1.tv_usec < 0 ) + { + t1.tv_sec--; + t1.tv_usec += USEC_PER_SEC; + } + return( t1 ) ; +} + +inline struct timeval tvMake( time_t sec, suseconds_t usec ) +{ + struct timeval t; + t.tv_sec = sec; + t.tv_usec = usec; + return( t ); +} + +#endif // ZM_TIME_H diff --git a/src/zm_timer.cpp b/src/zm_timer.cpp new file mode 100644 index 000000000..fbac45435 --- /dev/null +++ b/src/zm_timer.cpp @@ -0,0 +1,119 @@ +// +// ZoneMinder Timer Class Implementation, $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. +// + +#include "zm_timer.h" + +#include "zm_logger.h" + +int Timer::TimerThread::mNextTimerId = 0; + +Timer::TimerThread::TimerThread( Timer &timer, int duration, bool repeat ) : + mTimerId( 0 ), + mTimer( timer ), + mDuration( duration ), + mRepeat( repeat ), + mReset( false ), + mExpiryFlag( true ) +{ + mAccessMutex.lock(); + mTimerId = mNextTimerId++; + Debug( 5, "Creating timer %d for %d seconds%s", mTimerId, mDuration, mRepeat?", repeating":"" ); + mAccessMutex.unlock(); +} + +Timer::TimerThread::~TimerThread() +{ + cancel(); +} + +void Timer::TimerThread::cancel() +{ + mAccessMutex.lock(); + if ( mRunning ) + { + Debug( 4, "Cancelling timer %d", mTimerId ); + mRepeat = false; + mReset = false; + mExpiryFlag.updateValueSignal( false ); + } + mAccessMutex.unlock(); +} + +void Timer::TimerThread::reset() +{ + mAccessMutex.lock(); + if ( mRunning ) + { + Debug( 4, "Resetting timer" ); + mReset = true; + mExpiryFlag.updateValueSignal( false ); + } + else + { + Error( "Attempting to reset expired timer %d", mTimerId ); + } + mAccessMutex.unlock(); +} + +int Timer::TimerThread::run() +{ + Debug( 4, "Starting timer %d for %d seconds", mTimerId, mDuration ); + bool timerExpired = false; + do + { + mAccessMutex.lock(); + mReset = false; + mExpiryFlag.setValue( true ); + mAccessMutex.unlock(); + timerExpired = mExpiryFlag.getUpdatedValue( mDuration ); + mAccessMutex.lock(); + if ( timerExpired ) + { + Debug( 4, "Timer %d expired", mTimerId ); + mTimer.expire(); + } + else + { + Debug( 4, "Timer %d %s", mTimerId, mReset?"reset":"cancelled" ); + } + mAccessMutex.unlock(); + } while ( mRepeat || (mReset && !timerExpired) ); + return( timerExpired ); +} + +Timer::Timer( int timeout, bool repeat ) : mTimerThread( *this, timeout, repeat ) +{ + mTimerThread.start(); +} + +Timer::~Timer() +{ + //cancel(); +} + +void Timer::Timer::cancel() +{ + mTimerThread.cancel(); +} + +void Timer::Timer::reset() +{ + mTimerThread.reset(); +} + diff --git a/src/zm_timer.h b/src/zm_timer.h new file mode 100644 index 000000000..f1aa54706 --- /dev/null +++ b/src/zm_timer.h @@ -0,0 +1,87 @@ +// +// ZoneMinder Timer Class Interface, $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. +// + +#ifndef ZM_TIMER_H +#define ZM_TIMER_H + +#include "zm_thread.h" + +#include "zm_exception.h" + +class Timer +{ +private: + class TimerException : public Exception + { + public: + TimerException( const std::string &message ) : Exception( stringtf( "(%d) "+message, (long int)syscall(224) ) ) + { + } + }; + + class TimerThread : public Thread + { + private: + typedef ThreadData ExpiryFlag; + + private: + static int mNextTimerId; + + private: + int mTimerId; + Timer &mTimer; + int mDuration; + int mRepeat; + int mReset; + ExpiryFlag mExpiryFlag; + Mutex mAccessMutex; + + private: + void quit() + { + cancel(); + } + + public: + TimerThread( Timer &timer, int timeout, bool repeat ); + ~TimerThread(); + + void cancel(); + void reset(); + int run(); + }; + +protected: + TimerThread mTimerThread; + +protected: + Timer( int timeout, bool repeat=false ); + +public: + virtual ~Timer(); + +protected: + virtual void expire()=0; + +public: + void cancel(); + void reset(); +}; + +#endif // ZM_TIMER_H diff --git a/src/zm_user.cpp b/src/zm_user.cpp new file mode 100644 index 000000000..9bc712230 --- /dev/null +++ b/src/zm_user.cpp @@ -0,0 +1,246 @@ +/* + * ZoneMinder regular expression class implementation, $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. +*/ + +#include "zm.h" +#include "zm_db.h" + +#include "zm_user.h" + +#include +#include +#include +#include + +User::User() +{ + username[0] = password[0] = 0; + enabled = false; + stream = events = control = monitors = system = PERM_NONE; + monitor_ids = 0; +} + +User::User( MYSQL_ROW &dbrow ) +{ + int index = 0; + strncpy( username, dbrow[index++], sizeof(username) ); + strncpy( password, dbrow[index++], sizeof(password) ); + enabled = (bool)atoi( dbrow[index++] ); + stream = (Permission)atoi( dbrow[index++] ); + events = (Permission)atoi( dbrow[index++] ); + control = (Permission)atoi( dbrow[index++] ); + monitors = (Permission)atoi( dbrow[index++] ); + system = (Permission)atoi( dbrow[index++] ); + monitor_ids = 0; + char *monitor_ids_str = dbrow[index++]; + if ( monitor_ids_str && *monitor_ids_str ) + { + monitor_ids = new int[strlen(monitor_ids_str)]; + int n_monitor_ids = 0; + const char *ptr = monitor_ids_str; + do + { + int id = 0; + while( isdigit( *ptr ) ) + { + id *= 10; + id += *ptr-'0'; + ptr++; + } + if ( id ) + { + monitor_ids[n_monitor_ids++] = id; + if ( !*ptr ) + break; + } + while ( !isdigit( *ptr ) ) + ptr++; + } while( *ptr ); + monitor_ids[n_monitor_ids] = 0; + } +} + +User::~User() +{ + delete monitor_ids; +} + +bool User::canAccess( int monitor_id ) +{ + if ( !monitor_ids ) + { + return( true ); + } + for ( int i = 0; monitor_ids[i]; i++ ) + { + if ( monitor_ids[i] == monitor_id ) + { + return( true ); + } + } + return( false ); +} + +// Function to load a user from username and password +User *zmLoadUser( const char *username, const char *password ) +{ + char sql[ZM_SQL_SML_BUFSIZ] = ""; + + if ( password ) + { + snprintf( sql, sizeof(sql), "select Username, Password, Enabled, Stream+0, Events+0, Control+0, Monitors+0, System+0, MonitorIds from Users where Username = '%s' and Password = password('%s') and Enabled = 1", username, password ); + } + else + { + snprintf( sql, sizeof(sql), "select Username, Password, Enabled, Stream+0, Events+0, Control+0, Monitors+0, System+0, MonitorIds from Users where Username = '%s' and Enabled = 1", username ); + } + + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_users = mysql_num_rows( result ); + + if ( n_users != 1 ) + { + Warning( "Unable to authenticate user %s", username ); + return( 0 ); + } + + MYSQL_ROW dbrow = mysql_fetch_row( result ); + + User *user = new User( dbrow ); + Info( "Authenticated user '%s'", user->getUsername() ); + + mysql_free_result( result ); + + return( user ); +} + +// Function to validate an authentication string +User *zmLoadAuthUser( const char *auth, bool use_remote_addr ) +{ +#if HAVE_DECL_MD5 || HAVE_DECL_GNUTLS_FINGERPRINT +#ifdef HAVE_GCRYPT_H + // Special initialisation for libgcrypt + if ( !gcry_check_version( GCRYPT_VERSION ) ) + { + Fatal( "Unable to initialise libgcrypt" ); + } + gcry_control( GCRYCTL_DISABLE_SECMEM, 0 ); + gcry_control( GCRYCTL_INITIALIZATION_FINISHED, 0 ); +#endif // HAVE_GCRYPT_H + + const char *remote_addr = ""; + if ( use_remote_addr ) + { + remote_addr = getenv( "REMOTE_ADDR" ); + if ( !remote_addr ) + { + Warning( "Can't determine remote address, using null" ); + remote_addr = ""; + } + } + + Debug( 1, "Attempting to authenticate user from auth string '%s'", auth ); + char sql[ZM_SQL_SML_BUFSIZ] = ""; + snprintf( sql, sizeof(sql), "select Username, Password, Enabled, Stream+0, Events+0, Control+0, Monitors+0, System+0, MonitorIds from Users where Enabled = 1" ); + + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_users = mysql_num_rows( result ); + + if ( n_users < 1 ) + { + Warning( "Unable to authenticate user" ); + return( 0 ); + } + + while( MYSQL_ROW dbrow = mysql_fetch_row( result ) ) + { + const char *user = dbrow[0]; + const char *pass = dbrow[1]; + + char auth_key[512] = ""; + char auth_md5[32+1] = ""; + size_t md5len = 32; + unsigned char md5sum[md5len]; + + time_t now = time( 0 ); + int max_tries = 2; + + for ( int i = 0; i < max_tries; i++, now -= (60*60) ) + { + struct tm *now_tm = localtime( &now ); + + snprintf( auth_key, sizeof(auth_key), "%s%s%s%s%d%d%d%d", + config.auth_hash_secret, + user, + pass, + remote_addr, + now_tm->tm_hour, + now_tm->tm_mday, + now_tm->tm_mon, + now_tm->tm_year + ); + +#if HAVE_DECL_MD + MD5( (unsigned char *)auth_key, strlen(auth_key), md5sum ); +#elif HAVE_DECL_GNUTLS_FINGERPRINT + gnutls_datum_t md5data = { (unsigned char *)auth_key, strlen(auth_key) }; + gnutls_fingerprint( GNUTLS_DIG_MD5, &md5data, md5sum, &md5len ); +#endif + auth_md5[0] = '\0'; + for ( unsigned int j = 0; j < md5len; j++ ) + { + sprintf( &auth_md5[2*j], "%02x", md5sum[j] ); + } + Debug( 1, "Checking auth_key '%s' -> auth_md5 '%s'", auth_key, auth_md5 ); + + if ( !strcmp( auth, auth_md5 ) ) + { + // We have a match + User *user = new User( dbrow ); + Info( "Authenticated user '%s'", user->getUsername() ); + return( user ); + } + } + } +#else // HAVE_DECL_MD5 + Error( "You need to build with gnutls or openssl installed to use hash based authentication" ); +#endif // HAVE_DECL_MD5 + return( 0 ); +} diff --git a/src/zm_user.h b/src/zm_user.h new file mode 100644 index 000000000..95fb71474 --- /dev/null +++ b/src/zm_user.h @@ -0,0 +1,74 @@ +/* + * ZoneMinder User Class Interface, $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. +*/ + +#include "zm.h" +#include "zm_db.h" + +#ifndef ZM_USER_H +#define ZM_USER_H + +#if HAVE_GNUTLS_OPENSSL_H +#include +#endif +#if HAVE_GNUTLS_GNUTLS_H +#include +#endif + +#if HAVE_GCRYPT_H +#include +#elif HAVE_LIBCRYPTO +#include +#endif // HAVE_L || HAVE_LIBCRYPTO + +class User +{ +public: + typedef enum { PERM_NONE=1, PERM_VIEW, PERM_EDIT } Permission; + +protected: + char username[32+1]; + char password[64+1]; + bool enabled; + Permission stream; + Permission events; + Permission control; + Permission monitors; + Permission system; + int *monitor_ids; + +public: + User(); + User( MYSQL_ROW &dbrow ); + ~User(); + + const char *getUsername() const { return( username ); } + const char *getPassword() const { return( password ); } + bool isEnabled() const { return( enabled ); } + Permission getStream() const { return( stream ); } + Permission getEvents() const { return( events ); } + Permission getControl() const { return( control ); } + Permission getMonitors() const { return( monitors ); } + Permission getSystem() const { return( system ); } + bool canAccess( int monitor_id ); +}; + +User *zmLoadUser( const char *username, const char *password=0 ); +User *zmLoadAuthUser( const char *auth, bool use_remote_addr ); + +#endif // ZM_USER_H diff --git a/src/zm_utils.cpp b/src/zm_utils.cpp new file mode 100644 index 000000000..cef91366e --- /dev/null +++ b/src/zm_utils.cpp @@ -0,0 +1,253 @@ +// +// ZoneMinder General Utility Functions, $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. +// + +//#include "zm_logger.h" +#include "zm.h" +#include "zm_utils.h" + +#include +#include +#include + +unsigned int sseversion = 0; + +const std::string stringtf( const char *format, ... ) +{ + va_list ap; + char tempBuffer[8192]; + std::string tempString; + + va_start(ap, format ); + vsnprintf( tempBuffer, sizeof(tempBuffer), format , ap ); + va_end(ap); + + tempString = tempBuffer; + + return( tempString ); +} + +const std::string stringtf( const std::string &format, ... ) +{ + va_list ap; + char tempBuffer[8192]; + std::string tempString; + + va_start(ap, format ); + vsnprintf( tempBuffer, sizeof(tempBuffer), format.c_str() , ap ); + va_end(ap); + + tempString = tempBuffer; + + return( tempString ); +} + +bool startsWith( const std::string &haystack, const std::string &needle ) +{ + return( haystack.substr( 0, needle.length() ) == needle ); +} + +StringVector split( const std::string &string, const std::string chars, int limit ) +{ + StringVector stringVector; + std::string tempString = string; + std::string::size_type startIndex = 0; + std::string::size_type endIndex = 0; + + //Info( "Looking for '%s' in '%s', limit %d", chars.c_str(), string.c_str(), limit ); + do + { + // Find delimiters + endIndex = string.find_first_of( chars, startIndex ); + //Info( "Got endIndex at %d", endIndex ); + if ( endIndex > 0 ) + { + //Info( "Adding '%s'", string.substr( startIndex, endIndex-startIndex ).c_str() ); + stringVector.push_back( string.substr( startIndex, endIndex-startIndex ) ); + } + if ( endIndex == std::string::npos ) + break; + // Find non-delimiters + startIndex = tempString.find_first_not_of( chars, endIndex ); + if ( limit && (stringVector.size() == (unsigned int)(limit-1)) ) + { + stringVector.push_back( string.substr( startIndex ) ); + break; + } + //Info( "Got new startIndex at %d", startIndex ); + } while ( startIndex != std::string::npos ); + //Info( "Finished with %d strings", stringVector.size() ); + + return( stringVector ); +} + +const std::string base64Encode( const std::string &inString ) +{ + static char base64_table[64] = { '\0' }; + + if ( !base64_table[0] ) + { + int i = 0; + for ( char c = 'A'; c <= 'Z'; c++ ) + base64_table[i++] = c; + for ( char c = 'a'; c <= 'z'; c++ ) + base64_table[i++] = c; + for ( char c = '0'; c <= '9'; c++ ) + base64_table[i++] = c; + base64_table[i++] = '+'; + base64_table[i++] = '/'; + } + + std::string outString; + outString.reserve( 2 * inString.size() ); + + const char *inPtr = inString.c_str(); + while( *inPtr ) + { + unsigned char selection = *inPtr >> 2; + unsigned char remainder = (*inPtr++ & 0x03) << 4; + outString += base64_table[selection]; + + if ( *inPtr ) + { + selection = remainder | (*inPtr >> 4); + remainder = (*inPtr++ & 0x0f) << 2; + outString += base64_table[selection]; + + if ( *inPtr ) + { + selection = remainder | (*inPtr >> 6); + outString += base64_table[selection]; + selection = (*inPtr++ & 0x3f); + outString += base64_table[selection]; + } + else + { + outString += base64_table[remainder]; + outString += '='; + } + } + else + { + outString += base64_table[remainder]; + outString += '='; + outString += '='; + } + } + return( outString ); +} + +/* Sets sse_version */ +void ssedetect() { +#if (defined(__i386__) || defined(__x86_64__)) + /* x86 or x86-64 processor */ + uint32_t r_edx, r_ecx; + + __asm__ __volatile__( + "mov $0x1,%%eax\n\t" + "cpuid\n\t" + : "=d" (r_edx), "=c" (r_ecx) + : + : "%eax", "%ebx" + ); + + if (r_ecx & 0x00000200) { + sseversion = 35; /* SSSE3 */ + Debug(1,"Detected a x86\\x86-64 processor with SSSE3"); + } else if (r_ecx & 0x00000001) { + sseversion = 30; /* SSE3 */ + Debug(1,"Detected a x86\\x86-64 processor with SSE3"); + } else if (r_edx & 0x04000000) { + sseversion = 20; /* SSE2 */ + Debug(1,"Detected a x86\\x86-64 processor with SSE2"); + } else if (r_edx & 0x02000000) { + sseversion = 10; /* SSE */ + Debug(1,"Detected a x86\\x86-64 processor with SSE"); + } else { + sseversion = 0; + Debug(1,"Detected a x86\\x86-64 processor"); + } + +#else + /* Non x86 or x86-64 processor, SSE2 is not available */ + Debug(1,"Detected a non x86\\x86-64 processor"); + sseversion = 0; +#endif +} + +/* SSE2 aligned memory copy. Useful for big copying of aligned memory like image buffers in ZM */ +/* For platforms without SSE2 we will use standard x86 asm memcpy or glibc's memcpy() */ +__attribute__((noinline,__target__("sse2"))) void* sse2_aligned_memcpy(void* dest, const void* src, size_t bytes) { +#if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE)) + if(bytes > 128) { + unsigned int remainder = bytes % 128; + const uint8_t* lastsrc = (uint8_t*)src + (bytes - remainder); + + __asm__ __volatile__( + "sse2_copy_iter:\n\t" + "movdqa (%0),%%xmm0\n\t" + "movdqa 0x10(%0),%%xmm1\n\t" + "movdqa 0x20(%0),%%xmm2\n\t" + "movdqa 0x30(%0),%%xmm3\n\t" + "movdqa 0x40(%0),%%xmm4\n\t" + "movdqa 0x50(%0),%%xmm5\n\t" + "movdqa 0x60(%0),%%xmm6\n\t" + "movdqa 0x70(%0),%%xmm7\n\t" + "movntdq %%xmm0,(%1)\n\t" + "movntdq %%xmm1,0x10(%1)\n\t" + "movntdq %%xmm2,0x20(%1)\n\t" + "movntdq %%xmm3,0x30(%1)\n\t" + "movntdq %%xmm4,0x40(%1)\n\t" + "movntdq %%xmm5,0x50(%1)\n\t" + "movntdq %%xmm6,0x60(%1)\n\t" + "movntdq %%xmm7,0x70(%1)\n\t" + "add $0x80, %0\n\t" + "add $0x80, %1\n\t" + "cmp %2, %0\n\t" + "jb sse2_copy_iter\n\t" + "test %3, %3\n\t" + "jz sse2_copy_finish\n\t" + "cld\n\t" + "rep movsb\n\t" + "sse2_copy_finish:\n\t" + : + : "S" (src), "D" (dest), "r" (lastsrc), "c" (remainder) + : "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "cc", "memory" + ); + + } else { + /* Standard memcpy */ + __asm__ __volatile__("cld; rep movsb" :: "S"(src), "D"(dest), "c"(bytes) : "cc", "memory"); + } +#else + /* Non x86\x86-64 platform, use memcpy */ + memcpy(dest,src,bytes); +#endif + return dest; +} + +void timespec_diff(struct timespec *start, struct timespec *end, struct timespec *diff) { + if (((end->tv_nsec)-(start->tv_nsec))<0) { + diff->tv_sec = end->tv_sec-start->tv_sec-1; + diff->tv_nsec = 1000000000+end->tv_nsec-start->tv_nsec; + } else { + diff->tv_sec = end->tv_sec-start->tv_sec; + diff->tv_nsec = end->tv_nsec-start->tv_nsec; + } +} + diff --git a/src/zm_utils.h b/src/zm_utils.h new file mode 100644 index 000000000..658c10180 --- /dev/null +++ b/src/zm_utils.h @@ -0,0 +1,54 @@ +// +// ZoneMinder General Utility Functions, $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. +// + +#ifndef ZM_UTILS_H +#define ZM_UTILS_H + +#include +#include +#include +#include + +typedef std::vector StringVector; + +const std::string stringtf( const char *format, ... ); +const std::string stringtf( const std::string &format, ... ); + +bool startsWith( const std::string &haystack, const std::string &needle ); +StringVector split( const std::string &string, const std::string chars, int limit=0 ); + +const std::string base64Encode( const std::string &inString ); + +inline int max( int a, int b ) +{ + return( a>=b?a:b ); +} + +inline int min( int a, int b ) +{ + return( a<=b?a:b ); +} + +void ssedetect(); +void* sse2_aligned_memcpy(void* dest, const void* src, size_t bytes); +void timespec_diff(struct timespec *start, struct timespec *end, struct timespec *diff); + +extern unsigned int sseversion; + +#endif // ZM_UTILS_H diff --git a/src/zm_zone.cpp b/src/zm_zone.cpp new file mode 100644 index 000000000..1319607fa --- /dev/null +++ b/src/zm_zone.cpp @@ -0,0 +1,1082 @@ +// +// ZoneMinder Zone Class Implementation, $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. +// + +#include "zm.h" +#include "zm_db.h" +#include "zm_zone.h" +#include "zm_image.h" +#include "zm_monitor.h" + +void Zone::Setup( Monitor *p_monitor, int p_id, const char *p_label, ZoneType p_type, const Polygon &p_polygon, const Rgb p_alarm_rgb, CheckMethod p_check_method, int p_min_pixel_threshold, int p_max_pixel_threshold, int p_min_alarm_pixels, int p_max_alarm_pixels, const Coord &p_filter_box, int p_min_filter_pixels, int p_max_filter_pixels, int p_min_blob_pixels, int p_max_blob_pixels, int p_min_blobs, int p_max_blobs, int p_overload_frames ) +{ + monitor = p_monitor; + + id = p_id; + label = new char[strlen(p_label)+1]; + strcpy( label, p_label ); + type = p_type; + polygon = p_polygon; + alarm_rgb = p_alarm_rgb; + check_method = p_check_method; + min_pixel_threshold = p_min_pixel_threshold; + max_pixel_threshold = p_max_pixel_threshold; + min_alarm_pixels = p_min_alarm_pixels; + max_alarm_pixels = p_max_alarm_pixels; + filter_box = p_filter_box; + min_filter_pixels = p_min_filter_pixels; + max_filter_pixels = p_max_filter_pixels; + min_blob_pixels = p_min_blob_pixels; + max_blob_pixels = p_max_blob_pixels; + min_blobs = p_min_blobs; + max_blobs = p_max_blobs; + overload_frames = p_overload_frames; + + Debug( 1, "Initialised zone %d/%s - %d - %dx%d - Rgb:%06x, CM:%d, MnAT:%d, MxAT:%d, MnAP:%d, MxAP:%d, FB:%dx%d, MnFP:%d, MxFP:%d, MnBS:%d, MxBS:%d, MnB:%d, MxB:%d, OF: %d", id, label, type, polygon.Width(), polygon.Height(), alarm_rgb, check_method, min_pixel_threshold, max_pixel_threshold, min_alarm_pixels, max_alarm_pixels, filter_box.X(), filter_box.Y(), min_filter_pixels, max_filter_pixels, min_blob_pixels, max_blob_pixels, min_blobs, max_blobs, overload_frames ); + + alarmed = false; + pixel_diff = 0; + alarm_pixels = 0; + alarm_filter_pixels = 0; + alarm_blob_pixels = 0; + alarm_blobs = 0; + min_blob_size = 0; + max_blob_size = 0; + image = 0; + score = 0; + + overload_count = 0; + + pg_image = new Image( monitor->Width(), monitor->Height(), 1, ZM_SUBPIX_ORDER_NONE); + pg_image->Clear(); + pg_image->Fill( 0xff, polygon ); + pg_image->Outline( 0xff, polygon ); + + ranges = new Range[monitor->Height()]; + for ( unsigned int y = 0; y < monitor->Height(); y++) + { + ranges[y].lo_x = -1; + ranges[y].hi_x = 0; + ranges[y].off_x = 0; + const uint8_t *ppoly = pg_image->Buffer( 0, y ); + for ( unsigned int x = 0; x < monitor->Width(); x++, ppoly++ ) + { + if ( *ppoly ) + { + if ( ranges[y].lo_x == -1 ) + { + ranges[y].lo_x = x; + } + if ( (unsigned int)ranges[y].hi_x < x ) + { + ranges[y].hi_x = x; + } + } + } + } + + if ( config.record_diag_images ) + { + static char diag_path[PATH_MAX] = ""; + if ( !diag_path[0] ) + { + snprintf( diag_path, sizeof(diag_path), "%s/%s/diag-%d-poly.jpg", config.dir_events, monitor->Name(), id); + } + pg_image->WriteJpeg( diag_path ); + } +} + +Zone::~Zone() +{ + delete[] label; + delete image; + delete pg_image; + delete[] ranges; +} + +void Zone::RecordStats( const Event *event ) +{ + static char sql[ZM_SQL_MED_BUFSIZ]; + snprintf( sql, sizeof(sql), "insert into Stats set MonitorId=%d, ZoneId=%d, EventId=%d, FrameId=%d, PixelDiff=%d, AlarmPixels=%d, FilterPixels=%d, BlobPixels=%d, Blobs=%d, MinBlobSize=%d, MaxBlobSize=%d, MinX=%d, MinY=%d, MaxX=%d, MaxY=%d, Score=%d", monitor->Id(), id, event->Id(), event->Frames()+1, pixel_diff, alarm_pixels, alarm_filter_pixels, alarm_blob_pixels, alarm_blobs, min_blob_size, max_blob_size, alarm_box.LoX(), alarm_box.LoY(), alarm_box.HiX(), alarm_box.HiY(), score ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't insert event stats: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } +} + + +//============================================================================= +bool Zone::CheckOverloadCount() +{ + Info("Overloaded count: %d, Overloaded frames: %d", overload_count, overload_frames); + if ( overload_count ) + { + Info( "In overload mode, %d frames of %d remaining", overload_count, overload_frames ); + Debug( 4, "In overload mode, %d frames of %d remaining", overload_count, overload_frames ); + overload_count--; + return( false ); + } + return true; +} + +void Zone::SetScore(unsigned int nScore) +{ + score = nScore; +} + + +void Zone::SetAlarmImage(const Image* srcImage) +{ + delete image; + image = new Image(*srcImage); +} + +int Zone::GetOverloadCount() +{ + return overload_count; +} + +void Zone::SetOverloadCount(int nOverCount) +{ + overload_count = nOverCount; +} + +int Zone::GetOverloadFrames() +{ + return overload_frames; +} +//=========================================================================== + + + +bool Zone::CheckAlarms( const Image *delta_image ) +{ + //bool alarm = false; // nextime + + ResetStats(); + + if ( overload_count ) + { + Info( "In overload mode, %d frames of %d remaining", overload_count, overload_frames ); + Debug( 4, "In overload mode, %d frames of %d remaining", overload_count, overload_frames ); + overload_count--; + return( false ); + } + + delete image; + // Get the difference image + Image *diff_image = image = new Image( *delta_image ); + int diff_width = diff_image->Width(); + uint8_t* diff_buff = (uint8_t*)diff_image->Buffer(); + uint8_t* pdiff; + const uint8_t* ppoly; + + unsigned int pixel_diff_count = 0; + + int alarm_lo_x = 0; + int alarm_hi_x = 0; + int alarm_lo_y = 0; + int alarm_hi_y = 0; + + int alarm_mid_x = -1; + int alarm_mid_y = -1; + + unsigned int lo_y = polygon.LoY(); + unsigned int lo_x = polygon.LoX(); + unsigned int hi_x = polygon.HiX(); + unsigned int hi_y = polygon.HiY(); + + Debug( 4, "Checking alarms for zone %d/%s in lines %d -> %d", id, label, lo_y, hi_y ); + + + Debug( 5, "Checking for alarmed pixels" ); + /* if(config.cpu_extensions && sseversion >= 20) { + sse2_alarmedpixels(diff_image, pg_image, &alarm_pixels, &pixel_diff_count); + } else { + std_alarmedpixels(diff_image, pg_image, &alarm_pixels, &pixel_diff_count); + } */ + std_alarmedpixels(diff_image, pg_image, &alarm_pixels, &pixel_diff_count); + + if ( config.record_diag_images ) + { + static char diag_path[PATH_MAX] = ""; + if ( !diag_path[0] ) + { + snprintf( diag_path, sizeof(diag_path), "%s/%s/diag-%d-%d.jpg", config.dir_events, monitor->Name(), id, 1 ); + } + diff_image->WriteJpeg( diag_path ); + } + + if ( pixel_diff_count && alarm_pixels ) + pixel_diff = pixel_diff_count/alarm_pixels; + Debug( 5, "Got %d alarmed pixels, need %d -> %d, avg pixel diff %d", alarm_pixels, min_alarm_pixels, max_alarm_pixels, pixel_diff ); + + if( alarm_pixels ) { + if( min_alarm_pixels && (alarm_pixels < (unsigned int)min_alarm_pixels) ) { + /* Not enough pixels alarmed */ + return (false); + } else if( max_alarm_pixels && (alarm_pixels > (unsigned int)max_alarm_pixels) ) { + /* Too many pixels alarmed */ + overload_count = overload_frames; + return (false); + } + } else { + /* No alarmed pixels */ + return (false); + } + + score = (100*alarm_pixels)/polygon.Area(); + if(score < 1) + score = 1; /* Fix for score of 0 when frame meets thresholds but alarmed area is not big enough */ + Debug( 5, "Current score is %d", score ); + + if ( check_method >= FILTERED_PIXELS ) + { + int bx = filter_box.X(); + int by = filter_box.Y(); + int bx1 = bx-1; + int by1 = by-1; + + Debug( 5, "Checking for filtered pixels" ); + if ( bx > 1 || by > 1 ) + { + // Now remove any pixels smaller than our filter size + unsigned char *cpdiff; + int ldx, hdx, ldy, hdy; + bool block; + for ( unsigned int y = lo_y; y <= hi_y; y++ ) + { + int lo_x = ranges[y].lo_x; + int hi_x = ranges[y].hi_x; + + pdiff = (uint8_t*)diff_image->Buffer( lo_x, y ); + + for ( int x = lo_x; x <= hi_x; x++, pdiff++ ) + { + if ( *pdiff == WHITE ) + { + // Check participation in an X block + ldx = (x>=(lo_x+bx1))?-bx1:lo_x-x; + hdx = (x<=(hi_x-bx1))?0:((hi_x-x)-bx1); + ldy = (y>=(lo_y+by1))?-by1:lo_y-y; + hdy = (y<=(hi_y-by1))?0:((hi_y-y)-by1); + block = false; + for ( int dy = ldy; !block && dy <= hdy; dy++ ) + { + for ( int dx = ldx; !block && dx <= hdx; dx++ ) + { + block = true; + for ( int dy2 = 0; block && dy2 < by; dy2++ ) + { + for ( int dx2 = 0; block && dx2 < bx; dx2++ ) + { + cpdiff = diff_buff + (((y+dy+dy2)*diff_width) + (x+dx+dx2)); + if ( !*cpdiff ) + { + block = false; + } + } + } + } + } + if ( !block ) + { + *pdiff = BLACK; + continue; + } + alarm_filter_pixels++; + } + } + } + } + else + { + alarm_filter_pixels = alarm_pixels; + } + + if ( config.record_diag_images ) + { + static char diag_path[PATH_MAX] = ""; + if ( !diag_path[0] ) + { + snprintf( diag_path, sizeof(diag_path), "%s/%d/diag-%d-%d.jpg", config.dir_events, monitor->Id(), id, 2 ); + } + diff_image->WriteJpeg( diag_path ); + } + + Debug( 5, "Got %d filtered pixels, need %d -> %d", alarm_filter_pixels, min_filter_pixels, max_filter_pixels ); + + if( alarm_filter_pixels ) { + if( min_filter_pixels && (alarm_filter_pixels < min_filter_pixels) ) { + /* Not enough pixels alarmed */ + return (false); + } else if( max_filter_pixels && (alarm_filter_pixels > max_filter_pixels) ) { + /* Too many pixels alarmed */ + overload_count = overload_frames; + return (false); + } + } else { + /* No filtered pixels */ + return (false); + } + + score = (100*alarm_filter_pixels)/(polygon.Area()); + if(score < 1) + score = 1; /* Fix for score of 0 when frame meets thresholds but alarmed area is not big enough */ + Debug( 5, "Current score is %d", score ); + + if ( check_method >= BLOBS ) + { + Debug( 5, "Checking for blob pixels" ); + typedef struct { unsigned char tag; int count; int lo_x; int hi_x; int lo_y; int hi_y; } BlobStats; + BlobStats blob_stats[256]; + memset( blob_stats, 0, sizeof(BlobStats)*256 ); + uint8_t *spdiff; + uint8_t last_x, last_y; + BlobStats *bsx, *bsy; + BlobStats *bsm, *bss; + for ( unsigned int y = lo_y; y <= hi_y; y++ ) + { + int lo_x = ranges[y].lo_x; + int hi_x = ranges[y].hi_x; + + pdiff = (uint8_t*)diff_image->Buffer( lo_x, y ); + for ( int x = lo_x; x <= hi_x; x++, pdiff++ ) + { + if ( *pdiff == WHITE ) + { + Debug( 9, "Got white pixel at %d,%d (%p)", x, y, pdiff ); + //last_x = (x>lo_x)?*(pdiff-1):0; + //last_y = (y>lo_y&&x>=last_lo_x&&x<=last_hi_x)?*(pdiff-diff_width):0; + + last_x = 0; + if(x > 0) { + if((x-1) >= lo_x) { + last_x = *(pdiff-1); + } + } + + last_y = 0; + if(y > 0) { + if((y-1) >= lo_y && ranges[(y-1)].lo_x <= x && ranges[(y-1)].hi_x >= x) { + last_y = *(pdiff-diff_width); + } + } + + if ( last_x ) + { + Debug( 9, "Left neighbour is %d", last_x ); + bsx = &blob_stats[last_x]; + if ( last_y ) + { + Debug( 9, "Top neighbour is %d", last_y ); + bsy = &blob_stats[last_y]; + if ( last_x == last_y ) + { + Debug( 9, "Matching neighbours, setting to %d", last_x ); + // Add to the blob from the x side (either side really) + *pdiff = last_x; + alarm_blob_pixels++; + bsx->count++; + if ( x > bsx->hi_x ) bsx->hi_x = x; + if ( (int)y > bsx->hi_y ) bsx->hi_y = y; + } + else + { + // Aggregate blobs + bsm = bsx->count>=bsy->count?bsx:bsy; + bss = bsm==bsx?bsy:bsx; + + Debug( 9, "Different neighbours, setting pixels of %d to %d", bss->tag, bsm->tag ); + Debug( 9, "Master blob t:%d, c:%d, lx:%d, hx:%d, ly:%d, hy:%d", bsm->tag, bsm->count, bsm->lo_x, bsm->hi_x, bsm->lo_y, bsm->hi_y ); + Debug( 9, "Slave blob t:%d, c:%d, lx:%d, hx:%d, ly:%d, hy:%d", bss->tag, bss->count, bss->lo_x, bss->hi_x, bss->lo_y, bss->hi_y ); + // Now change all those pixels to the other setting + int changed = 0; + for ( int sy = bss->lo_y; sy <= bss->hi_y; sy++) + { + int lo_sx = bss->lo_x>=ranges[sy].lo_x?bss->lo_x:ranges[sy].lo_x; + int hi_sx = bss->hi_x<=ranges[sy].hi_x?bss->hi_x:ranges[sy].hi_x; + + Debug( 9, "Changing %d, %d->%d", sy, lo_sx, hi_sx ); + Debug( 9, "Range %d, %d->%d", sy, ranges[sy].lo_x, ranges[sy].hi_x ); + spdiff = diff_buff + ((diff_width * sy) + lo_sx); + for ( int sx = lo_sx; sx <= hi_sx; sx++, spdiff++ ) + { + Debug( 9, "Pixel at %d,%d (%p) is %d", sx, sy, spdiff, *spdiff ); + if ( *spdiff == bss->tag ) + { + Debug( 9, "Setting pixel" ); + *spdiff = bsm->tag; + changed++; + } + } + } + *pdiff = bsm->tag; + alarm_blob_pixels++; + if ( !changed ) + { + Info( "Master blob t:%d, c:%d, lx:%d, hx:%d, ly:%d, hy:%d", bsm->tag, bsm->count, bsm->lo_x, bsm->hi_x, bsm->lo_y, bsm->hi_y ); + Info( "Slave blob t:%d, c:%d, lx:%d, hx:%d, ly:%d, hy:%d", bss->tag, bss->count, bss->lo_x, bss->hi_x, bss->lo_y, bss->hi_y ); + Error( "No pixels changed, exiting" ); + exit( -1 ); + } + + // Merge the slave blob into the master + bsm->count += bss->count+1; + if ( x > bsm->hi_x ) bsm->hi_x = x; + if ( (int)y > bsm->hi_y ) bsm->hi_y = y; + if ( bss->lo_x < bsm->lo_x ) bsm->lo_x = bss->lo_x; + if ( bss->lo_y < bsm->lo_y ) bsm->lo_y = bss->lo_y; + if ( bss->hi_x > bsm->hi_x ) bsm->hi_x = bss->hi_x; + if ( bss->hi_y > bsm->hi_y ) bsm->hi_y = bss->hi_y; + + alarm_blobs--; + + Debug( 6, "Merging blob %d with %d at %d,%d, %d current blobs", bss->tag, bsm->tag, x, y, alarm_blobs ); + + // Clear out the old blob + bss->tag = 0; + bss->count = 0; + bss->lo_x = 0; + bss->lo_y = 0; + bss->hi_x = 0; + bss->hi_y = 0; + } + } + else + { + Debug( 9, "Setting to left neighbour %d", last_x ); + // Add to the blob from the x side + *pdiff = last_x; + alarm_blob_pixels++; + bsx->count++; + if ( x > bsx->hi_x ) bsx->hi_x = x; + if ( (int)y > bsx->hi_y ) bsx->hi_y = y; + } + } + else + { + if ( last_y ) + { + Debug( 9, "Top neighbour is %d", last_y ); + Debug( 9, "Setting to top neighbour %d", last_y ); + + // Add to the blob from the y side + BlobStats *bsy = &blob_stats[last_y]; + + *pdiff = last_y; + alarm_blob_pixels++; + bsy->count++; + if ( x > bsy->hi_x ) bsy->hi_x = x; + if ( (int)y > bsy->hi_y ) bsy->hi_y = y; + } + else + { + // Create a new blob + int i; + for ( i = (WHITE-1); i > 0; i-- ) + { + BlobStats *bs = &blob_stats[i]; + // See if we can recycle one first, only if it's at least two rows up + if ( bs->count && bs->hi_y < (int)(y-1) ) + { + if ( (min_blob_pixels && bs->count < min_blob_pixels) || (max_blob_pixels && bs->count > max_blob_pixels) ) + { + if ( config.create_analysis_images || config.record_diag_images ) + { + for ( int sy = bs->lo_y; sy <= bs->hi_y; sy++ ) + { + spdiff = diff_buff + ((diff_width * sy) + bs->lo_x); + for ( int sx = bs->lo_x; sx <= bs->hi_x; sx++, spdiff++ ) + { + if ( *spdiff == bs->tag ) + { + *spdiff = BLACK; + } + } + } + } + alarm_blobs--; + alarm_blob_pixels -= bs->count; + + Debug( 6, "Eliminated blob %d, %d pixels (%d,%d - %d,%d), %d current blobs", i, bs->count, bs->lo_x, bs->lo_y, bs->hi_x, bs->hi_y, alarm_blobs ); + + bs->tag = 0; + bs->count = 0; + bs->lo_x = 0; + bs->lo_y = 0; + bs->hi_x = 0; + bs->hi_y = 0; + } + } + if ( !bs->count ) + { + Debug( 9, "Creating new blob %d", i ); + *pdiff = i; + alarm_blob_pixels++; + bs->tag = i; + bs->count++; + bs->lo_x = bs->hi_x = x; + bs->lo_y = bs->hi_y = y; + alarm_blobs++; + + Debug( 6, "Created blob %d at %d,%d, %d current blobs", bs->tag, x, y, alarm_blobs ); + break; + } + } + if ( i == 0 ) + { + Warning( "Max blob count reached. Unable to allocate new blobs so terminating. Zone settings may be too sensitive." ); + x = hi_x+1; + y = hi_y+1; + } + } + } + } + } + } + if ( config.record_diag_images ) + { + static char diag_path[PATH_MAX] = ""; + if ( !diag_path[0] ) + { + snprintf( diag_path, sizeof(diag_path), "%s/%d/diag-%d-%d.jpg", config.dir_events, monitor->Id(), id, 3 ); + } + diff_image->WriteJpeg( diag_path ); + } + + if ( !alarm_blobs ) + { + return( false ); + } + + Debug( 5, "Got %d raw blob pixels, %d raw blobs, need %d -> %d, %d -> %d", alarm_blob_pixels, alarm_blobs, min_blob_pixels, max_blob_pixels, min_blobs, max_blobs ); + + // Now eliminate blobs under the threshold + for ( int i = 1; i < WHITE; i++ ) + { + BlobStats *bs = &blob_stats[i]; + if ( bs->count ) + { + if ( (min_blob_pixels && bs->count < min_blob_pixels) || (max_blob_pixels && bs->count > max_blob_pixels) ) + { + if ( config.create_analysis_images || config.record_diag_images ) + { + for ( int sy = bs->lo_y; sy <= bs->hi_y; sy++ ) + { + spdiff = diff_buff + ((diff_width * sy) + bs->lo_x); + for ( int sx = bs->lo_x; sx <= bs->hi_x; sx++, spdiff++ ) + { + if ( *spdiff == bs->tag ) + { + *spdiff = BLACK; + } + } + } + } + alarm_blobs--; + alarm_blob_pixels -= bs->count; + + Debug( 6, "Eliminated blob %d, %d pixels (%d,%d - %d,%d), %d current blobs", i, bs->count, bs->lo_x, bs->lo_y, bs->hi_x, bs->hi_y, alarm_blobs ); + + bs->tag = 0; + bs->count = 0; + bs->lo_x = 0; + bs->lo_y = 0; + bs->hi_x = 0; + bs->hi_y = 0; + } + else + { + Debug( 6, "Preserved blob %d, %d pixels (%d,%d - %d,%d), %d current blobs", i, bs->count, bs->lo_x, bs->lo_y, bs->hi_x, bs->hi_y, alarm_blobs ); + if ( !min_blob_size || bs->count < min_blob_size ) min_blob_size = bs->count; + if ( !max_blob_size || bs->count > max_blob_size ) max_blob_size = bs->count; + } + } + } + if ( config.record_diag_images ) + { + static char diag_path[PATH_MAX] = ""; + if ( !diag_path[0] ) + { + snprintf( diag_path, sizeof(diag_path), "%s/%d/diag-%d-%d.jpg", config.dir_events, monitor->Id(), id, 4 ); + } + diff_image->WriteJpeg( diag_path ); + } + Debug( 5, "Got %d blob pixels, %d blobs, need %d -> %d, %d -> %d", alarm_blob_pixels, alarm_blobs, min_blob_pixels, max_blob_pixels, min_blobs, max_blobs ); + + if( alarm_blobs ) { + if( min_blobs && (alarm_blobs < min_blobs) ) { + /* Not enough pixels alarmed */ + return (false); + } else if(max_blobs && (alarm_blobs > max_blobs) ) { + /* Too many pixels alarmed */ + overload_count = overload_frames; + return (false); + } + } else { + /* No blobs */ + return (false); + } + + score = (100*alarm_blob_pixels)/(polygon.Area()); + if(score < 1) + score = 1; /* Fix for score of 0 when frame meets thresholds but alarmed area is not big enough */ + Debug( 5, "Current score is %d", score ); + + alarm_lo_x = polygon.HiX()+1; + alarm_hi_x = polygon.LoX()-1; + alarm_lo_y = polygon.HiY()+1; + alarm_hi_y = polygon.LoY()-1; + for ( int i = 1; i < WHITE; i++ ) + { + BlobStats *bs = &blob_stats[i]; + if ( bs->count ) + { + if ( bs->count == max_blob_size ) + { + if ( config.weighted_alarm_centres ) + { + unsigned long x_total = 0; + unsigned long y_total = 0; + + for ( int sy = bs->lo_y; sy <= bs->hi_y; sy++ ) + { + spdiff = diff_buff + ((diff_width * sy) + bs->lo_x); + for ( int sx = bs->lo_x; sx <= bs->hi_x; sx++, spdiff++ ) + { + if ( *spdiff == bs->tag ) + { + x_total += sx; + y_total += sy; + } + } + } + alarm_mid_x = int(round(x_total/bs->count)); + alarm_mid_y = int(round(y_total/bs->count)); + } + else + { + alarm_mid_x = int((bs->hi_x+bs->lo_x+1)/2); + alarm_mid_y = int((bs->hi_y+bs->lo_y+1)/2); + } + } + + if ( alarm_lo_x > bs->lo_x ) alarm_lo_x = bs->lo_x; + if ( alarm_lo_y > bs->lo_y ) alarm_lo_y = bs->lo_y; + if ( alarm_hi_x < bs->hi_x ) alarm_hi_x = bs->hi_x; + if ( alarm_hi_y < bs->hi_y ) alarm_hi_y = bs->hi_y; + } + } + } + else + { + alarm_mid_x = int((alarm_hi_x+alarm_lo_x+1)/2); + alarm_mid_y = int((alarm_hi_y+alarm_lo_y+1)/2); + } + } + + if ( type == INCLUSIVE ) + { + // score >>= 1; + score /= 2; + } + else if ( type == EXCLUSIVE ) + { + // score <<= 1; + score *= 2; + + } + + Debug( 5, "Adjusted score is %d", score ); + + // Now outline the changed region + if ( score ) + { + //alarm = true; + + alarm_box = Box( Coord( alarm_lo_x, alarm_lo_y ), Coord( alarm_hi_x, alarm_hi_y ) ); + + //if ( monitor->followMotion() ) + if ( true ) + { + alarm_centre = Coord( alarm_mid_x, alarm_mid_y ); + } + else + { + alarm_centre = alarm_box.Centre(); + } + + if ( (type < PRECLUSIVE) && check_method >= BLOBS && config.create_analysis_images ) + { + + // First mask out anything we don't want + for ( unsigned int y = lo_y; y <= hi_y; y++ ) + { + pdiff = diff_buff + ((diff_width * y) + lo_x); + + int lo_x2 = ranges[y].lo_x; + int hi_x2 = ranges[y].hi_x; + + int lo_gap = lo_x2-lo_x; + if ( lo_gap > 0 ) + { + if ( lo_gap == 1 ) + { + *pdiff++ = BLACK; + } + else + { + memset( pdiff, BLACK, lo_gap ); + pdiff += lo_gap; + } + } + + ppoly = pg_image->Buffer( lo_x2, y ); + for ( int x = lo_x2; x <= hi_x2; x++, pdiff++, ppoly++ ) + { + if ( !*ppoly ) + { + *pdiff = BLACK; + } + } + + int hi_gap = hi_x-hi_x2; + if ( hi_gap > 0 ) + { + if ( hi_gap == 1 ) + { + *pdiff = BLACK; + } + else + { + memset( pdiff, BLACK, hi_gap ); + } + } + } + + if( monitor->Colours() == ZM_COLOUR_GRAY8 ) { + image = diff_image->HighlightEdges( alarm_rgb, ZM_COLOUR_RGB24, ZM_SUBPIX_ORDER_RGB, &polygon.Extent() ); + } else { + image = diff_image->HighlightEdges( alarm_rgb, monitor->Colours(), monitor->SubpixelOrder(), &polygon.Extent() ); + } + + // Only need to delete this when 'image' becomes detached and points somewhere else + delete diff_image; + } + else + { + delete image; + image = 0; + } + + Debug( 1, "%s: Pixel Diff: %d, Alarm Pixels: %d, Filter Pixels: %d, Blob Pixels: %d, Blobs: %d, Score: %d", Label(), pixel_diff, alarm_pixels, alarm_filter_pixels, alarm_blob_pixels, alarm_blobs, score ); + } + return( true ); +} + +bool Zone::ParsePolygonString( const char *poly_string, Polygon &polygon ) +{ + Debug( 3, "Parsing polygon string '%s'", poly_string ); + + char *str_ptr = new char[strlen(poly_string)+1]; + char *str = str_ptr; + strcpy( str, poly_string ); + + char *ws; + int n_coords = 0; + int max_n_coords = strlen(str)/4; + Coord *coords = new Coord[max_n_coords]; + while( true ) + { + if ( *str == '\0' ) + { + break; + } + ws = strchr( str, ' ' ); + if ( ws ) + { + *ws = '\0'; + } + char *cp = strchr( str, ',' ); + if ( !cp ) + { + Error( "Bogus coordinate %s found in polygon string", str ); + delete[] coords; + delete[] str_ptr; + return( false ); + } + else + { + *cp = '\0'; + char *xp = str; + char *yp = cp+1; + + int x = atoi(xp); + int y = atoi(yp); + + Debug( 3, "Got coordinate %d,%d from polygon string", x, y ); +#if 0 + if ( x < 0 ) + x = 0; + else if ( x >= width ) + x = width-1; + if ( y < 0 ) + y = 0; + else if ( y >= height ) + y = height-1; +#endif + coords[n_coords++] = Coord( x, y ); + } + if ( ws ) + str = ws+1; + else + break; + } + polygon = Polygon( n_coords, coords ); + + Debug( 3, "Successfully parsed polygon string" ); + //printf( "Area: %d\n", pg.Area() ); + //printf( "Centre: %d,%d\n", pg.Centre().X(), pg.Centre().Y() ); + + delete[] coords; + delete[] str_ptr; + + return( true ); +} + +bool Zone::ParseZoneString( const char *zone_string, int &zone_id, int &colour, Polygon &polygon ) +{ + Debug( 3, "Parsing zone string '%s'", zone_string ); + + char *str_ptr = new char[strlen(zone_string)+1]; + char *str = str_ptr; + strcpy( str, zone_string ); + + char *ws = strchr( str, ' ' ); + if ( !ws ) + { + Debug( 3, "No initial whitespace found in zone string '%s', finishing", str ); + } + zone_id = strtol( str, 0, 10 ); + Debug( 3, "Got zone %d from zone string", zone_id ); + if ( !ws ) + { + delete str_ptr; + return( true ); + } + + *ws = '\0'; + str = ws+1; + + ws = strchr( str, ' ' ); + if ( !ws ) + { + Debug( 3, "No secondary whitespace found in zone string '%s', finishing", zone_string ); + } + colour = strtol( str, 0, 16 ); + Debug( 3, "Got colour %06x from zone string", colour ); + if ( !ws ) + { + delete str_ptr; + return( true ); + } + *ws = '\0'; + str = ws+1; + + bool result = ParsePolygonString( str, polygon ); + + //printf( "Area: %d\n", pg.Area() ); + //printf( "Centre: %d,%d\n", pg.Centre().X(), pg.Centre().Y() ); + + delete[] str_ptr; + + return( result ); +} + +int Zone::Load( Monitor *monitor, Zone **&zones ) +{ + static char sql[ZM_SQL_MED_BUFSIZ]; + snprintf( sql, sizeof(sql), "select Id,Name,Type+0,Units,NumCoords,Coords,AlarmRGB,CheckMethod+0,MinPixelThreshold,MaxPixelThreshold,MinAlarmPixels,MaxAlarmPixels,FilterX,FilterY,MinFilterPixels,MaxFilterPixels,MinBlobPixels,MaxBlobPixels,MinBlobs,MaxBlobs,OverloadFrames from Zones where MonitorId = %d order by Type, Id", monitor->Id() ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_zones = mysql_num_rows( result ); + Debug( 1, "Got %d zones for monitor %s", n_zones, monitor->Name() ); + delete[] zones; + zones = new Zone *[n_zones]; + for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) + { + int col = 0; + + int Id = atoi(dbrow[col++]); + const char *Name = dbrow[col++]; + int Type = atoi(dbrow[col++]); + const char *Units = dbrow[col++]; + /* int NumCoords = */ atoi(dbrow[col++]); + const char *Coords = dbrow[col++]; + int AlarmRGB = dbrow[col]?atoi(dbrow[col]):0; col++; + int CheckMethod = atoi(dbrow[col++]); + int MinPixelThreshold = dbrow[col]?atoi(dbrow[col]):0; col++; + int MaxPixelThreshold = dbrow[col]?atoi(dbrow[col]):0; col++; + int MinAlarmPixels = dbrow[col]?atoi(dbrow[col]):0; col++; + int MaxAlarmPixels = dbrow[col]?atoi(dbrow[col]):0; col++; + int FilterX = dbrow[col]?atoi(dbrow[col]):0; col++; + int FilterY = dbrow[col]?atoi(dbrow[col]):0; col++; + int MinFilterPixels = dbrow[col]?atoi(dbrow[col]):0; col++; + int MaxFilterPixels = dbrow[col]?atoi(dbrow[col]):0; col++; + int MinBlobPixels = dbrow[col]?atoi(dbrow[col]):0; col++; + int MaxBlobPixels = dbrow[col]?atoi(dbrow[col]):0; col++; + int MinBlobs = dbrow[col]?atoi(dbrow[col]):0; col++; + int MaxBlobs = dbrow[col]?atoi(dbrow[col]):0; col++; + int OverloadFrames = dbrow[col]?atoi(dbrow[col]):0; col++; + + /* HTML colour code is actually BGR in memory, we want RGB */ + AlarmRGB = rgb_convert(AlarmRGB, ZM_SUBPIX_ORDER_BGR); + + Debug( 5, "Parsing polygon %s", Coords ); + Polygon polygon; + if ( !ParsePolygonString( Coords, polygon ) ) + Panic( "Unable to parse polygon string '%s' for zone %d/%s for monitor %s", Coords, Id, Name, monitor->Name() ); + + if ( polygon.LoX() < 0 || polygon.HiX() >= (int)monitor->Width() + || polygon.LoY() < 0 || polygon.HiY() >= (int)monitor->Height() ) + Panic( "Zone %d/%s for monitor %s extends outside of image dimensions, %d, %d, %d, %d", Id, Name, monitor->Name(), polygon.LoX(), polygon.LoY(), polygon.HiX(), polygon.HiY() ); + + if ( false && !strcmp( Units, "Percent" ) ) + { + MinAlarmPixels = (MinAlarmPixels*polygon.Area())/100; + MaxAlarmPixels = (MaxAlarmPixels*polygon.Area())/100; + MinFilterPixels = (MinFilterPixels*polygon.Area())/100; + MaxFilterPixels = (MaxFilterPixels*polygon.Area())/100; + MinBlobPixels = (MinBlobPixels*polygon.Area())/100; + MaxBlobPixels = (MaxBlobPixels*polygon.Area())/100; + } + + if ( atoi(dbrow[2]) == Zone::INACTIVE ) + { + zones[i] = new Zone( monitor, Id, Name, polygon ); + } + else + { + zones[i] = new Zone( monitor, Id, Name, (Zone::ZoneType)Type, polygon, AlarmRGB, (Zone::CheckMethod)CheckMethod, MinPixelThreshold, MaxPixelThreshold, MinAlarmPixels, MaxAlarmPixels, Coord( FilterX, FilterY ), MinFilterPixels, MaxFilterPixels, MinBlobPixels, MaxBlobPixels, MinBlobs, MaxBlobs, OverloadFrames ); + } + } + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + // Yadda yadda + mysql_free_result( result ); + return( n_zones ); +} + +bool Zone::DumpSettings( char *output, bool /*verbose*/ ) +{ + output[0] = 0; + + sprintf( output+strlen(output), " Id : %d\n", id ); + sprintf( output+strlen(output), " Label : %s\n", label ); + sprintf( output+strlen(output), " Type: %d - %s\n", type, + type==ACTIVE?"Active":( + type==INCLUSIVE?"Inclusive":( + type==EXCLUSIVE?"Exclusive":( + type==PRECLUSIVE?"Preclusive":( + type==INACTIVE?"Inactive":"Unknown" + ))))); + sprintf( output+strlen(output), " Shape : %d points\n", polygon.getNumCoords() ); + for ( int i = 0; i < polygon.getNumCoords(); i++ ) + { + sprintf( output+strlen(output), " %i: %d,%d\n", i, polygon.getCoord( i ).X(), polygon.getCoord( i ).Y() ); + } + sprintf( output+strlen(output), " Alarm RGB : %06x\n", alarm_rgb ); + sprintf( output+strlen(output), " Check Method: %d - %s\n", check_method, + check_method==ALARMED_PIXELS?"Alarmed Pixels":( + check_method==FILTERED_PIXELS?"FilteredPixels":( + check_method==BLOBS?"Blobs":"Unknown" + ))); + sprintf( output+strlen(output), " Min Pixel Threshold : %d\n", min_pixel_threshold ); + sprintf( output+strlen(output), " Max Pixel Threshold : %d\n", max_pixel_threshold ); + sprintf( output+strlen(output), " Min Alarm Pixels : %d\n", min_alarm_pixels ); + sprintf( output+strlen(output), " Max Alarm Pixels : %d\n", max_alarm_pixels ); + sprintf( output+strlen(output), " Filter Box : %d,%d\n", filter_box.X(), filter_box.Y() ); + sprintf( output+strlen(output), " Min Filter Pixels : %d\n", min_filter_pixels ); + sprintf( output+strlen(output), " Max Filter Pixels : %d\n", max_filter_pixels ); + sprintf( output+strlen(output), " Min Blob Pixels : %d\n", min_blob_pixels ); + sprintf( output+strlen(output), " Max Blob Pixels : %d\n", max_blob_pixels ); + sprintf( output+strlen(output), " Min Blobs : %d\n", min_blobs ); + sprintf( output+strlen(output), " Max Blobs : %d\n", max_blobs ); + return( true ); +} + +void Zone::std_alarmedpixels(Image* pdiff_image, const Image* ppoly_image, unsigned int* pixel_count, unsigned int* pixel_sum) { + uint32_t pixelsalarmed = 0; + uint32_t pixelsdifference = 0; + uint8_t *pdiff; + const uint8_t *ppoly; + uint8_t calc_max_pixel_threshold = 255; + unsigned int lo_y; + unsigned int hi_y; + unsigned int lo_x; + unsigned int hi_x; + + if(max_pixel_threshold) + calc_max_pixel_threshold = max_pixel_threshold; + + lo_y = polygon.LoY(); + hi_y = polygon.HiY(); + for ( unsigned int y = lo_y; y <= hi_y; y++ ) + { + lo_x = ranges[y].lo_x; + hi_x = ranges[y].hi_x; + + Debug( 7, "Checking line %d from %d -> %d", y, lo_x, hi_x ); + pdiff = (uint8_t*)pdiff_image->Buffer( lo_x, y ); + ppoly = ppoly_image->Buffer( lo_x, y ); + + for ( unsigned int x = lo_x; x <= hi_x; x++, pdiff++, ppoly++ ) + { + if ( *ppoly && (*pdiff > min_pixel_threshold) && (*pdiff <= calc_max_pixel_threshold) ) + { + pixelsalarmed++; + pixelsdifference += *pdiff; + *pdiff = WHITE; + } + else + { + *pdiff = BLACK; + } + } + } + + /* Store the results */ + *pixel_count = pixelsalarmed; + *pixel_sum = pixelsdifference; + Debug( 7, "STORED"); +} diff --git a/src/zm_zone.cpp.orig b/src/zm_zone.cpp.orig new file mode 100644 index 000000000..0acf7a045 --- /dev/null +++ b/src/zm_zone.cpp.orig @@ -0,0 +1,1035 @@ +// +// ZoneMinder Zone Class Implementation, $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. +// + +#include "zm.h" +#include "zm_db.h" +#include "zm_zone.h" +#include "zm_image.h" +#include "zm_monitor.h" + +void Zone::Setup( Monitor *p_monitor, int p_id, const char *p_label, ZoneType p_type, const Polygon &p_polygon, const Rgb p_alarm_rgb, CheckMethod p_check_method, int p_min_pixel_threshold, int p_max_pixel_threshold, int p_min_alarm_pixels, int p_max_alarm_pixels, const Coord &p_filter_box, int p_min_filter_pixels, int p_max_filter_pixels, int p_min_blob_pixels, int p_max_blob_pixels, int p_min_blobs, int p_max_blobs, int p_overload_frames ) +{ + monitor = p_monitor; + + id = p_id; + label = new char[strlen(p_label)+1]; + strcpy( label, p_label ); + type = p_type; + polygon = p_polygon; + alarm_rgb = p_alarm_rgb; + check_method = p_check_method; + min_pixel_threshold = p_min_pixel_threshold; + max_pixel_threshold = p_max_pixel_threshold; + min_alarm_pixels = p_min_alarm_pixels; + max_alarm_pixels = p_max_alarm_pixels; + filter_box = p_filter_box; + min_filter_pixels = p_min_filter_pixels; + max_filter_pixels = p_max_filter_pixels; + min_blob_pixels = p_min_blob_pixels; + max_blob_pixels = p_max_blob_pixels; + min_blobs = p_min_blobs; + max_blobs = p_max_blobs; + overload_frames = p_overload_frames; + + Debug( 1, "Initialised zone %d/%s - %d - %dx%d - Rgb:%06x, CM:%d, MnAT:%d, MxAT:%d, MnAP:%d, MxAP:%d, FB:%dx%d, MnFP:%d, MxFP:%d, MnBS:%d, MxBS:%d, MnB:%d, MxB:%d, OF: %d", id, label, type, polygon.Width(), polygon.Height(), alarm_rgb, check_method, min_pixel_threshold, max_pixel_threshold, min_alarm_pixels, max_alarm_pixels, filter_box.X(), filter_box.Y(), min_filter_pixels, max_filter_pixels, min_blob_pixels, max_blob_pixels, min_blobs, max_blobs, overload_frames ); + + alarmed = false; + pixel_diff = 0; + alarm_pixels = 0; + alarm_filter_pixels = 0; + alarm_blob_pixels = 0; + alarm_blobs = 0; + min_blob_size = 0; + max_blob_size = 0; + image = 0; + score = 0; + + overload_count = 0; + + pg_image = new Image( monitor->Width(), monitor->Height(), 1, ZM_SUBPIX_ORDER_NONE); + pg_image->Clear(); + pg_image->Fill( 0xff, polygon ); + pg_image->Outline( 0xff, polygon ); + + ranges = new Range[monitor->Height()]; + for ( int y = 0; y < monitor->Height(); y++) + { + ranges[y].lo_x = -1; + ranges[y].hi_x = -1; + ranges[y].off_x = 0; + const uint8_t *ppoly = pg_image->Buffer( 0, y ); + for ( int x = 0; x < monitor->Width(); x++, ppoly++ ) + { + if ( *ppoly ) + { + if ( ranges[y].lo_x == -1 ) + { + ranges[y].lo_x = x; + } + if ( ranges[y].hi_x < x ) + { + ranges[y].hi_x = x; + } + } + } + } + + if ( config.record_diag_images ) + { + static char diag_path[PATH_MAX] = ""; + if ( !diag_path[0] ) + { + snprintf( diag_path, sizeof(diag_path), "%s/%s/diag-%d-poly.jpg", config.dir_events, monitor->Name(), id); + } + pg_image->WriteJpeg( diag_path ); + } +} + +Zone::~Zone() +{ + delete[] label; + delete image; + delete pg_image; + delete[] ranges; +} + +void Zone::RecordStats( const Event *event ) +{ + static char sql[ZM_SQL_MED_BUFSIZ]; + snprintf( sql, sizeof(sql), "insert into Stats set MonitorId=%d, ZoneId=%d, EventId=%d, FrameId=%d, PixelDiff=%d, AlarmPixels=%d, FilterPixels=%d, BlobPixels=%d, Blobs=%d, MinBlobSize=%d, MaxBlobSize=%d, MinX=%d, MinY=%d, MaxX=%d, MaxY=%d, Score=%d", monitor->Id(), id, event->Id(), event->Frames()+1, pixel_diff, alarm_pixels, alarm_filter_pixels, alarm_blob_pixels, alarm_blobs, min_blob_size, max_blob_size, alarm_box.LoX(), alarm_box.LoY(), alarm_box.HiX(), alarm_box.HiY(), score ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't insert event stats: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } +} + +bool Zone::CheckAlarms( const Image *delta_image ) +{ + bool alarm = false; + + ResetStats(); + + if ( overload_count ) + { + Info( "In overload mode, %d frames of %d remaining", overload_count, overload_frames ); + Debug( 4, "In overload mode, %d frames of %d remaining", overload_count, overload_frames ); + overload_count--; + return( false ); + } + + delete image; + // Get the difference image + Image *diff_image = image = new Image( *delta_image ); + int diff_width = diff_image->Width(); + uint8_t* diff_buff = (uint8_t*)diff_image->Buffer(); + uint8_t* pdiff; + const uint8_t* ppoly; + + unsigned int pixel_diff_count = 0; + + int alarm_lo_x = 0; + int alarm_hi_x = 0; + int alarm_lo_y = 0; + int alarm_hi_y = 0; + + int alarm_mid_x = -1; + int alarm_mid_y = -1; + + unsigned int lo_y = polygon.LoY(); + unsigned int lo_x = polygon.LoX(); + unsigned int hi_x = polygon.HiX(); + unsigned int hi_y = polygon.HiY(); + + Debug( 4, "Checking alarms for zone %d/%s in lines %d -> %d", id, label, lo_y, hi_y ); + + + Debug( 5, "Checking for alarmed pixels" ); + /* if(config.cpu_extensions && sseversion >= 20) { + sse2_alarmedpixels(diff_image, pg_image, &alarm_pixels, &pixel_diff_count); + } else { + std_alarmedpixels(diff_image, pg_image, &alarm_pixels, &pixel_diff_count); + } */ + std_alarmedpixels(diff_image, pg_image, &alarm_pixels, &pixel_diff_count); + + if ( config.record_diag_images ) + { + static char diag_path[PATH_MAX] = ""; + if ( !diag_path[0] ) + { + snprintf( diag_path, sizeof(diag_path), "%s/%s/diag-%d-%d.jpg", config.dir_events, monitor->Name(), id, 1 ); + } + diff_image->WriteJpeg( diag_path ); + } + + if ( pixel_diff_count && alarm_pixels ) + pixel_diff = pixel_diff_count/alarm_pixels; + Debug( 5, "Got %d alarmed pixels, need %d -> %d, avg pixel diff %d", alarm_pixels, min_alarm_pixels, max_alarm_pixels, pixel_diff ); + + if( alarm_pixels ) { + if( min_alarm_pixels && (alarm_pixels < min_alarm_pixels) ) { + /* Not enough pixels alarmed */ + return (false); + } else if( max_alarm_pixels && (alarm_pixels > max_alarm_pixels) ) { + /* Too many pixels alarmed */ + overload_count = overload_frames; + return (false); + } + } else { + /* No alarmed pixels */ + return (false); + } + + score = (100*alarm_pixels)/polygon.Area(); + if(score < 1) + score = 1; /* Fix for score of 0 when frame meets thresholds but alarmed area is not big enough */ + Debug( 5, "Current score is %d", score ); + + if ( check_method >= FILTERED_PIXELS ) + { + int bx = filter_box.X(); + int by = filter_box.Y(); + int bx1 = bx-1; + int by1 = by-1; + + Debug( 5, "Checking for filtered pixels" ); + if ( bx > 1 || by > 1 ) + { + // Now remove any pixels smaller than our filter size + unsigned char *cpdiff; + int ldx, hdx, ldy, hdy; + bool block; + for ( int y = lo_y; y <= hi_y; y++ ) + { + int lo_x = ranges[y].lo_x; + int hi_x = ranges[y].hi_x; + + pdiff = (uint8_t*)diff_image->Buffer( lo_x, y ); + + for ( int x = lo_x; x <= hi_x; x++, pdiff++ ) + { + if ( *pdiff == WHITE ) + { + // Check participation in an X block + ldx = (x>=(lo_x+bx1))?-bx1:lo_x-x; + hdx = (x<=(hi_x-bx1))?0:((hi_x-x)-bx1); + ldy = (y>=(lo_y+by1))?-by1:lo_y-y; + hdy = (y<=(hi_y-by1))?0:((hi_y-y)-by1); + block = false; + for ( int dy = ldy; !block && dy <= hdy; dy++ ) + { + for ( int dx = ldx; !block && dx <= hdx; dx++ ) + { + block = true; + for ( int dy2 = 0; block && dy2 < by; dy2++ ) + { + for ( int dx2 = 0; block && dx2 < bx; dx2++ ) + { + cpdiff = diff_buff + (((y+dy+dy2)*diff_width) + (x+dx+dx2)); + if ( !*cpdiff ) + { + block = false; + } + } + } + } + } + if ( !block ) + { + *pdiff = BLACK; + continue; + } + alarm_filter_pixels++; + } + } + } + } + else + { + alarm_filter_pixels = alarm_pixels; + } + + if ( config.record_diag_images ) + { + static char diag_path[PATH_MAX] = ""; + if ( !diag_path[0] ) + { + snprintf( diag_path, sizeof(diag_path), "%s/%d/diag-%d-%d.jpg", config.dir_events, monitor->Id(), id, 2 ); + } + diff_image->WriteJpeg( diag_path ); + } + + Debug( 5, "Got %d filtered pixels, need %d -> %d", alarm_filter_pixels, min_filter_pixels, max_filter_pixels ); + + if( alarm_filter_pixels ) { + if( min_filter_pixels && (alarm_filter_pixels < min_filter_pixels) ) { + /* Not enough pixels alarmed */ + return (false); + } else if( max_filter_pixels && (alarm_filter_pixels > max_filter_pixels) ) { + /* Too many pixels alarmed */ + overload_count = overload_frames; + return (false); + } + } else { + /* No filtered pixels */ + return (false); + } + + score = (100*alarm_filter_pixels)/(polygon.Area()); + if(score < 1) + score = 1; /* Fix for score of 0 when frame meets thresholds but alarmed area is not big enough */ + Debug( 5, "Current score is %d", score ); + + if ( check_method >= BLOBS ) + { + Debug( 5, "Checking for blob pixels" ); + typedef struct { unsigned char tag; int count; int lo_x; int hi_x; int lo_y; int hi_y; } BlobStats; + BlobStats blob_stats[256]; + memset( blob_stats, 0, sizeof(BlobStats)*256 ); + uint8_t *spdiff; + uint8_t last_x, last_y; + BlobStats *bsx, *bsy; + BlobStats *bsm, *bss; + for ( int y = lo_y; y <= hi_y; y++ ) + { + int lo_x = ranges[y].lo_x; + int hi_x = ranges[y].hi_x; + + pdiff = (uint8_t*)diff_image->Buffer( lo_x, y ); + for ( int x = lo_x; x <= hi_x; x++, pdiff++ ) + { + if ( *pdiff == WHITE ) + { + Debug( 9, "Got white pixel at %d,%d (%p)", x, y, pdiff ); + //last_x = (x>lo_x)?*(pdiff-1):0; + //last_y = (y>lo_y&&x>=last_lo_x&&x<=last_hi_x)?*(pdiff-diff_width):0; + + last_x = 0; + if(x > 0) { + if((x-1) >= lo_x) { + last_x = *(pdiff-1); + } + } + + last_y = 0; + if(y > 0) { + if((y-1) >= lo_y && ranges[(y-1)].lo_x <= x && ranges[(y-1)].hi_x >= x) { + last_y = *(pdiff-diff_width); + } + } + + if ( last_x ) + { + Debug( 9, "Left neighbour is %d", last_x ); + bsx = &blob_stats[last_x]; + if ( last_y ) + { + Debug( 9, "Top neighbour is %d", last_y ); + bsy = &blob_stats[last_y]; + if ( last_x == last_y ) + { + Debug( 9, "Matching neighbours, setting to %d", last_x ); + // Add to the blob from the x side (either side really) + *pdiff = last_x; + alarm_blob_pixels++; + bsx->count++; + if ( x > bsx->hi_x ) bsx->hi_x = x; + if ( y > bsx->hi_y ) bsx->hi_y = y; + } + else + { + // Aggregate blobs + bsm = bsx->count>=bsy->count?bsx:bsy; + bss = bsm==bsx?bsy:bsx; + + Debug( 9, "Different neighbours, setting pixels of %d to %d", bss->tag, bsm->tag ); + Debug( 9, "Master blob t:%d, c:%d, lx:%d, hx:%d, ly:%d, hy:%d", bsm->tag, bsm->count, bsm->lo_x, bsm->hi_x, bsm->lo_y, bsm->hi_y ); + Debug( 9, "Slave blob t:%d, c:%d, lx:%d, hx:%d, ly:%d, hy:%d", bss->tag, bss->count, bss->lo_x, bss->hi_x, bss->lo_y, bss->hi_y ); + // Now change all those pixels to the other setting + int changed = 0; + for ( int sy = bss->lo_y; sy <= bss->hi_y; sy++) + { + int lo_sx = bss->lo_x>=ranges[sy].lo_x?bss->lo_x:ranges[sy].lo_x; + int hi_sx = bss->hi_x<=ranges[sy].hi_x?bss->hi_x:ranges[sy].hi_x; + + Debug( 9, "Changing %d, %d->%d", sy, lo_sx, hi_sx ); + Debug( 9, "Range %d, %d->%d", sy, ranges[sy].lo_x, ranges[sy].hi_x ); + spdiff = diff_buff + ((diff_width * sy) + lo_sx); + for ( int sx = lo_sx; sx <= hi_sx; sx++, spdiff++ ) + { + Debug( 9, "Pixel at %d,%d (%p) is %d", sx, sy, spdiff, *spdiff ); + if ( *spdiff == bss->tag ) + { + Debug( 9, "Setting pixel" ); + *spdiff = bsm->tag; + changed++; + } + } + } + *pdiff = bsm->tag; + alarm_blob_pixels++; + if ( !changed ) + { + Info( "Master blob t:%d, c:%d, lx:%d, hx:%d, ly:%d, hy:%d", bsm->tag, bsm->count, bsm->lo_x, bsm->hi_x, bsm->lo_y, bsm->hi_y ); + Info( "Slave blob t:%d, c:%d, lx:%d, hx:%d, ly:%d, hy:%d", bss->tag, bss->count, bss->lo_x, bss->hi_x, bss->lo_y, bss->hi_y ); + Error( "No pixels changed, exiting" ); + exit( -1 ); + } + + // Merge the slave blob into the master + bsm->count += bss->count+1; + if ( x > bsm->hi_x ) bsm->hi_x = x; + if ( y > bsm->hi_y ) bsm->hi_y = y; + if ( bss->lo_x < bsm->lo_x ) bsm->lo_x = bss->lo_x; + if ( bss->lo_y < bsm->lo_y ) bsm->lo_y = bss->lo_y; + if ( bss->hi_x > bsm->hi_x ) bsm->hi_x = bss->hi_x; + if ( bss->hi_y > bsm->hi_y ) bsm->hi_y = bss->hi_y; + + alarm_blobs--; + + Debug( 6, "Merging blob %d with %d at %d,%d, %d current blobs", bss->tag, bsm->tag, x, y, alarm_blobs ); + + // Clear out the old blob + bss->tag = 0; + bss->count = 0; + bss->lo_x = 0; + bss->lo_y = 0; + bss->hi_x = 0; + bss->hi_y = 0; + } + } + else + { + Debug( 9, "Setting to left neighbour %d", last_x ); + // Add to the blob from the x side + *pdiff = last_x; + alarm_blob_pixels++; + bsx->count++; + if ( x > bsx->hi_x ) bsx->hi_x = x; + if ( y > bsx->hi_y ) bsx->hi_y = y; + } + } + else + { + if ( last_y ) + { + Debug( 9, "Top neighbour is %d", last_y ); + Debug( 9, "Setting to top neighbour %d", last_y ); + + // Add to the blob from the y side + BlobStats *bsy = &blob_stats[last_y]; + + *pdiff = last_y; + alarm_blob_pixels++; + bsy->count++; + if ( x > bsy->hi_x ) bsy->hi_x = x; + if ( y > bsy->hi_y ) bsy->hi_y = y; + } + else + { + // Create a new blob + int i; + for ( i = (WHITE-1); i > 0; i-- ) + { + BlobStats *bs = &blob_stats[i]; + // See if we can recycle one first, only if it's at least two rows up + if ( bs->count && bs->hi_y < (y-1) ) + { + if ( (min_blob_pixels && bs->count < min_blob_pixels) || (max_blob_pixels && bs->count > max_blob_pixels) ) + { + if ( config.create_analysis_images || config.record_diag_images ) + { + for ( int sy = bs->lo_y; sy <= bs->hi_y; sy++ ) + { + spdiff = diff_buff + ((diff_width * sy) + bs->lo_x); + for ( int sx = bs->lo_x; sx <= bs->hi_x; sx++, spdiff++ ) + { + if ( *spdiff == bs->tag ) + { + *spdiff = BLACK; + } + } + } + } + alarm_blobs--; + alarm_blob_pixels -= bs->count; + + Debug( 6, "Eliminated blob %d, %d pixels (%d,%d - %d,%d), %d current blobs", i, bs->count, bs->lo_x, bs->lo_y, bs->hi_x, bs->hi_y, alarm_blobs ); + + bs->tag = 0; + bs->count = 0; + bs->lo_x = 0; + bs->lo_y = 0; + bs->hi_x = 0; + bs->hi_y = 0; + } + } + if ( !bs->count ) + { + Debug( 9, "Creating new blob %d", i ); + *pdiff = i; + alarm_blob_pixels++; + bs->tag = i; + bs->count++; + bs->lo_x = bs->hi_x = x; + bs->lo_y = bs->hi_y = y; + alarm_blobs++; + + Debug( 6, "Created blob %d at %d,%d, %d current blobs", bs->tag, x, y, alarm_blobs ); + break; + } + } + if ( i == 0 ) + { + Warning( "Max blob count reached. Unable to allocate new blobs so terminating. Zone settings may be too sensitive." ); + x = hi_x+1; + y = hi_y+1; + } + } + } + } + } + } + if ( config.record_diag_images ) + { + static char diag_path[PATH_MAX] = ""; + if ( !diag_path[0] ) + { + snprintf( diag_path, sizeof(diag_path), "%s/%d/diag-%d-%d.jpg", config.dir_events, monitor->Id(), id, 3 ); + } + diff_image->WriteJpeg( diag_path ); + } + + if ( !alarm_blobs ) + { + return( false ); + } + + Debug( 5, "Got %d raw blob pixels, %d raw blobs, need %d -> %d, %d -> %d", alarm_blob_pixels, alarm_blobs, min_blob_pixels, max_blob_pixels, min_blobs, max_blobs ); + + // Now eliminate blobs under the threshold + for ( int i = 1; i < WHITE; i++ ) + { + BlobStats *bs = &blob_stats[i]; + if ( bs->count ) + { + if ( (min_blob_pixels && bs->count < min_blob_pixels) || (max_blob_pixels && bs->count > max_blob_pixels) ) + { + if ( config.create_analysis_images || config.record_diag_images ) + { + for ( int sy = bs->lo_y; sy <= bs->hi_y; sy++ ) + { + spdiff = diff_buff + ((diff_width * sy) + bs->lo_x); + for ( int sx = bs->lo_x; sx <= bs->hi_x; sx++, spdiff++ ) + { + if ( *spdiff == bs->tag ) + { + *spdiff = BLACK; + } + } + } + } + alarm_blobs--; + alarm_blob_pixels -= bs->count; + + Debug( 6, "Eliminated blob %d, %d pixels (%d,%d - %d,%d), %d current blobs", i, bs->count, bs->lo_x, bs->lo_y, bs->hi_x, bs->hi_y, alarm_blobs ); + + bs->tag = 0; + bs->count = 0; + bs->lo_x = 0; + bs->lo_y = 0; + bs->hi_x = 0; + bs->hi_y = 0; + } + else + { + Debug( 6, "Preserved blob %d, %d pixels (%d,%d - %d,%d), %d current blobs", i, bs->count, bs->lo_x, bs->lo_y, bs->hi_x, bs->hi_y, alarm_blobs ); + if ( !min_blob_size || bs->count < min_blob_size ) min_blob_size = bs->count; + if ( !max_blob_size || bs->count > max_blob_size ) max_blob_size = bs->count; + } + } + } + if ( config.record_diag_images ) + { + static char diag_path[PATH_MAX] = ""; + if ( !diag_path[0] ) + { + snprintf( diag_path, sizeof(diag_path), "%s/%d/diag-%d-%d.jpg", config.dir_events, monitor->Id(), id, 4 ); + } + diff_image->WriteJpeg( diag_path ); + } + Debug( 5, "Got %d blob pixels, %d blobs, need %d -> %d, %d -> %d", alarm_blob_pixels, alarm_blobs, min_blob_pixels, max_blob_pixels, min_blobs, max_blobs ); + + if( alarm_blobs ) { + if( min_blobs && (alarm_blobs < min_blobs) ) { + /* Not enough pixels alarmed */ + return (false); + } else if(max_blobs && (alarm_blobs > max_blobs) ) { + /* Too many pixels alarmed */ + overload_count = overload_frames; + return (false); + } + } else { + /* No blobs */ + return (false); + } + + score = (100*alarm_blob_pixels)/(polygon.Area()); + if(score < 1) + score = 1; /* Fix for score of 0 when frame meets thresholds but alarmed area is not big enough */ + Debug( 5, "Current score is %d", score ); + + alarm_lo_x = polygon.HiX()+1; + alarm_hi_x = polygon.LoX()-1; + alarm_lo_y = polygon.HiY()+1; + alarm_hi_y = polygon.LoY()-1; + for ( int i = 1; i < WHITE; i++ ) + { + BlobStats *bs = &blob_stats[i]; + if ( bs->count ) + { + if ( bs->count == max_blob_size ) + { + if ( config.weighted_alarm_centres ) + { + unsigned long x_total = 0; + unsigned long y_total = 0; + + for ( int sy = bs->lo_y; sy <= bs->hi_y; sy++ ) + { + spdiff = diff_buff + ((diff_width * sy) + bs->lo_x); + for ( int sx = bs->lo_x; sx <= bs->hi_x; sx++, spdiff++ ) + { + if ( *spdiff == bs->tag ) + { + x_total += sx; + y_total += sy; + } + } + } + alarm_mid_x = int(round(x_total/bs->count)); + alarm_mid_y = int(round(y_total/bs->count)); + } + else + { + alarm_mid_x = int((bs->hi_x+bs->lo_x+1)/2); + alarm_mid_y = int((bs->hi_y+bs->lo_y+1)/2); + } + } + + if ( alarm_lo_x > bs->lo_x ) alarm_lo_x = bs->lo_x; + if ( alarm_lo_y > bs->lo_y ) alarm_lo_y = bs->lo_y; + if ( alarm_hi_x < bs->hi_x ) alarm_hi_x = bs->hi_x; + if ( alarm_hi_y < bs->hi_y ) alarm_hi_y = bs->hi_y; + } + } + } + else + { + alarm_mid_x = int((alarm_hi_x+alarm_lo_x+1)/2); + alarm_mid_y = int((alarm_hi_y+alarm_lo_y+1)/2); + } + } + + if ( type == INCLUSIVE ) + { + // score >>= 1; + score /= 2; + } + else if ( type == EXCLUSIVE ) + { + // score <<= 1; + score *= 2; + + } + + Debug( 5, "Adjusted score is %d", score ); + + // Now outline the changed region + if ( score ) + { + alarm = true; + + alarm_box = Box( Coord( alarm_lo_x, alarm_lo_y ), Coord( alarm_hi_x, alarm_hi_y ) ); + + //if ( monitor->followMotion() ) + if ( true ) + { + alarm_centre = Coord( alarm_mid_x, alarm_mid_y ); + } + else + { + alarm_centre = alarm_box.Centre(); + } + + if ( (type < PRECLUSIVE) && check_method >= BLOBS && config.create_analysis_images ) + { + + // First mask out anything we don't want + for ( int y = lo_y; y <= hi_y; y++ ) + { + pdiff = diff_buff + ((diff_width * y) + lo_x); + + int lo_x2 = ranges[y].lo_x; + int hi_x2 = ranges[y].hi_x; + + int lo_gap = lo_x2-lo_x; + if ( lo_gap > 0 ) + { + if ( lo_gap == 1 ) + { + *pdiff++ = BLACK; + } + else + { + memset( pdiff, BLACK, lo_gap ); + pdiff += lo_gap; + } + } + + ppoly = pg_image->Buffer( lo_x2, y ); + for ( int x = lo_x2; x <= hi_x2; x++, pdiff++, ppoly++ ) + { + if ( !*ppoly ) + { + *pdiff = BLACK; + } + } + + int hi_gap = hi_x-hi_x2; + if ( hi_gap > 0 ) + { + if ( hi_gap == 1 ) + { + *pdiff = BLACK; + } + else + { + memset( pdiff, BLACK, hi_gap ); + } + } + } + + if( monitor->Colours() == ZM_COLOUR_GRAY8 ) { + image = diff_image->HighlightEdges( alarm_rgb, ZM_COLOUR_RGB24, ZM_SUBPIX_ORDER_RGB, &polygon.Extent() ); + } else { + image = diff_image->HighlightEdges( alarm_rgb, monitor->Colours(), monitor->SubpixelOrder(), &polygon.Extent() ); + } + + // Only need to delete this when 'image' becomes detached and points somewhere else + delete diff_image; + } + else + { + delete image; + image = 0; + } + + Debug( 1, "%s: Pixel Diff: %d, Alarm Pixels: %d, Filter Pixels: %d, Blob Pixels: %d, Blobs: %d, Score: %d", Label(), pixel_diff, alarm_pixels, alarm_filter_pixels, alarm_blob_pixels, alarm_blobs, score ); + } + return( true ); +} + +bool Zone::ParsePolygonString( const char *poly_string, Polygon &polygon ) +{ + Debug( 3, "Parsing polygon string '%s'", poly_string ); + + char *str_ptr = new char[strlen(poly_string)+1]; + char *str = str_ptr; + strcpy( str, poly_string ); + + char *ws; + int n_coords = 0; + int max_n_coords = strlen(str)/4; + Coord *coords = new Coord[max_n_coords]; + while( true ) + { + if ( *str == '\0' ) + { + break; + } + ws = strchr( str, ' ' ); + if ( ws ) + { + *ws = '\0'; + } + char *cp = strchr( str, ',' ); + if ( !cp ) + { + Error( "Bogus coordinate %s found in polygon string", str ); + delete[] coords; + delete[] str_ptr; + return( false ); + } + else + { + *cp = '\0'; + char *xp = str; + char *yp = cp+1; + + int x = atoi(xp); + int y = atoi(yp); + + Debug( 3, "Got coordinate %d,%d from polygon string", x, y ); +#if 0 + if ( x < 0 ) + x = 0; + else if ( x >= width ) + x = width-1; + if ( y < 0 ) + y = 0; + else if ( y >= height ) + y = height-1; +#endif + coords[n_coords++] = Coord( x, y ); + } + if ( ws ) + str = ws+1; + else + break; + } + polygon = Polygon( n_coords, coords ); + + Debug( 3, "Successfully parsed polygon string" ); + //printf( "Area: %d\n", pg.Area() ); + //printf( "Centre: %d,%d\n", pg.Centre().X(), pg.Centre().Y() ); + + delete[] coords; + delete[] str_ptr; + + return( true ); +} + +bool Zone::ParseZoneString( const char *zone_string, int &zone_id, int &colour, Polygon &polygon ) +{ + Debug( 3, "Parsing zone string '%s'", zone_string ); + + char *str_ptr = new char[strlen(zone_string)+1]; + char *str = str_ptr; + strcpy( str, zone_string ); + + char *ws = strchr( str, ' ' ); + if ( !ws ) + { + Debug( 3, "No initial whitespace found in zone string '%s', finishing", str ); + } + zone_id = strtol( str, 0, 10 ); + Debug( 3, "Got zone %d from zone string", zone_id ); + if ( !ws ) + { + delete str_ptr; + return( true ); + } + + *ws = '\0'; + str = ws+1; + + ws = strchr( str, ' ' ); + if ( !ws ) + { + Debug( 3, "No secondary whitespace found in zone string '%s', finishing", zone_string ); + } + colour = strtol( str, 0, 16 ); + Debug( 3, "Got colour %06x from zone string", colour ); + if ( !ws ) + { + delete str_ptr; + return( true ); + } + *ws = '\0'; + str = ws+1; + + bool result = ParsePolygonString( str, polygon ); + + //printf( "Area: %d\n", pg.Area() ); + //printf( "Centre: %d,%d\n", pg.Centre().X(), pg.Centre().Y() ); + + delete[] str_ptr; + + return( result ); +} + +int Zone::Load( Monitor *monitor, Zone **&zones ) +{ + static char sql[ZM_SQL_MED_BUFSIZ]; + snprintf( sql, sizeof(sql), "select Id,Name,Type+0,Units,NumCoords,Coords,AlarmRGB,CheckMethod+0,MinPixelThreshold,MaxPixelThreshold,MinAlarmPixels,MaxAlarmPixels,FilterX,FilterY,MinFilterPixels,MaxFilterPixels,MinBlobPixels,MaxBlobPixels,MinBlobs,MaxBlobs,OverloadFrames from Zones where MonitorId = %d order by Type, Id", monitor->Id() ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_zones = mysql_num_rows( result ); + Debug( 1, "Got %d zones for monitor %s", n_zones, monitor->Name() ); + delete[] zones; + zones = new Zone *[n_zones]; + for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) + { + int col = 0; + + int Id = atoi(dbrow[col++]); + const char *Name = dbrow[col++]; + int Type = atoi(dbrow[col++]); + const char *Units = dbrow[col++]; + /* int NumCoords = */ atoi(dbrow[col++]); + const char *Coords = dbrow[col++]; + int AlarmRGB = dbrow[col]?atoi(dbrow[col]):0; col++; + int CheckMethod = atoi(dbrow[col++]); + int MinPixelThreshold = dbrow[col]?atoi(dbrow[col]):0; col++; + int MaxPixelThreshold = dbrow[col]?atoi(dbrow[col]):0; col++; + int MinAlarmPixels = dbrow[col]?atoi(dbrow[col]):0; col++; + int MaxAlarmPixels = dbrow[col]?atoi(dbrow[col]):0; col++; + int FilterX = dbrow[col]?atoi(dbrow[col]):0; col++; + int FilterY = dbrow[col]?atoi(dbrow[col]):0; col++; + int MinFilterPixels = dbrow[col]?atoi(dbrow[col]):0; col++; + int MaxFilterPixels = dbrow[col]?atoi(dbrow[col]):0; col++; + int MinBlobPixels = dbrow[col]?atoi(dbrow[col]):0; col++; + int MaxBlobPixels = dbrow[col]?atoi(dbrow[col]):0; col++; + int MinBlobs = dbrow[col]?atoi(dbrow[col]):0; col++; + int MaxBlobs = dbrow[col]?atoi(dbrow[col]):0; col++; + int OverloadFrames = dbrow[col]?atoi(dbrow[col]):0; col++; + + /* HTML colour code is actually BGR in memory, we want RGB */ + AlarmRGB = rgb_convert(AlarmRGB, ZM_SUBPIX_ORDER_BGR); + + Debug( 5, "Parsing polygon %s", Coords ); + Polygon polygon; + if ( !ParsePolygonString( Coords, polygon ) ) + Panic( "Unable to parse polygon string '%s' for zone %d/%s for monitor %s", Coords, Id, Name, monitor->Name() ); + + if ( polygon.LoX() < 0 || polygon.HiX() >= monitor->Width() || polygon.LoY() < 0 || polygon.HiY() >= monitor->Height() ) + Panic( "Zone %d/%s for monitor %s extends outside of image dimensions, %d, %d, %d, %d", Id, Name, monitor->Name(), polygon.LoX(), polygon.LoY(), polygon.HiX(), polygon.HiY() ); + + if ( false && !strcmp( Units, "Percent" ) ) + { + MinAlarmPixels = (MinAlarmPixels*polygon.Area())/100; + MaxAlarmPixels = (MaxAlarmPixels*polygon.Area())/100; + MinFilterPixels = (MinFilterPixels*polygon.Area())/100; + MaxFilterPixels = (MaxFilterPixels*polygon.Area())/100; + MinBlobPixels = (MinBlobPixels*polygon.Area())/100; + MaxBlobPixels = (MaxBlobPixels*polygon.Area())/100; + } + + if ( atoi(dbrow[2]) == Zone::INACTIVE ) + { + zones[i] = new Zone( monitor, Id, Name, polygon ); + } + else + { + zones[i] = new Zone( monitor, Id, Name, (Zone::ZoneType)Type, polygon, AlarmRGB, (Zone::CheckMethod)CheckMethod, MinPixelThreshold, MaxPixelThreshold, MinAlarmPixels, MaxAlarmPixels, Coord( FilterX, FilterY ), MinFilterPixels, MaxFilterPixels, MinBlobPixels, MaxBlobPixels, MinBlobs, MaxBlobs, OverloadFrames ); + } + } + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + // Yadda yadda + mysql_free_result( result ); + return( n_zones ); +} + +bool Zone::DumpSettings( char *output, bool /*verbose*/ ) +{ + output[0] = 0; + + sprintf( output+strlen(output), " Id : %d\n", id ); + sprintf( output+strlen(output), " Label : %s\n", label ); + sprintf( output+strlen(output), " Type: %d - %s\n", type, + type==ACTIVE?"Active":( + type==INCLUSIVE?"Inclusive":( + type==EXCLUSIVE?"Exclusive":( + type==PRECLUSIVE?"Preclusive":( + type==INACTIVE?"Inactive":"Unknown" + ))))); + sprintf( output+strlen(output), " Shape : %d points\n", polygon.getNumCoords() ); + for ( int i = 0; i < polygon.getNumCoords(); i++ ) + { + sprintf( output+strlen(output), " %i: %d,%d\n", i, polygon.getCoord( i ).X(), polygon.getCoord( i ).Y() ); + } + sprintf( output+strlen(output), " Alarm RGB : %06x\n", alarm_rgb ); + sprintf( output+strlen(output), " Check Method: %d - %s\n", check_method, + check_method==ALARMED_PIXELS?"Alarmed Pixels":( + check_method==FILTERED_PIXELS?"FilteredPixels":( + check_method==BLOBS?"Blobs":"Unknown" + ))); + sprintf( output+strlen(output), " Min Pixel Threshold : %d\n", min_pixel_threshold ); + sprintf( output+strlen(output), " Max Pixel Threshold : %d\n", max_pixel_threshold ); + sprintf( output+strlen(output), " Min Alarm Pixels : %d\n", min_alarm_pixels ); + sprintf( output+strlen(output), " Max Alarm Pixels : %d\n", max_alarm_pixels ); + sprintf( output+strlen(output), " Filter Box : %d,%d\n", filter_box.X(), filter_box.Y() ); + sprintf( output+strlen(output), " Min Filter Pixels : %d\n", min_filter_pixels ); + sprintf( output+strlen(output), " Max Filter Pixels : %d\n", max_filter_pixels ); + sprintf( output+strlen(output), " Min Blob Pixels : %d\n", min_blob_pixels ); + sprintf( output+strlen(output), " Max Blob Pixels : %d\n", max_blob_pixels ); + sprintf( output+strlen(output), " Min Blobs : %d\n", min_blobs ); + sprintf( output+strlen(output), " Max Blobs : %d\n", max_blobs ); + return( true ); +} + +void Zone::std_alarmedpixels(Image* pdiff_image, const Image* ppoly_image, unsigned int* pixel_count, unsigned int* pixel_sum) { + uint32_t pixelsalarmed = 0; + uint32_t pixelsdifference = 0; + uint8_t *pdiff; + const uint8_t *ppoly; + uint8_t calc_max_pixel_threshold = 255; + unsigned int lo_y; + unsigned int hi_y; + unsigned int lo_x; + unsigned int hi_x; + + if(max_pixel_threshold) + calc_max_pixel_threshold = max_pixel_threshold; + + lo_y = polygon.LoY(); + hi_y = polygon.HiY(); + for ( int y = lo_y; y <= hi_y; y++ ) + { + lo_x = ranges[y].lo_x; + hi_x = ranges[y].hi_x; + + Debug( 7, "Checking line %d from %d -> %d", y, lo_x, hi_x ); + pdiff = (uint8_t*)pdiff_image->Buffer( lo_x, y ); + ppoly = ppoly_image->Buffer( lo_x, y ); + + for ( int x = lo_x; x <= hi_x; x++, pdiff++, ppoly++ ) + { + if ( *ppoly && (*pdiff > min_pixel_threshold) && (*pdiff <= calc_max_pixel_threshold) ) + { + pixelsalarmed++; + pixelsdifference += *pdiff; + *pdiff = WHITE; + } + else + { + *pdiff = BLACK; + } + } + } + + /* Store the results */ + *pixel_count = pixelsalarmed; + *pixel_sum = pixelsdifference; +} diff --git a/src/zm_zone.h b/src/zm_zone.h new file mode 100644 index 000000000..3eb8d7815 --- /dev/null +++ b/src/zm_zone.h @@ -0,0 +1,164 @@ +// +// ZoneMinder Zone Class Interfaces, $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. +// + +#ifndef ZM_ZONE_H +#define ZM_ZONE_H + +#include "zm_rgb.h" +#include "zm_coord.h" +#include "zm_poly.h" +#include "zm_image.h" +#include "zm_event.h" + +class Monitor; + +// +// This describes a 'zone', or an area of an image that has certain +// detection characteristics. +// +class Zone +{ +protected: + struct Range + { + int lo_x; + int hi_x; + int off_x; + }; + +public: + typedef enum { ACTIVE=1, INCLUSIVE, EXCLUSIVE, PRECLUSIVE, INACTIVE } ZoneType; + typedef enum { ALARMED_PIXELS=1, FILTERED_PIXELS, BLOBS } CheckMethod; + +protected: + // Inputs + Monitor *monitor; + + int id; + char *label; + ZoneType type; + Polygon polygon; + Rgb alarm_rgb; + CheckMethod check_method; + + int min_pixel_threshold; + int max_pixel_threshold; + + int min_alarm_pixels; + int max_alarm_pixels; + + Coord filter_box; + int min_filter_pixels; + int max_filter_pixels; + + int min_blob_pixels; + int max_blob_pixels; + int min_blobs; + int max_blobs; + + int overload_frames; + + // Outputs/Statistics + bool alarmed; + int pixel_diff; + unsigned int alarm_pixels; + int alarm_filter_pixels; + int alarm_blob_pixels; + int alarm_blobs; + int min_blob_size; + int max_blob_size; + Box alarm_box; + Coord alarm_centre; + unsigned int score; + Image *pg_image; + Range *ranges; + Image *image; + + int overload_count; + +protected: + void Setup( Monitor *p_monitor, int p_id, const char *p_label, ZoneType p_type, const Polygon &p_polygon, const Rgb p_alarm_rgb, CheckMethod p_check_method, int p_min_pixel_threshold, int p_max_pixel_threshold, int p_min_alarm_pixels, int p_max_alarm_pixels, const Coord &p_filter_box, int p_min_filter_pixels, int p_max_filter_pixels, int p_min_blob_pixels, int p_max_blob_pixels, int p_min_blobs, int p_max_blobs, int p_overload_frames ); + void std_alarmedpixels(Image* pdiff_image, const Image* ppoly_image, unsigned int* pixel_count, unsigned int* pixel_sum); + +public: + Zone( Monitor *p_monitor, int p_id, const char *p_label, ZoneType p_type, const Polygon &p_polygon, const Rgb p_alarm_rgb, CheckMethod p_check_method, int p_min_pixel_threshold=15, int p_max_pixel_threshold=0, int p_min_alarm_pixels=50, int p_max_alarm_pixels=75000, const Coord &p_filter_box=Coord( 3, 3 ), int p_min_filter_pixels=50, int p_max_filter_pixels=50000, int p_min_blob_pixels=10, int p_max_blob_pixels=0, int p_min_blobs=0, int p_max_blobs=0, int p_overload_frames=0 ) + { + Setup( p_monitor, p_id, p_label, p_type, p_polygon, p_alarm_rgb, p_check_method, p_min_pixel_threshold, p_max_pixel_threshold, p_min_alarm_pixels, p_max_alarm_pixels, p_filter_box, p_min_filter_pixels, p_max_filter_pixels, p_min_blob_pixels, p_max_blob_pixels, p_min_blobs, p_max_blobs, p_overload_frames ); + } + Zone( Monitor *p_monitor, int p_id, const char *p_label, const Polygon &p_polygon, const Rgb p_alarm_rgb, CheckMethod p_check_method, int p_min_pixel_threshold=15, int p_max_pixel_threshold=0, int p_min_alarm_pixels=50, int p_max_alarm_pixels=75000, const Coord &p_filter_box=Coord( 3, 3 ), int p_min_filter_pixels=50, int p_max_filter_pixels=50000, int p_min_blob_pixels=10, int p_max_blob_pixels=0, int p_min_blobs=0, int p_max_blobs=0, int p_overload_frames=0 ) + { + Setup( p_monitor, p_id, p_label, Zone::ACTIVE, p_polygon, p_alarm_rgb, p_check_method, p_min_pixel_threshold, p_max_pixel_threshold, p_min_alarm_pixels, p_max_alarm_pixels, p_filter_box, p_min_filter_pixels, p_max_filter_pixels, p_min_blob_pixels, p_max_blob_pixels, p_min_blobs, p_max_blobs, p_overload_frames ); + } + Zone( Monitor *p_monitor, int p_id, const char *p_label, const Polygon &p_polygon ) + { + Setup( p_monitor, p_id, p_label, Zone::INACTIVE, p_polygon, RGB_BLACK, (Zone::CheckMethod)0, 0, 0, 0, 0, Coord( 0, 0 ), 0, 0, 0, 0, 0, 0, 0 ); + } + +public: + ~Zone(); + + inline int Id() const { return( id ); } + inline const char *Label() const { return( label ); } + inline ZoneType Type() const { return( type ); } + inline bool IsActive() const { return( type == ACTIVE ); } + inline bool IsInclusive() const { return( type == INCLUSIVE ); } + inline bool IsExclusive() const { return( type == EXCLUSIVE ); } + inline bool IsPreclusive() const { return( type == PRECLUSIVE ); } + inline bool IsInactive() const { return( type == INACTIVE ); } + inline const Image *AlarmImage() const { return( image ); } + inline const Polygon &GetPolygon() const { return( polygon ); } + inline bool Alarmed() const { return( alarmed ); } + inline void SetAlarm() { alarmed = true; } + inline void ClearAlarm() { alarmed = false; } + inline Coord GetAlarmCentre() const { return( alarm_centre ); } + inline unsigned int Score() const { return( score ); } + + inline void ResetStats() + { + alarmed = false; + pixel_diff = 0; + alarm_pixels = 0; + alarm_filter_pixels = 0; + alarm_blob_pixels = 0; + alarm_blobs = 0; + min_blob_size = 0; + max_blob_size = 0; + score = 0; + } + void RecordStats( const Event *event ); + bool CheckAlarms( const Image *delta_image ); + bool DumpSettings( char *output, bool verbose ); + + static bool ParsePolygonString( const char *polygon_string, Polygon &polygon ); + static bool ParseZoneString( const char *zone_string, int &zone_id, int &colour, Polygon &polygon ); + static int Load( Monitor *monitor, Zone **&zones ); + //================================================= + bool CheckOverloadCount(); + int GetOverloadCount(); + void SetOverloadCount(int nOverCount); + int GetOverloadFrames(); + void SetScore(unsigned int nScore); + void SetAlarmImage(const Image* srcImage); + + inline const Image *getPgImage() const { return( pg_image ); } + inline const Range *getRanges() const { return( ranges ); } + +}; + +#endif // ZM_ZONE_H diff --git a/src/zm_zone.h.orig b/src/zm_zone.h.orig new file mode 100644 index 000000000..6aa45e13d --- /dev/null +++ b/src/zm_zone.h.orig @@ -0,0 +1,153 @@ +// +// ZoneMinder Zone Class Interfaces, $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. +// + +#ifndef ZM_ZONE_H +#define ZM_ZONE_H + +#include "zm_rgb.h" +#include "zm_coord.h" +#include "zm_poly.h" +#include "zm_image.h" +#include "zm_event.h" + +class Monitor; + +// +// This describes a 'zone', or an area of an image that has certain +// detection characteristics. +// +class Zone +{ +protected: + struct Range + { + int lo_x; + int hi_x; + int off_x; + }; + +public: + typedef enum { ACTIVE=1, INCLUSIVE, EXCLUSIVE, PRECLUSIVE, INACTIVE } ZoneType; + typedef enum { ALARMED_PIXELS=1, FILTERED_PIXELS, BLOBS } CheckMethod; + +protected: + // Inputs + Monitor *monitor; + + int id; + char *label; + ZoneType type; + Polygon polygon; + Rgb alarm_rgb; + CheckMethod check_method; + + int min_pixel_threshold; + int max_pixel_threshold; + + int min_alarm_pixels; + int max_alarm_pixels; + + Coord filter_box; + int min_filter_pixels; + int max_filter_pixels; + + int min_blob_pixels; + int max_blob_pixels; + int min_blobs; + int max_blobs; + + int overload_frames; + + // Outputs/Statistics + bool alarmed; + int pixel_diff; + unsigned int alarm_pixels; + int alarm_filter_pixels; + int alarm_blob_pixels; + int alarm_blobs; + int min_blob_size; + int max_blob_size; + Box alarm_box; + Coord alarm_centre; + unsigned int score; + Image *pg_image; + Range *ranges; + Image *image; + + int overload_count; + +protected: + void Setup( Monitor *p_monitor, int p_id, const char *p_label, ZoneType p_type, const Polygon &p_polygon, const Rgb p_alarm_rgb, CheckMethod p_check_method, int p_min_pixel_threshold, int p_max_pixel_threshold, int p_min_alarm_pixels, int p_max_alarm_pixels, const Coord &p_filter_box, int p_min_filter_pixels, int p_max_filter_pixels, int p_min_blob_pixels, int p_max_blob_pixels, int p_min_blobs, int p_max_blobs, int p_overload_frames ); + void std_alarmedpixels(Image* pdiff_image, const Image* ppoly_image, unsigned int* pixel_count, unsigned int* pixel_sum); + +public: + Zone( Monitor *p_monitor, int p_id, const char *p_label, ZoneType p_type, const Polygon &p_polygon, const Rgb p_alarm_rgb, CheckMethod p_check_method, int p_min_pixel_threshold=15, int p_max_pixel_threshold=0, int p_min_alarm_pixels=50, int p_max_alarm_pixels=75000, const Coord &p_filter_box=Coord( 3, 3 ), int p_min_filter_pixels=50, int p_max_filter_pixels=50000, int p_min_blob_pixels=10, int p_max_blob_pixels=0, int p_min_blobs=0, int p_max_blobs=0, int p_overload_frames=0 ) + { + Setup( p_monitor, p_id, p_label, p_type, p_polygon, p_alarm_rgb, p_check_method, p_min_pixel_threshold, p_max_pixel_threshold, p_min_alarm_pixels, p_max_alarm_pixels, p_filter_box, p_min_filter_pixels, p_max_filter_pixels, p_min_blob_pixels, p_max_blob_pixels, p_min_blobs, p_max_blobs, p_overload_frames ); + } + Zone( Monitor *p_monitor, int p_id, const char *p_label, const Polygon &p_polygon, const Rgb p_alarm_rgb, CheckMethod p_check_method, int p_min_pixel_threshold=15, int p_max_pixel_threshold=0, int p_min_alarm_pixels=50, int p_max_alarm_pixels=75000, const Coord &p_filter_box=Coord( 3, 3 ), int p_min_filter_pixels=50, int p_max_filter_pixels=50000, int p_min_blob_pixels=10, int p_max_blob_pixels=0, int p_min_blobs=0, int p_max_blobs=0, int p_overload_frames=0 ) + { + Setup( p_monitor, p_id, p_label, Zone::ACTIVE, p_polygon, p_alarm_rgb, p_check_method, p_min_pixel_threshold, p_max_pixel_threshold, p_min_alarm_pixels, p_max_alarm_pixels, p_filter_box, p_min_filter_pixels, p_max_filter_pixels, p_min_blob_pixels, p_max_blob_pixels, p_min_blobs, p_max_blobs, p_overload_frames ); + } + Zone( Monitor *p_monitor, int p_id, const char *p_label, const Polygon &p_polygon ) + { + Setup( p_monitor, p_id, p_label, Zone::INACTIVE, p_polygon, RGB_BLACK, (Zone::CheckMethod)0, 0, 0, 0, 0, Coord( 0, 0 ), 0, 0, 0, 0, 0, 0, 0 ); + } + +public: + ~Zone(); + + inline int Id() const { return( id ); } + inline const char *Label() const { return( label ); } + inline ZoneType Type() const { return( type ); } + inline bool IsActive() const { return( type == ACTIVE ); } + inline bool IsInclusive() const { return( type == INCLUSIVE ); } + inline bool IsExclusive() const { return( type == EXCLUSIVE ); } + inline bool IsPreclusive() const { return( type == PRECLUSIVE ); } + inline bool IsInactive() const { return( type == INACTIVE ); } + inline const Image *AlarmImage() const { return( image ); } + inline const Polygon &GetPolygon() const { return( polygon ); } + inline bool Alarmed() const { return( alarmed ); } + inline void SetAlarm() { alarmed = true; } + inline void ClearAlarm() { alarmed = false; } + inline Coord GetAlarmCentre() const { return( alarm_centre ); } + inline unsigned int Score() const { return( score ); } + + inline void ResetStats() + { + alarmed = false; + pixel_diff = 0; + alarm_pixels = 0; + alarm_filter_pixels = 0; + alarm_blob_pixels = 0; + alarm_blobs = 0; + min_blob_size = 0; + max_blob_size = 0; + score = 0; + } + void RecordStats( const Event *event ); + bool CheckAlarms( const Image *delta_image ); + bool DumpSettings( char *output, bool verbose ); + + static bool ParsePolygonString( const char *polygon_string, Polygon &polygon ); + static bool ParseZoneString( const char *zone_string, int &zone_id, int &colour, Polygon &polygon ); + static int Load( Monitor *monitor, Zone **&zones ); +}; + +#endif // ZM_ZONE_H diff --git a/src/zma.cpp b/src/zma.cpp new file mode 100644 index 000000000..3de25bf12 --- /dev/null +++ b/src/zma.cpp @@ -0,0 +1,139 @@ +// +// ZoneMinder Analysis Daemon, $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. +// + +#include +#include + +#include "zm.h" +#include "zm_db.h" +#include "zm_signal.h" +#include "zm_monitor.h" + +void Usage() +{ + fprintf( stderr, "zma -m \n" ); + fprintf( stderr, "Options:\n" ); + fprintf( stderr, " -m, --monitor : Specify which monitor to use\n" ); + fprintf( stderr, " -h, --help : This screen\n" ); + exit( 0 ); +} + +int main( int argc, char *argv[] ) +{ + srand( getpid() * time( 0 ) ); + + int id = -1; + + static struct option long_options[] = { + {"monitor", 1, 0, 'm'}, + {"help", 0, 0, 'h'}, + {0, 0, 0, 0} + }; + + while (1) + { + int option_index = 0; + + int c = getopt_long (argc, argv, "m:h", long_options, &option_index); + if (c == -1) + { + break; + } + + switch (c) + { + case 'm': + id = atoi(optarg); + break; + case 'h': + case '?': + Usage(); + break; + default: + //fprintf( stderr, "?? getopt returned character code 0%o ??\n", c ); + break; + } + } + + if (optind < argc) + { + fprintf( stderr, "Extraneous options, " ); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + Usage(); + } + + if ( id < 0 ) + { + fprintf( stderr, "Bogus monitor %d\n", id ); + Usage(); + exit( 0 ); + } + + char log_id_string[16]; + snprintf( log_id_string, sizeof(log_id_string), "zma_m%d", id ); + + zmLoadConfig(); + + logInit( log_id_string ); + + ssedetect(); + + Monitor *monitor = Monitor::Load( id, true, Monitor::ANALYSIS ); + + if ( monitor ) + { + Info( "In mode %d/%d, warming up", monitor->GetFunction(), monitor->Enabled() ); + + if ( config.opt_frame_server ) + { + Event::OpenFrameSocket( monitor->Id() ); + } + + zmSetDefaultHupHandler(); + zmSetDefaultTermHandler(); + zmSetDefaultDieHandler(); + + sigset_t block_set; + sigemptyset( &block_set ); + + while( !zm_terminate ) + { + // Process the next image + sigprocmask( SIG_BLOCK, &block_set, 0 ); + if ( !monitor->Analyse() ) + { + usleep( monitor->Active()?ZM_SAMPLE_RATE:ZM_SUSPENDED_RATE ); + } + if ( zm_reload ) + { + monitor->Reload(); + zm_reload = false; + } + sigprocmask( SIG_UNBLOCK, &block_set, 0 ); + } + delete monitor; + } + else + { + fprintf( stderr, "Can't find monitor with id of %d\n", id ); + } + return( 0 ); +} diff --git a/src/zmc.cpp b/src/zmc.cpp new file mode 100644 index 000000000..692c0b59e --- /dev/null +++ b/src/zmc.cpp @@ -0,0 +1,304 @@ +// +// ZoneMinder Capture Daemon, $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. +// + +#include +#include +#include + +#include "zm.h" +#include "zm_db.h" +#include "zm_time.h" +#include "zm_signal.h" +#include "zm_monitor.h" + +void Usage() +{ + fprintf( stderr, "zmc -d or -r -H -P -p or -f or -m \n" ); + + fprintf( stderr, "Options:\n" ); + fprintf( stderr, " -d, --device : For local cameras, device to access. E.g /dev/video0 etc\n" ); + fprintf( stderr, " -r -H -P -p : For remote cameras\n" ); + fprintf( stderr, " -f, --file : For local images, jpg file to access.\n" ); + fprintf( stderr, " -m, --monitor : For sources associated with a single monitor\n" ); + fprintf( stderr, " -h, --help : This screen\n" ); + exit( 0 ); +} + +int main( int argc, char *argv[] ) +{ + srand( getpid() * time( 0 ) ); + + const char *device = ""; + const char *protocol = ""; + const char *host = ""; + const char *port = ""; + const char *path = ""; + const char *file = ""; + int monitor_id = -1; + + static struct option long_options[] = { + {"device", 1, 0, 'd'}, + {"protocol", 1, 0, 'r'}, + {"host", 1, 0, 'H'}, + {"port", 1, 0, 'P'}, + {"path", 1, 0, 'p'}, + {"file", 1, 0, 'f'}, + {"monitor", 1, 0, 'm'}, + {"help", 0, 0, 'h'}, + {0, 0, 0, 0} + }; + + while (1) + { + int option_index = 0; + + int c = getopt_long (argc, argv, "d:H:P:p:f:m:h", long_options, &option_index); + if (c == -1) + { + break; + } + + switch (c) + { + case 'd': + device = optarg; + break; + case 'H': + host = optarg; + break; + case 'P': + port = optarg; + break; + case 'p': + path = optarg; + break; + case 'f': + file = optarg; + break; + case 'm': + monitor_id = atoi(optarg); + break; + case 'h': + case '?': + Usage(); + break; + default: + //fprintf( stderr, "?? getopt returned character code 0%o ??\n", c ); + break; + } + } + + if (optind < argc) + { + fprintf( stderr, "Extraneous options, " ); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + Usage(); + } + + int modes = ( device[0]?1:0 + host[0]?1:0 + file[0]?1:0 + (monitor_id>0?1:0) ); + if ( modes > 1 ) + { + fprintf( stderr, "Only one of device, host/port/path, file or monitor id allowed\n" ); + Usage(); + exit( 0 ); + } + + if ( modes < 1 ) + { + fprintf( stderr, "One of device, host/port/path, file or monitor id must be specified\n" ); + Usage(); + exit( 0 ); + } + + char log_id_string[32] = ""; + if ( device[0] ) + { + const char *slash_ptr = strrchr( device, '/' ); + snprintf( log_id_string, sizeof(log_id_string), "zmc_d%s", slash_ptr?slash_ptr+1:device ); + } + else if ( host[0] ) + { + snprintf( log_id_string, sizeof(log_id_string), "zmc_h%s", host ); + } + else if ( file[0] ) + { + const char *slash_ptr = strrchr( file, '/' ); + snprintf( log_id_string, sizeof(log_id_string), "zmc_f%s", slash_ptr?slash_ptr+1:file ); + } + else + { + snprintf( log_id_string, sizeof(log_id_string), "zmc_m%d", monitor_id ); + } + + zmLoadConfig(); + + logInit( log_id_string ); + + ssedetect(); + + Monitor **monitors = 0; + int n_monitors = 0; +#if ZM_HAS_V4L + if ( device[0] ) + { + n_monitors = Monitor::LoadLocalMonitors( device, monitors, Monitor::CAPTURE ); + } + else +#endif // ZM_HAS_V4L + if ( host[0] ) + { + if ( !port ) + port = "80"; + n_monitors = Monitor::LoadRemoteMonitors( protocol, host, port, path, monitors, Monitor::CAPTURE ); + } + else if ( file[0] ) + { + n_monitors = Monitor::LoadFileMonitors( file, monitors, Monitor::CAPTURE ); + } + else + { + Monitor *monitor = Monitor::Load( monitor_id, true, Monitor::CAPTURE ); + if ( monitor ) + { + monitors = new Monitor *[1]; + monitors[0] = monitor; + n_monitors = 1; + } + } + + if ( !n_monitors ) + { + Error( "No monitors found" ); + exit ( -1 ); + } + + Info( "Starting Capture" ); + + zmSetDefaultTermHandler(); + zmSetDefaultDieHandler(); + + sigset_t block_set; + sigemptyset( &block_set ); + + sigaddset( &block_set, SIGUSR1 ); + sigaddset( &block_set, SIGUSR2 ); + + if ( monitors[0]->PrimeCapture() < 0 ) + { + Error( "Failed to prime capture of initial monitor" ); + exit( -1 ); + } + + long *capture_delays = new long[n_monitors]; + long *alarm_capture_delays = new long[n_monitors]; + long *next_delays = new long[n_monitors]; + struct timeval * last_capture_times = new struct timeval[n_monitors]; + for ( int i = 0; i < n_monitors; i++ ) + { + last_capture_times[i].tv_sec = last_capture_times[i].tv_usec = 0; + capture_delays[i] = monitors[i]->GetCaptureDelay(); + alarm_capture_delays[i] = monitors[i]->GetAlarmCaptureDelay(); + } + + int result = 0; + struct timeval now; + struct DeltaTimeval delta_time; + while( !zm_terminate ) + { + sigprocmask( SIG_BLOCK, &block_set, 0 ); + for ( int i = 0; i < n_monitors; i++ ) + { + long min_delay = MAXINT; + + gettimeofday( &now, NULL ); + for ( int j = 0; j < n_monitors; j++ ) + { + if ( last_capture_times[j].tv_sec ) + { + DELTA_TIMEVAL( delta_time, now, last_capture_times[j], DT_PREC_3 ); + if ( monitors[i]->GetState() == Monitor::ALARM ) + next_delays[j] = alarm_capture_delays[j]-delta_time.delta; + else + next_delays[j] = capture_delays[j]-delta_time.delta; + if ( next_delays[j] < 0 ) + next_delays[j] = 0; + } + else + { + next_delays[j] = 0; + } + if ( next_delays[j] <= min_delay ) + { + min_delay = next_delays[j]; + } + } + + if ( next_delays[i] <= min_delay || next_delays[i] <= 0 ) + { + if ( monitors[i]->PreCapture() < 0 ) + { + Error( "Failed to pre-capture monitor %d (%d/%d)", monitors[i]->Id(), i, n_monitors ); + zm_terminate = true; + result = -1; + break; + } + if ( monitors[i]->Capture() < 0 ) + { + Error( "Failed to capture image from monitor %d (%d/%d)", monitors[i]->Id(), i, n_monitors ); + zm_terminate = true; + result = -1; + break; + } + if ( monitors[i]->PostCapture() < 0 ) + { + Error( "Failed to post-capture monitor %d (%d/%d)", monitors[i]->Id(), i, n_monitors ); + zm_terminate = true; + result = -1; + break; + } + + if ( next_delays[i] > 0 ) + { + gettimeofday( &now, NULL ); + DELTA_TIMEVAL( delta_time, now, last_capture_times[i], DT_PREC_3 ); + long sleep_time = next_delays[i]-delta_time.delta; + if ( sleep_time > 0 ) + { + usleep( sleep_time*(DT_MAXGRAN/DT_PREC_3) ); + } + } + gettimeofday( &(last_capture_times[i]), NULL ); + } + } + sigprocmask( SIG_UNBLOCK, &block_set, 0 ); + } + for ( int i = 0; i < n_monitors; i++ ) + { + delete monitors[i]; + } + delete monitors; + delete [] alarm_capture_delays; + delete [] capture_delays; + delete [] next_delays; + delete [] last_capture_times; + + return( result ); +} diff --git a/src/zmf.cpp b/src/zmf.cpp new file mode 100644 index 000000000..bc7a54ee0 --- /dev/null +++ b/src/zmf.cpp @@ -0,0 +1,283 @@ +// +// ZoneMinder Image File Writer Implementation, $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. +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "zm.h" +#include "zm_db.h" +#include "zm_signal.h" +#include "zm_monitor.h" + +#include "zmf.h" + +int OpenSocket( int monitor_id ) +{ + int sd = socket( AF_UNIX, SOCK_STREAM, 0); + if ( sd < 0 ) + { + Error( "Can't create socket: %s", strerror(errno) ); + return( -1 ); + } + + char sock_path[PATH_MAX] = ""; + snprintf( sock_path, sizeof(sock_path), "%s/zmf-%d.sock", config.path_socks, monitor_id ); + if ( unlink( sock_path ) < 0 ) + { + Warning( "Can't unlink '%s': %s", sock_path, strerror(errno) ); + } + + struct sockaddr_un addr; + + strncpy( addr.sun_path, sock_path, sizeof(addr.sun_path) ); + addr.sun_family = AF_UNIX; + + if ( bind( sd, (struct sockaddr *)&addr, strlen(addr.sun_path)+sizeof(addr.sun_family)) < 0 ) + { + Error( "Can't bind: %s", strerror(errno) ); + exit( -1 ); + } + + if ( listen( sd, SOMAXCONN ) < 0 ) + { + Error( "Can't listen: %s", strerror(errno) ); + return( -1 ); + } + + struct sockaddr_un rem_addr; + socklen_t rem_addr_len = sizeof(rem_addr); + int new_sd = -1; + if ( (new_sd = accept( sd, (struct sockaddr *)&rem_addr, &rem_addr_len )) < 0 ) + { + Error( "Can't accept: %s", strerror(errno) ); + exit( -1 ); + } + close( sd ); + + sd = new_sd; + + Info( "Frame server socket open, awaiting images" ); + return( sd ); +} + +int ReopenSocket( int &sd, int monitor_id ) +{ + close( sd ); + return( sd = OpenSocket( monitor_id ) ); +} + +void Usage() +{ + fprintf( stderr, "zmf -m \n" ); + fprintf( stderr, "Options:\n" ); + fprintf( stderr, " -m, --monitor : Specify which monitor to use\n" ); + fprintf( stderr, " -h, --help : This screen\n" ); + exit( 0 ); +} + +int main( int argc, char *argv[] ) +{ + srand( getpid() * time( 0 ) ); + + int id = -1; + + static struct option long_options[] = { + {"monitor", 1, 0, 'm'}, + {"help", 0, 0, 'h'}, + {0, 0, 0, 0} + }; + + while (1) + { + int option_index = 0; + + int c = getopt_long (argc, argv, "m:h", long_options, &option_index); + if (c == -1) + { + break; + } + + switch (c) + { + case 'm': + id = atoi(optarg); + break; + case 'h': + case '?': + Usage(); + break; + default: + //fprintf( stderr, "?? getopt returned character code 0%o ??\n", c ); + break; + } + } + + if (optind < argc) + { + fprintf( stderr, "Extraneous options, " ); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + Usage(); + } + + if ( id < 0 ) + { + fprintf( stderr, "Bogus monitor %d\n", id ); + Usage(); + exit( 0 ); + } + + char log_id_string[16]; + snprintf( log_id_string, sizeof(log_id_string), "m%d", id ); + + zmLoadConfig(); + + logInit( "zmf" ); + + ssedetect(); + + Monitor *monitor = Monitor::Load( id, false, Monitor::QUERY ); + + if ( !monitor ) + { + fprintf( stderr, "Can't find monitor with id of %d\n", id ); + exit( -1 ); + } + + char capt_path[PATH_MAX]; + char anal_path[PATH_MAX]; + snprintf( capt_path, sizeof(capt_path), "%s/%d/%%s/%%0%dd-capture.jpg", config.dir_events, monitor->Id(), config.event_image_digits ); + snprintf( anal_path, sizeof(anal_path), "%s/%d/%%s/%%0%dd-analyse.jpg", config.dir_events, monitor->Id(), config.event_image_digits ); + zmSetDefaultTermHandler(); + zmSetDefaultDieHandler(); + + sigset_t block_set; + sigemptyset( &block_set ); + + int sd = OpenSocket( monitor->Id() ); + + FrameHeader frame_header = { 0, 0, false, 0 }; + //unsigned char *image_data = 0; + + fd_set rfds; + + struct timeval timeout; + timeout.tv_sec = 1; + timeout.tv_usec = 0; + while( 1 ) + { + struct timeval temp_timeout = timeout; + + FD_ZERO(&rfds); + FD_SET(sd, &rfds); + int n_found = select( sd+1, &rfds, NULL, NULL, &temp_timeout ); + if( n_found == 0 ) + { + Debug( 1, "Select timed out" ); + continue; + } + else if ( n_found < 0) + { + Error( "Select error: %s", strerror(errno) ); + ReopenSocket( sd, monitor->Id() ); + continue; + } + + sigprocmask( SIG_BLOCK, &block_set, 0 ); + + int n_bytes = read( sd, &frame_header, sizeof(frame_header) ); + if ( n_bytes != sizeof(frame_header) ) + { + if ( n_bytes < 0 ) + { + Error( "Can't read frame header: %s", strerror(errno) ); + } + else if ( n_bytes > 0 ) + { + Error( "Incomplete read of frame header, %d bytes only", n_bytes ); + } + else + { + Warning( "Socket closed at remote end" ); + } + ReopenSocket( sd, monitor->Id() ); + continue; + } + Debug( 1, "Read frame header, expecting %ld bytes of image", frame_header.image_length ); + static unsigned char image_data[ZM_MAX_IMAGE_SIZE]; + n_bytes = read( sd, image_data, frame_header.image_length ); + if ( n_bytes != (ssize_t)frame_header.image_length ) + { + if ( n_bytes < 0 ) + { + Error( "Can't read frame image data: %s", strerror(errno) ); + } + else if ( n_bytes > 0 ) + { + Error( "Incomplete read of frame image data, %d bytes only", n_bytes ); + } + else + { + Warning( "Socket closed at remote end" ); + } + ReopenSocket( sd, monitor->Id() ); + continue; + } + static char subpath[PATH_MAX] = ""; + if ( config.use_deep_storage ) + { + struct tm *time = localtime( &frame_header.event_time ); + snprintf( subpath, sizeof(subpath), "%02d/%02d/%02d/%02d/%02d/%02d", time->tm_year-100, time->tm_mon+1, time->tm_mday, time->tm_hour, time->tm_min, time->tm_sec ); + } + else + { + snprintf( subpath, sizeof(subpath), "%ld", frame_header.event_id ); + } + static char path[PATH_MAX] = ""; + snprintf( path, sizeof(path), frame_header.alarm_frame?anal_path:capt_path, subpath, frame_header.frame_id ); + Debug( 1, "Got image, writing to %s", path ); + + FILE *fd = 0; + if ( (fd = fopen( path, "w" )) < 0 ) + { + Error( "Can't fopen '%s': %s", path, strerror(errno) ); + exit( -1 ); + } + if ( 0 == fwrite( image_data, frame_header.image_length, 1, fd ) ) + { + Error( "Can't fwrite image data: %s", strerror(errno) ); + exit( -1 ); + } + fclose( fd ); + + sigprocmask( SIG_UNBLOCK, &block_set, 0 ); + } +} diff --git a/src/zmf.h b/src/zmf.h new file mode 100644 index 000000000..f00ffa891 --- /dev/null +++ b/src/zmf.h @@ -0,0 +1,32 @@ +// +// ZoneMinder Image File Write Class Interface, $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. +// + +#ifndef ZMFILE_H +#define ZMFILE_H + +struct FrameHeader +{ + unsigned long event_id; + time_t event_time; + unsigned long frame_id; + bool alarm_frame; + unsigned long image_length; +}; + +#endif // ZMFILE_H diff --git a/src/zmfix.cpp b/src/zmfix.cpp new file mode 100644 index 000000000..2d3be8756 --- /dev/null +++ b/src/zmfix.cpp @@ -0,0 +1,205 @@ +// +// ZoneMinder Video Device Fixer, $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. +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "zm.h" +#include "zm_db.h" + +// Determine if we are a member of the group +int inGroup( gid_t gid ) +{ + // Get how many groups we are in + int n_gids = getgroups( 0, NULL ); + if ( n_gids < 0 ) + { + Error( "getgroups:%s", strerror(errno) ); + return( -1 ); + } + + // Not in any groups + if ( !n_gids ) + { + return( 0 ); + } + + // Allocate space to hold groups + gid_t *gids = new gid_t[n_gids * sizeof(gid_t)]; + if ( !gids ) + { + Error( "Unable to allocate groups: %s", strerror(errno) ); + return( -1 ); + } + + // Get list of groups + if ( getgroups( n_gids, gids ) != n_gids ) + { + Error( "getgroups:%s", strerror(errno) ); + delete[] gids; + return( -1 ); + } + + // See if gid in list of groups we belong to + int in_gid = 0; + for ( int i = 0; i < n_gids; i++ ) + { + if ( gids[i] == gid ) + { + in_gid = 1; + } + } + delete[] gids; + return( in_gid ); +} + +bool fixDevice( const char *device_path ) +{ + struct stat stat_buf; + + if ( stat( device_path, &stat_buf ) < 0 ) + { + Error( "Can't stat %s: %s", device_path, strerror(errno)); + return( false ); + } + + uid_t uid = getuid(); + gid_t gid = getgid(); + + int in_gid; + if ( (in_gid = inGroup( stat_buf.st_gid )) < 0 ) + { + return( false ); + } + + mode_t mask = 0; + if ( uid == stat_buf.st_uid ) + { + // If we are the owner + mask = 00600; + } + else if ( gid == stat_buf.st_gid || in_gid ) + { + // If we are in the owner group + mask = 00060; + } + else + { + // We are neither the owner nor in the group + mask = 00006; + } + + mode_t mode = stat_buf.st_mode; + if ( (mode & mask) == mask ) + { + Debug( 1, "Permissions on %s are ok at %o", device_path, mode ); + return( true ); + } + mode |= mask; + + Info( "Resetting permissions on %s to %o", device_path, mode ); + if ( chmod( device_path, mode ) < 0 ) + { + Error( "Can't chmod %s to %o: %s", device_path, mode, strerror(errno)); + return( false ); + } + return( true ); +} + +int main( int argc, char *argv[] ) +{ + zmLoadConfig(); + + logInit( "zmfix" ); + logCapLevel( Logger::ERROR ); + + // Only do registered devices + static char sql[ZM_SQL_SML_BUFSIZ]; + snprintf( sql, sizeof(sql), "select distinct Device from Monitors where not isnull(Device) and Type = 'Local'" ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) + { + fixDevice( dbrow[0] ); + } + + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + // Yadda yadda + mysql_free_result( result ); + + snprintf( sql, sizeof(sql), "select distinct ControlDevice from Monitors where not isnull(ControlDevice)" ); + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) + { + fixDevice( dbrow[0] ); + } + + if ( mysql_errno( &dbconn ) ) + { + Error( "Can't fetch row: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + // Yadda yadda + mysql_free_result( result ); + + if ( config.opt_x10 ) + { + if ( config.x10_device ) + { + fixDevice( config.x10_device ); + } + } + + return( 0 ); +} diff --git a/src/zms.cpp b/src/zms.cpp new file mode 100644 index 000000000..af294cb71 --- /dev/null +++ b/src/zms.cpp @@ -0,0 +1,327 @@ +// +// ZoneMinder Streaming Server, $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. +// + +#include +#include + +#include "zm.h" +#include "zm_db.h" +#include "zm_user.h" +#include "zm_signal.h" +#include "zm_monitor.h" + +bool ValidateAccess( User *user, int mon_id ) +{ + bool allowed = true; + + if ( mon_id > 0 ) + { + if ( user->getStream() < User::PERM_VIEW ) + allowed = false; + if ( !user->canAccess( mon_id ) ) + allowed = false; + } + else + { + if ( user->getEvents() < User::PERM_VIEW ) + allowed = false; + } + if ( !allowed ) + { + Error( "Error, insufficient privileges for requested action" ); + exit( -1 ); + } + return( allowed ); +} + +int main( int argc, const char *argv[] ) +{ + srand( getpid() * time( 0 ) ); + + enum { ZMS_MONITOR, ZMS_EVENT } source = ZMS_MONITOR; + enum { ZMS_JPEG, ZMS_MPEG, ZMS_RAW, ZMS_ZIP, ZMS_SINGLE } mode = ZMS_JPEG; + char format[32] = ""; + int monitor_id = 0; + time_t event_time = 0; + int event_id = 0; + int frame_id = 1; + unsigned int scale = 100; + unsigned int rate = 100; + double maxfps = 10.0; + unsigned int bitrate = 100000; + unsigned int ttl = 0; + EventStream::StreamMode replay = EventStream::MODE_SINGLE; + char username[64] = ""; + char password[64] = ""; + char auth[64] = ""; + unsigned int connkey = 0; + unsigned int playback_buffer = 0; + + bool nph = false; + const char *basename = strrchr( argv[0], '/' ); + if (basename) //if we found a / lets skip past it + basename++; + else //argv[0] will not always contain the full path, but rather just the script name + basename = argv[0]; + const char *nph_prefix = "nph-"; + if ( basename && !strncmp( basename, nph_prefix, strlen(nph_prefix) ) ) + { + nph = true; + } + + zmLoadConfig(); + + logInit( "zms" ); + + ssedetect(); + + zmSetDefaultTermHandler(); + zmSetDefaultDieHandler(); + + const char *query = getenv( "QUERY_STRING" ); + if ( query ) + { + Debug( 1, "Query: %s", query ); + + char temp_query[1024]; + strncpy( temp_query, query, sizeof(temp_query) ); + char *q_ptr = temp_query; + char *parms[16]; // Shouldn't be more than this + int parm_no = 0; + while( (parm_no < 16) && (parms[parm_no] = strtok( q_ptr, "&" )) ) + { + parm_no++; + q_ptr = NULL; + } + + for ( int p = 0; p < parm_no; p++ ) + { + char *name = strtok( parms[p], "=" ); + char *value = strtok( NULL, "=" ); + if ( !value ) + value = (char *)""; + if ( !strcmp( name, "source" ) ) + { + source = !strcmp( value, "event" )?ZMS_EVENT:ZMS_MONITOR; + } + else if ( !strcmp( name, "mode" ) ) + { + mode = !strcmp( value, "jpeg" )?ZMS_JPEG:ZMS_MPEG; + mode = !strcmp( value, "raw" )?ZMS_RAW:mode; + mode = !strcmp( value, "zip" )?ZMS_ZIP:mode; + mode = !strcmp( value, "single" )?ZMS_SINGLE:mode; + } + else if ( !strcmp( name, "format" ) ) + strncpy( format, value, sizeof(format) ); + else if ( !strcmp( name, "monitor" ) ) + monitor_id = atoi( value ); + else if ( !strcmp( name, "time" ) ) + event_time = atoi( value ); + else if ( !strcmp( name, "event" ) ) + event_id = strtoull( value, (char **)NULL, 10 ); + else if ( !strcmp( name, "frame" ) ) + frame_id = strtoull( value, (char **)NULL, 10 ); + else if ( !strcmp( name, "scale" ) ) + scale = atoi( value ); + else if ( !strcmp( name, "rate" ) ) + rate = atoi( value ); + else if ( !strcmp( name, "maxfps" ) ) + maxfps = atof( value ); + else if ( !strcmp( name, "bitrate" ) ) + bitrate = atoi( value ); + else if ( !strcmp( name, "ttl" ) ) + ttl = atoi(value); + else if ( !strcmp( name, "replay" ) ) + { + replay = !strcmp( value, "gapless" )?EventStream::MODE_ALL_GAPLESS:EventStream::MODE_SINGLE; + replay = !strcmp( value, "all" )?EventStream::MODE_ALL:replay; + } + else if ( !strcmp( name, "connkey" ) ) + connkey = atoi(value); + else if ( !strcmp( name, "buffer" ) ) + playback_buffer = atoi(value); + else if ( config.opt_use_auth ) + { + if ( strcmp( config.auth_relay, "none" ) == 0 ) + { + if ( !strcmp( name, "user" ) ) + { + strncpy( username, value, sizeof(username) ); + } + } + else + { + //if ( strcmp( config.auth_relay, "hashed" ) == 0 ) + { + if ( !strcmp( name, "auth" ) ) + { + strncpy( auth, value, sizeof(auth) ); + } + } + //else if ( strcmp( config.auth_relay, "plain" ) == 0 ) + { + if ( !strcmp( name, "user" ) ) + { + strncpy( username, value, sizeof(username) ); + } + if ( !strcmp( name, "pass" ) ) + { + strncpy( password, value, sizeof(password) ); + } + } + } + } + } + } + + if ( config.opt_use_auth ) + { + User *user = 0; + + if ( strcmp( config.auth_relay, "none" ) == 0 ) + { + if ( *username ) + { + user = zmLoadUser( username ); + } + } + else + { + //if ( strcmp( config.auth_relay, "hashed" ) == 0 ) + { + if ( *auth ) + { + user = zmLoadAuthUser( auth, config.auth_hash_ips ); + } + } + //else if ( strcmp( config.auth_relay, "plain" ) == 0 ) + { + if ( *username && *password ) + { + user = zmLoadUser( username, password ); + } + } + } + if ( !user ) + { + Error( "Unable to authenticate user" ); + return( -1 ); + } + ValidateAccess( user, monitor_id ); + } + + setbuf( stdout, 0 ); + if ( nph ) + { + fprintf( stdout, "HTTP/1.0 200 OK\r\n" ); + } + 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"); + // Removed as causing more problems than it fixed. + //if ( !nph ) + //{ + //fprintf( stdout, "Content-Length: 0\r\n"); + //} + + if ( source == ZMS_MONITOR ) + { + MonitorStream stream; + stream.setStreamScale( scale ); + stream.setStreamReplayRate( rate ); + stream.setStreamMaxFPS( maxfps ); + stream.setStreamTTL( ttl ); + stream.setStreamQueue( connkey ); + stream.setStreamBuffer( playback_buffer ); + stream.setStreamStart( monitor_id ); + + if ( mode == ZMS_JPEG ) + { + stream.setStreamType( MonitorStream::STREAM_JPEG ); + } + else if ( mode == ZMS_RAW ) + { + stream.setStreamType( MonitorStream::STREAM_RAW ); + } + else if ( mode == ZMS_ZIP ) + { + stream.setStreamType( MonitorStream::STREAM_ZIP ); + } + else if ( mode == ZMS_SINGLE ) + { + stream.setStreamType( MonitorStream::STREAM_SINGLE ); + } + else + { +#if HAVE_LIBAVCODEC + stream.setStreamFormat( format ); + stream.setStreamBitrate( bitrate ); + stream.setStreamType( MonitorStream::STREAM_MPEG ); +#else // HAVE_LIBAVCODEC + Error( "MPEG streaming of '%s' attempted while disabled", query ); + fprintf( stderr, "MPEG streaming is disabled.\nYou should configure with the --with-ffmpeg option and rebuild to use this functionality.\n" ); + return( -1 ); +#endif // HAVE_LIBAVCODEC + } + stream.runStream(); + } + else if ( source == ZMS_EVENT ) + { + EventStream stream; + stream.setStreamScale( scale ); + stream.setStreamReplayRate( rate ); + stream.setStreamMaxFPS( maxfps ); + stream.setStreamMode( replay ); + stream.setStreamQueue( connkey ); + if ( monitor_id && event_time ) + { + stream.setStreamStart( monitor_id, event_time ); + } + else + { + stream.setStreamStart( event_id, frame_id ); + } + if ( mode == ZMS_JPEG ) + { + stream.setStreamType( EventStream::STREAM_JPEG ); + } + else + { +#if HAVE_LIBAVCODEC + stream.setStreamFormat( format ); + stream.setStreamBitrate( bitrate ); + stream.setStreamType( EventStream::STREAM_MPEG ); +#else // HAVE_LIBAVCODEC + Error( "MPEG streaming of '%s' attempted while disabled", query ); + fprintf( stderr, "MPEG streaming is disabled.\nYou should ensure the ffmpeg libraries are installed and detected and rebuild to use this functionality.\n" ); + return( -1 ); +#endif // HAVE_LIBAVCODEC + } + stream.runStream(); + } + return( 0 ); +} diff --git a/src/zmstreamer.cpp b/src/zmstreamer.cpp new file mode 100644 index 000000000..26384412a --- /dev/null +++ b/src/zmstreamer.cpp @@ -0,0 +1,195 @@ +// +// 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. + +#include +#include + +#include +#include + +#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:?" + +// 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) { + // 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 'i': + case '?': + printf("-e : Specify output mode: mpeg/jpg/zip/single/raw. Default = %s\n", ZMS_DEFAULT_MODE); + printf("-o : Specify output format. Default = %s\n", ZMS_DEFAULT_FORMAT); + printf("-u : Specify buffer size in ms. Default = %d\n", ZMS_DEFAULT_BUFFER); + printf("-f : Specify maximum framerate. Default = %lf\n", ZMS_DEFAULT_FPS); + printf("-s : Specify scale. Default = %d\n", ZMS_DEFAULT_SCALE); + printf("-b : Specify bitrate. Default = %d\n", ZMS_DEFAULT_BITRATE); + printf("-m : Specify monitor id. Default = %d\n", ZMS_DEFAULT_ID); + printf("-d : 0 = off, 1 = no streaming, 2 = with streaming. Default = 0\n"); + printf("-i or -? : This information\n"); + return EXIT_SUCCESS; + } + } + + // 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"); + 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"); + + return (EXIT_SUCCESS); +} diff --git a/src/zmu.cpp b/src/zmu.cpp new file mode 100644 index 000000000..49efafd05 --- /dev/null +++ b/src/zmu.cpp @@ -0,0 +1,751 @@ +// +// ZoneMinder Control Utility, $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. +// + +#include + +#include "zm.h" +#include "zm_db.h" +#include "zm_user.h" +#include "zm_signal.h" +#include "zm_monitor.h" +#include "zm_local_camera.h" + +void Usage( int status=-1 ) +{ + fprintf( stderr, "zmu <-d device_path> [-v] [function] [-U -P]\n" ); + fprintf( stderr, "zmu <-m monitor_id> [-v] [function] [-U -P]\n" ); + fprintf( stderr, "General options:\n" ); + fprintf( stderr, " -h, --help : This screen\n" ); + fprintf( stderr, " -v, --verbose : Produce more verbose output\n" ); + fprintf( stderr, " -l, --list : List the current status of active (or all with -v) monitors\n" ); + fprintf( stderr, "Options for use with devices:\n" ); + fprintf( stderr, " -d, --device [device_path] : Get the current video device settings for [device_path] or all devices\n" ); + fprintf( stderr, " -V, --version : Set the Video 4 Linux API version to use for the query, use 1 or 2\n" ); + fprintf( stderr, " -q, --query : Query the current settings for the device\n" ); + fprintf( stderr, "Options for use with monitors:\n" ); + fprintf( stderr, " -m, --monitor : Specify which monitor to address, default 1 if absent\n" ); + fprintf( stderr, " -q, --query : Query the current settings for the monitor\n" ); + fprintf( stderr, " -s, --state : Output the current monitor state, 0 = idle, 1 = prealarm, 2 = alarm,\n" ); + fprintf( stderr, " 3 = alert, 4 = tape\n" ); + fprintf( stderr, " -B, --brightness [value] : Output the current brightness, set to value if given \n" ); + fprintf( stderr, " -C, --contrast [value] : Output the current contrast, set to value if given \n" ); + fprintf( stderr, " -H, --hue [value] : Output the current hue, set to value if given \n" ); + fprintf( stderr, " -O, --colour [value] : Output the current colour, set to value if given \n" ); + fprintf( stderr, " -i, --image [image_index] : Write captured image to disk as .jpg, last image captured\n" ); + fprintf( stderr, " or specified ring buffer index if given.\n" ); + fprintf( stderr, " -S, --scale : With --image specify any scaling (in %%) to be applied to the image\n" ); + fprintf( stderr, " -t, --timestamp [image_index] : Output captured image timestamp, last image captured or specified\n" ); + fprintf( stderr, " ring buffer index if given\n" ); + fprintf( stderr, " -R, --read_index : Output ring buffer read index\n" ); + fprintf( stderr, " -W, --write_index : Output ring buffer write index\n" ); + fprintf( stderr, " -e, --event : Output last event index\n" ); + fprintf( stderr, " -f, --fps : Output last Frames Per Second captured reading\n" ); + fprintf( stderr, " -z, --zones : Write last captured image overlaid with zones to -Zones.jpg\n" ); + fprintf( stderr, " -a, --alarm : Force alarm in monitor, this will trigger recording until cancelled with -c\n" ); + fprintf( stderr, " -n, --noalarm : Force no alarms in monitor, this will prevent alarms until cancelled with -c\n" ); + fprintf( stderr, " -c, --cancel : Cancel a forced alarm/noalarm in monitor, required after being enabled with -a or -n\n" ); + fprintf( stderr, " -L, --reload : Signal monitor to reload settings\n" ); + fprintf( stderr, " -E, --enable : Enable detection, wake monitor up\n" ); + fprintf( stderr, " -D, --disable : Disable detection, put monitor to sleep\n" ); + fprintf( stderr, " -u, --suspend : Suspend detection, useful to prevent bogus alarms when panning etc\n" ); + fprintf( stderr, " -r, --resume : Resume detection after a suspend\n" ); + fprintf( stderr, " -U, --username : When running in authenticated mode the username and\n" ); + fprintf( stderr, " -P, --password : password combination of the given user\n" ); + fprintf( stderr, " -A, --auth : Pass authentication hash string instead of user details\n" ); + + exit( status ); +} + +typedef enum { + ZMU_BOGUS = 0x00000000, + ZMU_STATE = 0x00000001, + ZMU_IMAGE = 0x00000002, + ZMU_TIME = 0x00000004, + ZMU_READ_IDX = 0x00000008, + ZMU_WRITE_IDX = 0x00000010, + ZMU_EVENT = 0x00000020, + ZMU_FPS = 0x00000040, + ZMU_ZONES = 0x00000080, + ZMU_ALARM = 0x00000100, + ZMU_NOALARM = 0x00000200, + ZMU_CANCEL = 0x00000400, + ZMU_QUERY = 0x00000800, + ZMU_BRIGHTNESS = 0x00001000, + ZMU_CONTRAST = 0x00002000, + ZMU_HUE = 0x00004000, + ZMU_COLOUR = 0x00008000, + ZMU_RELOAD = 0x00010000, + ZMU_ENABLE = 0x00100000, + ZMU_DISABLE = 0x00200000, + ZMU_SUSPEND = 0x00400000, + ZMU_RESUME = 0x00800000, + ZMU_LIST = 0x10000000, +} Function; + +bool ValidateAccess( User *user, int mon_id, int function ) +{ + bool allowed = true; + if ( function & (ZMU_STATE|ZMU_IMAGE|ZMU_TIME|ZMU_READ_IDX|ZMU_WRITE_IDX|ZMU_FPS) ) + { + if ( user->getStream() < User::PERM_VIEW ) + allowed = false; + } + if ( function & ZMU_EVENT ) + { + if ( user->getEvents() < User::PERM_VIEW ) + allowed = false; + } + if ( function & (ZMU_ZONES|ZMU_QUERY|ZMU_LIST) ) + { + if ( user->getMonitors() < User::PERM_VIEW ) + allowed = false; + } + if ( function & (ZMU_ALARM|ZMU_NOALARM|ZMU_CANCEL|ZMU_RELOAD|ZMU_ENABLE|ZMU_DISABLE|ZMU_SUSPEND|ZMU_RESUME|ZMU_BRIGHTNESS|ZMU_CONTRAST|ZMU_HUE|ZMU_COLOUR) ) + { + if ( user->getMonitors() < User::PERM_EDIT ) + allowed = false; + } + if ( mon_id > 0 ) + { + if ( !user->canAccess( mon_id ) ) + { + allowed = false; + } + } + if ( !allowed ) + { + fprintf( stderr, "Error, insufficient privileges for requested action\n" ); + exit( -1 ); + } + return( allowed ); +} + +int main( int argc, char *argv[] ) +{ + srand( getpid() * time( 0 ) ); + + static struct option long_options[] = { + {"device", 2, 0, 'd'}, + {"monitor", 1, 0, 'm'}, + {"verbose", 0, 0, 'v'}, + {"image", 2, 0, 'i'}, + {"scale", 1, 0, 'S'}, + {"timestamp", 2, 0, 't'}, + {"state", 0, 0, 's'}, + {"brightness", 2, 0, 'B'}, + {"contrast", 2, 0, 'C'}, + {"hue", 2, 0, 'H'}, + {"contrast", 2, 0, 'O'}, + {"read_index", 0, 0, 'R'}, + {"write_index", 0, 0, 'W'}, + {"event", 0, 0, 'e'}, + {"fps", 0, 0, 'f'}, + {"zones", 2, 0, 'z'}, + {"alarm", 0, 0, 'a'}, + {"noalarm", 0, 0, 'n'}, + {"cancel", 0, 0, 'c'}, + {"reload", 0, 0, 'L'}, + {"enable", 0, 0, 'E'}, + {"disable", 0, 0, 'D'}, + {"suspend", 0, 0, 'u'}, + {"resume", 0, 0, 'r'}, + {"query", 0, 0, 'q'}, + {"username", 1, 0, 'U'}, + {"password", 1, 0, 'P'}, + {"auth", 1, 0, 'A'}, + {"version", 1, 0, 'V'}, + {"help", 0, 0, 'h'}, + {"list", 0, 0, 'l'}, + {0, 0, 0, 0} + }; + + const char *device = 0; + int mon_id = 0; + bool verbose = false; + int function = ZMU_BOGUS; + + int image_idx = -1; + int scale = -1; + int brightness = -1; + int contrast = -1; + int hue = -1; + int colour = -1; + char *zoneString = 0; + char *username = 0; + char *password = 0; + char *auth = 0; +#if ZM_HAS_V4L +#if ZM_HAS_V4L2 + int v4lVersion = 2; +#elif ZM_HAS_V4L1 + int v4lVersion = 1; +#endif // ZM_HAS_V4L2/1 +#endif // ZM_HAS_V4L + while (1) + { + int option_index = 0; + + int c = getopt_long (argc, argv, "d:m:vsEDLurwei::S:t::fz::ancqhlB::C::H::O::U:P:A:V:", long_options, &option_index); + if (c == -1) + { + break; + } + + switch (c) + { + case 'd': + if ( optarg ) + device = optarg; + break; + case 'm': + mon_id = atoi(optarg); + break; + case 'v': + verbose = true; + break; + case 's': + function |= ZMU_STATE; + break; + case 'i': + function |= ZMU_IMAGE; + if ( optarg ) + image_idx = atoi( optarg ); + break; + case 'S': + scale = atoi(optarg); + break; + case 't': + function |= ZMU_TIME; + if ( optarg ) + image_idx = atoi( optarg ); + break; + case 'R': + function |= ZMU_READ_IDX; + break; + case 'W': + function |= ZMU_WRITE_IDX; + break; + case 'e': + function |= ZMU_EVENT; + break; + case 'f': + function |= ZMU_FPS; + break; + case 'z': + function |= ZMU_ZONES; + if ( optarg ) + zoneString = optarg; + break; + case 'a': + function |= ZMU_ALARM; + break; + case 'n': + function |= ZMU_NOALARM; + break; + case 'c': + function |= ZMU_CANCEL; + break; + case 'L': + function |= ZMU_RELOAD; + break; + case 'E': + function |= ZMU_ENABLE; + break; + case 'D': + function |= ZMU_DISABLE; + break; + case 'u': + function |= ZMU_SUSPEND; + break; + case 'r': + function |= ZMU_RESUME; + break; + case 'q': + function |= ZMU_QUERY; + break; + case 'B': + function |= ZMU_BRIGHTNESS; + if ( optarg ) + brightness = atoi( optarg ); + break; + case 'C': + function |= ZMU_CONTRAST; + if ( optarg ) + contrast = atoi( optarg ); + break; + case 'H': + function |= ZMU_HUE; + if ( optarg ) + hue = atoi( optarg ); + break; + case 'O': + function |= ZMU_COLOUR; + if ( optarg ) + colour = atoi( optarg ); + break; + case 'U': + username = optarg; + break; + case 'P': + password = optarg; + break; + case 'A': + auth = optarg; + break; +#if ZM_HAS_V4L + case 'V': + v4lVersion = (atoi(optarg)==1)?1:2; + break; +#endif // ZM_HAS_V4L + case 'h': + Usage( 0 ); + break; + case 'l': + function |= ZMU_LIST; + break; + case '?': + Usage(); + break; + default: + //fprintf( stderr, "?? getopt returned character code 0%o ??\n", c ); + break; + } + } + + if (optind < argc) + { + fprintf( stderr, "Extraneous options, " ); + while (optind < argc) + fprintf( stderr, "%s ", argv[optind++]); + fprintf( stderr, "\n"); + Usage(); + } + + if ( device && !(function&ZMU_QUERY) ) + { + fprintf( stderr, "Error, -d option cannot be used with this option\n" ); + Usage(); + } + if ( scale != -1 && !(function&ZMU_IMAGE) ) + { + fprintf( stderr, "Error, -S option cannot be used with this option\n" ); + Usage(); + } + //printf( "Monitor %d, Function %d\n", mon_id, function ); + + zmLoadConfig(); + + logInit( "zmu" ); + + zmSetDefaultTermHandler(); + zmSetDefaultDieHandler(); + + User *user = 0; + + if ( config.opt_use_auth ) + { + if ( strcmp( config.auth_relay, "none" ) == 0 ) + { + if ( !username ) + { + fprintf( stderr, "Error, username must be supplied\n" ); + exit( -1 ); + } + + if ( username ) + { + user = zmLoadUser( username ); + } + } + else + { + if ( !(username && password) && !auth ) + { + fprintf( stderr, "Error, username and password or auth string must be supplied\n" ); + exit( -1 ); + } + + //if ( strcmp( config.auth_relay, "hashed" ) == 0 ) + { + if ( auth ) + { + user = zmLoadAuthUser( auth, false ); + } + } + //else if ( strcmp( config.auth_relay, "plain" ) == 0 ) + { + if ( username && password ) + { + user = zmLoadUser( username, password ); + } + } + } + if ( !user ) + { + fprintf( stderr, "Error, unable to authenticate user\n" ); + exit( -1 ); + } + ValidateAccess( user, mon_id, function ); + } + + + if ( mon_id > 0 ) + { + Monitor *monitor = Monitor::Load( mon_id, function&(ZMU_QUERY|ZMU_ZONES), Monitor::QUERY ); + if ( monitor ) + { + if ( verbose ) + { + printf( "Monitor %d(%s)\n", monitor->Id(), monitor->Name() ); + } + char separator = ' '; + bool have_output = false; + if ( function & ZMU_STATE ) + { + Monitor::State state = monitor->GetState(); + if ( verbose ) + printf( "Current state: %s\n", state==Monitor::ALARM?"Alarm":(state==Monitor::ALERT?"Alert":"Idle") ); + else + { + if ( have_output ) printf( "%c", separator ); + printf( "%d", state ); + have_output = true; + } + } + if ( function & ZMU_TIME ) + { + struct timeval timestamp = monitor->GetTimestamp( image_idx ); + if ( verbose ) + { + char timestamp_str[64] = "None"; + if ( timestamp.tv_sec ) + strftime( timestamp_str, sizeof(timestamp_str), "%Y-%m-%d %H:%M:%S", localtime( ×tamp.tv_sec ) ); + if ( image_idx == -1 ) + printf( "Time of last image capture: %s.%02ld\n", timestamp_str, timestamp.tv_usec/10000 ); + else + printf( "Time of image %d capture: %s.%02ld\n", image_idx, timestamp_str, timestamp.tv_usec/10000 ); + } + else + { + if ( have_output ) printf( "%c", separator ); + printf( "%ld.%02ld", timestamp.tv_sec, timestamp.tv_usec/10000 ); + have_output = true; + } + } + if ( function & ZMU_READ_IDX ) + { + if ( verbose ) + printf( "Last read index: %d\n", monitor->GetLastReadIndex() ); + else + { + if ( have_output ) printf( "%c", separator ); + printf( "%d", monitor->GetLastReadIndex() ); + have_output = true; + } + } + if ( function & ZMU_WRITE_IDX ) + { + if ( verbose ) + printf( "Last write index: %d\n", monitor->GetLastWriteIndex() ); + else + { + if ( have_output ) printf( "%c", separator ); + printf( "%d", monitor->GetLastWriteIndex() ); + have_output = true; + } + } + if ( function & ZMU_EVENT ) + { + if ( verbose ) + printf( "Last event id: %d\n", monitor->GetLastEvent() ); + else + { + if ( have_output ) printf( "%c", separator ); + printf( "%d", monitor->GetLastEvent() ); + have_output = true; + } + } + if ( function & ZMU_FPS ) + { + if ( verbose ) + printf( "Current capture rate: %.2f frames per second\n", monitor->GetFPS() ); + else + { + if ( have_output ) printf( "%c", separator ); + printf( "%.2f", monitor->GetFPS() ); + have_output = true; + } + } + if ( function & ZMU_IMAGE ) + { + if ( verbose ) + { + if ( image_idx == -1 ) + printf( "Dumping last image captured to Monitor%d.jpg", monitor->Id() ); + else + printf( "Dumping buffer image %d to Monitor%d.jpg", image_idx, monitor->Id() ); + if ( scale != -1 ) + printf( ", scaling by %d%%", scale ); + printf( "\n" ); + } + monitor->GetImage( image_idx, scale>0?scale:100 ); + } + if ( function & ZMU_ZONES ) + { + if ( verbose ) + printf( "Dumping zone image to Zones%d.jpg\n", monitor->Id() ); + monitor->DumpZoneImage( zoneString ); + } + if ( function & ZMU_ALARM ) + { + if ( verbose ) + printf( "Forcing alarm on\n" ); + monitor->ForceAlarmOn( config.forced_alarm_score, "Forced Web" ); + } + if ( function & ZMU_NOALARM ) + { + if ( verbose ) + printf( "Forcing alarm off\n" ); + monitor->ForceAlarmOff(); + } + if ( function & ZMU_CANCEL ) + { + if ( verbose ) + printf( "Cancelling forced alarm on/off\n" ); + monitor->CancelForced(); + } + if ( function & ZMU_RELOAD ) + { + if ( verbose ) + printf( "Reloading monitor settings\n" ); + monitor->actionReload(); + } + if ( function & ZMU_ENABLE ) + { + if ( verbose ) + printf( "Enabling event generation\n" ); + monitor->actionEnable(); + } + if ( function & ZMU_DISABLE ) + { + if ( verbose ) + printf( "Disabling event generation\n" ); + monitor->actionDisable(); + } + if ( function & ZMU_SUSPEND ) + { + if ( verbose ) + printf( "Suspending event generation\n" ); + monitor->actionSuspend(); + } + if ( function & ZMU_RESUME ) + { + if ( verbose ) + printf( "Resuming event generation\n" ); + monitor->actionResume(); + } + if ( function & ZMU_QUERY ) + { + char monString[16382] = ""; + monitor->DumpSettings( monString, verbose ); + printf( "%s\n", monString ); + } + if ( function & ZMU_BRIGHTNESS ) + { + if ( verbose ) + { + if ( brightness >= 0 ) + printf( "New brightness: %d\n", monitor->actionBrightness( brightness ) ); + else + printf( "Current brightness: %d\n", monitor->actionBrightness() ); + } + else + { + if ( have_output ) printf( "%c", separator ); + if ( brightness >= 0 ) + printf( "%d", monitor->actionBrightness( brightness ) ); + else + printf( "%d", monitor->actionBrightness() ); + have_output = true; + } + } + if ( function & ZMU_CONTRAST ) + { + if ( verbose ) + { + if ( contrast >= 0 ) + printf( "New brightness: %d\n", monitor->actionContrast( contrast ) ); + else + printf( "Current contrast: %d\n", monitor->actionContrast() ); + } + else + { + if ( have_output ) printf( "%c", separator ); + if ( contrast >= 0 ) + printf( "%d", monitor->actionContrast( contrast ) ); + else + printf( "%d", monitor->actionContrast() ); + have_output = true; + } + } + if ( function & ZMU_HUE ) + { + if ( verbose ) + { + if ( hue >= 0 ) + printf( "New hue: %d\n", monitor->actionHue( hue ) ); + else + printf( "Current hue: %d\n", monitor->actionHue() ); + } + else + { + if ( have_output ) printf( "%c", separator ); + if ( hue >= 0 ) + printf( "%d", monitor->actionHue( hue ) ); + else + printf( "%d", monitor->actionHue() ); + have_output = true; + } + } + if ( function & ZMU_COLOUR ) + { + if ( verbose ) + { + if ( colour >= 0 ) + printf( "New colour: %d\n", monitor->actionColour( colour ) ); + else + printf( "Current colour: %d\n", monitor->actionColour() ); + } + else + { + if ( have_output ) printf( "%c", separator ); + if ( colour >= 0 ) + printf( "%d", monitor->actionColour( colour ) ); + else + printf( "%d", monitor->actionColour() ); + have_output = true; + } + } + if ( have_output ) + { + printf( "\n" ); + } + if ( !function ) + { + Usage(); + } + delete monitor; + } + else + { + fprintf( stderr, "Error, invalid monitor id %d\n", mon_id ); + exit( -1 ); + } + } + else + { + if ( function & ZMU_QUERY ) + { +#if ZM_HAS_V4L + char vidString[0x10000] = ""; + bool ok = LocalCamera::GetCurrentSettings( device, vidString, v4lVersion, verbose ); + printf( "%s", vidString ); + exit( ok?0:-1 ); +#else // ZM_HAS_V4L + fprintf( stderr, "Error, video4linux is required for device querying\n" ); + exit( -1 ); +#endif // ZM_HAS_V4L + } + + if ( function & ZMU_LIST ) + { + char sql[ZM_SQL_SML_BUFSIZ]; + strncpy( sql, "select Id, Function+0 from Monitors", sizeof(sql) ); + if ( !verbose ) + { + strncat( sql, " where Function != 'None'", sizeof(sql)-strlen(sql) ); + } + strncat( sql, " order by Id asc", sizeof(sql)-strlen(sql) ); + + if ( mysql_query( &dbconn, sql ) ) + { + Error( "Can't run query: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + + MYSQL_RES *result = mysql_store_result( &dbconn ); + if ( !result ) + { + Error( "Can't use query result: %s", mysql_error( &dbconn ) ); + exit( mysql_errno( &dbconn ) ); + } + int n_monitors = mysql_num_rows( result ); + Debug( 1, "Got %d monitors", n_monitors ); + + printf( "%4s%5s%6s%9s%14s%6s%6s%8s%8s\n", "Id", "Func", "State", "TrgState", "LastImgTim", "RdIdx", "WrIdx", "LastEvt", "FrmRate" ); + for( int i = 0; MYSQL_ROW dbrow = mysql_fetch_row( result ); i++ ) + { + int mon_id = atoi(dbrow[0]); + int function = atoi(dbrow[1]); + if ( !user || user->canAccess( mon_id ) ) + { + if ( function > 1 ) + { + Monitor *monitor = Monitor::Load( mon_id, false, Monitor::QUERY ); + if ( monitor ) + { + struct timeval tv = monitor->GetTimestamp(); + printf( "%4d%5d%6d%9d%11ld.%02ld%6d%6d%8d%8.2f\n", + monitor->Id(), + function, + monitor->GetState(), + monitor->GetTriggerState(), + tv.tv_sec, tv.tv_usec/10000, + monitor->GetLastReadIndex(), + monitor->GetLastWriteIndex(), + monitor->GetLastEvent(), + monitor->GetFPS() + ); + delete monitor; + } + } + else + { + struct timeval tv = { 0, 0 }; + printf( "%4d%5d%6d%9d%11ld.%02ld%6d%6d%8d%8.2f\n", + mon_id, + function, + 0, + 0, + tv.tv_sec, tv.tv_usec/10000, + 0, + 0, + 0, + 0.0 + ); + } + } + } + mysql_free_result( result ); + } + } + delete user; + + return( 0 ); +} diff --git a/stamp-h.in b/stamp-h.in new file mode 100644 index 000000000..9788f7023 --- /dev/null +++ b/stamp-h.in @@ -0,0 +1 @@ +timestamp diff --git a/stamp-h1 b/stamp-h1 new file mode 100644 index 000000000..4547fe1b5 --- /dev/null +++ b/stamp-h1 @@ -0,0 +1 @@ +timestamp for config.h diff --git a/umutils/nextimeconfigure.zm b/umutils/nextimeconfigure.zm new file mode 100755 index 000000000..e2c0e2f32 --- /dev/null +++ b/umutils/nextimeconfigure.zm @@ -0,0 +1,16 @@ +#!/bin/bash + +#http://tom.webarts.ca/Blog/new-blog-items/buildingzoneminderandrequiredffmpegandx264fromsource + +export LD_LIBRARY_PATH="/usr/local/lib:/opt/libjpeg-turbo/lib:$LD_LIBRARY_PATH" +export LDFLAGS=" -L/home/nextime/zm/libjpeg-turbo-1.2.1/.libs " + + +DEB_HOST_GNU_TYPE=$(dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +CXXFLAGS=" -DZM_FFMPEG_CVS -DHAVE_LIBCRYPTO -msse2 -DJPEG_INCLUDE_DIR=/home/nextime/zm/libjpeg-turbo-1.2.1/ " +CXXFLAGS="$CXXFLAGS -I/home/nextime/zm/libjpeg-turbo-1.2.1/ " + +CXXFLAGS="$CXXFLAGS" ./configure --with-libarch=lib/$DEB_HOST_GNU_TYPE --disable-debug --host=$DEB_HOST_GNU_TYPE --build=$DEB_BUILD_GNU_TYPE --sysconfdir=/etc/zm --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-mysql=/usr --with-webdir=/usr/share/zoneminder --with-ffmpeg=/usr --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-crashtrace=no --enable-mmap=yes + diff --git a/web/Makefile.am b/web/Makefile.am new file mode 100644 index 000000000..077a4ff91 --- /dev/null +++ b/web/Makefile.am @@ -0,0 +1,35 @@ +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 ) diff --git a/web/Makefile.in b/web/Makefile.in new file mode 100644 index 000000000..8757f668c --- /dev/null +++ b/web/Makefile.in @@ -0,0 +1,685 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +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 + +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-dist_webDATA + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-dist_webDATA + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-data-am install-strip tags-recursive \ + uninstall-am + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic ctags \ + ctags-recursive distclean distclean-generic distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-data-hook \ + install-dist_webDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-dist_webDATA uninstall-hook + + +# 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 ) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/ajax/Makefile.am b/web/ajax/Makefile.am new file mode 100644 index 000000000..ef79e6cae --- /dev/null +++ b/web/ajax/Makefile.am @@ -0,0 +1,12 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/ajax + +dist_web_DATA = \ + alarm.php \ + control.php \ + event.php \ + log.php \ + status.php \ + stream.php \ + zone.php diff --git a/web/ajax/Makefile.in b/web/ajax/Makefile.in new file mode 100644 index 000000000..27c21d99f --- /dev/null +++ b/web/ajax/Makefile.in @@ -0,0 +1,459 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/ajax +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +webdir = @WEB_PREFIX@/ajax +dist_web_DATA = \ + alarm.php \ + control.php \ + event.php \ + log.php \ + status.php \ + stream.php \ + zone.php + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/ajax/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/ajax/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_webDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/ajax/alarm.php b/web/ajax/alarm.php new file mode 100644 index 000000000..b1f5f1496 --- /dev/null +++ b/web/ajax/alarm.php @@ -0,0 +1,42 @@ + diff --git a/web/ajax/control.php b/web/ajax/control.php new file mode 100644 index 000000000..227082f63 --- /dev/null +++ b/web/ajax/control.php @@ -0,0 +1,64 @@ +'.join( ' // ', $ctrlOutput ) ); + ajaxResponse( 'Used script' ); + } + } + else + { + ajaxError( "No command received" ); + } +} + +ajaxError( 'Unrecognised action or insufficient permissions' ); + +function ajaxCleanup() +{ + global $socket; + if ( !empty( $socket ) ) + @socket_close( $socket ); +} +?> diff --git a/web/ajax/event.php b/web/ajax/event.php new file mode 100644 index 000000000..bb8341727 --- /dev/null +++ b/web/ajax/event.php @@ -0,0 +1,124 @@ +$videoFile ) ); + else + ajaxError( "Video Generation Failed" ); + } + $ok = true; + break; + } + case 'deleteVideo' : + { + unlink( $videoFiles[$_REQUEST['id']] ); + unset( $videoFiles[$_REQUEST['id']] ); + ajaxResponse(); + break; + } + case "export" : + { + require_once( ZM_SKIN_PATH.'/includes/export_functions.php' ); + + if ( !empty($_REQUEST['exportDetail']) ) + $exportDetail = $_SESSION['export']['detail'] = $_REQUEST['exportDetail']; + else + $exportDetail = false; + if ( !empty($_REQUEST['exportFrames']) ) + $exportFrames = $_SESSION['export']['frames'] = $_REQUEST['exportFrames']; + else + $exportFrames = false; + if ( !empty($_REQUEST['exportImages']) ) + $exportImages = $_SESSION['export']['images'] = $_REQUEST['exportImages']; + else + $exportImages = false; + if ( !empty($_REQUEST['exportVideo']) ) + $exportVideo = $_SESSION['export']['video'] = $_REQUEST['exportVideo']; + else + $exportVideo = false; + if ( !empty($_REQUEST['exportMisc']) ) + $exportMisc = $_SESSION['export']['misc'] = $_REQUEST['exportMisc']; + else + $exportMisc = false; + if ( !empty($_REQUEST['exportFormat']) ) + $exportFormat = $_SESSION['export']['format'] = $_REQUEST['exportFormat']; + else + $exportFormat = ''; + + $exportIds = !empty($_REQUEST['eids'])?$_REQUEST['eids']:$_REQUEST['id']; + if ( $exportFile = exportEvents( $exportIds, $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc, $exportFormat ) ) + ajaxResponse( array( 'exportFile'=>$exportFile ) ); + else + ajaxError( "Export Failed" ); + break; + } + } +} + +if ( canEdit( 'Events' ) ) +{ + switch ( $_REQUEST['action'] ) + { + case "rename" : + { + if ( !empty($_REQUEST['eventName']) ) + dbQuery( "update Events set Name = '".dbEscape($_REQUEST['eventName'])."' where Id = '".dbEscape($_REQUEST['id'])."'" ); + else + ajaxError( "No new event name supplied" ); + ajaxResponse( array( 'refreshEvent'=>true, 'refreshParent'=>true ) ); + break; + } + case "eventdetail" : + { + dbQuery( "update Events set Cause = '".dbEscape($_REQUEST['newEvent']['Cause'])."', Notes = '".dbEscape($_REQUEST['newEvent']['Notes'])."' where Id = '".dbEscape($_REQUEST['id'])."'" ); + ajaxResponse( array( 'refreshEvent'=>true, 'refreshParent'=>true ) ); + break; + } + case "archive" : + case "unarchive" : + { + $archiveVal = ($_REQUEST['action'] == "archive")?1:0; + dbQuery( "update Events set Archived = ".$archiveVal." where Id = '".dbEscape($_REQUEST['id'])."'" ); + ajaxResponse( array( 'refreshEvent'=>true, 'refreshParent'=>false ) ); + break; + } + case "delete" : + { + deleteEvent( dbEscape($_REQUEST['id']) ); + ajaxResponse( array( 'refreshEvent'=>false, 'refreshParent'=>true ) ); + break; + } + } +} + +ajaxError( 'Unrecognised action or insufficient permissions' ); + +?> diff --git a/web/ajax/log.php b/web/ajax/log.php new file mode 100644 index 000000000..6dd1e0548 --- /dev/null +++ b/web/ajax/log.php @@ -0,0 +1,363 @@ + "web_js" ) ); + + $string = $_POST['message']; + $file = preg_replace( '/\w+:\/\/\w+\//', '', $_POST['file'] ); + if ( !empty( $_POST['line'] ) ) + $line = $_POST['line']; + else + $line = NULL; + + $levels = array_flip(Logger::$codes); + if ( !isset($levels[$_POST['level']]) ) + Panic( "Unexpected logger level '".$_POST['level']."'" ); + $level = $levels[$_POST['level']]; + Logger::fetch()->logPrint( $level, $string, $file, $line ); + } + ajaxResponse(); + break; + } + case 'query' : + { + if ( !canView( 'System' ) ) + ajaxError( 'Insufficient permissions to view log entries' ); + + $minTime = isset($_POST['minTime'])?$_POST['minTime']:NULL; + $maxTime = isset($_POST['maxTime'])?$_POST['maxTime']:NULL; + $limit = isset($_POST['limit'])?$_POST['limit']:1000; + $filter = isset($_POST['filter'])?$_POST['filter']:array(); + $sortField = isset($_POST['sortField'])?$_POST['sortField']:'TimeKey'; + $sortOrder = isset($_POST['sortOrder'])?$_POST['sortOrder']:'desc'; + + $filterFields = array( 'Component', 'Pid', 'Level', 'File', 'Line' ); + + //$filterSql = $filter?' where + $countSql = "select count(*) as Total from Logs"; + $total = dbFetchOne( $countSql, 'Total' ); + $sql = "select * from Logs"; + $where = array(); + if ( $minTime ) + $where[] = "TimeKey > ".dbEscape($minTime); + elseif ( $maxTime ) + $where[] = "TimeKey < ".dbEscape($maxTime); + foreach ( $filter as $field=>$value ) + if ( $field == 'Level' ) + $where[] = dbEscape($field)." <= ".dbEscape($value); + else + $where[] = dbEscape($field)." = '".dbEscape($value)."'"; + if ( count($where) ) + $sql.= " where ".join( " and ", $where ); + $sql .= " order by ".dbEscape($sortField)." ".dbEscape($sortOrder)." limit ".dbEscape($limit); + $logs = array(); + foreach ( dbFetchAll( $sql ) as $log ) + { + $log['DateTime'] = preg_replace( '/^\d+/', strftime( "%Y-%m-%d %H:%M:%S", intval($log['TimeKey']) ), $log['TimeKey'] ); + $logs[] = $log; + } + $options = array(); + $where = array(); + foreach( $filter as $field=>$value ) + if ( $field == 'Level' ) + $where[$field] = dbEscape($field)." <= ".dbEscape($value); + else + $where[$field] = dbEscape($field)." = '".dbEscape($value)."'"; + foreach( $filterFields as $field ) + { + $sql = "select distinct $field from Logs where not isnull($field)"; + $fieldWhere = array_diff_key( $where, array( $field=>true ) ); + if ( count($fieldWhere) ) + $sql.= " and ".join( " and ", $fieldWhere ); + $sql.= " order by $field asc"; + if ( $field == 'Level' ) + { + foreach( dbFetchAll( $sql, $field ) as $value ) + if ( $value <= Logger::INFO ) + $options[$field][$value] = Logger::$codes[$value]; + else + $options[$field][$value] = "DB".$value; + } + else + { + foreach( dbFetchAll( $sql, $field ) as $value ) + if ( $value != '' ) + $options[$field][] = $value; + } + } + if ( count($filter) ) + { + $sql = "select count(*) as Available from Logs where ".join( " and ", $where ); + $available = dbFetchOne( $sql, 'Available' ); + } + ajaxResponse( array( + 'updated' => preg_match( '/%/', DATE_FMT_CONSOLE_LONG )?strftime( DATE_FMT_CONSOLE_LONG ):date( DATE_FMT_CONSOLE_LONG ), + 'total' => $total, + 'available' => isset($available)?$available:$total, + 'logs' => $logs, + 'state' => logState(), + 'options' => $options + ) ); + break; + } + case 'export' : + { + if ( !canView( 'System' ) ) + ajaxError( 'Insufficient permissions to export logs' ); + + $minTime = isset($_POST['minTime'])?$_POST['minTime']:NULL; + $maxTime = isset($_POST['maxTime'])?$_POST['maxTime']:NULL; + if ( !is_null($minTime) && !is_null($maxTime) && $minTime > $maxTime ) + { + $tempTime = $minTime; + $minTime = $maxTime; + $maxTime = $tempTime; + } + //$limit = isset($_POST['limit'])?$_POST['limit']:1000; + $filter = isset($_POST['filter'])?$_POST['filter']:array(); + $sortField = isset($_POST['sortField'])?$_POST['sortField']:'TimeKey'; + $sortOrder = isset($_POST['sortOrder'])?$_POST['sortOrder']:'asc'; + + $sql = "select * from Logs"; + $where = array(); + if ( $minTime ) + { + preg_match( '/(.+)(\.\d+)/', $minTime, $matches ); + $minTime = strtotime($matches[1]).$matches[2]; + $where[] = "TimeKey >= ".$minTime; + } + if ( $maxTime ) + { + preg_match( '/(.+)(\.\d+)/', $maxTime, $matches ); + $maxTime = strtotime($matches[1]).$matches[2]; + $where[] = "TimeKey <= ".$maxTime; + } + foreach ( $filter as $field=>$value ) + if ( $value != '' ) + if ( $field == 'Level' ) + $where[] = dbEscape($field)." <= ".dbEscape($value); + else + $where[] = dbEscape($field)." = '".dbEscape($value)."'"; + if ( count($where) ) + $sql.= " where ".join( " and ", $where ); + $sql .= " order by ".dbEscape($sortField)." ".dbEscape($sortOrder); + //$sql .= " limit ".dbEscape($limit); + $format = isset($_POST['format'])?$_POST['format']:'text'; + switch( $format ) + { + case 'text' : + $exportExt = "txt"; + break; + case 'tsv' : + $exportExt = "tsv"; + break; + case 'html' : + $exportExt = "html"; + break; + case 'xml' : + $exportExt = "xml"; + break; + default : + Fatal( "Unrecognised log export format '$format'" ); + } + $exportKey = substr(md5(rand()),0,8); + $exportFile = "zm-log.$exportExt"; + $exportPath = "temp/zm-log-$exportKey.$exportExt"; + if ( !($exportFP = fopen( $exportPath, "w" )) ) + Fatal( "Unable to open log export file $exportFile" ); + $logs = array(); + foreach ( dbFetchAll( $sql ) as $log ) + { + $log['DateTime'] = preg_replace( '/^\d+/', strftime( "%Y-%m-%d %H:%M:%S", intval($log['TimeKey']) ), $log['TimeKey'] ); + $logs[] = $log; + } + switch( $format ) + { + case 'text' : + { + foreach ( $logs as $log ) + { + if ( $log['Line'] ) + fprintf( $exportFP, "%s %s[%d].%s-%s/%d [%s]\n", $log['DateTime'], $log['Component'], $log['Pid'], $log['Code'], $log['File'], $log['Line'], $log['Message'] ); + else + fprintf( $exportFP, "%s %s[%d].%s-%s [%s]\n", $log['DateTime'], $log['Component'], $log['Pid'], $log['Code'], $log['File'], $log['Message'] ); + } + break; + } + case 'tsv' : + { + fprintf( $exportFP, $SLANG['DateTime']."\t".$SLANG['Component']."\t".$SLANG['Pid']."\t".$SLANG['Level']."\t".$SLANG['Message']."\t".$SLANG['File']."\t".$SLANG['Line']."\n" ); + foreach ( $logs as $log ) + { + fprintf( $exportFP, "%s\t%s\t%d\t%s\t%s\t%s\t%s\n", $log['DateTime'], $log['Component'], $log['Pid'], $log['Code'], $log['Message'], $log['File'], $log['Line'] ); + } + break; + } + case 'html' : + { + fwrite( $exportFP, +' + + + '.$SLANG['ZoneMinderLog'].' + + + +

'.$SLANG['ZoneMinderLog'].'

+

'.htmlspecialchars(preg_match( '/%/', DATE_FMT_CONSOLE_LONG )?strftime( DATE_FMT_CONSOLE_LONG ):date( DATE_FMT_CONSOLE_LONG )).'

+

'.count($logs).' '.$SLANG['Logs'].'

+ + + +' ); + foreach ( $logs as $log ) + { + $classLevel = $log['Level']; + if ( $classLevel < Logger::FATAL ) + $classLevel = Logger::FATAL; + elseif ( $classLevel > Logger::DEBUG ) + $classLevel = Logger::DEBUG; + $logClass = 'log-'.strtolower(Logger::$codes[$classLevel]); + fprintf( $exportFP, " \n", $logClass, $log['DateTime'], $log['Component'], $log['Pid'], $log['Code'], $log['Message'], $log['File'], $log['Line'] ); + } + fwrite( $exportFP, +' +
'.$SLANG['DateTime'].''.$SLANG['Component'].''.$SLANG['Pid'].''.$SLANG['Level'].''.$SLANG['Message'].''.$SLANG['File'].''.$SLANG['Line'].'
%s%s%d%s%s%s%s
+ +' ); + break; + } + case 'xml' : + { + fwrite( $exportFP, +' + + '.$_POST['selector'].'' ); + foreach ( $filter as $field=>$value ) + if ( $value != '' ) + fwrite( $exportFP, +' + <'.strtolower($field).'>'.htmlspecialchars($value).' + ' ); + fwrite( $exportFP, +' + '.$SLANG['DateTime'].''.$SLANG['Component'].''.$SLANG['Pid'].''.$SLANG['Level'].''.$SLANG['Message'].''.$SLANG['File'].''.$SLANG['Line'].' + + +' ); + foreach ( $logs as $log ) + { + fprintf( $exportFP, +" + %s + %s + %d + %s + + %s + %d + \n", $log['DateTime'], $log['Component'], $log['Pid'], $log['Code'], utf8_decode( $log['Message'] ), $log['File'], $log['Line'] ); + } + fwrite( $exportFP, +' +' ); + break; + } + $exportExt = "xml"; + break; + } + fclose( $exportFP ); + ajaxResponse( array( + 'key' => $exportKey, + 'format' => $format, + ) ); + break; + } + case 'download' : + { + if ( !canView( 'System' ) ) + ajaxError( 'Insufficient permissions to download logs' ); + + if ( empty($_REQUEST['key']) ) + Fatal( "No log export key given" ); + $exportKey = $_REQUEST['key']; + if ( empty($_REQUEST['format']) ) + Fatal( "No log export format given" ); + $format = $_REQUEST['format']; + + switch( $format ) + { + case 'text' : + $exportExt = "txt"; + break; + case 'tsv' : + $exportExt = "tsv"; + break; + case 'html' : + $exportExt = "html"; + break; + case 'xml' : + $exportExt = "xml"; + break; + default : + Fatal( "Unrecognised log export format '$format'" ); + } + + $exportFile = "zm-log.$exportExt"; + $exportPath = "temp/zm-log-$exportKey.$exportExt"; + + header( "Pragma: public" ); + header( "Expires: 0" ); + header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" ); + header( "Cache-Control: private", false ); // required by certain browsers + header( "Content-Description: File Transfer" ); + header( 'Content-Disposition: attachment; filename="'.$exportFile.'"' ); + header( "Content-Transfer-Encoding: binary" ); + header( "Content-Type: application/force-download" ); + header( "Content-Length: ".filesize($exportPath) ); + readfile( $exportPath ); + exit( 0 ); + break; + } +} + +ajaxError( 'Unrecognised action or insufficient permissions' ); + +?> diff --git a/web/ajax/status.php b/web/ajax/status.php new file mode 100644 index 000000000..fe82fe5cc --- /dev/null +++ b/web/ajax/status.php @@ -0,0 +1,413 @@ + array( + "permission" => "System", + "table" => "Monitors", + "limit" => 1, + "elements" => array( + "MonitorCount" => array( "sql" => "count(*)" ), + "ActiveMonitorCount" => array( "sql" => "count(if(Function != 'None',1,NULL))" ), + "State" => array( "func" => "daemonCheck()?".$SLANG['Running'].":".$SLANG['Stopped'] ), + "Load" => array( "func" => "getLoad()" ), + "Disk" => array( "func" => "getDiskPercent()" ), + ), + ), + "monitor" => array( + "permission" => "Monitors", + "table" => "Monitors", + "limit" => 1, + "selector" => "Monitors.Id", + "elements" => array( + "Id" => array( "sql" => "Monitors.Id" ), + "Name" => array( "sql" => "Monitors.Name" ), + "Type" => true, + "Function" => true, + "Enabled" => true, + "LinkedMonitors" => true, + "Triggers" => true, + "Device" => true, + "Channel" => true, + "Format" => true, + "Host" => true, + "Port" => true, + "Path" => true, + "Width" => array( "sql" => "Monitors.Width" ), + "Height" => array( "sql" => "Monitors.Height" ), + "Palette" => true, + "Orientation" => true, + "Brightness" => true, + "Contrast" => true, + "Hue" => true, + "Colour" => true, + "EventPrefix" => true, + "LabelFormat" => true, + "LabelX" => true, + "LabelY" => true, + "ImageBufferCount" => true, + "WarmupCount" => true, + "PreEventCount" => true, + "PostEventCount" => true, + "AlarmFrameCount" => true, + "SectionLength" => true, + "FrameSkip" => true, + "MaxFPS" => true, + "AlarmMaxFPS" => true, + "FPSReportInterval" => true, + "RefBlendPerc" => true, + "Controllable" => true, + "ControlId" => true, + "ControlDevice" => true, + "ControlAddress" => true, + "AutoStopTimeout" => true, + "TrackMotion" => true, + "TrackDelay" => true, + "ReturnLocation" => true, + "ReturnDelay" => true, + "DefaultView" => true, + "DefaultRate" => true, + "DefaultScale" => true, + "WebColour" => true, + "Sequence" => true, + "MinEventId" => array( "sql" => "min(Events.Id)", "table" => "Events", "join" => "Events.MonitorId = Monitors.Id", "group" => "Events.MonitorId" ), + "MaxEventId" => array( "sql" => "max(Events.Id)", "table" => "Events", "join" => "Events.MonitorId = Monitors.Id", "group" => "Events.MonitorId" ), + "TotalEvents" => array( "sql" => "count(Events.Id)", "table" => "Events", "join" => "Events.MonitorId = Monitors.Id", "group" => "Events.MonitorId" ), + "Status" => array( "zmu" => "-m ".escapeshellarg($_REQUEST['id'][0])." -s" ), + "FrameRate" => array( "zmu" => "-m ".escapeshellarg($_REQUEST['id'][0])." -f" ), + ), + ), + "events" => array( + "permission" => "Events", + "table" => "Events", + "selector" => "Events.MonitorId", + "elements" => array( + "Id" => true, + "Name" => true, + "Cause" => true, + "Notes" => true, + "StartTime" => true, + "StartTimeShort" => array( "sql" => "date_format( StartTime, '".MYSQL_FMT_DATETIME_SHORT."' )" ), + "EndTime" => true, + "Width" => true, + "Height" => true, + "Length" => true, + "Frames" => true, + "AlarmFrames" => true, + "TotScore" => true, + "AvgScore" => true, + "MaxScore" => true, + ), + ), + "event" => array( + "permission" => "Events", + "table" => "Events", + "limit" => 1, + "selector" => "Events.Id", + "elements" => array( + "Id" => array( "sql" => "Events.Id" ), + "MonitorId" => true, + "Name" => true, + "Cause" => true, + "StartTime" => true, + "StartTimeShort" => array( "sql" => "date_format( StartTime, '".MYSQL_FMT_DATETIME_SHORT."' )" ), + "EndTime" => true, + "Width" => true, + "Height" => true, + "Length" => true, + "Frames" => true, + "AlarmFrames" => true, + "TotScore" => true, + "AvgScore" => true, + "MaxScore" => true, + "Archived" => true, + "Videoed" => true, + "Uploaded" => true, + "Emailed" => true, + "Messaged" => true, + "Executed" => true, + "Notes" => true, + "MinFrameId" => array( "sql" => "min(Frames.FrameId)", "table" => "Frames", "join" => "Events.Id = Frames.EventId", "group" => "Frames.EventId" ), + "MaxFrameId" => array( "sql" => "max(Frames.FrameId)", "table" => "Frames", "join" => "Events.Id = Frames.EventId", "group" => "Frames.EventId" ), + "MinFrameDelta" => array( "sql" => "min(Frames.Delta)", "table" => "Frames", "join" => "Events.Id = Frames.EventId", "group" => "Frames.EventId" ), + "MaxFrameDelta" => array( "sql" => "max(Frames.Delta)", "table" => "Frames", "join" => "Events.Id = Frames.EventId", "group" => "Frames.EventId" ), + //"Path" => array( "postFunc" => "getEventPath" ), + ), + ), + "frame" => array( + "permission" => "Events", + "table" => "Frames", + "limit" => 1, + "selector" => array( array( "table" => "Events", "join" => "Events.Id = Frames.EventId", "selector"=>"Events.Id" ), "Frames.FrameId" ), + "elements" => array( + //"Id" => array( "sql" => "Frames.FrameId" ), + "FrameId" => true, + "EventId" => true, + "Type" => true, + "TimeStamp" => true, + "TimeStampShort" => array( "sql" => "date_format( StartTime, '".MYSQL_FMT_DATETIME_SHORT."' )" ), + "Delta" => true, + "Score" => true, + //"Image" => array( "postFunc" => "getFrameImage" ), + ), + ), + "frameimage" => array( + "permission" => "Events", + "func" => "getFrameImage()" + ), + "nearframe" => array( + "permission" => "Events", + "func" => "getNearFrame()" + ), + "nearevents" => array( + "permission" => "Events", + "func" => "getNearEvents()" + ) +); + +function collectData() +{ + global $statusData; + + $entitySpec = &$statusData[strtolower(validJsStr($_REQUEST['entity']))]; + #print_r( $entitySpec ); + if ( !canView( $entitySpec['permission'] ) ) + ajaxError( 'Unrecognised action or insufficient permissions' ); + + if ( !empty($entitySpec['func']) ) + { + $data = eval( "return( ".$entitySpec['func']." );" ); + } + else + { + $data = array(); + $postFuncs = array(); + + $fieldSql = array(); + $joinSql = array(); + $groupSql = array(); + + $elements = &$entitySpec['elements']; + $lc_elements = array_change_key_case( $elements ); + + $id = false; + if ( isset($_REQUEST['id']) ) + if ( !is_array($_REQUEST['id']) ) + $id = array( validJsStr($_REQUEST['id']) ); + else + $id = array_values( $_REQUEST['id'] ); + + if ( !isset($_REQUEST['element']) ) + $_REQUEST['element'] = array_keys( $elements ); + else if ( !is_array($_REQUEST['element']) ) + $_REQUEST['element'] = array( validJsStr($_REQUEST['element']) ); + + if ( isset($entitySpec['selector']) ) + { + if ( !is_array($entitySpec['selector']) ) + $entitySpec['selector'] = array( $entitySpec['selector'] ); + foreach( $entitySpec['selector'] as $selector ) + if ( is_array( $selector ) && isset($selector['table']) && isset($selector['join']) ) + $joinSql[] = "left join ".$selector['table']." on ".$selector['join']; + } + + foreach ( $_REQUEST['element'] as $element ) + { + if ( !($elementData = $lc_elements[strtolower($element)]) ) + ajaxError( "Bad ".validJsStr($_REQUEST['entity'])." element ".$element ); + if ( isset($elementData['func']) ) + $data[$element] = eval( "return( ".$elementData['func']." );" ); + else if ( isset($elementData['postFunc']) ) + $postFuncs[$element] = $elementData['postFunc']; + else if ( isset($elementData['zmu']) ) + $data[$element] = exec( escapeshellcmd( getZmuCommand( " ".$elementData['zmu'] ) ) ); + else + { + if ( isset($elementData['sql']) ) + $fieldSql[] = $elementData['sql']." as ".$element; + else + $fieldSql[] = $element; + if ( isset($elementData['table']) && isset($elementData['join']) ) + { + $joinSql[] = "left join ".$elementData['table']." on ".$elementData['join']; + } + if ( isset($elementData['group']) ) + { + $groupSql[] = $elementData['group']; + } + } + } + + if ( count($fieldSql) ) + { + $sql = "select ".join( ", ", $fieldSql )." from ".$entitySpec['table']; + if ( $joinSql ) + $sql .= " ".join( " ", array_unique( $joinSql ) ); + if ( $id && !empty($entitySpec['selector']) ) + { + $index = 0; + $where = array(); + foreach( $entitySpec['selector'] as $selector ) + { + if ( is_array( $selector ) ) + $where[] = $selector['selector']." = ".dbEscape($id[$index]); + else + $where[] = $selector." = ".dbEscape($id[$index]); + $index++; + } + $sql .= " where ".join( " and ", $where ); + } + if ( $groupSql ) + $sql .= " group by ".join( ",", array_unique( $groupSql ) ); + if ( !empty($_REQUEST['sort']) ) + $sql .= " order by ".dbEscape($_REQUEST['sort']); + if ( !empty($entitySpec['limit']) ) + $limit = $entitySpec['limit']; + elseif ( !empty($_REQUEST['count']) ) + $limit = dbEscape($_REQUEST['count']); + if ( !empty( $limit ) ) + $sql .= " limit ".$limit; + if ( isset($limit) && $limit == 1 ) + { + if ( $sqlData = dbFetchOne( $sql ) ) + { + foreach ( $postFuncs as $element=>$func ) + $sqlData[$element] = eval( 'return( '.$func.'( $sqlData ) );' ); + $data = array_merge( $data, $sqlData ); + } + } + else + { + $count = 0; + foreach( dbFetchAll( $sql ) as $sqlData ) + { + foreach ( $postFuncs as $element=>$func ) + $sqlData[$element] = eval( 'return( '.$func.'( $sqlData ) );' ); + $data[] = $sqlData; + if ( isset($limi) && ++$count >= $limit ) + break; + } + } + } + } + #print_r( $data ); + return( $data ); +} + +$data = collectData(); + +if ( !isset($_REQUEST['layout']) ) +{ + $_REQUEST['layout'] = "json"; +} +switch( $_REQUEST['layout'] ) +{ + case 'xml NOT CURRENTLY SUPPORTED' : + { + header("Content-type: application/xml" ); + echo( ''."\n" ); + echo "<".strtolower($_REQUEST['entity']).">\n"; + foreach ( $data as $key=>$value ) + { + $key = strtolower( $key ); + echo "<$key>".htmlentities($value)."\n"; + } + echo "\n"; + break; + } + case 'json' : + { + $response = array( strtolower(validJsStr($_REQUEST['entity'])) => $data ); + if ( isset($_REQUEST['loopback']) ) + $response['loopback'] = validJsStr($_REQUEST['loopback']); + ajaxResponse( $response ); + break; + } + case 'text' : + { + header("Content-type: text/plain" ); + echo join( " ", array_values( $data ) ); + break; + } +} + +function getFrameImage() +{ + $eventId = dbEscape($_REQUEST['id'][0]); + $frameId = dbEscape($_REQUEST['id'][1]); + + $sql = "select * from Frames where EventId = '".$eventId."' and FrameId = '".$frameId."'"; + if ( !($frame = dbFetchOne( $sql )) ) + { + $frame = array(); + $frame['EventId'] = $eventId; + $frame['FrameId'] = $frameId; + $frame['Type'] = "Virtual"; + } + $event = dbFetchOne( "select * from Events where Id = '".$frame['EventId']."'" ); + $frame['Image'] = getImageSrc( $event, $frame, SCALE_BASE ); + return( $frame ); +} + +function getNearFrame() +{ + $eventId = dbEscape($_REQUEST['id'][0]); + $frameId = dbEscape($_REQUEST['id'][1]); + + $sql = "select FrameId from Frames where EventId = '".$eventId."' and FrameId <= '".$frameId."' order by FrameId desc limit 1"; + if ( !$nearFrameId = dbFetchOne( $sql, 'FrameId' ) ) + { + $sql = "select * from Frames where EventId = '".$eventId."' and FrameId > '".$frameId."' order by FrameId asc limit 1"; + if ( !$nearFrameId = dbFetchOne( $sql, 'FrameId' ) ) + { + return( array() ); + } + } + $_REQUEST['entity'] = "frame"; + $_REQUEST['id'][1] = $nearFrameId; + return( collectData() ); +} + +function getNearEvents() +{ + global $user, $sortColumn, $sortOrder; + + $eventId = dbEscape($_REQUEST['id']); + $event = dbFetchOne( "select * from Events where Id = '".$eventId."'" ); + + parseFilter( $_REQUEST['filter'] ); + parseSort(); + + if ( $user['MonitorIds'] ) + $midSql = " and MonitorId in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")"; + else + $midSql = ''; + + $sql = "select E.Id as Id from Events as E inner join Monitors as M on E.MonitorId = M.Id where ".dbEscape($sortColumn)." ".($sortOrder=='asc'?'<=':'>=')." '".$event[$_REQUEST['sort_field']]."'".$_REQUEST['filter']['sql'].$midSql." order by $sortColumn ".($sortOrder=='asc'?'desc':'asc'); + $result = dbQuery( $sql ); + while ( $id = dbFetchNext( $result, 'Id' ) ) + { + if ( $id == $eventId ) + { + $prevId = dbFetchNext( $result, 'Id' ); + break; + } + } + + $sql = "select E.Id as Id from Events as E inner join Monitors as M on E.MonitorId = M.Id where $sortColumn ".($sortOrder=='asc'?'>=':'<=')." '".$event[$_REQUEST['sort_field']]."'".$_REQUEST['filter']['sql'].$midSql." order by $sortColumn $sortOrder"; + $result = dbQuery( $sql ); + while ( $id = dbFetchNext( $result, 'Id' ) ) + { + if ( $id == $eventId ) + { + $nextId = dbFetchNext( $result, 'Id' ); + break; + } + } + + $result = array( 'EventId'=>$eventId ); + $result['PrevEventId'] = empty($prevId)?0:$prevId; + $result['NextEventId'] = empty($nextId)?0:$nextId; + return( $result ); +} + +?> diff --git a/web/ajax/stream.php b/web/ajax/stream.php new file mode 100644 index 000000000..98cd7c8b9 --- /dev/null +++ b/web/ajax/stream.php @@ -0,0 +1,135 @@ + 0 ) +{ + if ( count($rSockets) != 1 ) + ajaxError( "Bogus return from select, ".count($rSockets)." sockets available" ); +} + +switch( $nbytes = @socket_recvfrom( $socket, $msg, MSG_DATA_SIZE, 0, $remSockFile ) ) +{ + case -1 : + { + ajaxError( "socket_recvfrom( $remSockFile ) failed: ".socket_strerror(socket_last_error()) ); + break; + } + case 0 : + { + ajaxError( "No data to read from socket" ); + break; + } + default : + { + if ( $nbytes != MSG_DATA_SIZE ) + ajaxError( "Got unexpected message size, got $nbytes, expected ".MSG_DATA_SIZE ); + break; + } +} + +$data = unpack( "ltype", $msg ); +switch ( $data['type'] ) +{ + case MSG_DATA_WATCH : + { + $data = unpack( "ltype/imonitor/istate/dfps/ilevel/irate/ddelay/izoom/Cdelayed/Cpaused/Cenabled/Cforced", $msg ); + $data['fps'] = sprintf( "%.2f", $data['fps'] ); + $data['rate'] /= RATE_BASE; + $data['delay'] = sprintf( "%.2f", $data['delay'] ); + $data['zoom'] = sprintf( "%.1f", $data['zoom']/SCALE_BASE ); + ajaxResponse( array( 'status'=>$data ) ); + break; + } + case MSG_DATA_EVENT : + { + $data = unpack( "ltype/ievent/iprogress/irate/izoom/Cpaused", $msg ); + //$data['progress'] = sprintf( "%.2f", $data['progress'] ); + $data['rate'] /= RATE_BASE; + $data['zoom'] = sprintf( "%.1f", $data['zoom']/SCALE_BASE ); + ajaxResponse( array( 'status'=>$data ) ); + break; + } + default : + { + ajaxError( "Unexpected received message type '$type'" ); + } +} + +ajaxError( 'Unrecognised action or insufficient permissions' ); + +function ajaxCleanup() +{ + global $socket, $locSockFile; + if ( !empty( $socket ) ) + @socket_close( $socket ); + if ( !empty( $locSockFile ) ) + @unlink( $locSockFile ); +} +?> diff --git a/web/ajax/zone.php b/web/ajax/zone.php new file mode 100644 index 000000000..1c087541d --- /dev/null +++ b/web/ajax/zone.php @@ -0,0 +1,45 @@ + ZM_DIR_IMAGES.'/Zones'.$monitor['Id'].'.jpg?'.time(), + 'selfIntersecting' => isSelfIntersecting( $points ), + 'area' => getPolyArea( $points ) + ) ); + + break; + } + } +} + +ajaxError( 'Unrecognised action or insufficient permissions' ); + +?> diff --git a/web/css/Makefile.am b/web/css/Makefile.am new file mode 100644 index 000000000..917b8f389 --- /dev/null +++ b/web/css/Makefile.am @@ -0,0 +1,8 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/css + +dist_web_DATA = \ + reset.css \ + spinner.css \ + overlay.css diff --git a/web/css/Makefile.in b/web/css/Makefile.in new file mode 100644 index 000000000..c2494c9d4 --- /dev/null +++ b/web/css/Makefile.in @@ -0,0 +1,455 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/css +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +webdir = @WEB_PREFIX@/css +dist_web_DATA = \ + reset.css \ + spinner.css \ + overlay.css + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/css/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/css/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_webDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/css/overlay.css b/web/css/overlay.css new file mode 100644 index 000000000..de7ed5ecb --- /dev/null +++ b/web/css/overlay.css @@ -0,0 +1,49 @@ +.overlayMask { + position: absolute; + opacity: 0.6; + filter: alpha(opacity=60); + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60); + z-index: 999; + background: #aaaaaa; +} + +.overlay { + display: none; + position: absolute; + background-color: #f0f0f0; + border: 2px solid #555555; + -moz-border-radius: 4px; + z-index: 1000; + overflow: hidden; +} + +.overlayHeader { + float: left; + background-color: #dddddd; + width: 100%; + border-bottom: 1px solid #666666; + color: black; +} + +.overlayTitle { + float: left; + padding: 10px 6px; + font-weight: bold; + width: auto; +} + +.overlayToolbar { + float: right; + font-weight: bold; + padding: 6px 4px; + width: auto; +} + +.overlayBody { + float: left; + width: 100%; +} + +.overlayContent { + padding: 4px 4px 6px; +} diff --git a/web/css/reset.css b/web/css/reset.css new file mode 100644 index 000000000..12656ad4c --- /dev/null +++ b/web/css/reset.css @@ -0,0 +1,77 @@ +/* + * ZoneMinder Reset Stylesheet, $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. + */ + +/* + * Based on Reset Reloaded by Eric Meyer at http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/ + */ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +input, textarea, select, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +/* remember to define focus styles! */ +:focus { + outline: 0; +} + +body { + line-height: 1; + color: black; + background: white; +} + +ol, ul { + list-style: none; +} + +/* tables still need 'cellspacing="0"' in the markup */ +table { + border-collapse: separate; + border-spacing: 0; +} + +caption, th, td { + text-align: left; + font-weight: normal; +} + +blockquote:before, blockquote:after, +q:before, q:after { + content: ""; +} + +blockquote, q { + quotes: "" ""; +} diff --git a/web/css/spinner.css b/web/css/spinner.css new file mode 100644 index 000000000..835d4e665 --- /dev/null +++ b/web/css/spinner.css @@ -0,0 +1,19 @@ +.spinner { + position: absolute; + opacity: 0.9; + filter: alpha(opacity=90); + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=90); + z-index: 1001; + background: #fff; +} +.spinner-msg { + text-align: center; + font-weight: bold; +} + +.spinner-img { + background: url(/graphics/spinner.gif) no-repeat; + width: 24px; + height: 24px; + margin: 0 auto; +} diff --git a/web/graphics/Makefile.am b/web/graphics/Makefile.am new file mode 100644 index 000000000..ec252c82e --- /dev/null +++ b/web/graphics/Makefile.am @@ -0,0 +1,8 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/graphics + +dist_web_DATA = \ + favicon.ico \ + spinner.gif \ + transparent.gif diff --git a/web/graphics/Makefile.in b/web/graphics/Makefile.in new file mode 100644 index 000000000..4e6e9f5ee --- /dev/null +++ b/web/graphics/Makefile.in @@ -0,0 +1,455 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/graphics +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +webdir = @WEB_PREFIX@/graphics +dist_web_DATA = \ + favicon.ico \ + spinner.gif \ + transparent.gif + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/graphics/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/graphics/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_webDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/graphics/favicon.ico b/web/graphics/favicon.ico new file mode 100644 index 000000000..3a42fd483 Binary files /dev/null and b/web/graphics/favicon.ico differ diff --git a/web/graphics/spinner.gif b/web/graphics/spinner.gif new file mode 100644 index 000000000..53dd589fa Binary files /dev/null and b/web/graphics/spinner.gif differ diff --git a/web/graphics/transparent.gif b/web/graphics/transparent.gif new file mode 100644 index 000000000..edab8f2b5 Binary files /dev/null and b/web/graphics/transparent.gif differ diff --git a/web/includes/Makefile.am b/web/includes/Makefile.am new file mode 100644 index 000000000..93fe65380 --- /dev/null +++ b/web/includes/Makefile.am @@ -0,0 +1,17 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/includes + +web_DATA = \ + config.php + +dist_web_DATA = \ + actions.php \ + database.php \ + functions.php \ + control_functions.php \ + lang.php \ + logger.php + +EXTRA_DIST = \ + config.php.in diff --git a/web/includes/Makefile.in b/web/includes/Makefile.in new file mode 100644 index 000000000..d8b2fd3ac --- /dev/null +++ b/web/includes/Makefile.in @@ -0,0 +1,488 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/includes +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.php.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = config.php +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) $(web_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +webdir = @WEB_PREFIX@/includes +web_DATA = \ + config.php + +dist_web_DATA = \ + actions.php \ + database.php \ + functions.php \ + control_functions.php \ + lang.php \ + logger.php + +EXTRA_DIST = \ + config.php.in + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/includes/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/includes/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +config.php: $(top_builddir)/config.status $(srcdir)/config.php.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) +install-webDATA: $(web_DATA) + @$(NORMAL_INSTALL) + @list='$(web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-webDATA: + @$(NORMAL_UNINSTALL) + @list='$(web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(webdir)" "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_webDATA install-webDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_webDATA uninstall-webDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_webDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip install-webDATA \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-dist_webDATA \ + uninstall-webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/includes/actions.php b/web/includes/actions.php new file mode 100644 index 000000000..1892464a7 --- /dev/null +++ b/web/includes/actions.php @@ -0,0 +1,932 @@ +$type ) + { + if ( preg_match( '/^(Can|Has)/', $name ) ) + { + $types[$name] = 'toggle'; + } + } + $changes = getFormChanges( $control, $_REQUEST['newControl'], $types, $columns ); + + if ( count( $changes ) ) + { + if ( !empty($_REQUEST['cid']) ) + { + dbQuery( "update Controls set ".implode( ", ", $changes )." where Id = '".dbEscape($_REQUEST['cid'])."'" ); + } + else + { + dbQuery( "insert into Controls set ".implode( ", ", $changes ) ); + //$_REQUEST['cid'] = dbInsertId(); + } + $refreshParent = true; + } + $view = 'none'; + } + elseif ( $action == "delete" ) + { + if ( isset($_REQUEST['markCids']) ) + { + foreach( $_REQUEST['markCids'] as $markCid ) + { + dbQuery( "delete from Controls where Id = '".dbEscape($markCid)."'" ); + dbQuery( "update Monitors set Controllable = 0, ControlId = 0 where ControlId = '".dbEscape($markCid)."'" ); + $refreshParent = true; + } + } + } + } + + // Monitor edit actions, require a monitor id and edit permissions for that monitor + if ( !empty($_REQUEST['mid']) && canEdit( 'Monitors', $_REQUEST['mid'] ) ) + { + $mid = validInt($_REQUEST['mid']); + if ( $action == "function" ) + { + $monitor = dbFetchOne( "select * from Monitors where Id = '".$mid."'" ); + + $newFunction = validStr($_REQUEST['newFunction']); + $newEnabled = validStr($_REQUEST['newEnabled']); + $oldFunction = $monitor['Function']; + $oldEnabled = $monitor['Enabled']; + if ( $newFunction != $oldFunction || $newEnabled != $oldEnabled ) + { + dbQuery( "update Monitors set Function = '".dbEscape($newFunction)."', Enabled = '".$newEnabled."' where Id = '".$mid."'" ); + + $monitor['Function'] = $newFunction; + $monitor['Enabled'] = $newEnabled; + //if ( $cookies ) session_write_close(); + if ( daemonCheck() ) + { + $restart = ($oldFunction == 'None') || ($newFunction == 'None') || ($newEnabled != $oldEnabled); + zmaControl( $monitor, "stop" ); + zmcControl( $monitor, $restart?"restart":"" ); + zmaControl( $monitor, "start" ); + } + $refreshParent = true; + } + } + elseif ( $action == "zone" && isset( $_REQUEST['zid'] ) ) + { + $zid = validInt($_REQUEST['zid']); + $monitor = dbFetchOne( "select * from Monitors where Id = '".dbEscape($mid)."'" ); + + if ( !empty($zid) ) + { + $zone = dbFetchOne( "select * from Zones where MonitorId = '".dbEscape($mid)."' and Id = '".dbEscape($zid)."'" ); + } + else + { + $zone = array(); + } + + if ( $_REQUEST['newZone']['Units'] == 'Percent' ) + { + $_REQUEST['newZone']['MinAlarmPixels'] = intval(($_REQUEST['newZone']['MinAlarmPixels']*$_REQUEST['newZone']['Area'])/100); + $_REQUEST['newZone']['MaxAlarmPixels'] = intval(($_REQUEST['newZone']['MaxAlarmPixels']*$_REQUEST['newZone']['Area'])/100); + if ( isset($_REQUEST['newZone']['MinFilterPixels']) ) + $_REQUEST['newZone']['MinFilterPixels'] = intval(($_REQUEST['newZone']['MinFilterPixels']*$_REQUEST['newZone']['Area'])/100); + if ( isset($_REQUEST['newZone']['MaxFilterPixels']) ) + $_REQUEST['newZone']['MaxFilterPixels'] = intval(($_REQUEST['newZone']['MaxFilterPixels']*$_REQUEST['newZone']['Area'])/100); + if ( isset($_REQUEST['newZone']['MinBlobPixels']) ) + $_REQUEST['newZone']['MinBlobPixels'] = intval(($_REQUEST['newZone']['MinBlobPixels']*$_REQUEST['newZone']['Area'])/100); + if ( isset($_REQUEST['newZone']['MaxBlobPixels']) ) + $_REQUEST['newZone']['MaxBlobPixels'] = intval(($_REQUEST['newZone']['MaxBlobPixels']*$_REQUEST['newZone']['Area'])/100); + } + + unset( $_REQUEST['newZone']['Points'] ); + $types = array(); + $changes = getFormChanges( $zone, $_REQUEST['newZone'], $types ); + + if ( count( $changes ) ) + { + if ( $zid > 0 ) + { + $sql = "update Zones set ".implode( ", ", $changes )." where MonitorId = '".dbEscape($mid)."' and Id = '".dbEscape($zid)."'"; + } + else + { + $sql = "insert into Zones set MonitorId = '".dbEscape($mid)."', ".implode( ", ", $changes ); + } + dbQuery( $sql ); + //if ( $cookies ) session_write_close(); + if ( daemonCheck() ) + { + zmaControl( $mid, "restart" ); + } + $refreshParent = true; + } + $view = 'none'; + } + elseif ( $action == "plugin" && isset($_REQUEST['pl'])) + { + $plugin=dbEscape($_REQUEST['pl']); + $zid=validInt($_REQUEST['zid']); + $sql="SELECT * FROM PluginsConfig WHERE MonitorId='".dbEscape($mid)."' AND ZoneId='".$zid."' AND pluginName='".$plugin."'"; + $pconfs=dbFetchAll( $sql ); + $changes=0; + foreach( $pconfs as $pconf ) + { + $value=$_REQUEST['pluginOpt'][$pconf['Name']]; + if(array_key_exists($pconf['Name'], $_REQUEST['pluginOpt']) && ($pconf['Value']!=$value)) + { + dbQuery("UPDATE PluginsConfig SET Value='".dbEscape($value)."' WHERE id='".$pconf['Id']."'"); + $changes++; + } + } + if($changes>0) + { + if ( daemonCheck() ) + { + zmaControl( $mid, "restart" ); + } + $refreshParent = true; + } + $view = 'none'; + } + elseif ( $action == "sequence" && isset($_REQUEST['smid']) ) + { + $smid = validInt($_REQUEST['smid']); + $monitor = dbFetchOne( "select * from Monitors where Id = '".dbEscape($mid)."'" ); + $smonitor = dbFetchOne( "select * from Monitors where Id = '".dbEscape($smid)."'" ); + + dbQuery( "update Monitors set Sequence = '".$smonitor['Sequence']."' where Id = '".$monitor['Id']."'" ); + dbQuery( "update Monitors set Sequence = '".$monitor['Sequence']."' where Id = '".$smonitor['Id']."'" ); + + $refreshParent = true; + fixSequences(); + } + if ( $action == "delete" ) + { + if ( isset($_REQUEST['markZids']) ) + { + $deletedZid = 0; + foreach( $_REQUEST['markZids'] as $markZid ) + { + dbQuery( "delete from Zones where MonitorId = '".dbEscape($mid)."' && Id = '".dbEscape($markZid)."'" ); + $deletedZid = 1; + } + if ( $deletedZid ) + { + //if ( $cookies ) + //session_write_close(); + if ( daemonCheck() ) + zmaControl( $mid, "restart" ); + $refreshParent = true; + } + } + } + } + + // Monitor edit actions, monitor id derived, require edit permissions for that monitor + if ( canEdit( 'Monitors' ) ) + { + if ( $action == "monitor" ) + { + if ( !empty($_REQUEST['mid']) ) + { + $mid = validInt($_REQUEST['mid']); + $monitor = dbFetchOne( "select * from Monitors where Id = '".dbEscape($mid)."'" ); + + if ( ZM_OPT_X10 ) + { + $x10Monitor = dbFetchOne( "select * from TriggersX10 where MonitorId = '".dbEscape($mid)."'" ); + if ( !$x10Monitor ) + $x10Monitor = array(); + } + } + else + { + $monitor = array(); + if ( ZM_OPT_X10 ) + { + $x10Monitor = array(); + } + } + + // Define a field type for anything that's not simple text equivalent + $types = array( + 'Triggers' => 'set', + 'Controllable' => 'toggle', + 'TrackMotion' => 'toggle', + 'Enabled' => 'toggle', + 'DoNativeMotDet' => 'toggle' + ); + + $columns = getTableColumns( 'Monitors' ); + $changes = getFormChanges( $monitor, $_REQUEST['newMonitor'], $types, $columns ); + + if ( count( $changes ) ) + { + if ( !empty($_REQUEST['mid']) ) + { + $mid = validInt($_REQUEST['mid']); + $sql = "update Monitors set ".implode( ", ", $changes )." where Id = '".dbEscape($mid)."'"; + dbQuery( $sql ); + if ( isset($changes['Name']) ) + { + exec( escapeshellcmd( "mv ".ZM_DIR_EVENTS."/".$monitor['Name']." ".ZM_DIR_EVENTS."/".$_REQUEST['newMonitor']['Name'] ) ); + } + if ( isset($changes['Width']) || isset($changes['Height']) ) + { + $newW = $_REQUEST['newMonitor']['Width']; + $newH = $_REQUEST['newMonitor']['Height']; + $newA = $newW * $newH; + $oldW = $monitor['Width']; + $oldH = $monitor['Height']; + $oldA = $oldW * $oldH; + + $zones = dbFetchAll( "select * from Zones where MonitorId = '".dbEscape($mid)."'" ); + foreach ( $zones as $zone ) + { + $newZone = $zone; + $points = coordsToPoints( $zone['Coords'] ); + for ( $i = 0; $i < count($points); $i++ ) + { + $points[$i]['x'] = intval(($points[$i]['x']*($newW-1))/($oldW-1)); + $points[$i]['y'] = intval(($points[$i]['y']*($newH-1))/($oldH-1)); + } + $newZone['Coords'] = pointsToCoords( $points ); + $newZone['Area'] = intval(round(($zone['Area']*$newA)/$oldA)); + $newZone['MinAlarmPixels'] = intval(round(($newZone['MinAlarmPixels']*$newA)/$oldA)); + $newZone['MaxAlarmPixels'] = intval(round(($newZone['MaxAlarmPixels']*$newA)/$oldA)); + $newZone['MinFilterPixels'] = intval(round(($newZone['MinFilterPixels']*$newA)/$oldA)); + $newZone['MaxFilterPixels'] = intval(round(($newZone['MaxFilterPixels']*$newA)/$oldA)); + $newZone['MinBlobPixels'] = intval(round(($newZone['MinBlobPixels']*$newA)/$oldA)); + $newZone['MaxBlobPixels'] = intval(round(($newZone['MaxBlobPixels']*$newA)/$oldA)); + + $changes = getFormChanges( $zone, $newZone, $types ); + + if ( count( $changes ) ) + { + dbQuery( "update Zones set ".implode( ", ", $changes )." where MonitorId = '".dbEscape($mid)."' and Id = '".$zone['Id']."'" ); + } + } + } + } + elseif ( !$user['MonitorIds'] ) + { + $maxSeq = dbFetchOne( "select max(Sequence) as MaxSequence from Monitors", "MaxSequence" ); + $changes[] = "Sequence = ".($maxSeq+1); + + dbQuery( "insert into Monitors set ".implode( ", ", $changes ) ); + $mid = dbInsertId(); + $zoneArea = $_REQUEST['newMonitor']['Width'] * $_REQUEST['newMonitor']['Height']; + dbQuery( "insert into Zones set MonitorId = ".dbEscape($mid).", Name = 'All', Type = 'Active', Units = 'Percent', NumCoords = 4, Coords = '".sprintf( "%d,%d %d,%d %d,%d %d,%d", 0, 0, $_REQUEST['newMonitor']['Width']-1, 0, $_REQUEST['newMonitor']['Width']-1, $_REQUEST['newMonitor']['Height']-1, 0, $_REQUEST['newMonitor']['Height']-1 )."', Area = ".$zoneArea.", AlarmRGB = 0xff0000, CheckMethod = 'Blobs', MinPixelThreshold = 25, MinAlarmPixels = ".intval(($zoneArea*3)/100).", MaxAlarmPixels = ".intval(($zoneArea*75)/100).", FilterX = 3, FilterY = 3, MinFilterPixels = ".intval(($zoneArea*3)/100).", MaxFilterPixels = ".intval(($zoneArea*75)/100).", MinBlobPixels = ".intval(($zoneArea*2)/100).", MinBlobs = 1" ); + //$view = 'none'; + mkdir( ZM_DIR_EVENTS.'/'.$mid, 0755 ); + symlink( $mid, ZM_DIR_EVENTS.'/'.$_REQUEST['newMonitor']['Name'] ); + if ( isset($_COOKIE['zmGroup']) ) + { + $sql = "update Groups set MonitorIds = concat(MonitorIds,',".$mid."') where Id = '".dbEscape($_COOKIE['zmGroup'])."'"; + dbQuery( $sql ); + } + } + $restart = true; + } + + if ( ZM_OPT_X10 ) + { + $x10Changes = getFormChanges( $x10Monitor, $_REQUEST['newX10Monitor'] ); + + if ( count( $x10Changes ) ) + { + if ( $x10Monitor && isset($_REQUEST['newX10Monitor']) ) + { + dbQuery( "update TriggersX10 set ".implode( ", ", $x10Changes )." where MonitorId = '".dbEscape($mid)."'" ); + } + elseif ( !$user['MonitorIds'] ) + { + if ( !$x10Monitor ) + { + dbQuery( "insert into TriggersX10 set MonitorId = '".dbEscape($mid)."', ".implode( ", ", $x10Changes ) ); + } + else + { + dbQuery( "delete from TriggersX10 where MonitorId = '".dbEscape($mid)."'" ); + } + } + $restart = true; + } + } + + if ( $restart ) + { + $monitor = dbFetchOne( "select * from Monitors where Id = '".dbEscape($mid)."'" ); + fixDevices(); + //if ( $cookies ) + //session_write_close(); + if ( daemonCheck() ) + { + zmaControl( $monitor, "stop" ); + zmcControl( $monitor, "restart" ); + zmaControl( $monitor, "start" ); + } + //daemonControl( 'restart', 'zmwatch.pl' ); + $refreshParent = true; + } + $view = 'none'; + } + if ( $action == "delete" ) + { + if ( isset($_REQUEST['markMids']) && !$user['MonitorIds'] ) + { + foreach( $_REQUEST['markMids'] as $markMid ) + { + if ( canEdit( 'Monitors', $markMid ) ) + { + $sql = "select * from Monitors where Id = '".dbEscape($markMid)."'"; + if ( $monitor = dbFetchOne( $sql ) ) + { + if ( daemonCheck() ) + { + zmaControl( $monitor, "stop" ); + zmcControl( $monitor, "stop" ); + } + + // This is the important stuff + dbQuery( "delete from Monitors where Id = '".dbEscape($markMid)."'" ); + dbQuery( "delete from Zones where MonitorId = '".dbEscape($markMid)."'" ); + if ( ZM_OPT_X10 ) + dbQuery( "delete from TriggersX10 where MonitorId = '".dbEscape($markMid)."'" ); + + fixSequences(); + + // If fast deletes are on, then zmaudit will clean everything else up later + // If fast deletes are off and there are lots of events then this step may + // well time out before completing, in which case zmaudit will still tidy up + if ( !ZM_OPT_FAST_DELETE ) + { + $sql = "select Id from Events where MonitorId = '".dbEscape($markMid)."'"; + $markEids = dbFetchAll( $sql, 'Id' ); + foreach( $markEids as $markEid ) + deleteEvent( $markEid ); + + deletePath( ZM_DIR_EVENTS."/".$monitor['Name'] ); + deletePath( ZM_DIR_EVENTS."/".$monitor['Id'] ); + } + } + } + } + } + } + } + + // Device view actions + if ( canEdit( 'Devices' ) ) + { + if ( $action == "device" ) + { + if ( !empty($_REQUEST['command']) ) + { + setDeviceStatusX10( $_REQUEST['key'], $_REQUEST['command'] ); + } + elseif ( isset( $_REQUEST['newDevice'] ) ) + { + if ( isset($_REQUEST['did']) ) + { + dbQuery( "update Devices set Name = '".dbEscape($_REQUEST['newDevice']['Name'])."', KeyString = '".dbEscape($_REQUEST['newDevice']['KeyString'])."' where Id = '".dbEscape($_REQUEST['did'])."'" ); + } + else + { + dbQuery( "insert into Devices set Name = '".dbEscape($_REQUEST['newDevice']['Name'])."', KeyString = '".dbEscape($_REQUEST['newDevice']['KeyString'])."'" ); + } + $refreshParent = true; + $view = 'none'; + } + } + elseif ( $action == "delete" ) + { + if ( isset($_REQUEST['markDids']) ) + { + foreach( $_REQUEST['markDids'] as $markDid ) + { + dbQuery( "delete from Devices where Id = '".dbEscape($markDid)."'" ); + $refreshParent = true; + } + } + } + } + + // System view actions + if ( canView( 'System' ) ) + { + if ( $action == "setgroup" ) + { + if ( !empty($_REQUEST['gid']) ) + { + setcookie( "zmGroup", validInt($_REQUEST['gid']), time()+3600*24*30*12*10 ); + } + else + { + setcookie( "zmGroup", "", time()-3600*24*2 ); + } + $refreshParent = true; + } + } + + // System edit actions + if ( canEdit( 'System' ) ) + { + if ( $action == "version" && isset($_REQUEST['option']) ) + { + $option = $_REQUEST['option']; + switch( $option ) + { + case 'go' : + { + // Ignore this, the caller will open the page itself + break; + } + case 'ignore' : + { + dbQuery( "update Config set Value = '".ZM_DYN_LAST_VERSION."' where Name = 'ZM_DYN_CURR_VERSION'" ); + break; + } + case 'hour' : + case 'day' : + case 'week' : + { + $nextReminder = time(); + if ( $option == 'hour' ) + { + $nextReminder += 60*60; + } + elseif ( $option == 'day' ) + { + $nextReminder += 24*60*60; + } + elseif ( $option == 'week' ) + { + $nextReminder += 7*24*60*60; + } + dbQuery( "update Config set Value = '".$nextReminder."' where Name = 'ZM_DYN_NEXT_REMINDER'" ); + break; + } + case 'never' : + { + dbQuery( "update Config set Value = '0' where Name = 'ZM_CHECK_FOR_UPDATES'" ); + break; + } + } + } + if ( $action == "donate" && isset($_REQUEST['option']) ) + { + $option = $_REQUEST['option']; + switch( $option ) + { + case 'go' : + { + // Ignore this, the caller will open the page itself + break; + } + case 'hour' : + case 'day' : + case 'week' : + case 'month' : + { + $nextReminder = time(); + if ( $option == 'hour' ) + { + $nextReminder += 60*60; + } + elseif ( $option == 'day' ) + { + $nextReminder += 24*60*60; + } + elseif ( $option == 'week' ) + { + $nextReminder += 7*24*60*60; + } + elseif ( $option == 'month' ) + { + $nextReminder += 30*24*60*60; + } + dbQuery( "update Config set Value = '".$nextReminder."' where Name = 'ZM_DYN_DONATE_REMINDER_TIME'" ); + break; + } + case 'never' : + case 'already' : + { + dbQuery( "update Config set Value = '0' where Name = 'ZM_DYN_SHOW_DONATE_REMINDER'" ); + break; + } + } + } + if ( $action == "options" && isset($_REQUEST['tab']) ) + { + $configCat = $configCats[$_REQUEST['tab']]; + $changed = false; + foreach ( $configCat as $name=>$value ) + { + unset( $newValue ); + if ( $value['Type'] == "boolean" && empty($_REQUEST['newConfig'][$name]) ) + $newValue = 0; + elseif ( isset($_REQUEST['newConfig'][$name]) ) + $newValue = preg_replace( "/\r\n/", "\n", stripslashes( $_REQUEST['newConfig'][$name] ) ); + + if ( isset($newValue) && ($newValue != $value['Value']) ) + { + dbQuery( "update Config set Value = '".$newValue."' where Name = '".$name."'" ); + $changed = true; + } + } + if ( $changed ) + { + switch( $_REQUEST['tab'] ) + { + case "system" : + case "config" : + case "paths" : + $restartWarning = true; + break; + case "web" : + case "tools" : + break; + case "logging" : + case "network" : + case "mail" : + case "upload" : + $restartWarning = true; + break; + case "highband" : + case "medband" : + case "lowband" : + case "phoneband" : + break; + } + } + loadConfig( false ); + } + elseif ( $action == "user" ) + { + if ( !empty($_REQUEST['uid']) ) + $dbUser = dbFetchOne( "select * from Users where Id = '".dbEscape($_REQUEST['uid'])."'" ); + else + $dbUser = array(); + + $types = array(); + $changes = getFormChanges( $dbUser, $_REQUEST['newUser'], $types ); + + if ( $_REQUEST['newUser']['Password'] ) + $changes['Password'] = "Password = password('".dbEscape($_REQUEST['newUser']['Password'])."')"; + else + unset( $changes['Password'] ); + + if ( count( $changes ) ) + { + if ( !empty($_REQUEST['uid']) ) + { + $sql = "update Users set ".implode( ", ", $changes )." where Id = '".dbEscape($_REQUEST['uid'])."'"; + } + else + { + $sql = "insert into Users set ".implode( ", ", $changes ); + } + dbQuery( $sql ); + $refreshParent = true; + if ( $dbUser['Username'] == $user['Username'] ) + userLogin( $dbUser['Username'], $dbUser['Password'] ); + } + $view = 'none'; + } + elseif ( $action == "state" ) + { + if ( !empty($_REQUEST['runState']) ) + { + //if ( $cookies ) session_write_close(); + packageControl( $_REQUEST['runState'] ); + $refreshParent = true; + } + } + elseif ( $action == "save" ) + { + if ( !empty($_REQUEST['runState']) || !empty($_REQUEST['newState']) ) + { + $sql = "select Id,Function,Enabled from Monitors order by Id"; + $definitions = array(); + foreach( dbFetchAll( $sql ) as $monitor ) + { + $definitions[] = $monitor['Id'].":".$monitor['Function'].":".$monitor['Enabled']; + } + $definition = join( ',', $definitions ); + if ( $_REQUEST['newState'] ) + $_REQUEST['runState'] = $_REQUEST['newState']; + dbQuery( "replace into States set Name = '".dbEscape($_REQUEST['runState'])."', Definition = '".dbEscape($definition)."'" ); + } + } + elseif ( $action == "group" ) + { + if ( !empty($_REQUEST['gid']) ) + { + $sql = "update Groups set Name = '".dbEscape($_REQUEST['newGroup']['Name'])."', MonitorIds = '".dbEscape(join(',',$_REQUEST['newGroup']['MonitorIds']))."' where Id = '".dbEscape($_REQUEST['gid'])."'"; + } + else + { + $sql = "insert into Groups set Name = '".dbEscape($_REQUEST['newGroup']['Name'])."', MonitorIds = '".dbEscape(join(',',$_REQUEST['newGroup']['MonitorIds']))."'"; + } + dbQuery( $sql ); + $refreshParent = true; + $view = 'none'; + } + elseif ( $action == "delete" ) + { + if ( isset($_REQUEST['runState']) ) + dbQuery( "delete from States where Name = '".dbEscape($_REQUEST['runState'])."'" ); + + if ( isset($_REQUEST['markUids']) ) + { + foreach( $_REQUEST['markUids'] as $markUid ) + dbQuery( "delete from Users where Id = '".dbEscape($markUid)."'" ); + if ( $markUid == $user['Id'] ) + userLogout(); + } + if ( !empty($_REQUEST['gid']) ) + { + dbQuery( "delete from Groups where Id = '".dbEscape($_REQUEST['gid'])."'" ); + if ( isset($_COOKIE['zmGroup']) ) + { + if ( $_REQUEST['gid'] == $_COOKIE['zmGroup'] ) + { + unset( $_COOKIE['zmGroup'] ); + setcookie( "zmGroup", "", time()-3600*24*2 ); + $refreshParent = true; + } + } + } + } + } + else + { + if ( ZM_USER_SELF_EDIT && $action == "user" ) + { + $uid = $user['Id']; + + $dbUser = dbFetchOne( "select Id, Password, Language from Users where Id = '".dbEscape($uid)."'" ); + + $types = array(); + $changes = getFormChanges( $dbUser, $_REQUEST['newUser'], $types ); + + if ( !empty($_REQUEST['newUser']['Password']) ) + $changes['Password'] = "Password = password('".dbEscape($_REQUEST['newUser']['Password'])."')"; + else + unset( $changes['Password'] ); + if ( count( $changes ) ) + { + $sql = "update Users set ".implode( ", ", $changes )." where Id = '".dbEscape($uid)."'"; + dbQuery( $sql ); + $refreshParent = true; + } + $view = 'none'; + } + } + + if ( $action == "reset" ) + { + $_SESSION['zmEventResetTime'] = strftime( STRF_FMT_DATETIME_DB ); + setcookie( "zmEventResetTime", $_SESSION['zmEventResetTime'], time()+3600*24*30*12*10 ); + //if ( $cookies ) session_write_close(); + } +} + +?> diff --git a/web/includes/config.php b/web/includes/config.php new file mode 100644 index 000000000..6f1082473 --- /dev/null +++ b/web/includes/config.php @@ -0,0 +1,173 @@ + 0 ) +{ + if ( php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR']) ) + print( "Warning, overriding installed $localConfigFile file with local copy\n" ); + else + error_log( "Warning, overriding installed $localConfigFile file with local copy" ); + $configFile = $localConfigFile; +} + +$cfg = fopen( $configFile, "r") or die("Could not open config file."); +while ( !feof($cfg) ) +{ + $str = fgets( $cfg, 256 ); + if ( preg_match( '/^\s*$/', $str )) + continue; + elseif ( preg_match( '/^\s*#/', $str )) + continue; + elseif ( preg_match( '/^\s*([^=\s]+)\s*=\s*(.+?)\s*$/', $str, $matches )) + define( $matches[1], $matches[2] ); +} +fclose( $cfg ); + +// +// This section is options normally derived from other options or configuration +// +define( "ZMU_PATH", ZM_PATH_BIN."/zmu" ); // Local path to the ZoneMinder Utility + +// +// If setup supports Video 4 Linux v2 and/or v1 +// +define( "ZM_HAS_V4L2", "1" ); // V4L2 support enabled +define( "ZM_HAS_V4L1", "0" ); // V4L1 support enabled +define( "ZM_HAS_V4L", "1" ); // V4L support enabled + +// +// If PCRE dev libraries are installed +// +define( "ZM_PCRE", "1" ); // PCRE support enabled + +// +// Alarm states +// +define( "STATE_IDLE", 0 ); +define( "STATE_PREALARM", 1 ); +define( "STATE_ALARM", 2 ); +define( "STATE_ALERT", 3 ); +define( "STATE_TAPE", 4 ); + +// +// DVR Control Commands +// + +define( "MSG_CMD", 1 ); +define( "MSG_DATA_WATCH", 2 ); +define( "MSG_DATA_EVENT", 3 ); + +define( "CMD_NONE", 0 ); +define( "CMD_PAUSE", 1 ); +define( "CMD_PLAY", 2 ); +define( "CMD_STOP", 3 ); +define( "CMD_FASTFWD", 4 ); +define( "CMD_SLOWFWD", 5 ); +define( "CMD_SLOWREV", 6 ); +define( "CMD_FASTREV", 7 ); +define( "CMD_ZOOMIN", 8 ); +define( "CMD_ZOOMOUT", 9 ); +define( "CMD_PAN", 10 ); +define( "CMD_SCALE", 11 ); +define( "CMD_PREV", 12 ); +define( "CMD_NEXT", 13 ); +define( "CMD_SEEK", 14 ); +define( "CMD_VARPLAY", 15 ); +define( "CMD_QUERY", 99 ); + +// +// These are miscellaneous options you won't normally need to change +// +define( "MAX_EVENTS", 10 ); // The maximum number of events to show in the monitor event listing +define( "RATE_BASE", 100 ); // The additional scaling factor used to help get fractional rates in integer format +define( "SCALE_BASE", 100 ); // The additional scaling factor used to help get fractional scales in integer format + +// +// Date and time formats, eventually some of these may end up in the language files +// +define( "DATE_FMT_CONSOLE_LONG", "D jS M, g:ia" ); // This is the main console date/time, date() or strftime() format +define( "DATE_FMT_CONSOLE_SHORT", "%H:%M" ); // This is the xHTML console date/time, date() or strftime() format + +define( "STRF_FMT_DATETIME_DB", "%Y-%m-%d %H:%M:%S" ); // Strftime format for database queries, don't change + +define( "STRF_FMT_DATETIME", "%c" ); // Strftime locale aware format for dates with times +define( "STRF_FMT_DATE", "%x" ); // Strftime locale aware format for dates without times +define( "STRF_FMT_TIME", "%X" ); // Strftime locale aware format for times without dates + +define( "STRF_FMT_DATETIME_SHORT", "%y/%m/%d %H:%M:%S" ); // Strftime shorter format for dates with time, not locale aware +define( "STRF_FMT_DATETIME_SHORTER", "%m/%d %H:%M:%S" ); // Strftime shorter format for dates with time, not locale aware, used where space is tight + +define( "MYSQL_FMT_DATETIME_SHORT", "%y/%m/%d %H:%i:%S" ); // MySQL date_format shorter format for dates with time + +require_once( 'database.php' ); +loadConfig(); + +$GLOBALS['defaultUser'] = array( + "Username" => "admin", + "Password" => "", + "Language" => "", + "Enabled" => 1, + "Stream" => 'View', + "Events" => 'Edit', + "Control" => 'Edit', + "Monitors" => 'Edit', + "Devices" => 'Edit', + "System" => 'Edit', + "MaxBandwidth" => "", + "MonitorIds" => false +); + +function loadConfig( $defineConsts=true ) +{ + global $config; + global $configCats; + + $config = array(); + $configCat = array(); + + $sql = "select * from Config order by Id asc"; + $result = mysql_query( $sql ); + if ( !$result ) + echo mysql_error(); + $monitors = array(); + while( $row = mysql_fetch_assoc( $result ) ) + { + if ( $defineConsts ) + define( $row['Name'], $row['Value'] ); + $config[$row['Name']] = $row; + if ( !($configCat = &$configCats[$row['Category']]) ) + { + $configCats[$row['Category']] = array(); + $configCat = &$configCats[$row['Category']]; + } + $configCat[$row['Name']] = $row; + } + //print_r( $config ); + //print_r( $configCats ); +} + +?> diff --git a/web/includes/config.php.in b/web/includes/config.php.in new file mode 100644 index 000000000..b9f66449e --- /dev/null +++ b/web/includes/config.php.in @@ -0,0 +1,173 @@ + 0 ) +{ + if ( php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR']) ) + print( "Warning, overriding installed $localConfigFile file with local copy\n" ); + else + error_log( "Warning, overriding installed $localConfigFile file with local copy" ); + $configFile = $localConfigFile; +} + +$cfg = fopen( $configFile, "r") or die("Could not open config file."); +while ( !feof($cfg) ) +{ + $str = fgets( $cfg, 256 ); + if ( preg_match( '/^\s*$/', $str )) + continue; + elseif ( preg_match( '/^\s*#/', $str )) + continue; + elseif ( preg_match( '/^\s*([^=\s]+)\s*=\s*(.+?)\s*$/', $str, $matches )) + define( $matches[1], $matches[2] ); +} +fclose( $cfg ); + +// +// This section is options normally derived from other options or configuration +// +define( "ZMU_PATH", ZM_PATH_BIN."/zmu" ); // Local path to the ZoneMinder Utility + +// +// If setup supports Video 4 Linux v2 and/or v1 +// +define( "ZM_HAS_V4L2", "@ZM_HAS_V4L2@" ); // V4L2 support enabled +define( "ZM_HAS_V4L1", "@ZM_HAS_V4L1@" ); // V4L1 support enabled +define( "ZM_HAS_V4L", "@ZM_HAS_V4L@" ); // V4L support enabled + +// +// If PCRE dev libraries are installed +// +define( "ZM_PCRE", "@ZM_PCRE@" ); // PCRE support enabled + +// +// Alarm states +// +define( "STATE_IDLE", 0 ); +define( "STATE_PREALARM", 1 ); +define( "STATE_ALARM", 2 ); +define( "STATE_ALERT", 3 ); +define( "STATE_TAPE", 4 ); + +// +// DVR Control Commands +// + +define( "MSG_CMD", 1 ); +define( "MSG_DATA_WATCH", 2 ); +define( "MSG_DATA_EVENT", 3 ); + +define( "CMD_NONE", 0 ); +define( "CMD_PAUSE", 1 ); +define( "CMD_PLAY", 2 ); +define( "CMD_STOP", 3 ); +define( "CMD_FASTFWD", 4 ); +define( "CMD_SLOWFWD", 5 ); +define( "CMD_SLOWREV", 6 ); +define( "CMD_FASTREV", 7 ); +define( "CMD_ZOOMIN", 8 ); +define( "CMD_ZOOMOUT", 9 ); +define( "CMD_PAN", 10 ); +define( "CMD_SCALE", 11 ); +define( "CMD_PREV", 12 ); +define( "CMD_NEXT", 13 ); +define( "CMD_SEEK", 14 ); +define( "CMD_VARPLAY", 15 ); +define( "CMD_QUERY", 99 ); + +// +// These are miscellaneous options you won't normally need to change +// +define( "MAX_EVENTS", 10 ); // The maximum number of events to show in the monitor event listing +define( "RATE_BASE", 100 ); // The additional scaling factor used to help get fractional rates in integer format +define( "SCALE_BASE", 100 ); // The additional scaling factor used to help get fractional scales in integer format + +// +// Date and time formats, eventually some of these may end up in the language files +// +define( "DATE_FMT_CONSOLE_LONG", "D jS M, g:ia" ); // This is the main console date/time, date() or strftime() format +define( "DATE_FMT_CONSOLE_SHORT", "%H:%M" ); // This is the xHTML console date/time, date() or strftime() format + +define( "STRF_FMT_DATETIME_DB", "%Y-%m-%d %H:%M:%S" ); // Strftime format for database queries, don't change + +define( "STRF_FMT_DATETIME", "%c" ); // Strftime locale aware format for dates with times +define( "STRF_FMT_DATE", "%x" ); // Strftime locale aware format for dates without times +define( "STRF_FMT_TIME", "%X" ); // Strftime locale aware format for times without dates + +define( "STRF_FMT_DATETIME_SHORT", "%y/%m/%d %H:%M:%S" ); // Strftime shorter format for dates with time, not locale aware +define( "STRF_FMT_DATETIME_SHORTER", "%m/%d %H:%M:%S" ); // Strftime shorter format for dates with time, not locale aware, used where space is tight + +define( "MYSQL_FMT_DATETIME_SHORT", "%y/%m/%d %H:%i:%S" ); // MySQL date_format shorter format for dates with time + +require_once( 'database.php' ); +loadConfig(); + +$GLOBALS['defaultUser'] = array( + "Username" => "admin", + "Password" => "", + "Language" => "", + "Enabled" => 1, + "Stream" => 'View', + "Events" => 'Edit', + "Control" => 'Edit', + "Monitors" => 'Edit', + "Devices" => 'Edit', + "System" => 'Edit', + "MaxBandwidth" => "", + "MonitorIds" => false +); + +function loadConfig( $defineConsts=true ) +{ + global $config; + global $configCats; + + $config = array(); + $configCat = array(); + + $sql = "select * from Config order by Id asc"; + $result = mysql_query( $sql ); + if ( !$result ) + echo mysql_error(); + $monitors = array(); + while( $row = mysql_fetch_assoc( $result ) ) + { + if ( $defineConsts ) + define( $row['Name'], $row['Value'] ); + $config[$row['Name']] = $row; + if ( !($configCat = &$configCats[$row['Category']]) ) + { + $configCats[$row['Category']] = array(); + $configCat = &$configCats[$row['Category']]; + } + $configCat[$row['Name']] = $row; + } + //print_r( $config ); + //print_r( $configCats ); +} + +?> diff --git a/web/includes/control_functions.php b/web/includes/control_functions.php new file mode 100644 index 000000000..a4549155e --- /dev/null +++ b/web/includes/control_functions.php @@ -0,0 +1,969 @@ + array( + 'Up' => 'Left', + 'Down' => 'Right', + 'Left' => 'Down', + 'Right' => 'Up', + 'UpLeft' => 'DownLeft', + 'UpRight' => 'UpLeft', + 'DownLeft' => 'DownRight', + 'DownRight' => 'UpRight', + ), + '180' => array( + 'Up' => 'Down', + 'Down' => 'Up', + 'Left' => 'Right', + 'Right' => 'Left', + 'UpLeft' => 'DownRight', + 'UpRight' => 'DownLeft', + 'DownLeft' => 'UpRight', + 'DownRight' => 'UpLeft', + ), + '270' => array( + 'Up' => 'Right', + 'Down' => 'Left', + 'Left' => 'Up', + 'Right' => 'Down', + 'UpLeft' => 'UpRight', + 'UpRight' => 'DownRight', + 'DownLeft' => 'UpLeft', + 'DownRight' => 'DownLeft', + ), + 'hori' => array( + 'Up' => 'Up', + 'Down' => 'Down', + 'Left' => 'Right', + 'Right' => 'Left', + 'UpLeft' => 'UpRight', + 'UpRight' => 'UpLeft', + 'DownLeft' => 'DownRight', + 'DownRight' => 'DownLeft', + ), + 'vert' => array( + 'Up' => 'Down', + 'Down' => 'Up', + 'Left' => 'Left', + 'Right' => 'Right', + 'UpLeft' => 'DownLeft', + 'UpRight' => 'DownRight', + 'DownLeft' => 'UpLeft', + 'DownRight' => 'UpRight', + ), + ); + $new_dirn = $conversions[$monitor['Orientation']][$dirn]; + $_REQUEST['control'] = preg_replace( "/_$dirn\$/", "_$new_dirn", $_REQUEST['control'] ); + $dirn = $new_dirn; + } + + if ( $monitor['HasPanSpeed'] && $xFactor ) + { + if ( $monitor['HasTurboPan'] ) + { + if ( $xFactor >= $turbo ) + { + $panSpeed = $monitor['TurboPanSpeed']; + } + else + { + $xFactor = $xFactor/$turbo; + $panSpeed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$xFactor))); + } + } + else + { + $panSpeed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$xFactor))); + } + $ctrlCommand .= " --panspeed=".$panSpeed; + } + if ( $monitor['HasTiltSpeed'] && $yFactor ) + { + if ( $monitor['HasTurboTilt'] ) + { + if ( $yFactor >= $turbo ) + { + $tiltSpeed = $monitor['TurboTiltSpeed']; + } + else + { + $yFactor = $yFactor/$turbo; + $tiltSpeed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$yFactor))); + } + } + else + { + $tiltSpeed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$yFactor))); + } + $ctrlCommand .= " --tiltspeed=".$tiltSpeed; + } + switch( $mode ) + { + case 'Rel' : + case 'Abs' : + { + if ( preg_match( '/(Left|Right)$/', $dirn ) ) + { + $panStep = intval(round($monitor['MinPanStep']+(($monitor['MaxPanStep']-$monitor['MinPanStep'])*$xFactor))); + $ctrlCommand .= " --panstep=".$panStep; + } + if ( preg_match( '/^(Up|Down)/', $dirn ) ) + { + $tiltStep = intval(round($monitor['MinTiltStep']+(($monitor['MaxTiltStep']-$monitor['MinTiltStep'])*$yFactor))); + $ctrlCommand .= " --tiltstep=".$tiltStep; + } + break; + } + case 'Con' : + { + if ( $monitor['AutoStopTimeout'] ) + { + $slowPanSpeed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$slow))); + $slowTiltSpeed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$slow))); + if ( (!isset($panSpeed) || ($panSpeed < $slowPanSpeed)) && (!isset($tiltSpeed) || ($tiltSpeed < $slowTiltSpeed)) ) + { + $ctrlCommand .= " --autostop"; + } + } + break; + } + } + } + } + } + } + elseif ( isset($_REQUEST['x']) && isset($_REQUEST['y']) ) + { + if ( $_REQUEST['control'] == "moveMap" ) + { + $x = deScale( $_REQUEST['x'], $_REQUEST['scale'] ); + $y = deScale( $_REQUEST['y'], $_REQUEST['scale'] ); + switch ( $monitor['Orientation'] ) + { + case '0' : + case '180' : + case 'hori' : + case 'vert' : + $width = $monitor['Width']; + $height = $monitor['Height']; + break; + case '90' : + case '270' : + $width = $monitor['Height']; + $height = $monitor['Width']; + break; + } + switch ( $monitor['Orientation'] ) + { + case '90' : + $tempY = $y; + $y = $height - $x; + $x = $tempY; + break; + case '180' : + $x = $width - $x; + $y = $height - $y; + break; + case '270' : + $tempX = $x; + $x = $width - $y; + $y = $tempX; + break; + case 'hori' : + $x = $width - $x; + break; + case 'vert' : + $y = $height - $y; + break; + } + //$ctrlCommand .= " --xcoord=$x --ycoord=$y --width=$width --height=$height"; + $ctrlCommand .= " --xcoord=$x --ycoord=$y"; + } + elseif ( $_REQUEST['control'] == "movePseudoMap" ) + { + $x = deScale( $_REQUEST['x'], $_REQUEST['scale'] ); + $y = deScale( $_REQUEST['y'], $_REQUEST['scale'] ); + + $halfWidth = $monitor['Width'] / 2; + $halfHeight = $monitor['Height'] / 2; + $xFactor = ($x - $halfWidth)/$halfWidth; + $yFactor = ($y - $halfHeight)/$halfHeight; + + switch ( $monitor['Orientation'] ) + { + case '90' : + $tempYFactor = $y; + $yFactor = -$xFactor; + $xFactor = $tempYFactor; + break; + case '180' : + $xFactor = -$xFactor; + $yFactor = -$yFactor; + break; + case '270' : + $tempXFactor = $x; + $xFactor = -$yFactor; + $yFactor = $tempXFactor; + break; + case 'hori' : + $xFactor = -$xFactor; + break; + case 'vert' : + $yFactor = -$yFactor; + break; + } + + $turbo = 0.9; // Threshold for turbo speed + $blind = 0.1; // Threshold for blind spot + + $panControl = ''; + $tiltControl = ''; + if ( $xFactor > $blind ) + { + $panControl = 'Right'; + } + elseif ( $xFactor < -$blind ) + { + $panControl = 'Left'; + } + if ( $yFactor > $blind ) + { + $tiltControl = 'Down'; + } + elseif ( $yFactor < -$blind ) + { + $tiltControl = 'Up'; + } + + $dirn = $tiltControl.$panControl; + if ( !$dirn ) + { + // No command, probably in blind spot in middle + $_REQUEST['control'] = 'null'; + return( false ); + } + else + { + $_REQUEST['control'] = 'moveRel'.$dirn; + $xFactor = abs($xFactor); + $yFactor = abs($yFactor); + + if ( $monitor['HasPanSpeed'] && $xFactor ) + { + if ( $monitor['HasTurboPan'] ) + { + if ( $xFactor >= $turbo ) + { + $panSpeed = $monitor['TurboPanSpeed']; + } + else + { + $xFactor = $xFactor/$turbo; + $panSpeed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$xFactor))); + } + } + else + { + $panSpeed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$xFactor))); + } + } + if ( $monitor['HasTiltSpeed'] && $yFactor ) + { + if ( $monitor['HasTurboTilt'] ) + { + if ( $yFactor >= $turbo ) + { + $tiltSpeed = $monitor['TurboTiltSpeed']; + } + else + { + $yFactor = $yFactor/$turbo; + $tiltSpeed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$yFactor))); + } + } + else + { + $tiltSpeed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$yFactor))); + } + } + if ( preg_match( '/(Left|Right)$/', $dirn ) ) + { + $panStep = intval(round($monitor['MinPanStep']+(($monitor['MaxPanStep']-$monitor['MinPanStep'])*$xFactor))); + $ctrlCommand .= " --panstep=".$panStep." --panspeed=".$panSpeed; + } + if ( preg_match( '/^(Up|Down)/', $dirn ) ) + { + $tiltStep = intval(round($monitor['MinTiltStep']+(($monitor['MaxTiltStep']-$monitor['MinTiltStep'])*$yFactor))); + $ctrlCommand .= " --tiltstep=".$tiltStep." --tiltspeed=".$tiltSpeed; + } + } + } + elseif ( $_REQUEST['control'] == "moveConMap" ) + { + $x = deScale( $_REQUEST['x'], $_REQUEST['scale'] ); + $y = deScale( $_REQUEST['y'], $_REQUEST['scale'] ); + + $halfWidth = $monitor['Width'] / 2; + $halfHeight = $monitor['Height'] / 2; + $xFactor = ($x - $halfWidth)/$halfWidth; + $yFactor = ($y - $halfHeight)/$halfHeight; + + switch ( $monitor['Orientation'] ) + { + case '90' : + $tempYFactor = $y; + $yFactor = -$xFactor; + $xFactor = $tempYFactor; + break; + case '180' : + $xFactor = -$xFactor; + $yFactor = -$yFactor; + break; + case '270' : + $tempXFactor = $x; + $xFactor = -$yFactor; + $yFactor = $tempXFactor; + break; + case 'hori' : + $xFactor = -$xFactor; + break; + case 'vert' : + $yFactor = -$yFactor; + break; + } + + $slow = 0.9; // Threshold for slow speed/timeouts + $turbo = 0.9; // Threshold for turbo speed + $blind = 0.1; // Threshold for blind spot + + $panControl = ''; + $tiltControl = ''; + if ( $xFactor > $blind ) + { + $panControl = 'Right'; + } + elseif ( $xFactor < -$blind ) + { + $panControl = 'Left'; + } + if ( $yFactor > $blind ) + { + $tiltControl = 'Down'; + } + elseif ( $yFactor < -$blind ) + { + $tiltControl = 'Up'; + } + + $dirn = $tiltControl.$panControl; + if ( !$dirn ) + { + // No command, probably in blind spot in middle + $_REQUEST['control'] = 'moveStop'; + } + else + { + $_REQUEST['control'] = 'moveCon'.$dirn; + $xFactor = abs($xFactor); + $yFactor = abs($yFactor); + + if ( $monitor['HasPanSpeed'] && $xFactor ) + { + if ( $monitor['HasTurboPan'] ) + { + if ( $xFactor >= $turbo ) + { + $panSpeed = $monitor['TurboPanSpeed']; + } + else + { + $xFactor = $xFactor/$turbo; + $panSpeed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$xFactor))); + } + } + else + { + $panSpeed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$xFactor))); + } + } + if ( $monitor['HasTiltSpeed'] && $yFactor ) + { + if ( $monitor['HasTurboTilt'] ) + { + if ( $yFactor >= $turbo ) + { + $tiltSpeed = $monitor['TurboTiltSpeed']; + } + else + { + $yFactor = $yFactor/$turbo; + $tiltSpeed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$yFactor))); + } + } + else + { + $tiltSpeed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$yFactor))); + } + } + if ( preg_match( '/(Left|Right)$/', $dirn ) ) + { + $ctrlCommand .= " --panspeed=".$panSpeed; + } + if ( preg_match( '/^(Up|Down)/', $dirn ) ) + { + $ctrlCommand .= " --tiltspeed=".$tiltSpeed; + } + if ( $monitor['AutoStopTimeout'] ) + { + $slowPanSpeed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$slow))); + $slowTiltSpeed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$slow))); + if ( (!isset($panSpeed) || ($panSpeed < $slowPanSpeed)) && (!isset($tiltSpeed) || ($tiltSpeed < $slowTiltSpeed)) ) + { + $ctrlCommand .= " --autostop"; + } + } + } + } + else + { + $slow = 0.9; // Threshold for slow speed/timeouts + $turbo = 0.9; // Threshold for turbo speed + $long_y = 48; + $short_x = 32; + $short_y = 32; + + if ( preg_match( '/^([a-z]+)([A-Z][a-z]+)([A-Z][a-z]+)$/', $_REQUEST['control'], $matches ) ) + { + $command = $matches[1]; + $mode = $matches[2]; + $dirn = $matches[3]; + + switch( $command ) + { + case 'focus' : + { + switch( $dirn ) + { + case 'Near' : + { + $factor = ($long_y-($y+1))/$long_y; + break; + } + case 'Far' : + { + $factor = ($y+1)/$long_y; + break; + } + } + if ( $monitor['HasFocusSpeed'] ) + { + $speed = intval(round($monitor['MinFocusSpeed']+(($monitor['MaxFocusSpeed']-$monitor['MinFocusSpeed'])*$factor))); + $ctrlCommand .= " --speed=".$speed; + } + switch( $mode ) + { + case 'Abs' : + case 'Rel' : + { + $step = intval(round($monitor['MinFocusStep']+(($monitor['MaxFocusStep']-$monitor['MinFocusStep'])*$factor))); + $ctrlCommand .= " --step=".$step; + break; + } + case 'Con' : + { + if ( $monitor['AutoStopTimeout'] ) + { + $slowSpeed = intval(round($monitor['MinFocusSpeed']+(($monitor['MaxFocusSpeed']-$monitor['MinFocusSpeed'])*$slow))); + if ( $speed < $slowSpeed ) + { + $ctrlCommand .= " --autostop"; + } + } + break; + } + } + break; + } + case 'zoom' : + { + switch( $dirn ) + { + case 'Tele' : + { + $factor = ($long_y-($y+1))/$long_y; + break; + } + case 'Wide' : + { + $factor = ($y+1)/$long_y; + break; + } + } + if ( $monitor['HasZoomSpeed'] ) + { + $speed = intval(round($monitor['MinZoomSpeed']+(($monitor['MaxZoomSpeed']-$monitor['MinZoomSpeed'])*$factor))); + $ctrlCommand .= " --speed=".$speed; + } + switch( $mode ) + { + case 'Abs' : + case 'Rel' : + { + $step = intval(round($monitor['MinZoomStep']+(($monitor['MaxZoomStep']-$monitor['MinZoomStep'])*$factor))); + $ctrlCommand .= " --step=".$step; + break; + } + case 'Con' : + { + if ( $monitor['AutoStopTimeout'] ) + { + $slowSpeed = intval(round($monitor['MinZoomSpeed']+(($monitor['MaxZoomSpeed']-$monitor['MinZoomSpeed'])*$slow))); + if ( $speed < $slowSpeed ) + { + $ctrlCommand .= " --autostop"; + } + } + break; + } + } + break; + } + case 'iris' : + { + switch( $dirn ) + { + case 'Open' : + { + $factor = ($long_y-($y+1))/$long_y; + break; + } + case 'Close' : + { + $factor = ($y+1)/$long_y; + break; + } + } + if ( $monitor['HasIrisSpeed'] ) + { + $speed = intval(round($monitor['MinIrisSpeed']+(($monitor['MaxIrisSpeed']-$monitor['MinIrisSpeed'])*$factor))); + $ctrlCommand .= " --speed=".$speed; + } + switch( $mode ) + { + case 'Abs' : + case 'Rel' : + { + $step = intval(round($monitor['MinIrisStep']+(($monitor['MaxIrisStep']-$monitor['MinIrisStep'])*$factor))); + $ctrlCommand .= " --step=".$step; + break; + } + } + break; + } + case 'white' : + { + switch( $dirn ) + { + case 'In' : + { + $factor = ($long_y-($y+1))/$long_y; + break; + } + case 'Out' : + { + $factor = ($y+1)/$long_y; + break; + } + } + if ( $monitor['HasWhiteSpeed'] ) + { + $speed = intval(round($monitor['MinWhiteSpeed']+(($monitor['MaxWhiteSpeed']-$monitor['MinWhiteSpeed'])*$factor))); + $ctrlCommand .= " --speed=".$speed; + } + switch( $mode ) + { + case 'Abs' : + case 'Rel' : + { + $step = intval(round($monitor['MinWhiteStep']+(($monitor['MaxWhiteStep']-$monitor['MinWhiteStep'])*$factor))); + $ctrlCommand .= " --step=".$step; + break; + } + } + break; + } + case 'gain' : + { + switch( $dirn ) + { + case 'Up' : + { + $factor = ($long_y-($y+1))/$long_y; + break; + } + case 'Down' : + { + $factor = ($y+1)/$long_y; + break; + } + } + if ( $monitor['HasGainSpeed'] ) + { + $speed = intval(round($monitor['MinGainSpeed']+(($monitor['MaxGainSpeed']-$monitor['MinGainSpeed'])*$factor))); + $ctrlCommand .= " --speed=".$speed; + } + switch( $mode ) + { + case 'Abs' : + case 'Rel' : + { + $step = intval(round($monitor['MinGainStep']+(($monitor['MaxGainStep']-$monitor['MinGainStep'])*$factor))); + $ctrlCommand .= " --step=".$step; + break; + } + } + break; + } + case 'move' : + { + $xFactor = 0; + $yFactor = 0; + + if ( preg_match( '/^Up/', $dirn ) ) + { + $yFactor = ($short_y-($y+1))/$short_y; + } + elseif ( preg_match( '/^Down/', $dirn ) ) + { + $yFactor = ($y+1)/$short_y; + } + if ( preg_match( '/Left$/', $dirn ) ) + { + $xFactor = ($short_x-($x+1))/$short_x; + } + elseif ( preg_match( '/Right$/', $dirn ) ) + { + $xFactor = ($x+1)/$short_x; + } + + if ( $monitor['Orientation'] != '0' ) + { + $conversions = array( + '90' => array( + 'Up' => 'Left', + 'Down' => 'Right', + 'Left' => 'Down', + 'Right' => 'Up', + 'UpLeft' => 'DownLeft', + 'UpRight' => 'UpLeft', + 'DownLeft' => 'DownRight', + 'DownRight' => 'UpRight', + ), + '180' => array( + 'Up' => 'Down', + 'Down' => 'Up', + 'Left' => 'Right', + 'Right' => 'Left', + 'UpLeft' => 'DownRight', + 'UpRight' => 'DownLeft', + 'DownLeft' => 'UpRight', + 'DownRight' => 'UpLeft', + ), + '270' => array( + 'Up' => 'Right', + 'Down' => 'Left', + 'Left' => 'Up', + 'Right' => 'Down', + 'UpLeft' => 'UpRight', + 'UpRight' => 'DownRight', + 'DownLeft' => 'UpLeft', + 'DownRight' => 'DownLeft', + ), + 'hori' => array( + 'Up' => 'Up', + 'Down' => 'Down', + 'Left' => 'Right', + 'Right' => 'Left', + 'UpLeft' => 'UpRight', + 'UpRight' => 'UpLeft', + 'DownLeft' => 'DownRight', + 'DownRight' => 'DownLeft', + ), + 'vert' => array( + 'Up' => 'Down', + 'Down' => 'Up', + 'Left' => 'Left', + 'Right' => 'Right', + 'UpLeft' => 'DownLeft', + 'UpRight' => 'DownRight', + 'DownLeft' => 'UpLeft', + 'DownRight' => 'UpRight', + ), + ); + $new_dirn = $conversions[$monitor['Orientation']][$dirn]; + $_REQUEST['control'] = preg_replace( "/_$dirn\$/", "_$new_dirn", $_REQUEST['control'] ); + $dirn = $new_dirn; + } + + if ( $monitor['HasPanSpeed'] && $xFactor ) + { + if ( $monitor['HasTurboPan'] ) + { + if ( $xFactor >= $turbo ) + { + $panSpeed = $monitor['TurboPanSpeed']; + } + else + { + $xFactor = $xFactor/$turbo; + $panSpeed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$xFactor))); + } + } + else + { + $panSpeed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$xFactor))); + } + $ctrlCommand .= " --panspeed=".$panSpeed; + } + if ( $monitor['HasTiltSpeed'] && $yFactor ) + { + if ( $monitor['HasTurboTilt'] ) + { + if ( $yFactor >= $turbo ) + { + $tiltSpeed = $monitor['TurboTiltSpeed']; + } + else + { + $yFactor = $yFactor/$turbo; + $tiltSpeed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$yFactor))); + } + } + else + { + $tiltSpeed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$yFactor))); + } + $ctrlCommand .= " --tiltspeed=".$tiltSpeed; + } + switch( $mode ) + { + case 'Rel' : + case 'Abs' : + { + if ( preg_match( '/(Left|Right)$/', $dirn ) ) + { + $panStep = intval(round($monitor['MinPanStep']+(($monitor['MaxPanStep']-$monitor['MinPanStep'])*$xFactor))); + $ctrlCommand .= " --panstep=".$panStep; + } + if ( preg_match( '/^(Up|Down)/', $dirn ) ) + { + $tiltStep = intval(round($monitor['MinTiltStep']+(($monitor['MaxTiltStep']-$monitor['MinTiltStep'])*$yFactor))); + $ctrlCommand .= " --tiltstep=".$tiltStep; + } + break; + } + case 'Con' : + { + if ( $monitor['AutoStopTimeout'] ) + { + $slowPanSpeed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$slow))); + $slowTiltSpeed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$slow))); + if ( (!isset($panSpeed) || ($panSpeed < $slowPanSpeed)) && (!isset($tiltSpeed) || ($tiltSpeed < $slowTiltSpeed)) ) + { + $ctrlCommand .= " --autostop"; + } + } + break; + } + } + } + } + } + } + } + else + { + if ( preg_match( '/^presetGoto(\d+)$/', $_REQUEST['control'], $matches ) ) + { + $_REQUEST['control'] = 'presetGoto'; + $ctrlCommand .= " --preset=".$matches[1]; + } + elseif ( $_REQUEST['control'] == "presetGoto" && !empty($_REQUEST['preset']) ) + { + $ctrlCommand .= " --preset=".$_REQUEST['preset']; + } + elseif ( $_REQUEST['control'] == "presetSet" ) + { + if ( canEdit( 'Control' ) ) + { + $preset = validInt($_REQUEST['preset']); + $newLabel = validJsStr($_REQUEST['newLabel']); + $row = dbFetchOne( "select * from ControlPresets where MonitorId = '".$monitor['Id']."' and Preset = '".dbEscape($preset)."'" ); + if ( $newLabel != $row['Label'] ) + { + if ( $newLabel ) + $sql = "replace into ControlPresets ( MonitorId, Preset, Label ) values ( '".$monitor['Id']."', '".dbEscape($preset)."', '".dbEscape($newLabel)."' )"; + else + $sql = "delete from ControlPresets where MonitorId = '".$monitor['Id']."' and Preset = '".dbEscape($preset)."'"; + dbQuery( $sql ); + } + $ctrlCommand .= " --preset=".$preset; + } + $ctrlCommand .= " --preset=".$preset; + } + elseif ( $_REQUEST['control'] == "moveMap" ) + { + $ctrlCommand .= " --xcoord=$x --ycoord=$y"; + } + } + $ctrlCommand .= " --command=".$_REQUEST['control']; + return( $ctrlCommand ); +} diff --git a/web/includes/database.php b/web/includes/database.php new file mode 100644 index 000000000..314029b20 --- /dev/null +++ b/web/includes/database.php @@ -0,0 +1,350 @@ += DB_LOG_DEBUG); + if ( $dbLogLevel > DB_LOG_OFF ) + Debug( "SQL-LOG: $sql".($noExecute?" (not executed)":"") ); + return( $noExecute ); +} + +function dbError( $sql ) +{ + Fatal( "SQL-ERR '".mysql_error()."', statement was '".$sql."'" ); +} + +function dbEscape( $string ) +{ + if ( version_compare( phpversion(), "4.3.0", "<") ) + if ( get_magic_quotes_gpc() ) + return( mysql_escape_string( stripslashes( $string ) ) ); + else + return( mysql_escape_string( $string ) ); + else + if ( get_magic_quotes_gpc() ) + return( mysql_real_escape_string( stripslashes( $string ) ) ); + else + return( mysql_real_escape_string( $string ) ); +} + +function dbQuery( $sql ) +{ + if ( dbLog( $sql, true ) ) + return; + if (!($result = mysql_query( $sql ))) + dbError( $sql ); + return( $result ); +} + +function dbFetchOne( $sql, $col=false ) +{ + dbLog( $sql ); + if (!($result = mysql_query( $sql ))) + dbError( $sql ); + + if ( $dbRow = mysql_fetch_assoc( $result ) ) + return( $col?$dbRow[$col]:$dbRow ); + return( false ); +} + +function dbFetchAll( $sql, $col=false ) +{ + dbLog( $sql ); + if (!($result = mysql_query( $sql ))) + dbError( $sql ); + + $dbRows = array(); + while( $dbRow = mysql_fetch_assoc( $result ) ) + $dbRows[] = $col?$dbRow[$col]:$dbRow; + return( $dbRows ); +} + +function dbFetchAssoc( $sql, $indexCol, $dataCol=false ) +{ + dbLog( $sql ); + if (!($result = mysql_query( $sql ))) + dbError( $sql ); + + $dbRows = array(); + while( $dbRow = mysql_fetch_assoc( $result ) ) + $dbRows[$dbRow[$indexCol]] = $dataCol?$dbRow[$dataCol]:$dbRow; + return( $dbRows ); +} + +function dbFetch( $sql, $col=false ) +{ + return( dbFetchAll( $sql, $col ) ); +} + +function dbFetchNext( $result, $col=false ) +{ + if ( $dbRow = mysql_fetch_assoc( $result ) ) + return( $col?$dbRow[$col]:$dbRow ); + return( false ); +} + +function dbNumRows( $sql ) +{ + dbLog( $sql ); + if (!($result = mysql_query( $sql ))) + dbError( $sql ); + return( mysql_num_rows( $result ) ); +} + +function dbInsertId() +{ + return( mysql_insert_id() ); +} + +function getEnumValues( $table, $column ) +{ + $row = dbFetchOne( "describe $table $column" ); + preg_match_all( "/'([^']+)'/", $row['Type'], $matches ); + return( $matches[1] ); +} + +function getSetValues( $table, $column ) +{ + return( getEnumValues( $table, $column ) ); +} + +function getUniqueValues( $table, $column, $asString=1 ) +{ + $values = array(); + $sql = "select distinct $column from $table where (not isnull($column) and $column != '') order by $column"; + foreach( dbFetchAll( $sql ) as $row ) + { + if ( $asString ) + $values[$row[$column]] = $row[$column]; + else + $values[] = $row[$column]; + } + return( $values ); +} + +function getTableColumns( $table, $asString=1 ) +{ + $columns = array(); + $table = dbEscape($table); + $sql = "describe $table"; + foreach( dbFetchAll( $sql ) as $row ) + { + if ( $asString ) + $columns[$row['Field']] = $row['Type']; + else + $columns[] = $row['Type']; + } + return( $columns ); +} + +function getTableAutoInc( $table ) +{ + $sql = "show table status where Name = '".dbEscape($table)."'"; + $row = dbFetchOne( $sql ); + return( $row['Auto_increment'] ); +} + +function getTableDescription( $table, $asString=1 ) +{ + $columns = array(); + $table = dbEscape($table); + $sql = "describe $table"; + foreach( dbFetchAll( $sql ) as $row ) + { + $desc = array( + 'name' => $row['Field'], + 'required' => ($row['Null']=='NO')?true:false, + 'default' => $row['Default'], + 'db' => $row, + ); + if ( preg_match( "/^varchar\((\d+)\)$/", $row['Type'], $matches ) ) + { + $desc['type'] = 'text'; + $desc['typeAttrib'] = 'varchar'; + $desc['maxLength'] = $matches[1]; + } + elseif ( preg_match( "/^(\w+)?text$/", $row['Type'], $matches ) ) + { + $desc['type'] = 'text'; + if (!empty($matches[1]) ) + $desc['typeAttrib'] = $matches[1]; + switch ( $matches[1] ) + { + case 'tiny' : + $desc['maxLength'] = 255; + break; + case 'medium' : + $desc['maxLength'] = 32768; + break; + case '' : + case 'big' : + //$desc['minLength'] = -128; + break; + default : + Error( "Unexpected text qualifier '".$matches[1]."' found for field '".$row['Field']."' in table '".$table."'" ); + break; + } + } + elseif ( preg_match( "/^(enum|set)\((.*)\)$/", $row['Type'], $matches ) ) + { + $desc['type'] = 'text'; + $desc['typeAttrib'] = $matches[1]; + preg_match_all( "/'([^']+)'/", $matches[2], $matches ); + $desc['values'] = $matches[1]; + } + elseif ( preg_match( "/^(\w+)?int\(\d+\)(?:\s+(unsigned))?$/", $row['Type'], $matches ) ) + { + $desc['type'] = 'integer'; + switch ( $matches[1] ) + { + case 'tiny' : + $desc['minValue'] = -128; + $desc['maxValue'] = 127; + break; + case 'small' : + $desc['minValue'] = -32768; + $desc['maxValue'] = 32767; + break; + case 'medium' : + $desc['minValue'] = -8388608; + $desc['maxValue'] = 8388607; + break; + case '' : + $desc['minValue'] = -2147483648; + $desc['maxValue'] = 2147483647; + break; + case 'big' : + //$desc['minValue'] = -128; + //$desc['maxValue'] = 127; + break; + default : + Error( "Unexpected integer qualifier '".$matches[1]."' found for field '".$row['Field']."' in table '".$table."'" ); + break; + } + if ( !empty($matches[1]) ) + $desc['typeAttrib'] = $matches[1]; + if ( $desc['unsigned'] = ( isset($matches[2]) && $matches[2] == 'unsigned' ) ) + { + $desc['maxValue'] += (-$desc['minValue']); + $desc['minValue'] = 0; + } + } + elseif ( preg_match( "/^(?:decimal|numeric)\((\d+)(?:,(\d+))?\)(?:\s+(unsigned))?$/", $row['Type'], $matches ) ) + { + $desc['type'] = 'fixed'; + $desc['range'] = $matches[1]; + if ( isset($matches[2]) ) + $desc['precision'] = $matches[2]; + else + $desc['precision'] = 0; + $desc['unsigned'] = ( isset($matches[3]) && $matches[3] == 'unsigned' ); + } + elseif ( preg_match( "/^(datetime|timestamp|date|time)$/", $row['Type'], $matches ) ) + { + $desc['type'] = 'datetime'; + switch ( $desc['typeAttrib'] = $matches[1] ) + { + case 'datetime' : + case 'timestamp' : + $desc['hasDate'] = true; + $desc['hasTime'] = true; + break; + case 'date' : + $desc['hasDate'] = true; + $desc['hasTime'] = false; + break; + case 'time' : + $desc['hasDate'] = false; + $desc['hasTime'] = true; + break; + } + } + else + { + Error( "Can't parse database type '".$row['Type']."' found for field '".$row['Field']."' in table '".$table."'" ); + } + + if ( $asString ) + $columns[$row['Field']] = $desc; + else + $columns[] = $desc; + } + return( $columns ); +} + +function dbFetchMonitor( $mid ) +{ + return( dbFetchOne( "select * from Monitors where Id = '".dbEscape($mid)."'" ) ); +} + +function dbFetchGroup( $gid ) +{ + return( dbFetchOne( "select * from Groups where Id = '".dbEscape($gid)."'" ) ); +} + +?> diff --git a/web/includes/functions.php b/web/includes/functions.php new file mode 100644 index 000000000..17fa04105 --- /dev/null +++ b/web/includes/functions.php @@ -0,0 +1,2436 @@ +/dev/null' ) ) ); +} + +function outputVideoStream( $id, $src, $width, $height, $format, $title="" ) +{ + if ( file_exists( $src ) ) + $mimeType = getMimeType( $src ); + else + { + switch( $format ) + { + case 'asf' : + $mimeType = "video/x-ms-asf"; + break; + case 'avi' : + case 'wmv' : + $mimeType = "video/x-msvideo"; + break; + case 'mov' : + $mimeType = "video/quicktime"; + break; + case 'mpg' : + case 'mpeg' : + $mimeType = "video/mpeg"; + break; + case 'swf' : + $mimeType = "application/x-shockwave-flash"; + break; + case '3gp' : + $mimeType = "video/3gpp"; + break; + default : + $mimeType = "video/$format"; + break; + } + } + if ( !$mimeType || ($mimeType == 'application/octet-stream') ) + $mimeType = 'video/'.$format; + $objectTag = false; + if ( ZM_WEB_USE_OBJECT_TAGS ) + { + switch( $mimeType ) + { + case "video/x-ms-asf" : + case "video/x-msvideo" : + case "video/mp4" : + { + if ( isWindows() ) + { +?> + + + + + + + + + + + + + + + + + + + + + + + +src="" +name="" +width="" +height="" +autostart="1" +autoplay="1" +showcontrols="0" +controller="0"> + + + + + + + + + + + + + + + + <?= ZM_WEB_TITLE_PREFIX ?> - <?= validHtmlStr($title) ?> + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/skins/classic/includes/init.php b/web/skins/classic/includes/init.php new file mode 100644 index 000000000..e69de29bb diff --git a/web/skins/classic/includes/timeline_functions.php b/web/skins/classic/includes/timeline_functions.php new file mode 100644 index 000000000..74a58c06c --- /dev/null +++ b/web/skins/classic/includes/timeline_functions.php @@ -0,0 +1,524 @@ +"; + if ( $scaleRange >= $minLines ) + { + $scale['range'] = $scaleRange; + break; + } + } + if ( !isset($scale['range']) ) + { + $scale['range'] = (int)($range/($scale['factor']*$align)); + } + $scale['divisor'] = 1; + while ( ($scale['range']/$scale['divisor']) > $maxLines ) + { + $scale['divisor']++; + } + $scale['lines'] = (int)($scale['range']/$scale['divisor']); + return( $scale ); +} + +function getYScale( $range, $minLines, $maxLines ) +{ + $scale['range'] = $range; + $scale['divisor'] = 1; + while ( $scale['range']/$scale['divisor'] > $maxLines ) + { + $scale['divisor']++; + } + $scale['lines'] = (int)(($scale['range']-1)/$scale['divisor'])+1; + + return( $scale ); +} + +function getSlotFrame( $slot ) +{ + $slotFrame = isset($slot['frame'])?$slot['frame']['FrameId']:1; + if ( false && $slotFrame ) + { + $slotFrame -= $monitor['PreEventCount']; + if ( $slotFrame < 1 ) + $slotFrame = 1; + } + return( $slotFrame ); +} + +function parseFilterToTree( $filter ) +{ + if ( count($filter['terms']) > 0 ) + { + $postfixExpr = array(); + $postfixStack = array(); + + $priorities = array( + '<' => 1, + '<=' => 1, + '>' => 1, + '>=' => 1, + '=' => 2, + '!=' => 2, + '=~' => 2, + '!~' => 2, + '=[]' => 2, + '![]' => 2, + 'and' => 3, + 'or' => 4, + ); + + for ( $i = 0; $i <= count($filter['terms']); $i++ ) + { + if ( !empty($filter['terms'][$i]['cnj']) ) + { + while( true ) + { + if ( !count($postfixStack) ) + { + $postfixStack[] = array( 'type'=>"cnj", 'value'=>$filter['terms'][$i]['cnj'], 'sqlValue'=>$filter['terms'][$i]['cnj']); + break; + } + elseif ( $postfixStack[count($postfixStack)-1]['type'] == 'obr' ) + { + $postfixStack[] = array( 'type'=>"cnj", 'value'=>$filter['terms'][$i]['cnj'], 'sqlValue'=>$filter['terms'][$i]['cnj']); + break; + } + elseif ( $priorities[$filter['terms'][$i]['cnj']] < $priorities[$postfixStack[count($postfixStack)-1]['value']] ) + { + $postfixStack[] = array( 'type'=>"cnj", 'value'=>$filter['terms'][$i]['cnj'], 'sqlValue'=>$filter['terms'][$i]['cnj']); + break; + } + else + { + $postfixExpr[] = array_pop( $postfixStack ); + } + } + } + if ( !empty($filter['terms'][$i]['obr']) ) + { + for ( $j = 0; $j < $filter['terms'][$i]['obr']; $j++ ) + { + $postfixStack[] = array( 'type'=>"obr", 'value'=>$filter['terms'][$i]['obr']); + } + } + if ( !empty($filter['terms'][$i]['attr']) ) + { + $dtAttr = false; + switch ( $filter['terms'][$i]['attr']) + { + case 'MonitorName': + $sqlValue = 'M.'.preg_replace( '/^Monitor/', '', $filter['terms'][$i]['attr']); + break; + case 'Name': + $sqlValue = "E.Name"; + break; + case 'Cause': + $sqlValue = "E.Cause"; + break; + case 'DateTime': + $sqlValue = "E.StartTime"; + $dtAttr = true; + break; + case 'Date': + $sqlValue = "to_days( E.StartTime )"; + $dtAttr = true; + break; + case 'Time': + $sqlValue = "extract( hour_second from E.StartTime )"; + break; + case 'Weekday': + $sqlValue = "weekday( E.StartTime )"; + break; + case 'Id': + case 'Name': + case 'MonitorId': + case 'Length': + case 'Frames': + case 'AlarmFrames': + case 'TotScore': + case 'AvgScore': + case 'MaxScore': + case 'Archived': + $sqlValue = "E.".$filter['terms'][$i]['attr']; + break; + case 'DiskPercent': + $sqlValue = getDiskPercent(); + break; + case 'DiskBlocks': + $sqlValue = getDiskBlocks(); + break; + default : + $sqlValue = $filter['terms'][$i]['attr']; + break; + } + if ( $dtAttr ) + { + $postfixExpr[] = array( 'type'=>"attr", 'value'=>$filter['terms'][$i]['attr'], 'sqlValue'=>$sqlValue, 'dtAttr'=>true ); + } + else + { + $postfixExpr[] = array( 'type'=>"attr", 'value'=>$filter['terms'][$i]['attr'], 'sqlValue'=>$sqlValue ); + } + } + if ( isset($filter['terms'][$i]['op']) ) + { + if ( empty($filter['terms'][$i]['op']) ) + { + $filter['terms'][$i]['op' ]= '='; + } + switch ( $filter['terms'][$i]['op' ]) + { + case '=' : + case '!=' : + case '>=' : + case '>' : + case '<' : + case '<=' : + $sqlValue = $filter['terms'][$i]['op']; + break; + case '=~' : + $sqlValue = "regexp"; + break; + case '!~' : + $sqlValue = "not regexp"; + break; + case '=[]' : + $sqlValue = 'in ('; + break; + case '![]' : + $sqlValue = 'not in ('; + break; + } + while( true ) + { + if ( !count($postfixStack) ) + { + $postfixStack[] = array( 'type'=>"op", 'value'=>$filter['terms'][$i]['op'], 'sqlValue'=>$sqlValue ); + break; + } + elseif ( $postfixStack[count($postfixStack)-1]['type'] == 'obr' ) + { + $postfixStack[] = array( 'type'=>"op", 'value'=>$filter['terms'][$i]['op'], 'sqlValue'=>$sqlValue ); + break; + } + elseif ( $priorities[$filter['terms'][$i]['op']] < $priorities[$postfixStack[count($postfixStack)-1]['value']] ) + { + $postfixStack[] = array( 'type'=>"op", 'value'=>$filter['terms'][$i]['op'], 'sqlValue'=>$sqlValue ); + break; + } + else + { + $postfixExpr[] = array_pop( $postfixStack ); + } + } + } + if ( isset($filter['terms'][$i]['val']) ) + { + $valueList = array(); + foreach ( preg_split( '/["\'\s]*?,["\'\s]*?/', preg_replace( '/^["\']+?(.+)["\']+?$/', '$1', $filter['terms'][$i]['val' ]) ) as $value ) + { + switch ( $filter['terms'][$i]['attr']) + { + case 'MonitorName': + case 'Name': + case 'Cause': + $value = "'$value'"; + break; + case 'DateTime': + $value = "'".strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) )."'"; + break; + case 'Date': + $value = "to_days( '".strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) )."' )"; + break; + case 'Time': + $value = "extract( hour_second from '".strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) )."' )"; + break; + case 'Weekday': + $value = "weekday( '".strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) )."' )"; + break; + } + $valueList[] = $value; + } + $postfixExpr[] = array( 'type'=>"val", 'value'=>$filter['terms'][$i]['val'], 'sqlValue'=>join( ',', $valueList ) ); + } + if ( !empty($filter['terms'][$i]['cbr']) ) + { + for ( $j = 0; $j < $filter['terms'][$i]['cbr']; $j++ ) + { + while ( count($postfixStack) ) + { + $element = array_pop( $postfixStack ); + if ( $element['type'] == "obr" ) + { + $postfixExpr[count($postfixExpr)-1]['bracket'] = true; + break; + } + $postfixExpr[] = $element; + } + } + } + } + while ( count($postfixStack) ) + { + $postfixExpr[] = array_pop( $postfixStack ); + } + + $exprStack = array(); + //foreach ( $postfixExpr as $element ) + //{ + //echo $element['value']." "; + //} + //echo "
"; + foreach ( $postfixExpr as $element ) + { + if ( $element['type'] == 'attr' || $element['type'] == 'val' ) + { + $node = array( 'data'=>$element, 'count'=>0 ); + $exprStack[] = $node; + } + elseif ( $element['type'] == 'op' || $element['type'] == 'cnj' ) + { + $right = array_pop( $exprStack ); + $left = array_pop( $exprStack ); + $node = array( 'data'=>$element, 'count'=>2+$left['count']+$right['count'], 'right'=>$right, 'left'=>$left ); + $exprStack[] = $node; + } + else + { + Fatal( "Unexpected element type '".$element['type']."', value '".$element['value']."'" ); + } + } + if ( count($exprStack) != 1 ) + { + Fatal( "Expression stack has ".count($exprStack)." elements" ); + } + $exprTree = array_pop( $exprStack ); + return( $exprTree ); + } + return( false ); +} + +function _parseTreeToInfix( $node ) +{ + $expression = ''; + if ( isset($node) ) + { + if ( isset($node['left']) ) + { + if ( !empty($node['data']['bracket']) ) + $expression .= '( '; + $expression .= _parseTreeToInfix( $node['left'] ); + } + $expression .= $node['data']['value']." "; + if ( isset($node['right']) ) + { + $expression .= _parseTreeToInfix( $node['right'] ); + if ( !empty($node['data']['bracket']) ) + $expression .= ') '; + } + } + return( $expression ); +} + +function parseTreeToInfix( $tree ) +{ + return( _parseTreeToInfix( $tree ) ); +} + +function _parseTreeToSQL( $node, $cbr=false ) +{ + $expression = ''; + if ( $node ) + { + if ( isset($node['left']) ) + { + if ( !empty($node['data']['bracket']) ) + $expression .= '( '; + $expression .= _parseTreeToSQL( $node['left'] ); + } + $inExpr = $node['data']['type'] == 'op' && ($node['data']['value'] == '=[]' || $node['data']['value'] == '![]'); + $expression .= $node['data']['sqlValue']; + if ( !$inExpr ) + $expression .= ' '; + if ( $cbr ) + $expression .= ') '; + if ( isset($node['right']) ) + { + $expression .= _parseTreeToSQL( $node['right'], $inExpr ); + if ( !empty($node['data']['bracket']) ) + $expression .= ') '; + } + } + return( $expression ); +} + +function parseTreeToSQL( $tree ) +{ + return( _parseTreeToSQL( $tree ) ); +} + +function _parseTreeToFilter( $node, &$terms, &$level ) +{ + $elements = array(); + if ( $node ) + { + if ( isset($node['left']) ) + { + if ( !empty($node['data']['bracket']) ) + $terms[$level]['obr'] = 1; + _parseTreeToFilter( $node['left'], $terms, $level ); + } + if ( $node['data']['type'] == 'cnj' ) + { + $level++; + } + $terms[$level][$node['data']['type']] = $node['data']['value']; + if ( isset($node['right']) ) + { + _parseTreeToFilter( $node['right'], $terms, $level ); + if ( !empty($node['data']['bracket']) ) + $terms[$level]['cbr'] = 1; + } + } +} + +function parseTreeToFilter( $tree ) +{ + $terms = array(); + if ( isset($tree) ) + { + $level = 0; + _parseTreeToFilter( $tree, $terms, $level ); + } + return( array( 'terms' => $terms ) ); +} + +function parseTreeToQuery( $tree ) +{ + $filter = parseTreeToFilter( $tree ); + parseFilter( $filter, false, '&' ); + return( $filter['query'] ); +} + +function _drawTree( $node, $level ) +{ + if ( isset($node['left']) ) + { + _drawTree( $node['left'], $level+1 ); + } + echo str_repeat( ".", $level*2 ).$node['data']['value']."
"; + if ( isset($node['right']) ) + { + _drawTree( $node['right'], $level+1 ); + } +} + +function drawTree( $tree ) +{ + _drawTree( $tree, 0 ); +} + +function _extractDatetimeRange( &$node, &$minTime, &$maxTime, &$expandable, $subOr ) +{ + $pruned = $leftPruned = $rightPruned = false; + if ( $node ) + { + if ( isset($node['left']) && isset($node['right']) ) + { + if ( $node['data']['type'] == 'cnj' && $node['data']['value'] == 'or' ) + { + $subOr = true; + } + elseif ( !empty($node['left']['data']['dtAttr']) ) + { + if ( $subOr ) + { + $expandable = false; + } + elseif ( $node['data']['type'] == 'op' ) + { + if ( $node['data']['value'] == '>' || $node['data']['value'] == '>=' ) + { + if ( !$minTime || $minTime > $node['right']['data']['sqlValue'] ) + { + $minTime = $node['right']['data']['value']; + return( true ); + } + } + if ( $node['data']['value'] == '<' || $node['data']['value'] == '<=' ) + { + if ( !$maxTime || $maxTime < $node['right']['data']['sqlValue'] ) + { + $maxTime = $node['right']['data']['value']; + return( true ); + } + } + } + else + { + Fatal( "Unexpected node type '".$node['data']['type']."'" ); + } + return( false ); + } + + $leftPruned = _extractDatetimeRange( $node['left'], $minTime, $maxTime, $expandable, $subOr ); + $rightPruned = _extractDatetimeRange( $node['right'], $minTime, $maxTime, $expandable, $subOr ); + + if ( $leftPruned && $rightPruned ) + { + $pruned = true; + } + elseif ( $leftPruned ) + { + $node = $node['right']; + } + elseif ( $rightPruned ) + { + $node = $node['left']; + } + } + } + return( $pruned ); +} + +function extractDatetimeRange( &$tree, &$minTime, &$maxTime, &$expandable ) +{ + $minTime = ""; + $maxTime = ""; + $expandable = true; + + _extractDateTimeRange( $tree, $minTime, $maxTime, $expandable, false ); +} + +function appendDatetimeRange( &$tree, $minTime, $maxTime=false ) +{ + $attrNode = array( 'data'=>array( 'type'=>'attr', 'value'=>'DateTime', 'sqlValue'=>'E.StartTime', 'dtAttr'=>true ), 'count'=>0 ); + $valNode = array( 'data'=>array( 'type'=>'val', 'value'=>$minTime, 'sqlValue'=>$minTime ), 'count'=>0 ); + $opNode = array( 'data'=>array( 'type'=>'op', 'value'=>'>=', 'sqlValue'=>'>=' ), 'count'=>2, 'left'=>$attrNode, 'right'=>$valNode ); + if ( isset($tree) ) + { + $cnjNode = array( 'data'=>array( 'type'=>'cnj', 'value'=>'and', 'sqlValue'=>'and' ), 'count'=>2+$tree['count']+$opNode['count'], 'left'=>$tree, 'right'=>$opNode ); + $tree = $cnjNode; + } + else + { + $tree = $opNode; + } + + if ( $maxTime ) + { + $attrNode = array( 'data'=>array( 'type'=>'attr', 'value'=>'DateTime', 'sqlValue'=>'E.StartTime', 'dtAttr'=>true ), 'count'=>0 ); + $valNode = array( 'data'=>array( 'type'=>'val', 'value'=>$maxTime, 'sqlValue'=>$maxTime ), 'count'=>0 ); + $opNode = array( 'data'=>array( 'type'=>'op', 'value'=>'<=', 'sqlValue'=>'<=' ), 'count'=>2, 'left'=>$attrNode, 'right'=>$valNode ); + $cnjNode = array( 'data'=>array( 'type'=>'cnj', 'value'=>'and', 'sqlValue'=>'and' ), 'count'=>2+$tree['count']+$opNode['count'], 'left'=>$tree, 'right'=>$opNode ); + $tree = $cnjNode; + } +} + +?> diff --git a/web/skins/classic/js/Makefile.am b/web/skins/classic/js/Makefile.am new file mode 100644 index 000000000..22f944d9e --- /dev/null +++ b/web/skins/classic/js/Makefile.am @@ -0,0 +1,7 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/skins/classic/js + +dist_web_DATA = \ + skin.js \ + skin.js.php diff --git a/web/skins/classic/js/Makefile.in b/web/skins/classic/js/Makefile.in new file mode 100644 index 000000000..04d248260 --- /dev/null +++ b/web/skins/classic/js/Makefile.in @@ -0,0 +1,454 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/skins/classic/js +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +webdir = @WEB_PREFIX@/skins/classic/js +dist_web_DATA = \ + skin.js \ + skin.js.php + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/skins/classic/js/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/skins/classic/js/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_webDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/skins/classic/js/skin.js b/web/skins/classic/js/skin.js new file mode 100644 index 000000000..32d83a9cd --- /dev/null +++ b/web/skins/classic/js/skin.js @@ -0,0 +1,289 @@ +// +// ZoneMinder base static javascript 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. +// + +// +// This file should only contain static JavaScript and no php. +// Use skin.js.php for JavaScript that need pre-processing +// + +// Javascript window sizes +var popupSizes = { + 'bandwidth': { 'width': 200, 'height': 120 }, + 'console': { 'width': 750, 'height': 312 }, + 'control': { 'width': 380, 'height': 480 }, + 'controlcaps': { 'width': 780, 'height': 320 }, + 'controlcap': { 'width': 400, 'height': 400 }, + 'cycle': { 'addWidth': 16, 'minWidth': 384, 'addHeight': 48 }, + 'device': { 'width': 260, 'height': 150 }, + 'devices': { 'width': 400, 'height': 240 }, + 'donate': { 'width': 500, 'height': 280 }, + 'event': { 'addWidth': 108, 'minWidth': 496, 'addHeight': 200, minHeight: 540 }, + 'eventdetail': { 'width': 400, 'height': 220 }, + 'events': { 'width': 760, 'height': 480 }, + 'export': { 'width': 400, 'height': 340 }, + 'filter': { 'width': 720, 'height': 360 }, + 'filtersave': { 'width': 560, 'height': 120 }, + 'frame': { 'addWidth': 32, 'minWidth': 384, 'addHeight': 100 }, + 'frames': { 'width': 500, 'height': 300 }, + 'function': { 'width': 248, 'height': 92 }, + 'group': { 'width': 360, 'height': 180 }, + 'groups': { 'width': 400, 'height': 220 }, + 'image': { 'addWidth': 48, 'addHeight': 80 }, + 'log': { 'width': 980, 'height': 720 }, + 'login': { 'width': 720, 'height': 480 }, + 'logout': { 'width': 240, 'height': 100 }, + 'monitor': { 'width': 380, 'height': 364 }, + 'monitorpreset':{ 'width': 400, 'height': 200 }, + 'monitorprobe': { 'width': 500, 'height': 240 }, + 'monitorselect':{ 'width': 160, 'height': 200 }, + 'montage': { 'width': -1, 'height': -1 }, + 'optionhelp': { 'width': 400, 'height': 320 }, + 'options': { 'width': 960, 'height': 620 }, + 'preset': { 'width': 300, 'height': 120 }, + 'settings': { 'width': 200, 'height': 225 }, + 'state': { 'width': 240, 'height': 124 }, + 'stats': { 'width': 740, 'height': 200 }, + 'timeline': { 'width': 760, 'height': 540 }, + 'user': { 'width': 320, 'height': 420 }, + 'version': { 'width': 360, 'height': 140 }, + 'video': { 'width': 420, 'height': 360 }, + 'videoview': { 'addWidth': 48, 'addHeight': 80 }, + 'watch': { 'addWidth': 96, 'minWidth': 420, 'addHeight': 384 }, + 'zone': { 'addWidth': 450, 'addHeight': 200, 'minHeight': 450 }, + 'zones': { 'addWidth': 72, 'addHeight': 232 } +}; + +var popupOptions = "resizable,scrollbars,status=no"; + +// Deprecated +function newWindow( url, name, width, height ) +{ + var windowId = window.open( url, name, popupOptions+",width="+width+",height="+height ); +} + +function getPopupSize( tag, width, height ) +{ + var popupSize = Object.clone( popupSizes[tag] ); + if ( !popupSize ) + { + Error( "Can't find window size for tag '"+tag+"'" ); + return( { 'width': 0, 'height': 0 } ); + } + if ( popupSize.width && popupSize.height ) + { + if ( width || height ) + Warning( "Ignoring passed dimensions "+width+"x"+height+" when getting popup size for tag '"+tag+"'" ); + return( popupSize ); + } + if ( popupSize.addWidth ) + { + popupSize.width = popupSize.addWidth; + if ( !width ) + Error( "Got addWidth but no passed width when getting popup size for tag '"+tag+"'" ); + else + popupSize.width += parseInt(width); + } + else if ( width ) + { + popupSize.width = width; + Error( "Got passed width but no addWidth when getting popup size for tag '"+tag+"'" ); + } + if ( popupSize.minWidth && popupSize.width < popupSize.minWidth ) + { + Warning( "Adjusting to minimum width when getting popup size for tag '"+tag+"'" ); + popupSize.width = popupSize.minWidth; + } + if ( popupSize.addHeight ) + { + popupSize.height = popupSize.addHeight; + if ( !height ) + Error( "Got addHeight but no passed height when getting popup size for tag '"+tag+"'" ); + else + popupSize.height += parseInt(height); + } + else if ( height ) + { + popupSize.height = height; + Error( "Got passed height but no addHeight when getting popup size for tag '"+tag+"'" ); + } + if ( popupSize.minHeight && popupSize.height < popupSize.minHeight ) + { + Warning( "Adjusting to minimum height when getting popup size for tag '"+tag+"'" ); + popupSize.height = popupSize.minHeight; + } + Debug( popupSize ); + return( popupSize ); +} + +function zmWindow() +{ + var zmWin = window.open( 'http://www.zoneminder.com', 'ZoneMinder' ); + zmWin.focus(); +} + +function createPopup( url, name, tag, width, height ) +{ + var popupSize = getPopupSize( tag, width, height ); + var popupDimensions = ""; + if ( popupSize.width > 0 ) + popupDimensions += ",width="+popupSize.width; + if ( popupSize.height > 0 ) + popupDimensions += ",height="+popupSize.height; + var popup = window.open( url, name, popupOptions+popupDimensions ); +} + +function createEventPopup( eventId, eventFilter, width, height ) +{ + var url = '?view=event&eid='+eventId; + if ( eventFilter ) + url += eventFilter; + var name = 'zmEvent'; + var popupSize = getPopupSize( 'event', width, height ); + var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height ); +} + +function createFramesPopup( eventId, width, height ) +{ + var url = '?view=frames&eid='+eventId; + var name = 'zmFrames'; + var popupSize = getPopupSize( 'frames', width, height ); + var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height ); +} + +function createFramePopup( eventId, frameId, width, height ) +{ + var url = '?view=frame&eid='+eventId+'&fid='+frameId; + var name = 'zmFrame'; + var popupSize = getPopupSize( 'frame', width, height ); + var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height ); +} + +function windowToFront() +{ + top.window.focus(); +} + +function closeWindow() +{ + top.window.close(); +} + +function refreshWindow() +{ + window.location.reload( true ); +} + +function refreshParentWindow() +{ + if ( window.opener ) + window.opener.location.reload( true ); +} + +//Shows a message if there is an error in the streamObj or the stream doesn't exist. Returns true if error, false otherwise. +function checkStreamForErrors( funcName, streamObj ) +{ + if ( !streamObj ) + { + Error( funcName+": stream object was null" ); + return true; + } + if ( streamObj.result == "Error" ) + { + Error( funcName+" stream error: "+streamObj.message ); + return true; + } + return false; +} + +function secsToTime( seconds ) +{ + var timeString = "--"; + if ( seconds < 60 ) + timeString = seconds.toString(); + else if ( seconds < 60*60 ) + { + var timeMins = parseInt(seconds/60); + var timeSecs = seconds%60; + if ( timeSecs < 10 ) + timeSecs = '0'+timeSecs.toString().substr( 0, 4 ); + else + timeSecs = timeSecs.toString().substr( 0, 5 ); + timeString = timeMins+":"+timeSecs; + } + else + { + var timeHours = parseInt(seconds/3600); + var timeMins = (seconds%3600)/60; + var timeSecs = seconds%60; + if ( timeMins < 10 ) + timeMins = '0'+timeMins.toString().substr( 0, 4 ); + else + timeMins = timeMins.toString().substr( 0, 5 ); + if ( timeSecs < 10 ) + timeSecs = '0'+timeSecs.toString().substr( 0, 4 ); + else + timeSecs = timeSecs.toString().substr( 0, 5 ); + timeString = timeHours+":"+timeMins+":"+timeSecs; + } + return( timeString ); +} + +function submitTab( tab ) +{ + var form = $('contentForm'); + form.action.value = ""; + form.tab.value = tab; + form.submit(); +} + +function configureDeleteButton( element ) +{ + var form = element.form; + var checked = element.checked; + if ( !checked ) + { + for ( var i = 0; i < form.elements.length; i++ ) + { + if ( form.elements[i].name == element.name ) + { + if ( form.elements[i].checked ) + { + checked = true; + break; + } + } + } + } + form.deleteBtn.disabled = !checked; +} + +function confirmDelete( message ) +{ + return( confirm( message?message:'Are you sure you wish to delete?' ) ); +} + +if ( refreshParent ) +{ + refreshParentWindow(); +} + +if ( focusWindow ) +{ + windowToFront(); +} diff --git a/web/skins/classic/js/skin.js.php b/web/skins/classic/js/skin.js.php new file mode 100644 index 000000000..16b8f055e --- /dev/null +++ b/web/skins/classic/js/skin.js.php @@ -0,0 +1,40 @@ + +var AJAX_TIMEOUT = ; + +var currentView = ''; +var thisUrl = ""; +var skinPath = ""; + +var canEditSystem = ; +var canViewSystem = ; + +var refreshParent = ; + +var focusWindow = ; + +var imagePrefix = ""; diff --git a/web/skins/classic/lang/Makefile.am b/web/skins/classic/lang/Makefile.am new file mode 100644 index 000000000..6a089b4fa --- /dev/null +++ b/web/skins/classic/lang/Makefile.am @@ -0,0 +1,5 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/skins/classic/lang + +dist_web_DATA = # No files here diff --git a/web/skins/classic/lang/Makefile.in b/web/skins/classic/lang/Makefile.in new file mode 100644 index 000000000..1349ff476 --- /dev/null +++ b/web/skins/classic/lang/Makefile.in @@ -0,0 +1,451 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/skins/classic/lang +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +webdir = @WEB_PREFIX@/skins/classic/lang +dist_web_DATA = # No files here +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/skins/classic/lang/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/skins/classic/lang/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_webDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/skins/classic/skin.php b/web/skins/classic/skin.php new file mode 100644 index 000000000..9e0aea10f --- /dev/null +++ b/web/skins/classic/skin.php @@ -0,0 +1,73 @@ + diff --git a/web/skins/classic/svn-commit.tmp b/web/skins/classic/svn-commit.tmp new file mode 100644 index 000000000..a8bae9fc0 --- /dev/null +++ b/web/skins/classic/svn-commit.tmp @@ -0,0 +1,5 @@ + +--This line, and those below, will be ignored-- + +M views/plugin.php +M views/css/plugin.css diff --git a/web/skins/classic/views/Makefile.am b/web/skins/classic/views/Makefile.am new file mode 100644 index 000000000..58c72b78f --- /dev/null +++ b/web/skins/classic/views/Makefile.am @@ -0,0 +1,55 @@ +AUTOMAKE_OPTIONS = gnu + +SUBDIRS = \ + css \ + 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 \ + none.php \ + optionhelp.php \ + options.php \ + postlogin.php \ + settings.php \ + state.php \ + stats.php \ + status.php \ + timeline.php \ + user.php \ + version.php \ + video.php \ + watch.php \ + zone.php \ + zones.php diff --git a/web/skins/classic/views/Makefile.in b/web/skins/classic/views/Makefile.in new file mode 100644 index 000000000..13da5f23f --- /dev/null +++ b/web/skins/classic/views/Makefile.in @@ -0,0 +1,701 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/skins/classic/views +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +SUBDIRS = \ + css \ + 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 \ + none.php \ + optionhelp.php \ + options.php \ + postlogin.php \ + settings.php \ + state.php \ + stats.php \ + status.php \ + timeline.php \ + user.php \ + version.php \ + video.php \ + watch.php \ + zone.php \ + zones.php + +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/skins/classic/views/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/skins/classic/views/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic ctags \ + ctags-recursive distclean distclean-generic distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dist_webDATA \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/skins/classic/views/bandwidth.php b/web/skins/classic/views/bandwidth.php new file mode 100644 index 000000000..5c09ed446 --- /dev/null +++ b/web/skins/classic/views/bandwidth.php @@ -0,0 +1,58 @@ + + +
+ +
+
+ + +

+

+
+ +
+
+
+
+ + diff --git a/web/skins/classic/views/blank.php b/web/skins/classic/views/blank.php new file mode 100644 index 000000000..ac5c9caa7 --- /dev/null +++ b/web/skins/classic/views/blank.php @@ -0,0 +1,37 @@ + + + + + + + + + diff --git a/web/skins/classic/views/console.php b/web/skins/classic/views/console.php new file mode 100644 index 000000000..bc00e4da4 --- /dev/null +++ b/web/skins/classic/views/console.php @@ -0,0 +1,342 @@ + $SLANG['Events'], + "filter" => array( + "terms" => array( + ) + ), + ), + array( + "title" => $SLANG['Hour'], + "filter" => array( + "terms" => array( + array( "attr" => "DateTime", "op" => ">=", "val" => "-1 hour" ), + ) + ), + ), + array( + "title" => $SLANG['Day'], + "filter" => array( + "terms" => array( + array( "attr" => "DateTime", "op" => ">=", "val" => "-1 day" ), + ) + ), + ), + array( + "title" => $SLANG['Week'], + "filter" => array( + "terms" => array( + array( "attr" => "DateTime", "op" => ">=", "val" => "-7 day" ), + ) + ), + ), + array( + "title" => $SLANG['Month'], + "filter" => array( + "terms" => array( + array( "attr" => "DateTime", "op" => ">=", "val" => "-1 month" ), + ) + ), + ), + array( + "title" => $SLANG['Archived'], + "filter" => array( + "terms" => array( + array( "attr" => "Archived", "op" => "=", "val" => "1" ), + ) + ), + ), +); + +$running = daemonCheck(); +$status = $running?$SLANG['Running']:$SLANG['Stopped']; + +if ( $group = dbFetchOne( "select * from Groups where Id = '".(empty($_COOKIE['zmGroup'])?0:dbEscape($_COOKIE['zmGroup']))."'" ) ) + $groupIds = array_flip(explode( ',', $group['MonitorIds'] )); + +noCacheHeaders(); + +$maxWidth = 0; +$maxHeight = 0; +$cycleCount = 0; +$minSequence = 0; +$maxSequence = 1; +$seqIdList = array(); +$monitors = dbFetchAll( "select * from Monitors order by Sequence asc" ); +$displayMonitors = array(); +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; + if ( empty($minSequence) || ($monitors[$i]['Sequence'] < $minSequence) ) + { + $minSequence = $monitors[$i]['Sequence']; + } + if ( $monitors[$i]['Sequence'] > $maxSequence ) + { + $maxSequence = $monitors[$i]['Sequence']; + } + $monitors[$i]['zmc'] = zmcStatus( $monitors[$i] ); + $monitors[$i]['zma'] = zmaStatus( $monitors[$i] ); + $monitors[$i]['ZoneCount'] = dbFetchOne( "select count(Id) as ZoneCount from Zones where MonitorId = '".$monitors[$i]['Id']."'", "ZoneCount" ); + $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 ); + $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++; + $scaleWidth = reScale( $monitors[$i]['Width'], $monitors[$i]['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); + $scaleHeight = reScale( $monitors[$i]['Height'], $monitors[$i]['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); + if ( $maxWidth < $scaleWidth ) $maxWidth = $scaleWidth; + if ( $maxHeight < $scaleHeight ) $maxHeight = $scaleHeight; + } + $monitors[$i] = array_merge( $monitors[$i], $counts ); + $seqIdList[] = $monitors[$i]['Id']; + $displayMonitors[] = $monitors[$i]; +} +$lastId = 0; +$seqIdUpList = array(); +foreach ( $seqIdList as $seqId ) +{ + if ( !empty($lastId) ) + $seqIdUpList[$seqId] = $lastId; + else + $seqIdUpList[$seqId] = $seqId; + $lastId = $seqId; +} +$lastId = 0; +$seqIdDownList = array(); +foreach ( array_reverse($seqIdList) as $seqId ) +{ + if ( !empty($lastId) ) + $seqIdDownList[$seqId] = $lastId; + else + $seqIdDownList[$seqId] = $seqId; + $lastId = $seqId; +} + +$cycleWidth = $maxWidth; +$cycleHeight = $maxHeight; + +$eventsView = ZM_WEB_EVENTS_VIEW; +$eventsWindow = 'zm'.ucfirst(ZM_WEB_EVENTS_VIEW); + +$eventCount = 0; +for ( $i = 0; $i < count($eventCounts); $i++ ) +{ + $eventCounts[$i]['total'] = 0; +} +$zoneCount = 0; +foreach( $displayMonitors as $monitor ) +{ + for ( $i = 0; $i < count($eventCounts); $i++ ) + { + $eventCounts[$i]['total'] += $monitor['EventCount'.$i]; + } + $zoneCount += $monitor['ZoneCount']; +} + +$seqUpFile = getSkinFile( 'graphics/seq-u.gif' ); +$seqDownFile = getSkinFile( 'graphics/seq-d.gif' ); + +$versionClass = (ZM_DYN_DB_VERSION&&(ZM_DYN_DB_VERSION!=ZM_VERSION))?'errorText':''; + +xhtmlHeaders( __FILE__, $SLANG['Console'] ); +?> + +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
'.$monitor['Function'].'', canEdit( 'Monitors' ) ) ?>'.$monitor['Device'].' ('.$monitor['Channel'].')', canEdit( 'Monitors' ) ) ?>'.preg_replace( '/^.*@/', '', $monitor['Host'] ).'', canEdit( 'Monitors' ) ) ?>'.preg_replace( '/^.*\//', '', $monitor['Path'] ).'', canEdit( 'Monitors' ) ) ?>'.preg_replace( '/^.*\//', '', $monitor['Path'] ).'', canEdit( 'Monitors' ) ) ?> ', $monitor['Sequence']>$minSequence ) ?>', $monitor['Sequence']<$maxSequence ) ?> disabled="disabled"/>
+
+
+
+ + diff --git a/web/skins/classic/views/control.php b/web/skins/classic/views/control.php new file mode 100644 index 000000000..df3b33adc --- /dev/null +++ b/web/skins/classic/views/control.php @@ -0,0 +1,81 @@ + + +
+ +
+
+ +
+
+
+ + diff --git a/web/skins/classic/views/controlcap.php b/web/skins/classic/views/controlcap.php new file mode 100644 index 000000000..7fbc61f61 --- /dev/null +++ b/web/skins/classic/views/controlcap.php @@ -0,0 +1,512 @@ + $SLANG['New'], + 'Type' => "Local", + 'Protocol' => "", + 'CanWake' => "", + 'CanSleep' => "", + 'CanReset' => "", + 'CanMove' => "", + 'CanMoveDiag' => "", + 'CanMoveMap' => "", + 'CanMoveAbs' => "", + 'CanMoveRel' => "", + 'CanMoveCon' => "", + 'CanPan' => "", + 'MinPanRange' => "", + 'MaxPanRange' => "", + 'MinPanStep' => "", + 'MaxPanStep' => "", + 'HasPanSpeed' => "", + 'MinPanSpeed' => "", + 'MaxPanSpeed' => "", + 'HasTurboPan' => "", + 'TurboPanSpeed' => "", + 'CanTilt' => "", + 'MinTiltRange' => "", + 'MaxTiltRange' => "", + 'MinTiltStep' => "", + 'MaxTiltStep' => "", + 'HasTiltSpeed' => "", + 'MinTiltSpeed' => "", + 'MaxTiltSpeed' => "", + 'HasTurboTilt' => "", + 'TurboTiltSpeed' => "", + 'CanZoom' => "", + 'CanZoomAbs' => "", + 'CanZoomRel' => "", + 'CanZoomCon' => "", + 'MinZoomRange' => "", + 'MaxZoomRange' => "", + 'MinZoomStep' => "", + 'MaxZoomStep' => "", + 'HasZoomSpeed' => "", + 'MinZoomSpeed' => "", + 'MaxZoomSpeed' => "", + 'CanFocus' => "", + 'CanAutoFocus' => "", + 'CanFocusAbs' => "", + 'CanFocusRel' => "", + 'CanFocusCon' => "", + 'MinFocusRange' => "", + 'MaxFocusRange' => "", + 'MinFocusStep' => "", + 'MaxFocusStep' => "", + 'HasFocusSpeed' => "", + 'MinFocusSpeed' => "", + 'MaxFocusSpeed' => "", + 'CanIris' => "", + 'CanAutoIris' => "", + 'CanIrisAbs' => "", + 'CanIrisRel' => "", + 'CanIrisCon' => "", + 'MinIrisRange' => "", + 'MaxIrisRange' => "", + 'MinIrisStep' => "", + 'MaxIrisStep' => "", + 'HasIrisSpeed' => "", + 'MinIrisSpeed' => "", + 'MaxIrisSpeed' => "", + 'CanGain' => "", + 'CanAutoGain' => "", + 'CanGainAbs' => "", + 'CanGainRel' => "", + 'CanGainCon' => "", + 'MinGainRange' => "", + 'MaxGainRange' => "", + 'MinGainStep' => "", + 'MaxGainStep' => "", + 'HasGainSpeed' => "", + 'MinGainSpeed' => "", + 'MaxGainSpeed' => "", + 'CanWhite' => "", + 'CanAutoWhite' => "", + 'CanWhiteAbs' => "", + 'CanWhiteRel' => "", + 'CanWhiteCon' => "", + 'MinWhiteRange' => "", + 'MaxWhiteRange' => "", + 'MinWhiteStep' => "", + 'MaxWhiteStep' => "", + 'HasWhiteSpeed' => "", + 'MinWhiteSpeed' => "", + 'MaxWhiteSpeed' => "", + 'HasPresets' => "", + 'NumPresets' => "", + 'HasHomePreset' => "", + 'CanSetPresets' => "", + ); + } + $newControl = $control; +} + +$focusWindow = true; + +xhtmlHeaders(__FILE__, $SLANG['ControlCap']." - ".$newControl['Name'] ); +?> + +
+ +
+
    +$value ) +{ + if ( $tab == $name ) + { +?> +
  • + +
  • + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +$SLANG['Local'], 'Remote'=>$SLANG['Remote'] ); +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked">
checked="checked"/>
checked="checked"/>
checked="checked">
checked="checked"/>
checked="checked"/>
checked="checked">
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked">
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
checked="checked"/>
+
+ disabled="disabled"/> +
+
+
+
+ + diff --git a/web/skins/classic/views/controlcaps.php b/web/skins/classic/views/controlcaps.php new file mode 100644 index 000000000..0a737a3f5 --- /dev/null +++ b/web/skins/classic/views/controlcaps.php @@ -0,0 +1,90 @@ + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
disabled="disabled"/>
+
+ disabled="disabled"/> +
+
+
+
+ + diff --git a/web/skins/classic/views/controlpreset.php b/web/skins/classic/views/controlpreset.php new file mode 100644 index 000000000..45ffc4dd9 --- /dev/null +++ b/web/skins/classic/views/controlpreset.php @@ -0,0 +1,72 @@ + + +
+ +
+
+ + + + + +

+

+
+ +
+
+
+
+ + diff --git a/web/skins/classic/views/css/Makefile.am b/web/skins/classic/views/css/Makefile.am new file mode 100644 index 000000000..39c270cf7 --- /dev/null +++ b/web/skins/classic/views/css/Makefile.am @@ -0,0 +1,31 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/skins/classic/views/css + +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 diff --git a/web/skins/classic/views/css/Makefile.in b/web/skins/classic/views/css/Makefile.in new file mode 100644 index 000000000..6b852e415 --- /dev/null +++ b/web/skins/classic/views/css/Makefile.in @@ -0,0 +1,478 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/skins/classic/views/css +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +webdir = @WEB_PREFIX@/skins/classic/views/css +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 + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/skins/classic/views/css/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/skins/classic/views/css/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_webDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/skins/classic/views/css/console.css b/web/skins/classic/views/css/console.css new file mode 100644 index 000000000..49920402a --- /dev/null +++ b/web/skins/classic/views/css/console.css @@ -0,0 +1,97 @@ +#systemTime { + float: left; +} + +#title { + margin: 0 auto; + text-align: center; + width: 50%; +} + +#systemStats { + float: right; +} + +#monitorSummary { + float: left; + text-align: left; + width: 20%; +} + +#devices { + float: left; +} + +#loginBandwidth { + margin: 0 auto; + text-align: center; + width: 40%; +} + +#cycleMontage { + float: right; +} + +#options { + float: right; + text-align: right; + width: 20%; +} + +#consoleTable { + width: 100%; +} + +#consoleTable tr.highlight { + background-color: #eeeeee; +} + +#consoleTable thead th { + padding-bottom: 4px; + vertical-align: middle; +} + +#consoleTable tfoot td { + padding-top: 4px; + vertical-align: middle; +} + +#consoleTable th,td { + height: 16px; + text-align: left; +} + +#consoleTable .colOrder { + text-align: center; +} + +#consoleTable .colMark { + width: 32px; + text-align: center; +} + +#consoleTable .colEvents { + text-align: right; +} + +#consoleTable .colZones { + text-align: right; +} + +#consoleTable .colLeftButtons { + text-align: left; +} + +#consoleTable .colLeftButtons input { + margin-right: 24px; +} + +#consoleTable .colRightButtons { + text-align: right; + padding-right: 8px; +} + +#consoleTable .colRightButtons input { + margin: 0 8px; +} + diff --git a/web/skins/classic/views/css/control.css b/web/skins/classic/views/css/control.css new file mode 100644 index 000000000..0096ffcd7 --- /dev/null +++ b/web/skins/classic/views/css/control.css @@ -0,0 +1 @@ +@import url(../../css/control.css); diff --git a/web/skins/classic/views/css/controlcaps.css b/web/skins/classic/views/css/controlcaps.css new file mode 100644 index 000000000..1a2783fd7 --- /dev/null +++ b/web/skins/classic/views/css/controlcaps.css @@ -0,0 +1,3 @@ +#content table.major .colCanMove, #content table.major .colCanZoom, #content table.major .colCanFocus, #content table.major .colCanIris, #content table.major .colCanWhiteBal, #content table.major .colHasPresets { + text-align: center; +} diff --git a/web/skins/classic/views/css/devices.css b/web/skins/classic/views/css/devices.css new file mode 100644 index 000000000..6015985d0 --- /dev/null +++ b/web/skins/classic/views/css/devices.css @@ -0,0 +1,4 @@ +input.set { + border: 1px #7F7FB2 dashed; +} + diff --git a/web/skins/classic/views/css/event.css b/web/skins/classic/views/css/event.css new file mode 100644 index 000000000..995a06c1d --- /dev/null +++ b/web/skins/classic/views/css/event.css @@ -0,0 +1,232 @@ +#dataBar { + width: 100%; + margin: 2px auto; + text-align: center; +} + +#dataBar #dataTable { + width: 100%; +} + +#dataBar #dataTable td { + text-align: center; + padding: 2px; +} + +#menuBar1 { + width: 100%; + height: 1.5em; + padding: 3px 0; + text-align: center; + clear: both; +} + +#menuBar1 #nameControl { + float: left; +} + +#menuBar1 #nameControl #eventName { + margin-right: 4px; +} + +#menuBar1 #replayControl { + float: right; + margin-left: 8px; +} + +#menuBar1 #scaleControl { + float: right; + margin-left: 8px; +} + +#menuBar2 { + width: 100%; + height: 1.2em; + padding: 3px 0; + margin-bottom: 4px; +} + +#menuBar2 div { + text-align: left; + float: left; + padding: 0 12px; +} + +#menuBar2 #closeWindow { + float: right; + text-align: right; +} + +#imageFeed { + text-align: center; +} + +#monitorStatus { + width: 100%; + margin-top: 3px; + margin-bottom: 2px; + text-align: center; +} + +#monitorStatus #enableAlarms { + position: absolute; + left: 4px; +} + +#monitorStatus #forceAlarm { + position: absolute; + right: 4px; +} + +#monitorStatus #monitorState { +} + +#dvrControls { + margin-top: 3px; + margin-bottom: 2px; + text-align: center; +} + +#dvrControls input { + height: 20px; + width: 28px; + padding-bottom: 3px; + margin: 0 3px; +} + +#dvrControls input[disabled=disabled] { + color: #aaaaaa; +} + +#dvrControls input.active { + border: 1px solid blue; +} + +#dvrControls input.inactive { + border: 1px solid green; +} + +#dvrControls input.unavail { + border: 1px solid red; +} + +#replayStatus { + margin: 3px 0 2px; + text-align: center; + clear: both; +} + +#replayStatus > span { + padding: 0 4px; +} + +#progressBar { + position: relative; + border: 1px solid #666666; + height: 15px; + margin: 0 auto; +} + +#progressBar .progressBox { + position: absolute; + top: 0px; + left: 0px; + height: 15px; + background: #eeeeee; + border-left: 1px solid #999999; +} + +#progressBar .complete { + background: #aaaaaa; +} + +#eventStills { + width: 100%; + position: relative; +} + +#eventThumbsPanel { + position: relative; + width: 100%; + margin: 4px auto; + z-index: 1; +} + +#eventThumbs { + margin: 0 auto; + width: 100%; + overflow: hidden; + height: 300px; +} + +#eventThumbs img { + height: 25px; /* HACK - Although this is pixels it will be interpreted as a scale %ge, so 25px = 25% scaling for thumbnails */ + margin: 2px; + background-color: #dddddd; +} + +#eventThumbs img.placeholder { + /* width: 100px; */ +} + +#eventThumbs img.selected { +} + +#eventImagePanel { + position: absolute; + z-index: 10; +} + +#eventImageFrame { + border: 2px solid gray; + background-color: white; + padding: 4px; +} + +#eventImage { +} + +#eventImageBar { + margin-top: 2px; +} + +#eventImageStats { + float: left; +} + +#eventImageData { + margin: 0 auto; + padding-top: 2px; +} + +#eventImageClose { + float: right; +} + +#eventImageNav { + position: relative; +} + +#eventImageNav input { + width: 32px; + font-size: 16px; +} + +#thumbsSliderPanel { + width: 400px; + margin: 4px auto 0; + background: #888888; + padding: 1px; +} + +#thumbsSlider { + width: 400px; + height: 10px; + background: #dddddd; +} + +#thumbsKnob { + width: 8px; + height: 10px; + background-color: #444444; +} diff --git a/web/skins/classic/views/css/events.css b/web/skins/classic/views/css/events.css new file mode 100644 index 000000000..5726e904d --- /dev/null +++ b/web/skins/classic/views/css/events.css @@ -0,0 +1,42 @@ +#controls { + height: 16px; + width: 100%; + text-align: center; + margin: 0 auto; + position: relative; +} + +#controls a { + width: 32%; +} + +#controls #refreshLink { + position: absolute; + left: 0%; + text-align: left; +} + +#controls #filterLink { + position: absolute; + left: 34%; + text-align: center; +} + +#controls #timelineLink { + position: absolute; + left: 68%; + text-align: right; +} + +#contentTable.major .colTime { + white-space: nowrap; +} + +#contentTable.major .colId, #contentTable.major .colDuration, #contentTable.major .colFrames, #contentTable.major .colAlarmFrames, #contentTable.major .colTotScore, #contentTable.major .colMaxScore, #contentTable.major .colAvgScore { + text-align: center; +} + +#contentTable.major td.colDuration { + text-align: right; + padding-right: 8px; +} diff --git a/web/skins/classic/views/css/export.css b/web/skins/classic/views/css/export.css new file mode 100644 index 000000000..e22851ca0 --- /dev/null +++ b/web/skins/classic/views/css/export.css @@ -0,0 +1,15 @@ +#contentTable + input { + margin-top: 6px; +} + +#contentTable th, #contentTable td { + white-space: nowrap; +} + +#exportProgress { + margin: 8px auto 4px; +} + +#downloadLink { + margin-top: 8px; +} diff --git a/web/skins/classic/views/css/filter.css b/web/skins/classic/views/css/filter.css new file mode 100644 index 000000000..2287cfea2 --- /dev/null +++ b/web/skins/classic/views/css/filter.css @@ -0,0 +1,25 @@ +#filterSelector { +} + +table.filterTable { + width: 100%; +} + +#fieldsTable td { + height: 16px; +} + +#fieldsTable input[type=button] { + width: 1.6em; + margin-left: 2px; + text-align: center; +} + +#sortTable input[type=text] { + margin-right: 4px; +} + +#actionsTable input[type=text] { + margin-left: 4px; +} + diff --git a/web/skins/classic/views/css/frame.css b/web/skins/classic/views/css/frame.css new file mode 100644 index 000000000..2c7789349 --- /dev/null +++ b/web/skins/classic/views/css/frame.css @@ -0,0 +1,30 @@ +#controls { + width: 80%; + text-align: center; + margin: 0 auto; +} + +#controls a { + width: 40px; + margin-left: -20px; +} + +#firstLink { + position: absolute; + left: 13%; +} + +#prevLink { + position: absolute; + left: 37%; +} + +#nextLink { + position: absolute; + left: 63%; +} + +#lastLink { + position: absolute; + left: 87%; +} diff --git a/web/skins/classic/views/css/frames.css b/web/skins/classic/views/css/frames.css new file mode 100644 index 000000000..249fa3751 --- /dev/null +++ b/web/skins/classic/views/css/frames.css @@ -0,0 +1,15 @@ +#contentTable.major .colId, #contentTable.major .colType, #contentTable.major .colTimeStamp, #contentTable.major .colTimeDelta, #contentTable.major .colScore { + text-align: center; +} + +tr.alarm { + background-color: #fa8072; +} + +tr.bulk { + background-color: #cccccc; +} + +tr.normal { + background-color: #ffffff; +} diff --git a/web/skins/classic/views/css/groups.css b/web/skins/classic/views/css/groups.css new file mode 100644 index 000000000..64f5013de --- /dev/null +++ b/web/skins/classic/views/css/groups.css @@ -0,0 +1,6 @@ +#contentTable .colSelect { + text-align: center; +} + +#contentTable .colSelect input { +} diff --git a/web/skins/classic/views/css/log.css b/web/skins/classic/views/css/log.css new file mode 100644 index 000000000..44f309b9b --- /dev/null +++ b/web/skins/classic/views/css/log.css @@ -0,0 +1,53 @@ +#logSummary { + margin: 4px auto 0; + border-collapse: collapse; +} + +#logSummary tr { + margin: 0; + padding: 0; +} + +#logSummary td { + border: 1px solid #7f7fb2; + padding: 0 6px; + text-align: center; + font-size: 10px; + line-height: 15px; +} + +tr.log-fat td { + background-color:#ffcccc; + font-weight: bold; +} + +tr.log-err td { + background-color:#ffcccc; +} + +tr.log-war td { + background-color: #ffe4b5; +} + +tr.log-dbg td { + color: #666666; + font-style: italic; +} + +#exportLog label { + vertical-align: middle; +} + +#exportLog input[type=radio] { + margin-right: 4px; + vertical-align: middle; +} + +#exportError { + display: none; + color: #dc143c; + margin-bottom: 8px; +} + +#exportErrorText { +} diff --git a/web/skins/classic/views/css/monitor.css b/web/skins/classic/views/css/monitor.css new file mode 100644 index 000000000..7cac28fe1 --- /dev/null +++ b/web/skins/classic/views/css/monitor.css @@ -0,0 +1,5 @@ +.swatch { + border: 1px solid black; + margin-left: 3px; + padding: 0px; +} diff --git a/web/skins/classic/views/css/montage.css b/web/skins/classic/views/css/montage.css new file mode 100644 index 000000000..1afd402a7 --- /dev/null +++ b/web/skins/classic/views/css/montage.css @@ -0,0 +1,41 @@ +#header { + width: 99%; +} + +#layout { + margin-right: 10px; +} + +#content { + width: 99%; +} + +#monitors .alarm { + color: #ff0000; +} + +#monitors .alert { + color: #ffa500; +} + +#monitors .imageFeed { + text-align: center; + vertical-align: middle; +} + +#monitors .imageFeed img.idle { + border: 2px solid #ffffff; +} + +#monitors .imageFeed img.alarm { + border: 2px solid #ff0000; +} + +#monitors .imageFeed img.alert { + border: 2px solid #ffa500; +} + +#monitors .monitorState { + margin: 2px auto; + text-align: center; +} diff --git a/web/skins/classic/views/css/montage_2wide.css b/web/skins/classic/views/css/montage_2wide.css new file mode 100644 index 000000000..b0fa77298 --- /dev/null +++ b/web/skins/classic/views/css/montage_2wide.css @@ -0,0 +1,30 @@ +#monitors { + width: 100%; + margin: 0 auto; + text-align: center; +} + +#monitors .monitorFrame { + padding: 1px; + float: left; +} + +#monitors .monitor { +} + +#monitorFrame0, #monitorFrame2, #monitorFrame4, #monitorFrame6, #monitorFrame8, #monitorFrame10, #monitorFrame12, #monitorFrame14 { + width: 49%; + clear: both; +} + +#monitor0, #monitor2, #monitor4, #monitor6, #monitor8, #monitor10, #monitor12, #monitor14 { + float: right; +} + +#monitorFrame1, #monitorFrame3, #monitorFrame5, #monitorFrame7, #monitorFrame9, #monitorFrame11, #monitorFrame13, #monitorFrame15 { + width: 49%; +} + +#monitor1, #monitor3, #monitor5, #monitor7, #monitor9, #monitor11, #monitor13, #monitor15 { + float: left; +} diff --git a/web/skins/classic/views/css/montage_3wide.css b/web/skins/classic/views/css/montage_3wide.css new file mode 100644 index 000000000..81f0c00ae --- /dev/null +++ b/web/skins/classic/views/css/montage_3wide.css @@ -0,0 +1,37 @@ +#monitors { + width: 100%; + margin: 0 auto; + text-align: center; +} + +#monitors .monitorFrame { + padding: 1px; + float: left; + width: 33%; +} + +#monitors .monitor { + text-align: center; +} + +#monitorFrame0, #monitorFrame3, #monitorFrame6, #monitorFrame9, #monitorFrame12, #monitorFrame15 { + clear: both; +} + +#monitor0, #monitor3, #monitor6, #monitor9, #monitor12, #monitor15 { + float: right; +} + +#monitorFrame1, #monitorFrame4, #monitorFrame7, #monitorFrame10, #monitorFrame13, #monitorFrame16 { + text-align: center; +} + +#monitor1, #monitor4, #monitor7, #monitor10, #monitor13, #monitor16 { +} + +#monitorFrame2, #monitorFrame5, #monitorFrame8, #monitorFrame11, #monitorFrame14, #monitorFrame17 { +} + +#monitor2, #monitor5, #monitor8, #monitor11, #monitor14, #monitor17 { + float: left; +} diff --git a/web/skins/classic/views/css/montage_3wide50enlarge.css b/web/skins/classic/views/css/montage_3wide50enlarge.css new file mode 100644 index 000000000..59bedd9ba --- /dev/null +++ b/web/skins/classic/views/css/montage_3wide50enlarge.css @@ -0,0 +1,74 @@ +#monitors { + width: 100%; + margin: 0 auto; + text-align: center; +} + +#monitors .monitorFrame { + float: left; + padding: 1px; +} + +#monitors .monitor { + text-align: center; +} + +#monitorFrame0, #monitorFrame3, #monitorFrame6, #monitorFrame9, #monitorFrame12, #monitorFrame15 { + width: 32%; + text-align: right; + clear: both; +} + +#monitor0, #monitor3, #monitor6, #monitor9, #monitor12, #monitor15 { + margin-left: auto; + margin-right: 0; +} + +#monitorFrame1, #monitorFrame4, #monitorFrame7, #monitorFrame10, #monitorFrame13, #monitorFrame16 { + width: 32%; + text-align: center; +} + +#monitor1, #monitor4, #monitor7, #monitor10, #monitor13, #monitor16 { + margin-left: auto; + margin-right: auto; +} + +#monitorFrame2, #monitorFrame5, #monitorFrame8, #monitorFrame11, #monitorFrame14, #monitorFrame17 { + width: 32%; + text-align: left; +} + +#monitor2, #monitor5, #monitor8, #monitor11, #monitor14, #monitor17 { + margin-left: 0; + margin-right: auto; +} + +#monitors .imageFeed img { + width: 100%; + height: 100%; +} + +#monitors .monitorFrame > div.alarm, #monitors .monitorFrame > div.alert { + position: absolute; + width: 96%; + left: 2%; + top: 72px; +} + +#monitors .monitorFrame > div.alert { + z-index: 100; +} + +#monitors .monitorFrame > div.alarm { + z-index: 200; +} + +#monitors .monitorFrame div.alarm, #monitors .monitorFrame div.alert { + font-size: 140%; + line-height: 160%; +} + +#monitors .monitorFrame div.monitorState { + text-align: center; +} diff --git a/web/skins/classic/views/css/montage_4wide.css b/web/skins/classic/views/css/montage_4wide.css new file mode 100644 index 000000000..4e5b7bc49 --- /dev/null +++ b/web/skins/classic/views/css/montage_4wide.css @@ -0,0 +1,44 @@ +#monitors { + width: 100%; + margin: 0 auto; + text-align: center; +} + +#monitors .monitorFrame { + padding: 1px; + float: left; + width: 24.5%; +} + +#monitors .monitor { + text-align: center; +} + +#monitorFrame0, #monitorFrame4, #monitorFrame8, #monitorFrame12, #monitorFrame16, #monitorFrame20 { + clear: both; +} + +#monitor0, #monitor4, #monitor8, #monitor12, #monitor16, #monitor20 { + float: right; +} + +#monitorFrame1, #monitorFrame5, #monitorFrame9, #monitorFrame13, #monitorFrame17, #monitorFrame21 { + text-align: center; +} + +#monitor1, #monitor5, #monitor9, #monitor13, #monitor17, #monitor21 { +} + +#monitorFrame2, #monitorFrame6, #monitorFrame10, #monitorFrame14, #monitorFrame18, #monitorFrame22 { + text-align: center; +} + +#monitor2, #monitor6, #monitor10, #monitor14, #monitor18, #monitor22 { +} + +#monitorFrame3, #monitorFrame7, #monitorFrame11, #monitorFrame15, #monitorFrame19, #monitorFrame23 { +} + +#monitor3, #monitor7, #monitor11, #monitor15, #monitor19, #monitor23 { + float: left; +} diff --git a/web/skins/classic/views/css/montage_freeform.css b/web/skins/classic/views/css/montage_freeform.css new file mode 100644 index 000000000..da6a4bb22 --- /dev/null +++ b/web/skins/classic/views/css/montage_freeform.css @@ -0,0 +1,9 @@ +#monitors { + margin: 0 auto; + text-align: center; +} + +#monitors .monitorFrame { + float: left; + padding: 1px; +} diff --git a/web/skins/classic/views/css/options.css b/web/skins/classic/views/css/options.css new file mode 100644 index 000000000..f2635edea --- /dev/null +++ b/web/skins/classic/views/css/options.css @@ -0,0 +1,24 @@ +input.small { + width: 6em; +} + +input.medium { + width: 9em; +} + +input.large { + width: 20em; +} + +#contentTable.optionTable th, #contentTable.optionTable td { + vertical-align: top; +} + +#contentTable.userTable th, #contentTable.userTable td { + text-align: center; +} + +#contentTable.userTable .colMonitor, #contentTable.userTable .colUsername { + text-align: left; +} + diff --git a/web/skins/classic/views/css/plugin.css b/web/skins/classic/views/css/plugin.css new file mode 100644 index 000000000..040e26558 --- /dev/null +++ b/web/skins/classic/views/css/plugin.css @@ -0,0 +1,20 @@ +#settingsPanel { + float: left; + margin: 0 2px; +} + +#pluginSettings { + border-collapse: collapse; +} + +#pluginSettings th, #pluginSettings td { + border: 1px solid #7f7fb2; + padding: 3px; + text-align: left; +} + +#pluginSettings th[scope=row] { + padding: 4px 3px 3px; + vertical-align: top; + white-space: nowrap; +} diff --git a/web/skins/classic/views/css/stats.css b/web/skins/classic/views/css/stats.css new file mode 100644 index 000000000..c47e85e3a --- /dev/null +++ b/web/skins/classic/views/css/stats.css @@ -0,0 +1,9 @@ +#contentTable.major .colZone, #contentTable.major .colPixelDiff, #contentTable.major .colAlarmPx, #contentTable.major .colFilterPx, #contentTable.major .colBlobPx, #contentTable.major .colBlobs, #contentTable.major .colBlobSizes, #contentTable.major .colAlarmLimits, #contentTable.major .colScore { + + text-align: center; +} + +#contentTable.major .rowNoStats { + text-align: center; + padding: 20px; +} diff --git a/web/skins/classic/views/css/timeline.css b/web/skins/classic/views/css/timeline.css new file mode 100644 index 000000000..6b66ea4e1 --- /dev/null +++ b/web/skins/classic/views/css/timeline.css @@ -0,0 +1,222 @@ +#content { + position: relative; + text-align: center; + border: 1px solid #666666; + margin: 0 auto; +} + +#title { + position: relative; + margin: 0 auto; + color: #016A9D; + height: 30px; + font-size: 13px; + font-weight: bold; + line-height: 20px; +} + +#listLink { + position: absolute; + top: 5px; + left: 20px; + height: 15px; +} + +#closeLink { + position: absolute; + top: 5px; + right: 20px; + height: 15px; +} + +#topPanel { + position: relative; + height: 220px; + margin: 4px auto 6px; +} + +#topPanel #imagePanel +{ + width: 50%; + float: left; + text-align: right; +} + +#topPanel #image { + float: right; + margin: 0 auto; + width: 90%; + text-align: right; + margin-right: 2px; + background-color: #eeeeee; + border: 1px solid #c8c8c8; +} + +#topPanel #image img { + float: left; + top: 0px; + background-color: #f8f8f8; + width: 100%; +} + +#topPanel #dataPanel { + width: 45%; + float: left; + text-align: left; + margin-left: 2px; +} + +#topPanel #textPanel { + text-align: left; + width: 100%; + height: 140px; + margin: 0 auto; + color: #016A9D; + font-size: 11px; + font-weight: bold; + line-height: 14px; + background-color: #eeeeee; + border: 1px solid #c8c8c8; + padding: 2px; +} + +#topPanel #navPanel { + width: 100%; + height: 70px; + margin: 4px auto; +} + +#topPanel #navPanel input { + background-color: #eeeeee; + border: 1px solid #c8c8c8; + padding: 5px; +} + +#chartPanel { + position: relative; + margin: 0 auto; +} + +#chartPanel #chart { + position: relative; + border: 1px solid black; + margin: 0 auto; + z-index: 0; +} + +#chartPanel #activity { + position: absolute; + text-align: center; + left: 0px; + border-bottom: 1px solid #cccccc; +} + +#chartPanel #activity div.activity { + position: absolute; + bottom: 0px; + z-index: 3; + width: 1px; +} + +#chartPanel .events { + position: absolute; + text-align: center; + left: 0px; + background-color: #fcfcfc; + border-bottom: 1px solid black; +} + +#chartPanel .event { + position: absolute; + bottom: 0px; + z-index: 3; +} + +#chartLabels { + margin: 25px auto 0; + text-align: center; +} + +#range { + width: 30%; + margin: 0 auto; + color: #016A9D; + font-size: 11px; + font-weight: bold; + line-height: 20px; +} + +#key { + float: right; + margin-top: -4px; + text-align: right; +} + +span.keyEntry { +} + +img.keyBox { + position: relative; + border: 1px solid black; + width: 16px; + height: 16px; + top: 4px; + margin-left: 4px; +} + +div.majGridX { + position: absolute; + z-index: 1; + top: 0px; + width: 1px; + border-left: dotted 1px #cccccc; +} + +div.majTickX { + position: absolute; + bottom: -7px; + width: 1px; + height: 7px; + border-left: solid 1px black; +} + +div.majLabelX { + position: absolute; + text-align: center; + bottom: -20px; + width: 50px; + font-size: 9px; + font-weight: normal; +} + +div.majGridY { + position: absolute; + z-index: 1; + left: 0px; + height: 1px; + border-top: dotted 1px #cccccc; +} + +div.majTickY { + position: absolute; + left: -7px; + height: 1px; + width: 7px; + border-top: solid 1px black; +} + +div.majLabelY { + position: absolute; + text-align: right; + left: -30px; + width: 20px; + font-size: 9px; + font-weight: normal; +} + +div.zoom { + position: absolute; + z-index: 2; + bottom: 0px; +} + diff --git a/web/skins/classic/views/css/timeline.css.php b/web/skins/classic/views/css/timeline.css.php new file mode 100644 index 000000000..3bc75fbcf --- /dev/null +++ b/web/skins/classic/views/css/timeline.css.php @@ -0,0 +1,77 @@ +.chartSize { + width: px; + height: px; +} + +.graphSize { + width: px; + height: px; +} + +.graphHeight { + height: px; +} + +.graphWidth { + width: px; +} + +.imageSize { + width: px; + height: px; +} + +.imageHeight { + height: px; +} + +.activitySize { + width: px; + height: px; +} + +.eventsSize { + width: px; + height: px; +} + +.eventsHeight { + height: px; +} + +#chartPanel .eventsPos { + top: px; +} + +#chartPanel .activityPos { + top: px; +} + +#chartPanel .eventsPos { + top: px; +} + +.monitorColour { + background-color: ; +} + diff --git a/web/skins/classic/views/css/video.css b/web/skins/classic/views/css/video.css new file mode 100644 index 000000000..7e9708f2c --- /dev/null +++ b/web/skins/classic/views/css/video.css @@ -0,0 +1,19 @@ +#contentTable + input { + margin-top: 6px; +} + +#videoProgress { + margin: 8px auto 4px; +} + +#videoFilesHeader { + margin: 8px auto 4px; +} + +#videoNoFiles { + margin: 4px auto; +} + +#videoFile { + margin-bottom: 6px; +} diff --git a/web/skins/classic/views/css/watch.css b/web/skins/classic/views/css/watch.css new file mode 100644 index 000000000..82cfca234 --- /dev/null +++ b/web/skins/classic/views/css/watch.css @@ -0,0 +1,134 @@ +@import url(../../css/control.css); + +#menuBar { + margin: 6px auto 4px; + text-align: center; +} + +#menuBar #monitorName { + float: left; +} + +#menuBar #closeControl { + float: right; +} + +#menuBar #menuControls { + margin: 0 auto; + width: 60%; +} + +#menuBar #menuControls #controlControl { + float: left; +} + +#menuBar #menuControls #eventsControl { + float: left; +} + +#menuBar #menuControls #settingsControl { + float: right; +} + +#menuBar #menuControls #scaleControl { + margin: 0 auto; +} + +#imageFeed{ + text-align: center; +} + +#monitorStatus { + margin: 4px auto; + text-align: center; +} + +#monitorStatus #enableDisableAlarms { + float: left; +} + +#monitorStatus #forceCancelAlarm { + float: right; +} + +#monitorStatus #monitorState { +} + +#dvrControls { + margin-top: 3px; + margin-bottom: 2px; + text-align: center; +} + +#dvrControls input { + height: 20px; + width: 28px; + padding-bottom: 3px; + margin: 0 3px; +} + +#dvrControls input[disabled] { + color: #aaaaaa; +} + +#dvrControls input.active { + border: 1px solid blue; +} + +#dvrControls input.inactive { + border: 1px solid green; +} + +#dvrControls input.unavail { + border: 1px solid red; +} + +#replayStatus { + margin: 3px 0 2px; + text-align: center; + clear: both; +} + +#replayStatus > span { + padding: 0 4px; +} + +#events { + margin: 0 auto; +} + +#eventList { + width: 100%; +} + +#eventList thead td { + font-weight: bold; +} + +#eventList th, #eventList td { + text-align: center; +} + +li { + display: inline; + list-style-type: none; +} + +span.alarm { + color: #DC143C; + font-weight: bold; +} + +span.alert { + color: #FF8C00; + font-weight: bold; +} + +#eventList tr.recent { + background-color: #B0E0E6; +} + +#eventList tr.highlight { + background-color: #DCDCDC; +} + diff --git a/web/skins/classic/views/css/zone.css b/web/skins/classic/views/css/zone.css new file mode 100644 index 000000000..554255a74 --- /dev/null +++ b/web/skins/classic/views/css/zone.css @@ -0,0 +1,91 @@ +#settingsPanel { + float: left; + margin: 0 2px; +} + +#zoneSettings { + border-collapse: collapse; +} + +#zoneSettings th, #zoneSettings td { + border: 1px solid #7f7fb2; + padding: 3px; + text-align: left; +} + +#zoneSettings th[scope=row] { + padding: 4px 3px 3px; + vertical-align: top; + white-space: nowrap; +} + +#definitionPanel { + float: left; + margin: 0 2px; + text-align: center; +} + +#definitionPanel input[type=submit], #definitionPanel input[type=submit] { + margin: 0 4px; +} + +#imagePanel { + position: relative; +} + +#imageFrame { + position: relative; + padding: 0 6px 6px 0; /* Double margin of points below */ +} + +#imageFrame div { + position: absolute; + width: 7px; + height: 7px; + margin-left: -3px; + margin-top: -3px; + z-index: 5; +} + +#imageFrame div { + background-image: url(../../graphics/point-g.gif); +} + +#imageFrame div.highlight { + background-image: url(../../graphics/point-o.gif); +} + +#imageFrame div.active { + background-image: url(../../graphics/point-r.gif); +} + +#zonePoints { + margin: 8px 0; + border-collapse: collapse; +} + +#zonePoints td { + vertical-align: top; +} + +#zonePoints table { + border-collapse: collapse; +} + +#zonePoints table tr.highlight { + background-color: #f0e68c; +} + +#zonePoints table tr.active { + background-color: #ffa07a; +} + +#zonePoints table th, #zonePoints table td { + border: 1px solid #7f7fb2; + padding: 3px; + text-align: center; +} + +#zonePoints table a { + margin: 0 2px; +} diff --git a/web/skins/classic/views/cycle.php b/web/skins/classic/views/cycle.php new file mode 100644 index 000000000..258d21af5 --- /dev/null +++ b/web/skins/classic/views/cycle.php @@ -0,0 +1,129 @@ + + +
+ +
+
+ +
+
+
+ + diff --git a/web/skins/classic/views/device.php b/web/skins/classic/views/device.php new file mode 100644 index 000000000..645c14295 --- /dev/null +++ b/web/skins/classic/views/device.php @@ -0,0 +1,71 @@ + "", + "Name" => "New Device", + "KeyString" => "" + ); +} + +xhtmlHeaders( __FILE__, $SLANG['Device']." - ".$newDevice['Name'] ); +?> + +
+ +
+
+ + + + + + + + + + + + + + +
+
+ disabled="disabled"/> +
+
+
+
+ + diff --git a/web/skins/classic/views/devices.php b/web/skins/classic/views/devices.php new file mode 100644 index 000000000..106f3d4a8 --- /dev/null +++ b/web/skins/classic/views/devices.php @@ -0,0 +1,86 @@ + + +
+ +
+
+ + + + + + + + + + + + + + + +
'.validHtmlStr($device['Name']).' ('.validHtmlStr($device['KeyString']).')', canEdit( 'Devices' ) ) ?> onclick="switchDeviceOn( this, '' )"/> onclick="switchDeviceOff( this, '' )"/> disabled="disabled"/>
+
+ /> + + +
+
+
+
+ + diff --git a/web/skins/classic/views/donate.php b/web/skins/classic/views/donate.php new file mode 100644 index 000000000..34ee4efa3 --- /dev/null +++ b/web/skins/classic/views/donate.php @@ -0,0 +1,65 @@ + $SLANG['DonateYes'], + "hour" => $SLANG['DonateRemindHour'], + "day" => $SLANG['DonateRemindDay'], + "week" => $SLANG['DonateRemindWeek'], + "month" => $SLANG['DonateRemindMonth'], + "never" => $SLANG['DonateRemindNever'], + "already" => $SLANG['DonateAlready'], +); + +$focusWindow = true; + +xhtmlHeaders(__FILE__, $SLANG['Donate'] ); +?> + +
+ +
+
+ + +

+ +

+

+ +

+
+ + +
+
+
+
+ + diff --git a/web/skins/classic/views/error.php b/web/skins/classic/views/error.php new file mode 100644 index 000000000..c18ae307e --- /dev/null +++ b/web/skins/classic/views/error.php @@ -0,0 +1,43 @@ + + +
+ +
+

+ +

+

+ +

+

+ +

+
+
+ + diff --git a/web/skins/classic/views/event.php b/web/skins/classic/views/event.php new file mode 100644 index 000000000..5ac1e1740 --- /dev/null +++ b/web/skins/classic/views/event.php @@ -0,0 +1,222 @@ + $SLANG['ReplaySingle'], + 'all' => $SLANG['ReplayAll'], + 'gapless' => $SLANG['ReplayGapless'], +); + +if ( isset( $_REQUEST['streamMode'] ) ) + $streamMode = validHtmlStr($_REQUEST['streamMode']); +else + $streamMode = canStream()?'stream':'stills'; + +if ( isset( $_REQUEST['replayMode'] ) ) + $replayMode = validHtmlStr($_REQUEST['replayMode']); +if ( isset( $_COOKIE['replayMode']) && preg_match('#^[a-z]+$#', $_COOKIE['replayMode']) ) + $replayMode = validHtmlStr($_COOKIE['replayMode']); + else + $replayMode = array_shift( array_keys( $replayModes ) ); + +parseSort(); +parseFilter( $_REQUEST['filter'] ); +$filterQuery = $_REQUEST['filter']['query']; + +$panelSections = 40; +$panelSectionWidth = (int)ceil(reScale($event['Width'],$scale)/$panelSections); +$panelWidth = ($panelSections*$panelSectionWidth-1); + +$connkey = generateConnKey(); + +$focusWindow = true; + +xhtmlHeaders(__FILE__, $SLANG['Event'] ); +?> + +
+
+
+ + + + + + + + + +
s">/">//
+
+ + +
+
+ +
+

+ + + + + + + + + +

+
+ Mode:   + Rate: x + Progress: s + Zoom: x +
+ +
+ +
+
+ + diff --git a/web/skins/classic/views/eventdetail.php b/web/skins/classic/views/eventdetail.php new file mode 100644 index 000000000..437b95f98 --- /dev/null +++ b/web/skins/classic/views/eventdetail.php @@ -0,0 +1,134 @@ + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + +
+
+ disabled="disabled"/> +
+
+
+
+ + diff --git a/web/skins/classic/views/events.php b/web/skins/classic/views/events.php new file mode 100644 index 000000000..5959bdc6f --- /dev/null +++ b/web/skins/classic/views/events.php @@ -0,0 +1,270 @@ + $limit ) +{ + $nEvents = $limit; +} +$pages = (int)ceil($nEvents/ZM_WEB_EVENTS_PER_PAGE); +if ( $pages > 1 ) +{ + if ( !empty($page) ) + { + if ( $page < 0 ) + $page = 1; + if ( $page > $pages ) + $page = $pages; + } +} +if ( !empty($page) ) +{ + $limitStart = (($page-1)*ZM_WEB_EVENTS_PER_PAGE); + if ( empty( $limit ) ) + { + $limitAmount = ZM_WEB_EVENTS_PER_PAGE; + } + else + { + $limitLeft = $limit - $limitStart; + $limitAmount = ($limitLeft>ZM_WEB_EVENTS_PER_PAGE)?ZM_WEB_EVENTS_PER_PAGE:$limitLeft; + } + $eventsSql .= " limit $limitStart, $limitAmount"; +} +elseif ( !empty( $limit ) ) +{ + $eventsSql .= " limit 0, ".dbEscape($limit); +} + +$maxWidth = 0; +$maxHeight = 0; +$archived = false; +$unarchived = false; +$events = array(); +foreach ( dbFetchAll( $eventsSql ) as $event ) +{ + $events[] = $event; + $scale = max( reScale( SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ), SCALE_BASE ); + $eventWidth = reScale( $event['Width'], $scale ); + $eventHeight = reScale( $event['Height'], $scale ); + if ( $maxWidth < $eventWidth ) $maxWidth = $eventWidth; + if ( $maxHeight < $eventHeight ) $maxHeight = $eventHeight; + if ( $event['Archived'] ) + $archived = true; + else + $unarchived = true; +} + +$maxShortcuts = 5; +$pagination = getPagination( $pages, $page, $maxShortcuts, $filterQuery.$sortQuery.'&limit='.$limit ); + +$focusWindow = true; + +xhtmlHeaders(__FILE__, $SLANG['Events'] ); + +?> + +
+ +
+
+ + + + + + + + +

+ +

+ + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
disabled="disabled"/>
' ) ?>  disabled="disabled"/>
+ +

+ +
+ + + + + + +
+ +
+
+
+ + diff --git a/web/skins/classic/views/export.php b/web/skins/classic/views/export.php new file mode 100644 index 000000000..5ca464f88 --- /dev/null +++ b/web/skins/classic/views/export.php @@ -0,0 +1,131 @@ + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
checked="checked" onclick="configureExportButton( this )"/>
checked="checked" onclick="configureExportButton( this )"/>
checked="checked" onclick="configureExportButton( this )"/>
checked="checked" onclick="configureExportButton( this )"/>
checked="checked" onclick="configureExportButton( this )"/>
+ checked="checked" onclick="configureExportButton( this )"/> + checked="checked" onclick="configureExportButton( this )"/> +
+ +
+
+ +

+ + + + + +
+ + diff --git a/web/skins/classic/views/filter.php b/web/skins/classic/views/filter.php new file mode 100644 index 000000000..21b804353 --- /dev/null +++ b/web/skins/classic/views/filter.php @@ -0,0 +1,331 @@ +$SLANG['ChooseFilter'] ); +foreach ( dbFetchAll( "select * from Filters order by Name" ) as $row ) +{ + $filterNames[$row['Name']] = $row['Name']; + if ( $row['Background'] ) + $filterNames[$row['Name']] .= "*"; + if ( !empty($_REQUEST['reload']) && isset($_REQUEST['filterName']) && $_REQUEST['filterName'] == $row['Name'] ) + $dbFilter = $row; +} + +$backgroundStr = ""; +if ( isset($dbFilter) ) +{ + if ( $dbFilter['Background'] ) + $backgroundStr = '['.strtolower($SLANG['Background']).']'; + $_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'] ); +} + +$conjunctionTypes = array( + 'and' => $SLANG['ConjAnd'], + 'or' => $SLANG['ConjOr'] +); +$obracketTypes = array(); +$cbracketTypes = array(); +if ( isset($_REQUEST['filter']['terms']) ) +{ + for ( $i = 0; $i <= count($_REQUEST['filter']['terms'])-2; $i++ ) + { + $obracketTypes[$i] = str_repeat( "(", $i ); + $cbracketTypes[$i] = str_repeat( ")", $i ); + } +} + +$attrTypes = array( + 'MonitorId' => $SLANG['AttrMonitorId'], + 'MonitorName' => $SLANG['AttrMonitorName'], + 'Id' => $SLANG['AttrId'], + 'Name' => $SLANG['AttrName'], + 'Cause' => $SLANG['AttrCause'], + 'Notes' => $SLANG['AttrNotes'], + 'DateTime' => $SLANG['AttrDateTime'], + 'Date' => $SLANG['AttrDate'], + 'Time' => $SLANG['AttrTime'], + 'Weekday' => $SLANG['AttrWeekday'], + 'Length' => $SLANG['AttrDuration'], + 'Frames' => $SLANG['AttrFrames'], + 'AlarmFrames' => $SLANG['AttrAlarmFrames'], + 'TotScore' => $SLANG['AttrTotalScore'], + 'AvgScore' => $SLANG['AttrAvgScore'], + 'MaxScore' => $SLANG['AttrMaxScore'], + 'Archived' => $SLANG['AttrArchiveStatus'], + 'DiskPercent' => $SLANG['AttrDiskPercent'], + 'DiskBlocks' => $SLANG['AttrDiskBlocks'], + 'SystemLoad' => $SLANG['AttrSystemLoad'], +); +$opTypes = array( + '=' => $SLANG['OpEq'], + '!=' => $SLANG['OpNe'], + '>=' => $SLANG['OpGtEq'], + '>' => $SLANG['OpGt'], + '<' => $SLANG['OpLt'], + '<=' => $SLANG['OpLtEq'], + '=~' => $SLANG['OpMatches'], + '!~' => $SLANG['OpNotMatches'], + '=[]' => $SLANG['OpIn'], + '![]' => $SLANG['OpNotIn'], +); +$archiveTypes = array( + '0' => $SLANG['ArchUnarchived'], + '1' => $SLANG['ArchArchived'] +); +$weekdays = array(); +for ( $i = 0; $i < 7; $i++ ) +{ + $weekdays[$i] = strftime( "%A", mktime( 12, 0, 0, 1, $i+1, 2001 ) ); +} +$sort_fields = array( + 'Id' => $SLANG['AttrId'], + 'Name' => $SLANG['AttrName'], + 'Cause' => $SLANG['AttrCause'], + 'Notes' => $SLANG['AttrNotes'], + 'MonitorName' => $SLANG['AttrMonitorName'], + 'DateTime' => $SLANG['AttrDateTime'], + 'Length' => $SLANG['AttrDuration'], + 'Frames' => $SLANG['AttrFrames'], + 'AlarmFrames' => $SLANG['AttrAlarmFrames'], + 'TotScore' => $SLANG['AttrTotalScore'], + 'AvgScore' => $SLANG['AttrAvgScore'], + 'MaxScore' => $SLANG['AttrMaxScore'], +); +$sort_dirns = array( + '1' => $SLANG['SortAsc'], + '0' => $SLANG['SortDesc'] +); +if ( empty($_REQUEST['sort_field']) ) +{ + $_REQUEST['sort_field'] = ZM_WEB_EVENT_SORT_FIELD; + $_REQUEST['sort_asc'] = (ZM_WEB_EVENT_SORT_ORDER == "asc"); +} + +$hasCal = file_exists( 'tools/jscalendar/calendar.js' ); + +$focusWindow = true; + +xhtmlHeaders(__FILE__, $SLANG['EventFilter'] ); +?> + +
+ +
+
+ + + + + + + + +
+
1 ) { echo buildSelect( $selectName, $filterNames, "submitToFilter( this, 1 );" ); } else { ?>
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  2 ) { echo buildSelect( "filter[terms][$i][obr]", $obracketTypes ); } else { ?>  2 ) { echo buildSelect( "filter[terms][$i][cbr]", $cbracketTypes ); } else { ?>  1 ) { ?>
+
+ + + + + + + +
"/>
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
checked="checked" onclick="updateButtons( this )"/>
checked="checked" onclick="updateButtons( this )"/>
checked="checked" onclick="updateButtons( this )"/>
checked="checked" onclick="updateButtons( this )"/>
checked="checked" onclick="updateButtons( this )"/>
checked="checked"/>" size="32" maxlength="255" onchange="updateButtons( this )"/>
checked="checked" onclick="updateButtons( this )"/>
+
+
+ + + + + + + +
+
+
+
+ + diff --git a/web/skins/classic/views/filtersave.php b/web/skins/classic/views/filtersave.php new file mode 100644 index 000000000..ba040d72f --- /dev/null +++ b/web/skins/classic/views/filtersave.php @@ -0,0 +1,86 @@ + + +
+ +
+
+ + + + + + + + + + + + + + + +

+ +

+ +

+ +

+ +

+ checked="checked"/> +

+
+ disabled="disabled"/> +
+
+
+
+ + diff --git a/web/skins/classic/views/frame.php b/web/skins/classic/views/frame.php new file mode 100644 index 000000000..1cbe3634e --- /dev/null +++ b/web/skins/classic/views/frame.php @@ -0,0 +1,103 @@ +$fid, 'Type'=>'Normal', 'Score'=>0 ); +} +else +{ + $frame = dbFetchOne( "select * from Frames where EventId = '".dbEscape($eid)."' and Score = '".$event['MaxScore']."'" ); +} + +$maxFid = $event['Frames']; + +$firstFid = 1; +$prevFid = $frame['FrameId']-1; +$nextFid = $frame['FrameId']+1; +$lastFid = $maxFid; + +$alarmFrame = $frame['Type']=='Alarm'; + +if ( isset( $_REQUEST['scale'] ) ) + $scale = validInt($_REQUEST['scale']); +else + $scale = max( reScale( SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ), SCALE_BASE ); + +$imageData = getImageSrc( $event, $frame, $scale, (isset($_REQUEST['show']) && $_REQUEST['show']=="capt") ); + +$imagePath = $imageData['thumbPath']; +$eventPath = $imageData['eventPath']; +$dImagePath = sprintf( "%s/%0".ZM_EVENT_IMAGE_DIGITS."d-diag-d.jpg", $eventPath, $frame['FrameId'] ); +$rImagePath = sprintf( "%s/%0".ZM_EVENT_IMAGE_DIGITS."d-diag-r.jpg", $eventPath, $frame['FrameId'] ); + +$focusWindow = true; + +xhtmlHeaders(__FILE__, $SLANG['Frame']." - ".$event['Id']." - ".$frame['FrameId'] ); +?> + +
+ +
+

"><?= $frame['EventId']." class=""/>

+

+ 1 ) { ?> + + 1 ) { ?> + + + + + + +

+ +

+

" width="" height="" class=""/>

+ +

+

+ +
+
+ + diff --git a/web/skins/classic/views/frames.php b/web/skins/classic/views/frames.php new file mode 100644 index 000000000..a9c7862fe --- /dev/null +++ b/web/skins/classic/views/frames.php @@ -0,0 +1,103 @@ + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ + diff --git a/web/skins/classic/views/function.php b/web/skins/classic/views/function.php new file mode 100644 index 000000000..445450f30 --- /dev/null +++ b/web/skins/classic/views/function.php @@ -0,0 +1,64 @@ + + +
+ +
+
+ + + +

+ + checked="checked"/> +

+
+ + +
+
+
+
+ + diff --git a/web/skins/classic/views/group.php b/web/skins/classic/views/group.php new file mode 100644 index 000000000..bb81774d6 --- /dev/null +++ b/web/skins/classic/views/group.php @@ -0,0 +1,88 @@ + "", + "Name" => "New Group", + "MonitorIds" => "" + ); +} + +xhtmlHeaders( __FILE__, $SLANG['Group']." - ".$newGroup['Name'] ); +?> + +
+ +
+
+ + + + + + + + + + + + + + +
+ +
+
+ disabled="disabled"/> + +
+
+
+
+ + diff --git a/web/skins/classic/views/groups.php b/web/skins/classic/views/groups.php new file mode 100644 index 000000000..87f8b9ebe --- /dev/null +++ b/web/skins/classic/views/groups.php @@ -0,0 +1,94 @@ + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
onclick="configureButtons( this );"/>
onclick="configureButtons( this );"/>
+
+ + /> + /> + /> + +
+
+
+
+ + diff --git a/web/skins/classic/views/js/Makefile.am b/web/skins/classic/views/js/Makefile.am new file mode 100644 index 000000000..ba1845e0c --- /dev/null +++ b/web/skins/classic/views/js/Makefile.am @@ -0,0 +1,49 @@ +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 \ + options.js.php \ + postlogin.js \ + 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 diff --git a/web/skins/classic/views/js/Makefile.in b/web/skins/classic/views/js/Makefile.in new file mode 100644 index 000000000..ecaf3b191 --- /dev/null +++ b/web/skins/classic/views/js/Makefile.in @@ -0,0 +1,496 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/skins/classic/views/js +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +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 \ + options.js.php \ + postlogin.js \ + 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 + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/skins/classic/views/js/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/skins/classic/views/js/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_webDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/skins/classic/views/js/console.js b/web/skins/classic/views/js/console.js new file mode 100644 index 000000000..5182a5fd5 --- /dev/null +++ b/web/skins/classic/views/js/console.js @@ -0,0 +1,65 @@ +function setButtonStates( element ) +{ + var form = element.form; + var checked = 0; + for ( var i = 0; i < form.elements.length; i++ ) + { + if ( form.elements[i].type == "checkbox" ) + { + if ( form.elements[i].checked ) + { + if ( checked++ > 1 ) + break; + } + } + } + $(element).getParent( 'tr' ).toggleClass( 'highlight' ); + form.editBtn.disabled = (checked!=1); + form.deleteBtn.disabled = (checked==0); +} + +function editMonitor( element ) +{ + var form = element.form; + for ( var i = 0; i < form.elements.length; i++ ) + { + if ( form.elements[i].type == "checkbox" ) + { + if ( form.elements[i].checked ) + { + var monitorId = form.elements[i].value; + createPopup( '?view=monitor&mid='+monitorId, 'zmMonitor'+monitorId, 'monitor' ); + form.elements[i].checked = false; + setButtonStates( form.elements[i] ); + //$(form.elements[i]).getParent( 'tr' ).removeClass( 'highlight' ); + break; + } + } + } +} + +function deleteMonitor( element ) +{ + if ( confirm( 'Warning, deleting a monitor also deletes all events and database entries associated with it.\nAre you sure you wish to delete?' ) ) + { + var form = element.form; + form.elements['action'].value = 'delete'; + form.submit(); + } +} + +function reloadWindow() +{ + window.location.replace( thisUrl ); +} + +function initPage() +{ + reloadWindow.periodical( consoleRefreshTimeout ); + if ( showVersionPopup ) + createPopup( '?view=version', 'zmVersion', 'version' ); + if ( showDonatePopup ) + createPopup( '?view=donate', 'zmDonate', 'donate' ); +} + +window.addEvent( 'domready', initPage ); diff --git a/web/skins/classic/views/js/console.js.php b/web/skins/classic/views/js/console.js.php new file mode 100644 index 000000000..90f66a619 --- /dev/null +++ b/web/skins/classic/views/js/console.js.php @@ -0,0 +1,28 @@ +var consoleRefreshTimeout = ; + + 0 ) + { + if ( ZM_DYN_DONATE_REMINDER_TIME < time() ) + { + $showDonatePopup = true; + } + } + else + { + $nextReminder = time() + 30*24*60*60; + dbQuery( "update Config set Value = '".$nextReminder."' where Name = 'ZM_DYN_DONATE_REMINDER_TIME'" ); + } + } +} +?> +var showVersionPopup = ; +var showDonatePopup = ; diff --git a/web/skins/classic/views/js/control.js b/web/skins/classic/views/js/control.js new file mode 100644 index 000000000..819f088d8 --- /dev/null +++ b/web/skins/classic/views/js/control.js @@ -0,0 +1,49 @@ +var controlParms = "view=request&request=control"; +var controlReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, onSuccess: getControlResponse } ); + +function getControlResponse( respObj, respText ) +{ + if ( !respObj ) + return; + //console.log( respText ); + if ( respObj.result != 'Ok' ) + { + alert( "Control response was status = "+respObj.status+"\nmessage = "+respObj.message ); + } +} + +function controlCmd( control, event, xtell, ytell ) +{ + var locParms = "&id="+$('mid').get('value'); + if ( event && (xtell || ytell) ) + { + var xEvent = new Event( event ); + var target = xEvent.target; + var coords = $(target).getCoordinates(); + + var l = coords.left; + var t = coords.top; + var x = xEvent.page.x - l; + var y = xEvent.page.y - t; + + if ( xtell ) + { + var xge = parseInt( (x*100)/coords.width ); + if ( xtell == -1 ) + xge = 100 - xge; + else if ( xtell == 2 ) + xge = 2*(50 - xge); + locParms += "&xge="+xge; + } + if ( ytell ) + { + var yge = parseInt( (y*100)/coords.height ); + if ( ytell == -1 ) + yge = 100 - yge; + else if ( ytell == 2 ) + yge = 2*(50 - yge); + locParms += "&yge="+yge; + } + } + controlReq.send( controlParms+"&control="+control+locParms ); +} diff --git a/web/skins/classic/views/js/controlpreset.js b/web/skins/classic/views/js/controlpreset.js new file mode 100644 index 000000000..ec2629cae --- /dev/null +++ b/web/skins/classic/views/js/controlpreset.js @@ -0,0 +1,14 @@ +function updateLabel() +{ + var presetIndex = $('contentForm').preset.getValue(); + if ( labels[presetIndex] ) + { + $('contentForm').newLabel.value = labels[presetIndex]; + } + else + { + $('contentForm').newLabel.value = ""; + } +} + +window.addEvent( 'domready', updateLabel ); diff --git a/web/skins/classic/views/js/controlpreset.js.php b/web/skins/classic/views/js/controlpreset.js.php new file mode 100644 index 000000000..0aac01bf6 --- /dev/null +++ b/web/skins/classic/views/js/controlpreset.js.php @@ -0,0 +1,9 @@ +var labels = new Array(); +$label ) +{ +?> +labels[] = ""; + diff --git a/web/skins/classic/views/js/cycle.js b/web/skins/classic/views/js/cycle.js new file mode 100644 index 000000000..e799a422e --- /dev/null +++ b/web/skins/classic/views/js/cycle.js @@ -0,0 +1,11 @@ +function nextCycleView() +{ + window.location.replace( '?view=cycle&group='+currGroup+'&mid='+nextMid+'&mode='+mode, cycleRefreshTimeout ); +} + +function initCycle() +{ + nextCycleView.periodical( cycleRefreshTimeout ); +} + +window.addEvent( 'domready', initCycle ); diff --git a/web/skins/classic/views/js/cycle.js.php b/web/skins/classic/views/js/cycle.js.php new file mode 100644 index 000000000..c9dabaec4 --- /dev/null +++ b/web/skins/classic/views/js/cycle.js.php @@ -0,0 +1,5 @@ +var currGroup = ""; +var nextMid = ""; +var mode = ""; + +var cycleRefreshTimeout = ; diff --git a/web/skins/classic/views/js/devices.js b/web/skins/classic/views/js/devices.js new file mode 100644 index 000000000..8191518fc --- /dev/null +++ b/web/skins/classic/views/js/devices.js @@ -0,0 +1,47 @@ +function switchDeviceOn( element, key ) +{ + var form = element.form; + form.view.value = currentView; + form.action.value = 'device'; + form.command.value = 'on'; + form.key.value = key; + form.submit(); +} + +function switchDeviceOff( element, key ) +{ + var form = element.form; + form.view.value = currentView; + form.action.value = 'device'; + form.command.value = 'off'; + form.key.value = key; + form.submit(); +} + +function deleteDevice( element ) +{ + var form = element.form; + form.view.value = currentView; + form.action.value = 'delete'; + form.submit(); +} + +function configureButtons( element, name ) +{ + var form = element.form; + var checked = false; + for (var i = 0; i < form.elements.length; i++) + { + if ( form.elements[i].name.indexOf(name) == 0) + { + if ( form.elements[i].checked ) + { + checked = true; + break; + } + } + } + form.deleteBtn.disabled = !checked; +} + +window.focus(); diff --git a/web/skins/classic/views/js/donate.js b/web/skins/classic/views/js/donate.js new file mode 100644 index 000000000..87d99198b --- /dev/null +++ b/web/skins/classic/views/js/donate.js @@ -0,0 +1,14 @@ +function submitForm( element ) +{ + var form = element.form; + if ( form.option.selectedIndex == 0 ) + form.view.value = currentView; + else + form.view.value = 'none'; + form.submit(); +} + +if ( action == "donate" && option == "go" ) +{ + zmWindow(); +} diff --git a/web/skins/classic/views/js/donate.js.php b/web/skins/classic/views/js/donate.js.php new file mode 100644 index 000000000..9d24e392f --- /dev/null +++ b/web/skins/classic/views/js/donate.js.php @@ -0,0 +1,2 @@ +var action = ''; +var option = ''; diff --git a/web/skins/classic/views/js/event.js b/web/skins/classic/views/js/event.js new file mode 100644 index 000000000..a1b2a2e55 --- /dev/null +++ b/web/skins/classic/views/js/event.js @@ -0,0 +1,754 @@ +function setButtonState( element, butClass ) +{ + element.className = butClass; + element.disabled = (butClass != 'inactive'); +} + +function changeScale() +{ + var scale = $('scale').get('value'); + var baseWidth = eventData.Width; + var baseHeight = eventData.Height; + var newWidth = ( baseWidth * scale ) / SCALE_BASE; + var newHeight = ( baseHeight * scale ) / SCALE_BASE; + + streamScale( scale ); + + /*Stream could be an applet so can't use moo tools*/ + var streamImg = document.getElementById('evtStream'); + streamImg.style.width = newWidth + "px"; + streamImg.style.height = newHeight + "px"; +} + +function changeReplayMode() +{ + var replayMode = $('replayMode').get('value'); + + Cookie.write( 'replayMode', replayMode, { duration: 10*365 }) + + refreshWindow(); +} + +var streamParms = "view=request&request=stream&connkey="+connKey; +var streamCmdTimer = null; + +var streamStatus = null; +var lastEventId = 0; + +function getCmdResponse( respObj, respText ) +{ + if ( checkStreamForErrors( "getCmdResponse" ,respObj ) ) + return; + + if ( streamCmdTimer ) + streamCmdTimer = clearTimeout( streamCmdTimer ); + + streamStatus = respObj.status; + + var eventId = streamStatus.event; + if ( eventId != lastEventId ) + { + eventQuery( eventId ); + lastEventId = eventId; + } + if ( streamStatus.paused == true ) + { + $('modeValue').set( 'text', "Paused" ); + $('rate').addClass( 'hidden' ); + streamPause( false ); + } + else + { + $('modeValue').set( 'text', "Replay" ); + $('rateValue').set( 'text', streamStatus.rate ); + $('rate').removeClass( 'hidden' ); + streamPlay( false ); + } + $('progressValue').set( 'text', secsToTime( parseInt(streamStatus.progress) ) ); + $('zoomValue').set( 'text', streamStatus.zoom ); + if ( streamStatus.zoom == "1.0" ) + setButtonState( $('zoomOutBtn'), 'unavail' ); + else + setButtonState( $('zoomOutBtn'), 'inactive' ); + + updateProgressBar(); + + streamCmdTimer = streamQuery.delay( streamTimeout ); +} + +var streamReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, link: 'chain', onSuccess: getCmdResponse } ); + +function streamPause( action ) +{ + setButtonState( $('pauseBtn'), 'active' ); + setButtonState( $('playBtn'), 'inactive' ); + setButtonState( $('fastFwdBtn'), 'unavail' ); + setButtonState( $('slowFwdBtn'), 'inactive' ); + setButtonState( $('slowRevBtn'), 'inactive' ); + setButtonState( $('fastRevBtn'), 'unavail' ); + if ( action ) + streamReq.send( streamParms+"&command="+CMD_PAUSE ); +} + +function streamPlay( action ) +{ + setButtonState( $('pauseBtn'), 'inactive' ); + if (streamStatus) + setButtonState( $('playBtn'), streamStatus.rate==1?'active':'inactive' ); + setButtonState( $('fastFwdBtn'), 'inactive' ); + setButtonState( $('slowFwdBtn'), 'unavail' ); + setButtonState( $('slowRevBtn'), 'unavail' ); + setButtonState( $('fastRevBtn'), 'inactive' ); + if ( action ) + { + streamReq.send( streamParms+"&command="+CMD_PLAY ); + } +} + +function streamFastFwd( action ) +{ + setButtonState( $('pauseBtn'), 'inactive' ); + setButtonState( $('playBtn'), 'inactive' ); + setButtonState( $('fastFwdBtn'), 'inactive' ); + setButtonState( $('slowFwdBtn'), 'unavail' ); + setButtonState( $('slowRevBtn'), 'unavail' ); + setButtonState( $('fastRevBtn'), 'inactive' ); + if ( action ) + streamReq.send( streamParms+"&command="+CMD_FASTFWD ); +} + +function streamSlowFwd( action ) +{ + setButtonState( $('pauseBtn'), 'inactive' ); + setButtonState( $('playBtn'), 'inactive' ); + setButtonState( $('fastFwdBtn'), 'unavail' ); + setButtonState( $('slowFwdBtn'), 'active' ); + setButtonState( $('slowRevBtn'), 'inactive' ); + setButtonState( $('fastRevBtn'), 'unavail' ); + if ( action ) + streamReq.send( streamParms+"&command="+CMD_SLOWFWD ); + setButtonState( $('pauseBtn'), 'active' ); + setButtonState( $('slowFwdBtn'), 'inactive' ); +} + +function streamSlowRev( action ) +{ + setButtonState( $('pauseBtn'), 'inactive' ); + setButtonState( $('playBtn'), 'inactive' ); + setButtonState( $('fastFwdBtn'), 'unavail' ); + setButtonState( $('slowFwdBtn'), 'inactive' ); + setButtonState( $('slowRevBtn'), 'active' ); + setButtonState( $('fastRevBtn'), 'unavail' ); + if ( action ) + streamReq.send( streamParms+"&command="+CMD_SLOWREV ); + setButtonState( $('pauseBtn'), 'active' ); + setButtonState( $('slowRevBtn'), 'inactive' ); +} + +function streamFastRev( action ) +{ + setButtonState( $('pauseBtn'), 'inactive' ); + setButtonState( $('playBtn'), 'inactive' ); + setButtonState( $('fastFwdBtn'), 'inactive' ); + setButtonState( $('slowFwdBtn'), 'unavail' ); + setButtonState( $('slowRevBtn'), 'unavail' ); + setButtonState( $('fastRevBtn'), 'inactive' ); + if ( action ) + streamReq.send( streamParms+"&command="+CMD_FASTREV ); +} + +function streamPrev( action ) +{ + streamPlay( false ); + if ( action ) + streamReq.send( streamParms+"&command="+CMD_PREV ); +} + +function streamNext( action ) +{ + streamPlay( false ); + if ( action ) + streamReq.send( streamParms+"&command="+CMD_NEXT ); +} + +function streamZoomIn( x, y ) +{ + streamReq.send( streamParms+"&command="+CMD_ZOOMIN+"&x="+x+"&y="+y ); +} + +function streamZoomOut() +{ + streamReq.send( streamParms+"&command="+CMD_ZOOMOUT ); +} + +function streamScale( scale ) +{ + streamReq.send( streamParms+"&command="+CMD_SCALE+"&scale="+scale ); +} + +function streamPan( x, y ) +{ + streamReq.send( streamParms+"&command="+CMD_PAN+"&x="+x+"&y="+y ); +} + +function streamSeek( offset ) +{ + streamReq.send( streamParms+"&command="+CMD_SEEK+"&offset="+offset ); +} + +function streamQuery() +{ + streamReq.send( streamParms+"&command="+CMD_QUERY ); +} + +var slider = null; +var scroll = null; + +function getEventResponse( respObj, respText ) +{ + if ( checkStreamForErrors( "getEventResponse", respObj ) ) + return; + + eventData = respObj.event; + if ( !$('eventStills').hasClass( 'hidden' ) && currEventId != eventData.Id ) + resetEventStills(); + currEventId = eventData.Id; + + $('dataId').set( 'text', eventData.Id ); + if ( eventData.Notes ) + { + $('dataCause').setProperty( 'title', eventData.Notes ); + } + else + { + $('dataCause').setProperty( 'title', causeString ); + } + $('dataCause').set( 'text', eventData.Cause ); + $('dataTime').set( 'text', eventData.StartTime ); + $('dataDuration').set( 'text', eventData.Length ); + $('dataFrames').set( 'text', eventData.Frames+"/"+eventData.AlarmFrames ); + $('dataScore').set( 'text', eventData.TotScore+"/"+eventData.AvgScore+"/"+eventData.MaxScore ); + $('eventName').setProperty( 'value', eventData.Name ); + + if ( canEditEvents ) + { + if ( parseInt(eventData.Archived) ) + { + $('archiveEvent').addClass( 'hidden' ); + $('unarchiveEvent').removeClass( 'hidden' ); + } + else + { + $('archiveEvent').removeClass( 'hidden' ); + $('unarchiveEvent').addClass( 'hidden' ); + } + } + //var eventImg = $('eventImage'); + //eventImg.setStyles( { 'width': eventData.width, 'height': eventData.height } ); + drawProgressBar(); + nearEventsQuery( eventData.Id ); +} + +var eventReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: getEventResponse } ); + +function eventQuery( eventId ) +{ + var eventParms = "view=request&request=status&entity=event&id="+eventId; + eventReq.send( eventParms ); +} + +var prevEventId = 0; +var nextEventId = 0; + +function getNearEventsResponse( respObj, respText ) +{ + if ( checkStreamForErrors( "getNearEventsResponse", respObj ) ) + return; + prevEventId = respObj.nearevents.PrevEventId; + nextEventId = respObj.nearevents.NextEventId; + + $('prevEventBtn').disabled = !prevEventId; + $('nextEventBtn').disabled = !nextEventId; +} + +var nearEventsReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: getNearEventsResponse } ); + +function nearEventsQuery( eventId ) +{ + var parms = "view=request&request=status&entity=nearevents&id="+eventId; + nearEventsReq.send( parms ); +} + +var frameBatch = 40; + +function loadEventThumb( event, frame, loadImage ) +{ + var thumbImg = $('eventThumb'+frame.FrameId); + if ( !thumbImg ) + { + console.error( "No holder found for frame "+frame.FrameId ); + return; + } + var img = new Asset.image( imagePrefix+frame.Image.imagePath, + { + 'onload': ( function( loadImage ) + { + thumbImg.setProperty( 'src', img.getProperty( 'src' ) ); + thumbImg.removeClass( 'placeholder' ); + thumbImg.setProperty( 'class', frame.Type=='Alarm'?'alarm':'normal' ); + thumbImg.setProperty( 'title', frame.FrameId+' / '+((frame.Type=='Alarm')?frame.Score:0) ); + thumbImg.removeEvents( 'click' ); + thumbImg.addEvent( 'click', function() { locateImage( frame.FrameId, true ); } ); + if ( loadImage ) + loadEventImage( event, frame ); + } ).pass( loadImage ) + } + ); +} + +function updateStillsSizes( noDelay ) +{ + var containerDim = $('eventThumbs').getSize(); + + var containerWidth = containerDim.x; + var containerHeight = containerDim.y; + var popupWidth = parseInt($('eventImage').getStyle( 'width' )); + var popupHeight = parseInt($('eventImage').getStyle( 'height' )); + + var left = (containerWidth - popupWidth)/2; + if ( left < 0 ) left = 0; + var top = (containerHeight - popupHeight)/2; + if ( top < 0 ) top = 0; + if ( popupHeight == 0 && !noDelay ) // image not yet loaded lets give it another second + { + updateStillsSizes.pass( true ).delay( 50 ); + return; + } + $('eventImagePanel').setStyles( { + 'left': left, + 'top': top + } ); +} + +function loadEventImage( event, frame ) +{ + console.debug( "Loading "+event.Id+"/"+frame.FrameId ); + var eventImg = $('eventImage'); + var thumbImg = $('eventThumb'+frame.FrameId); + if ( eventImg.getProperty( 'src' ) != thumbImg.getProperty( 'src' ) ) + { + var eventImagePanel = $('eventImagePanel'); + + if ( eventImagePanel.getStyle( 'display' ) != 'none' ) + { + var lastThumbImg = $('eventThumb'+eventImg.getProperty( 'alt' )); + lastThumbImg.removeClass('selected'); + lastThumbImg.setOpacity( 1.0 ); + } + + eventImg.setProperties( { + 'class': frame.Type=='Alarm'?'alarm':'normal', + 'src': thumbImg.getProperty( 'src' ), + 'title': thumbImg.getProperty( 'title' ), + 'alt': thumbImg.getProperty( 'alt' ), + 'width': event.Width, + 'height': event.Height + } ); + $('eventImageBar').setStyle( 'width', event.Width ); + if ( frame.Type=='Alarm' ) + $('eventImageStats').removeClass( 'hidden' ); + else + $('eventImageStats').addClass( 'hidden' ); + thumbImg.addClass( 'selected' ); + thumbImg.setOpacity( 0.5 ); + + if ( eventImagePanel.getStyle( 'display' ) == 'none' ) + { + eventImagePanel.setOpacity( 0 ); + updateStillsSizes(); + eventImagePanel.setStyle( 'display', 'block' ); + new Fx.Tween( eventImagePanel, { duration: 500, transition: Fx.Transitions.Sine } ).start( 'opacity', 0, 1 ); + } + + $('eventImageNo').set( 'text', frame.FrameId ); + $('prevImageBtn').disabled = (frame.FrameId==1); + $('nextImageBtn').disabled = (frame.FrameId==event.Frames); + } +} + +function hideEventImageComplete() +{ + var eventImg = $('eventImage'); + var thumbImg = $('eventThumb'+$('eventImage').getProperty( 'alt' )); + thumbImg.removeClass('selected'); + thumbImg.setOpacity( 1.0 ); + $('prevImageBtn').disabled = true; + $('nextImageBtn').disabled = true; + $('eventImagePanel').setStyle( 'display', 'none' ); + $('eventImageStats').addClass( 'hidden' ); +} + +function hideEventImage() +{ + if ( $('eventImagePanel').getStyle( 'display' ) != 'none' ) + new Fx.Tween( $('eventImagePanel'), { duration: 500, transition: Fx.Transitions.Sine, onComplete: hideEventImageComplete } ).start( 'opacity', 1, 0 ); +} + +function resetEventStills() +{ + hideEventImage(); + $('eventThumbs').empty(); + if ( true || !slider ) + { + slider = new Slider( $('thumbsSlider'), $('thumbsKnob'), { + /*steps: eventData.Frames,*/ + onChange: function( step ) + { + if ( !step ) + step = 0; + var fid = parseInt((step * eventData.Frames)/this.options.steps); + if ( fid < 1 ) + fid = 1; + else if ( fid > eventData.Frames ) + fid = eventData.Frames; + checkFrames( eventData.Id, fid ); + scroll.toElement( 'eventThumb'+fid ); + } + } ).set( 0 ); + } + if ( $('eventThumbs').getStyle( 'height' ).match( /^\d+/ ) < (parseInt(eventData.Height)+80) ) + $('eventThumbs').setStyle( 'height', (parseInt(eventData.Height)+80)+'px' ); +} + +function getFrameResponse( respObj, respText ) +{ + if ( checkStreamForErrors( "getFrameResponse", respObj ) ) + return; + + var frame = respObj.frameimage; + + if ( !eventData ) + { + console.error( "No event "+frame.EventId+" found" ); + return; + } + + if ( !eventData['frames'] ) + eventData['frames'] = new Object(); + + eventData['frames'][frame.FrameId] = frame; + + loadEventThumb( eventData, frame, respObj.loopback=="true" ); +} + +var frameReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, link: 'chain', onSuccess: getFrameResponse } ); + +function frameQuery( eventId, frameId, loadImage ) +{ + var parms = "view=request&request=status&entity=frameimage&id[0]="+eventId+"&id[1]="+frameId+"&loopback="+loadImage; + frameReq.send( parms ); +} + +var currFrameId = null; + +function checkFrames( eventId, frameId, loadImage ) +{ + if ( !eventData ) + { + console.error( "No event "+eventId+" found" ); + return; + } + + if ( !eventData['frames'] ) + eventData['frames'] = new Object(); + + currFrameId = frameId; + + var loFid = frameId - frameBatch/2; + if ( loFid < 1 ) + loFid = 1; + var hiFid = loFid + (frameBatch-1); + if ( hiFid > eventData.Frames ) + hiFid = eventData.Frames; + + for ( var fid = loFid; fid <= hiFid; fid++ ) + { + if ( !$('eventThumb'+fid) ) + { + var img = new Element( 'img', { 'id': 'eventThumb'+fid, 'src': 'graphics/transparent.gif', 'alt': fid, 'class': 'placeholder' } ); + img.addEvent( 'click', function () { eventData['frames'][fid] = null; checkFrames( eventId, fid ) } ); + frameQuery( eventId, fid, loadImage && (fid == frameId) ); + var imgs = $('eventThumbs').getElements( 'img' ); + var injected = false; + if ( fid < imgs.length ) + { + img.inject( imgs[fid-1], 'before' ); + injected = true; + } + else + { + injected = imgs.some( + function( thumbImg, index ) + { + if ( parseInt(img.getProperty( 'alt' )) < parseInt(thumbImg.getProperty( 'alt' )) ) + { + img.inject( thumbImg, 'before' ); + return( true ); + } + return( false ); + } + ); + } + if ( !injected ) + { + img.inject( $('eventThumbs') ); + } + var scale = parseInt(img.getStyle('height')); + img.setStyles( { + 'width': parseInt((eventData.Width*scale)/100), + 'height': parseInt((eventData.Height*scale)/100) + } ); + } + else if ( eventData['frames'][fid] ) + { + if ( loadImage && (fid == frameId) ) + { + loadEventImage( eventData, eventData['frames'][fid], loadImage ); + } + } + } + $('prevThumbsBtn').disabled = (frameId==1); + $('nextThumbsBtn').disabled = (frameId==eventData.Frames); +} + +function locateImage( frameId, loadImage ) +{ + if ( slider ) + slider.fireEvent( 'tick', slider.toPosition( parseInt((frameId-1)*slider.options.steps/eventData.Frames) )); + checkFrames( eventData.Id, frameId, loadImage ); + scroll.toElement( 'eventThumb'+frameId ); +} + +function prevImage() +{ + if ( currFrameId > 1 ) + locateImage( parseInt(currFrameId)-1, true ); +} + +function nextImage() +{ + if ( currFrameId < eventData.Frames ) + locateImage( parseInt(currFrameId)+1, true ); +} + +function prevThumbs() +{ + if ( currFrameId > 1 ) + locateImage( parseInt(currFrameId)>10?(parseInt(currFrameId)-10):1, $('eventImagePanel').getStyle('display')!="none" ); +} + +function nextThumbs() +{ + if ( currFrameId < eventData.Frames ) + locateImage( parseInt(currFrameId)<(eventData.Frames-10)?(parseInt(currFrameId)+10):eventData.Frames, $('eventImagePanel').getStyle('display')!="none" ); +} + +function prevEvent() +{ + if ( prevEventId ) + { + eventQuery( prevEventId ); + streamPrev( true ); + } +} + +function nextEvent() +{ + if ( nextEventId ) + { + eventQuery( nextEventId ); + streamNext( true ); + } +} + +function getActResponse( respObj, respText ) +{ + if ( checkStreamForErrors( "getActResponse", respObj ) ) + return; + + if ( respObj.refreshParent ) + refreshParentWindow(); + + if ( respObj.refreshEvent ) + eventQuery( eventData.Id ); +} + +var actReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: getActResponse } ); + +function actQuery( action, parms ) +{ + var actParms = "view=request&request=event&id="+eventData.Id+"&action="+action; + if ( parms != null ) + actParms += "&"+Object.toQueryString( parms ); + actReq.send( actParms ); +} + +function deleteEvent() +{ + actQuery( 'delete' ); + streamNext( true ); +} + +function renameEvent() +{ + var newName = $('eventName').get('value'); + actQuery( 'rename', { eventName: newName } ); +} + +function editEvent() +{ + createPopup( '?view=eventdetail&eid='+eventData.Id, 'zmEventDetail', 'eventdetail' ); +} + +function exportEvent() +{ + createPopup( '?view=export&eid='+eventData.Id, 'zmExport', 'export' ); +} + +function archiveEvent() +{ + actQuery( 'archive' ); +} + +function unarchiveEvent() +{ + actQuery( 'unarchive' ); +} + +function showEventFrames() +{ + createPopup( '?view=frames&eid='+eventData.Id, 'zmFrames', 'frames' ); +} + +function showStream() +{ + $('eventStills').addClass( 'hidden' ); + $('eventStream').removeClass( 'hidden' ); + $('streamEvent').addClass( 'hidden' ); + $('stillsEvent').removeClass( 'hidden' ); + + //$(window).removeEvent( 'resize', updateStillsSizes ); +} + +function showStills() +{ + $('eventStream').addClass( 'hidden' ); + $('eventStills').removeClass( 'hidden' ); + $('stillsEvent').addClass( 'hidden' ); + $('streamEvent').removeClass( 'hidden' ); + streamPause( true ); + if ( !scroll ) + { + scroll = new Fx.Scroll( 'eventThumbs', { + wait: false, + duration: 500, + offset: { 'x': 0, 'y': 0 }, + transition: Fx.Transitions.Quad.easeInOut + } + ); + } + resetEventStills(); + $(window).addEvent( 'resize', updateStillsSizes ); +} + +function showFrameStats() +{ + var fid = $('eventImageNo').get('text'); + createPopup( '?view=stats&eid='+eventData.Id+'&fid='+fid, 'zmStats', 'stats', eventData.Width, eventData.Height ); +} + +function videoEvent() +{ + createPopup( '?view=video&eid='+eventData.Id, 'zmVideo', 'video', eventData.Width, eventData.Height ); +} + +function drawProgressBar() +{ + var barWidth = 0; + $('progressBar').addClass( 'invisible' ); + var cells = $('progressBar').getElements( 'div' ); + var cellWidth = parseInt( eventData.Width/$$(cells).length ); + $$(cells).forEach( + function( cell, index ) + { + if ( index == 0 ) + $(cell).setStyles( { 'left': barWidth, 'width': cellWidth, 'borderLeft': 0 } ); + else + $(cell).setStyles( { 'left': barWidth, 'width': cellWidth } ); + var offset = parseInt((index*eventData.Length)/$$(cells).length); + $(cell).setProperty( 'title', '+'+secsToTime(offset)+'s' ); + $(cell).removeEvent( 'click' ); + $(cell).addEvent( 'click', function(){ streamSeek( offset ); } ); + barWidth += $(cell).getCoordinates().width; + } + ); + $('progressBar').setStyle( 'width', barWidth ); + $('progressBar').removeClass( 'invisible' ); +} + +function updateProgressBar() +{ + if ( eventData && streamStatus ) + { + var cells = $('progressBar').getElements( 'div' ); + var completeIndex = parseInt((($$(cells).length+1)*streamStatus.progress)/eventData.Length); + $$(cells).forEach( + function( cell, index ) + { + if ( index < completeIndex ) + { + if ( !$(cell).hasClass( 'complete' ) ) + { + $(cell).addClass( 'complete' ); + } + } + else + { + if ( $(cell).hasClass( 'complete' ) ) + { + $(cell).removeClass( 'complete' ); + } + } + } + ); + } +} + +function handleClick( event ) +{ + var target = event.target; + var x = event.page.x - $(target).getLeft(); + var y = event.page.y - $(target).getTop(); + + if ( event.shift ) + streamPan( x, y ); + else + streamZoomIn( x, y ); +} + +function initPage() +{ + streamCmdTimer = streamQuery.delay( 250 ); + eventQuery.pass( eventData.Id ).delay( 500 ); + + if ( canStreamNative ) + { + var streamImg = $('imageFeed').getElement('img'); + if ( !streamImg ) + streamImg = $('imageFeed').getElement('object'); + $(streamImg).addEvent( 'click', function( event ) { handleClick( event ); } ); + } +} + +// Kick everything off +window.addEvent( 'domready', initPage ); diff --git a/web/skins/classic/views/js/event.js.php b/web/skins/classic/views/js/event.js.php new file mode 100644 index 000000000..9ae458651 --- /dev/null +++ b/web/skins/classic/views/js/event.js.php @@ -0,0 +1,48 @@ +// +// Import constants +// +var CMD_NONE = ; +var CMD_PAUSE = ; +var CMD_PLAY = ; +var CMD_STOP = ; +var CMD_FASTFWD = ; +var CMD_SLOWFWD = ; +var CMD_SLOWREV = ; +var CMD_FASTREV = ; +var CMD_ZOOMIN = ; +var CMD_ZOOMOUT = ; +var CMD_PAN = ; +var CMD_SCALE = ; +var CMD_PREV = ; +var CMD_NEXT = ; +var CMD_SEEK = ; +var CMD_QUERY = ; + +var SCALE_BASE = ; + +// +// PHP variables to JS +// +var connKey = ''; + +var eventData = { + Id: , + Width: , + Height: , + Length: +}; + +var filterQuery = ''; +var sortQuery = ''; + +var scale = ; +var canEditEvents = ; +var streamTimeout = ; + +var canStreamNative = ; + +// +// Strings +// +var deleteString = ""; +var causeString = ""; diff --git a/web/skins/classic/views/js/events.js b/web/skins/classic/views/js/events.js new file mode 100644 index 000000000..6aa129932 --- /dev/null +++ b/web/skins/classic/views/js/events.js @@ -0,0 +1,150 @@ +function closeWindows() +{ + window.close(); + // This is a hack. The only way to close an existing window is to try and open it! + var filterWindow = window.open( thisUrl+'?view=none', 'zmFilter', 'width=1,height=1' ); + filterWindow.close(); +} + +function toggleCheckbox( element, name ) +{ + var form = element.form; + var checked = element.checked; + for (var i = 0; i < form.elements.length; i++) + if (form.elements[i].name.indexOf(name) == 0) + form.elements[i].checked = checked; + form.viewBtn.disabled = !checked; + form.editBtn.disabled = !checked; + form.archiveBtn.disabled = unarchivedEvents?!checked:true; + form.unarchiveBtn.disabled = archivedEvents?!checked:true; + form.exportBtn.disabled = !checked; + form.deleteBtn.disabled = !checked; +} + +function configureButton( element, name ) +{ + var form = element.form; + var checked = element.checked; + if ( !checked ) + { + for (var i = 0; i < form.elements.length; i++) + { + if ( form.elements[i].name.indexOf(name) == 0) + { + if ( form.elements[i].checked ) + { + checked = true; + break; + } + } + } + } + if ( !element.checked ) + form.toggleCheck.checked = false; + form.viewBtn.disabled = !checked; + form.editBtn.disabled = !checked; + form.archiveBtn.disabled = (!checked)||(!unarchivedEvents); + form.unarchiveBtn.disabled = (!checked)||(!archivedEvents); + form.exportBtn.disabled = !checked; + form.deleteBtn.disabled = !checked; +} + +function deleteEvents( element, name ) +{ + var form = element.form; + var count = 0; + for (var i = 0; i < form.elements.length; i++) + { + if (form.elements[i].name.indexOf(name) == 0) + { + if ( form.elements[i].checked ) + { + count++; + break; + } + } + } + if ( count > 0 ) + { + if ( confirm( confirmDeleteEventsString ) ) + { + form.action.value = 'delete'; + form.submit(); + } + } +} + +function editEvents( element, name ) +{ + var form = element.form; + var eids = new Array(); + for (var i = 0; i < form.elements.length; i++) + { + if (form.elements[i].name.indexOf(name) == 0) + { + if ( form.elements[i].checked ) + { + eids[eids.length] = 'eids[]='+form.elements[i].value; + } + } + } + createPopup( '?view=eventdetail&'+eids.join( '&' ), 'zmEventDetail', 'eventdetail' ); +} + +function exportEvents( element, name ) +{ + var form = element.form; + var eids = new Array(); + for (var i = 0; i < form.elements.length; i++) + { + if (form.elements[i].name.indexOf(name) == 0) + { + if ( form.elements[i].checked ) + { + eids[eids.length] = 'eids[]='+form.elements[i].value; + } + } + } + createPopup( '?view=export&'+eids.join( '&' ), 'zmExport', 'export' ); +} + +function viewEvents( element, name ) +{ + var form = element.form; + var events = new Array(); + for (var i = 0; i < form.elements.length; i++) + { + if ( form.elements[i].name.indexOf(name) == 0) + { + if ( form.elements[i].checked ) + { + events[events.length] = form.elements[i].value; + } + } + } + if ( events.length > 0 ) + { + createPopup( '?view=event&eid='+events[0]+'&filter[terms][0][attr]=Id&&filter[terms][0][op]=%3D%5B%5D&&filter[terms][0][val]='+events.join('%2C')+sortQuery+'&page=1&play=1', 'zmEvent', 'event', maxWidth, maxHeight ); + } +} + +function archiveEvents( element, name ) +{ + var form = element.form; + form.action.value = 'archive'; + form.submit(); +} + +function unarchiveEvents( element, name ) +{ + var form = element.form; + form.action.value = 'unarchive'; + form.submit(); +} + +if ( openFilterWindow ) +{ + //opener.location.reload(true); + createPopup( '?view=filter&page='+thisPage+filterQuery, 'zmFilter', 'filter' ); + location.replace( '?view='+currentView+'&page='+thisPage+filterQuery ); +} diff --git a/web/skins/classic/views/js/events.js.php b/web/skins/classic/views/js/events.js.php new file mode 100644 index 000000000..497d0c96e --- /dev/null +++ b/web/skins/classic/views/js/events.js.php @@ -0,0 +1,13 @@ +//var openFilterWindow = ; +var openFilterWindow = false; + +var archivedEvents = ; +var unarchivedEvents = ; + +var filterQuery = ''; +var sortQuery = ''; + +var maxWidth = ; +var maxHeight = ; + +var confirmDeleteEventsString = ""; diff --git a/web/skins/classic/views/js/export.js b/web/skins/classic/views/js/export.js new file mode 100644 index 000000000..482b41d72 --- /dev/null +++ b/web/skins/classic/views/js/export.js @@ -0,0 +1,58 @@ +function configureExportButton( element ) +{ + var form = element.form; + + var checkCount = 0; + var radioCount = 0; + for ( var i = 0; i < form.elements.length; i++ ) + if ( form.elements[i].type == "checkbox" && form.elements[i].checked ) + checkCount++; + else if ( form.elements[i].type == "radio" && form.elements[i].checked ) + radioCount++; + form.elements['exportButton'].disabled = (checkCount == 0 || radioCount == 0); +} + +function startDownload( exportFile ) +{ + window.location.replace( exportFile ); +} + +var exportTimer = null; + +function exportProgress() +{ + var tickerText = $('exportProgressTicker').get('text'); + if ( tickerText.length < 1 || tickerText.length > 4 ) + $('exportProgressTicker').set( 'text', '.' ); + else + $('exportProgressTicker').appendText( '.' ); +} + +function exportResponse( respObj, respText ) +{ + window.location.replace( thisUrl+'?view='+currentView+'&'+eidParm+'&exportFile='+respObj.exportFile+'&generated='+((respObj.result=='Ok')?1:0) ); +} + +function exportEvent( form ) +{ + var parms = 'view=request&request=event&action=export'; + parms += '&'+$(form).toQueryString(); + var query = new Request.JSON( { url: thisUrl, method: 'post', data: parms, onSuccess: exportResponse } ); + query.send(); + $('exportProgress').removeClass( 'hidden' ); + $('exportProgress').setProperty( 'class', 'warnText' ); + $('exportProgressText').set( 'text', exportProgressString ); + exportProgress(); + exportTimer = exportProgress.periodical( 500 ); +} + +function initPage() +{ + configureExportButton( $('exportButton') ); + if ( exportReady ) + { + startDownload.pass( exportFile ).delay( 1500 ); + } +} + +window.addEvent( 'domready', initPage ); diff --git a/web/skins/classic/views/js/export.js.php b/web/skins/classic/views/js/export.js.php new file mode 100644 index 000000000..e51089c14 --- /dev/null +++ b/web/skins/classic/views/js/export.js.php @@ -0,0 +1,22 @@ + +var eidParm = ''; + +var eidParm = 'eid='; + + +var exportReady = ; +var exportFile = ''; + +var exportProgressString = ''; diff --git a/web/skins/classic/views/js/filter.js b/web/skins/classic/views/js/filter.js new file mode 100644 index 000000000..840ca04e0 --- /dev/null +++ b/web/skins/classic/views/js/filter.js @@ -0,0 +1,120 @@ +function updateButtons( element ) +{ + var form = element.form; + + if ( element.type == 'checkbox' && element.checked ) + form.elements['executeButton'].disabled = false; + else + { + var canExecute = false; + if ( form.elements['autoArchive'].checked ) + canExecute = true; + if ( form.elements['autoVideo'].checked ) + canExecute = true; + if ( form.elements['autoUpload'].checked ) + canExecute = true; + if ( form.elements['autoEmail'].checked ) + canExecute = true; + if ( form.elements['autoMessage'].checked ) + canExecute = true; + if ( form.elements['autoExecute'].checked && form.elements['autoExecuteCmd'].value != '' ) + canExecute = true; + if ( form.elements['autoDelete'].checked ) + canExecute = true; + form.elements['executeButton'].disabled = !canExecute; + } +} + +function clearValue( element, line ) +{ + var form = element.form; + var val = form.elements['filter[terms]['+line+'][val]']; + val.value = ''; +} + +function submitToFilter( element, reload ) +{ + var form = element.form; + form.target = window.name; + form.view.value = 'filter'; + form.reload.value = reload; + form.submit(); +} + +function submitToEvents( element ) +{ + var form = element.form; + if ( validateForm( form ) ) + { + form.target = 'zmEvents'; + form.view.value = 'events'; + form.action.value = ''; + form.execute.value = 0; + form.submit(); + } +} + +function executeFilter( element ) +{ + var form = element.form; + if ( validateForm( form ) ) + { + form.target = 'zmEvents'; + form.view.value = 'events'; + form.action.value = 'filter'; + form.execute.value = 1; + form.submit(); + } +} + +function saveFilter( element ) +{ + var form = element.form; + + var popupName = 'zmEventsFilterSave'; + createPopup( thisUrl, popupName, 'filtersave' ); + + form.target = popupName; + form.view.value = 'filtersave'; + form.submit(); +} + +function deleteFilter( element, name ) +{ + if ( confirm( deleteSavedFilterString+" '"+name+"'" ) ) + { + var form = element.form; + form.action.value = 'delete'; + form.fid.value = name; + submitToFilter( element, 1 ); + } +} + +function addTerm( element, line ) +{ + var form = element.form; + form.target = window.name; + form.view.value = currentView; + form.action.value = 'filter'; + form.subaction.value = 'addterm'; + form.line.value = line; + form.submit(); +} + +function delTerm( element, line ) +{ + var form = element.form; + form.target = window.name; + form.view.value = currentView; + form.action.value = 'filter'; + form.subaction.value = 'delterm'; + form.line.value = line; + form.submit(); +} + +function init() +{ + updateButtons( $('executeButton') ); +} + +window.addEvent( 'domready', init ); diff --git a/web/skins/classic/views/js/filter.js.php b/web/skins/classic/views/js/filter.js.php new file mode 100644 index 000000000..c83a27a39 --- /dev/null +++ b/web/skins/classic/views/js/filter.js.php @@ -0,0 +1,56 @@ +var deleteSavedFilterString = ""; + +function validateForm( form ) +{ + 2 ) +{ +?> + var bracket_count = 0; + + var obr = form.elements['filter[terms][][obr]']; + var cbr = form.elements['filter[terms][][cbr]']; + bracket_count += parseInt(obr.options[obr.selectedIndex].value); + bracket_count -= parseInt(cbr.options[cbr.selectedIndex].value); + + if ( bracket_count ) + { + alert( "" ); + return( false ); + } + + + var val = form.elements['filter[terms][][val]']; + if ( val.value == '' ) + { + alert( "" ); + return( false ); + } + + return( true ); +} + + + + + + + + + + + + + + diff --git a/web/skins/classic/views/optionhelp.php b/web/skins/classic/views/optionhelp.php new file mode 100644 index 000000000..5ac37527b --- /dev/null +++ b/web/skins/classic/views/optionhelp.php @@ -0,0 +1,44 @@ +", $optionHelpText ); + +$focusWindow = true; + +xhtmlHeaders(__FILE__, $SLANG['OptionHelp'] ); +?> + +
+ +
+

+

+
+
+ + diff --git a/web/skins/classic/views/options.php b/web/skins/classic/views/options.php new file mode 100644 index 000000000..e87aa542a --- /dev/null +++ b/web/skins/classic/views/options.php @@ -0,0 +1,324 @@ + + +
+ +
+
    +$value ) +{ + if ( $tab == $name ) + { +?> +
  • + +
  • + +
+
+window.opener.location.reload();window.location.reload();'; + } + +?> +
+ + + + + + + + +
ZM_SKIN +
+
+ /> + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
disabled="disabled"/>
+
+ disabled="disabled"/> +
+
+ +
+ + + + + + + + + + + + +$value ) + { + $shortName = preg_replace( '/^ZM_/', '', $name ); + $optionPromptText = !empty($OLANG[$shortName])?$OLANG[$shortName]:$value['Prompt']; +?> + + + + + + + + + + + + + + + + + + + + + +
 () checked="checked"/> + 3 ) + { +?> + + + checked="checked"/>  + + />/>/>/>
+
+ /> +
+
+ +
+
+ + diff --git a/web/skins/classic/views/plugin.php b/web/skins/classic/views/plugin.php new file mode 100644 index 000000000..91795be77 --- /dev/null +++ b/web/skins/classic/views/plugin.php @@ -0,0 +1,170 @@ + 0 ) +{ + $newZone = dbFetchOne( "select * from Zones where MonitorId = '".dbEscape($mid)."' and Id = '".dbEscape($zid)."'" ); +} else { + $view = "error"; + return; +} +$monitor = dbFetchMonitor ( $mid ); +$plugin = dbEscape($_REQUEST['pl']); + +$plugin_path = dirname(ZM_PLUGINS_CONFIG_PATH)."/".$plugin; + +$focusWindow = true; + +xhtmlHeaders(__FILE__, $SLANG['Plugin'] ); + + +$pluginOptions=array( + 'Enabled'=>array( + 'Type'=>'select', + 'Name'=>'Enabled', + 'Choices'=>'yes,no', + 'Value'=>'no' + ) + ); + +$optionNames=array(); +if(file_exists($plugin_path."/config.php")) +{ + include_once($plugin_path."/config.php"); +} + +$sql="SELECT * FROM PluginsConfig WHERE MonitorId=$mid AND ZoneId=$zid AND pluginName='$plugin'"; +foreach( dbFetchAll( $sql ) as $popt ) +{ + if(array_key_exists($popt['Name'], $pluginOptions) + && $popt['Type']==$pluginOptions[$popt['Name']]['Type'] + && $popt['Choices']==$pluginOptions[$popt['Name']]['Choices'] + ) + { + $pluginOptions[$popt['Name']]=$popt; + array_push($optionNames, $popt['Name']); + } else { + dbQuery("DELETE from PluginsConfig WHERE Id=".$popt['Id']); + } +} +foreach($pluginOptions as $name => $values) +{ + if(!in_array($name, $optionNames)) + { + $popt=$pluginOptions[$name]; + $sql="INSERT INTO PluginsConfig VALUES + ('','".dbEscape($popt['Name'])."','".dbEscape($popt['Value'])."', + '".dbEscape($popt['Type'])."','".dbEscape($popt['Choices'])."','$mid','$zid','$plugin')"; + dbQuery($sql); + } +} + +$PLANG=array(); +if(file_exists($plugin_path."/lang/".$user['Language'].".php")) { + include_once($plugin_path."/lang/".$user['Language'].".php"); +} + +function pLang($name) +{ + global $PLANG; + if(array_key_exists($name, $PLANG)) + return $PLANG[$name]; + else + return $name; +} + + +?> + +
+ +
+
+ + + + + + +
+ + + $popt) +{ + ?> + + + + + + + + +
+
+ disabled="disabled"/> +
+
+
+
+ + diff --git a/web/skins/classic/views/postlogin.php b/web/skins/classic/views/postlogin.php new file mode 100644 index 000000000..2ce1ff88f --- /dev/null +++ b/web/skins/classic/views/postlogin.php @@ -0,0 +1,33 @@ + + +
+ +
+

+
+
+ + diff --git a/web/skins/classic/views/settings.php b/web/skins/classic/views/settings.php new file mode 100644 index 000000000..dcc0316f5 --- /dev/null +++ b/web/skins/classic/views/settings.php @@ -0,0 +1,78 @@ + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + +
disabled="disabled"/>
disabled="disabled"/>
disabled="disabled"/>
disabled="disabled"/>
+
+ disabled="disabled"/> +
+
+
+
+ + diff --git a/web/skins/classic/views/state.php b/web/skins/classic/views/state.php new file mode 100644 index 000000000..4e8365d51 --- /dev/null +++ b/web/skins/classic/views/state.php @@ -0,0 +1,106 @@ + + +
+ +
+
+ + + + +

+ +

+ + + + + + + +
+
+ + + + +
+ + + + +

+

+ +
+
+
+ + diff --git a/web/skins/classic/views/stats.php b/web/skins/classic/views/stats.php new file mode 100644 index 000000000..a1668bc8e --- /dev/null +++ b/web/skins/classic/views/stats.php @@ -0,0 +1,111 @@ + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + 1 ) +{ +?> + + + + + + + + + + + + + +
+
+
+
+ + diff --git a/web/skins/classic/views/status.php b/web/skins/classic/views/status.php new file mode 100644 index 000000000..113c23d88 --- /dev/null +++ b/web/skins/classic/views/status.php @@ -0,0 +1,85 @@ + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+
+
+ + diff --git a/web/skins/classic/views/timeline.php b/web/skins/classic/views/timeline.php new file mode 100644 index 000000000..d137b8bfd --- /dev/null +++ b/web/skins/classic/views/timeline.php @@ -0,0 +1,974 @@ +700, + "height"=>460, + "image" => array( + "width"=>264, + "height"=>220, + "topOffset"=>20, + ), + "imageText" => array( + "width"=>400, + "height"=>30, + "topOffset"=>20, + ), + "graph" => array( + "width"=>600, + "height"=>160, + "topOffset"=>30, + ), + "title" => array( + "topOffset"=>50 + ), + "key" => array( + "topOffset"=>50 + ), + "axes" => array( + "x" => array( + "height" => 20, + ), + "y" => array( + "width" => 30, + ), + ), + "grid" => array( + "x" => array( + "major" => array( + "max" => 12, + "min" => 4, + ), + "minor" => array( + "max" => 48, + "min" => 12, + ), + ), + "y" => array( + "major" => array( + "max" => 8, + "min" => 1, + ), + "minor" => array( + "max" => 0, + "min" => 0, + ), + ), + ), +); + +$monitors = array(); +$monitorsSql = "select * from Monitors order by Sequence asc"; +//srand( 97981 ); +foreach( dbFetchAll( $monitorsSql ) as $row ) +{ + //if ( empty($row['WebColour']) ) + //{ + //$row['WebColour'] = sprintf( "#%02x%02x%02x", rand( 0, 255 ), rand( 0, 255), rand( 0, 255 ) ); + //} + $monitors[$row['Id']] = $row; +} + +$rangeSql = "select min(E.StartTime) as MinTime, max(E.EndTime) as MaxTime from Events as E inner join Monitors as M on (E.MonitorId = M.Id) where not isnull(E.StartTime) and not isnull(E.EndTime)"; +$eventsSql = "select E.Id,E.Name,E.StartTime,E.EndTime,E.Length,E.Frames,E.MaxScore,E.Cause,E.Notes,E.Archived,E.MonitorId from Events as E inner join Monitors as M on (E.MonitorId = M.Id) where not isnull(StartTime)"; + +if ( !empty($user['MonitorIds']) ) +{ + $monFilterSql = " and M.Id in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")"; + + $rangeSql .= $monFilterSql; + $eventsSql .= $monFilterSql; +} + +if ( isset($_REQUEST['filter']) ) + $tree = parseFilterToTree( $_REQUEST['filter'] ); +else + $tree = false; + +if ( isset($_REQUEST['range']) ) + $range = validHtmlStr($_REQUEST['range']); +if ( isset($_REQUEST['minTime']) ) + $minTime = validHtmlStr($_REQUEST['minTime']); +if ( isset($_REQUEST['midTime']) ) + $midTime = validHtmlStr($_REQUEST['midTime']); +if ( isset($_REQUEST['maxTime']) ) + $maxTime = validHtmlStr($_REQUEST['maxTime']); + +if ( isset($range) ) +{ + $halfRange = (int)($range/2); + if ( isset($midTime) ) + { + $midTimeT = strtotime($midTime); + $minTimeT = $midTimeT-$halfRange; + $maxTimeT = $midTimeT+$halfRange; + if ( !($range%1) ) + { + $maxTimeT--; + } + $minTime = strftime( STRF_FMT_DATETIME_DB, $minTimeT ); + $maxTime = strftime( STRF_FMT_DATETIME_DB, $maxTimeT ); + } + elseif ( isset($minTime) ) + { + $minTimeT = strtotime($minTime); + $maxTimeT = $minTimeT + $range; + $midTimeT = $minTimeT + $halfRange; + $midTime = strftime( STRF_FMT_DATETIME_DB, $midTimeT ); + $maxTime = strftime( STRF_FMT_DATETIME_DB, $maxTimeT ); + } + elseif ( isset($maxTime) ) + { + $maxTimeT = strtotime($maxTime); + $minTimeT = $maxTimeT - $range; + $midTimeT = $minTimeT + $halfRange; + $minTime = strftime( STRF_FMT_DATETIME_DB, $minTimeT ); + $midTime = strftime( STRF_FMT_DATETIME_DB, $midTimeT ); + } +} +elseif ( isset($minTime) && isset($maxTime) ) +{ + $minTimeT = strtotime($minTime); + $maxTimeT = strtotime($maxTime); + $range = ($maxTimeT - $minTimeT) + 1; + $halfRange = (int)($range/2); + $midTimeT = $minTimeT + $halfRange; + $midTime = strftime( STRF_FMT_DATETIME_DB, $midTimeT ); +} + +if ( isset($minTime) && isset($maxTime) ) +{ + $tempMinTime = $tempMaxTime = $tempExpandable = false; + extractDatetimeRange( $tree, $tempMinTime, $tempMaxTime, $tempExpandable ); + $filterSql = parseTreeToSQL( $tree ); + + if ( $filterSql ) + { + $filterSql = " and $filterSql"; + $eventsSql .= $filterSql; + } +} +else +{ + $filterSql = parseTreeToSQL( $tree ); + $tempMinTime = $tempMaxTime = $tempExpandable = false; + extractDatetimeRange( $tree, $tempMinTime, $tempMaxTime, $tempExpandable ); + + if ( $filterSql ) + { + $filterSql = " and $filterSql"; + $rangeSql .= $filterSql; + $eventsSql .= $filterSql; + } + + if ( !isset($minTime) || !isset($maxTime) ) + { + // Dynamically determine range + $row = dbFetchOne( $rangeSql ); + + if ( !isset($minTime) ) + $minTime = $row['MinTime']; + if ( !isset($maxTime) ) + $maxTime = $row['MaxTime']; + } + + if ( empty($minTime) ) + $minTime = $tempMinTime; + if ( empty($maxTime) ) + $maxTime = $tempMaxTime; + if ( empty($maxTime) ) + $maxTime = "now"; + + $minTimeT = strtotime($minTime); + $maxTimeT = strtotime($maxTime); + $range = ($maxTimeT - $minTimeT) + 1; + $halfRange = (int)($range/2); + $midTimeT = $minTimeT + $halfRange; + $midTime = strftime( STRF_FMT_DATETIME_DB, $midTimeT ); +} + +//echo "MnT: $tempMinTime, MxT: $tempMaxTime, ExP: $tempExpandable
"; +if ( $tree ) +{ + appendDatetimeRange( $tree, $minTime, $maxTime ); + + $filterQuery = parseTreeToQuery( $tree ); +} +else +{ + $filterQuery = false; +} + +$scales = array( + array( "name"=>"year", "factor"=>60*60*24*365, "align"=>1, "zoomout"=>2, "label"=>STRF_TL_AXIS_LABEL_YEAR ), + array( "name"=>"month", "factor"=>60*60*24*30, "align"=>1, "zoomout"=>12, "label"=>STRF_TL_AXIS_LABEL_MONTH ), + array( "name"=>"week", "factor"=>60*60*24*7, "align"=>1, "zoomout"=>4.25, "label"=>STRF_TL_AXIS_LABEL_WEEK, "labelCheck"=>"%W" ), + array( "name"=>"day", "factor"=>60*60*24, "align"=>1, "zoomout"=>7, "label"=>STRF_TL_AXIS_LABEL_DAY ), + array( "name"=>"hour4", "factor"=>60*60, "align"=>4, "zoomout"=>6, "label"=>STRF_TL_AXIS_LABEL_4HOUR, "labelCheck"=>"%H" ), + array( "name"=>"hour", "factor"=>60*60, "align"=>1, "zoomout"=>4, "label"=>STRF_TL_AXIS_LABEL_HOUR, "labelCheck"=>"%H" ), + array( "name"=>"minute10", "factor"=>60, "align"=>10, "zoomout"=>6, "label"=>STRF_TL_AXIS_LABEL_10MINUTE, "labelCheck"=>"%M" ), + array( "name"=>"minute", "factor"=>60, "align"=>1, "zoomout"=>10, "label"=>STRF_TL_AXIS_LABEL_MINUTE, "labelCheck"=>"%M" ), + array( "name"=>"second10", "factor"=>1, "align"=>10, "zoomout"=>6, "label"=>STRF_TL_AXIS_LABEL_10SECOND ), + array( "name"=>"second", "factor"=>1, "align"=>1, "zoomout"=>10, "label"=>STRF_TL_AXIS_LABEL_SECOND ), +); + +$majXScale = getDateScale( $scales, $range, $chart['grid']['x']['major']['min'], $chart['grid']['x']['major']['max'] ); + +// Adjust the range etc for scale +$minTimeT -= $minTimeT%($majXScale['factor']*$majXScale['align']); +$minTime = strftime( STRF_FMT_DATETIME_DB, $minTimeT ); +$maxTimeT += (($majXScale['factor']*$majXScale['align'])-$maxTimeT%($majXScale['factor']*$majXScale['align']))-1; +if ( $maxTimeT > time() ) + $maxTimeT = time(); +$maxTime = strftime( STRF_FMT_DATETIME_DB, $maxTimeT ); +$range = ($maxTimeT - $minTimeT) + 1; +$halfRange = (int)($range/2); +$midTimeT = $minTimeT + $halfRange; +$midTime = strftime( STRF_FMT_DATETIME_DB, $midTimeT ); + +//echo "R:$range
"; +//echo "MnT:$minTime
"; +//echo "MnTt:$minTimeT
"; +//echo "MdT:$midTime
"; +//echo "MdTt:$midTimeT
"; +//echo "MxT:$maxTime
"; +//echo "MxTt:$maxTimeT
"; + +if ( isset($minTime) && isset($maxTime) ) +{ + $eventsSql .= " and E.EndTime >= '$minTime' and E.StartTime <= '$maxTime'"; +} + +$eventsSql .= " order by Id asc"; +//echo "ESQL: $eventsSql
"; + +$chart['data'] = array( + "x" => array( + "lo" => strtotime( $minTime ), + "hi" => strtotime( $maxTime ), + ), + "y" => array( + "lo" => 0, + "hi" => 0, + ) +); + +$chart['data']['x']['range'] = ($chart['data']['x']['hi'] - $chart['data']['x']['lo']) + 1; +$chart['data']['x']['density'] = $chart['data']['x']['range']/$chart['graph']['width']; + +$monEventSlots = array(); +$monFrameSlots = array(); +$monitorIds = array(); +foreach( dbFetchAll( $eventsSql ) as $event ) +{ + if ( !isset($monitorIds[$event['MonitorId']]) ) + $monitorIds[$event['MonitorId']] = true; + + if ( !isset($monEventSlots[$event['MonitorId']]) ) + $monEventSlots[$event['MonitorId']] = array(); + if ( !isset($monFrameSlots[$event['MonitorId']]) ) + $monFrameSlots[$event['MonitorId']] = array(); + + $currEventSlots = &$monEventSlots[$event['MonitorId']]; + $currFrameSlots = &$monFrameSlots[$event['MonitorId']]; + + $startTimeT = strtotime($event['StartTime']); + $startIndex = $rawStartIndex = (int)(($startTimeT - $chart['data']['x']['lo']) / $chart['data']['x']['density']); + if ( $startIndex < 0 ) + $startIndex = 0; + + if ( isset($event['EndTime']) ) + $endTimeT = strtotime($event['EndTime']); + else + $endTimeT = time(); + $endIndex = $rawEndIndex = (int)(($endTimeT - $chart['data']['x']['lo']) / $chart['data']['x']['density']); + + if ( $endIndex >= $chart['graph']['width'] ) + $endIndex = $chart['graph']['width'] - 1; + + for ( $i = $startIndex; $i <= $endIndex; $i++ ) + { + if ( !isset($currEventSlots[$i]) ) + { + if ( $rawStartIndex == $rawEndIndex ) + { + $offset = 1; + } + else + { + $offset = 1 + ($event['Frames']?((int)(($event['Frames']-1)*(($i-$rawStartIndex)/($rawEndIndex-$rawStartIndex)))):0); + } + $currEventSlots[$i] = array( "count"=>0, "width"=>1, "offset"=>$offset, "event"=>$event ); + } + else + { + $currEventSlots[$i]['count']++; + } + } + if ( $event['MaxScore'] > 0 ) + { + if ( $startIndex == $endIndex ) + { + $framesSql = "select FrameId,Score from Frames where EventId = '".$event['Id']."' and Score > 0 order by Score desc limit 1"; + $frame = dbFetchOne( $framesSql ); + + $i = $startIndex; + if ( !isset($currFrameSlots[$i]) ) + { + $currFrameSlots[$i] = array( "count"=>1, "value"=>$event['MaxScore'], "event"=>$event, "frame"=>$frame ); + } + else + { + $currFrameSlots[$i]['count']++; + if ( $event['MaxScore'] > $currFrameSlots[$i]['value'] ) + { + $currFrameSlots[$i]['value'] = $event['MaxScore']; + $currFrameSlots[$i]['event'] = $event; + $currFrameSlots[$i]['frame'] = $frame; + } + } + if ( $event['MaxScore'] > $chart['data']['y']['hi'] ) + { + $chart['data']['y']['hi'] = $event['MaxScore']; + } + } + else + { + $framesSql = "select FrameId,Delta,unix_timestamp(TimeStamp) as TimeT,Score from Frames where EventId = '".$event['Id']."' and Score > 0"; + $result = dbQuery( $framesSql ); + while( $frame = dbFetchNext( $result ) ) + { + if ( $frame['Score'] == 0 ) + continue; + $frameTimeT = $frame['TimeT']; + $frameTimeT = $startTimeT + $frame['Delta']; + $frameIndex = (int)(($frameTimeT - $chart['data']['x']['lo']) / $chart['data']['x']['density']); + if ( $frameIndex < 0 ) + continue; + if ( $frameIndex >= $chart['graph']['width'] ) + continue; + + if ( !isset($currFrameSlots[$frameIndex]) ) + { + $currFrameSlots[$frameIndex] = array( "count"=>1, "value"=>$frame['Score'], "event"=>$event, "frame"=>$frame ); + } + else + { + $currFrameSlots[$frameIndex]['count']++; + if ( $frame['Score'] > $currFrameSlots[$frameIndex]['value'] ) + { + $currFrameSlots[$frameIndex]['value'] = $frame['Score']; + $currFrameSlots[$frameIndex]['event'] = $event; + $currFrameSlots[$frameIndex]['frame'] = $frame; + } + } + if ( $frame['Score'] > $chart['data']['y']['hi'] ) + { + $chart['data']['y']['hi'] = $frame['Score']; + } + } + } + } +} + +ksort( $monitorIds, SORT_NUMERIC ); +ksort( $monEventSlots, SORT_NUMERIC ); +ksort( $monFrameSlots, SORT_NUMERIC ); + +// No longer needed? +if ( false ) +{ + // Add on missing frames + foreach( array_keys($monFrameSlots) as $monitorId ) + { + unset( $currFrameSlots ); + $currFrameSlots = &$monFrameSlots[$monitorId]; + for ( $i = 0; $i < $chart['graph']['width']; $i++ ) + { + if ( isset($currFrameSlots[$i]) ) + { + if ( !isset($currFrameSlots[$i]['frame']) ) + { + $framesSql = "select FrameId,Score from Frames where EventId = '".$currFrameSlots[$i]['event']['Id']."' and Score > 0 order by FrameId limit 1"; + $currFrameSlots[$i]['frame'] = dbFetchOne( $framesSql ); + } + } + } + } +} + +$chart['data']['y']['range'] = ($chart['data']['y']['hi'] - $chart['data']['y']['lo']) + 1; +$chart['data']['y']['density'] = $chart['data']['y']['range']/$chart['graph']['height']; + +$majYScale = getYScale( $chart['data']['y']['range'], $chart['grid']['y']['major']['min'], $chart['grid']['y']['major']['max'] ); + +$maxWidth = 0; +$maxHeight = 0; + +foreach ( array_keys($monitorIds) as $monitorId ) +{ + if ( $maxWidth < $monitors[$monitorId]['Width'] ) + $maxWidth = $monitors[$monitorId]['Width']; + if ( $maxHeight < $monitors[$monitorId]['Height'] ) + $maxHeight = $monitors[$monitorId]['Height']; +} + +//print_r( $monEventSlots ); +// Optimise boxes +foreach( array_keys($monEventSlots) as $monitorId ) +{ + unset( $currEventSlots ); + $currEventSlots = &$monEventSlots[$monitorId]; + for ( $i = 0; $i < $chart['graph']['width']; $i++ ) + { + if ( isset($currEventSlots[$i]) ) + { + if ( isset($currSlot) ) + { + if ( $currSlot['event']['Id'] == $currEventSlots[$i]['event']['Id'] ) + { + if ( $currSlot['width'] < $maxEventWidth ) + { + // Merge slots for the same long event + $currSlot['width']++; + unset( $currEventSlots[$i] ); + continue; + } + elseif ( $currSlot['offset'] < $currEventSlots[$i]['offset'] ) + { + // Split very long events + $currEventSlots[$i]['frame'] = array( 'FrameId'=>$currEventSlots[$i]['offset'] ); + } + } + elseif ( $currSlot['width'] < $minEventWidth ) + { + // Merge multiple small events + $currSlot['width']++; + unset( $currEventSlots[$i] ); + continue; + } + } + $currSlot = &$currEventSlots[$i]; + } + else + { + unset( $currSlot ); + } + } + if ( isset( $currSlot ) ) + unset( $currSlot ); +} +//print_r( $monEventSlots ); + +// Stack events +$frameSlots = array(); +$frameMonitorIds = array_keys($monFrameSlots); +for ( $i = 0; $i < $chart['graph']['width']; $i++ ) +{ + foreach ( $frameMonitorIds as $frameMonitorId ) + { + unset( $currFrameSlots ); + $currFrameSlots = &$monFrameSlots[$frameMonitorId]; + if ( isset($currFrameSlots[$i]) ) + { + if ( !isset($frameSlots[$i]) ) + { + $frameSlots[$i] = array(); + $frameSlots[$i][] = &$currFrameSlots[$i]; + } + else + { + $slotCount = count($frameSlots[$i]); + for ( $j = 0; $j < $slotCount; $j++ ) + { + if ( $currFrameSlots[$i]['value'] > $frameSlots[$i][$j]['value'] ) + { + for ( $k = $slotCount; $k > $j; $k-- ) + { + $frameSlots[$i][$k] = $frameSlots[$i][$k-1]; + } + $frameSlots[$i][$j] = &$currFrameSlots[$i]; + break 2; + } + } + $frameSlots[$i][] = &$currFrameSlots[$i]; + } + } + } +} + +//print_r( $monEventSlots ); +//print_r( $monFrameSlots ); +//print_r( $chart ); + +$graphHeight = $chart['graph']['height']; + +if ( $mode == "overlay" ) +{ + $minEventBarHeight = 10; + $maxEventBarHeight = 40; + + if ( count($monitorIds) ) + { + $chart['graph']['eventBarHeight'] = $minEventBarHeight; + while ( ($chart['graph']['eventsHeight'] = (($chart['graph']['eventBarHeight'] * count($monitorIds)) + (count($monitorIds)-1))) < $maxEventBarHeight ) + { + $chart['graph']['eventBarHeight']++; + } + } + else + { + $chart['graph']['eventBarHeight'] = $maxEventBarHeight; + $chart['graph']['eventsHeight'] = $maxEventBarHeight; + } + $chart['graph']['activityHeight'] = ($graphHeight - $chart['graph']['eventsHeight']); + $chart['data']['y']['density'] = $chart['data']['y']['range']/$chart['graph']['activityHeight']; + + $chart['eventBars'] = array(); + $top = $chart['graph']['activityHeight']; + foreach ( array_keys($monitorIds) as $monitorId ) + { + $chart['eventBars'][$monitorId] = array( 'top' => $top ); + $top += $chart['graph']['eventBarHeight']+1; + } +} +elseif ( $mode == "split" ) +{ + $minActivityBarHeight = 30; + $minEventBarHeight = 10; + $maxEventBarHeight = 40; + + if ( count($monitorIds) ) + { + $chart['graph']['eventBarHeight'] = $minEventBarHeight; + $chart['graph']['activityBarHeight'] = $minActivityBarHeight; + while ( ((($chart['graph']['eventBarHeight']+$chart['graph']['activityBarHeight']) * count($monitorIds)) + ((2*count($monitorIds))-1)) < $graphHeight ) + { + $chart['graph']['activityBarHeight']++; + if ( $chart['graph']['eventBarHeight'] < $maxEventBarHeight ) + { + $chart['graph']['eventBarHeight']++; + } + } + } + else + { + $chart['graph']['eventBarHeight'] = $maxEventBarHeight; + $chart['graph']['activityBarHeight'] = $graphHeight - $chart['graph']['eventBarHeight']; + } + $chart['data']['y']['density'] = $chart['data']['y']['range']/$chart['graph']['activityBarHeight']; + +?> + $top ); + $chart['eventBars'][$monitorId] = array( 'top' => $top+$chart['graph']['activityBarHeight']+1 ); + $top += $chart['graph']['activityBarHeight']+1+$chart['graph']['eventBarHeight']+1; + } +} + +preg_match( '/^(\d+)-(\d+)-(\d+) (\d+):(\d+)/', $minTime, $startMatches ); +preg_match( '/^(\d+)-(\d+)-(\d+) (\d+):(\d+)/', $maxTime, $endMatches ); + +if ( $startMatches[1] != $endMatches[1] ) +{ + // Different years + $title = strftime( STRF_TL_AXIS_RANGE_YEAR1, $chart['data']['x']['lo'] )." - ".strftime( STRF_TL_AXIS_RANGE_YEAR2, $chart['data']['x']['hi'] ); +} +elseif ( $startMatches[2] != $endMatches[2] ) +{ + // Different months + $title = strftime( STRF_TL_AXIS_RANGE_MONTH1, $chart['data']['x']['lo'] )." - ".strftime( STRF_TL_AXIS_RANGE_MONTH2, $chart['data']['x']['hi'] ); +} +elseif ( $startMatches[3] != $endMatches[3] ) +{ + // Different dates + $title = strftime( STRF_TL_AXIS_RANGE_DAY1, $chart['data']['x']['lo'] )." - ".strftime( STRF_TL_AXIS_RANGE_DAY2, $chart['data']['x']['hi'] ); +} +else +{ + // Different times + $title = strftime( STRF_TL_AXIS_RANGE_TIME1, $chart['data']['x']['lo'] )." - ".strftime( STRF_TL_AXIS_RANGE_TIME2, $chart['data']['x']['hi'] ); +} + +function drawXGrid( $chart, $scale, $labelClass, $tickClass, $gridClass, $zoomClass=false ) +{ + global $SLANG; + + ob_start(); + $labelCount = 0; + $lastTick = 0; + unset( $lastLabel ); + $labelCheck = isset($scale['labelCheck'])?$scale['labelCheck']:$scale['label']; +?> +
+ 1 ) + { + $label = (int)(strftime( $labelCheck, $timeOffset )/$scale['align']); + } + else + { + $label = strftime( $labelCheck, $timeOffset ); + } + if ( !isset($lastLabel) || ($lastLabel != $label) ) + { + $labelCount++; + } + if ( $labelCount >= $scale['divisor'] ) + { + $labelCount = 0; + if ( isset($lastLabel) ) + { + if ( $labelClass ) + { +?> +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+
+
+
<?= $SLANG['ViewEvent'] ?>
+
+
+
+
+

Pass your mouse over the graph to view a snapshot image and event details.

+

Click on the coloured sections of the graph, or the image, to view the event.

+

Click on the background to zoom in to a smaller time period based around your click.

+

Use the controls below to zoom out or navigate back and forward through the time range.

+
+
+
+
+ +
+
+
+
+ +
+$slots ) + { + foreach ( $slots as $slot ) + { + $slotHeight = (int)($slot['value']/$chart['data']['y']['density']); + + if ( $slotHeight <= 0 ) + continue; + + if ( $mouseover ) + { + $behaviours = array( + 'onclick="'.getSlotShowEventBehaviour( $slot ).'"', + 'onmouseover="'.getSlotPreviewEventBehaviour( $slot ).'"' + ); + } + else + { + $behaviours = array( + 'onclick="'.getSlotPreviewEventBehaviour( $slot ).'"' + ); + } +?> +
>
+ +
+ +
+$slot ) + { + $slotHeight = (int)($slot['value']/$chart['data']['y']['density']); + + if ( $slotHeight <= 0 ) + continue; + + if ( $mouseover ) + { + $behaviours = array( + 'onclick="'.getSlotShowEventBehaviour( $slot ).'"', + 'onmouseover="'.getSlotPreviewEventBehaviour( $slot ).'"' + ); + } + else + { + $behaviours = array( + 'onclick="'.getSlotPreviewEventBehaviour( $slot ).'"' + ); + } + ?> +
>
+ +
+ +
+ +
>
+ +
+ +
+
+
+
+ + <?= $monitors[$monitorId]['Name'] ?> + +
+
+
+
+
+ + diff --git a/web/skins/classic/views/user.php b/web/skins/classic/views/user.php new file mode 100644 index 000000000..55c7d9514 --- /dev/null +++ b/web/skins/classic/views/user.php @@ -0,0 +1,154 @@ +$SLANG['No'], 1=>$SLANG['Yes'] ); +$nv = array( 'None'=>$SLANG['None'], 'View'=>$SLANG['View'] ); +$nve = array( 'None'=>$SLANG['None'], 'View'=>$SLANG['View'], 'Edit'=>$SLANG['Edit'] ); +$bandwidths = array_merge( array( ""=>"" ), $bwArray ); +$langs = array_merge( array( ""=>"" ), getLanguages() ); + +$sql = "select Id,Name from Monitors order by Sequence asc"; +$monitors = array(); +foreach( dbFetchAll( $sql ) as $monitor ) +{ + $monitors[] = $monitor; +} + +$focusWindow = true; + +xhtmlHeaders(__FILE__, $SLANG['User']." - ".$newUser['Username'] ); +?> + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+
+
+
+ + diff --git a/web/skins/classic/views/version.php b/web/skins/classic/views/version.php new file mode 100644 index 000000000..2feacbbbe --- /dev/null +++ b/web/skins/classic/views/version.php @@ -0,0 +1,93 @@ + $SLANG['GoToZoneMinder'] +); + +if ( verNum( ZM_DYN_CURR_VERSION ) != verNum( ZM_DYN_LAST_VERSION ) ) +{ + $options = array_merge( $options, array( + "ignore" => $SLANG['VersionIgnore'], + "hour" => $SLANG['VersionRemindHour'], + "day" => $SLANG['VersionRemindDay'], + "week" => $SLANG['VersionRemindWeek'], + "never" => $SLANG['VersionRemindNever'] + ) ); +} + +$focusWindow = true; + +xhtmlHeaders(__FILE__, $SLANG['Version'] ); +?> + +
+ +
+ +

+

+
+ +
+ +

+

+

+
+ +
+ +
+ + +

+

+

+
+ + +
+
+ +
+
+ + diff --git a/web/skins/classic/views/video.php b/web/skins/classic/views/video.php new file mode 100644 index 000000000..a34037aea --- /dev/null +++ b/web/skins/classic/views/video.php @@ -0,0 +1,241 @@ + + +
+ +
+ +

+
+ +
+ + + + + + + + + + + + + + + + + + + + +
checked="checked"/>
+ disabled="disabled"/> +
+ +

+ + + +

+ +

+ + + + + + + + + + + + + 0 ) + { + 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]; + } + $width = $scale?reScale( $event['Width'], $scale ):$event['Width']; + $height = $scale?reScale( $event['Height'], $scale ):$event['Height']; +?> + + + + + + + + + +
 /  / 
+ +
+
+ + diff --git a/web/skins/classic/views/watch.php b/web/skins/classic/views/watch.php new file mode 100644 index 000000000..661630ab3 --- /dev/null +++ b/web/skins/classic/views/watch.php @@ -0,0 +1,230 @@ + + +
+
+ +
+ +
+
+ +
+ +
+ +
 -  fps
+
+ + + +
+ +
+ + + + + +
+
+ + diff --git a/web/skins/classic/views/zone.php b/web/skins/classic/views/zone.php new file mode 100644 index 000000000..80a3f5e0e --- /dev/null +++ b/web/skins/classic/views/zone.php @@ -0,0 +1,288 @@ + 0 ) + { + $zone = dbFetchOne( "select * from Zones where MonitorId = '".dbEscape($monitor['Id'])."' and Id = '".dbEscape($zid)."'" ); + } + else + { + $zone = array( + 'Name' => $SLANG['New'], + 'Id' => 0, + 'MonitorId' => $monitor['Id'], + 'NumCoords' => 4, + 'Coords' => sprintf( "%d,%d %d,%d, %d,%d %d,%d", $minX, $minY, $maxX, $minY, $maxX, $maxY, $minX, $maxY ), + 'Area' => $monitor['Width'] * $monitor['Height'], + 'AlarmRGB' => 0xff0000, + 'CheckMethod' => 'Blobs', + 'MinPixelThreshold' => '', + 'MaxPixelThreshold' => '', + 'MinAlarmPixels' => '', + 'MaxAlarmPixels' => '', + 'FilterX' => '', + 'FilterY' => '', + 'MinFilterPixels' => '', + 'MaxFilterPixels' => '', + 'MinBlobPixels' => '', + 'MaxBlobPixels' => '', + 'MinBlobs' => '', + 'MaxBlobs' => '', + 'OverloadFrames' => '', + ); + } + $zone['Points'] = coordsToPoints( $zone['Coords'] ); + + $newZone = $zone; +} + +//if ( !$points ) +//{ + //$points = $zone['Points']; +//} + +ksort( $newZone['Points'], SORT_NUMERIC ); + +$newZone['Coords'] = pointsToCoords( $newZone['Points'] ); +$newZone['Area'] = getPolyArea( $newZone['Points'] ); +$selfIntersecting = isSelfIntersecting( $newZone['Points'] ); + +$wd = getcwd(); +chdir( ZM_DIR_IMAGES ); +$command = getZmuCommand( " -m ".$mid." -z" ); +$command .= '"'.$zid.' '.$hicolor.' '.$newZone['Coords'].'"'; +$status = exec( escapeshellcmd( $command ) ); +chdir( $wd ); + +$zoneImage = ZM_DIR_IMAGES.'/Zones'.$monitor['Id'].'.jpg?'.time(); + +$focusWindow = true; + +xhtmlHeaders(__FILE__, $SLANG['Zone'] ); +?> + +
+ +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
"applyPreset()", "onblur"=>"this.selectedIndex=0" ) ) ?>
 /  / 
+$pl
"; + } +} +?> +
+
+
+
+
+ Zone Image +
+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
disabled="disabled"/> disabled="disabled"/>+ 3 ) { ?>  X
+
 
+ disabled="disabled"/> +
+
+
+
+ + diff --git a/web/skins/classic/views/zones.php b/web/skins/classic/views/zones.php new file mode 100644 index 000000000..3089c9ad3 --- /dev/null +++ b/web/skins/classic/views/zones.php @@ -0,0 +1,106 @@ + + +
+ +
+ + + <?= htmlspecialchars($zone['Name']) ?> + + + + zones +
+ + + + + + + + + + + + + + + + + + + + + + +
 /  disabled="disabled"/>
+
+ disabled="disabled"/> + +
+
+
+
+ + diff --git a/web/skins/mobile/Makefile.am b/web/skins/mobile/Makefile.am new file mode 100644 index 000000000..35051fade --- /dev/null +++ b/web/skins/mobile/Makefile.am @@ -0,0 +1,14 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/skins/mobile + +SUBDIRS = \ + ajax \ + css \ + graphics \ + includes \ + lang \ + views + +dist_web_DATA = \ + skin.php diff --git a/web/skins/mobile/Makefile.in b/web/skins/mobile/Makefile.in new file mode 100644 index 000000000..f5eeebb17 --- /dev/null +++ b/web/skins/mobile/Makefile.in @@ -0,0 +1,660 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/skins/mobile +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +webdir = @WEB_PREFIX@/skins/mobile +SUBDIRS = \ + ajax \ + css \ + graphics \ + includes \ + lang \ + views + +dist_web_DATA = \ + skin.php + +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/skins/mobile/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/skins/mobile/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic ctags \ + ctags-recursive distclean distclean-generic distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dist_webDATA \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/skins/mobile/ajax/Makefile.am b/web/skins/mobile/ajax/Makefile.am new file mode 100644 index 000000000..0558929c0 --- /dev/null +++ b/web/skins/mobile/ajax/Makefile.am @@ -0,0 +1,5 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/skins/mobile/ajax + +dist_web_DATA = # No files here diff --git a/web/skins/mobile/ajax/Makefile.in b/web/skins/mobile/ajax/Makefile.in new file mode 100644 index 000000000..d7dbdd679 --- /dev/null +++ b/web/skins/mobile/ajax/Makefile.in @@ -0,0 +1,451 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/skins/mobile/ajax +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +webdir = @WEB_PREFIX@/skins/mobile/ajax +dist_web_DATA = # No files here +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/skins/mobile/ajax/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/skins/mobile/ajax/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_webDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/skins/mobile/css/Makefile.am b/web/skins/mobile/css/Makefile.am new file mode 100644 index 000000000..6353e163e --- /dev/null +++ b/web/skins/mobile/css/Makefile.am @@ -0,0 +1,6 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/skins/mobile/css + +dist_web_DATA = \ + skin.css diff --git a/web/skins/mobile/css/Makefile.in b/web/skins/mobile/css/Makefile.in new file mode 100644 index 000000000..eb3d9ffc2 --- /dev/null +++ b/web/skins/mobile/css/Makefile.in @@ -0,0 +1,453 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/skins/mobile/css +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +webdir = @WEB_PREFIX@/skins/mobile/css +dist_web_DATA = \ + skin.css + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/skins/mobile/css/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/skins/mobile/css/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_webDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/skins/mobile/css/skin.css b/web/skins/mobile/css/skin.css new file mode 100644 index 000000000..b996392a3 --- /dev/null +++ b/web/skins/mobile/css/skin.css @@ -0,0 +1,311 @@ +/* + * 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; +} + diff --git a/web/skins/mobile/graphics/Makefile.am b/web/skins/mobile/graphics/Makefile.am new file mode 100644 index 000000000..dfd43bef7 --- /dev/null +++ b/web/skins/mobile/graphics/Makefile.am @@ -0,0 +1,5 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/skins/mobile/graphics + +dist_web_DATA = # No files here diff --git a/web/skins/mobile/graphics/Makefile.in b/web/skins/mobile/graphics/Makefile.in new file mode 100644 index 000000000..6de8e67b6 --- /dev/null +++ b/web/skins/mobile/graphics/Makefile.in @@ -0,0 +1,451 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/skins/mobile/graphics +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +webdir = @WEB_PREFIX@/skins/mobile/graphics +dist_web_DATA = # No files here +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/skins/mobile/graphics/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/skins/mobile/graphics/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_webDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/skins/mobile/includes/Makefile.am b/web/skins/mobile/includes/Makefile.am new file mode 100644 index 000000000..c88ad435a --- /dev/null +++ b/web/skins/mobile/includes/Makefile.am @@ -0,0 +1,9 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/skins/mobile/includes + +dist_web_DATA = \ + init.php \ + config.php \ + functions.php \ + control_functions.php diff --git a/web/skins/mobile/includes/Makefile.in b/web/skins/mobile/includes/Makefile.in new file mode 100644 index 000000000..cf5b6a84e --- /dev/null +++ b/web/skins/mobile/includes/Makefile.in @@ -0,0 +1,456 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/skins/mobile/includes +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +webdir = @WEB_PREFIX@/skins/mobile/includes +dist_web_DATA = \ + init.php \ + config.php \ + functions.php \ + control_functions.php + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/skins/mobile/includes/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/skins/mobile/includes/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_webDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/skins/mobile/includes/config.php b/web/skins/mobile/includes/config.php new file mode 100644 index 000000000..956c36bcc --- /dev/null +++ b/web/skins/mobile/includes/config.php @@ -0,0 +1,63 @@ + "50x", + "2000" => "20x", + "500" => "5x", + "200" => "2x", + "100" => $SLANG['Real'], + "50" => "1/2x", +); + +$scales = array( + "400" => "4x", + "300" => "3x", + "200" => "2x", + "150" => "1.5x", + "100" => $SLANG['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; + } +} + +?> diff --git a/web/skins/mobile/includes/control_functions.php b/web/skins/mobile/includes/control_functions.php new file mode 100644 index 000000000..3a5314998 --- /dev/null +++ b/web/skins/mobile/includes/control_functions.php @@ -0,0 +1,186 @@ + +
+
+
+ +
+ + " name="preset" value=""/> + +
+
+
+
+ diff --git a/web/skins/mobile/includes/functions.php b/web/skins/mobile/includes/functions.php new file mode 100644 index 000000000..40c1b055a --- /dev/null +++ b/web/skins/mobile/includes/functions.php @@ -0,0 +1,66 @@ +'."\n" ); +?> + + + + <?= ZM_WEB_TITLE_PREFIX ?> - <?= $title ?> + + + + + + + + + + + diff --git a/web/skins/mobile/includes/init.php b/web/skins/mobile/includes/init.php new file mode 100644 index 000000000..ae92bcdee --- /dev/null +++ b/web/skins/mobile/includes/init.php @@ -0,0 +1,29 @@ + diff --git a/web/skins/mobile/lang/Makefile.am b/web/skins/mobile/lang/Makefile.am new file mode 100644 index 000000000..5084203fb --- /dev/null +++ b/web/skins/mobile/lang/Makefile.am @@ -0,0 +1,5 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/skins/mobile/lang + +dist_web_DATA = # No files here diff --git a/web/skins/mobile/lang/Makefile.in b/web/skins/mobile/lang/Makefile.in new file mode 100644 index 000000000..2663443d2 --- /dev/null +++ b/web/skins/mobile/lang/Makefile.in @@ -0,0 +1,451 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/skins/mobile/lang +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +webdir = @WEB_PREFIX@/skins/mobile/lang +dist_web_DATA = # No files here +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/skins/mobile/lang/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/skins/mobile/lang/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_webDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/skins/mobile/skin.php b/web/skins/mobile/skin.php new file mode 100644 index 000000000..0b7f59747 --- /dev/null +++ b/web/skins/mobile/skin.php @@ -0,0 +1,104 @@ +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 ) +{ + if ( ZM_AUTH_TYPE == "remote" && !empty( $_SERVER['REMOTE_USER'] ) ) + { + $view = "postlogin"; + $action = "login"; + $_REQUEST['username'] = $_SERVER['REMOTE_USER']; + } + else + { + $view = "login"; + } +} + +// If there are additional actions +foreach ( getSkinIncludes( 'includes/actions.php' ) as $includeFile ) + require_once $includeFile; + +?> diff --git a/web/skins/mobile/views/Makefile.am b/web/skins/mobile/views/Makefile.am new file mode 100644 index 000000000..c7d175ca3 --- /dev/null +++ b/web/skins/mobile/views/Makefile.am @@ -0,0 +1,22 @@ +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 diff --git a/web/skins/mobile/views/Makefile.in b/web/skins/mobile/views/Makefile.in new file mode 100644 index 000000000..9b2d72ee1 --- /dev/null +++ b/web/skins/mobile/views/Makefile.in @@ -0,0 +1,668 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/skins/mobile/views +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +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 + +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/skins/mobile/views/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/skins/mobile/views/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic ctags \ + ctags-recursive distclean distclean-generic distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dist_webDATA \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/skins/mobile/views/console.php b/web/skins/mobile/views/console.php new file mode 100644 index 000000000..9422c5d62 --- /dev/null +++ b/web/skins/mobile/views/console.php @@ -0,0 +1,178 @@ + 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?$SLANG['Running']:$SLANG['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, '&' ); + $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__, $SLANG['Console'] ); +?> + +
+ +
+ + + + + + + + + + + + + + + + + 1 ) { +?> + + + + + + + +
".substr( $monitor['Function'], 0, 4 )."", canEdit( 'Monitors' ) ) ?>
  
+
+
+ + diff --git a/web/skins/mobile/views/css/Makefile.am b/web/skins/mobile/views/css/Makefile.am new file mode 100644 index 000000000..86e0ff0a3 --- /dev/null +++ b/web/skins/mobile/views/css/Makefile.am @@ -0,0 +1,6 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/skins/mobile/views/css + +dist_web_DATA = \ + console.css diff --git a/web/skins/mobile/views/css/Makefile.in b/web/skins/mobile/views/css/Makefile.in new file mode 100644 index 000000000..06bd7f268 --- /dev/null +++ b/web/skins/mobile/views/css/Makefile.in @@ -0,0 +1,453 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/skins/mobile/views/css +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +webdir = @WEB_PREFIX@/skins/mobile/views/css +dist_web_DATA = \ + console.css + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/skins/mobile/views/css/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/skins/mobile/views/css/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_webDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/skins/mobile/views/css/console.css b/web/skins/mobile/views/css/console.css new file mode 100644 index 000000000..49c711039 --- /dev/null +++ b/web/skins/mobile/views/css/console.css @@ -0,0 +1,16 @@ +#systemTime { + float: left; +} + +#systemState { + margin: 0 auto; + text-align: center; +} + +#systemStats { + float: right; +} + +td.colEvents { + text-align: right; +} diff --git a/web/skins/mobile/views/devices.php b/web/skins/mobile/views/devices.php new file mode 100644 index 000000000..1270e518d --- /dev/null +++ b/web/skins/mobile/views/devices.php @@ -0,0 +1,73 @@ + + +
+ +
+ + + + + + + + +
+

+
+
+ + diff --git a/web/skins/mobile/views/error.php b/web/skins/mobile/views/error.php new file mode 100644 index 000000000..0adf4f9f3 --- /dev/null +++ b/web/skins/mobile/views/error.php @@ -0,0 +1,34 @@ + + +
+ +
+

+

+
+
+ + diff --git a/web/skins/mobile/views/event.php b/web/skins/mobile/views/event.php new file mode 100644 index 000000000..b804c137c --- /dev/null +++ b/web/skins/mobile/views/event.php @@ -0,0 +1,143 @@ +=')." '".$event[$_REQUEST['sort_field']]."'".$_REQUEST['filter']['sql'].$midSql." order by $sortColumn ".($sortOrder=='asc'?'desc':'asc'); +$result = dbQuery( $sql ); +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'?'>=':'<=')." '".$event[$_REQUEST['sort_field']]."'".$_REQUEST['filter']['sql'].$midSql." order by $sortColumn $sortOrder"; +$result = dbQuery( $sql ); +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 = '".dbEscape($_REQUEST['eid'])."'"; +if ( $paged && !empty($_REQUEST['page']) ) + $sql .= " and FrameId between $loFrameId and $hiFrameId"; +$sql .= " order by FrameId"; +$frames = dbFetchAll( $sql ); + +$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, '&eid='.$_REQUEST['eid'].$filterQuery.$sortQuery, '&' ); + +xhtmlHeaders( __FILE__, $SLANG['Event'].' - '.$event['Name'] ); +?> + +
+ +
+ +

+ +
+ + <?= $frame['Type'] ?>/<?= $frame['Type']=='Alarm'?$frame['Score']:0 ?> + +
+
+
+ + diff --git a/web/skins/mobile/views/eventdetails.php b/web/skins/mobile/views/eventdetails.php new file mode 100644 index 000000000..89a8acc73 --- /dev/null +++ b/web/skins/mobile/views/eventdetails.php @@ -0,0 +1,86 @@ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
s
()
//
+
+ 1 + <?= $frame['FrameId'] ?> +
+
+ + +
+
+
+ + diff --git a/web/skins/mobile/views/events.php b/web/skins/mobile/views/events.php new file mode 100644 index 000000000..dbe16b086 --- /dev/null +++ b/web/skins/mobile/views/events.php @@ -0,0 +1,157 @@ +$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.'&limit='.$_REQUEST['limit'], '&' ); + +xhtmlHeaders( __FILE__, $SLANG['Events'] ); +?> + +
+ +
+ +

+ + + + + + + + + + + + + + + + + + + +
+

+
+
+ + diff --git a/web/skins/mobile/views/filter.php b/web/skins/mobile/views/filter.php new file mode 100644 index 000000000..d01249109 --- /dev/null +++ b/web/skins/mobile/views/filter.php @@ -0,0 +1,71 @@ + + +
+ +
+
+ + 0 ) +{ +?> +
+ +
+
+ +
+ +

+ +
+
+
+ + diff --git a/web/skins/mobile/views/frame.php b/web/skins/mobile/views/frame.php new file mode 100644 index 000000000..403fe5201 --- /dev/null +++ b/web/skins/mobile/views/frame.php @@ -0,0 +1,73 @@ + + +
+ +
+ "> +
+ 1 ) { ?> + << + 1 ) { ?> + < + + > + + >> + +
+
+
+ + diff --git a/web/skins/mobile/views/function.php b/web/skins/mobile/views/function.php new file mode 100644 index 000000000..8825129ff --- /dev/null +++ b/web/skins/mobile/views/function.php @@ -0,0 +1,66 @@ + + +
+ +
+
+ +
+ +
+
+ checked="checked"/> +
+
+ +
+
+
+
+ + diff --git a/web/skins/mobile/views/login.php b/web/skins/mobile/views/login.php new file mode 100644 index 000000000..7882ce9be --- /dev/null +++ b/web/skins/mobile/views/login.php @@ -0,0 +1,54 @@ + + +
+ +
+
+ + + + + + + + + + +
" size="12"/>
+
+ +
+
+
+
+ + diff --git a/web/skins/mobile/views/montage.php b/web/skins/mobile/views/montage.php new file mode 100644 index 000000000..a491804e6 --- /dev/null +++ b/web/skins/mobile/views/montage.php @@ -0,0 +1,75 @@ + + +
+ +
+
+ + <?= $monitor['Name'] ?> + +
+
+
+
+ + diff --git a/web/skins/mobile/views/state.php b/web/skins/mobile/views/state.php new file mode 100644 index 000000000..caa7f8f74 --- /dev/null +++ b/web/skins/mobile/views/state.php @@ -0,0 +1,77 @@ + + +
+ +
+
+ + +
+ +
+
+
+
+ + diff --git a/web/skins/mobile/views/video.php b/web/skins/mobile/views/video.php new file mode 100644 index 000000000..46a2f1c80 --- /dev/null +++ b/web/skins/mobile/views/video.php @@ -0,0 +1,226 @@ += 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__, $SLANG['Video'].' - '.$event['Name'] ); +?> + +
+
+
+ + + + + + + + + + + + + + +
checked="checked"/>
+
+
+ +

+ +

+ + +

+ + + + + + + + + 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]; + } +?> + + + + + + + + +
 / 
+ +

+ +
+
+ + diff --git a/web/skins/mobile/views/watch.php b/web/skins/mobile/views/watch.php new file mode 100644 index 000000000..8d481e108 --- /dev/null +++ b/web/skins/mobile/views/watch.php @@ -0,0 +1,154 @@ + + +
+
+

 -  fps

+

+ + + +

+ +
+ +
+ +
+ + + +
+ +
+
+ + diff --git a/web/skins/xml/Makefile.am b/web/skins/xml/Makefile.am new file mode 100644 index 000000000..2c30d19a3 --- /dev/null +++ b/web/skins/xml/Makefile.am @@ -0,0 +1,10 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/skins/xml + +SUBDIRS = \ + includes \ + views + +dist_web_DATA = \ + skin.php diff --git a/web/skins/xml/Makefile.in b/web/skins/xml/Makefile.in new file mode 100644 index 000000000..0c89d073f --- /dev/null +++ b/web/skins/xml/Makefile.in @@ -0,0 +1,656 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/skins/xml +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +webdir = @WEB_PREFIX@/skins/xml +SUBDIRS = \ + includes \ + views + +dist_web_DATA = \ + skin.php + +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/skins/xml/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/skins/xml/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic ctags \ + ctags-recursive distclean distclean-generic distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dist_webDATA \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/skins/xml/includes/Makefile.am b/web/skins/xml/includes/Makefile.am new file mode 100644 index 000000000..c6128f8a2 --- /dev/null +++ b/web/skins/xml/includes/Makefile.am @@ -0,0 +1,8 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/skins/xml/includes + +dist_web_DATA = \ + init.php \ + config.php \ + functions.php diff --git a/web/skins/xml/includes/Makefile.in b/web/skins/xml/includes/Makefile.in new file mode 100644 index 000000000..37b45e7c8 --- /dev/null +++ b/web/skins/xml/includes/Makefile.in @@ -0,0 +1,455 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/skins/xml/includes +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +webdir = @WEB_PREFIX@/skins/xml/includes +dist_web_DATA = \ + init.php \ + config.php \ + functions.php + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/skins/xml/includes/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/skins/xml/includes/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_webDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/skins/xml/includes/config.php b/web/skins/xml/includes/config.php new file mode 100644 index 000000000..538938df2 --- /dev/null +++ b/web/skins/xml/includes/config.php @@ -0,0 +1,155 @@ + "100x", + "5000" => "50x", + "2500" => "25x", + "1000" => "10x", + "400" => "4x", + "200" => "2x", + "100" => $SLANG['Real'], + "50" => "1/2x", + "25" => "1/4x", +); + +$scales = array( + "400" => "4x", + "300" => "3x", + "200" => "2x", + "150" => "1.5x", + "100" => $SLANG['Actual'], + "75" => "3/4x", + "50" => "1/2x", + "33" => "1/3x", + "25" => "1/4x", +); + +$bwArray = array( + "high" => $SLANG['High'], + "medium" => $SLANG['Medium'], + "low" => $SLANG['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; + } +} + +?> diff --git a/web/skins/xml/includes/functions.php b/web/skins/xml/includes/functions.php new file mode 100644 index 000000000..ef7b33a6c --- /dev/null +++ b/web/skins/xml/includes/functions.php @@ -0,0 +1,455 @@ + $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 ""; +} +function xml_tag_val($tag, $val) +{ + echo "<".$tag.">".$val.""; +} +function xml_tag_sec($tag, $open) +{ + if ($open) $tok = "<"; + else $tok = ""; +} +function xhtmlHeaders( $file, $title ) +{ +?> + + + + + + + /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 = ".$monitor; + $res = dbFetchOne(escapeSql($query)); + 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 = ".$monitor; + $res = dbFetchOne(escapeSql($query)); + return $res; +} +/** Returns the temp directory for H264 encoding */ +function getTempDir() +{ + /* Assume that the directory structure is /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_*.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...
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; +?> + + + + + + + +
+
+Initializing H264 Stream ()...
+This may take a few seconds +
+
+ +
+ +
+ + + diff --git a/web/skins/xml/includes/init.php b/web/skins/xml/includes/init.php new file mode 100644 index 000000000..acb6c3546 --- /dev/null +++ b/web/skins/xml/includes/init.php @@ -0,0 +1,2 @@ + diff --git a/web/skins/xml/skin.php b/web/skins/xml/skin.php new file mode 100644 index 000000000..d797c7b08 --- /dev/null +++ b/web/skins/xml/skin.php @@ -0,0 +1,46 @@ + diff --git a/web/skins/xml/views/Makefile.am b/web/skins/xml/views/Makefile.am new file mode 100644 index 000000000..ab9147ae4 --- /dev/null +++ b/web/skins/xml/views/Makefile.am @@ -0,0 +1,11 @@ +AUTOMAKE_OPTIONS = gnu + +SUBDIRS = + +webdir = @WEB_PREFIX@/skins/xml/views + +dist_web_DATA = \ + console.php \ + actions.php \ + none.php \ + notfound.png diff --git a/web/skins/xml/views/Makefile.in b/web/skins/xml/views/Makefile.in new file mode 100644 index 000000000..77440a95e --- /dev/null +++ b/web/skins/xml/views/Makefile.in @@ -0,0 +1,656 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/skins/xml/views +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +SUBDIRS = +webdir = @WEB_PREFIX@/skins/xml/views +dist_web_DATA = \ + console.php \ + actions.php \ + none.php \ + notfound.png + +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/skins/xml/views/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/skins/xml/views/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic ctags \ + ctags-recursive distclean distclean-generic distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dist_webDATA \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/skins/xml/views/actions.php b/web/skins/xml/views/actions.php new file mode 100644 index 000000000..f6f62adca --- /dev/null +++ b/web/skins/xml/views/actions.php @@ -0,0 +1,393 @@ + */ + if (!canEdit('Events')) { + logXmlErr("User ".$user['Username']. " doesn't have edit Events perms"); + exit; + } + if (!isset($_REQUEST['eid'])) { + logXmlErr("EID not set for action delete-event"); + exit; + } + $eid = validInteger($_REQUEST['eid']); + $url = "./index.php?view=request&request=event&id=".$eid."&action=delete"; + header("Location: ".$url); + exit; + + } else if (!strcmp($action, "spawn264")) { + /* ACTION: Spawn 264 streaming process. + * Parms: [br|width|height] */ + if (!canView('Stream')) { + logXmlErr("User ".$user['Username']. " doesn't have view Stream perms"); + exit; + } + if (!isset($_GET['monitor'])) { + logXmlErr("Not all parameters specified for spawn264"); + exit; + } + $monitor = validInteger($_REQUEST['monitor']); + if (!isMonitor($monitor)) exit; + $dims = getMonitorDims($monitor); + $width = validInteger(getset('width', $dims['Width'])); + $height = validInteger(getset('height', $dims['Height'])); + $br = validString(getset('br', ZM_EYEZM_H264_DEFAULT_BR)); + /* Check that we can stream first */ + if (!canStream264()) { + /* canStream264 will print out error */ + exit; + } + $streamUrl = stream264fn($monitor, $width, $height, $br); + logXml("Using H264 Pipe Function: ".$streamUrl); + $pid = shell_exec($streamUrl); + logXml("Streaming Process for monitor ".$monitor." ended, cleaning up files"); + eraseH264Files($monitor); + exit; + + } else if (!strcmp($action, "kill264")) { + /* ACTION: Kill existing H264 stream process and cleanup files. + * Parms: . + * NOTE: This will be called directly by path, so include files + * may not be available */ + session_start(); + require_once(dirname(__FILE__)."/../includes/functions.php"); + if (!isset($_GET['monitor'])) { + logXmlErr("Not all parameters specified for kill264"); + exit; + } + $monitor = validInteger($_GET['monitor']); + kill264proc($monitor); + logXml("Killed Segmenter process for monitor ".$monitor); + exit; + + } else if (!strcmp($action, "chk264")) { + /* ACTION: Simply stalls while checking for 264 file. + * Parms: + * NOTE: This will be called directly by path, so include files + * may not be available */ + session_start(); + require_once(dirname(__FILE__)."/../includes/functions.php"); + if (!isset($_GET['monitor']) || !isset($_GET['timeout'])) { + logXmlErr("Monitor not specified for chk264"); + exit; + } + $monitor = validInteger($_GET['monitor']); + $path = getTempDir()."/".m3u8fname($monitor); + /* Wait for the second sample to become available */ + $tsfile = getTempDir()."/sample_".$monitor."-2.ts"; + /* Setup timeout */ + $startTime = time(); + $timeout = validInteger($_GET['timeout']); + while (!file_exists($path) || !file_exists($tsfile)) { + if (time() > $startTime + $timeout) { + logXmlErr("Timed out waiting for stream to start, exiting..."); + kill264proc($monitor); + exit; + } + usleep(10000); + } + logXml("File exists, stream created after ".(time()-$startTime)." sec"); + exit; + + } else if (!strcmp($action, "feed")) { + /* ACTION: View a feed. Parms: [height|width|fps|scale|vcodec|br] */ + if (!canView('Stream')) { + logXmlErr("User ".$user['Username']. " doesn't have view Stream perms"); + exit; + } + /* Check that required variables are set */ + if (!isset($_REQUEST['monitor'])) { + logXmlErr("Not all parameters set for action view-feed"); + exit; + } + $monitor = validInteger($_REQUEST['monitor']); + if (!isMonitor($monitor)) exit; + $dims = getMonitorDims($monitor); + $width = validInteger(getset('width', $dims['Width'])); + $height = validInteger(getset('height', $dims['Height'])); + $fps = validInteger(getset('fps', ZM_WEB_VIDEO_MAXFPS)); + $scale = validInteger(getset('scale', 100)); + $vcodec = validString(getset('vcodec', ZM_EYEZM_FEED_VCODEC)); + /* Select which codec we want */ + if (!strcmp($vcodec, "h264")) { + /* Validate that we can in fact stream H264 */ + if (!canStream264()) { + /* canStream264 will print out error if + * there is one */ + echo "Server cannot stream H264. Check eyeZm log for details"; + exit; + } + if (!requireVer("1", "2")) { + echo "H264 Streaming requires eyeZm v1.2 or above"; + logXmlErr("H264 Streaming requires eyeZm v1.2 or above"); + exit; + } + $br = validString(getset('br', ZM_EYEZM_H264_DEFAULT_BR)); + /* H264 processing */ + noCacheHeaders(); + /* Kill any existing processes and files */ + kill264proc($monitor); + eraseH264Files($monitor); + logXml("Streaming H264 on Monitor ".$monitor.", ".$width."x".$height." @".$br); + /* Get thumbnail source */ + $thumbsrc = + getStreamSrc( array( + "mode=single", + "monitor=".$monitor, + "scale=".$scale, + "maxfps=".$fps, + "buffer=1000" + ) ); + logXml("Using thumbnail image from ".$thumbsrc); + /* Generate H264 Web-page */ + echo "\n"; + h264vidHtml($width, $height, $monitor, $br, $thumbsrc); + } else if (!strcmp($vcodec, "mjpeg")) { + /* MJPEG streaming */ + /* If $fps=0, get a single-shot */ + if (!$fps) { + /* single-shot */ + $streamSrc = + getStreamSrc( array( + "mode=single", + "monitor=".$monitor, + "scale=".$scale, + "maxfps=0", + "buffer=1000" + ) ); + } else { + $streamSrc = + getStreamSrc( array( + "mode=jpeg", + "monitor=".$monitor, + "scale=".$scale, + "maxfps=".$fps, + "buffer=1000" + ) ); + } + noCacheHeaders(); + xhtmlHeaders( __FILE__, "Stream" ); + logXml("Streaming MJPEG on Monitor ".$monitor.", ".$width."x".$height." @".$fps."fps"); + echo "\n"; + echo "\n"; + echo "
\n"; + logXml("Using stream source: ".$streamSrc); + outputImageStream("liveStream", $streamSrc, $width, $height, "stream"); + echo "
"; + } else { + logXmlErr("Unsupported codec ".$vcodec." selected for streaming"); + echo("Unsupported codec ".$vcodec." selected for streaming"); + } + exit; + + } else if (!strcmp($action, "vevent")) { + /* ACTION: View an event. Parms: [fps|vcodec|br] */ + if (!canView('Events')) { + logXmlErr("User ".$user['Username']. " doesn't have view Events perms"); + exit; + } + if (!isset($_GET['eid'])) { + logXmlErr("Not all parameters set for Action View-event"); + exit; + } + /* Grab event from the database */ + $eid = validInteger($_GET['eid']); + $eventsSql = "select E.Id, E.MonitorId, E.Name, E.StartTime, E.Length, E.Frames from Events as E where (E.Id = ".$eid.")"; + $event = dbFetchOne(escapeSql($eventsSql)); + /* Check if exists */ + if (!$event) { + logxmlErr("Requested event ID ".$eid." does not exist"); + exit; + } + /* Calculate FPS */ + $fps = validInteger(getset('fps',ceil($event['Frames'] / $event['Length']))); + $vcodec = validString(getset('vcodec', ZM_EYEZM_EVENT_VCODEC)); + $baseURL = ZM_PATH_WEB."/".getEventPathSafe($event); + /* Here we validate the codec. + * Check that FFMPEG exists and supports codecs */ + if (!strcmp($vcodec, "mpeg4")) { + if (!ffmpegSupportsCodec("mpeg4")) { + logXmlErr("FFMPEG not installed, accessible in path/ZM_PATH_FFMPEG, or doesn't support mpeg4"); + exit; + } + /* Can generate, we are good to go */ + $fname = "capture.mov"; + $ffparms = "-vcodec mpeg4 -r ".ZM_EYEZM_EVENT_FPS." ".$baseURL."/".$fname." 2> /dev/null"; + + } else if (!strcmp($vcodec, "h264")) { + if (!ffmpegSupportsCodec("libx264")) { + logXmlErr("FFMPEG not installed, accessible in path/ZM_PATH_FFMPEG, or doesn't support H264"); + exit; + } + if (!requireVer("1","2")) { + logXmlErr("H264 Event viewing requires eyeZm v1.2 or greater"); + exit; + } + /* Good to go */ + $fname = "capture.mp4"; + $ffparms = getFfmpeg264FoutParms( + validString(getset('br',ZM_EYEZM_H264_DEFAULT_EVBR)), + $baseURL."/".$fname); + + } else { + logXmlErr("Unknown codec ".$vcodec." selected for event viewing"); + exit; + } + logXml("Selected ".$vcodec." for viewing event ".$event['Id']); + $fnameOut = $baseURL."/".$fname; + $shellCmd = getFfmpegPath()." -y -r ".$fps." -i ".$baseURL."/%0".ZM_EVENT_IMAGE_DIGITS."d-capture.jpg"; + $shellCmd .= " ".$ffparms; + logXml("Encoding event with command: ".$shellCmd); + $shellOutput = shell_exec($shellCmd); + /* Check that file exists */ + if (!file_exists(trim($fnameOut))) { + logXmlErr("Generate Event ".$event['Id']." file ".$fnameOut." does not exist"); + exit; + } + $url = "./".getEventPathSafe($event)."/".$fname; + logXml("Loading Event URL ".$url); + header("Location: ".$url); + exit; + + } else if (!strcmp($action, "vframe")) { + /* ACTION: View a frame given by an event and frame-id. Parms: [alarm | analyze | qty | scale] + * If 'alarm' is set, the returned frame will be the -th alarm frame. If 'analyze' is set, + * the returned frame will be the %03d-analyse frame instead of %03d-capture, if ZM_CREATE_ANALYSIS_IMAGES + * is set. Otherwise it just returns the captured frame. + * If qty is set, it will apply a quality factor from 0-100, and if width is set, it will scale the jpeg accordingly + */ + if (!isset($_GET['eid']) || !isset($_GET['frame'])) { + logXmlErr("Not all parameters set for action view-frame"); + exit; + } + $eid = validInteger($_GET['eid']); + $frame = validInteger($_GET['frame']); + $eventsSql = "select E.Id, E.MonitorId, E.Name, E.StartTime, E.Length, E.Frames from Events as E where (E.Id = ".$eid.")"; + $event = dbFetchOne(escapeSql($eventsSql)); + $qty = validInteger(getset('qty', 100)); + if ($qty > 100) $qty = 100; + $scale = validInteger(getset('scale', 100)); + if (!$event) { + logxmlErr("Requested event ID ".$eid." does not exist"); + exit; + } + /* Figure out the frame number. If 'alarm' is not set, this is just equal to the parameter. + * If 'alarm' is set, need to query DB and grab the -th item */ + if (isset($_GET['alarm'])) { + $frameSql = escapeSql("select * from Frames as F where (F.EventId = ".$eid.") "); + $frameSql .= " and (F.Type = 'Alarm') order by F.FrameId"; + $i=0; + foreach (dbFetchAll($frameSql) as $dbframe) { + if ($i == $frame) { + $frame = $dbframe['FrameId']; + break; + } + $i++; + } + } + if (isset($_GET['analyze']) && ZM_CREATE_ANALYSIS_IMAGES) { + $suffix = "analyse"; + } else { + $suffix = "capture"; + } + /* A frame index of 0 is invalid, so if we see this, just use frame 1 */ + if (!$frame) $frame = 1; + /* Suffix based on 'analyze' */ + $fname = sprintf("%0".ZM_EVENT_IMAGE_DIGITS."d-%s.jpg", $frame, $suffix); + $url = "./".getEventPathSafe($event)."/".$fname; + if (!file_exists($url)) { + logXmlErr("Invalid frame image requested: ".$url); + $url = "./skins/xml/views/notfound.png"; + } + /* Check if the image needs any processing - check for GD if requested */ + if (($scale != 100) || ($qty < 100)) { + if (!gdExists()) { + logXmlErr("Lib GD is not loaded, but required for image scaling functions"); + $url = "./skins/xml/views/notfound.png"; + } else if (!$img = imagecreatefromjpeg($url)) { + logXmlErr("Could not load JPEG from ".$url); + $url = "./skins/xml/views/notfound.png"; + } else { + /* GD exists and we read the file ok */ + header('Content-type: image/jpeg'); + /* Check if resizing is needed */ + if ($scale != 100) { + list($width_orig, $height_orig) = getimagesize($url); + $width_new = $width_orig * ($scale/100); + $height_new = $height_orig * ($scale/100); + $img_new = imagecreatetruecolor($width_new, $height_new); + imagecopyresampled($img_new, $img, 0, 0, 0, 0, $width_new, $height_new, $width_orig, $height_orig); + imagejpeg($img_new, NULL, $qty); + } else { + imagejpeg($img, NULL, $qty); + } + exit; + } + } + header("Location: ".$url); + exit; + + } else if (!strcmp($action, "state")) { + /* ACTION: Change the state of the system. Parms: */ + if (!canEdit('System')) { + logXmlErr("User ".$user['Username']. " doesn't have edit System perms"); + exit; + } + if (!isset($_GET['state'])) { + logXmlErr("Server state not specified for action"); + exit; + } + $url = "./index.php?view=none&action=state&runState=".validString($_GET['state']); + header("Location: ".$url); + exit; + + } else if (!strcmp($action, "func")) { + /* ACTION: Change state of the monitor. Parms: */ + if (!canEdit('Monitors')) { + logXmlErr("User ".$user['Username']. " doesn't have monitors Edit perms"); + exit; + } + if (!isset($_GET['mid']) || !isset($_GET['func']) || !isset($_GET['en'])) { + logXmlErr("Not all parameters specified for action Monitor state"); + exit; + } + $mid = validInteger($_GET['mid']); + if (!isMonitor($mid)) exit; + $url = "./index.php?view=none&action=function&mid=".$mid."&newFunction=".validString($_GET['func'])."&newEnabled=".validString($_GET['en']); + header("Location: ".$url); + exit; + + } else if (!strcmp($action, "vlog")) { + /* ACTION: View log file. Must have debug and log to file enabled, and sufficient perms + * Parms: [lines] */ + if (!canEdit('System')) { + logXmlErr("Insufficient permissions to view log file"); + echo "Insufficient permissions to view log file"; + exit; + } + if (!ZM_EYEZM_DEBUG || !ZM_EYEZM_LOG_TO_FILE) { + echo "eyeZm Debug (EYEZM_DEBUG) or log-to-file (EYEZM_LOG_TO_FILE) not enabled. Please enable first"; + exit; + } + if (!file_exists(ZM_EYEZM_LOG_FILE)) { + echo "Log file ".ZM_EYEZM_LOG_FILE." doesn't exist"; + exit; + } + $lines = validInteger(getset('lines',ZM_EYEZM_LOG_LINES)); + logXml("Returning last ".$lines." lines of eyeZm Log from ".ZM_EYEZM_LOG_FILE); + echo shell_exec("tail -n ".$lines." ".ZM_EYEZM_LOG_FILE); + echo "\n\n--- Showing last ".$lines." lines ---\n"; + echo "--- End of Log ---\n\n"; + } +} +?> diff --git a/web/skins/xml/views/console.php b/web/skins/xml/views/console.php new file mode 100644 index 000000000..d2668fc8a --- /dev/null +++ b/web/skins/xml/views/console.php @@ -0,0 +1,259 @@ + $SLANG['Events'], + "filter" => array( + "terms" => array( + ) + ), + ), + array( + "title" => $SLANG['Hour'], + "filter" => array( + "terms" => array( + array( "attr" => "Archived", "op" => "=", "val" => "0" ), + array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-1 hour" ), + ) + ), + ), + array( + "title" => $SLANG['Day'], + "filter" => array( + "terms" => array( + array( "attr" => "Archived", "op" => "=", "val" => "0" ), + array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-1 day" ), + ) + ), + ), + array( + "title" => $SLANG['Week'], + "filter" => array( + "terms" => array( + array( "attr" => "Archived", "op" => "=", "val" => "0" ), + array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-7 day" ), + ) + ), + ), + array( + "title" => $SLANG['Month'], + "filter" => array( + "terms" => array( + array( "attr" => "Archived", "op" => "=", "val" => "0" ), + array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-1 month" ), + ) + ), + ), + array( + "title" => $SLANG['Archived'], + "filter" => array( + "terms" => array( + array( "attr" => "Archived", "op" => "=", "val" => "1" ), + ) + ), + ), +); + +$running = daemonCheck(); +$status = $running?$SLANG['Running']:$SLANG['Stopped']; + +if ( $group = dbFetchOne( "select * from Groups where Id = '".(empty($_COOKIE['zmGroup'])?0:dbEscape($_COOKIE['zmGroup']))."'" ) ) + $groupIds = array_flip(split( ',', $group['MonitorIds'] )); + +$maxWidth = 0; +$maxHeight = 0; +$cycleCount = 0; +$minSequence = 0; +$maxSequence = 1; +$seqIdList = array(); +$monitors = dbFetchAll( "select * from Monitors order by Sequence asc" ); +$displayMonitors = array(); +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; + if ( empty($minSequence) || ($monitors[$i]['Sequence'] < $minSequence) ) + { + $minSequence = $monitors[$i]['Sequence']; + } + if ( $monitors[$i]['Sequence'] > $maxSequence ) + { + $maxSequence = $monitors[$i]['Sequence']; + } + if (isset($_GET['nostatus'])) { + $monitors[$i]['zmc'] = 1; + $monitors[$i]['zma'] = 1; + } else { + $monitors[$i]['zmc'] = zmcStatus( $monitors[$i] ); + $monitors[$i]['zma'] = zmaStatus( $monitors[$i] ); + } + $monitors[$i]['ZoneCount'] = dbFetchOne( "select count(Id) as ZoneCount from Zones where MonitorId = '".$monitors[$i]['Id']."'", "ZoneCount" ); + $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 ); + $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++; + $scaleWidth = reScale( $monitors[$i]['Width'], $monitors[$i]['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); + $scaleHeight = reScale( $monitors[$i]['Height'], $monitors[$i]['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); + if ( $maxWidth < $scaleWidth ) $maxWidth = $scaleWidth; + if ( $maxHeight < $scaleHeight ) $maxHeight = $scaleHeight; + } + $monitors[$i] = array_merge( $monitors[$i], $counts ); + $seqIdList[] = $monitors[$i]['Id']; + $displayMonitors[] = $monitors[$i]; +} +$states = dbFetchAll("select * from States"); +/* XML Dump Starts here */ +xml_header(); +/* Print out the general section */ +xml_tag_sec("ZM_XML", 1); +xml_tag_sec("GENERAL", 1); +xml_tag_val("RUNNING", $running); +xml_tag_val("PROTOVER", ZM_EYEZM_PROTOCOL_VERSION); +xml_tag_val("FEATURESET", ZM_EYEZM_FEATURE_SET); +xml_tag_val("VERSION", ZM_VERSION); +xml_tag_val("CANSTR264", canStream264(1)); +xml_tag_val("GD", gdExists()); +xml_tag_val("FVCODEC", ZM_EYEZM_FEED_VCODEC); +xml_tag_val("FVTMT", ZM_EYEZM_H264_TIMEOUT); +xml_tag_val("USER", $user['Username']); +xml_tag_val("UID", $user['Id']); +/* Permissions block */ +xml_tag_sec("PERMS", 1); +xml_tag_val("STREAM", $user['Stream']); +xml_tag_val("EVENTS", $user['Events']); +xml_tag_val("CONTROL", $user['Control']); +xml_tag_val("MONITORS", $user['Monitors']); +xml_tag_val("DEVICES", $user['Devices']); +xml_tag_val("SYSTEM", $user['System']); +xml_tag_sec("PERMS", 0); +/* End permissions block */ +if (canEdit('System')) { + if ($running) { + xml_tag_val("STATE", "stop"); + xml_tag_val("STATE", "restart"); + } else { + xml_tag_val("STATE", "start"); + } + foreach ($states as $state) { + xml_tag_val("STATE", $state['Name']); + } +} +/* End general section */ +xml_tag_sec("GENERAL", 0); +/* Print out the monitors section */ +xml_tag_sec("MONITOR_LIST", 1); +foreach( $displayMonitors as $monitor ) +{ + if (!canView('Monitors')) continue; + xml_tag_sec("MONITOR", 1); + xml_tag_val("ID", $monitor['Id']); + xml_tag_val("NAME", $monitor['Name']); + xml_tag_val("FUNCTION", $monitor['Function']); + xml_tag_val("NUMEVENTS", $monitor['EventCount0']); + xml_tag_val("ENABLED", $monitor['Enabled']); + xml_tag_val("ZMC", $monitor['zmc']); + xml_tag_val("ZMA", $monitor['zma']); + xml_tag_val("STATE", ($monitor['zmc']!=1)?"ERROR":( + ($monitor['zma']==1)?"OK":"WARN")); + xml_tag_val("WIDTH", $monitor['Width']); + xml_tag_val("HEIGHT", $monitor['Height']); + + /* Form the data-base query for this monitor */ + $pageOffset = 0; + $offset = 0; + if (isset($_GET['numEvents'])) { + $numEvents = validInteger($_GET['numEvents']); + $eventsSql = "select E.Id,E.MonitorId,M.Name As MonitorName,E.Cause,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) and ( E.MonitorId = ".$monitor['Id']." ) order by E.StartTime desc"; + $eventsSql .= " limit ".$numEvents; + /* If there is an pageOff tag for this monitor, then retrieve the offset. Otherwise, don't specify offset */ + if (isset($_GET['pageOff'.$monitor['Id']])) { + /* If pageOffset is greater than we actually have, + * we need to adjust it */ + $pageOffset = validInteger($_GET['pageOff'.$monitor['Id']]); + if ($pageOffset >= ceil($monitor['EventCount0']/$numEvents)) { + $pageOffset = 0; + } + $offset = $pageOffset * $numEvents; + } + $eventsSql .= " offset ".$offset; + } else { + unset($eventsSql); + } + xml_tag_val("PAGEOFF", $pageOffset); + xml_tag_sec("EVENTS",1); + if (canView('Events') && isset($eventsSql)) { + foreach ( dbFetchAll( escapeSql($eventsSql) ) as $event ) + { + xml_tag_sec("EVENT",1); + xml_tag_val("ID",$event['Id']); + xml_tag_val("NAME",$event['Name']); + xml_tag_val("TIME", strftime( STRF_FMT_DATETIME_SHORTER, strtotime($event['StartTime']))); + xml_tag_val("DURATION", $event['Length']); + xml_tag_val("FRAMES", $event['Frames']); + xml_tag_val("FPS", ($event['Length'] > 0)?ceil($event['Frames']/$event['Length']):0); + xml_tag_val("TOTSCORE", $event['TotScore']); + xml_tag_val("AVGSCORE", $event['AvgScore']); + xml_tag_val("MAXSCORE", $event['MaxScore']); + /* Grab the max frame-id from Frames table. If AlarmFrames = 0, don't try + * to grab any frames, and just signal the max frame index as index 0 */ + $fridx = 1; + $alarmFrames = 1; + if ($event['AlarmFrames']) { + $framesSql = "select FrameId from Frames where (Type = 'Alarm') and (EventId = ".$event['Id'].") order by Score desc limit 1"; + $fr = dbFetchOne($framesSql); + $fridx = $fr['FrameId']; + $alarmFrames = $event['AlarmFrames']; + } + xml_tag_val("ALARMFRAMES", $alarmFrames); + xml_tag_val("MAXFRAMEID", $fridx); + xml_tag_sec("EVENT",0); + } + } + xml_tag_sec("EVENTS",0); + xml_tag_sec("MONITOR", 0); +} +xml_tag_sec("MONITOR_LIST", 0); +xml_tag_sec("ZM_XML", 0); +?> diff --git a/web/skins/xml/views/none.php b/web/skins/xml/views/none.php new file mode 100644 index 000000000..e69de29bb diff --git a/web/skins/xml/views/notfound.png b/web/skins/xml/views/notfound.png new file mode 100644 index 000000000..219706897 Binary files /dev/null and b/web/skins/xml/views/notfound.png differ diff --git a/web/tools/Makefile.am b/web/tools/Makefile.am new file mode 100644 index 000000000..29c91bc02 --- /dev/null +++ b/web/tools/Makefile.am @@ -0,0 +1,4 @@ +AUTOMAKE_OPTIONS = gnu + +SUBDIRS = \ + mootools diff --git a/web/tools/Makefile.in b/web/tools/Makefile.in new file mode 100644 index 000000000..b07349f77 --- /dev/null +++ b/web/tools/Makefile.in @@ -0,0 +1,595 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/tools +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +SUBDIRS = \ + mootools + +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/tools/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/tools/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic ctags \ + ctags-recursive distclean distclean-generic distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ + tags-recursive uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/tools/mootools/Makefile.am b/web/tools/mootools/Makefile.am new file mode 100644 index 000000000..958647796 --- /dev/null +++ b/web/tools/mootools/Makefile.am @@ -0,0 +1,18 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/tools/mootools + +dist_web_DATA = \ + mootools-core-1.3.2-nc.js \ + mootools-core-1.3.2-yc.js \ + mootools-more-1.3.2.1-nc.js \ + mootools-more-1.3.2.1-yc.js + +# Yes, you are correct. This is a HACK! +install-data-hook: + ( cd $(DESTDIR)$(webdir); rm -f mootools-core.js mootools-more.js ) + ( cd $(DESTDIR)$(webdir); ln -s mootools-core-1.3.2-yc.js mootools-core.js ) + ( cd $(DESTDIR)$(webdir); ln -s mootools-more-1.3.2.1-yc.js mootools-more.js ) + +uninstall-hook: + @-( cd $(DESTDIR)$(webdir); rm -f mootools-* ) diff --git a/web/tools/mootools/Makefile.in b/web/tools/mootools/Makefile.in new file mode 100644 index 000000000..c44380251 --- /dev/null +++ b/web/tools/mootools/Makefile.in @@ -0,0 +1,468 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/tools/mootools +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +webdir = @WEB_PREFIX@/tools/mootools +dist_web_DATA = \ + mootools-core-1.3.2-nc.js \ + mootools-core-1.3.2-yc.js \ + mootools-more-1.3.2.1-nc.js \ + mootools-more-1.3.2.1-yc.js + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/tools/mootools/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/tools/mootools/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_webDATA + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_webDATA + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook +.MAKE: install-am install-data-am install-strip uninstall-am + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-data-hook install-dist_webDATA install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-dist_webDATA uninstall-hook + + +# Yes, you are correct. This is a HACK! +install-data-hook: + ( cd $(DESTDIR)$(webdir); rm -f mootools-core.js mootools-more.js ) + ( cd $(DESTDIR)$(webdir); ln -s mootools-core-1.3.2-yc.js mootools-core.js ) + ( cd $(DESTDIR)$(webdir); ln -s mootools-more-1.3.2.1-yc.js mootools-more.js ) + +uninstall-hook: + @-( cd $(DESTDIR)$(webdir); rm -f mootools-* ) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/tools/mootools/mootools-core-1.3.2-nc.js b/web/tools/mootools/mootools-core-1.3.2-nc.js new file mode 100644 index 000000000..cba97ef7f --- /dev/null +++ b/web/tools/mootools/mootools-core-1.3.2-nc.js @@ -0,0 +1,5515 @@ +/* +--- +MooTools: the javascript framework + +web build: + - http://mootools.net/core/7c56cfef9dddcf170a5d68e3fb61cfd7 + +packager build: + - packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class Core/Class.Extras Core/Slick.Parser Core/Slick.Finder Core/Element Core/Element.Style Core/Element.Event Core/Element.Dimensions Core/Fx Core/Fx.CSS Core/Fx.Tween Core/Fx.Morph Core/Fx.Transitions Core/Request Core/Request.HTML Core/Request.JSON Core/Cookie Core/JSON Core/DOMReady Core/Swiff + +/* +--- + +name: Core + +description: The heart of MooTools. + +license: MIT-style license. + +copyright: Copyright (c) 2006-2010 [Valerio Proietti](http://mad4milk.net/). + +authors: The MooTools production team (http://mootools.net/developers/) + +inspiration: + - Class implementation inspired by [Base.js](http://dean.edwards.name/weblog/2006/03/base/) Copyright (c) 2006 Dean Edwards, [GNU Lesser General Public License](http://opensource.org/licenses/lgpl-license.php) + - Some functionality inspired by [Prototype.js](http://prototypejs.org) Copyright (c) 2005-2007 Sam Stephenson, [MIT License](http://opensource.org/licenses/mit-license.php) + +provides: [Core, MooTools, Type, typeOf, instanceOf, Native] + +... +*/ + +(function(){ + +this.MooTools = { + version: '1.3.2', + build: 'c9f1ff10e9e7facb65e9481049ed1b450959d587' +}; + +// typeOf, instanceOf + +var typeOf = this.typeOf = function(item){ + if (item == null) return 'null'; + if (item.$family) return item.$family(); + + if (item.nodeName){ + if (item.nodeType == 1) return 'element'; + if (item.nodeType == 3) return (/\S/).test(item.nodeValue) ? 'textnode' : 'whitespace'; + } else if (typeof item.length == 'number'){ + if (item.callee) return 'arguments'; + if ('item' in item) return 'collection'; + } + + return typeof item; +}; + +var instanceOf = this.instanceOf = function(item, object){ + if (item == null) return false; + var constructor = item.$constructor || item.constructor; + while (constructor){ + if (constructor === object) return true; + constructor = constructor.parent; + } + return item instanceof object; +}; + +// Function overloading + +var Function = this.Function; + +var enumerables = true; +for (var i in {toString: 1}) enumerables = null; +if (enumerables) enumerables = ['hasOwnProperty', 'valueOf', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'constructor']; + +Function.prototype.overloadSetter = function(usePlural){ + var self = this; + return function(a, b){ + if (a == null) return this; + if (usePlural || typeof a != 'string'){ + for (var k in a) self.call(this, k, a[k]); + if (enumerables) for (var i = enumerables.length; i--;){ + k = enumerables[i]; + if (a.hasOwnProperty(k)) self.call(this, k, a[k]); + } + } else { + self.call(this, a, b); + } + return this; + }; +}; + +Function.prototype.overloadGetter = function(usePlural){ + var self = this; + return function(a){ + var args, result; + if (usePlural || typeof a != 'string') args = a; + else if (arguments.length > 1) args = arguments; + if (args){ + result = {}; + for (var i = 0; i < args.length; i++) result[args[i]] = self.call(this, args[i]); + } else { + result = self.call(this, a); + } + return result; + }; +}; + +Function.prototype.extend = function(key, value){ + this[key] = value; +}.overloadSetter(); + +Function.prototype.implement = function(key, value){ + this.prototype[key] = value; +}.overloadSetter(); + +// From + +var slice = Array.prototype.slice; + +Function.from = function(item){ + return (typeOf(item) == 'function') ? item : function(){ + return item; + }; +}; + +Array.from = function(item){ + if (item == null) return []; + return (Type.isEnumerable(item) && typeof item != 'string') ? (typeOf(item) == 'array') ? item : slice.call(item) : [item]; +}; + +Number.from = function(item){ + var number = parseFloat(item); + return isFinite(number) ? number : null; +}; + +String.from = function(item){ + return item + ''; +}; + +// hide, protect + +Function.implement({ + + hide: function(){ + this.$hidden = true; + return this; + }, + + protect: function(){ + this.$protected = true; + return this; + } + +}); + +// Type + +var Type = this.Type = function(name, object){ + if (name){ + var lower = name.toLowerCase(); + var typeCheck = function(item){ + return (typeOf(item) == lower); + }; + + Type['is' + name] = typeCheck; + if (object != null){ + object.prototype.$family = (function(){ + return lower; + }).hide(); + + } + } + + if (object == null) return null; + + object.extend(this); + object.$constructor = Type; + object.prototype.$constructor = object; + + return object; +}; + +var toString = Object.prototype.toString; + +Type.isEnumerable = function(item){ + return (item != null && typeof item.length == 'number' && toString.call(item) != '[object Function]' ); +}; + +var hooks = {}; + +var hooksOf = function(object){ + var type = typeOf(object.prototype); + return hooks[type] || (hooks[type] = []); +}; + +var implement = function(name, method){ + if (method && method.$hidden) return; + + var hooks = hooksOf(this); + + for (var i = 0; i < hooks.length; i++){ + var hook = hooks[i]; + if (typeOf(hook) == 'type') implement.call(hook, name, method); + else hook.call(this, name, method); + } + + var previous = this.prototype[name]; + if (previous == null || !previous.$protected) this.prototype[name] = method; + + if (this[name] == null && typeOf(method) == 'function') extend.call(this, name, function(item){ + return method.apply(item, slice.call(arguments, 1)); + }); +}; + +var extend = function(name, method){ + if (method && method.$hidden) return; + var previous = this[name]; + if (previous == null || !previous.$protected) this[name] = method; +}; + +Type.implement({ + + implement: implement.overloadSetter(), + + extend: extend.overloadSetter(), + + alias: function(name, existing){ + implement.call(this, name, this.prototype[existing]); + }.overloadSetter(), + + mirror: function(hook){ + hooksOf(this).push(hook); + return this; + } + +}); + +new Type('Type', Type); + +// Default Types + +var force = function(name, object, methods){ + var isType = (object != Object), + prototype = object.prototype; + + if (isType) object = new Type(name, object); + + for (var i = 0, l = methods.length; i < l; i++){ + var key = methods[i], + generic = object[key], + proto = prototype[key]; + + if (generic) generic.protect(); + + if (isType && proto){ + delete prototype[key]; + prototype[key] = proto.protect(); + } + } + + if (isType) object.implement(prototype); + + return force; +}; + +force('String', String, [ + 'charAt', 'charCodeAt', 'concat', 'indexOf', 'lastIndexOf', 'match', 'quote', 'replace', 'search', + 'slice', 'split', 'substr', 'substring', 'toLowerCase', 'toUpperCase' +])('Array', Array, [ + 'pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift', 'concat', 'join', 'slice', + 'indexOf', 'lastIndexOf', 'filter', 'forEach', 'every', 'map', 'some', 'reduce', 'reduceRight' +])('Number', Number, [ + 'toExponential', 'toFixed', 'toLocaleString', 'toPrecision' +])('Function', Function, [ + 'apply', 'call', 'bind' +])('RegExp', RegExp, [ + 'exec', 'test' +])('Object', Object, [ + 'create', 'defineProperty', 'defineProperties', 'keys', + 'getPrototypeOf', 'getOwnPropertyDescriptor', 'getOwnPropertyNames', + 'preventExtensions', 'isExtensible', 'seal', 'isSealed', 'freeze', 'isFrozen' +])('Date', Date, ['now']); + +Object.extend = extend.overloadSetter(); + +Date.extend('now', function(){ + return +(new Date); +}); + +new Type('Boolean', Boolean); + +// fixes NaN returning as Number + +Number.prototype.$family = function(){ + return isFinite(this) ? 'number' : 'null'; +}.hide(); + +// Number.random + +Number.extend('random', function(min, max){ + return Math.floor(Math.random() * (max - min + 1) + min); +}); + +// forEach, each + +var hasOwnProperty = Object.prototype.hasOwnProperty; +Object.extend('forEach', function(object, fn, bind){ + for (var key in object){ + if (hasOwnProperty.call(object, key)) fn.call(bind, object[key], key, object); + } +}); + +Object.each = Object.forEach; + +Array.implement({ + + forEach: function(fn, bind){ + for (var i = 0, l = this.length; i < l; i++){ + if (i in this) fn.call(bind, this[i], i, this); + } + }, + + each: function(fn, bind){ + Array.forEach(this, fn, bind); + return this; + } + +}); + +// Array & Object cloning, Object merging and appending + +var cloneOf = function(item){ + switch (typeOf(item)){ + case 'array': return item.clone(); + case 'object': return Object.clone(item); + default: return item; + } +}; + +Array.implement('clone', function(){ + var i = this.length, clone = new Array(i); + while (i--) clone[i] = cloneOf(this[i]); + return clone; +}); + +var mergeOne = function(source, key, current){ + switch (typeOf(current)){ + case 'object': + if (typeOf(source[key]) == 'object') Object.merge(source[key], current); + else source[key] = Object.clone(current); + break; + case 'array': source[key] = current.clone(); break; + default: source[key] = current; + } + return source; +}; + +Object.extend({ + + merge: function(source, k, v){ + if (typeOf(k) == 'string') return mergeOne(source, k, v); + for (var i = 1, l = arguments.length; i < l; i++){ + var object = arguments[i]; + for (var key in object) mergeOne(source, key, object[key]); + } + return source; + }, + + clone: function(object){ + var clone = {}; + for (var key in object) clone[key] = cloneOf(object[key]); + return clone; + }, + + append: function(original){ + for (var i = 1, l = arguments.length; i < l; i++){ + var extended = arguments[i] || {}; + for (var key in extended) original[key] = extended[key]; + } + return original; + } + +}); + +// Object-less types + +['Object', 'WhiteSpace', 'TextNode', 'Collection', 'Arguments'].each(function(name){ + new Type(name); +}); + +// Unique ID + +var UID = Date.now(); + +String.extend('uniqueID', function(){ + return (UID++).toString(36); +}); + + + +})(); + + +/* +--- + +name: Array + +description: Contains Array Prototypes like each, contains, and erase. + +license: MIT-style license. + +requires: Type + +provides: Array + +... +*/ + +Array.implement({ + + /**/ + every: function(fn, bind){ + for (var i = 0, l = this.length; i < l; i++){ + if ((i in this) && !fn.call(bind, this[i], i, this)) return false; + } + return true; + }, + + filter: function(fn, bind){ + var results = []; + for (var i = 0, l = this.length; i < l; i++){ + if ((i in this) && fn.call(bind, this[i], i, this)) results.push(this[i]); + } + return results; + }, + + indexOf: function(item, from){ + var len = this.length; + for (var i = (from < 0) ? Math.max(0, len + from) : from || 0; i < len; i++){ + if (this[i] === item) return i; + } + return -1; + }, + + map: function(fn, bind){ + var results = []; + for (var i = 0, l = this.length; i < l; i++){ + if (i in this) results[i] = fn.call(bind, this[i], i, this); + } + return results; + }, + + some: function(fn, bind){ + for (var i = 0, l = this.length; i < l; i++){ + if ((i in this) && fn.call(bind, this[i], i, this)) return true; + } + return false; + }, + /**/ + + clean: function(){ + return this.filter(function(item){ + return item != null; + }); + }, + + invoke: function(methodName){ + var args = Array.slice(arguments, 1); + return this.map(function(item){ + return item[methodName].apply(item, args); + }); + }, + + associate: function(keys){ + var obj = {}, length = Math.min(this.length, keys.length); + for (var i = 0; i < length; i++) obj[keys[i]] = this[i]; + return obj; + }, + + link: function(object){ + var result = {}; + for (var i = 0, l = this.length; i < l; i++){ + for (var key in object){ + if (object[key](this[i])){ + result[key] = this[i]; + delete object[key]; + break; + } + } + } + return result; + }, + + contains: function(item, from){ + return this.indexOf(item, from) != -1; + }, + + append: function(array){ + this.push.apply(this, array); + return this; + }, + + getLast: function(){ + return (this.length) ? this[this.length - 1] : null; + }, + + getRandom: function(){ + return (this.length) ? this[Number.random(0, this.length - 1)] : null; + }, + + include: function(item){ + if (!this.contains(item)) this.push(item); + return this; + }, + + combine: function(array){ + for (var i = 0, l = array.length; i < l; i++) this.include(array[i]); + return this; + }, + + erase: function(item){ + for (var i = this.length; i--;){ + if (this[i] === item) this.splice(i, 1); + } + return this; + }, + + empty: function(){ + this.length = 0; + return this; + }, + + flatten: function(){ + var array = []; + for (var i = 0, l = this.length; i < l; i++){ + var type = typeOf(this[i]); + if (type == 'null') continue; + array = array.concat((type == 'array' || type == 'collection' || type == 'arguments' || instanceOf(this[i], Array)) ? Array.flatten(this[i]) : this[i]); + } + return array; + }, + + pick: function(){ + for (var i = 0, l = this.length; i < l; i++){ + if (this[i] != null) return this[i]; + } + return null; + }, + + hexToRgb: function(array){ + if (this.length != 3) return null; + var rgb = this.map(function(value){ + if (value.length == 1) value += value; + return value.toInt(16); + }); + return (array) ? rgb : 'rgb(' + rgb + ')'; + }, + + rgbToHex: function(array){ + if (this.length < 3) return null; + if (this.length == 4 && this[3] == 0 && !array) return 'transparent'; + var hex = []; + for (var i = 0; i < 3; i++){ + var bit = (this[i] - 0).toString(16); + hex.push((bit.length == 1) ? '0' + bit : bit); + } + return (array) ? hex : '#' + hex.join(''); + } + +}); + + + + +/* +--- + +name: String + +description: Contains String Prototypes like camelCase, capitalize, test, and toInt. + +license: MIT-style license. + +requires: Type + +provides: String + +... +*/ + +String.implement({ + + test: function(regex, params){ + return ((typeOf(regex) == 'regexp') ? regex : new RegExp('' + regex, params)).test(this); + }, + + contains: function(string, separator){ + return (separator) ? (separator + this + separator).indexOf(separator + string + separator) > -1 : this.indexOf(string) > -1; + }, + + trim: function(){ + return this.replace(/^\s+|\s+$/g, ''); + }, + + clean: function(){ + return this.replace(/\s+/g, ' ').trim(); + }, + + camelCase: function(){ + return this.replace(/-\D/g, function(match){ + return match.charAt(1).toUpperCase(); + }); + }, + + hyphenate: function(){ + return this.replace(/[A-Z]/g, function(match){ + return ('-' + match.charAt(0).toLowerCase()); + }); + }, + + capitalize: function(){ + return this.replace(/\b[a-z]/g, function(match){ + return match.toUpperCase(); + }); + }, + + escapeRegExp: function(){ + return this.replace(/([-.*+?^${}()|[\]\/\\])/g, '\\$1'); + }, + + toInt: function(base){ + return parseInt(this, base || 10); + }, + + toFloat: function(){ + return parseFloat(this); + }, + + hexToRgb: function(array){ + var hex = this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/); + return (hex) ? hex.slice(1).hexToRgb(array) : null; + }, + + rgbToHex: function(array){ + var rgb = this.match(/\d{1,3}/g); + return (rgb) ? rgb.rgbToHex(array) : null; + }, + + substitute: function(object, regexp){ + return this.replace(regexp || (/\\?\{([^{}]+)\}/g), function(match, name){ + if (match.charAt(0) == '\\') return match.slice(1); + return (object[name] != null) ? object[name] : ''; + }); + } + +}); + + +/* +--- + +name: Number + +description: Contains Number Prototypes like limit, round, times, and ceil. + +license: MIT-style license. + +requires: Type + +provides: Number + +... +*/ + +Number.implement({ + + limit: function(min, max){ + return Math.min(max, Math.max(min, this)); + }, + + round: function(precision){ + precision = Math.pow(10, precision || 0).toFixed(precision < 0 ? -precision : 0); + return Math.round(this * precision) / precision; + }, + + times: function(fn, bind){ + for (var i = 0; i < this; i++) fn.call(bind, i, this); + }, + + toFloat: function(){ + return parseFloat(this); + }, + + toInt: function(base){ + return parseInt(this, base || 10); + } + +}); + +Number.alias('each', 'times'); + +(function(math){ + var methods = {}; + math.each(function(name){ + if (!Number[name]) methods[name] = function(){ + return Math[name].apply(null, [this].concat(Array.from(arguments))); + }; + }); + Number.implement(methods); +})(['abs', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'exp', 'floor', 'log', 'max', 'min', 'pow', 'sin', 'sqrt', 'tan']); + + +/* +--- + +name: Function + +description: Contains Function Prototypes like create, bind, pass, and delay. + +license: MIT-style license. + +requires: Type + +provides: Function + +... +*/ + +Function.extend({ + + attempt: function(){ + for (var i = 0, l = arguments.length; i < l; i++){ + try { + return arguments[i](); + } catch (e){} + } + return null; + } + +}); + +Function.implement({ + + attempt: function(args, bind){ + try { + return this.apply(bind, Array.from(args)); + } catch (e){} + + return null; + }, + + /**/ + bind: function(bind){ + var self = this, + args = (arguments.length > 1) ? Array.slice(arguments, 1) : null; + + return function(){ + if (!args && !arguments.length) return self.call(bind); + if (args && arguments.length) return self.apply(bind, args.concat(Array.from(arguments))); + return self.apply(bind, args || arguments); + }; + }, + /**/ + + pass: function(args, bind){ + var self = this; + if (args != null) args = Array.from(args); + return function(){ + return self.apply(bind, args || arguments); + }; + }, + + delay: function(delay, bind, args){ + return setTimeout(this.pass((args == null ? [] : args), bind), delay); + }, + + periodical: function(periodical, bind, args){ + return setInterval(this.pass((args == null ? [] : args), bind), periodical); + } + +}); + + + + +/* +--- + +name: Object + +description: Object generic methods + +license: MIT-style license. + +requires: Type + +provides: [Object, Hash] + +... +*/ + +(function(){ + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +Object.extend({ + + subset: function(object, keys){ + var results = {}; + for (var i = 0, l = keys.length; i < l; i++){ + var k = keys[i]; + if (k in object) results[k] = object[k]; + } + return results; + }, + + map: function(object, fn, bind){ + var results = {}; + for (var key in object){ + if (hasOwnProperty.call(object, key)) results[key] = fn.call(bind, object[key], key, object); + } + return results; + }, + + filter: function(object, fn, bind){ + var results = {}; + for (var key in object){ + var value = object[key]; + if (hasOwnProperty.call(object, key) && fn.call(bind, value, key, object)) results[key] = value; + } + return results; + }, + + every: function(object, fn, bind){ + for (var key in object){ + if (hasOwnProperty.call(object, key) && !fn.call(bind, object[key], key)) return false; + } + return true; + }, + + some: function(object, fn, bind){ + for (var key in object){ + if (hasOwnProperty.call(object, key) && fn.call(bind, object[key], key)) return true; + } + return false; + }, + + keys: function(object){ + var keys = []; + for (var key in object){ + if (hasOwnProperty.call(object, key)) keys.push(key); + } + return keys; + }, + + values: function(object){ + var values = []; + for (var key in object){ + if (hasOwnProperty.call(object, key)) values.push(object[key]); + } + return values; + }, + + getLength: function(object){ + return Object.keys(object).length; + }, + + keyOf: function(object, value){ + for (var key in object){ + if (hasOwnProperty.call(object, key) && object[key] === value) return key; + } + return null; + }, + + contains: function(object, value){ + return Object.keyOf(object, value) != null; + }, + + toQueryString: function(object, base){ + var queryString = []; + + Object.each(object, function(value, key){ + if (base) key = base + '[' + key + ']'; + var result; + switch (typeOf(value)){ + case 'object': result = Object.toQueryString(value, key); break; + case 'array': + var qs = {}; + value.each(function(val, i){ + qs[i] = val; + }); + result = Object.toQueryString(qs, key); + break; + default: result = key + '=' + encodeURIComponent(value); + } + if (value != null) queryString.push(result); + }); + + return queryString.join('&'); + } + +}); + +})(); + + + + +/* +--- + +name: Browser + +description: The Browser Object. Contains Browser initialization, Window and Document, and the Browser Hash. + +license: MIT-style license. + +requires: [Array, Function, Number, String] + +provides: [Browser, Window, Document] + +... +*/ + +(function(){ + +var document = this.document; +var window = document.window = this; + +var UID = 1; + +this.$uid = (window.ActiveXObject) ? function(item){ + return (item.uid || (item.uid = [UID++]))[0]; +} : function(item){ + return item.uid || (item.uid = UID++); +}; + +$uid(window); +$uid(document); + +var ua = navigator.userAgent.toLowerCase(), + platform = navigator.platform.toLowerCase(), + UA = ua.match(/(opera|ie|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|$)/) || [null, 'unknown', 0], + mode = UA[1] == 'ie' && document.documentMode; + +var Browser = this.Browser = { + + extend: Function.prototype.extend, + + name: (UA[1] == 'version') ? UA[3] : UA[1], + + version: mode || parseFloat((UA[1] == 'opera' && UA[4]) ? UA[4] : UA[2]), + + Platform: { + name: ua.match(/ip(?:ad|od|hone)/) ? 'ios' : (ua.match(/(?:webos|android)/) || platform.match(/mac|win|linux/) || ['other'])[0] + }, + + Features: { + xpath: !!(document.evaluate), + air: !!(window.runtime), + query: !!(document.querySelector), + json: !!(window.JSON) + }, + + Plugins: {} + +}; + +Browser[Browser.name] = true; +Browser[Browser.name + parseInt(Browser.version, 10)] = true; +Browser.Platform[Browser.Platform.name] = true; + +// Request + +Browser.Request = (function(){ + + var XMLHTTP = function(){ + return new XMLHttpRequest(); + }; + + var MSXML2 = function(){ + return new ActiveXObject('MSXML2.XMLHTTP'); + }; + + var MSXML = function(){ + return new ActiveXObject('Microsoft.XMLHTTP'); + }; + + return Function.attempt(function(){ + XMLHTTP(); + return XMLHTTP; + }, function(){ + MSXML2(); + return MSXML2; + }, function(){ + MSXML(); + return MSXML; + }); + +})(); + +Browser.Features.xhr = !!(Browser.Request); + +// Flash detection + +var version = (Function.attempt(function(){ + return navigator.plugins['Shockwave Flash'].description; +}, function(){ + return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version'); +}) || '0 r0').match(/\d+/g); + +Browser.Plugins.Flash = { + version: Number(version[0] || '0.' + version[1]) || 0, + build: Number(version[2]) || 0 +}; + +// String scripts + +Browser.exec = function(text){ + if (!text) return text; + if (window.execScript){ + window.execScript(text); + } else { + var script = document.createElement('script'); + script.setAttribute('type', 'text/javascript'); + script.text = text; + document.head.appendChild(script); + document.head.removeChild(script); + } + return text; +}; + +String.implement('stripScripts', function(exec){ + var scripts = ''; + var text = this.replace(/]*>([\s\S]*?)<\/script>/gi, function(all, code){ + scripts += code + '\n'; + return ''; + }); + if (exec === true) Browser.exec(scripts); + else if (typeOf(exec) == 'function') exec(scripts, text); + return text; +}); + +// Window, Document + +Browser.extend({ + Document: this.Document, + Window: this.Window, + Element: this.Element, + Event: this.Event +}); + +this.Window = this.$constructor = new Type('Window', function(){}); + +this.$family = Function.from('window').hide(); + +Window.mirror(function(name, method){ + window[name] = method; +}); + +this.Document = document.$constructor = new Type('Document', function(){}); + +document.$family = Function.from('document').hide(); + +Document.mirror(function(name, method){ + document[name] = method; +}); + +document.html = document.documentElement; +if (!document.head) document.head = document.getElementsByTagName('head')[0]; + +if (document.execCommand) try { + document.execCommand("BackgroundImageCache", false, true); +} catch (e){} + +/**/ +if (this.attachEvent && !this.addEventListener){ + var unloadEvent = function(){ + this.detachEvent('onunload', unloadEvent); + document.head = document.html = document.window = null; + }; + this.attachEvent('onunload', unloadEvent); +} + +// IE fails on collections and ) +var arrayFrom = Array.from; +try { + arrayFrom(document.html.childNodes); +} catch(e){ + Array.from = function(item){ + if (typeof item != 'string' && Type.isEnumerable(item) && typeOf(item) != 'array'){ + var i = item.length, array = new Array(i); + while (i--) array[i] = item[i]; + return array; + } + return arrayFrom(item); + }; + + var prototype = Array.prototype, + slice = prototype.slice; + ['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift', 'concat', 'join', 'slice'].each(function(name){ + var method = prototype[name]; + Array[name] = function(item){ + return method.apply(Array.from(item), slice.call(arguments, 1)); + }; + }); +} +/**/ + + + +})(); + + +/* +--- + +name: Event + +description: Contains the Event Class, to make the event object cross-browser. + +license: MIT-style license. + +requires: [Window, Document, Array, Function, String, Object] + +provides: Event + +... +*/ + +var Event = new Type('Event', function(event, win){ + if (!win) win = window; + var doc = win.document; + event = event || win.event; + if (event.$extended) return event; + this.$extended = true; + var type = event.type, + target = event.target || event.srcElement, + page = {}, + client = {}, + related = null, + rightClick, wheel, code, key; + while (target && target.nodeType == 3) target = target.parentNode; + + if (type.indexOf('key') != -1){ + code = event.which || event.keyCode; + key = Object.keyOf(Event.Keys, code); + if (type == 'keydown'){ + var fKey = code - 111; + if (fKey > 0 && fKey < 13) key = 'f' + fKey; + } + if (!key) key = String.fromCharCode(code).toLowerCase(); + } else if ((/click|mouse|menu/i).test(type)){ + doc = (!doc.compatMode || doc.compatMode == 'CSS1Compat') ? doc.html : doc.body; + page = { + x: (event.pageX != null) ? event.pageX : event.clientX + doc.scrollLeft, + y: (event.pageY != null) ? event.pageY : event.clientY + doc.scrollTop + }; + client = { + x: (event.pageX != null) ? event.pageX - win.pageXOffset : event.clientX, + y: (event.pageY != null) ? event.pageY - win.pageYOffset : event.clientY + }; + if ((/DOMMouseScroll|mousewheel/).test(type)){ + wheel = (event.wheelDelta) ? event.wheelDelta / 120 : -(event.detail || 0) / 3; + } + rightClick = (event.which == 3) || (event.button == 2); + if ((/over|out/).test(type)){ + related = event.relatedTarget || event[(type == 'mouseover' ? 'from' : 'to') + 'Element']; + var testRelated = function(){ + while (related && related.nodeType == 3) related = related.parentNode; + return true; + }; + var hasRelated = (Browser.firefox2) ? testRelated.attempt() : testRelated(); + related = (hasRelated) ? related : null; + } + } else if ((/gesture|touch/i).test(type)){ + this.rotation = event.rotation; + this.scale = event.scale; + this.targetTouches = event.targetTouches; + this.changedTouches = event.changedTouches; + var touches = this.touches = event.touches; + if (touches && touches[0]){ + var touch = touches[0]; + page = {x: touch.pageX, y: touch.pageY}; + client = {x: touch.clientX, y: touch.clientY}; + } + } + + return Object.append(this, { + event: event, + type: type, + + page: page, + client: client, + rightClick: rightClick, + + wheel: wheel, + + relatedTarget: document.id(related), + target: document.id(target), + + code: code, + key: key, + + shift: event.shiftKey, + control: event.ctrlKey, + alt: event.altKey, + meta: event.metaKey + }); +}); + +Event.Keys = { + 'enter': 13, + 'up': 38, + 'down': 40, + 'left': 37, + 'right': 39, + 'esc': 27, + 'space': 32, + 'backspace': 8, + 'tab': 9, + 'delete': 46 +}; + + + +Event.implement({ + + stop: function(){ + return this.stopPropagation().preventDefault(); + }, + + stopPropagation: function(){ + if (this.event.stopPropagation) this.event.stopPropagation(); + else this.event.cancelBubble = true; + return this; + }, + + preventDefault: function(){ + if (this.event.preventDefault) this.event.preventDefault(); + else this.event.returnValue = false; + return this; + } + +}); + + +/* +--- + +name: Class + +description: Contains the Class Function for easily creating, extending, and implementing reusable Classes. + +license: MIT-style license. + +requires: [Array, String, Function, Number] + +provides: Class + +... +*/ + +(function(){ + +var Class = this.Class = new Type('Class', function(params){ + if (instanceOf(params, Function)) params = {initialize: params}; + + var newClass = function(){ + reset(this); + if (newClass.$prototyping) return this; + this.$caller = null; + var value = (this.initialize) ? this.initialize.apply(this, arguments) : this; + this.$caller = this.caller = null; + return value; + }.extend(this).implement(params); + + newClass.$constructor = Class; + newClass.prototype.$constructor = newClass; + newClass.prototype.parent = parent; + + return newClass; +}); + +var parent = function(){ + if (!this.$caller) throw new Error('The method "parent" cannot be called.'); + var name = this.$caller.$name, + parent = this.$caller.$owner.parent, + previous = (parent) ? parent.prototype[name] : null; + if (!previous) throw new Error('The method "' + name + '" has no parent.'); + return previous.apply(this, arguments); +}; + +var reset = function(object){ + for (var key in object){ + var value = object[key]; + switch (typeOf(value)){ + case 'object': + var F = function(){}; + F.prototype = value; + object[key] = reset(new F); + break; + case 'array': object[key] = value.clone(); break; + } + } + return object; +}; + +var wrap = function(self, key, method){ + if (method.$origin) method = method.$origin; + var wrapper = function(){ + if (method.$protected && this.$caller == null) throw new Error('The method "' + key + '" cannot be called.'); + var caller = this.caller, current = this.$caller; + this.caller = current; this.$caller = wrapper; + var result = method.apply(this, arguments); + this.$caller = current; this.caller = caller; + return result; + }.extend({$owner: self, $origin: method, $name: key}); + return wrapper; +}; + +var implement = function(key, value, retain){ + if (Class.Mutators.hasOwnProperty(key)){ + value = Class.Mutators[key].call(this, value); + if (value == null) return this; + } + + if (typeOf(value) == 'function'){ + if (value.$hidden) return this; + this.prototype[key] = (retain) ? value : wrap(this, key, value); + } else { + Object.merge(this.prototype, key, value); + } + + return this; +}; + +var getInstance = function(klass){ + klass.$prototyping = true; + var proto = new klass; + delete klass.$prototyping; + return proto; +}; + +Class.implement('implement', implement.overloadSetter()); + +Class.Mutators = { + + Extends: function(parent){ + this.parent = parent; + this.prototype = getInstance(parent); + }, + + Implements: function(items){ + Array.from(items).each(function(item){ + var instance = new item; + for (var key in instance) implement.call(this, key, instance[key], true); + }, this); + } +}; + +})(); + + +/* +--- + +name: Class.Extras + +description: Contains Utility Classes that can be implemented into your own Classes to ease the execution of many common tasks. + +license: MIT-style license. + +requires: Class + +provides: [Class.Extras, Chain, Events, Options] + +... +*/ + +(function(){ + +this.Chain = new Class({ + + $chain: [], + + chain: function(){ + this.$chain.append(Array.flatten(arguments)); + return this; + }, + + callChain: function(){ + return (this.$chain.length) ? this.$chain.shift().apply(this, arguments) : false; + }, + + clearChain: function(){ + this.$chain.empty(); + return this; + } + +}); + +var removeOn = function(string){ + return string.replace(/^on([A-Z])/, function(full, first){ + return first.toLowerCase(); + }); +}; + +this.Events = new Class({ + + $events: {}, + + addEvent: function(type, fn, internal){ + type = removeOn(type); + + + + this.$events[type] = (this.$events[type] || []).include(fn); + if (internal) fn.internal = true; + return this; + }, + + addEvents: function(events){ + for (var type in events) this.addEvent(type, events[type]); + return this; + }, + + fireEvent: function(type, args, delay){ + type = removeOn(type); + var events = this.$events[type]; + if (!events) return this; + args = Array.from(args); + events.each(function(fn){ + if (delay) fn.delay(delay, this, args); + else fn.apply(this, args); + }, this); + return this; + }, + + removeEvent: function(type, fn){ + type = removeOn(type); + var events = this.$events[type]; + if (events && !fn.internal){ + var index = events.indexOf(fn); + if (index != -1) delete events[index]; + } + return this; + }, + + removeEvents: function(events){ + var type; + if (typeOf(events) == 'object'){ + for (type in events) this.removeEvent(type, events[type]); + return this; + } + if (events) events = removeOn(events); + for (type in this.$events){ + if (events && events != type) continue; + var fns = this.$events[type]; + for (var i = fns.length; i--;) if (i in fns){ + this.removeEvent(type, fns[i]); + } + } + return this; + } + +}); + +this.Options = new Class({ + + setOptions: function(){ + var options = this.options = Object.merge.apply(null, [{}, this.options].append(arguments)); + if (this.addEvent) for (var option in options){ + if (typeOf(options[option]) != 'function' || !(/^on[A-Z]/).test(option)) continue; + this.addEvent(option, options[option]); + delete options[option]; + } + return this; + } + +}); + +})(); + + +/* +--- +name: Slick.Parser +description: Standalone CSS3 Selector parser +provides: Slick.Parser +... +*/ + +;(function(){ + +var parsed, + separatorIndex, + combinatorIndex, + reversed, + cache = {}, + reverseCache = {}, + reUnescape = /\\/g; + +var parse = function(expression, isReversed){ + if (expression == null) return null; + if (expression.Slick === true) return expression; + expression = ('' + expression).replace(/^\s+|\s+$/g, ''); + reversed = !!isReversed; + var currentCache = (reversed) ? reverseCache : cache; + if (currentCache[expression]) return currentCache[expression]; + parsed = { + Slick: true, + expressions: [], + raw: expression, + reverse: function(){ + return parse(this.raw, true); + } + }; + separatorIndex = -1; + while (expression != (expression = expression.replace(regexp, parser))); + parsed.length = parsed.expressions.length; + return currentCache[parsed.raw] = (reversed) ? reverse(parsed) : parsed; +}; + +var reverseCombinator = function(combinator){ + if (combinator === '!') return ' '; + else if (combinator === ' ') return '!'; + else if ((/^!/).test(combinator)) return combinator.replace(/^!/, ''); + else return '!' + combinator; +}; + +var reverse = function(expression){ + var expressions = expression.expressions; + for (var i = 0; i < expressions.length; i++){ + var exp = expressions[i]; + var last = {parts: [], tag: '*', combinator: reverseCombinator(exp[0].combinator)}; + + for (var j = 0; j < exp.length; j++){ + var cexp = exp[j]; + if (!cexp.reverseCombinator) cexp.reverseCombinator = ' '; + cexp.combinator = cexp.reverseCombinator; + delete cexp.reverseCombinator; + } + + exp.reverse().push(last); + } + return expression; +}; + +var escapeRegExp = function(string){// Credit: XRegExp 0.6.1 (c) 2007-2008 Steven Levithan MIT License + return string.replace(/[-[\]{}()*+?.\\^$|,#\s]/g, function(match){ + return '\\' + match; + }); +}; + +var regexp = new RegExp( +/* +#!/usr/bin/env ruby +puts "\t\t" + DATA.read.gsub(/\(\?x\)|\s+#.*$|\s+|\\$|\\n/,'') +__END__ + "(?x)^(?:\ + \\s* ( , ) \\s* # Separator \n\ + | \\s* ( + ) \\s* # Combinator \n\ + | ( \\s+ ) # CombinatorChildren \n\ + | ( + | \\* ) # Tag \n\ + | \\# ( + ) # ID \n\ + | \\. ( + ) # ClassName \n\ + | # Attribute \n\ + \\[ \ + \\s* (+) (?: \ + \\s* ([*^$!~|]?=) (?: \ + \\s* (?:\ + ([\"']?)(.*?)\\9 \ + )\ + ) \ + )? \\s* \ + \\](?!\\]) \n\ + | :+ ( + )(?:\ + \\( (?:\ + (?:([\"'])([^\\12]*)\\12)|((?:\\([^)]+\\)|[^()]*)+)\ + ) \\)\ + )?\ + )" +*/ + "^(?:\\s*(,)\\s*|\\s*(+)\\s*|(\\s+)|(+|\\*)|\\#(+)|\\.(+)|\\[\\s*(+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)" + .replace(//, '[' + escapeRegExp(">+~`!@$%^&={}\\;/g, '(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])') + .replace(//g, '(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])') +); + +function parser( + rawMatch, + + separator, + combinator, + combinatorChildren, + + tagName, + id, + className, + + attributeKey, + attributeOperator, + attributeQuote, + attributeValue, + + pseudoMarker, + pseudoClass, + pseudoQuote, + pseudoClassQuotedValue, + pseudoClassValue +){ + if (separator || separatorIndex === -1){ + parsed.expressions[++separatorIndex] = []; + combinatorIndex = -1; + if (separator) return ''; + } + + if (combinator || combinatorChildren || combinatorIndex === -1){ + combinator = combinator || ' '; + var currentSeparator = parsed.expressions[separatorIndex]; + if (reversed && currentSeparator[combinatorIndex]) + currentSeparator[combinatorIndex].reverseCombinator = reverseCombinator(combinator); + currentSeparator[++combinatorIndex] = {combinator: combinator, tag: '*'}; + } + + var currentParsed = parsed.expressions[separatorIndex][combinatorIndex]; + + if (tagName){ + currentParsed.tag = tagName.replace(reUnescape, ''); + + } else if (id){ + currentParsed.id = id.replace(reUnescape, ''); + + } else if (className){ + className = className.replace(reUnescape, ''); + + if (!currentParsed.classList) currentParsed.classList = []; + if (!currentParsed.classes) currentParsed.classes = []; + currentParsed.classList.push(className); + currentParsed.classes.push({ + value: className, + regexp: new RegExp('(^|\\s)' + escapeRegExp(className) + '(\\s|$)') + }); + + } else if (pseudoClass){ + pseudoClassValue = pseudoClassValue || pseudoClassQuotedValue; + pseudoClassValue = pseudoClassValue ? pseudoClassValue.replace(reUnescape, '') : null; + + if (!currentParsed.pseudos) currentParsed.pseudos = []; + currentParsed.pseudos.push({ + key: pseudoClass.replace(reUnescape, ''), + value: pseudoClassValue, + type: pseudoMarker.length == 1 ? 'class' : 'element' + }); + + } else if (attributeKey){ + attributeKey = attributeKey.replace(reUnescape, ''); + attributeValue = (attributeValue || '').replace(reUnescape, ''); + + var test, regexp; + + switch (attributeOperator){ + case '^=' : regexp = new RegExp( '^'+ escapeRegExp(attributeValue) ); break; + case '$=' : regexp = new RegExp( escapeRegExp(attributeValue) +'$' ); break; + case '~=' : regexp = new RegExp( '(^|\\s)'+ escapeRegExp(attributeValue) +'(\\s|$)' ); break; + case '|=' : regexp = new RegExp( '^'+ escapeRegExp(attributeValue) +'(-|$)' ); break; + case '=' : test = function(value){ + return attributeValue == value; + }; break; + case '*=' : test = function(value){ + return value && value.indexOf(attributeValue) > -1; + }; break; + case '!=' : test = function(value){ + return attributeValue != value; + }; break; + default : test = function(value){ + return !!value; + }; + } + + if (attributeValue == '' && (/^[*$^]=$/).test(attributeOperator)) test = function(){ + return false; + }; + + if (!test) test = function(value){ + return value && regexp.test(value); + }; + + if (!currentParsed.attributes) currentParsed.attributes = []; + currentParsed.attributes.push({ + key: attributeKey, + operator: attributeOperator, + value: attributeValue, + test: test + }); + + } + + return ''; +}; + +// Slick NS + +var Slick = (this.Slick || {}); + +Slick.parse = function(expression){ + return parse(expression); +}; + +Slick.escapeRegExp = escapeRegExp; + +if (!this.Slick) this.Slick = Slick; + +}).apply(/**/(typeof exports != 'undefined') ? exports : /**/this); + + +/* +--- +name: Slick.Finder +description: The new, superfast css selector engine. +provides: Slick.Finder +requires: Slick.Parser +... +*/ + +;(function(){ + +var local = {}, + featuresCache = {}, + toString = Object.prototype.toString; + +// Feature / Bug detection + +local.isNativeCode = function(fn){ + return (/\{\s*\[native code\]\s*\}/).test('' + fn); +}; + +local.isXML = function(document){ + return (!!document.xmlVersion) || (!!document.xml) || (toString.call(document) == '[object XMLDocument]') || + (document.nodeType == 9 && document.documentElement.nodeName != 'HTML'); +}; + +local.setDocument = function(document){ + + // convert elements / window arguments to document. if document cannot be extrapolated, the function returns. + var nodeType = document.nodeType; + if (nodeType == 9); // document + else if (nodeType) document = document.ownerDocument; // node + else if (document.navigator) document = document.document; // window + else return; + + // check if it's the old document + + if (this.document === document) return; + this.document = document; + + // check if we have done feature detection on this document before + + var root = document.documentElement, + rootUid = this.getUIDXML(root), + features = featuresCache[rootUid], + feature; + + if (features){ + for (feature in features){ + this[feature] = features[feature]; + } + return; + } + + features = featuresCache[rootUid] = {}; + + features.root = root; + features.isXMLDocument = this.isXML(document); + + features.brokenStarGEBTN + = features.starSelectsClosedQSA + = features.idGetsName + = features.brokenMixedCaseQSA + = features.brokenGEBCN + = features.brokenCheckedQSA + = features.brokenEmptyAttributeQSA + = features.isHTMLDocument + = features.nativeMatchesSelector + = false; + + var starSelectsClosed, starSelectsComments, + brokenSecondClassNameGEBCN, cachedGetElementsByClassName, + brokenFormAttributeGetter; + + var selected, id = 'slick_uniqueid'; + var testNode = document.createElement('div'); + + var testRoot = document.body || document.getElementsByTagName('body')[0] || root; + testRoot.appendChild(testNode); + + // on non-HTML documents innerHTML and getElementsById doesnt work properly + try { + testNode.innerHTML = ''; + features.isHTMLDocument = !!document.getElementById(id); + } catch(e){}; + + if (features.isHTMLDocument){ + + testNode.style.display = 'none'; + + // IE returns comment nodes for getElementsByTagName('*') for some documents + testNode.appendChild(document.createComment('')); + starSelectsComments = (testNode.getElementsByTagName('*').length > 1); + + // IE returns closed nodes (EG:"") for getElementsByTagName('*') for some documents + try { + testNode.innerHTML = 'foo'; + selected = testNode.getElementsByTagName('*'); + starSelectsClosed = (selected && !!selected.length && selected[0].nodeName.charAt(0) == '/'); + } catch(e){}; + + features.brokenStarGEBTN = starSelectsComments || starSelectsClosed; + + // IE returns elements with the name instead of just id for getElementsById for some documents + try { + testNode.innerHTML = ''; + features.idGetsName = document.getElementById(id) === testNode.firstChild; + } catch(e){}; + + if (testNode.getElementsByClassName){ + + // Safari 3.2 getElementsByClassName caches results + try { + testNode.innerHTML = ''; + testNode.getElementsByClassName('b').length; + testNode.firstChild.className = 'b'; + cachedGetElementsByClassName = (testNode.getElementsByClassName('b').length != 2); + } catch(e){}; + + // Opera 9.6 getElementsByClassName doesnt detects the class if its not the first one + try { + testNode.innerHTML = ''; + brokenSecondClassNameGEBCN = (testNode.getElementsByClassName('a').length != 2); + } catch(e){}; + + features.brokenGEBCN = cachedGetElementsByClassName || brokenSecondClassNameGEBCN; + } + + if (testNode.querySelectorAll){ + // IE 8 returns closed nodes (EG:"") for querySelectorAll('*') for some documents + try { + testNode.innerHTML = 'foo'; + selected = testNode.querySelectorAll('*'); + features.starSelectsClosedQSA = (selected && !!selected.length && selected[0].nodeName.charAt(0) == '/'); + } catch(e){}; + + // Safari 3.2 querySelectorAll doesnt work with mixedcase on quirksmode + try { + testNode.innerHTML = ''; + features.brokenMixedCaseQSA = !testNode.querySelectorAll('.MiX').length; + } catch(e){}; + + // Webkit and Opera dont return selected options on querySelectorAll + try { + testNode.innerHTML = ''; + features.brokenCheckedQSA = (testNode.querySelectorAll(':checked').length == 0); + } catch(e){}; + + // IE returns incorrect results for attr[*^$]="" selectors on querySelectorAll + try { + testNode.innerHTML = ''; + features.brokenEmptyAttributeQSA = (testNode.querySelectorAll('[class*=""]').length != 0); + } catch(e){}; + + } + + // IE6-7, if a form has an input of id x, form.getAttribute(x) returns a reference to the input + try { + testNode.innerHTML = '
'; + brokenFormAttributeGetter = (testNode.firstChild.getAttribute('action') != 's'); + } catch(e){}; + + // native matchesSelector function + + features.nativeMatchesSelector = root.matchesSelector || /*root.msMatchesSelector ||*/ root.mozMatchesSelector || root.webkitMatchesSelector; + if (features.nativeMatchesSelector) try { + // if matchesSelector trows errors on incorrect sintaxes we can use it + features.nativeMatchesSelector.call(root, ':slick'); + features.nativeMatchesSelector = null; + } catch(e){}; + + } + + try { + root.slick_expando = 1; + delete root.slick_expando; + features.getUID = this.getUIDHTML; + } catch(e) { + features.getUID = this.getUIDXML; + } + + testRoot.removeChild(testNode); + testNode = selected = testRoot = null; + + // getAttribute + + features.getAttribute = (features.isHTMLDocument && brokenFormAttributeGetter) ? function(node, name){ + var method = this.attributeGetters[name]; + if (method) return method.call(node); + var attributeNode = node.getAttributeNode(name); + return (attributeNode) ? attributeNode.nodeValue : null; + } : function(node, name){ + var method = this.attributeGetters[name]; + return (method) ? method.call(node) : node.getAttribute(name); + }; + + // hasAttribute + + features.hasAttribute = (root && this.isNativeCode(root.hasAttribute)) ? function(node, attribute) { + return node.hasAttribute(attribute); + } : function(node, attribute) { + node = node.getAttributeNode(attribute); + return !!(node && (node.specified || node.nodeValue)); + }; + + // contains + // FIXME: Add specs: local.contains should be different for xml and html documents? + features.contains = (root && this.isNativeCode(root.contains)) ? function(context, node){ + return context.contains(node); + } : (root && root.compareDocumentPosition) ? function(context, node){ + return context === node || !!(context.compareDocumentPosition(node) & 16); + } : function(context, node){ + if (node) do { + if (node === context) return true; + } while ((node = node.parentNode)); + return false; + }; + + // document order sorting + // credits to Sizzle (http://sizzlejs.com/) + + features.documentSorter = (root.compareDocumentPosition) ? function(a, b){ + if (!a.compareDocumentPosition || !b.compareDocumentPosition) return 0; + return a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; + } : ('sourceIndex' in root) ? function(a, b){ + if (!a.sourceIndex || !b.sourceIndex) return 0; + return a.sourceIndex - b.sourceIndex; + } : (document.createRange) ? function(a, b){ + if (!a.ownerDocument || !b.ownerDocument) return 0; + var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); + aRange.setStart(a, 0); + aRange.setEnd(a, 0); + bRange.setStart(b, 0); + bRange.setEnd(b, 0); + return aRange.compareBoundaryPoints(Range.START_TO_END, bRange); + } : null ; + + root = null; + + for (feature in features){ + this[feature] = features[feature]; + } +}; + +// Main Method + +var reSimpleSelector = /^([#.]?)((?:[\w-]+|\*))$/, + reEmptyAttribute = /\[.+[*$^]=(?:""|'')?\]/, + qsaFailExpCache = {}; + +local.search = function(context, expression, append, first){ + + var found = this.found = (first) ? null : (append || []); + + if (!context) return found; + else if (context.navigator) context = context.document; // Convert the node from a window to a document + else if (!context.nodeType) return found; + + // setup + + var parsed, i, + uniques = this.uniques = {}, + hasOthers = !!(append && append.length), + contextIsDocument = (context.nodeType == 9); + + if (this.document !== (contextIsDocument ? context : context.ownerDocument)) this.setDocument(context); + + // avoid duplicating items already in the append array + if (hasOthers) for (i = found.length; i--;) uniques[this.getUID(found[i])] = true; + + // expression checks + + if (typeof expression == 'string'){ // expression is a string + + /**/ + var simpleSelector = expression.match(reSimpleSelector); + simpleSelectors: if (simpleSelector) { + + var symbol = simpleSelector[1], + name = simpleSelector[2], + node, nodes; + + if (!symbol){ + + if (name == '*' && this.brokenStarGEBTN) break simpleSelectors; + nodes = context.getElementsByTagName(name); + if (first) return nodes[0] || null; + for (i = 0; node = nodes[i++];){ + if (!(hasOthers && uniques[this.getUID(node)])) found.push(node); + } + + } else if (symbol == '#'){ + + if (!this.isHTMLDocument || !contextIsDocument) break simpleSelectors; + node = context.getElementById(name); + if (!node) return found; + if (this.idGetsName && node.getAttributeNode('id').nodeValue != name) break simpleSelectors; + if (first) return node || null; + if (!(hasOthers && uniques[this.getUID(node)])) found.push(node); + + } else if (symbol == '.'){ + + if (!this.isHTMLDocument || ((!context.getElementsByClassName || this.brokenGEBCN) && context.querySelectorAll)) break simpleSelectors; + if (context.getElementsByClassName && !this.brokenGEBCN){ + nodes = context.getElementsByClassName(name); + if (first) return nodes[0] || null; + for (i = 0; node = nodes[i++];){ + if (!(hasOthers && uniques[this.getUID(node)])) found.push(node); + } + } else { + var matchClass = new RegExp('(^|\\s)'+ Slick.escapeRegExp(name) +'(\\s|$)'); + nodes = context.getElementsByTagName('*'); + for (i = 0; node = nodes[i++];){ + className = node.className; + if (!(className && matchClass.test(className))) continue; + if (first) return node; + if (!(hasOthers && uniques[this.getUID(node)])) found.push(node); + } + } + + } + + if (hasOthers) this.sort(found); + return (first) ? null : found; + + } + /**/ + + /**/ + querySelector: if (context.querySelectorAll) { + + if (!this.isHTMLDocument + || qsaFailExpCache[expression] + //TODO: only skip when expression is actually mixed case + || this.brokenMixedCaseQSA + || (this.brokenCheckedQSA && expression.indexOf(':checked') > -1) + || (this.brokenEmptyAttributeQSA && reEmptyAttribute.test(expression)) + || (!contextIsDocument //Abort when !contextIsDocument and... + // there are multiple expressions in the selector + // since we currently only fix non-document rooted QSA for single expression selectors + && expression.indexOf(',') > -1 + ) + || Slick.disableQSA + ) break querySelector; + + var _expression = expression, _context = context; + if (!contextIsDocument){ + // non-document rooted QSA + // credits to Andrew Dupont + var currentId = _context.getAttribute('id'), slickid = 'slickid__'; + _context.setAttribute('id', slickid); + _expression = '#' + slickid + ' ' + _expression; + context = _context.parentNode; + } + + try { + if (first) return context.querySelector(_expression) || null; + else nodes = context.querySelectorAll(_expression); + } catch(e) { + qsaFailExpCache[expression] = 1; + break querySelector; + } finally { + if (!contextIsDocument){ + if (currentId) _context.setAttribute('id', currentId); + else _context.removeAttribute('id'); + context = _context; + } + } + + if (this.starSelectsClosedQSA) for (i = 0; node = nodes[i++];){ + if (node.nodeName > '@' && !(hasOthers && uniques[this.getUID(node)])) found.push(node); + } else for (i = 0; node = nodes[i++];){ + if (!(hasOthers && uniques[this.getUID(node)])) found.push(node); + } + + if (hasOthers) this.sort(found); + return found; + + } + /**/ + + parsed = this.Slick.parse(expression); + if (!parsed.length) return found; + } else if (expression == null){ // there is no expression + return found; + } else if (expression.Slick){ // expression is a parsed Slick object + parsed = expression; + } else if (this.contains(context.documentElement || context, expression)){ // expression is a node + (found) ? found.push(expression) : found = expression; + return found; + } else { // other junk + return found; + } + + /**//**/ + + // cache elements for the nth selectors + + this.posNTH = {}; + this.posNTHLast = {}; + this.posNTHType = {}; + this.posNTHTypeLast = {}; + + /**//**/ + + // if append is null and there is only a single selector with one expression use pushArray, else use pushUID + this.push = (!hasOthers && (first || (parsed.length == 1 && parsed.expressions[0].length == 1))) ? this.pushArray : this.pushUID; + + if (found == null) found = []; + + // default engine + + var j, m, n; + var combinator, tag, id, classList, classes, attributes, pseudos; + var currentItems, currentExpression, currentBit, lastBit, expressions = parsed.expressions; + + search: for (i = 0; (currentExpression = expressions[i]); i++) for (j = 0; (currentBit = currentExpression[j]); j++){ + + combinator = 'combinator:' + currentBit.combinator; + if (!this[combinator]) continue search; + + tag = (this.isXMLDocument) ? currentBit.tag : currentBit.tag.toUpperCase(); + id = currentBit.id; + classList = currentBit.classList; + classes = currentBit.classes; + attributes = currentBit.attributes; + pseudos = currentBit.pseudos; + lastBit = (j === (currentExpression.length - 1)); + + this.bitUniques = {}; + + if (lastBit){ + this.uniques = uniques; + this.found = found; + } else { + this.uniques = {}; + this.found = []; + } + + if (j === 0){ + this[combinator](context, tag, id, classes, attributes, pseudos, classList); + if (first && lastBit && found.length) break search; + } else { + if (first && lastBit) for (m = 0, n = currentItems.length; m < n; m++){ + this[combinator](currentItems[m], tag, id, classes, attributes, pseudos, classList); + if (found.length) break search; + } else for (m = 0, n = currentItems.length; m < n; m++) this[combinator](currentItems[m], tag, id, classes, attributes, pseudos, classList); + } + + currentItems = this.found; + } + + // should sort if there are nodes in append and if you pass multiple expressions. + if (hasOthers || (parsed.expressions.length > 1)) this.sort(found); + + return (first) ? (found[0] || null) : found; +}; + +// Utils + +local.uidx = 1; +local.uidk = 'slick-uniqueid'; + +local.getUIDXML = function(node){ + var uid = node.getAttribute(this.uidk); + if (!uid){ + uid = this.uidx++; + node.setAttribute(this.uidk, uid); + } + return uid; +}; + +local.getUIDHTML = function(node){ + return node.uniqueNumber || (node.uniqueNumber = this.uidx++); +}; + +// sort based on the setDocument documentSorter method. + +local.sort = function(results){ + if (!this.documentSorter) return results; + results.sort(this.documentSorter); + return results; +}; + +/**//**/ + +local.cacheNTH = {}; + +local.matchNTH = /^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/; + +local.parseNTHArgument = function(argument){ + var parsed = argument.match(this.matchNTH); + if (!parsed) return false; + var special = parsed[2] || false; + var a = parsed[1] || 1; + if (a == '-') a = -1; + var b = +parsed[3] || 0; + parsed = + (special == 'n') ? {a: a, b: b} : + (special == 'odd') ? {a: 2, b: 1} : + (special == 'even') ? {a: 2, b: 0} : {a: 0, b: a}; + + return (this.cacheNTH[argument] = parsed); +}; + +local.createNTHPseudo = function(child, sibling, positions, ofType){ + return function(node, argument){ + var uid = this.getUID(node); + if (!this[positions][uid]){ + var parent = node.parentNode; + if (!parent) return false; + var el = parent[child], count = 1; + if (ofType){ + var nodeName = node.nodeName; + do { + if (el.nodeName != nodeName) continue; + this[positions][this.getUID(el)] = count++; + } while ((el = el[sibling])); + } else { + do { + if (el.nodeType != 1) continue; + this[positions][this.getUID(el)] = count++; + } while ((el = el[sibling])); + } + } + argument = argument || 'n'; + var parsed = this.cacheNTH[argument] || this.parseNTHArgument(argument); + if (!parsed) return false; + var a = parsed.a, b = parsed.b, pos = this[positions][uid]; + if (a == 0) return b == pos; + if (a > 0){ + if (pos < b) return false; + } else { + if (b < pos) return false; + } + return ((pos - b) % a) == 0; + }; +}; + +/**//**/ + +local.pushArray = function(node, tag, id, classes, attributes, pseudos){ + if (this.matchSelector(node, tag, id, classes, attributes, pseudos)) this.found.push(node); +}; + +local.pushUID = function(node, tag, id, classes, attributes, pseudos){ + var uid = this.getUID(node); + if (!this.uniques[uid] && this.matchSelector(node, tag, id, classes, attributes, pseudos)){ + this.uniques[uid] = true; + this.found.push(node); + } +}; + +local.matchNode = function(node, selector){ + if (this.isHTMLDocument && this.nativeMatchesSelector){ + try { + return this.nativeMatchesSelector.call(node, selector.replace(/\[([^=]+)=\s*([^'"\]]+?)\s*\]/g, '[$1="$2"]')); + } catch(matchError) {} + } + + var parsed = this.Slick.parse(selector); + if (!parsed) return true; + + // simple (single) selectors + var expressions = parsed.expressions, reversedExpressions, simpleExpCounter = 0, i; + for (i = 0; (currentExpression = expressions[i]); i++){ + if (currentExpression.length == 1){ + var exp = currentExpression[0]; + if (this.matchSelector(node, (this.isXMLDocument) ? exp.tag : exp.tag.toUpperCase(), exp.id, exp.classes, exp.attributes, exp.pseudos)) return true; + simpleExpCounter++; + } + } + + if (simpleExpCounter == parsed.length) return false; + + var nodes = this.search(this.document, parsed), item; + for (i = 0; item = nodes[i++];){ + if (item === node) return true; + } + return false; +}; + +local.matchPseudo = function(node, name, argument){ + var pseudoName = 'pseudo:' + name; + if (this[pseudoName]) return this[pseudoName](node, argument); + var attribute = this.getAttribute(node, name); + return (argument) ? argument == attribute : !!attribute; +}; + +local.matchSelector = function(node, tag, id, classes, attributes, pseudos){ + if (tag){ + var nodeName = (this.isXMLDocument) ? node.nodeName : node.nodeName.toUpperCase(); + if (tag == '*'){ + if (nodeName < '@') return false; // Fix for comment nodes and closed nodes + } else { + if (nodeName != tag) return false; + } + } + + if (id && node.getAttribute('id') != id) return false; + + var i, part, cls; + if (classes) for (i = classes.length; i--;){ + cls = node.getAttribute('class') || node.className; + if (!(cls && classes[i].regexp.test(cls))) return false; + } + if (attributes) for (i = attributes.length; i--;){ + part = attributes[i]; + if (part.operator ? !part.test(this.getAttribute(node, part.key)) : !this.hasAttribute(node, part.key)) return false; + } + if (pseudos) for (i = pseudos.length; i--;){ + part = pseudos[i]; + if (!this.matchPseudo(node, part.key, part.value)) return false; + } + return true; +}; + +var combinators = { + + ' ': function(node, tag, id, classes, attributes, pseudos, classList){ // all child nodes, any level + + var i, item, children; + + if (this.isHTMLDocument){ + getById: if (id){ + item = this.document.getElementById(id); + if ((!item && node.all) || (this.idGetsName && item && item.getAttributeNode('id').nodeValue != id)){ + // all[id] returns all the elements with that name or id inside node + // if theres just one it will return the element, else it will be a collection + children = node.all[id]; + if (!children) return; + if (!children[0]) children = [children]; + for (i = 0; item = children[i++];){ + var idNode = item.getAttributeNode('id'); + if (idNode && idNode.nodeValue == id){ + this.push(item, tag, null, classes, attributes, pseudos); + break; + } + } + return; + } + if (!item){ + // if the context is in the dom we return, else we will try GEBTN, breaking the getById label + if (this.contains(this.root, node)) return; + else break getById; + } else if (this.document !== node && !this.contains(node, item)) return; + this.push(item, tag, null, classes, attributes, pseudos); + return; + } + getByClass: if (classes && node.getElementsByClassName && !this.brokenGEBCN){ + children = node.getElementsByClassName(classList.join(' ')); + if (!(children && children.length)) break getByClass; + for (i = 0; item = children[i++];) this.push(item, tag, id, null, attributes, pseudos); + return; + } + } + getByTag: { + children = node.getElementsByTagName(tag); + if (!(children && children.length)) break getByTag; + if (!this.brokenStarGEBTN) tag = null; + for (i = 0; item = children[i++];) this.push(item, tag, id, classes, attributes, pseudos); + } + }, + + '>': function(node, tag, id, classes, attributes, pseudos){ // direct children + if ((node = node.firstChild)) do { + if (node.nodeType == 1) this.push(node, tag, id, classes, attributes, pseudos); + } while ((node = node.nextSibling)); + }, + + '+': function(node, tag, id, classes, attributes, pseudos){ // next sibling + while ((node = node.nextSibling)) if (node.nodeType == 1){ + this.push(node, tag, id, classes, attributes, pseudos); + break; + } + }, + + '^': function(node, tag, id, classes, attributes, pseudos){ // first child + node = node.firstChild; + if (node){ + if (node.nodeType == 1) this.push(node, tag, id, classes, attributes, pseudos); + else this['combinator:+'](node, tag, id, classes, attributes, pseudos); + } + }, + + '~': function(node, tag, id, classes, attributes, pseudos){ // next siblings + while ((node = node.nextSibling)){ + if (node.nodeType != 1) continue; + var uid = this.getUID(node); + if (this.bitUniques[uid]) break; + this.bitUniques[uid] = true; + this.push(node, tag, id, classes, attributes, pseudos); + } + }, + + '++': function(node, tag, id, classes, attributes, pseudos){ // next sibling and previous sibling + this['combinator:+'](node, tag, id, classes, attributes, pseudos); + this['combinator:!+'](node, tag, id, classes, attributes, pseudos); + }, + + '~~': function(node, tag, id, classes, attributes, pseudos){ // next siblings and previous siblings + this['combinator:~'](node, tag, id, classes, attributes, pseudos); + this['combinator:!~'](node, tag, id, classes, attributes, pseudos); + }, + + '!': function(node, tag, id, classes, attributes, pseudos){ // all parent nodes up to document + while ((node = node.parentNode)) if (node !== this.document) this.push(node, tag, id, classes, attributes, pseudos); + }, + + '!>': function(node, tag, id, classes, attributes, pseudos){ // direct parent (one level) + node = node.parentNode; + if (node !== this.document) this.push(node, tag, id, classes, attributes, pseudos); + }, + + '!+': function(node, tag, id, classes, attributes, pseudos){ // previous sibling + while ((node = node.previousSibling)) if (node.nodeType == 1){ + this.push(node, tag, id, classes, attributes, pseudos); + break; + } + }, + + '!^': function(node, tag, id, classes, attributes, pseudos){ // last child + node = node.lastChild; + if (node){ + if (node.nodeType == 1) this.push(node, tag, id, classes, attributes, pseudos); + else this['combinator:!+'](node, tag, id, classes, attributes, pseudos); + } + }, + + '!~': function(node, tag, id, classes, attributes, pseudos){ // previous siblings + while ((node = node.previousSibling)){ + if (node.nodeType != 1) continue; + var uid = this.getUID(node); + if (this.bitUniques[uid]) break; + this.bitUniques[uid] = true; + this.push(node, tag, id, classes, attributes, pseudos); + } + } + +}; + +for (var c in combinators) local['combinator:' + c] = combinators[c]; + +var pseudos = { + + /**/ + + 'empty': function(node){ + var child = node.firstChild; + return !(child && child.nodeType == 1) && !(node.innerText || node.textContent || '').length; + }, + + 'not': function(node, expression){ + return !this.matchNode(node, expression); + }, + + 'contains': function(node, text){ + return (node.innerText || node.textContent || '').indexOf(text) > -1; + }, + + 'first-child': function(node){ + while ((node = node.previousSibling)) if (node.nodeType == 1) return false; + return true; + }, + + 'last-child': function(node){ + while ((node = node.nextSibling)) if (node.nodeType == 1) return false; + return true; + }, + + 'only-child': function(node){ + var prev = node; + while ((prev = prev.previousSibling)) if (prev.nodeType == 1) return false; + var next = node; + while ((next = next.nextSibling)) if (next.nodeType == 1) return false; + return true; + }, + + /**/ + + 'nth-child': local.createNTHPseudo('firstChild', 'nextSibling', 'posNTH'), + + 'nth-last-child': local.createNTHPseudo('lastChild', 'previousSibling', 'posNTHLast'), + + 'nth-of-type': local.createNTHPseudo('firstChild', 'nextSibling', 'posNTHType', true), + + 'nth-last-of-type': local.createNTHPseudo('lastChild', 'previousSibling', 'posNTHTypeLast', true), + + 'index': function(node, index){ + return this['pseudo:nth-child'](node, '' + index + 1); + }, + + 'even': function(node){ + return this['pseudo:nth-child'](node, '2n'); + }, + + 'odd': function(node){ + return this['pseudo:nth-child'](node, '2n+1'); + }, + + /**/ + + /**/ + + 'first-of-type': function(node){ + var nodeName = node.nodeName; + while ((node = node.previousSibling)) if (node.nodeName == nodeName) return false; + return true; + }, + + 'last-of-type': function(node){ + var nodeName = node.nodeName; + while ((node = node.nextSibling)) if (node.nodeName == nodeName) return false; + return true; + }, + + 'only-of-type': function(node){ + var prev = node, nodeName = node.nodeName; + while ((prev = prev.previousSibling)) if (prev.nodeName == nodeName) return false; + var next = node; + while ((next = next.nextSibling)) if (next.nodeName == nodeName) return false; + return true; + }, + + /**/ + + // custom pseudos + + 'enabled': function(node){ + return !node.disabled; + }, + + 'disabled': function(node){ + return node.disabled; + }, + + 'checked': function(node){ + return node.checked || node.selected; + }, + + 'focus': function(node){ + return this.isHTMLDocument && this.document.activeElement === node && (node.href || node.type || this.hasAttribute(node, 'tabindex')); + }, + + 'root': function(node){ + return (node === this.root); + }, + + 'selected': function(node){ + return node.selected; + } + + /**/ +}; + +for (var p in pseudos) local['pseudo:' + p] = pseudos[p]; + +// attributes methods + +local.attributeGetters = { + + 'class': function(){ + return this.getAttribute('class') || this.className; + }, + + 'for': function(){ + return ('htmlFor' in this) ? this.htmlFor : this.getAttribute('for'); + }, + + 'href': function(){ + return ('href' in this) ? this.getAttribute('href', 2) : this.getAttribute('href'); + }, + + 'style': function(){ + return (this.style) ? this.style.cssText : this.getAttribute('style'); + }, + + 'tabindex': function(){ + var attributeNode = this.getAttributeNode('tabindex'); + return (attributeNode && attributeNode.specified) ? attributeNode.nodeValue : null; + }, + + 'type': function(){ + return this.getAttribute('type'); + } + +}; + +// Slick + +var Slick = local.Slick = (this.Slick || {}); + +Slick.version = '1.1.5'; + +// Slick finder + +Slick.search = function(context, expression, append){ + return local.search(context, expression, append); +}; + +Slick.find = function(context, expression){ + return local.search(context, expression, null, true); +}; + +// Slick containment checker + +Slick.contains = function(container, node){ + local.setDocument(container); + return local.contains(container, node); +}; + +// Slick attribute getter + +Slick.getAttribute = function(node, name){ + return local.getAttribute(node, name); +}; + +// Slick matcher + +Slick.match = function(node, selector){ + if (!(node && selector)) return false; + if (!selector || selector === node) return true; + local.setDocument(node); + return local.matchNode(node, selector); +}; + +// Slick attribute accessor + +Slick.defineAttributeGetter = function(name, fn){ + local.attributeGetters[name] = fn; + return this; +}; + +Slick.lookupAttributeGetter = function(name){ + return local.attributeGetters[name]; +}; + +// Slick pseudo accessor + +Slick.definePseudo = function(name, fn){ + local['pseudo:' + name] = function(node, argument){ + return fn.call(node, argument); + }; + return this; +}; + +Slick.lookupPseudo = function(name){ + var pseudo = local['pseudo:' + name]; + if (pseudo) return function(argument){ + return pseudo.call(this, argument); + }; + return null; +}; + +// Slick overrides accessor + +Slick.override = function(regexp, fn){ + local.override(regexp, fn); + return this; +}; + +Slick.isXML = local.isXML; + +Slick.uidOf = function(node){ + return local.getUIDHTML(node); +}; + +if (!this.Slick) this.Slick = Slick; + +}).apply(/**/(typeof exports != 'undefined') ? exports : /**/this); + + +/* +--- + +name: Element + +description: One of the most important items in MooTools. Contains the dollar function, the dollars function, and an handful of cross-browser, time-saver methods to let you easily work with HTML Elements. + +license: MIT-style license. + +requires: [Window, Document, Array, String, Function, Number, Slick.Parser, Slick.Finder] + +provides: [Element, Elements, $, $$, Iframe, Selectors] + +... +*/ + +var Element = function(tag, props){ + var konstructor = Element.Constructors[tag]; + if (konstructor) return konstructor(props); + if (typeof tag != 'string') return document.id(tag).set(props); + + if (!props) props = {}; + + if (!(/^[\w-]+$/).test(tag)){ + var parsed = Slick.parse(tag).expressions[0][0]; + tag = (parsed.tag == '*') ? 'div' : parsed.tag; + if (parsed.id && props.id == null) props.id = parsed.id; + + var attributes = parsed.attributes; + if (attributes) for (var i = 0, l = attributes.length; i < l; i++){ + var attr = attributes[i]; + if (props[attr.key] != null) continue; + + if (attr.value != null && attr.operator == '=') props[attr.key] = attr.value; + else if (!attr.value && !attr.operator) props[attr.key] = true; + } + + if (parsed.classList && props['class'] == null) props['class'] = parsed.classList.join(' '); + } + + return document.newElement(tag, props); +}; + +if (Browser.Element) Element.prototype = Browser.Element.prototype; + +new Type('Element', Element).mirror(function(name){ + if (Array.prototype[name]) return; + + var obj = {}; + obj[name] = function(){ + var results = [], args = arguments, elements = true; + for (var i = 0, l = this.length; i < l; i++){ + var element = this[i], result = results[i] = element[name].apply(element, args); + elements = (elements && typeOf(result) == 'element'); + } + return (elements) ? new Elements(results) : results; + }; + + Elements.implement(obj); +}); + +if (!Browser.Element){ + Element.parent = Object; + + Element.Prototype = {'$family': Function.from('element').hide()}; + + Element.mirror(function(name, method){ + Element.Prototype[name] = method; + }); +} + +Element.Constructors = {}; + + + +var IFrame = new Type('IFrame', function(){ + var params = Array.link(arguments, { + properties: Type.isObject, + iframe: function(obj){ + return (obj != null); + } + }); + + var props = params.properties || {}, iframe; + if (params.iframe) iframe = document.id(params.iframe); + var onload = props.onload || function(){}; + delete props.onload; + props.id = props.name = [props.id, props.name, iframe ? (iframe.id || iframe.name) : 'IFrame_' + String.uniqueID()].pick(); + iframe = new Element(iframe || 'iframe', props); + + var onLoad = function(){ + onload.call(iframe.contentWindow); + }; + + if (window.frames[props.id]) onLoad(); + else iframe.addListener('load', onLoad); + return iframe; +}); + +var Elements = this.Elements = function(nodes){ + if (nodes && nodes.length){ + var uniques = {}, node; + for (var i = 0; node = nodes[i++];){ + var uid = Slick.uidOf(node); + if (!uniques[uid]){ + uniques[uid] = true; + this.push(node); + } + } + } +}; + +Elements.prototype = {length: 0}; +Elements.parent = Array; + +new Type('Elements', Elements).implement({ + + filter: function(filter, bind){ + if (!filter) return this; + return new Elements(Array.filter(this, (typeOf(filter) == 'string') ? function(item){ + return item.match(filter); + } : filter, bind)); + }.protect(), + + push: function(){ + var length = this.length; + for (var i = 0, l = arguments.length; i < l; i++){ + var item = document.id(arguments[i]); + if (item) this[length++] = item; + } + return (this.length = length); + }.protect(), + + unshift: function(){ + var items = []; + for (var i = 0, l = arguments.length; i < l; i++){ + var item = document.id(arguments[i]); + if (item) items.push(item); + } + return Array.prototype.unshift.apply(this, items); + }.protect(), + + concat: function(){ + var newElements = new Elements(this); + for (var i = 0, l = arguments.length; i < l; i++){ + var item = arguments[i]; + if (Type.isEnumerable(item)) newElements.append(item); + else newElements.push(item); + } + return newElements; + }.protect(), + + append: function(collection){ + for (var i = 0, l = collection.length; i < l; i++) this.push(collection[i]); + return this; + }.protect(), + + empty: function(){ + while (this.length) delete this[--this.length]; + return this; + }.protect() + +}); + + + +(function(){ + +// FF, IE +var splice = Array.prototype.splice, object = {'0': 0, '1': 1, length: 2}; + +splice.call(object, 1, 1); +if (object[1] == 1) Elements.implement('splice', function(){ + var length = this.length; + splice.apply(this, arguments); + while (length >= this.length) delete this[length--]; + return this; +}.protect()); + +Elements.implement(Array.prototype); + +Array.mirror(Elements); + +/**/ +var createElementAcceptsHTML; +try { + var x = document.createElement(''); + createElementAcceptsHTML = (x.name == 'x'); +} catch(e){} + +var escapeQuotes = function(html){ + return ('' + html).replace(/&/g, '&').replace(/"/g, '"'); +}; +/**/ + +Document.implement({ + + newElement: function(tag, props){ + if (props && props.checked != null) props.defaultChecked = props.checked; + /**/// Fix for readonly name and type properties in IE < 8 + if (createElementAcceptsHTML && props){ + tag = '<' + tag; + if (props.name) tag += ' name="' + escapeQuotes(props.name) + '"'; + if (props.type) tag += ' type="' + escapeQuotes(props.type) + '"'; + tag += '>'; + delete props.name; + delete props.type; + } + /**/ + return this.id(this.createElement(tag)).set(props); + } + +}); + +})(); + +Document.implement({ + + newTextNode: function(text){ + return this.createTextNode(text); + }, + + getDocument: function(){ + return this; + }, + + getWindow: function(){ + return this.window; + }, + + id: (function(){ + + var types = { + + string: function(id, nocash, doc){ + id = Slick.find(doc, '#' + id.replace(/(\W)/g, '\\$1')); + return (id) ? types.element(id, nocash) : null; + }, + + element: function(el, nocash){ + $uid(el); + if (!nocash && !el.$family && !(/^(?:object|embed)$/i).test(el.tagName)){ + Object.append(el, Element.Prototype); + } + return el; + }, + + object: function(obj, nocash, doc){ + if (obj.toElement) return types.element(obj.toElement(doc), nocash); + return null; + } + + }; + + types.textnode = types.whitespace = types.window = types.document = function(zero){ + return zero; + }; + + return function(el, nocash, doc){ + if (el && el.$family && el.uid) return el; + var type = typeOf(el); + return (types[type]) ? types[type](el, nocash, doc || document) : null; + }; + + })() + +}); + +if (window.$ == null) Window.implement('$', function(el, nc){ + return document.id(el, nc, this.document); +}); + +Window.implement({ + + getDocument: function(){ + return this.document; + }, + + getWindow: function(){ + return this; + } + +}); + +[Document, Element].invoke('implement', { + + getElements: function(expression){ + return Slick.search(this, expression, new Elements); + }, + + getElement: function(expression){ + return document.id(Slick.find(this, expression)); + } + +}); + + + +if (window.$$ == null) Window.implement('$$', function(selector){ + if (arguments.length == 1){ + if (typeof selector == 'string') return Slick.search(this.document, selector, new Elements); + else if (Type.isEnumerable(selector)) return new Elements(selector); + } + return new Elements(arguments); +}); + +(function(){ + +var collected = {}, storage = {}; +var formProps = {input: 'checked', option: 'selected', textarea: 'value'}; + +var get = function(uid){ + return (storage[uid] || (storage[uid] = {})); +}; + +var clean = function(item){ + var uid = item.uid; + if (item.removeEvents) item.removeEvents(); + if (item.clearAttributes) item.clearAttributes(); + if (uid != null){ + delete collected[uid]; + delete storage[uid]; + } + return item; +}; + +var camels = ['defaultValue', 'accessKey', 'cellPadding', 'cellSpacing', 'colSpan', 'frameBorder', 'maxLength', 'readOnly', + 'rowSpan', 'tabIndex', 'useMap' +]; +var bools = ['compact', 'nowrap', 'ismap', 'declare', 'noshade', 'checked', 'disabled', 'readOnly', 'multiple', 'selected', + 'noresize', 'defer', 'defaultChecked' +]; + var attributes = { + 'html': 'innerHTML', + 'class': 'className', + 'for': 'htmlFor', + 'text': (function(){ + var temp = document.createElement('div'); + return (temp.textContent == null) ? 'innerText' : 'textContent'; + })() +}; +var readOnly = ['type']; +var expandos = ['value', 'defaultValue']; +var uriAttrs = /^(?:href|src|usemap)$/i; + +bools = bools.associate(bools); +camels = camels.associate(camels.map(String.toLowerCase)); +readOnly = readOnly.associate(readOnly); + +Object.append(attributes, expandos.associate(expandos)); + +var inserters = { + + before: function(context, element){ + var parent = element.parentNode; + if (parent) parent.insertBefore(context, element); + }, + + after: function(context, element){ + var parent = element.parentNode; + if (parent) parent.insertBefore(context, element.nextSibling); + }, + + bottom: function(context, element){ + element.appendChild(context); + }, + + top: function(context, element){ + element.insertBefore(context, element.firstChild); + } + +}; + +inserters.inside = inserters.bottom; + + + +var injectCombinator = function(expression, combinator){ + if (!expression) return combinator; + + expression = Object.clone(Slick.parse(expression)); + + var expressions = expression.expressions; + for (var i = expressions.length; i--;) + expressions[i][0].combinator = combinator; + + return expression; +}; + +Element.implement({ + + set: function(prop, value){ + var property = Element.Properties[prop]; + (property && property.set) ? property.set.call(this, value) : this.setProperty(prop, value); + }.overloadSetter(), + + get: function(prop){ + var property = Element.Properties[prop]; + return (property && property.get) ? property.get.apply(this) : this.getProperty(prop); + }.overloadGetter(), + + erase: function(prop){ + var property = Element.Properties[prop]; + (property && property.erase) ? property.erase.apply(this) : this.removeProperty(prop); + return this; + }, + + setProperty: function(attribute, value){ + attribute = camels[attribute] || attribute; + if (value == null) return this.removeProperty(attribute); + var key = attributes[attribute]; + (key) ? this[key] = value : + (bools[attribute]) ? this[attribute] = !!value : this.setAttribute(attribute, '' + value); + return this; + }, + + setProperties: function(attributes){ + for (var attribute in attributes) this.setProperty(attribute, attributes[attribute]); + return this; + }, + + getProperty: function(attribute){ + attribute = camels[attribute] || attribute; + var key = attributes[attribute] || readOnly[attribute]; + return (key) ? this[key] : + (bools[attribute]) ? !!this[attribute] : + (uriAttrs.test(attribute) ? this.getAttribute(attribute, 2) : + (key = this.getAttributeNode(attribute)) ? key.nodeValue : null) || null; + }, + + getProperties: function(){ + var args = Array.from(arguments); + return args.map(this.getProperty, this).associate(args); + }, + + removeProperty: function(attribute){ + attribute = camels[attribute] || attribute; + var key = attributes[attribute]; + (key) ? this[key] = '' : + (bools[attribute]) ? this[attribute] = false : this.removeAttribute(attribute); + return this; + }, + + removeProperties: function(){ + Array.each(arguments, this.removeProperty, this); + return this; + }, + + hasClass: function(className){ + return this.className.clean().contains(className, ' '); + }, + + addClass: function(className){ + if (!this.hasClass(className)) this.className = (this.className + ' ' + className).clean(); + return this; + }, + + removeClass: function(className){ + this.className = this.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)'), '$1'); + return this; + }, + + toggleClass: function(className, force){ + if (force == null) force = !this.hasClass(className); + return (force) ? this.addClass(className) : this.removeClass(className); + }, + + adopt: function(){ + var parent = this, fragment, elements = Array.flatten(arguments), length = elements.length; + if (length > 1) parent = fragment = document.createDocumentFragment(); + + for (var i = 0; i < length; i++){ + var element = document.id(elements[i], true); + if (element) parent.appendChild(element); + } + + if (fragment) this.appendChild(fragment); + + return this; + }, + + appendText: function(text, where){ + return this.grab(this.getDocument().newTextNode(text), where); + }, + + grab: function(el, where){ + inserters[where || 'bottom'](document.id(el, true), this); + return this; + }, + + inject: function(el, where){ + inserters[where || 'bottom'](this, document.id(el, true)); + return this; + }, + + replaces: function(el){ + el = document.id(el, true); + el.parentNode.replaceChild(this, el); + return this; + }, + + wraps: function(el, where){ + el = document.id(el, true); + return this.replaces(el).grab(el, where); + }, + + getPrevious: function(expression){ + return document.id(Slick.find(this, injectCombinator(expression, '!~'))); + }, + + getAllPrevious: function(expression){ + return Slick.search(this, injectCombinator(expression, '!~'), new Elements); + }, + + getNext: function(expression){ + return document.id(Slick.find(this, injectCombinator(expression, '~'))); + }, + + getAllNext: function(expression){ + return Slick.search(this, injectCombinator(expression, '~'), new Elements); + }, + + getFirst: function(expression){ + return document.id(Slick.search(this, injectCombinator(expression, '>'))[0]); + }, + + getLast: function(expression){ + return document.id(Slick.search(this, injectCombinator(expression, '>')).getLast()); + }, + + getParent: function(expression){ + return document.id(Slick.find(this, injectCombinator(expression, '!'))); + }, + + getParents: function(expression){ + return Slick.search(this, injectCombinator(expression, '!'), new Elements); + }, + + getSiblings: function(expression){ + return Slick.search(this, injectCombinator(expression, '~~'), new Elements); + }, + + getChildren: function(expression){ + return Slick.search(this, injectCombinator(expression, '>'), new Elements); + }, + + getWindow: function(){ + return this.ownerDocument.window; + }, + + getDocument: function(){ + return this.ownerDocument; + }, + + getElementById: function(id){ + return document.id(Slick.find(this, '#' + ('' + id).replace(/(\W)/g, '\\$1'))); + }, + + getSelected: function(){ + this.selectedIndex; // Safari 3.2.1 + return new Elements(Array.from(this.options).filter(function(option){ + return option.selected; + })); + }, + + toQueryString: function(){ + var queryString = []; + this.getElements('input, select, textarea').each(function(el){ + var type = el.type; + if (!el.name || el.disabled || type == 'submit' || type == 'reset' || type == 'file' || type == 'image') return; + + var value = (el.get('tag') == 'select') ? el.getSelected().map(function(opt){ + // IE + return document.id(opt).get('value'); + }) : ((type == 'radio' || type == 'checkbox') && !el.checked) ? null : el.get('value'); + + Array.from(value).each(function(val){ + if (typeof val != 'undefined') queryString.push(encodeURIComponent(el.name) + '=' + encodeURIComponent(val)); + }); + }); + return queryString.join('&'); + }, + + destroy: function(){ + var children = clean(this).getElementsByTagName('*'); + Array.each(children, clean); + Element.dispose(this); + return null; + }, + + empty: function(){ + Array.from(this.childNodes).each(Element.dispose); + return this; + }, + + dispose: function(){ + return (this.parentNode) ? this.parentNode.removeChild(this) : this; + }, + + match: function(expression){ + return !expression || Slick.match(this, expression); + } + +}); + +var cleanClone = function(node, element, keepid){ + if (!keepid) node.setAttributeNode(document.createAttribute('id')); + if (node.clearAttributes){ + node.clearAttributes(); + node.mergeAttributes(element); + node.removeAttribute('uid'); + if (node.options){ + var no = node.options, eo = element.options; + for (var i = no.length; i--;) no[i].selected = eo[i].selected; + } + } + + var prop = formProps[element.tagName.toLowerCase()]; + if (prop && element[prop]) node[prop] = element[prop]; +}; + +Element.implement('clone', function(contents, keepid){ + contents = contents !== false; + var clone = this.cloneNode(contents), i; + + if (contents){ + var ce = clone.getElementsByTagName('*'), te = this.getElementsByTagName('*'); + for (i = ce.length; i--;) cleanClone(ce[i], te[i], keepid); + } + + cleanClone(clone, this, keepid); + + if (Browser.ie){ + var co = clone.getElementsByTagName('object'), to = this.getElementsByTagName('object'); + for (i = co.length; i--;) co[i].outerHTML = to[i].outerHTML; + } + return document.id(clone); +}); + +var contains = {contains: function(element){ + return Slick.contains(this, element); +}}; + +if (!document.contains) Document.implement(contains); +if (!document.createElement('div').contains) Element.implement(contains); + + + +[Element, Window, Document].invoke('implement', { + + addListener: function(type, fn){ + if (type == 'unload'){ + var old = fn, self = this; + fn = function(){ + self.removeListener('unload', fn); + old(); + }; + } else { + collected[$uid(this)] = this; + } + if (this.addEventListener) this.addEventListener(type, fn, !!arguments[2]); + else this.attachEvent('on' + type, fn); + return this; + }, + + removeListener: function(type, fn){ + if (this.removeEventListener) this.removeEventListener(type, fn, !!arguments[2]); + else this.detachEvent('on' + type, fn); + return this; + }, + + retrieve: function(property, dflt){ + var storage = get($uid(this)), prop = storage[property]; + if (dflt != null && prop == null) prop = storage[property] = dflt; + return prop != null ? prop : null; + }, + + store: function(property, value){ + var storage = get($uid(this)); + storage[property] = value; + return this; + }, + + eliminate: function(property){ + var storage = get($uid(this)); + delete storage[property]; + return this; + } + +}); + +/**/ +if (window.attachEvent && !window.addEventListener) window.addListener('unload', function(){ + Object.each(collected, clean); + if (window.CollectGarbage) CollectGarbage(); +}); +/**/ + +})(); + +Element.Properties = {}; + + + +Element.Properties.style = { + + set: function(style){ + this.style.cssText = style; + }, + + get: function(){ + return this.style.cssText; + }, + + erase: function(){ + this.style.cssText = ''; + } + +}; + +Element.Properties.tag = { + + get: function(){ + return this.tagName.toLowerCase(); + } + +}; + +/**/ +(function(maxLength){ + if (maxLength != null) Element.Properties.maxlength = Element.Properties.maxLength = { + get: function(){ + var maxlength = this.getAttribute('maxLength'); + return maxlength == maxLength ? null : maxlength; + } + }; +})(document.createElement('input').getAttribute('maxLength')); +/**/ + +/**/ +Element.Properties.html = (function(){ + + var tableTest = Function.attempt(function(){ + var table = document.createElement('table'); + table.innerHTML = ''; + }); + + var wrapper = document.createElement('div'); + + var translations = { + table: [1, '', '
'], + select: [1, ''], + tbody: [2, '', '
'], + tr: [3, '', '
'] + }; + translations.thead = translations.tfoot = translations.tbody; + + var html = { + set: function(){ + var html = Array.flatten(arguments).join(''); + var wrap = (!tableTest && translations[this.get('tag')]); + if (wrap){ + var first = wrapper; + first.innerHTML = wrap[1] + html + wrap[2]; + for (var i = wrap[0]; i--;) first = first.firstChild; + this.empty().adopt(first.childNodes); + } else { + this.innerHTML = html; + } + } + }; + + html.erase = html.set; + + return html; +})(); +/**/ + + +/* +--- + +name: Element.Style + +description: Contains methods for interacting with the styles of Elements in a fashionable way. + +license: MIT-style license. + +requires: Element + +provides: Element.Style + +... +*/ + +(function(){ + +var html = document.html; + +Element.Properties.styles = {set: function(styles){ + this.setStyles(styles); +}}; + +var hasOpacity = (html.style.opacity != null); +var reAlpha = /alpha\(opacity=([\d.]+)\)/i; + +var setOpacity = function(element, opacity){ + if (!element.currentStyle || !element.currentStyle.hasLayout) element.style.zoom = 1; + if (hasOpacity){ + element.style.opacity = opacity; + } else { + opacity = (opacity * 100).limit(0, 100).round(); + opacity = (opacity == 100) ? '' : 'alpha(opacity=' + opacity + ')'; + var filter = element.style.filter || element.getComputedStyle('filter') || ''; + element.style.filter = reAlpha.test(filter) ? filter.replace(reAlpha, opacity) : filter + opacity; + } +}; + +Element.Properties.opacity = { + + set: function(opacity){ + var visibility = this.style.visibility; + if (opacity == 0 && visibility != 'hidden') this.style.visibility = 'hidden'; + else if (opacity != 0 && visibility != 'visible') this.style.visibility = 'visible'; + + setOpacity(this, opacity); + }, + + get: (hasOpacity) ? function(){ + var opacity = this.style.opacity || this.getComputedStyle('opacity'); + return (opacity == '') ? 1 : opacity; + } : function(){ + var opacity, filter = (this.style.filter || this.getComputedStyle('filter')); + if (filter) opacity = filter.match(reAlpha); + return (opacity == null || filter == null) ? 1 : (opacity[1] / 100); + } + +}; + +var floatName = (html.style.cssFloat == null) ? 'styleFloat' : 'cssFloat'; + +Element.implement({ + + getComputedStyle: function(property){ + if (this.currentStyle) return this.currentStyle[property.camelCase()]; + var defaultView = Element.getDocument(this).defaultView, + computed = defaultView ? defaultView.getComputedStyle(this, null) : null; + return (computed) ? computed.getPropertyValue((property == floatName) ? 'float' : property.hyphenate()) : null; + }, + + setOpacity: function(value){ + setOpacity(this, value); + return this; + }, + + getOpacity: function(){ + return this.get('opacity'); + }, + + setStyle: function(property, value){ + switch (property){ + case 'opacity': return this.set('opacity', parseFloat(value)); + case 'float': property = floatName; + } + property = property.camelCase(); + if (typeOf(value) != 'string'){ + var map = (Element.Styles[property] || '@').split(' '); + value = Array.from(value).map(function(val, i){ + if (!map[i]) return ''; + return (typeOf(val) == 'number') ? map[i].replace('@', Math.round(val)) : val; + }).join(' '); + } else if (value == String(Number(value))){ + value = Math.round(value); + } + this.style[property] = value; + return this; + }, + + getStyle: function(property){ + switch (property){ + case 'opacity': return this.get('opacity'); + case 'float': property = floatName; + } + property = property.camelCase(); + var result = this.style[property]; + if (!result || property == 'zIndex'){ + result = []; + for (var style in Element.ShortStyles){ + if (property != style) continue; + for (var s in Element.ShortStyles[style]) result.push(this.getStyle(s)); + return result.join(' '); + } + result = this.getComputedStyle(property); + } + if (result){ + result = String(result); + var color = result.match(/rgba?\([\d\s,]+\)/); + if (color) result = result.replace(color[0], color[0].rgbToHex()); + } + if (Browser.opera || (Browser.ie && isNaN(parseFloat(result)))){ + if ((/^(height|width)$/).test(property)){ + var values = (property == 'width') ? ['left', 'right'] : ['top', 'bottom'], size = 0; + values.each(function(value){ + size += this.getStyle('border-' + value + '-width').toInt() + this.getStyle('padding-' + value).toInt(); + }, this); + return this['offset' + property.capitalize()] - size + 'px'; + } + if (Browser.opera && String(result).indexOf('px') != -1) return result; + if ((/^border(.+)Width|margin|padding/).test(property)) return '0px'; + } + return result; + }, + + setStyles: function(styles){ + for (var style in styles) this.setStyle(style, styles[style]); + return this; + }, + + getStyles: function(){ + var result = {}; + Array.flatten(arguments).each(function(key){ + result[key] = this.getStyle(key); + }, this); + return result; + } + +}); + +Element.Styles = { + left: '@px', top: '@px', bottom: '@px', right: '@px', + width: '@px', height: '@px', maxWidth: '@px', maxHeight: '@px', minWidth: '@px', minHeight: '@px', + backgroundColor: 'rgb(@, @, @)', backgroundPosition: '@px @px', color: 'rgb(@, @, @)', + fontSize: '@px', letterSpacing: '@px', lineHeight: '@px', clip: 'rect(@px @px @px @px)', + margin: '@px @px @px @px', padding: '@px @px @px @px', border: '@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)', + borderWidth: '@px @px @px @px', borderStyle: '@ @ @ @', borderColor: 'rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)', + zIndex: '@', 'zoom': '@', fontWeight: '@', textIndent: '@px', opacity: '@' +}; + + + +Element.ShortStyles = {margin: {}, padding: {}, border: {}, borderWidth: {}, borderStyle: {}, borderColor: {}}; + +['Top', 'Right', 'Bottom', 'Left'].each(function(direction){ + var Short = Element.ShortStyles; + var All = Element.Styles; + ['margin', 'padding'].each(function(style){ + var sd = style + direction; + Short[style][sd] = All[sd] = '@px'; + }); + var bd = 'border' + direction; + Short.border[bd] = All[bd] = '@px @ rgb(@, @, @)'; + var bdw = bd + 'Width', bds = bd + 'Style', bdc = bd + 'Color'; + Short[bd] = {}; + Short.borderWidth[bdw] = Short[bd][bdw] = All[bdw] = '@px'; + Short.borderStyle[bds] = Short[bd][bds] = All[bds] = '@'; + Short.borderColor[bdc] = Short[bd][bdc] = All[bdc] = 'rgb(@, @, @)'; +}); + +})(); + + +/* +--- + +name: Element.Event + +description: Contains Element methods for dealing with events. This file also includes mouseenter and mouseleave custom Element Events. + +license: MIT-style license. + +requires: [Element, Event] + +provides: Element.Event + +... +*/ + +(function(){ + +Element.Properties.events = {set: function(events){ + this.addEvents(events); +}}; + +[Element, Window, Document].invoke('implement', { + + addEvent: function(type, fn){ + var events = this.retrieve('events', {}); + if (!events[type]) events[type] = {keys: [], values: []}; + if (events[type].keys.contains(fn)) return this; + events[type].keys.push(fn); + var realType = type, + custom = Element.Events[type], + condition = fn, + self = this; + if (custom){ + if (custom.onAdd) custom.onAdd.call(this, fn); + if (custom.condition){ + condition = function(event){ + if (custom.condition.call(this, event)) return fn.call(this, event); + return true; + }; + } + realType = custom.base || realType; + } + var defn = function(){ + return fn.call(self); + }; + var nativeEvent = Element.NativeEvents[realType]; + if (nativeEvent){ + if (nativeEvent == 2){ + defn = function(event){ + event = new Event(event, self.getWindow()); + if (condition.call(self, event) === false) event.stop(); + }; + } + this.addListener(realType, defn, arguments[2]); + } + events[type].values.push(defn); + return this; + }, + + removeEvent: function(type, fn){ + var events = this.retrieve('events'); + if (!events || !events[type]) return this; + var list = events[type]; + var index = list.keys.indexOf(fn); + if (index == -1) return this; + var value = list.values[index]; + delete list.keys[index]; + delete list.values[index]; + var custom = Element.Events[type]; + if (custom){ + if (custom.onRemove) custom.onRemove.call(this, fn); + type = custom.base || type; + } + return (Element.NativeEvents[type]) ? this.removeListener(type, value, arguments[2]) : this; + }, + + addEvents: function(events){ + for (var event in events) this.addEvent(event, events[event]); + return this; + }, + + removeEvents: function(events){ + var type; + if (typeOf(events) == 'object'){ + for (type in events) this.removeEvent(type, events[type]); + return this; + } + var attached = this.retrieve('events'); + if (!attached) return this; + if (!events){ + for (type in attached) this.removeEvents(type); + this.eliminate('events'); + } else if (attached[events]){ + attached[events].keys.each(function(fn){ + this.removeEvent(events, fn); + }, this); + delete attached[events]; + } + return this; + }, + + fireEvent: function(type, args, delay){ + var events = this.retrieve('events'); + if (!events || !events[type]) return this; + args = Array.from(args); + + events[type].keys.each(function(fn){ + if (delay) fn.delay(delay, this, args); + else fn.apply(this, args); + }, this); + return this; + }, + + cloneEvents: function(from, type){ + from = document.id(from); + var events = from.retrieve('events'); + if (!events) return this; + if (!type){ + for (var eventType in events) this.cloneEvents(from, eventType); + } else if (events[type]){ + events[type].keys.each(function(fn){ + this.addEvent(type, fn); + }, this); + } + return this; + } + +}); + +Element.NativeEvents = { + click: 2, dblclick: 2, mouseup: 2, mousedown: 2, contextmenu: 2, //mouse buttons + mousewheel: 2, DOMMouseScroll: 2, //mouse wheel + mouseover: 2, mouseout: 2, mousemove: 2, selectstart: 2, selectend: 2, //mouse movement + keydown: 2, keypress: 2, keyup: 2, //keyboard + orientationchange: 2, // mobile + touchstart: 2, touchmove: 2, touchend: 2, touchcancel: 2, // touch + gesturestart: 2, gesturechange: 2, gestureend: 2, // gesture + focus: 2, blur: 2, change: 2, reset: 2, select: 2, submit: 2, //form elements + load: 2, unload: 1, beforeunload: 2, resize: 1, move: 1, DOMContentLoaded: 1, readystatechange: 1, //window + error: 1, abort: 1, scroll: 1 //misc +}; + +var check = function(event){ + var related = event.relatedTarget; + if (related == null) return true; + if (!related) return false; + return (related != this && related.prefix != 'xul' && typeOf(this) != 'document' && !this.contains(related)); +}; + +Element.Events = { + + mouseenter: { + base: 'mouseover', + condition: check + }, + + mouseleave: { + base: 'mouseout', + condition: check + }, + + mousewheel: { + base: (Browser.firefox) ? 'DOMMouseScroll' : 'mousewheel' + } + +}; + + + +})(); + + +/* +--- + +name: Element.Dimensions + +description: Contains methods to work with size, scroll, or positioning of Elements and the window object. + +license: MIT-style license. + +credits: + - Element positioning based on the [qooxdoo](http://qooxdoo.org/) code and smart browser fixes, [LGPL License](http://www.gnu.org/licenses/lgpl.html). + - Viewport dimensions based on [YUI](http://developer.yahoo.com/yui/) code, [BSD License](http://developer.yahoo.com/yui/license.html). + +requires: [Element, Element.Style] + +provides: [Element.Dimensions] + +... +*/ + +(function(){ + +var element = document.createElement('div'), + child = document.createElement('div'); +element.style.height = '0'; +element.appendChild(child); +var brokenOffsetParent = (child.offsetParent === element); +element = child = null; + +var isOffset = function(el){ + return styleString(el, 'position') != 'static' || isBody(el); +}; + +var isOffsetStatic = function(el){ + return isOffset(el) || (/^(?:table|td|th)$/i).test(el.tagName); +}; + +Element.implement({ + + scrollTo: function(x, y){ + if (isBody(this)){ + this.getWindow().scrollTo(x, y); + } else { + this.scrollLeft = x; + this.scrollTop = y; + } + return this; + }, + + getSize: function(){ + if (isBody(this)) return this.getWindow().getSize(); + return {x: this.offsetWidth, y: this.offsetHeight}; + }, + + getScrollSize: function(){ + if (isBody(this)) return this.getWindow().getScrollSize(); + return {x: this.scrollWidth, y: this.scrollHeight}; + }, + + getScroll: function(){ + if (isBody(this)) return this.getWindow().getScroll(); + return {x: this.scrollLeft, y: this.scrollTop}; + }, + + getScrolls: function(){ + var element = this.parentNode, position = {x: 0, y: 0}; + while (element && !isBody(element)){ + position.x += element.scrollLeft; + position.y += element.scrollTop; + element = element.parentNode; + } + return position; + }, + + getOffsetParent: brokenOffsetParent ? function(){ + var element = this; + if (isBody(element) || styleString(element, 'position') == 'fixed') return null; + + var isOffsetCheck = (styleString(element, 'position') == 'static') ? isOffsetStatic : isOffset; + while ((element = element.parentNode)){ + if (isOffsetCheck(element)) return element; + } + return null; + } : function(){ + var element = this; + if (isBody(element) || styleString(element, 'position') == 'fixed') return null; + + try { + return element.offsetParent; + } catch(e) {} + return null; + }, + + getOffsets: function(){ + if (this.getBoundingClientRect && !Browser.Platform.ios){ + var bound = this.getBoundingClientRect(), + html = document.id(this.getDocument().documentElement), + htmlScroll = html.getScroll(), + elemScrolls = this.getScrolls(), + isFixed = (styleString(this, 'position') == 'fixed'); + + return { + x: bound.left.toInt() + elemScrolls.x + ((isFixed) ? 0 : htmlScroll.x) - html.clientLeft, + y: bound.top.toInt() + elemScrolls.y + ((isFixed) ? 0 : htmlScroll.y) - html.clientTop + }; + } + + var element = this, position = {x: 0, y: 0}; + if (isBody(this)) return position; + + while (element && !isBody(element)){ + position.x += element.offsetLeft; + position.y += element.offsetTop; + + if (Browser.firefox){ + if (!borderBox(element)){ + position.x += leftBorder(element); + position.y += topBorder(element); + } + var parent = element.parentNode; + if (parent && styleString(parent, 'overflow') != 'visible'){ + position.x += leftBorder(parent); + position.y += topBorder(parent); + } + } else if (element != this && Browser.safari){ + position.x += leftBorder(element); + position.y += topBorder(element); + } + + element = element.offsetParent; + } + if (Browser.firefox && !borderBox(this)){ + position.x -= leftBorder(this); + position.y -= topBorder(this); + } + return position; + }, + + getPosition: function(relative){ + if (isBody(this)) return {x: 0, y: 0}; + var offset = this.getOffsets(), + scroll = this.getScrolls(); + var position = { + x: offset.x - scroll.x, + y: offset.y - scroll.y + }; + + if (relative && (relative = document.id(relative))){ + var relativePosition = relative.getPosition(); + return {x: position.x - relativePosition.x - leftBorder(relative), y: position.y - relativePosition.y - topBorder(relative)}; + } + return position; + }, + + getCoordinates: function(element){ + if (isBody(this)) return this.getWindow().getCoordinates(); + var position = this.getPosition(element), + size = this.getSize(); + var obj = { + left: position.x, + top: position.y, + width: size.x, + height: size.y + }; + obj.right = obj.left + obj.width; + obj.bottom = obj.top + obj.height; + return obj; + }, + + computePosition: function(obj){ + return { + left: obj.x - styleNumber(this, 'margin-left'), + top: obj.y - styleNumber(this, 'margin-top') + }; + }, + + setPosition: function(obj){ + return this.setStyles(this.computePosition(obj)); + } + +}); + + +[Document, Window].invoke('implement', { + + getSize: function(){ + var doc = getCompatElement(this); + return {x: doc.clientWidth, y: doc.clientHeight}; + }, + + getScroll: function(){ + var win = this.getWindow(), doc = getCompatElement(this); + return {x: win.pageXOffset || doc.scrollLeft, y: win.pageYOffset || doc.scrollTop}; + }, + + getScrollSize: function(){ + var doc = getCompatElement(this), + min = this.getSize(), + body = this.getDocument().body; + + return {x: Math.max(doc.scrollWidth, body.scrollWidth, min.x), y: Math.max(doc.scrollHeight, body.scrollHeight, min.y)}; + }, + + getPosition: function(){ + return {x: 0, y: 0}; + }, + + getCoordinates: function(){ + var size = this.getSize(); + return {top: 0, left: 0, bottom: size.y, right: size.x, height: size.y, width: size.x}; + } + +}); + +// private methods + +var styleString = Element.getComputedStyle; + +function styleNumber(element, style){ + return styleString(element, style).toInt() || 0; +} + +function borderBox(element){ + return styleString(element, '-moz-box-sizing') == 'border-box'; +} + +function topBorder(element){ + return styleNumber(element, 'border-top-width'); +} + +function leftBorder(element){ + return styleNumber(element, 'border-left-width'); +} + +function isBody(element){ + return (/^(?:body|html)$/i).test(element.tagName); +} + +function getCompatElement(element){ + var doc = element.getDocument(); + return (!doc.compatMode || doc.compatMode == 'CSS1Compat') ? doc.html : doc.body; +} + +})(); + +//aliases +Element.alias({position: 'setPosition'}); //compatability + +[Window, Document, Element].invoke('implement', { + + getHeight: function(){ + return this.getSize().y; + }, + + getWidth: function(){ + return this.getSize().x; + }, + + getScrollTop: function(){ + return this.getScroll().y; + }, + + getScrollLeft: function(){ + return this.getScroll().x; + }, + + getScrollHeight: function(){ + return this.getScrollSize().y; + }, + + getScrollWidth: function(){ + return this.getScrollSize().x; + }, + + getTop: function(){ + return this.getPosition().y; + }, + + getLeft: function(){ + return this.getPosition().x; + } + +}); + + +/* +--- + +name: Fx + +description: Contains the basic animation logic to be extended by all other Fx Classes. + +license: MIT-style license. + +requires: [Chain, Events, Options] + +provides: Fx + +... +*/ + +(function(){ + +var Fx = this.Fx = new Class({ + + Implements: [Chain, Events, Options], + + options: { + /* + onStart: nil, + onCancel: nil, + onComplete: nil, + */ + fps: 60, + unit: false, + duration: 500, + frames: null, + frameSkip: true, + link: 'ignore' + }, + + initialize: function(options){ + this.subject = this.subject || this; + this.setOptions(options); + }, + + getTransition: function(){ + return function(p){ + return -(Math.cos(Math.PI * p) - 1) / 2; + }; + }, + + step: function(now){ + if (this.options.frameSkip){ + var diff = (this.time != null) ? (now - this.time) : 0, frames = diff / this.frameInterval; + this.time = now; + this.frame += frames; + } else { + this.frame++; + } + + if (this.frame < this.frames){ + var delta = this.transition(this.frame / this.frames); + this.set(this.compute(this.from, this.to, delta)); + } else { + this.frame = this.frames; + this.set(this.compute(this.from, this.to, 1)); + this.stop(); + } + }, + + set: function(now){ + return now; + }, + + compute: function(from, to, delta){ + return Fx.compute(from, to, delta); + }, + + check: function(){ + if (!this.isRunning()) return true; + switch (this.options.link){ + case 'cancel': this.cancel(); return true; + case 'chain': this.chain(this.caller.pass(arguments, this)); return false; + } + return false; + }, + + start: function(from, to){ + if (!this.check(from, to)) return this; + this.from = from; + this.to = to; + this.frame = (this.options.frameSkip) ? 0 : -1; + this.time = null; + this.transition = this.getTransition(); + var frames = this.options.frames, fps = this.options.fps, duration = this.options.duration; + this.duration = Fx.Durations[duration] || duration.toInt(); + this.frameInterval = 1000 / fps; + this.frames = frames || Math.round(this.duration / this.frameInterval); + this.fireEvent('start', this.subject); + pushInstance.call(this, fps); + return this; + }, + + stop: function(){ + if (this.isRunning()){ + this.time = null; + pullInstance.call(this, this.options.fps); + if (this.frames == this.frame){ + this.fireEvent('complete', this.subject); + if (!this.callChain()) this.fireEvent('chainComplete', this.subject); + } else { + this.fireEvent('stop', this.subject); + } + } + return this; + }, + + cancel: function(){ + if (this.isRunning()){ + this.time = null; + pullInstance.call(this, this.options.fps); + this.frame = this.frames; + this.fireEvent('cancel', this.subject).clearChain(); + } + return this; + }, + + pause: function(){ + if (this.isRunning()){ + this.time = null; + pullInstance.call(this, this.options.fps); + } + return this; + }, + + resume: function(){ + if ((this.frame < this.frames) && !this.isRunning()) pushInstance.call(this, this.options.fps); + return this; + }, + + isRunning: function(){ + var list = instances[this.options.fps]; + return list && list.contains(this); + } + +}); + +Fx.compute = function(from, to, delta){ + return (to - from) * delta + from; +}; + +Fx.Durations = {'short': 250, 'normal': 500, 'long': 1000}; + +// global timers + +var instances = {}, timers = {}; + +var loop = function(){ + var now = Date.now(); + for (var i = this.length; i--;){ + var instance = this[i]; + if (instance) instance.step(now); + } +}; + +var pushInstance = function(fps){ + var list = instances[fps] || (instances[fps] = []); + list.push(this); + if (!timers[fps]) timers[fps] = loop.periodical(Math.round(1000 / fps), list); +}; + +var pullInstance = function(fps){ + var list = instances[fps]; + if (list){ + list.erase(this); + if (!list.length && timers[fps]){ + delete instances[fps]; + timers[fps] = clearInterval(timers[fps]); + } + } +}; + +})(); + + +/* +--- + +name: Fx.CSS + +description: Contains the CSS animation logic. Used by Fx.Tween, Fx.Morph, Fx.Elements. + +license: MIT-style license. + +requires: [Fx, Element.Style] + +provides: Fx.CSS + +... +*/ + +Fx.CSS = new Class({ + + Extends: Fx, + + //prepares the base from/to object + + prepare: function(element, property, values){ + values = Array.from(values); + if (values[1] == null){ + values[1] = values[0]; + values[0] = element.getStyle(property); + } + var parsed = values.map(this.parse); + return {from: parsed[0], to: parsed[1]}; + }, + + //parses a value into an array + + parse: function(value){ + value = Function.from(value)(); + value = (typeof value == 'string') ? value.split(' ') : Array.from(value); + return value.map(function(val){ + val = String(val); + var found = false; + Object.each(Fx.CSS.Parsers, function(parser, key){ + if (found) return; + var parsed = parser.parse(val); + if (parsed || parsed === 0) found = {value: parsed, parser: parser}; + }); + found = found || {value: val, parser: Fx.CSS.Parsers.String}; + return found; + }); + }, + + //computes by a from and to prepared objects, using their parsers. + + compute: function(from, to, delta){ + var computed = []; + (Math.min(from.length, to.length)).times(function(i){ + computed.push({value: from[i].parser.compute(from[i].value, to[i].value, delta), parser: from[i].parser}); + }); + computed.$family = Function.from('fx:css:value'); + return computed; + }, + + //serves the value as settable + + serve: function(value, unit){ + if (typeOf(value) != 'fx:css:value') value = this.parse(value); + var returned = []; + value.each(function(bit){ + returned = returned.concat(bit.parser.serve(bit.value, unit)); + }); + return returned; + }, + + //renders the change to an element + + render: function(element, property, value, unit){ + element.setStyle(property, this.serve(value, unit)); + }, + + //searches inside the page css to find the values for a selector + + search: function(selector){ + if (Fx.CSS.Cache[selector]) return Fx.CSS.Cache[selector]; + var to = {}, selectorTest = new RegExp('^' + selector.escapeRegExp() + '$'); + Array.each(document.styleSheets, function(sheet, j){ + var href = sheet.href; + if (href && href.contains('://') && !href.contains(document.domain)) return; + var rules = sheet.rules || sheet.cssRules; + Array.each(rules, function(rule, i){ + if (!rule.style) return; + var selectorText = (rule.selectorText) ? rule.selectorText.replace(/^\w+/, function(m){ + return m.toLowerCase(); + }) : null; + if (!selectorText || !selectorTest.test(selectorText)) return; + Object.each(Element.Styles, function(value, style){ + if (!rule.style[style] || Element.ShortStyles[style]) return; + value = String(rule.style[style]); + to[style] = ((/^rgb/).test(value)) ? value.rgbToHex() : value; + }); + }); + }); + return Fx.CSS.Cache[selector] = to; + } + +}); + +Fx.CSS.Cache = {}; + +Fx.CSS.Parsers = { + + Color: { + parse: function(value){ + if (value.match(/^#[0-9a-f]{3,6}$/i)) return value.hexToRgb(true); + return ((value = value.match(/(\d+),\s*(\d+),\s*(\d+)/))) ? [value[1], value[2], value[3]] : false; + }, + compute: function(from, to, delta){ + return from.map(function(value, i){ + return Math.round(Fx.compute(from[i], to[i], delta)); + }); + }, + serve: function(value){ + return value.map(Number); + } + }, + + Number: { + parse: parseFloat, + compute: Fx.compute, + serve: function(value, unit){ + return (unit) ? value + unit : value; + } + }, + + String: { + parse: Function.from(false), + compute: function(zero, one){ + return one; + }, + serve: function(zero){ + return zero; + } + } + +}; + + + + +/* +--- + +name: Fx.Tween + +description: Formerly Fx.Style, effect to transition any CSS property for an element. + +license: MIT-style license. + +requires: Fx.CSS + +provides: [Fx.Tween, Element.fade, Element.highlight] + +... +*/ + +Fx.Tween = new Class({ + + Extends: Fx.CSS, + + initialize: function(element, options){ + this.element = this.subject = document.id(element); + this.parent(options); + }, + + set: function(property, now){ + if (arguments.length == 1){ + now = property; + property = this.property || this.options.property; + } + this.render(this.element, property, now, this.options.unit); + return this; + }, + + start: function(property, from, to){ + if (!this.check(property, from, to)) return this; + var args = Array.flatten(arguments); + this.property = this.options.property || args.shift(); + var parsed = this.prepare(this.element, this.property, args); + return this.parent(parsed.from, parsed.to); + } + +}); + +Element.Properties.tween = { + + set: function(options){ + this.get('tween').cancel().setOptions(options); + return this; + }, + + get: function(){ + var tween = this.retrieve('tween'); + if (!tween){ + tween = new Fx.Tween(this, {link: 'cancel'}); + this.store('tween', tween); + } + return tween; + } + +}; + +Element.implement({ + + tween: function(property, from, to){ + this.get('tween').start(arguments); + return this; + }, + + fade: function(how){ + var fade = this.get('tween'), o = 'opacity', toggle; + how = [how, 'toggle'].pick(); + switch (how){ + case 'in': fade.start(o, 1); break; + case 'out': fade.start(o, 0); break; + case 'show': fade.set(o, 1); break; + case 'hide': fade.set(o, 0); break; + case 'toggle': + var flag = this.retrieve('fade:flag', this.get('opacity') == 1); + fade.start(o, (flag) ? 0 : 1); + this.store('fade:flag', !flag); + toggle = true; + break; + default: fade.start(o, arguments); + } + if (!toggle) this.eliminate('fade:flag'); + return this; + }, + + highlight: function(start, end){ + if (!end){ + end = this.retrieve('highlight:original', this.getStyle('background-color')); + end = (end == 'transparent') ? '#fff' : end; + } + var tween = this.get('tween'); + tween.start('background-color', start || '#ffff88', end).chain(function(){ + this.setStyle('background-color', this.retrieve('highlight:original')); + tween.callChain(); + }.bind(this)); + return this; + } + +}); + + +/* +--- + +name: Fx.Morph + +description: Formerly Fx.Styles, effect to transition any number of CSS properties for an element using an object of rules, or CSS based selector rules. + +license: MIT-style license. + +requires: Fx.CSS + +provides: Fx.Morph + +... +*/ + +Fx.Morph = new Class({ + + Extends: Fx.CSS, + + initialize: function(element, options){ + this.element = this.subject = document.id(element); + this.parent(options); + }, + + set: function(now){ + if (typeof now == 'string') now = this.search(now); + for (var p in now) this.render(this.element, p, now[p], this.options.unit); + return this; + }, + + compute: function(from, to, delta){ + var now = {}; + for (var p in from) now[p] = this.parent(from[p], to[p], delta); + return now; + }, + + start: function(properties){ + if (!this.check(properties)) return this; + if (typeof properties == 'string') properties = this.search(properties); + var from = {}, to = {}; + for (var p in properties){ + var parsed = this.prepare(this.element, p, properties[p]); + from[p] = parsed.from; + to[p] = parsed.to; + } + return this.parent(from, to); + } + +}); + +Element.Properties.morph = { + + set: function(options){ + this.get('morph').cancel().setOptions(options); + return this; + }, + + get: function(){ + var morph = this.retrieve('morph'); + if (!morph){ + morph = new Fx.Morph(this, {link: 'cancel'}); + this.store('morph', morph); + } + return morph; + } + +}; + +Element.implement({ + + morph: function(props){ + this.get('morph').start(props); + return this; + } + +}); + + +/* +--- + +name: Fx.Transitions + +description: Contains a set of advanced transitions to be used with any of the Fx Classes. + +license: MIT-style license. + +credits: + - Easing Equations by Robert Penner, , modified and optimized to be used with MooTools. + +requires: Fx + +provides: Fx.Transitions + +... +*/ + +Fx.implement({ + + getTransition: function(){ + var trans = this.options.transition || Fx.Transitions.Sine.easeInOut; + if (typeof trans == 'string'){ + var data = trans.split(':'); + trans = Fx.Transitions; + trans = trans[data[0]] || trans[data[0].capitalize()]; + if (data[1]) trans = trans['ease' + data[1].capitalize() + (data[2] ? data[2].capitalize() : '')]; + } + return trans; + } + +}); + +Fx.Transition = function(transition, params){ + params = Array.from(params); + var easeIn = function(pos){ + return transition(pos, params); + }; + return Object.append(easeIn, { + easeIn: easeIn, + easeOut: function(pos){ + return 1 - transition(1 - pos, params); + }, + easeInOut: function(pos){ + return (pos <= 0.5 ? transition(2 * pos, params) : (2 - transition(2 * (1 - pos), params))) / 2; + } + }); +}; + +Fx.Transitions = { + + linear: function(zero){ + return zero; + } + +}; + + + +Fx.Transitions.extend = function(transitions){ + for (var transition in transitions) Fx.Transitions[transition] = new Fx.Transition(transitions[transition]); +}; + +Fx.Transitions.extend({ + + Pow: function(p, x){ + return Math.pow(p, x && x[0] || 6); + }, + + Expo: function(p){ + return Math.pow(2, 8 * (p - 1)); + }, + + Circ: function(p){ + return 1 - Math.sin(Math.acos(p)); + }, + + Sine: function(p){ + return 1 - Math.cos(p * Math.PI / 2); + }, + + Back: function(p, x){ + x = x && x[0] || 1.618; + return Math.pow(p, 2) * ((x + 1) * p - x); + }, + + Bounce: function(p){ + var value; + for (var a = 0, b = 1; 1; a += b, b /= 2){ + if (p >= (7 - 4 * a) / 11){ + value = b * b - Math.pow((11 - 6 * a - 11 * p) / 4, 2); + break; + } + } + return value; + }, + + Elastic: function(p, x){ + return Math.pow(2, 10 * --p) * Math.cos(20 * p * Math.PI * (x && x[0] || 1) / 3); + } + +}); + +['Quad', 'Cubic', 'Quart', 'Quint'].each(function(transition, i){ + Fx.Transitions[transition] = new Fx.Transition(function(p){ + return Math.pow(p, i + 2); + }); +}); + + +/* +--- + +name: Request + +description: Powerful all purpose Request Class. Uses XMLHTTPRequest. + +license: MIT-style license. + +requires: [Object, Element, Chain, Events, Options, Browser] + +provides: Request + +... +*/ + +(function(){ + +var empty = function(){}, + progressSupport = ('onprogress' in new Browser.Request); + +var Request = this.Request = new Class({ + + Implements: [Chain, Events, Options], + + options: {/* + onRequest: function(){}, + onLoadstart: function(event, xhr){}, + onProgress: function(event, xhr){}, + onComplete: function(){}, + onCancel: function(){}, + onSuccess: function(responseText, responseXML){}, + onFailure: function(xhr){}, + onException: function(headerName, value){}, + onTimeout: function(){}, + user: '', + password: '',*/ + url: '', + data: '', + headers: { + 'X-Requested-With': 'XMLHttpRequest', + 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' + }, + async: true, + format: false, + method: 'post', + link: 'ignore', + isSuccess: null, + emulation: true, + urlEncoded: true, + encoding: 'utf-8', + evalScripts: false, + evalResponse: false, + timeout: 0, + noCache: false + }, + + initialize: function(options){ + this.xhr = new Browser.Request(); + this.setOptions(options); + this.headers = this.options.headers; + }, + + onStateChange: function(){ + var xhr = this.xhr; + if (xhr.readyState != 4 || !this.running) return; + this.running = false; + this.status = 0; + Function.attempt(function(){ + var status = xhr.status; + this.status = (status == 1223) ? 204 : status; + }.bind(this)); + xhr.onreadystatechange = empty; + if (progressSupport) xhr.onprogress = xhr.onloadstart = empty; + clearTimeout(this.timer); + + this.response = {text: this.xhr.responseText || '', xml: this.xhr.responseXML}; + if (this.options.isSuccess.call(this, this.status)) + this.success(this.response.text, this.response.xml); + else + this.failure(); + }, + + isSuccess: function(){ + var status = this.status; + return (status >= 200 && status < 300); + }, + + isRunning: function(){ + return !!this.running; + }, + + processScripts: function(text){ + if (this.options.evalResponse || (/(ecma|java)script/).test(this.getHeader('Content-type'))) return Browser.exec(text); + return text.stripScripts(this.options.evalScripts); + }, + + success: function(text, xml){ + this.onSuccess(this.processScripts(text), xml); + }, + + onSuccess: function(){ + this.fireEvent('complete', arguments).fireEvent('success', arguments).callChain(); + }, + + failure: function(){ + this.onFailure(); + }, + + onFailure: function(){ + this.fireEvent('complete').fireEvent('failure', this.xhr); + }, + + loadstart: function(event){ + this.fireEvent('loadstart', [event, this.xhr]); + }, + + progress: function(event){ + this.fireEvent('progress', [event, this.xhr]); + }, + + timeout: function(){ + this.fireEvent('timeout', this.xhr); + }, + + setHeader: function(name, value){ + this.headers[name] = value; + return this; + }, + + getHeader: function(name){ + return Function.attempt(function(){ + return this.xhr.getResponseHeader(name); + }.bind(this)); + }, + + check: function(){ + if (!this.running) return true; + switch (this.options.link){ + case 'cancel': this.cancel(); return true; + case 'chain': this.chain(this.caller.pass(arguments, this)); return false; + } + return false; + }, + + send: function(options){ + if (!this.check(options)) return this; + + this.options.isSuccess = this.options.isSuccess || this.isSuccess; + this.running = true; + + var type = typeOf(options); + if (type == 'string' || type == 'element') options = {data: options}; + + var old = this.options; + options = Object.append({data: old.data, url: old.url, method: old.method}, options); + var data = options.data, url = String(options.url), method = options.method.toLowerCase(); + + switch (typeOf(data)){ + case 'element': data = document.id(data).toQueryString(); break; + case 'object': case 'hash': data = Object.toQueryString(data); + } + + if (this.options.format){ + var format = 'format=' + this.options.format; + data = (data) ? format + '&' + data : format; + } + + if (this.options.emulation && !['get', 'post'].contains(method)){ + var _method = '_method=' + method; + data = (data) ? _method + '&' + data : _method; + method = 'post'; + } + + if (this.options.urlEncoded && ['post', 'put'].contains(method)){ + var encoding = (this.options.encoding) ? '; charset=' + this.options.encoding : ''; + this.headers['Content-type'] = 'application/x-www-form-urlencoded' + encoding; + } + + if (!url) url = document.location.pathname; + + var trimPosition = url.lastIndexOf('/'); + if (trimPosition > -1 && (trimPosition = url.indexOf('#')) > -1) url = url.substr(0, trimPosition); + + if (this.options.noCache) + url += (url.contains('?') ? '&' : '?') + String.uniqueID(); + + if (data && method == 'get'){ + url += (url.contains('?') ? '&' : '?') + data; + data = null; + } + + var xhr = this.xhr; + if (progressSupport){ + xhr.onloadstart = this.loadstart.bind(this); + xhr.onprogress = this.progress.bind(this); + } + + xhr.open(method.toUpperCase(), url, this.options.async, this.options.user, this.options.password); + if (this.options.user && 'withCredentials' in xhr) xhr.withCredentials = true; + + xhr.onreadystatechange = this.onStateChange.bind(this); + + Object.each(this.headers, function(value, key){ + try { + xhr.setRequestHeader(key, value); + } catch (e){ + this.fireEvent('exception', [key, value]); + } + }, this); + + this.fireEvent('request'); + xhr.send(data); + if (!this.options.async) this.onStateChange(); + if (this.options.timeout) this.timer = this.timeout.delay(this.options.timeout, this); + return this; + }, + + cancel: function(){ + if (!this.running) return this; + this.running = false; + var xhr = this.xhr; + xhr.abort(); + clearTimeout(this.timer); + xhr.onreadystatechange = empty; + if (progressSupport) xhr.onprogress = xhr.onloadstart = empty; + this.xhr = new Browser.Request(); + this.fireEvent('cancel'); + return this; + } + +}); + +var methods = {}; +['get', 'post', 'put', 'delete', 'GET', 'POST', 'PUT', 'DELETE'].each(function(method){ + methods[method] = function(data){ + var object = { + method: method + }; + if (data != null) object.data = data; + return this.send(object); + }; +}); + +Request.implement(methods); + +Element.Properties.send = { + + set: function(options){ + var send = this.get('send').cancel(); + send.setOptions(options); + return this; + }, + + get: function(){ + var send = this.retrieve('send'); + if (!send){ + send = new Request({ + data: this, link: 'cancel', method: this.get('method') || 'post', url: this.get('action') + }); + this.store('send', send); + } + return send; + } + +}; + +Element.implement({ + + send: function(url){ + var sender = this.get('send'); + sender.send({data: this, url: url || sender.options.url}); + return this; + } + +}); + +})(); + +/* +--- + +name: Request.HTML + +description: Extends the basic Request Class with additional methods for interacting with HTML responses. + +license: MIT-style license. + +requires: [Element, Request] + +provides: Request.HTML + +... +*/ + +Request.HTML = new Class({ + + Extends: Request, + + options: { + update: false, + append: false, + evalScripts: true, + filter: false, + headers: { + Accept: 'text/html, application/xml, text/xml, */*' + } + }, + + success: function(text){ + var options = this.options, response = this.response; + + response.html = text.stripScripts(function(script){ + response.javascript = script; + }); + + var match = response.html.match(/]*>([\s\S]*?)<\/body>/i); + if (match) response.html = match[1]; + var temp = new Element('div').set('html', response.html); + + response.tree = temp.childNodes; + response.elements = temp.getElements('*'); + + if (options.filter) response.tree = response.elements.filter(options.filter); + if (options.update) document.id(options.update).empty().set('html', response.html); + else if (options.append) document.id(options.append).adopt(temp.getChildren()); + if (options.evalScripts) Browser.exec(response.javascript); + + this.onSuccess(response.tree, response.elements, response.html, response.javascript); + } + +}); + +Element.Properties.load = { + + set: function(options){ + var load = this.get('load').cancel(); + load.setOptions(options); + return this; + }, + + get: function(){ + var load = this.retrieve('load'); + if (!load){ + load = new Request.HTML({data: this, link: 'cancel', update: this, method: 'get'}); + this.store('load', load); + } + return load; + } + +}; + +Element.implement({ + + load: function(){ + this.get('load').send(Array.link(arguments, {data: Type.isObject, url: Type.isString})); + return this; + } + +}); + + +/* +--- + +name: JSON + +description: JSON encoder and decoder. + +license: MIT-style license. + +See Also: + +requires: [Array, String, Number, Function] + +provides: JSON + +... +*/ + +if (typeof JSON == 'undefined') this.JSON = {}; + + + +(function(){ + +var special = {'\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"' : '\\"', '\\': '\\\\'}; + +var escape = function(chr){ + return special[chr] || '\\u' + ('0000' + chr.charCodeAt(0).toString(16)).slice(-4); +}; + +JSON.validate = function(string){ + string = string.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@'). + replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'). + replace(/(?:^|:|,)(?:\s*\[)+/g, ''); + + return (/^[\],:{}\s]*$/).test(string); +}; + +JSON.encode = JSON.stringify ? function(obj){ + return JSON.stringify(obj); +} : function(obj){ + if (obj && obj.toJSON) obj = obj.toJSON(); + + switch (typeOf(obj)){ + case 'string': + return '"' + obj.replace(/[\x00-\x1f\\"]/g, escape) + '"'; + case 'array': + return '[' + obj.map(JSON.encode).clean() + ']'; + case 'object': case 'hash': + var string = []; + Object.each(obj, function(value, key){ + var json = JSON.encode(value); + if (json) string.push(JSON.encode(key) + ':' + json); + }); + return '{' + string + '}'; + case 'number': case 'boolean': return '' + obj; + case 'null': return 'null'; + } + + return null; +}; + +JSON.decode = function(string, secure){ + if (!string || typeOf(string) != 'string') return null; + + if (secure || JSON.secure){ + if (JSON.parse) return JSON.parse(string); + if (!JSON.validate(string)) throw new Error('JSON could not decode the input; security is enabled and the value is not secure.'); + } + + return eval('(' + string + ')'); +}; + +})(); + + +/* +--- + +name: Request.JSON + +description: Extends the basic Request Class with additional methods for sending and receiving JSON data. + +license: MIT-style license. + +requires: [Request, JSON] + +provides: Request.JSON + +... +*/ + +Request.JSON = new Class({ + + Extends: Request, + + options: { + /*onError: function(text, error){},*/ + secure: true + }, + + initialize: function(options){ + this.parent(options); + Object.append(this.headers, { + 'Accept': 'application/json', + 'X-Request': 'JSON' + }); + }, + + success: function(text){ + var json; + try { + json = this.response.json = JSON.decode(text, this.options.secure); + } catch (error){ + this.fireEvent('error', [text, error]); + return; + } + if (json == null) this.onFailure(); + else this.onSuccess(json, text); + } + +}); + + +/* +--- + +name: Cookie + +description: Class for creating, reading, and deleting browser Cookies. + +license: MIT-style license. + +credits: + - Based on the functions by Peter-Paul Koch (http://quirksmode.org). + +requires: [Options, Browser] + +provides: Cookie + +... +*/ + +var Cookie = new Class({ + + Implements: Options, + + options: { + path: '/', + domain: false, + duration: false, + secure: false, + document: document, + encode: true + }, + + initialize: function(key, options){ + this.key = key; + this.setOptions(options); + }, + + write: function(value){ + if (this.options.encode) value = encodeURIComponent(value); + if (this.options.domain) value += '; domain=' + this.options.domain; + if (this.options.path) value += '; path=' + this.options.path; + if (this.options.duration){ + var date = new Date(); + date.setTime(date.getTime() + this.options.duration * 24 * 60 * 60 * 1000); + value += '; expires=' + date.toGMTString(); + } + if (this.options.secure) value += '; secure'; + this.options.document.cookie = this.key + '=' + value; + return this; + }, + + read: function(){ + var value = this.options.document.cookie.match('(?:^|;)\\s*' + this.key.escapeRegExp() + '=([^;]*)'); + return (value) ? decodeURIComponent(value[1]) : null; + }, + + dispose: function(){ + new Cookie(this.key, Object.merge({}, this.options, {duration: -1})).write(''); + return this; + } + +}); + +Cookie.write = function(key, value, options){ + return new Cookie(key, options).write(value); +}; + +Cookie.read = function(key){ + return new Cookie(key).read(); +}; + +Cookie.dispose = function(key, options){ + return new Cookie(key, options).dispose(); +}; + + +/* +--- + +name: DOMReady + +description: Contains the custom event domready. + +license: MIT-style license. + +requires: [Browser, Element, Element.Event] + +provides: [DOMReady, DomReady] + +... +*/ + +(function(window, document){ + +var ready, + loaded, + checks = [], + shouldPoll, + timer, + testElement = document.createElement('div'); + +var domready = function(){ + clearTimeout(timer); + if (ready) return; + Browser.loaded = ready = true; + document.removeListener('DOMContentLoaded', domready).removeListener('readystatechange', check); + + document.fireEvent('domready'); + window.fireEvent('domready'); +}; + +var check = function(){ + for (var i = checks.length; i--;) if (checks[i]()){ + domready(); + return true; + } + return false; +}; + +var poll = function(){ + clearTimeout(timer); + if (!check()) timer = setTimeout(poll, 10); +}; + +document.addListener('DOMContentLoaded', domready); + +/**/ +// doScroll technique by Diego Perini http://javascript.nwbox.com/IEContentLoaded/ +// testElement.doScroll() throws when the DOM is not ready, only in the top window +var doScrollWorks = function(){ + try { + testElement.doScroll(); + return true; + } catch (e){} + return false; +} +// If doScroll works already, it can't be used to determine domready +// e.g. in an iframe +if (testElement.doScroll && !doScrollWorks()){ + checks.push(doScrollWorks); + shouldPoll = true; +} +/**/ + +if (document.readyState) checks.push(function(){ + var state = document.readyState; + return (state == 'loaded' || state == 'complete'); +}); + +if ('onreadystatechange' in document) document.addListener('readystatechange', check); +else shouldPoll = true; + +if (shouldPoll) poll(); + +Element.Events.domready = { + onAdd: function(fn){ + if (ready) fn.call(this); + } +}; + +// Make sure that domready fires before load +Element.Events.load = { + base: 'load', + onAdd: function(fn){ + if (loaded && this == window) fn.call(this); + }, + condition: function(){ + if (this == window){ + domready(); + delete Element.Events.load; + } + return true; + } +}; + +// This is based on the custom load event +window.addEvent('load', function(){ + loaded = true; +}); + +})(window, document); + + +/* +--- + +name: Swiff + +description: Wrapper for embedding SWF movies. Supports External Interface Communication. + +license: MIT-style license. + +credits: + - Flash detection & Internet Explorer + Flash Player 9 fix inspired by SWFObject. + +requires: [Options, Object, Element] + +provides: Swiff + +... +*/ + +(function(){ + +var Swiff = this.Swiff = new Class({ + + Implements: Options, + + options: { + id: null, + height: 1, + width: 1, + container: null, + properties: {}, + params: { + quality: 'high', + allowScriptAccess: 'always', + wMode: 'window', + swLiveConnect: true + }, + callBacks: {}, + vars: {} + }, + + toElement: function(){ + return this.object; + }, + + initialize: function(path, options){ + this.instance = 'Swiff_' + String.uniqueID(); + + this.setOptions(options); + options = this.options; + var id = this.id = options.id || this.instance; + var container = document.id(options.container); + + Swiff.CallBacks[this.instance] = {}; + + var params = options.params, vars = options.vars, callBacks = options.callBacks; + var properties = Object.append({height: options.height, width: options.width}, options.properties); + + var self = this; + + for (var callBack in callBacks){ + Swiff.CallBacks[this.instance][callBack] = (function(option){ + return function(){ + return option.apply(self.object, arguments); + }; + })(callBacks[callBack]); + vars[callBack] = 'Swiff.CallBacks.' + this.instance + '.' + callBack; + } + + params.flashVars = Object.toQueryString(vars); + if (Browser.ie){ + properties.classid = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'; + params.movie = path; + } else { + properties.type = 'application/x-shockwave-flash'; + } + properties.data = path; + + var build = ''; + } + build += ''; + this.object = ((container) ? container.empty() : new Element('div')).set('html', build).firstChild; + }, + + replaces: function(element){ + element = document.id(element, true); + element.parentNode.replaceChild(this.toElement(), element); + return this; + }, + + inject: function(element){ + document.id(element, true).appendChild(this.toElement()); + return this; + }, + + remote: function(){ + return Swiff.remote.apply(Swiff, [this.toElement()].append(arguments)); + } + +}); + +Swiff.CallBacks = {}; + +Swiff.remote = function(obj, fn){ + var rs = obj.CallFunction('' + __flash__argumentsToXML(arguments, 2) + ''); + return eval(rs); +}; + +})(); + diff --git a/web/tools/mootools/mootools-core-1.3.2-yc.js b/web/tools/mootools/mootools-core-1.3.2-yc.js new file mode 100644 index 000000000..71a263b81 --- /dev/null +++ b/web/tools/mootools/mootools-core-1.3.2-yc.js @@ -0,0 +1,450 @@ +/* +--- +MooTools: the javascript framework + +web build: + - http://mootools.net/core/7c56cfef9dddcf170a5d68e3fb61cfd7 + +packager build: + - packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class Core/Class.Extras Core/Slick.Parser Core/Slick.Finder Core/Element Core/Element.Style Core/Element.Event Core/Element.Dimensions Core/Fx Core/Fx.CSS Core/Fx.Tween Core/Fx.Morph Core/Fx.Transitions Core/Request Core/Request.HTML Core/Request.JSON Core/Cookie Core/JSON Core/DOMReady Core/Swiff + +copyrights: + - [MooTools](http://mootools.net) + +licenses: + - [MIT License](http://mootools.net/license.txt) +... +*/ +(function(){this.MooTools={version:"1.3.2",build:"c9f1ff10e9e7facb65e9481049ed1b450959d587"};var o=this.typeOf=function(i){if(i==null){return"null";}if(i.$family){return i.$family(); +}if(i.nodeName){if(i.nodeType==1){return"element";}if(i.nodeType==3){return(/\S/).test(i.nodeValue)?"textnode":"whitespace";}}else{if(typeof i.length=="number"){if(i.callee){return"arguments"; +}if("item" in i){return"collection";}}}return typeof i;};var j=this.instanceOf=function(t,i){if(t==null){return false;}var s=t.$constructor||t.constructor; +while(s){if(s===i){return true;}s=s.parent;}return t instanceof i;};var f=this.Function;var p=true;for(var k in {toString:1}){p=null;}if(p){p=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"]; +}f.prototype.overloadSetter=function(s){var i=this;return function(u,t){if(u==null){return this;}if(s||typeof u!="string"){for(var v in u){i.call(this,v,u[v]); +}if(p){for(var w=p.length;w--;){v=p[w];if(u.hasOwnProperty(v)){i.call(this,v,u[v]);}}}}else{i.call(this,u,t);}return this;};};f.prototype.overloadGetter=function(s){var i=this; +return function(u){var v,t;if(s||typeof u!="string"){v=u;}else{if(arguments.length>1){v=arguments;}}if(v){t={};for(var w=0;w-1:this.indexOf(a)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim(); +},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase()); +});},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1"); +},toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/); +return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null;},substitute:function(a,b){return this.replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1); +}return(a[c]!=null)?a[c]:"";});}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this));},round:function(a){a=Math.pow(10,a||0).toFixed(a<0?-a:0); +return Math.round(this*a)/a;},times:function(b,c){for(var a=0;a1)?Array.slice(arguments,1):null;return function(){if(!b&&!arguments.length){return a.call(c);}if(b&&arguments.length){return a.apply(c,b.concat(Array.from(arguments))); +}return a.apply(c,b||arguments);};},pass:function(b,c){var a=this;if(b!=null){b=Array.from(b);}return function(){return a.apply(c,b||arguments);};},delay:function(b,c,a){return setTimeout(this.pass((a==null?[]:a),c),b); +},periodical:function(c,b,a){return setInterval(this.pass((a==null?[]:a),b),c);}});(function(){var a=Object.prototype.hasOwnProperty;Object.extend({subset:function(d,g){var f={}; +for(var e=0,b=g.length;e]*>([\s\S]*?)<\/script>/gi,function(r,s){e+=s+"\n"; +return"";});if(p===true){o.exec(e);}else{if(typeOf(p)=="function"){p(e,q);}}return q;});o.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event}); +this.Window=this.$constructor=new Type("Window",function(){});this.$family=Function.from("window").hide();Window.mirror(function(e,p){i[e]=p;});this.Document=k.$constructor=new Type("Document",function(){}); +k.$family=Function.from("document").hide();Document.mirror(function(e,p){k[e]=p;});k.html=k.documentElement;if(!k.head){k.head=k.getElementsByTagName("head")[0]; +}if(k.execCommand){try{k.execCommand("BackgroundImageCache",false,true);}catch(g){}}if(this.attachEvent&&!this.addEventListener){var d=function(){this.detachEvent("onunload",d); +k.head=k.html=k.window=null;};this.attachEvent("onunload",d);}var m=Array.from;try{m(k.html.childNodes);}catch(g){Array.from=function(p){if(typeof p!="string"&&Type.isEnumerable(p)&&typeOf(p)!="array"){var e=p.length,q=new Array(e); +while(e--){q[e]=p[e];}return q;}return m(p);};var l=Array.prototype,n=l.slice;["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice"].each(function(e){var p=l[e]; +Array[e]=function(q){return p.apply(Array.from(q),n.call(arguments,1));};});}})();var Event=new Type("Event",function(a,i){if(!i){i=window;}var o=i.document; +a=a||i.event;if(a.$extended){return a;}this.$extended=true;var n=a.type,k=a.target||a.srcElement,m={},c={},q=null,h,l,b,p;while(k&&k.nodeType==3){k=k.parentNode; +}if(n.indexOf("key")!=-1){b=a.which||a.keyCode;p=Object.keyOf(Event.Keys,b);if(n=="keydown"){var d=b-111;if(d>0&&d<13){p="f"+d;}}if(!p){p=String.fromCharCode(b).toLowerCase(); +}}else{if((/click|mouse|menu/i).test(n)){o=(!o.compatMode||o.compatMode=="CSS1Compat")?o.html:o.body;m={x:(a.pageX!=null)?a.pageX:a.clientX+o.scrollLeft,y:(a.pageY!=null)?a.pageY:a.clientY+o.scrollTop}; +c={x:(a.pageX!=null)?a.pageX-i.pageXOffset:a.clientX,y:(a.pageY!=null)?a.pageY-i.pageYOffset:a.clientY};if((/DOMMouseScroll|mousewheel/).test(n)){l=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3; +}h=(a.which==3)||(a.button==2);if((/over|out/).test(n)){q=a.relatedTarget||a[(n=="mouseover"?"from":"to")+"Element"];var j=function(){while(q&&q.nodeType==3){q=q.parentNode; +}return true;};var g=(Browser.firefox2)?j.attempt():j();q=(g)?q:null;}}else{if((/gesture|touch/i).test(n)){this.rotation=a.rotation;this.scale=a.scale; +this.targetTouches=a.targetTouches;this.changedTouches=a.changedTouches;var f=this.touches=a.touches;if(f&&f[0]){var e=f[0];m={x:e.pageX,y:e.pageY};c={x:e.clientX,y:e.clientY}; +}}}}return Object.append(this,{event:a,type:n,page:m,client:c,rightClick:h,wheel:l,relatedTarget:document.id(q),target:document.id(k),code:b,key:p,shift:a.shiftKey,control:a.ctrlKey,alt:a.altKey,meta:a.metaKey}); +});Event.Keys={enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46};Event.implement({stop:function(){return this.stopPropagation().preventDefault(); +},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault(); +}else{this.event.returnValue=false;}return this;}});(function(){var a=this.Class=new Type("Class",function(h){if(instanceOf(h,Function)){h={initialize:h}; +}var g=function(){e(this);if(g.$prototyping){return this;}this.$caller=null;var i=(this.initialize)?this.initialize.apply(this,arguments):this;this.$caller=this.caller=null; +return i;}.extend(this).implement(h);g.$constructor=a;g.prototype.$constructor=g;g.prototype.parent=c;return g;});var c=function(){if(!this.$caller){throw new Error('The method "parent" cannot be called.'); +}var g=this.$caller.$name,h=this.$caller.$owner.parent,i=(h)?h.prototype[g]:null;if(!i){throw new Error('The method "'+g+'" has no parent.');}return i.apply(this,arguments); +};var e=function(g){for(var h in g){var j=g[h];switch(typeOf(j)){case"object":var i=function(){};i.prototype=j;g[h]=e(new i);break;case"array":g[h]=j.clone(); +break;}}return g;};var b=function(g,h,j){if(j.$origin){j=j.$origin;}var i=function(){if(j.$protected&&this.$caller==null){throw new Error('The method "'+h+'" cannot be called.'); +}var l=this.caller,m=this.$caller;this.caller=m;this.$caller=i;var k=j.apply(this,arguments);this.$caller=m;this.caller=l;return k;}.extend({$owner:g,$origin:j,$name:h}); +return i;};var f=function(h,i,g){if(a.Mutators.hasOwnProperty(h)){i=a.Mutators[h].call(this,i);if(i==null){return this;}}if(typeOf(i)=="function"){if(i.$hidden){return this; +}this.prototype[h]=(g)?i:b(this,h,i);}else{Object.merge(this.prototype,h,i);}return this;};var d=function(g){g.$prototyping=true;var h=new g;delete g.$prototyping; +return h;};a.implement("implement",f.overloadSetter());a.Mutators={Extends:function(g){this.parent=g;this.prototype=d(g);},Implements:function(g){Array.from(g).each(function(j){var h=new j; +for(var i in h){f.call(this,i,h[i],true);}},this);}};})();(function(){this.Chain=new Class({$chain:[],chain:function(){this.$chain.append(Array.flatten(arguments)); +return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false;},clearChain:function(){this.$chain.empty(); +return this;}});var a=function(b){return b.replace(/^on([A-Z])/,function(c,d){return d.toLowerCase();});};this.Events=new Class({$events:{},addEvent:function(d,c,b){d=a(d); +this.$events[d]=(this.$events[d]||[]).include(c);if(b){c.internal=true;}return this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]);}return this; +},fireEvent:function(e,c,b){e=a(e);var d=this.$events[e];if(!d){return this;}c=Array.from(c);d.each(function(f){if(b){f.delay(b,this,c);}else{f.apply(this,c); +}},this);return this;},removeEvent:function(e,d){e=a(e);var c=this.$events[e];if(c&&!d.internal){var b=c.indexOf(d);if(b!=-1){delete c[b];}}return this; +},removeEvents:function(d){var e;if(typeOf(d)=="object"){for(e in d){this.removeEvent(e,d[e]);}return this;}if(d){d=a(d);}for(e in this.$events){if(d&&d!=e){continue; +}var c=this.$events[e];for(var b=c.length;b--;){if(b in c){this.removeEvent(e,c[b]);}}}return this;}});this.Options=new Class({setOptions:function(){var b=this.options=Object.merge.apply(null,[{},this.options].append(arguments)); +if(this.addEvent){for(var c in b){if(typeOf(b[c])!="function"||!(/^on[A-Z]/).test(c)){continue;}this.addEvent(c,b[c]);delete b[c];}}return this;}});})(); +(function(){var k,n,l,g,a={},c={},m=/\\/g;var e=function(q,p){if(q==null){return null;}if(q.Slick===true){return q;}q=(""+q).replace(/^\s+|\s+$/g,"");g=!!p; +var o=(g)?c:a;if(o[q]){return o[q];}k={Slick:true,expressions:[],raw:q,reverse:function(){return e(this.raw,true);}};n=-1;while(q!=(q=q.replace(j,b))){}k.length=k.expressions.length; +return o[k.raw]=(g)?h(k):k;};var i=function(o){if(o==="!"){return" ";}else{if(o===" "){return"!";}else{if((/^!/).test(o)){return o.replace(/^!/,"");}else{return"!"+o; +}}}};var h=function(u){var r=u.expressions;for(var p=0;p+)\\s*|(\\s+)|(+|\\*)|\\#(+)|\\.(+)|\\[\\s*(+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(//,"["+f(">+~`!@$%^&={}\\;/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(//g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")); +function b(x,s,D,z,r,C,q,B,A,y,u,F,G,v,p,w){if(s||n===-1){k.expressions[++n]=[];l=-1;if(s){return"";}}if(D||z||l===-1){D=D||" ";var t=k.expressions[n]; +if(g&&t[l]){t[l].reverseCombinator=i(D);}t[++l]={combinator:D,tag:"*"};}var o=k.expressions[n][l];if(r){o.tag=r.replace(m,"");}else{if(C){o.id=C.replace(m,""); +}else{if(q){q=q.replace(m,"");if(!o.classList){o.classList=[];}if(!o.classes){o.classes=[];}o.classList.push(q);o.classes.push({value:q,regexp:new RegExp("(^|\\s)"+f(q)+"(\\s|$)")}); +}else{if(G){w=w||p;w=w?w.replace(m,""):null;if(!o.pseudos){o.pseudos=[];}o.pseudos.push({key:G.replace(m,""),value:w,type:F.length==1?"class":"element"}); +}else{if(B){B=B.replace(m,"");u=(u||"").replace(m,"");var E,H;switch(A){case"^=":H=new RegExp("^"+f(u));break;case"$=":H=new RegExp(f(u)+"$");break;case"~=":H=new RegExp("(^|\\s)"+f(u)+"(\\s|$)"); +break;case"|=":H=new RegExp("^"+f(u)+"(-|$)");break;case"=":E=function(I){return u==I;};break;case"*=":E=function(I){return I&&I.indexOf(u)>-1;};break; +case"!=":E=function(I){return u!=I;};break;default:E=function(I){return !!I;};}if(u==""&&(/^[*$^]=$/).test(A)){E=function(){return false;};}if(!E){E=function(I){return I&&H.test(I); +};}if(!o.attributes){o.attributes=[];}o.attributes.push({key:B,operator:A,value:u,test:E});}}}}}return"";}var d=(this.Slick||{});d.parse=function(o){return e(o); +};d.escapeRegExp=f;if(!this.Slick){this.Slick=d;}}).apply((typeof exports!="undefined")?exports:this);(function(){var j={},l={},b=Object.prototype.toString; +j.isNativeCode=function(c){return(/\{\s*\[native code\]\s*\}/).test(""+c);};j.isXML=function(c){return(!!c.xmlVersion)||(!!c.xml)||(b.call(c)=="[object XMLDocument]")||(c.nodeType==9&&c.documentElement.nodeName!="HTML"); +};j.setDocument=function(w){var t=w.nodeType;if(t==9){}else{if(t){w=w.ownerDocument;}else{if(w.navigator){w=w.document;}else{return;}}}if(this.document===w){return; +}this.document=w;var y=w.documentElement,u=this.getUIDXML(y),o=l[u],A;if(o){for(A in o){this[A]=o[A];}return;}o=l[u]={};o.root=y;o.isXMLDocument=this.isXML(w); +o.brokenStarGEBTN=o.starSelectsClosedQSA=o.idGetsName=o.brokenMixedCaseQSA=o.brokenGEBCN=o.brokenCheckedQSA=o.brokenEmptyAttributeQSA=o.isHTMLDocument=o.nativeMatchesSelector=false; +var m,n,x,q,r;var s,c="slick_uniqueid";var z=w.createElement("div");var p=w.body||w.getElementsByTagName("body")[0]||y;p.appendChild(z);try{z.innerHTML=''; +o.isHTMLDocument=!!w.getElementById(c);}catch(v){}if(o.isHTMLDocument){z.style.display="none";z.appendChild(w.createComment(""));n=(z.getElementsByTagName("*").length>1); +try{z.innerHTML="foo";s=z.getElementsByTagName("*");m=(s&&!!s.length&&s[0].nodeName.charAt(0)=="/");}catch(v){}o.brokenStarGEBTN=n||m;try{z.innerHTML=''; +o.idGetsName=w.getElementById(c)===z.firstChild;}catch(v){}if(z.getElementsByClassName){try{z.innerHTML='';z.getElementsByClassName("b").length; +z.firstChild.className="b";q=(z.getElementsByClassName("b").length!=2);}catch(v){}try{z.innerHTML='';x=(z.getElementsByClassName("a").length!=2); +}catch(v){}o.brokenGEBCN=q||x;}if(z.querySelectorAll){try{z.innerHTML="foo";s=z.querySelectorAll("*");o.starSelectsClosedQSA=(s&&!!s.length&&s[0].nodeName.charAt(0)=="/"); +}catch(v){}try{z.innerHTML='';o.brokenMixedCaseQSA=!z.querySelectorAll(".MiX").length;}catch(v){}try{z.innerHTML=''; +o.brokenCheckedQSA=(z.querySelectorAll(":checked").length==0);}catch(v){}try{z.innerHTML='';o.brokenEmptyAttributeQSA=(z.querySelectorAll('[class*=""]').length!=0); +}catch(v){}}try{z.innerHTML='
';r=(z.firstChild.getAttribute("action")!="s");}catch(v){}o.nativeMatchesSelector=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector; +if(o.nativeMatchesSelector){try{o.nativeMatchesSelector.call(y,":slick");o.nativeMatchesSelector=null;}catch(v){}}}try{y.slick_expando=1;delete y.slick_expando; +o.getUID=this.getUIDHTML;}catch(v){o.getUID=this.getUIDXML;}p.removeChild(z);z=s=p=null;o.getAttribute=(o.isHTMLDocument&&r)?function(D,B){var E=this.attributeGetters[B]; +if(E){return E.call(D);}var C=D.getAttributeNode(B);return(C)?C.nodeValue:null;}:function(C,B){var D=this.attributeGetters[B];return(D)?D.call(C):C.getAttribute(B); +};o.hasAttribute=(y&&this.isNativeCode(y.hasAttribute))?function(C,B){return C.hasAttribute(B);}:function(C,B){C=C.getAttributeNode(B);return !!(C&&(C.specified||C.nodeValue)); +};o.contains=(y&&this.isNativeCode(y.contains))?function(B,C){return B.contains(C);}:(y&&y.compareDocumentPosition)?function(B,C){return B===C||!!(B.compareDocumentPosition(C)&16); +}:function(B,C){if(C){do{if(C===B){return true;}}while((C=C.parentNode));}return false;};o.documentSorter=(y.compareDocumentPosition)?function(C,B){if(!C.compareDocumentPosition||!B.compareDocumentPosition){return 0; +}return C.compareDocumentPosition(B)&4?-1:C===B?0:1;}:("sourceIndex" in y)?function(C,B){if(!C.sourceIndex||!B.sourceIndex){return 0;}return C.sourceIndex-B.sourceIndex; +}:(w.createRange)?function(E,C){if(!E.ownerDocument||!C.ownerDocument){return 0;}var D=E.ownerDocument.createRange(),B=C.ownerDocument.createRange();D.setStart(E,0); +D.setEnd(E,0);B.setStart(C,0);B.setEnd(C,0);return D.compareBoundaryPoints(Range.START_TO_END,B);}:null;y=null;for(A in o){this[A]=o[A];}};var e=/^([#.]?)((?:[\w-]+|\*))$/,g=/\[.+[*$^]=(?:""|'')?\]/,f={}; +j.search=function(U,z,H,s){var p=this.found=(s)?null:(H||[]);if(!U){return p;}else{if(U.navigator){U=U.document;}else{if(!U.nodeType){return p;}}}var F,O,V=this.uniques={},I=!!(H&&H.length),y=(U.nodeType==9); +if(this.document!==(y?U:U.ownerDocument)){this.setDocument(U);}if(I){for(O=p.length;O--;){V[this.getUID(p[O])]=true;}}if(typeof z=="string"){var r=z.match(e); +simpleSelectors:if(r){var u=r[1],v=r[2],A,E;if(!u){if(v=="*"&&this.brokenStarGEBTN){break simpleSelectors;}E=U.getElementsByTagName(v);if(s){return E[0]||null; +}for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}else{if(u=="#"){if(!this.isHTMLDocument||!y){break simpleSelectors;}A=U.getElementById(v); +if(!A){return p;}if(this.idGetsName&&A.getAttributeNode("id").nodeValue!=v){break simpleSelectors;}if(s){return A||null;}if(!(I&&V[this.getUID(A)])){p.push(A); +}}else{if(u=="."){if(!this.isHTMLDocument||((!U.getElementsByClassName||this.brokenGEBCN)&&U.querySelectorAll)){break simpleSelectors;}if(U.getElementsByClassName&&!this.brokenGEBCN){E=U.getElementsByClassName(v); +if(s){return E[0]||null;}for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}else{var T=new RegExp("(^|\\s)"+d.escapeRegExp(v)+"(\\s|$)");E=U.getElementsByTagName("*"); +for(O=0;A=E[O++];){className=A.className;if(!(className&&T.test(className))){continue;}if(s){return A;}if(!(I&&V[this.getUID(A)])){p.push(A);}}}}}}if(I){this.sort(p); +}return(s)?null:p;}querySelector:if(U.querySelectorAll){if(!this.isHTMLDocument||f[z]||this.brokenMixedCaseQSA||(this.brokenCheckedQSA&&z.indexOf(":checked")>-1)||(this.brokenEmptyAttributeQSA&&g.test(z))||(!y&&z.indexOf(",")>-1)||d.disableQSA){break querySelector; +}var S=z,x=U;if(!y){var C=x.getAttribute("id"),t="slickid__";x.setAttribute("id",t);S="#"+t+" "+S;U=x.parentNode;}try{if(s){return U.querySelector(S)||null; +}else{E=U.querySelectorAll(S);}}catch(Q){f[z]=1;break querySelector;}finally{if(!y){if(C){x.setAttribute("id",C);}else{x.removeAttribute("id");}U=x;}}if(this.starSelectsClosedQSA){for(O=0; +A=E[O++];){if(A.nodeName>"@"&&!(I&&V[this.getUID(A)])){p.push(A);}}}else{for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}if(I){this.sort(p); +}return p;}F=this.Slick.parse(z);if(!F.length){return p;}}else{if(z==null){return p;}else{if(z.Slick){F=z;}else{if(this.contains(U.documentElement||U,z)){(p)?p.push(z):p=z; +return p;}else{return p;}}}}this.posNTH={};this.posNTHLast={};this.posNTHType={};this.posNTHTypeLast={};this.push=(!I&&(s||(F.length==1&&F.expressions[0].length==1)))?this.pushArray:this.pushUID; +if(p==null){p=[];}var M,L,K;var B,J,D,c,q,G,W;var N,P,o,w,R=F.expressions;search:for(O=0;(P=R[O]);O++){for(M=0;(o=P[M]);M++){B="combinator:"+o.combinator; +if(!this[B]){continue search;}J=(this.isXMLDocument)?o.tag:o.tag.toUpperCase();D=o.id;c=o.classList;q=o.classes;G=o.attributes;W=o.pseudos;w=(M===(P.length-1)); +this.bitUniques={};if(w){this.uniques=V;this.found=p;}else{this.uniques={};this.found=[];}if(M===0){this[B](U,J,D,q,G,W,c);if(s&&w&&p.length){break search; +}}else{if(s&&w){for(L=0,K=N.length;L1)){this.sort(p);}return(s)?(p[0]||null):p;};j.uidx=1;j.uidk="slick-uniqueid";j.getUIDXML=function(m){var c=m.getAttribute(this.uidk); +if(!c){c=this.uidx++;m.setAttribute(this.uidk,c);}return c;};j.getUIDHTML=function(c){return c.uniqueNumber||(c.uniqueNumber=this.uidx++);};j.sort=function(c){if(!this.documentSorter){return c; +}c.sort(this.documentSorter);return c;};j.cacheNTH={};j.matchNTH=/^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/;j.parseNTHArgument=function(p){var n=p.match(this.matchNTH); +if(!n){return false;}var o=n[2]||false;var m=n[1]||1;if(m=="-"){m=-1;}var c=+n[3]||0;n=(o=="n")?{a:m,b:c}:(o=="odd")?{a:2,b:1}:(o=="even")?{a:2,b:0}:{a:0,b:m}; +return(this.cacheNTH[p]=n);};j.createNTHPseudo=function(o,m,c,n){return function(r,p){var t=this.getUID(r);if(!this[c][t]){var z=r.parentNode;if(!z){return false; +}var q=z[o],s=1;if(n){var y=r.nodeName;do{if(q.nodeName!=y){continue;}this[c][this.getUID(q)]=s++;}while((q=q[m]));}else{do{if(q.nodeType!=1){continue; +}this[c][this.getUID(q)]=s++;}while((q=q[m]));}}p=p||"n";var u=this.cacheNTH[p]||this.parseNTHArgument(p);if(!u){return false;}var x=u.a,w=u.b,v=this[c][t]; +if(x==0){return w==v;}if(x>0){if(v":function(o,c,q,n,m,p){if((o=o.firstChild)){do{if(o.nodeType==1){this.push(o,c,q,n,m,p); +}}while((o=o.nextSibling));}},"+":function(o,c,q,n,m,p){while((o=o.nextSibling)){if(o.nodeType==1){this.push(o,c,q,n,m,p);break;}}},"^":function(o,c,q,n,m,p){o=o.firstChild; +if(o){if(o.nodeType==1){this.push(o,c,q,n,m,p);}else{this["combinator:+"](o,c,q,n,m,p);}}},"~":function(p,c,r,o,m,q){while((p=p.nextSibling)){if(p.nodeType!=1){continue; +}var n=this.getUID(p);if(this.bitUniques[n]){break;}this.bitUniques[n]=true;this.push(p,c,r,o,m,q);}},"++":function(o,c,q,n,m,p){this["combinator:+"](o,c,q,n,m,p); +this["combinator:!+"](o,c,q,n,m,p);},"~~":function(o,c,q,n,m,p){this["combinator:~"](o,c,q,n,m,p);this["combinator:!~"](o,c,q,n,m,p);},"!":function(o,c,q,n,m,p){while((o=o.parentNode)){if(o!==this.document){this.push(o,c,q,n,m,p); +}}},"!>":function(o,c,q,n,m,p){o=o.parentNode;if(o!==this.document){this.push(o,c,q,n,m,p);}},"!+":function(o,c,q,n,m,p){while((o=o.previousSibling)){if(o.nodeType==1){this.push(o,c,q,n,m,p); +break;}}},"!^":function(o,c,q,n,m,p){o=o.lastChild;if(o){if(o.nodeType==1){this.push(o,c,q,n,m,p);}else{this["combinator:!+"](o,c,q,n,m,p);}}},"!~":function(p,c,r,o,m,q){while((p=p.previousSibling)){if(p.nodeType!=1){continue; +}var n=this.getUID(p);if(this.bitUniques[n]){break;}this.bitUniques[n]=true;this.push(p,c,r,o,m,q);}}};for(var h in i){j["combinator:"+h]=i[h];}var k={empty:function(c){var m=c.firstChild; +return !(m&&m.nodeType==1)&&!(c.innerText||c.textContent||"").length;},not:function(c,m){return !this.matchNode(c,m);},contains:function(c,m){return(c.innerText||c.textContent||"").indexOf(m)>-1; +},"first-child":function(c){while((c=c.previousSibling)){if(c.nodeType==1){return false;}}return true;},"last-child":function(c){while((c=c.nextSibling)){if(c.nodeType==1){return false; +}}return true;},"only-child":function(n){var m=n;while((m=m.previousSibling)){if(m.nodeType==1){return false;}}var c=n;while((c=c.nextSibling)){if(c.nodeType==1){return false; +}}return true;},"nth-child":j.createNTHPseudo("firstChild","nextSibling","posNTH"),"nth-last-child":j.createNTHPseudo("lastChild","previousSibling","posNTHLast"),"nth-of-type":j.createNTHPseudo("firstChild","nextSibling","posNTHType",true),"nth-last-of-type":j.createNTHPseudo("lastChild","previousSibling","posNTHTypeLast",true),index:function(m,c){return this["pseudo:nth-child"](m,""+c+1); +},even:function(c){return this["pseudo:nth-child"](c,"2n");},odd:function(c){return this["pseudo:nth-child"](c,"2n+1");},"first-of-type":function(c){var m=c.nodeName; +while((c=c.previousSibling)){if(c.nodeName==m){return false;}}return true;},"last-of-type":function(c){var m=c.nodeName;while((c=c.nextSibling)){if(c.nodeName==m){return false; +}}return true;},"only-of-type":function(n){var m=n,o=n.nodeName;while((m=m.previousSibling)){if(m.nodeName==o){return false;}}var c=n;while((c=c.nextSibling)){if(c.nodeName==o){return false; +}}return true;},enabled:function(c){return !c.disabled;},disabled:function(c){return c.disabled;},checked:function(c){return c.checked||c.selected;},focus:function(c){return this.isHTMLDocument&&this.document.activeElement===c&&(c.href||c.type||this.hasAttribute(c,"tabindex")); +},root:function(c){return(c===this.root);},selected:function(c){return c.selected;}};for(var a in k){j["pseudo:"+a]=k[a];}j.attributeGetters={"class":function(){return this.getAttribute("class")||this.className; +},"for":function(){return("htmlFor" in this)?this.htmlFor:this.getAttribute("for");},href:function(){return("href" in this)?this.getAttribute("href",2):this.getAttribute("href"); +},style:function(){return(this.style)?this.style.cssText:this.getAttribute("style");},tabindex:function(){var c=this.getAttributeNode("tabindex");return(c&&c.specified)?c.nodeValue:null; +},type:function(){return this.getAttribute("type");}};var d=j.Slick=(this.Slick||{});d.version="1.1.5";d.search=function(m,n,c){return j.search(m,n,c); +};d.find=function(c,m){return j.search(c,m,null,true);};d.contains=function(c,m){j.setDocument(c);return j.contains(c,m);};d.getAttribute=function(m,c){return j.getAttribute(m,c); +};d.match=function(m,c){if(!(m&&c)){return false;}if(!c||c===m){return true;}j.setDocument(m);return j.matchNode(m,c);};d.defineAttributeGetter=function(c,m){j.attributeGetters[c]=m; +return this;};d.lookupAttributeGetter=function(c){return j.attributeGetters[c];};d.definePseudo=function(c,m){j["pseudo:"+c]=function(o,n){return m.call(o,n); +};return this;};d.lookupPseudo=function(c){var m=j["pseudo:"+c];if(m){return function(n){return m.call(this,n);};}return null;};d.override=function(m,c){j.override(m,c); +return this;};d.isXML=j.isXML;d.uidOf=function(c){return j.getUIDHTML(c);};if(!this.Slick){this.Slick=d;}}).apply((typeof exports!="undefined")?exports:this); +var Element=function(b,g){var h=Element.Constructors[b];if(h){return h(g);}if(typeof b!="string"){return document.id(b).set(g);}if(!g){g={};}if(!(/^[\w-]+$/).test(b)){var e=Slick.parse(b).expressions[0][0]; +b=(e.tag=="*")?"div":e.tag;if(e.id&&g.id==null){g.id=e.id;}var d=e.attributes;if(d){for(var f=0,c=d.length;f=this.length){delete this[e--];}return this; +}.protect());}Elements.implement(Array.prototype);Array.mirror(Elements);var f;try{var a=document.createElement("");f=(a.name=="x");}catch(c){}var d=function(e){return(""+e).replace(/&/g,"&").replace(/"/g,"""); +};Document.implement({newElement:function(e,h){if(h&&h.checked!=null){h.defaultChecked=h.checked;}if(f&&h){e="<"+e;if(h.name){e+=' name="'+d(h.name)+'"'; +}if(h.type){e+=' type="'+d(h.type)+'"';}e+=">";delete h.name;delete h.type;}return this.id(this.createElement(e)).set(h);}});})();Document.implement({newTextNode:function(a){return this.createTextNode(a); +},getDocument:function(){return this;},getWindow:function(){return this.window;},id:(function(){var a={string:function(d,c,b){d=Slick.find(b,"#"+d.replace(/(\W)/g,"\\$1")); +return(d)?a.element(d,c):null;},element:function(b,c){$uid(b);if(!c&&!b.$family&&!(/^(?:object|embed)$/i).test(b.tagName)){Object.append(b,Element.Prototype); +}return b;},object:function(c,d,b){if(c.toElement){return a.element(c.toElement(b),d);}return null;}};a.textnode=a.whitespace=a.window=a.document=function(b){return b; +};return function(c,e,d){if(c&&c.$family&&c.uid){return c;}var b=typeOf(c);return(a[b])?a[b](c,e,d||document):null;};})()});if(window.$==null){Window.implement("$",function(a,b){return document.id(a,b,this.document); +});}Window.implement({getDocument:function(){return this.document;},getWindow:function(){return this;}});[Document,Element].invoke("implement",{getElements:function(a){return Slick.search(this,a,new Elements); +},getElement:function(a){return document.id(Slick.find(this,a));}});if(window.$$==null){Window.implement("$$",function(a){if(arguments.length==1){if(typeof a=="string"){return Slick.search(this.document,a,new Elements); +}else{if(Type.isEnumerable(a)){return new Elements(a);}}}return new Elements(arguments);});}(function(){var k={},i={};var n={input:"checked",option:"selected",textarea:"value"}; +var e=function(p){return(i[p]||(i[p]={}));};var j=function(q){var p=q.uid;if(q.removeEvents){q.removeEvents();}if(q.clearAttributes){q.clearAttributes(); +}if(p!=null){delete k[p];delete i[p];}return q;};var o=["defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"]; +var d=["compact","nowrap","ismap","declare","noshade","checked","disabled","readOnly","multiple","selected","noresize","defer","defaultChecked"];var g={html:"innerHTML","class":"className","for":"htmlFor",text:(function(){var p=document.createElement("div"); +return(p.textContent==null)?"innerText":"textContent";})()};var m=["type"];var h=["value","defaultValue"];var l=/^(?:href|src|usemap)$/i;d=d.associate(d); +o=o.associate(o.map(String.toLowerCase));m=m.associate(m);Object.append(g,h.associate(h));var c={before:function(q,p){var r=p.parentNode;if(r){r.insertBefore(q,p); +}},after:function(q,p){var r=p.parentNode;if(r){r.insertBefore(q,p.nextSibling);}},bottom:function(q,p){p.appendChild(q);},top:function(q,p){p.insertBefore(q,p.firstChild); +}};c.inside=c.bottom;var b=function(s,r){if(!s){return r;}s=Object.clone(Slick.parse(s));var q=s.expressions;for(var p=q.length;p--;){q[p][0].combinator=r; +}return s;};Element.implement({set:function(r,q){var p=Element.Properties[r];(p&&p.set)?p.set.call(this,q):this.setProperty(r,q);}.overloadSetter(),get:function(q){var p=Element.Properties[q]; +return(p&&p.get)?p.get.apply(this):this.getProperty(q);}.overloadGetter(),erase:function(q){var p=Element.Properties[q];(p&&p.erase)?p.erase.apply(this):this.removeProperty(q); +return this;},setProperty:function(q,r){q=o[q]||q;if(r==null){return this.removeProperty(q);}var p=g[q];(p)?this[p]=r:(d[q])?this[q]=!!r:this.setAttribute(q,""+r); +return this;},setProperties:function(p){for(var q in p){this.setProperty(q,p[q]);}return this;},getProperty:function(q){q=o[q]||q;var p=g[q]||m[q];return(p)?this[p]:(d[q])?!!this[q]:(l.test(q)?this.getAttribute(q,2):(p=this.getAttributeNode(q))?p.nodeValue:null)||null; +},getProperties:function(){var p=Array.from(arguments);return p.map(this.getProperty,this).associate(p);},removeProperty:function(q){q=o[q]||q;var p=g[q]; +(p)?this[p]="":(d[q])?this[q]=false:this.removeAttribute(q);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this; +},hasClass:function(p){return this.className.clean().contains(p," ");},addClass:function(p){if(!this.hasClass(p)){this.className=(this.className+" "+p).clean(); +}return this;},removeClass:function(p){this.className=this.className.replace(new RegExp("(^|\\s)"+p+"(?:\\s|$)"),"$1");return this;},toggleClass:function(p,q){if(q==null){q=!this.hasClass(p); +}return(q)?this.addClass(p):this.removeClass(p);},adopt:function(){var s=this,p,u=Array.flatten(arguments),t=u.length;if(t>1){s=p=document.createDocumentFragment(); +}for(var r=0;r"))[0]);},getLast:function(p){return document.id(Slick.search(this,b(p,">")).getLast()); +},getParent:function(p){return document.id(Slick.find(this,b(p,"!")));},getParents:function(p){return Slick.search(this,b(p,"!"),new Elements);},getSiblings:function(p){return Slick.search(this,b(p,"~~"),new Elements); +},getChildren:function(p){return Slick.search(this,b(p,">"),new Elements);},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument; +},getElementById:function(p){return document.id(Slick.find(this,"#"+(""+p).replace(/(\W)/g,"\\$1")));},getSelected:function(){this.selectedIndex;return new Elements(Array.from(this.options).filter(function(p){return p.selected; +}));},toQueryString:function(){var p=[];this.getElements("input, select, textarea").each(function(r){var q=r.type;if(!r.name||r.disabled||q=="submit"||q=="reset"||q=="file"||q=="image"){return; +}var s=(r.get("tag")=="select")?r.getSelected().map(function(t){return document.id(t).get("value");}):((q=="radio"||q=="checkbox")&&!r.checked)?null:r.get("value"); +Array.from(s).each(function(t){if(typeof t!="undefined"){p.push(encodeURIComponent(r.name)+"="+encodeURIComponent(t));}});});return p.join("&");},destroy:function(){var p=j(this).getElementsByTagName("*"); +Array.each(p,j);Element.dispose(this);return null;},empty:function(){Array.from(this.childNodes).each(Element.dispose);return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this; +},match:function(p){return !p||Slick.match(this,p);}});var a=function(t,s,q){if(!q){t.setAttributeNode(document.createAttribute("id"));}if(t.clearAttributes){t.clearAttributes(); +t.mergeAttributes(s);t.removeAttribute("uid");if(t.options){var u=t.options,p=s.options;for(var r=u.length;r--;){u[r].selected=p[r].selected;}}}var v=n[s.tagName.toLowerCase()]; +if(v&&s[v]){t[v]=s[v];}};Element.implement("clone",function(r,p){r=r!==false;var w=this.cloneNode(r),q;if(r){var s=w.getElementsByTagName("*"),u=this.getElementsByTagName("*"); +for(q=s.length;q--;){a(s[q],u[q],p);}}a(w,this,p);if(Browser.ie){var t=w.getElementsByTagName("object"),v=this.getElementsByTagName("object");for(q=t.length; +q--;){t[q].outerHTML=v[q].outerHTML;}}return document.id(w);});var f={contains:function(p){return Slick.contains(this,p);}};if(!document.contains){Document.implement(f); +}if(!document.createElement("div").contains){Element.implement(f);}[Element,Window,Document].invoke("implement",{addListener:function(s,r){if(s=="unload"){var p=r,q=this; +r=function(){q.removeListener("unload",r);p();};}else{k[$uid(this)]=this;}if(this.addEventListener){this.addEventListener(s,r,!!arguments[2]);}else{this.attachEvent("on"+s,r); +}return this;},removeListener:function(q,p){if(this.removeEventListener){this.removeEventListener(q,p,!!arguments[2]);}else{this.detachEvent("on"+q,p); +}return this;},retrieve:function(q,p){var s=e($uid(this)),r=s[q];if(p!=null&&r==null){r=s[q]=p;}return r!=null?r:null;},store:function(q,p){var r=e($uid(this)); +r[q]=p;return this;},eliminate:function(p){var q=e($uid(this));delete q[p];return this;}});if(window.attachEvent&&!window.addEventListener){window.addListener("unload",function(){Object.each(k,j); +if(window.CollectGarbage){CollectGarbage();}});}})();Element.Properties={};Element.Properties.style={set:function(a){this.style.cssText=a;},get:function(){return this.style.cssText; +},erase:function(){this.style.cssText="";}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase();}};(function(a){if(a!=null){Element.Properties.maxlength=Element.Properties.maxLength={get:function(){var b=this.getAttribute("maxLength"); +return b==a?null:b;}};}})(document.createElement("input").getAttribute("maxLength"));Element.Properties.html=(function(){var c=Function.attempt(function(){var e=document.createElement("table"); +e.innerHTML="";});var d=document.createElement("div");var a={table:[1,"","
"],select:[1,""],tbody:[2,"","
"],tr:[3,"","
"]}; +a.thead=a.tfoot=a.tbody;var b={set:function(){var f=Array.flatten(arguments).join("");var g=(!c&&a[this.get("tag")]);if(g){var h=d;h.innerHTML=g[1]+f+g[2]; +for(var e=g[0];e--;){h=h.firstChild;}this.empty().adopt(h.childNodes);}else{this.innerHTML=f;}}};b.erase=b.set;return b;})();(function(){var c=document.html; +Element.Properties.styles={set:function(f){this.setStyles(f);}};var e=(c.style.opacity!=null);var d=/alpha\(opacity=([\d.]+)\)/i;var b=function(g,f){if(!g.currentStyle||!g.currentStyle.hasLayout){g.style.zoom=1; +}if(e){g.style.opacity=f;}else{f=(f*100).limit(0,100).round();f=(f==100)?"":"alpha(opacity="+f+")";var h=g.style.filter||g.getComputedStyle("filter")||""; +g.style.filter=d.test(h)?h.replace(d,f):h+f;}};Element.Properties.opacity={set:function(g){var f=this.style.visibility;if(g==0&&f!="hidden"){this.style.visibility="hidden"; +}else{if(g!=0&&f!="visible"){this.style.visibility="visible";}}b(this,g);},get:(e)?function(){var f=this.style.opacity||this.getComputedStyle("opacity"); +return(f=="")?1:f;}:function(){var f,g=(this.style.filter||this.getComputedStyle("filter"));if(g){f=g.match(d);}return(f==null||g==null)?1:(f[1]/100);}}; +var a=(c.style.cssFloat==null)?"styleFloat":"cssFloat";Element.implement({getComputedStyle:function(h){if(this.currentStyle){return this.currentStyle[h.camelCase()]; +}var g=Element.getDocument(this).defaultView,f=g?g.getComputedStyle(this,null):null;return(f)?f.getPropertyValue((h==a)?"float":h.hyphenate()):null;},setOpacity:function(f){b(this,f); +return this;},getOpacity:function(){return this.get("opacity");},setStyle:function(g,f){switch(g){case"opacity":return this.set("opacity",parseFloat(f)); +case"float":g=a;}g=g.camelCase();if(typeOf(f)!="string"){var h=(Element.Styles[g]||"@").split(" ");f=Array.from(f).map(function(k,j){if(!h[j]){return""; +}return(typeOf(k)=="number")?h[j].replace("@",Math.round(k)):k;}).join(" ");}else{if(f==String(Number(f))){f=Math.round(f);}}this.style[g]=f;return this; +},getStyle:function(l){switch(l){case"opacity":return this.get("opacity");case"float":l=a;}l=l.camelCase();var f=this.style[l];if(!f||l=="zIndex"){f=[]; +for(var k in Element.ShortStyles){if(l!=k){continue;}for(var j in Element.ShortStyles[k]){f.push(this.getStyle(j));}return f.join(" ");}f=this.getComputedStyle(l); +}if(f){f=String(f);var h=f.match(/rgba?\([\d\s,]+\)/);if(h){f=f.replace(h[0],h[0].rgbToHex());}}if(Browser.opera||(Browser.ie&&isNaN(parseFloat(f)))){if((/^(height|width)$/).test(l)){var g=(l=="width")?["left","right"]:["top","bottom"],i=0; +g.each(function(m){i+=this.getStyle("border-"+m+"-width").toInt()+this.getStyle("padding-"+m).toInt();},this);return this["offset"+l.capitalize()]-i+"px"; +}if(Browser.opera&&String(f).indexOf("px")!=-1){return f;}if((/^border(.+)Width|margin|padding/).test(l)){return"0px";}}return f;},setStyles:function(g){for(var f in g){this.setStyle(f,g[f]); +}return this;},getStyles:function(){var f={};Array.flatten(arguments).each(function(g){f[g]=this.getStyle(g);},this);return f;}});Element.Styles={left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"}; +Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(l){var k=Element.ShortStyles; +var g=Element.Styles;["margin","padding"].each(function(m){var n=m+l;k[m][n]=g[n]="@px";});var j="border"+l;k.border[j]=g[j]="@px @ rgb(@, @, @)";var i=j+"Width",f=j+"Style",h=j+"Color"; +k[j]={};k.borderWidth[i]=k[j][i]=g[i]="@px";k.borderStyle[f]=k[j][f]=g[f]="@";k.borderColor[h]=k[j][h]=g[h]="rgb(@, @, @)";});})();(function(){Element.Properties.events={set:function(b){this.addEvents(b); +}};[Element,Window,Document].invoke("implement",{addEvent:function(f,h){var i=this.retrieve("events",{});if(!i[f]){i[f]={keys:[],values:[]};}if(i[f].keys.contains(h)){return this; +}i[f].keys.push(h);var g=f,b=Element.Events[f],d=h,j=this;if(b){if(b.onAdd){b.onAdd.call(this,h);}if(b.condition){d=function(k){if(b.condition.call(this,k)){return h.call(this,k); +}return true;};}g=b.base||g;}var e=function(){return h.call(j);};var c=Element.NativeEvents[g];if(c){if(c==2){e=function(k){k=new Event(k,j.getWindow()); +if(d.call(j,k)===false){k.stop();}};}this.addListener(g,e,arguments[2]);}i[f].values.push(e);return this;},removeEvent:function(e,d){var c=this.retrieve("events"); +if(!c||!c[e]){return this;}var h=c[e];var b=h.keys.indexOf(d);if(b==-1){return this;}var g=h.values[b];delete h.keys[b];delete h.values[b];var f=Element.Events[e]; +if(f){if(f.onRemove){f.onRemove.call(this,d);}e=f.base||e;}return(Element.NativeEvents[e])?this.removeListener(e,g,arguments[2]):this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]); +}return this;},removeEvents:function(b){var d;if(typeOf(b)=="object"){for(d in b){this.removeEvent(d,b[d]);}return this;}var c=this.retrieve("events"); +if(!c){return this;}if(!b){for(d in c){this.removeEvents(d);}this.eliminate("events");}else{if(c[b]){c[b].keys.each(function(e){this.removeEvent(b,e);},this); +delete c[b];}}return this;},fireEvent:function(e,c,b){var d=this.retrieve("events");if(!d||!d[e]){return this;}c=Array.from(c);d[e].keys.each(function(f){if(b){f.delay(b,this,c); +}else{f.apply(this,c);}},this);return this;},cloneEvents:function(e,d){e=document.id(e);var c=e.retrieve("events");if(!c){return this;}if(!d){for(var b in c){this.cloneEvents(e,b); +}}else{if(c[d]){c[d].keys.each(function(f){this.addEvent(d,f);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,orientationchange:2,touchstart:2,touchmove:2,touchend:2,touchcancel:2,gesturestart:2,gesturechange:2,gestureend:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:2,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}; +var a=function(b){var c=b.relatedTarget;if(c==null){return true;}if(!c){return false;}return(c!=this&&c.prefix!="xul"&&typeOf(this)!="document"&&!this.contains(c)); +};Element.Events={mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.firefox)?"DOMMouseScroll":"mousewheel"}}; +})();(function(){var h=document.createElement("div"),e=document.createElement("div");h.style.height="0";h.appendChild(e);var d=(e.offsetParent===h);h=e=null; +var l=function(m){return k(m,"position")!="static"||a(m);};var i=function(m){return l(m)||(/^(?:table|td|th)$/i).test(m.tagName);};Element.implement({scrollTo:function(m,n){if(a(this)){this.getWindow().scrollTo(m,n); +}else{this.scrollLeft=m;this.scrollTop=n;}return this;},getSize:function(){if(a(this)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight}; +},getScrollSize:function(){if(a(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(a(this)){return this.getWindow().getScroll(); +}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var n=this.parentNode,m={x:0,y:0};while(n&&!a(n)){m.x+=n.scrollLeft;m.y+=n.scrollTop; +n=n.parentNode;}return m;},getOffsetParent:d?function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null;}var n=(k(m,"position")=="static")?i:l; +while((m=m.parentNode)){if(n(m)){return m;}}return null;}:function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null;}try{return m.offsetParent; +}catch(n){}return null;},getOffsets:function(){if(this.getBoundingClientRect&&!Browser.Platform.ios){var r=this.getBoundingClientRect(),o=document.id(this.getDocument().documentElement),q=o.getScroll(),t=this.getScrolls(),s=(k(this,"position")=="fixed"); +return{x:r.left.toInt()+t.x+((s)?0:q.x)-o.clientLeft,y:r.top.toInt()+t.y+((s)?0:q.y)-o.clientTop};}var n=this,m={x:0,y:0};if(a(this)){return m;}while(n&&!a(n)){m.x+=n.offsetLeft; +m.y+=n.offsetTop;if(Browser.firefox){if(!c(n)){m.x+=b(n);m.y+=g(n);}var p=n.parentNode;if(p&&k(p,"overflow")!="visible"){m.x+=b(p);m.y+=g(p);}}else{if(n!=this&&Browser.safari){m.x+=b(n); +m.y+=g(n);}}n=n.offsetParent;}if(Browser.firefox&&!c(this)){m.x-=b(this);m.y-=g(this);}return m;},getPosition:function(p){if(a(this)){return{x:0,y:0};}var q=this.getOffsets(),n=this.getScrolls(); +var m={x:q.x-n.x,y:q.y-n.y};if(p&&(p=document.id(p))){var o=p.getPosition();return{x:m.x-o.x-b(p),y:m.y-o.y-g(p)};}return m;},getCoordinates:function(o){if(a(this)){return this.getWindow().getCoordinates(); +}var m=this.getPosition(o),n=this.getSize();var p={left:m.x,top:m.y,width:n.x,height:n.y};p.right=p.left+p.width;p.bottom=p.top+p.height;return p;},computePosition:function(m){return{left:m.x-j(this,"margin-left"),top:m.y-j(this,"margin-top")}; +},setPosition:function(m){return this.setStyles(this.computePosition(m));}});[Document,Window].invoke("implement",{getSize:function(){var m=f(this);return{x:m.clientWidth,y:m.clientHeight}; +},getScroll:function(){var n=this.getWindow(),m=f(this);return{x:n.pageXOffset||m.scrollLeft,y:n.pageYOffset||m.scrollTop};},getScrollSize:function(){var o=f(this),n=this.getSize(),m=this.getDocument().body; +return{x:Math.max(o.scrollWidth,m.scrollWidth,n.x),y:Math.max(o.scrollHeight,m.scrollHeight,n.y)};},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var m=this.getSize(); +return{top:0,left:0,bottom:m.y,right:m.x,height:m.y,width:m.x};}});var k=Element.getComputedStyle;function j(m,n){return k(m,n).toInt()||0;}function c(m){return k(m,"-moz-box-sizing")=="border-box"; +}function g(m){return j(m,"border-top-width");}function b(m){return j(m,"border-left-width");}function a(m){return(/^(?:body|html)$/i).test(m.tagName); +}function f(m){var n=m.getDocument();return(!n.compatMode||n.compatMode=="CSS1Compat")?n.html:n.body;}})();Element.alias({position:"setPosition"});[Window,Document,Element].invoke("implement",{getHeight:function(){return this.getSize().y; +},getWidth:function(){return this.getSize().x;},getScrollTop:function(){return this.getScroll().y;},getScrollLeft:function(){return this.getScroll().x; +},getScrollHeight:function(){return this.getScrollSize().y;},getScrollWidth:function(){return this.getScrollSize().x;},getTop:function(){return this.getPosition().y; +},getLeft:function(){return this.getPosition().x;}});(function(){var f=this.Fx=new Class({Implements:[Chain,Events,Options],options:{fps:60,unit:false,duration:500,frames:null,frameSkip:true,link:"ignore"},initialize:function(g){this.subject=this.subject||this; +this.setOptions(g);},getTransition:function(){return function(g){return -(Math.cos(Math.PI*g)-1)/2;};},step:function(g){if(this.options.frameSkip){var h=(this.time!=null)?(g-this.time):0,i=h/this.frameInterval; +this.time=g;this.frame+=i;}else{this.frame++;}if(this.frame=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2);break;}}return e; +},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a&&a[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,a+2); +});});(function(){var d=function(){},a=("onprogress" in new Browser.Request);var c=this.Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,timeout:0,noCache:false},initialize:function(e){this.xhr=new Browser.Request(); +this.setOptions(e);this.headers=this.options.headers;},onStateChange:function(){var e=this.xhr;if(e.readyState!=4||!this.running){return;}this.running=false; +this.status=0;Function.attempt(function(){var f=e.status;this.status=(f==1223)?204:f;}.bind(this));e.onreadystatechange=d;if(a){e.onprogress=e.onloadstart=d; +}clearTimeout(this.timer);this.response={text:this.xhr.responseText||"",xml:this.xhr.responseXML};if(this.options.isSuccess.call(this,this.status)){this.success(this.response.text,this.response.xml); +}else{this.failure();}},isSuccess:function(){var e=this.status;return(e>=200&&e<300);},isRunning:function(){return !!this.running;},processScripts:function(e){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return Browser.exec(e); +}return e.stripScripts(this.options.evalScripts);},success:function(f,e){this.onSuccess(this.processScripts(f),e);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain(); +},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},loadstart:function(e){this.fireEvent("loadstart",[e,this.xhr]); +},progress:function(e){this.fireEvent("progress",[e,this.xhr]);},timeout:function(){this.fireEvent("timeout",this.xhr);},setHeader:function(e,f){this.headers[e]=f; +return this;},getHeader:function(e){return Function.attempt(function(){return this.xhr.getResponseHeader(e);}.bind(this));},check:function(){if(!this.running){return true; +}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.pass(arguments,this));return false;}return false;},send:function(o){if(!this.check(o)){return this; +}this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.running=true;var l=typeOf(o);if(l=="string"||l=="element"){o={data:o};}var h=this.options; +o=Object.append({data:h.data,url:h.url,method:h.method},o);var j=o.data,f=String(o.url),e=o.method.toLowerCase();switch(typeOf(j)){case"element":j=document.id(j).toQueryString(); +break;case"object":case"hash":j=Object.toQueryString(j);}if(this.options.format){var m="format="+this.options.format;j=(j)?m+"&"+j:m;}if(this.options.emulation&&!["get","post"].contains(e)){var k="_method="+e; +j=(j)?k+"&"+j:k;e="post";}if(this.options.urlEncoded&&["post","put"].contains(e)){var g=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers["Content-type"]="application/x-www-form-urlencoded"+g; +}if(!f){f=document.location.pathname;}var i=f.lastIndexOf("/");if(i>-1&&(i=f.indexOf("#"))>-1){f=f.substr(0,i);}if(this.options.noCache){f+=(f.contains("?")?"&":"?")+String.uniqueID(); +}if(j&&e=="get"){f+=(f.contains("?")?"&":"?")+j;j=null;}var n=this.xhr;if(a){n.onloadstart=this.loadstart.bind(this);n.onprogress=this.progress.bind(this); +}n.open(e.toUpperCase(),f,this.options.async,this.options.user,this.options.password);if(this.options.user&&"withCredentials" in n){n.withCredentials=true; +}n.onreadystatechange=this.onStateChange.bind(this);Object.each(this.headers,function(q,p){try{n.setRequestHeader(p,q);}catch(r){this.fireEvent("exception",[p,q]); +}},this);this.fireEvent("request");n.send(j);if(!this.options.async){this.onStateChange();}if(this.options.timeout){this.timer=this.timeout.delay(this.options.timeout,this); +}return this;},cancel:function(){if(!this.running){return this;}this.running=false;var e=this.xhr;e.abort();clearTimeout(this.timer);e.onreadystatechange=d; +if(a){e.onprogress=e.onloadstart=d;}this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});var b={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(e){b[e]=function(g){var f={method:e}; +if(g!=null){f.data=g;}return this.send(f);};});c.implement(b);Element.Properties.send={set:function(e){var f=this.get("send").cancel();f.setOptions(e); +return this;},get:function(){var e=this.retrieve("send");if(!e){e=new c({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")}); +this.store("send",e);}return e;}};Element.implement({send:function(e){var f=this.get("send");f.send({data:this,url:e||f.options.url});return this;}});})(); +Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false,headers:{Accept:"text/html, application/xml, text/xml, */*"}},success:function(e){var d=this.options,b=this.response; +b.html=e.stripScripts(function(f){b.javascript=f;});var c=b.html.match(/]*>([\s\S]*?)<\/body>/i);if(c){b.html=c[1];}var a=new Element("div").set("html",b.html); +b.tree=a.childNodes;b.elements=a.getElements("*");if(d.filter){b.tree=b.elements.filter(d.filter);}if(d.update){document.id(d.update).empty().set("html",b.html); +}else{if(d.append){document.id(d.append).adopt(a.getChildren());}}if(d.evalScripts){Browser.exec(b.javascript);}this.onSuccess(b.tree,b.elements,b.html,b.javascript); +}});Element.Properties.load={set:function(a){var b=this.get("load").cancel();b.setOptions(a);return this;},get:function(){var a=this.retrieve("load");if(!a){a=new Request.HTML({data:this,link:"cancel",update:this,method:"get"}); +this.store("load",a);}return a;}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Type.isObject,url:Type.isString})); +return this;}});if(typeof JSON=="undefined"){this.JSON={};}(function(){var special={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"}; +var escape=function(chr){return special[chr]||"\\u"+("0000"+chr.charCodeAt(0).toString(16)).slice(-4);};JSON.validate=function(string){string=string.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""); +return(/^[\],:{}\s]*$/).test(string);};JSON.encode=JSON.stringify?function(obj){return JSON.stringify(obj);}:function(obj){if(obj&&obj.toJSON){obj=obj.toJSON(); +}switch(typeOf(obj)){case"string":return'"'+obj.replace(/[\x00-\x1f\\"]/g,escape)+'"';case"array":return"["+obj.map(JSON.encode).clean()+"]";case"object":case"hash":var string=[]; +Object.each(obj,function(value,key){var json=JSON.encode(value);if(json){string.push(JSON.encode(key)+":"+json);}});return"{"+string+"}";case"number":case"boolean":return""+obj; +case"null":return"null";}return null;};JSON.decode=function(string,secure){if(!string||typeOf(string)!="string"){return null;}if(secure||JSON.secure){if(JSON.parse){return JSON.parse(string); +}if(!JSON.validate(string)){throw new Error("JSON could not decode the input; security is enabled and the value is not secure.");}}return eval("("+string+")"); +};})();Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a);Object.append(this.headers,{Accept:"application/json","X-Request":"JSON"}); +},success:function(c){var b;try{b=this.response.json=JSON.decode(c,this.options.secure);}catch(a){this.fireEvent("error",[c,a]);return;}if(b==null){this.onFailure(); +}else{this.onSuccess(b,c);}}});var Cookie=new Class({Implements:Options,options:{path:"/",domain:false,duration:false,secure:false,document:document,encode:true},initialize:function(b,a){this.key=b; +this.setOptions(a);},write:function(b){if(this.options.encode){b=encodeURIComponent(b);}if(this.options.domain){b+="; domain="+this.options.domain;}if(this.options.path){b+="; path="+this.options.path; +}if(this.options.duration){var a=new Date();a.setTime(a.getTime()+this.options.duration*24*60*60*1000);b+="; expires="+a.toGMTString();}if(this.options.secure){b+="; secure"; +}this.options.document.cookie=this.key+"="+b;return this;},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)"); +return(a)?decodeURIComponent(a[1]):null;},dispose:function(){new Cookie(this.key,Object.merge({},this.options,{duration:-1})).write("");return this;}}); +Cookie.write=function(b,c,a){return new Cookie(b,a).write(c);};Cookie.read=function(a){return new Cookie(a).read();};Cookie.dispose=function(b,a){return new Cookie(b,a).dispose(); +};(function(i,k){var l,f,e=[],c,b,d=k.createElement("div");var g=function(){clearTimeout(b);if(l){return;}Browser.loaded=l=true;k.removeListener("DOMContentLoaded",g).removeListener("readystatechange",a); +k.fireEvent("domready");i.fireEvent("domready");};var a=function(){for(var m=e.length;m--;){if(e[m]()){g();return true;}}return false;};var j=function(){clearTimeout(b); +if(!a()){b=setTimeout(j,10);}};k.addListener("DOMContentLoaded",g);var h=function(){try{d.doScroll();return true;}catch(m){}return false;};if(d.doScroll&&!h()){e.push(h); +c=true;}if(k.readyState){e.push(function(){var m=k.readyState;return(m=="loaded"||m=="complete");});}if("onreadystatechange" in k){k.addListener("readystatechange",a); +}else{c=true;}if(c){j();}Element.Events.domready={onAdd:function(m){if(l){m.call(this);}}};Element.Events.load={base:"load",onAdd:function(m){if(f&&this==i){m.call(this); +}},condition:function(){if(this==i){g();delete Element.Events.load;}return true;}};i.addEvent("load",function(){f=true;});})(window,document);(function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"window",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object; +},initialize:function(path,options){this.instance="Swiff_"+String.uniqueID();this.setOptions(options);options=this.options;var id=this.id=options.id||this.instance; +var container=document.id(options.container);Swiff.CallBacks[this.instance]={};var params=options.params,vars=options.vars,callBacks=options.callBacks; +var properties=Object.append({height:options.height,width:options.width},options.properties);var self=this;for(var callBack in callBacks){Swiff.CallBacks[this.instance][callBack]=(function(option){return function(){return option.apply(self.object,arguments); +};})(callBacks[callBack]);vars[callBack]="Swiff.CallBacks."+this.instance+"."+callBack;}params.flashVars=Object.toQueryString(vars);if(Browser.ie){properties.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"; +params.movie=path;}else{properties.type="application/x-shockwave-flash";}properties.data=path;var build='';}}build+="";this.object=((container)?container.empty():new Element("div")).set("html",build).firstChild; +},replaces:function(element){element=document.id(element,true);element.parentNode.replaceChild(this.toElement(),element);return this;},inject:function(element){document.id(element,true).appendChild(this.toElement()); +return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments));}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+""); +return eval(rs);};})(); \ No newline at end of file diff --git a/web/tools/mootools/mootools-more-1.3.2.1-nc.js b/web/tools/mootools/mootools-more-1.3.2.1-nc.js new file mode 100644 index 000000000..4bf490e79 --- /dev/null +++ b/web/tools/mootools/mootools-more-1.3.2.1-nc.js @@ -0,0 +1,10042 @@ +// MooTools: the javascript framework. +// Load this file's selection again by visiting: http://mootools.net/more/09f3e47813269cd5026cbf8c1f828e72 +// Or build this file again with packager using: packager build More/Chain.Wait More/Array.Extras More/Date More/Date.Extras More/Number.Format More/String.Extras More/String.QueryString More/URI More/URI.Relative More/Hash More/Hash.Extras More/Element.Forms More/Elements.From More/Element.Event.Pseudos.Keys More/Element.Pin More/Element.Position More/Element.Shortcuts More/Form.Request More/Form.Request.Append More/Form.Validator.Inline More/Form.Validator.Extras More/OverText More/Fx.Accordion More/Fx.Move More/Fx.Reveal More/Fx.Slide More/Fx.SmoothScroll More/Fx.Sort More/Drag.Move More/Slider More/Sortables More/Request.JSONP More/Request.Queue More/Request.Periodical More/Assets More/Color More/Group More/Hash.Cookie More/Table More/HtmlTable.Zebra More/HtmlTable.Sort More/HtmlTable.Select More/Keyboard.Extras More/Mask More/Scroller More/Tips More/Locale.en-GB.Date +/* +--- + +script: More.js + +name: More + +description: MooTools More + +license: MIT-style license + +authors: + - Guillermo Rauch + - Thomas Aylott + - Scott Kyle + - Arian Stolwijk + - Tim Wienk + - Christoph Pojer + - Aaron Newton + - Jacob Thornton + +requires: + - Core/MooTools + +provides: [MooTools.More] + +... +*/ + +MooTools.More = { + 'version': '1.3.2.1', + 'build': 'e586bcd2496e9b22acfde32e12f84d49ce09e59d' +}; + + +/* +--- + +script: Chain.Wait.js + +name: Chain.Wait + +description: value, Adds a method to inject pauses between chained events. + +license: MIT-style license. + +authors: + - Aaron Newton + +requires: + - Core/Chain + - Core/Element + - Core/Fx + - /MooTools.More + +provides: [Chain.Wait] + +... +*/ + +(function(){ + + var wait = { + wait: function(duration){ + return this.chain(function(){ + this.callChain.delay(duration == null ? 500 : duration, this); + return this; + }.bind(this)); + } + }; + + Chain.implement(wait); + + if (this.Fx) Fx.implement(wait); + + if (this.Element && Element.implement && this.Fx){ + Element.implement({ + + chains: function(effects){ + Array.from(effects || ['tween', 'morph', 'reveal']).each(function(effect){ + effect = this.get(effect); + if (!effect) return; + effect.setOptions({ + link:'chain' + }); + }, this); + return this; + }, + + pauseFx: function(duration, effect){ + this.chains(effect).get(effect || 'tween').wait(duration); + return this; + } + + }); + } + +})(); + + +/* +--- + +script: Array.Extras.js + +name: Array.Extras + +description: Extends the Array native object to include useful methods to work with arrays. + +license: MIT-style license + +authors: + - Christoph Pojer + - Sebastian MarkbÃ¥ge + +requires: + - Core/Array + - MooTools.More + +provides: [Array.Extras] + +... +*/ + +(function(nil){ + +Array.implement({ + + min: function(){ + return Math.min.apply(null, this); + }, + + max: function(){ + return Math.max.apply(null, this); + }, + + average: function(){ + return this.length ? this.sum() / this.length : 0; + }, + + sum: function(){ + var result = 0, l = this.length; + if (l){ + while (l--) result += this[l]; + } + return result; + }, + + unique: function(){ + return [].combine(this); + }, + + shuffle: function(){ + for (var i = this.length; i && --i;){ + var temp = this[i], r = Math.floor(Math.random() * ( i + 1 )); + this[i] = this[r]; + this[r] = temp; + } + return this; + }, + + reduce: function(fn, value){ + for (var i = 0, l = this.length; i < l; i++){ + if (i in this) value = value === nil ? this[i] : fn.call(null, value, this[i], i, this); + } + return value; + }, + + reduceRight: function(fn, value){ + var i = this.length; + while (i--){ + if (i in this) value = value === nil ? this[i] : fn.call(null, value, this[i], i, this); + } + return value; + } + +}); + +})(); + + +/* +--- + +script: Object.Extras.js + +name: Object.Extras + +description: Extra Object generics, like getFromPath which allows a path notation to child elements. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Object + - /MooTools.More + +provides: [Object.Extras] + +... +*/ + +(function(){ + +var defined = function(value){ + return value != null; +}; + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +Object.extend({ + + getFromPath: function(source, parts){ + if (typeof parts == 'string') parts = parts.split('.'); + for (var i = 0, l = parts.length; i < l; i++){ + if (hasOwnProperty.call(source, parts[i])) source = source[parts[i]]; + else return null; + } + return source; + }, + + cleanValues: function(object, method){ + method = method || defined; + for (var key in object) if (!method(object[key])){ + delete object[key]; + } + return object; + }, + + erase: function(object, key){ + if (hasOwnProperty.call(object, key)) delete object[key]; + return object; + }, + + run: function(object){ + var args = Array.slice(arguments, 1); + for (var key in object) if (object[key].apply){ + object[key].apply(object, args); + } + return object; + } + +}); + +})(); + + +/* +--- + +script: Locale.js + +name: Locale + +description: Provides methods for localization. + +license: MIT-style license + +authors: + - Aaron Newton + - Arian Stolwijk + +requires: + - Core/Events + - /Object.Extras + - /MooTools.More + +provides: [Locale, Lang] + +... +*/ + +(function(){ + +var current = null, + locales = {}, + inherits = {}; + +var getSet = function(set){ + if (instanceOf(set, Locale.Set)) return set; + else return locales[set]; +}; + +var Locale = this.Locale = { + + define: function(locale, set, key, value){ + var name; + if (instanceOf(locale, Locale.Set)){ + name = locale.name; + if (name) locales[name] = locale; + } else { + name = locale; + if (!locales[name]) locales[name] = new Locale.Set(name); + locale = locales[name]; + } + + if (set) locale.define(set, key, value); + + + + if (!current) current = locale; + + return locale; + }, + + use: function(locale){ + locale = getSet(locale); + + if (locale){ + current = locale; + + this.fireEvent('change', locale); + + + } + + return this; + }, + + getCurrent: function(){ + return current; + }, + + get: function(key, args){ + return (current) ? current.get(key, args) : ''; + }, + + inherit: function(locale, inherits, set){ + locale = getSet(locale); + + if (locale) locale.inherit(inherits, set); + return this; + }, + + list: function(){ + return Object.keys(locales); + } + +}; + +Object.append(Locale, new Events); + +Locale.Set = new Class({ + + sets: {}, + + inherits: { + locales: [], + sets: {} + }, + + initialize: function(name){ + this.name = name || ''; + }, + + define: function(set, key, value){ + var defineData = this.sets[set]; + if (!defineData) defineData = {}; + + if (key){ + if (typeOf(key) == 'object') defineData = Object.merge(defineData, key); + else defineData[key] = value; + } + this.sets[set] = defineData; + + return this; + }, + + get: function(key, args, _base){ + var value = Object.getFromPath(this.sets, key); + if (value != null){ + var type = typeOf(value); + if (type == 'function') value = value.apply(null, Array.from(args)); + else if (type == 'object') value = Object.clone(value); + return value; + } + + // get value of inherited locales + var index = key.indexOf('.'), + set = index < 0 ? key : key.substr(0, index), + names = (this.inherits.sets[set] || []).combine(this.inherits.locales).include('en-US'); + if (!_base) _base = []; + + for (var i = 0, l = names.length; i < l; i++){ + if (_base.contains(names[i])) continue; + _base.include(names[i]); + + var locale = locales[names[i]]; + if (!locale) continue; + + value = locale.get(key, args, _base); + if (value != null) return value; + } + + return ''; + }, + + inherit: function(names, set){ + names = Array.from(names); + + if (set && !this.inherits.sets[set]) this.inherits.sets[set] = []; + + var l = names.length; + while (l--) (set ? this.inherits.sets[set] : this.inherits.locales).unshift(names[l]); + + return this; + } + +}); + + + +})(); + + +/* +--- + +name: Locale.en-US.Date + +description: Date messages for US English. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - /Locale + +provides: [Locale.en-US.Date] + +... +*/ + +Locale.define('en-US', 'Date', { + + months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + months_abbr: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + days_abbr: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + + // Culture's date order: MM/DD/YYYY + dateOrder: ['month', 'date', 'year'], + shortDate: '%m/%d/%Y', + shortTime: '%I:%M%p', + AM: 'AM', + PM: 'PM', + firstDayOfWeek: 0, + + // Date.Extras + ordinal: function(dayOfMonth){ + // 1st, 2nd, 3rd, etc. + return (dayOfMonth > 3 && dayOfMonth < 21) ? 'th' : ['th', 'st', 'nd', 'rd', 'th'][Math.min(dayOfMonth % 10, 4)]; + }, + + lessThanMinuteAgo: 'less than a minute ago', + minuteAgo: 'about a minute ago', + minutesAgo: '{delta} minutes ago', + hourAgo: 'about an hour ago', + hoursAgo: 'about {delta} hours ago', + dayAgo: '1 day ago', + daysAgo: '{delta} days ago', + weekAgo: '1 week ago', + weeksAgo: '{delta} weeks ago', + monthAgo: '1 month ago', + monthsAgo: '{delta} months ago', + yearAgo: '1 year ago', + yearsAgo: '{delta} years ago', + + lessThanMinuteUntil: 'less than a minute from now', + minuteUntil: 'about a minute from now', + minutesUntil: '{delta} minutes from now', + hourUntil: 'about an hour from now', + hoursUntil: 'about {delta} hours from now', + dayUntil: '1 day from now', + daysUntil: '{delta} days from now', + weekUntil: '1 week from now', + weeksUntil: '{delta} weeks from now', + monthUntil: '1 month from now', + monthsUntil: '{delta} months from now', + yearUntil: '1 year from now', + yearsUntil: '{delta} years from now' + +}); + + +/* +--- + +script: Date.js + +name: Date + +description: Extends the Date native object to include methods useful in managing dates. + +license: MIT-style license + +authors: + - Aaron Newton + - Nicholas Barthelemy - https://svn.nbarthelemy.com/date-js/ + - Harald Kirshner - mail [at] digitarald.de; http://digitarald.de + - Scott Kyle - scott [at] appden.com; http://appden.com + +requires: + - Core/Array + - Core/String + - Core/Number + - MooTools.More + - Locale + - Locale.en-US.Date + +provides: [Date] + +... +*/ + +(function(){ + +var Date = this.Date; + +var DateMethods = Date.Methods = { + ms: 'Milliseconds', + year: 'FullYear', + min: 'Minutes', + mo: 'Month', + sec: 'Seconds', + hr: 'Hours' +}; + +['Date', 'Day', 'FullYear', 'Hours', 'Milliseconds', 'Minutes', 'Month', 'Seconds', 'Time', 'TimezoneOffset', + 'Week', 'Timezone', 'GMTOffset', 'DayOfYear', 'LastMonth', 'LastDayOfMonth', 'UTCDate', 'UTCDay', 'UTCFullYear', + 'AMPM', 'Ordinal', 'UTCHours', 'UTCMilliseconds', 'UTCMinutes', 'UTCMonth', 'UTCSeconds', 'UTCMilliseconds'].each(function(method){ + Date.Methods[method.toLowerCase()] = method; +}); + +var pad = function(n, digits, string){ + if (digits == 1) return n; + return n < Math.pow(10, digits - 1) ? (string || '0') + pad(n, digits - 1, string) : n; +}; + +Date.implement({ + + set: function(prop, value){ + prop = prop.toLowerCase(); + var method = DateMethods[prop] && 'set' + DateMethods[prop]; + if (method && this[method]) this[method](value); + return this; + }.overloadSetter(), + + get: function(prop){ + prop = prop.toLowerCase(); + var method = DateMethods[prop] && 'get' + DateMethods[prop]; + if (method && this[method]) return this[method](); + return null; + }.overloadGetter(), + + clone: function(){ + return new Date(this.get('time')); + }, + + increment: function(interval, times){ + interval = interval || 'day'; + times = times != null ? times : 1; + + switch (interval){ + case 'year': + return this.increment('month', times * 12); + case 'month': + var d = this.get('date'); + this.set('date', 1).set('mo', this.get('mo') + times); + return this.set('date', d.min(this.get('lastdayofmonth'))); + case 'week': + return this.increment('day', times * 7); + case 'day': + return this.set('date', this.get('date') + times); + } + + if (!Date.units[interval]) throw new Error(interval + ' is not a supported interval'); + + return this.set('time', this.get('time') + times * Date.units[interval]()); + }, + + decrement: function(interval, times){ + return this.increment(interval, -1 * (times != null ? times : 1)); + }, + + isLeapYear: function(){ + return Date.isLeapYear(this.get('year')); + }, + + clearTime: function(){ + return this.set({hr: 0, min: 0, sec: 0, ms: 0}); + }, + + diff: function(date, resolution){ + if (typeOf(date) == 'string') date = Date.parse(date); + + return ((date - this) / Date.units[resolution || 'day'](3, 3)).round(); // non-leap year, 30-day month + }, + + getLastDayOfMonth: function(){ + return Date.daysInMonth(this.get('mo'), this.get('year')); + }, + + getDayOfYear: function(){ + return (Date.UTC(this.get('year'), this.get('mo'), this.get('date') + 1) + - Date.UTC(this.get('year'), 0, 1)) / Date.units.day(); + }, + + setDay: function(day, firstDayOfWeek){ + if (firstDayOfWeek == null){ + firstDayOfWeek = Date.getMsg('firstDayOfWeek'); + if (firstDayOfWeek === '') firstDayOfWeek = 1; + } + + day = (7 + Date.parseDay(day, true) - firstDayOfWeek) % 7; + var currentDay = (7 + this.get('day') - firstDayOfWeek) % 7; + + return this.increment('day', day - currentDay); + }, + + getWeek: function(firstDayOfWeek){ + if (firstDayOfWeek == null){ + firstDayOfWeek = Date.getMsg('firstDayOfWeek'); + if (firstDayOfWeek === '') firstDayOfWeek = 1; + } + + var date = this, + dayOfWeek = (7 + date.get('day') - firstDayOfWeek) % 7, + dividend = 0, + firstDayOfYear; + + if (firstDayOfWeek == 1){ + // ISO-8601, week belongs to year that has the most days of the week (i.e. has the thursday of the week) + var month = date.get('month'), + startOfWeek = date.get('date') - dayOfWeek; + + if (month == 11 && startOfWeek > 28) return 1; // Week 1 of next year + + if (month == 0 && startOfWeek < -2){ + // Use a date from last year to determine the week + date = new Date(date).decrement('day', dayOfWeek); + dayOfWeek = 0; + } + + firstDayOfYear = new Date(date.get('year'), 0, 1).get('day') || 7; + if (firstDayOfYear > 4) dividend = -7; // First week of the year is not week 1 + } else { + // In other cultures the first week of the year is always week 1 and the last week always 53 or 54. + // Days in the same week can have a different weeknumber if the week spreads across two years. + firstDayOfYear = new Date(date.get('year'), 0, 1).get('day'); + } + + dividend += date.get('dayofyear'); + dividend += 6 - dayOfWeek; // Add days so we calculate the current date's week as a full week + dividend += (7 + firstDayOfYear - firstDayOfWeek) % 7; // Make up for first week of the year not being a full week + + return (dividend / 7); + }, + + getOrdinal: function(day){ + return Date.getMsg('ordinal', day || this.get('date')); + }, + + getTimezone: function(){ + return this.toString() + .replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/, '$1') + .replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/, '$1$2$3'); + }, + + getGMTOffset: function(){ + var off = this.get('timezoneOffset'); + return ((off > 0) ? '-' : '+') + pad((off.abs() / 60).floor(), 2) + pad(off % 60, 2); + }, + + setAMPM: function(ampm){ + ampm = ampm.toUpperCase(); + var hr = this.get('hr'); + if (hr > 11 && ampm == 'AM') return this.decrement('hour', 12); + else if (hr < 12 && ampm == 'PM') return this.increment('hour', 12); + return this; + }, + + getAMPM: function(){ + return (this.get('hr') < 12) ? 'AM' : 'PM'; + }, + + parse: function(str){ + this.set('time', Date.parse(str)); + return this; + }, + + isValid: function(date){ + return !isNaN((date || this).valueOf()); + }, + + format: function(f){ + if (!this.isValid()) return 'invalid date'; + if (!f) f = '%x %X'; + + var formatLower = f.toLowerCase(); + if (formatters[formatLower]) return formatters[formatLower](this); // it's a formatter! + f = formats[formatLower] || f; // replace short-hand with actual format + + var d = this; + return f.replace(/%([a-z%])/gi, + function($0, $1){ + switch ($1){ + case 'a': return Date.getMsg('days_abbr')[d.get('day')]; + case 'A': return Date.getMsg('days')[d.get('day')]; + case 'b': return Date.getMsg('months_abbr')[d.get('month')]; + case 'B': return Date.getMsg('months')[d.get('month')]; + case 'c': return d.format('%a %b %d %H:%M:%S %Y'); + case 'd': return pad(d.get('date'), 2); + case 'e': return pad(d.get('date'), 2, ' '); + case 'H': return pad(d.get('hr'), 2); + case 'I': return pad((d.get('hr') % 12) || 12, 2); + case 'j': return pad(d.get('dayofyear'), 3); + case 'k': return pad(d.get('hr'), 2, ' '); + case 'l': return pad((d.get('hr') % 12) || 12, 2, ' '); + case 'L': return pad(d.get('ms'), 3); + case 'm': return pad((d.get('mo') + 1), 2); + case 'M': return pad(d.get('min'), 2); + case 'o': return d.get('ordinal'); + case 'p': return Date.getMsg(d.get('ampm')); + case 's': return Math.round(d / 1000); + case 'S': return pad(d.get('seconds'), 2); + case 'T': return d.format('%H:%M:%S'); + case 'U': return pad(d.get('week'), 2); + case 'w': return d.get('day'); + case 'x': return d.format(Date.getMsg('shortDate')); + case 'X': return d.format(Date.getMsg('shortTime')); + case 'y': return d.get('year').toString().substr(2); + case 'Y': return d.get('year'); + case 'z': return d.get('GMTOffset'); + case 'Z': return d.get('Timezone'); + } + return $1; + } + ); + }, + + toISOString: function(){ + return this.format('iso8601'); + } + +}).alias({ + toJSON: 'toISOString', + compare: 'diff', + strftime: 'format' +}); + +var formats = { + db: '%Y-%m-%d %H:%M:%S', + compact: '%Y%m%dT%H%M%S', + 'short': '%d %b %H:%M', + 'long': '%B %d, %Y %H:%M' +}; + +// The day and month abbreviations are standardized, so we cannot use simply %a and %b because they will get localized +var rfcDayAbbr = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + rfcMonthAbbr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + +var formatters = { + rfc822: function(date){ + return rfcDayAbbr[date.get('day')] + date.format(', %d ') + rfcMonthAbbr[date.get('month')] + date.format(' %Y %H:%M:%S %Z'); + }, + rfc2822: function(date){ + return rfcDayAbbr[date.get('day')] + date.format(', %d ') + rfcMonthAbbr[date.get('month')] + date.format(' %Y %H:%M:%S %z'); + }, + iso8601: function(date){ + return ( + date.getUTCFullYear() + '-' + + pad(date.getUTCMonth() + 1, 2) + '-' + + pad(date.getUTCDate(), 2) + 'T' + + pad(date.getUTCHours(), 2) + ':' + + pad(date.getUTCMinutes(), 2) + ':' + + pad(date.getUTCSeconds(), 2) + '.' + + pad(date.getUTCMilliseconds(), 3) + 'Z' + ); + } +}; + + +var parsePatterns = [], + nativeParse = Date.parse; + +var parseWord = function(type, word, num){ + var ret = -1, + translated = Date.getMsg(type + 's'); + switch (typeOf(word)){ + case 'object': + ret = translated[word.get(type)]; + break; + case 'number': + ret = translated[word]; + if (!ret) throw new Error('Invalid ' + type + ' index: ' + word); + break; + case 'string': + var match = translated.filter(function(name){ + return this.test(name); + }, new RegExp('^' + word, 'i')); + if (!match.length) throw new Error('Invalid ' + type + ' string'); + if (match.length > 1) throw new Error('Ambiguous ' + type); + ret = match[0]; + } + + return (num) ? translated.indexOf(ret) : ret; +}; + +var startCentury = 1900, + startYear = 70; + +Date.extend({ + + getMsg: function(key, args){ + return Locale.get('Date.' + key, args); + }, + + units: { + ms: Function.from(1), + second: Function.from(1000), + minute: Function.from(60000), + hour: Function.from(3600000), + day: Function.from(86400000), + week: Function.from(608400000), + month: function(month, year){ + var d = new Date; + return Date.daysInMonth(month != null ? month : d.get('mo'), year != null ? year : d.get('year')) * 86400000; + }, + year: function(year){ + year = year || new Date().get('year'); + return Date.isLeapYear(year) ? 31622400000 : 31536000000; + } + }, + + daysInMonth: function(month, year){ + return [31, Date.isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; + }, + + isLeapYear: function(year){ + return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0); + }, + + parse: function(from){ + var t = typeOf(from); + if (t == 'number') return new Date(from); + if (t != 'string') return from; + from = from.clean(); + if (!from.length) return null; + + var parsed; + parsePatterns.some(function(pattern){ + var bits = pattern.re.exec(from); + return (bits) ? (parsed = pattern.handler(bits)) : false; + }); + + if (!(parsed && parsed.isValid())){ + parsed = new Date(nativeParse(from)); + if (!(parsed && parsed.isValid())) parsed = new Date(from.toInt()); + } + return parsed; + }, + + parseDay: function(day, num){ + return parseWord('day', day, num); + }, + + parseMonth: function(month, num){ + return parseWord('month', month, num); + }, + + parseUTC: function(value){ + var localDate = new Date(value); + var utcSeconds = Date.UTC( + localDate.get('year'), + localDate.get('mo'), + localDate.get('date'), + localDate.get('hr'), + localDate.get('min'), + localDate.get('sec'), + localDate.get('ms') + ); + return new Date(utcSeconds); + }, + + orderIndex: function(unit){ + return Date.getMsg('dateOrder').indexOf(unit) + 1; + }, + + defineFormat: function(name, format){ + formats[name] = format; + return this; + }, + + defineFormats: function(formats){ + for (var name in formats) Date.defineFormat(name, formats[name]); + return this; + }, + + + + defineParser: function(pattern){ + parsePatterns.push((pattern.re && pattern.handler) ? pattern : build(pattern)); + return this; + }, + + defineParsers: function(){ + Array.flatten(arguments).each(Date.defineParser); + return this; + }, + + define2DigitYearStart: function(year){ + startYear = year % 100; + startCentury = year - startYear; + return this; + } + +}); + +var regexOf = function(type){ + return new RegExp('(?:' + Date.getMsg(type).map(function(name){ + return name.substr(0, 3); + }).join('|') + ')[a-z]*'); +}; + +var replacers = function(key){ + switch (key){ + case 'T': + return '%H:%M:%S'; + case 'x': // iso8601 covers yyyy-mm-dd, so just check if month is first + return ((Date.orderIndex('month') == 1) ? '%m[-./]%d' : '%d[-./]%m') + '([-./]%y)?'; + case 'X': + return '%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?'; + } + return null; +}; + +var keys = { + d: /[0-2]?[0-9]|3[01]/, + H: /[01]?[0-9]|2[0-3]/, + I: /0?[1-9]|1[0-2]/, + M: /[0-5]?\d/, + s: /\d+/, + o: /[a-z]*/, + p: /[ap]\.?m\.?/, + y: /\d{2}|\d{4}/, + Y: /\d{4}/, + z: /Z|[+-]\d{2}(?::?\d{2})?/ +}; + +keys.m = keys.I; +keys.S = keys.M; + +var currentLanguage; + +var recompile = function(language){ + currentLanguage = language; + + keys.a = keys.A = regexOf('days'); + keys.b = keys.B = regexOf('months'); + + parsePatterns.each(function(pattern, i){ + if (pattern.format) parsePatterns[i] = build(pattern.format); + }); +}; + +var build = function(format){ + if (!currentLanguage) return {format: format}; + + var parsed = []; + var re = (format.source || format) // allow format to be regex + .replace(/%([a-z])/gi, + function($0, $1){ + return replacers($1) || $0; + } + ).replace(/\((?!\?)/g, '(?:') // make all groups non-capturing + .replace(/ (?!\?|\*)/g, ',? ') // be forgiving with spaces and commas + .replace(/%([a-z%])/gi, + function($0, $1){ + var p = keys[$1]; + if (!p) return $1; + parsed.push($1); + return '(' + p.source + ')'; + } + ).replace(/\[a-z\]/gi, '[a-z\\u00c0-\\uffff;\&]'); // handle unicode words + + return { + format: format, + re: new RegExp('^' + re + '$', 'i'), + handler: function(bits){ + bits = bits.slice(1).associate(parsed); + var date = new Date().clearTime(), + year = bits.y || bits.Y; + + if (year != null) handle.call(date, 'y', year); // need to start in the right year + if ('d' in bits) handle.call(date, 'd', 1); + if ('m' in bits || bits.b || bits.B) handle.call(date, 'm', 1); + + for (var key in bits) handle.call(date, key, bits[key]); + return date; + } + }; +}; + +var handle = function(key, value){ + if (!value) return this; + + switch (key){ + case 'a': case 'A': return this.set('day', Date.parseDay(value, true)); + case 'b': case 'B': return this.set('mo', Date.parseMonth(value, true)); + case 'd': return this.set('date', value); + case 'H': case 'I': return this.set('hr', value); + case 'm': return this.set('mo', value - 1); + case 'M': return this.set('min', value); + case 'p': return this.set('ampm', value.replace(/\./g, '')); + case 'S': return this.set('sec', value); + case 's': return this.set('ms', ('0.' + value) * 1000); + case 'w': return this.set('day', value); + case 'Y': return this.set('year', value); + case 'y': + value = +value; + if (value < 100) value += startCentury + (value < startYear ? 100 : 0); + return this.set('year', value); + case 'z': + if (value == 'Z') value = '+00'; + var offset = value.match(/([+-])(\d{2}):?(\d{2})?/); + offset = (offset[1] + '1') * (offset[2] * 60 + (+offset[3] || 0)) + this.getTimezoneOffset(); + return this.set('time', this - offset * 60000); + } + + return this; +}; + +Date.defineParsers( + '%Y([-./]%m([-./]%d((T| )%X)?)?)?', // "1999-12-31", "1999-12-31 11:59pm", "1999-12-31 23:59:59", ISO8601 + '%Y%m%d(T%H(%M%S?)?)?', // "19991231", "19991231T1159", compact + '%x( %X)?', // "12/31", "12.31.99", "12-31-1999", "12/31/2008 11:59 PM" + '%d%o( %b( %Y)?)?( %X)?', // "31st", "31st December", "31 Dec 1999", "31 Dec 1999 11:59pm" + '%b( %d%o)?( %Y)?( %X)?', // Same as above with month and day switched + '%Y %b( %d%o( %X)?)?', // Same as above with year coming first + '%o %b %d %X %z %Y', // "Thu Oct 22 08:11:23 +0000 2009" + '%T', // %H:%M:%S + '%H:%M( ?%p)?' // "11:05pm", "11:05 am" and "11:05" +); + +Locale.addEvent('change', function(language){ + if (Locale.get('Date')) recompile(language); +}).fireEvent('change', Locale.getCurrent()); + +})(); + + +/* +--- + +script: Date.Extras.js + +name: Date.Extras + +description: Extends the Date native object to include extra methods (on top of those in Date.js). + +license: MIT-style license + +authors: + - Aaron Newton + - Scott Kyle + +requires: + - /Date + +provides: [Date.Extras] + +... +*/ + +Date.implement({ + + timeDiffInWords: function(to){ + return Date.distanceOfTimeInWords(this, to || new Date); + }, + + timeDiff: function(to, separator){ + if (to == null) to = new Date; + var delta = ((to - this) / 1000).floor().abs(); + + var vals = [], + durations = [60, 60, 24, 365, 0], + names = ['s', 'm', 'h', 'd', 'y'], + value, duration; + + for (var item = 0; item < durations.length; item++){ + if (item && !delta) break; + value = delta; + if ((duration = durations[item])){ + value = (delta % duration); + delta = (delta / duration).floor(); + } + vals.unshift(value + (names[item] || '')); + } + + return vals.join(separator || ':'); + } + +}).extend({ + + distanceOfTimeInWords: function(from, to){ + return Date.getTimePhrase(((to - from) / 1000).toInt()); + }, + + getTimePhrase: function(delta){ + var suffix = (delta < 0) ? 'Until' : 'Ago'; + if (delta < 0) delta *= -1; + + var units = { + minute: 60, + hour: 60, + day: 24, + week: 7, + month: 52 / 12, + year: 12, + eon: Infinity + }; + + var msg = 'lessThanMinute'; + + for (var unit in units){ + var interval = units[unit]; + if (delta < 1.5 * interval){ + if (delta > 0.75 * interval) msg = unit; + break; + } + delta /= interval; + msg = unit + 's'; + } + + delta = delta.round(); + return Date.getMsg(msg + suffix, delta).substitute({delta: delta}); + } + +}).defineParsers( + + { + // "today", "tomorrow", "yesterday" + re: /^(?:tod|tom|yes)/i, + handler: function(bits){ + var d = new Date().clearTime(); + switch (bits[0]){ + case 'tom': return d.increment(); + case 'yes': return d.decrement(); + default: return d; + } + } + }, + + { + // "next Wednesday", "last Thursday" + re: /^(next|last) ([a-z]+)$/i, + handler: function(bits){ + var d = new Date().clearTime(); + var day = d.getDay(); + var newDay = Date.parseDay(bits[2], true); + var addDays = newDay - day; + if (newDay <= day) addDays += 7; + if (bits[1] == 'last') addDays -= 7; + return d.set('date', d.getDate() + addDays); + } + } + +).alias('timeAgoInWords', 'timeDiffInWords'); + + +/* +--- + +name: Locale.en-US.Number + +description: Number messages for US English. + +license: MIT-style license + +authors: + - Arian Stolwijk + +requires: + - /Locale + +provides: [Locale.en-US.Number] + +... +*/ + +Locale.define('en-US', 'Number', { + + decimal: '.', + group: ',', + +/* Commented properties are the defaults for Number.format + decimals: 0, + precision: 0, + scientific: null, + + prefix: null, + suffic: null, + + // Negative/Currency/percentage will mixin Number + negative: { + prefix: '-' + },*/ + + currency: { +// decimals: 2, + prefix: '$ ' + }/*, + + percentage: { + decimals: 2, + suffix: '%' + }*/ + +}); + + + + +/* +--- +name: Number.Format +description: Extends the Number Type object to include a number formatting method. +license: MIT-style license +authors: [Arian Stolwijk] +requires: [Core/Number, Locale.en-US.Number] +# Number.Extras is for compatibility +provides: [Number.Format, Number.Extras] +... +*/ + + +Number.implement({ + + format: function(options){ + // Thanks dojo and YUI for some inspiration + var value = this; + options = options ? Object.clone(options) : {}; + var getOption = function(key){ + if (options[key] != null) return options[key]; + return Locale.get('Number.' + key); + }; + + var negative = value < 0, + decimal = getOption('decimal'), + precision = getOption('precision'), + group = getOption('group'), + decimals = getOption('decimals'); + + if (negative){ + var negativeLocale = getOption('negative') || {}; + if (negativeLocale.prefix == null && negativeLocale.suffix == null) negativeLocale.prefix = '-'; + ['prefix', 'suffix'].each(function(key){ + if (negativeLocale[key]) options[key] = getOption(key) + negativeLocale[key]; + }); + + value = -value; + } + + var prefix = getOption('prefix'), + suffix = getOption('suffix'); + + if (decimals !== '' && decimals >= 0 && decimals <= 20) value = value.toFixed(decimals); + if (precision >= 1 && precision <= 21) value = (+value).toPrecision(precision); + + value += ''; + var index; + if (getOption('scientific') === false && value.indexOf('e') > -1){ + var match = value.split('e'), + zeros = +match[1]; + value = match[0].replace('.', ''); + + if (zeros < 0){ + zeros = -zeros - 1; + index = match[0].indexOf('.'); + if (index > -1) zeros -= index - 1; + while (zeros--) value = '0' + value; + value = '0.' + value; + } else { + index = match[0].lastIndexOf('.'); + if (index > -1) zeros -= match[0].length - index - 1; + while (zeros--) value += '0'; + } + } + + if (decimal != '.') value = value.replace('.', decimal); + + if (group){ + index = value.lastIndexOf(decimal); + index = (index > -1) ? index : value.length; + var newOutput = value.substring(index), + i = index; + + while (i--){ + if ((index - i - 1) % 3 == 0 && i != (index - 1)) newOutput = group + newOutput; + newOutput = value.charAt(i) + newOutput; + } + + value = newOutput; + } + + if (prefix) value = prefix + value; + if (suffix) value += suffix; + + return value; + }, + + formatCurrency: function(){ + var locale = Locale.get('Number.currency') || {}; + if (locale.scientific == null) locale.scientific = false; + if (locale.decimals == null) locale.decimals = 2; + + return this.format(locale); + }, + + formatPercentage: function(){ + var locale = Locale.get('Number.percentage') || {}; + if (locale.suffix == null) locale.suffix = '%'; + if (locale.decimals == null) locale.decimals = 2; + + return this.format(locale); + } + +}); + + +/* +--- + +script: String.Extras.js + +name: String.Extras + +description: Extends the String native object to include methods useful in managing various kinds of strings (query strings, urls, html, etc). + +license: MIT-style license + +authors: + - Aaron Newton + - Guillermo Rauch + - Christopher Pitt + +requires: + - Core/String + - Core/Array + - MooTools.More + +provides: [String.Extras] + +... +*/ + +(function(){ + +var special = { + 'a': /[àáâãäåăą]/g, + 'A': /[ÀÃÂÃÄÅĂĄ]/g, + 'c': /[ćÄç]/g, + 'C': /[ĆČÇ]/g, + 'd': /[ÄÄ‘]/g, + 'D': /[ÄŽÃ]/g, + 'e': /[èéêëěę]/g, + 'E': /[ÈÉÊËĚĘ]/g, + 'g': /[ÄŸ]/g, + 'G': /[Äž]/g, + 'i': /[ìíîï]/g, + 'I': /[ÃŒÃÃŽÃ]/g, + 'l': /[ĺľł]/g, + 'L': /[ĹĽÅ]/g, + 'n': /[ñňń]/g, + 'N': /[ÑŇŃ]/g, + 'o': /[òóôõöøő]/g, + 'O': /[ÒÓÔÕÖØ]/g, + 'r': /[řŕ]/g, + 'R': /[ŘŔ]/g, + 's': /[Å¡Å¡ÅŸ]/g, + 'S': /[ŠŞŚ]/g, + 't': /[ťţ]/g, + 'T': /[ŤŢ]/g, + 'ue': /[ü]/g, + 'UE': /[Ãœ]/g, + 'u': /[ùúûůµ]/g, + 'U': /[ÙÚÛŮ]/g, + 'y': /[ÿý]/g, + 'Y': /[ŸÃ]/g, + 'z': /[žźż]/g, + 'Z': /[ŽŹŻ]/g, + 'th': /[þ]/g, + 'TH': /[Þ]/g, + 'dh': /[ð]/g, + 'DH': /[Ã]/g, + 'ss': /[ß]/g, + 'oe': /[Å“]/g, + 'OE': /[Å’]/g, + 'ae': /[æ]/g, + 'AE': /[Æ]/g +}, + +tidy = { + ' ': /[\xa0\u2002\u2003\u2009]/g, + '*': /[\xb7]/g, + '\'': /[\u2018\u2019]/g, + '"': /[\u201c\u201d]/g, + '...': /[\u2026]/g, + '-': /[\u2013]/g, +// '--': /[\u2014]/g, + '»': /[\uFFFD]/g +}; + +var walk = function(string, replacements){ + var result = string, key; + for (key in replacements) result = result.replace(replacements[key], key); + return result; +}; + +var getRegexForTag = function(tag, contents){ + tag = tag || ''; + var regstr = contents ? "<" + tag + "(?!\\w)[^>]*>([\\s\\S]*?)<\/" + tag + "(?!\\w)>" : "<\/?" + tag + "([^>]+)?>", + reg = new RegExp(regstr, "gi"); + return reg; +}; + +String.implement({ + + standardize: function(){ + return walk(this, special); + }, + + repeat: function(times){ + return new Array(times + 1).join(this); + }, + + pad: function(length, str, direction){ + if (this.length >= length) return this; + + var pad = (str == null ? ' ' : '' + str) + .repeat(length - this.length) + .substr(0, length - this.length); + + if (!direction || direction == 'right') return this + pad; + if (direction == 'left') return pad + this; + + return pad.substr(0, (pad.length / 2).floor()) + this + pad.substr(0, (pad.length / 2).ceil()); + }, + + getTags: function(tag, contents){ + return this.match(getRegexForTag(tag, contents)) || []; + }, + + stripTags: function(tag, contents){ + return this.replace(getRegexForTag(tag, contents), ''); + }, + + tidy: function(){ + return walk(this, tidy); + }, + + truncate: function(max, trail, atChar){ + var string = this; + if (trail == null && arguments.length == 1) trail = '…'; + if (string.length > max){ + string = string.substring(0, max); + if (atChar){ + var index = string.lastIndexOf(atChar); + if (index != -1) string = string.substr(0, index); + } + if (trail) string += trail; + } + return string; + } + +}); + +})(); + + +/* +--- + +script: String.QueryString.js + +name: String.QueryString + +description: Methods for dealing with URI query strings. + +license: MIT-style license + +authors: + - Sebastian MarkbÃ¥ge + - Aaron Newton + - Lennart Pilon + - Valerio Proietti + +requires: + - Core/Array + - Core/String + - /MooTools.More + +provides: [String.QueryString] + +... +*/ + +String.implement({ + + parseQueryString: function(decodeKeys, decodeValues){ + if (decodeKeys == null) decodeKeys = true; + if (decodeValues == null) decodeValues = true; + + var vars = this.split(/[&;]/), + object = {}; + if (!vars.length) return object; + + vars.each(function(val){ + var index = val.indexOf('=') + 1, + value = index ? val.substr(index) : '', + keys = index ? val.substr(0, index - 1).match(/([^\]\[]+|(\B)(?=\]))/g) : [val], + obj = object; + if (!keys) return; + if (decodeValues) value = decodeURIComponent(value); + keys.each(function(key, i){ + if (decodeKeys) key = decodeURIComponent(key); + var current = obj[key]; + + if (i < keys.length - 1) obj = obj[key] = current || {}; + else if (typeOf(current) == 'array') current.push(value); + else obj[key] = current != null ? [current, value] : value; + }); + }); + + return object; + }, + + cleanQueryString: function(method){ + return this.split('&').filter(function(val){ + var index = val.indexOf('='), + key = index < 0 ? '' : val.substr(0, index), + value = val.substr(index + 1); + + return method ? method.call(null, key, value) : (value || value === 0); + }).join('&'); + } + +}); + + +/* +--- + +script: URI.js + +name: URI + +description: Provides methods useful in managing the window location and uris. + +license: MIT-style license + +authors: + - Sebastian MarkbÃ¥ge + - Aaron Newton + +requires: + - Core/Object + - Core/Class + - Core/Class.Extras + - Core/Element + - /String.QueryString + +provides: [URI] + +... +*/ + +(function(){ + +var toString = function(){ + return this.get('value'); +}; + +var URI = this.URI = new Class({ + + Implements: Options, + + options: { + /*base: false*/ + }, + + regex: /^(?:(\w+):)?(?:\/\/(?:(?:([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)?(\.\.?$|(?:[^?#\/]*\/)*)([^?#]*)(?:\?([^#]*))?(?:#(.*))?/, + parts: ['scheme', 'user', 'password', 'host', 'port', 'directory', 'file', 'query', 'fragment'], + schemes: {http: 80, https: 443, ftp: 21, rtsp: 554, mms: 1755, file: 0}, + + initialize: function(uri, options){ + this.setOptions(options); + var base = this.options.base || URI.base; + if (!uri) uri = base; + + if (uri && uri.parsed) this.parsed = Object.clone(uri.parsed); + else this.set('value', uri.href || uri.toString(), base ? new URI(base) : false); + }, + + parse: function(value, base){ + var bits = value.match(this.regex); + if (!bits) return false; + bits.shift(); + return this.merge(bits.associate(this.parts), base); + }, + + merge: function(bits, base){ + if ((!bits || !bits.scheme) && (!base || !base.scheme)) return false; + if (base){ + this.parts.every(function(part){ + if (bits[part]) return false; + bits[part] = base[part] || ''; + return true; + }); + } + bits.port = bits.port || this.schemes[bits.scheme.toLowerCase()]; + bits.directory = bits.directory ? this.parseDirectory(bits.directory, base ? base.directory : '') : '/'; + return bits; + }, + + parseDirectory: function(directory, baseDirectory){ + directory = (directory.substr(0, 1) == '/' ? '' : (baseDirectory || '/')) + directory; + if (!directory.test(URI.regs.directoryDot)) return directory; + var result = []; + directory.replace(URI.regs.endSlash, '').split('/').each(function(dir){ + if (dir == '..' && result.length > 0) result.pop(); + else if (dir != '.') result.push(dir); + }); + return result.join('/') + '/'; + }, + + combine: function(bits){ + return bits.value || bits.scheme + '://' + + (bits.user ? bits.user + (bits.password ? ':' + bits.password : '') + '@' : '') + + (bits.host || '') + (bits.port && bits.port != this.schemes[bits.scheme] ? ':' + bits.port : '') + + (bits.directory || '/') + (bits.file || '') + + (bits.query ? '?' + bits.query : '') + + (bits.fragment ? '#' + bits.fragment : ''); + }, + + set: function(part, value, base){ + if (part == 'value'){ + var scheme = value.match(URI.regs.scheme); + if (scheme) scheme = scheme[1]; + if (scheme && this.schemes[scheme.toLowerCase()] == null) this.parsed = { scheme: scheme, value: value }; + else this.parsed = this.parse(value, (base || this).parsed) || (scheme ? { scheme: scheme, value: value } : { value: value }); + } else if (part == 'data'){ + this.setData(value); + } else { + this.parsed[part] = value; + } + return this; + }, + + get: function(part, base){ + switch (part){ + case 'value': return this.combine(this.parsed, base ? base.parsed : false); + case 'data' : return this.getData(); + } + return this.parsed[part] || ''; + }, + + go: function(){ + document.location.href = this.toString(); + }, + + toURI: function(){ + return this; + }, + + getData: function(key, part){ + var qs = this.get(part || 'query'); + if (!(qs || qs === 0)) return key ? null : {}; + var obj = qs.parseQueryString(); + return key ? obj[key] : obj; + }, + + setData: function(values, merge, part){ + if (typeof values == 'string'){ + var data = this.getData(); + data[arguments[0]] = arguments[1]; + values = data; + } else if (merge){ + values = Object.merge(this.getData(), values); + } + return this.set(part || 'query', Object.toQueryString(values)); + }, + + clearData: function(part){ + return this.set(part || 'query', ''); + }, + + toString: toString, + valueOf: toString + +}); + +URI.regs = { + endSlash: /\/$/, + scheme: /^(\w+):/, + directoryDot: /\.\/|\.$/ +}; + +URI.base = new URI(Array.from(document.getElements('base[href]', true)).getLast(), {base: document.location}); + +String.implement({ + + toURI: function(options){ + return new URI(this, options); + } + +}); + +})(); + + +/* +--- + +script: Class.Refactor.js + +name: Class.Refactor + +description: Extends a class onto itself with new property, preserving any items attached to the class's namespace. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Class + - /MooTools.More + +# Some modules declare themselves dependent on Class.Refactor +provides: [Class.refactor, Class.Refactor] + +... +*/ + +Class.refactor = function(original, refactors){ + + Object.each(refactors, function(item, name){ + var origin = original.prototype[name]; + origin = (origin && origin.$origin) || origin || function(){}; + original.implement(name, (typeof item == 'function') ? function(){ + var old = this.previous; + this.previous = origin; + var value = item.apply(this, arguments); + this.previous = old; + return value; + } : item); + }); + + return original; + +}; + + +/* +--- + +script: URI.Relative.js + +name: URI.Relative + +description: Extends the URI class to add methods for computing relative and absolute urls. + +license: MIT-style license + +authors: + - Sebastian MarkbÃ¥ge + + +requires: + - /Class.refactor + - /URI + +provides: [URI.Relative] + +... +*/ + +URI = Class.refactor(URI, { + + combine: function(bits, base){ + if (!base || bits.scheme != base.scheme || bits.host != base.host || bits.port != base.port) + return this.previous.apply(this, arguments); + var end = bits.file + (bits.query ? '?' + bits.query : '') + (bits.fragment ? '#' + bits.fragment : ''); + + if (!base.directory) return (bits.directory || (bits.file ? '' : './')) + end; + + var baseDir = base.directory.split('/'), + relDir = bits.directory.split('/'), + path = '', + offset; + + var i = 0; + for (offset = 0; offset < baseDir.length && offset < relDir.length && baseDir[offset] == relDir[offset]; offset++); + for (i = 0; i < baseDir.length - offset - 1; i++) path += '../'; + for (i = offset; i < relDir.length - 1; i++) path += relDir[i] + '/'; + + return (path || (bits.file ? '' : './')) + end; + }, + + toAbsolute: function(base){ + base = new URI(base); + if (base) base.set('directory', '').set('file', ''); + return this.toRelative(base); + }, + + toRelative: function(base){ + return this.get('value', new URI(base)); + } + +}); + + +/* +--- + +name: Hash + +description: Contains Hash Prototypes. Provides a means for overcoming the JavaScript practical impossibility of extending native Objects. + +license: MIT-style license. + +requires: + - Core/Object + - /MooTools.More + +provides: [Hash] + +... +*/ + +(function(){ + +if (this.Hash) return; + +var Hash = this.Hash = new Type('Hash', function(object){ + if (typeOf(object) == 'hash') object = Object.clone(object.getClean()); + for (var key in object) this[key] = object[key]; + return this; +}); + +this.$H = function(object){ + return new Hash(object); +}; + +Hash.implement({ + + forEach: function(fn, bind){ + Object.forEach(this, fn, bind); + }, + + getClean: function(){ + var clean = {}; + for (var key in this){ + if (this.hasOwnProperty(key)) clean[key] = this[key]; + } + return clean; + }, + + getLength: function(){ + var length = 0; + for (var key in this){ + if (this.hasOwnProperty(key)) length++; + } + return length; + } + +}); + +Hash.alias('each', 'forEach'); + +Hash.implement({ + + has: Object.prototype.hasOwnProperty, + + keyOf: function(value){ + return Object.keyOf(this, value); + }, + + hasValue: function(value){ + return Object.contains(this, value); + }, + + extend: function(properties){ + Hash.each(properties || {}, function(value, key){ + Hash.set(this, key, value); + }, this); + return this; + }, + + combine: function(properties){ + Hash.each(properties || {}, function(value, key){ + Hash.include(this, key, value); + }, this); + return this; + }, + + erase: function(key){ + if (this.hasOwnProperty(key)) delete this[key]; + return this; + }, + + get: function(key){ + return (this.hasOwnProperty(key)) ? this[key] : null; + }, + + set: function(key, value){ + if (!this[key] || this.hasOwnProperty(key)) this[key] = value; + return this; + }, + + empty: function(){ + Hash.each(this, function(value, key){ + delete this[key]; + }, this); + return this; + }, + + include: function(key, value){ + if (this[key] == undefined) this[key] = value; + return this; + }, + + map: function(fn, bind){ + return new Hash(Object.map(this, fn, bind)); + }, + + filter: function(fn, bind){ + return new Hash(Object.filter(this, fn, bind)); + }, + + every: function(fn, bind){ + return Object.every(this, fn, bind); + }, + + some: function(fn, bind){ + return Object.some(this, fn, bind); + }, + + getKeys: function(){ + return Object.keys(this); + }, + + getValues: function(){ + return Object.values(this); + }, + + toQueryString: function(base){ + return Object.toQueryString(this, base); + } + +}); + +Hash.alias({indexOf: 'keyOf', contains: 'hasValue'}); + + +})(); + + + +/* +--- + +script: Hash.Extras.js + +name: Hash.Extras + +description: Extends the Hash Type to include getFromPath which allows a path notation to child elements. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - /Hash + - /Object.Extras + +provides: [Hash.Extras] + +... +*/ + +Hash.implement({ + + getFromPath: function(notation){ + return Object.getFromPath(this, notation); + }, + + cleanValues: function(method){ + return new Hash(Object.cleanValues(this, method)); + }, + + run: function(){ + Object.run(arguments); + } + +}); + + +/* +--- + +script: Element.Forms.js + +name: Element.Forms + +description: Extends the Element native object to include methods useful in managing inputs. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Element + - /String.Extras + - /MooTools.More + +provides: [Element.Forms] + +... +*/ + +Element.implement({ + + tidy: function(){ + this.set('value', this.get('value').tidy()); + }, + + getTextInRange: function(start, end){ + return this.get('value').substring(start, end); + }, + + getSelectedText: function(){ + if (this.setSelectionRange) return this.getTextInRange(this.getSelectionStart(), this.getSelectionEnd()); + return document.selection.createRange().text; + }, + + getSelectedRange: function(){ + if (this.selectionStart != null){ + return { + start: this.selectionStart, + end: this.selectionEnd + }; + } + + var pos = { + start: 0, + end: 0 + }; + var range = this.getDocument().selection.createRange(); + if (!range || range.parentElement() != this) return pos; + var duplicate = range.duplicate(); + + if (this.type == 'text'){ + pos.start = 0 - duplicate.moveStart('character', -100000); + pos.end = pos.start + range.text.length; + } else { + var value = this.get('value'); + var offset = value.length; + duplicate.moveToElementText(this); + duplicate.setEndPoint('StartToEnd', range); + if (duplicate.text.length) offset -= value.match(/[\n\r]*$/)[0].length; + pos.end = offset - duplicate.text.length; + duplicate.setEndPoint('StartToStart', range); + pos.start = offset - duplicate.text.length; + } + return pos; + }, + + getSelectionStart: function(){ + return this.getSelectedRange().start; + }, + + getSelectionEnd: function(){ + return this.getSelectedRange().end; + }, + + setCaretPosition: function(pos){ + if (pos == 'end') pos = this.get('value').length; + this.selectRange(pos, pos); + return this; + }, + + getCaretPosition: function(){ + return this.getSelectedRange().start; + }, + + selectRange: function(start, end){ + if (this.setSelectionRange){ + this.focus(); + this.setSelectionRange(start, end); + } else { + var value = this.get('value'); + var diff = value.substr(start, end - start).replace(/\r/g, '').length; + start = value.substr(0, start).replace(/\r/g, '').length; + var range = this.createTextRange(); + range.collapse(true); + range.moveEnd('character', start + diff); + range.moveStart('character', start); + range.select(); + } + return this; + }, + + insertAtCursor: function(value, select){ + var pos = this.getSelectedRange(); + var text = this.get('value'); + this.set('value', text.substring(0, pos.start) + value + text.substring(pos.end, text.length)); + if (select !== false) this.selectRange(pos.start, pos.start + value.length); + else this.setCaretPosition(pos.start + value.length); + return this; + }, + + insertAroundCursor: function(options, select){ + options = Object.append({ + before: '', + defaultMiddle: '', + after: '' + }, options); + + var value = this.getSelectedText() || options.defaultMiddle; + var pos = this.getSelectedRange(); + var text = this.get('value'); + + if (pos.start == pos.end){ + this.set('value', text.substring(0, pos.start) + options.before + value + options.after + text.substring(pos.end, text.length)); + this.selectRange(pos.start + options.before.length, pos.end + options.before.length + value.length); + } else { + var current = text.substring(pos.start, pos.end); + this.set('value', text.substring(0, pos.start) + options.before + current + options.after + text.substring(pos.end, text.length)); + var selStart = pos.start + options.before.length; + if (select !== false) this.selectRange(selStart, selStart + current.length); + else this.setCaretPosition(selStart + text.length); + } + return this; + } + +}); + + +/* +--- + +script: Elements.From.js + +name: Elements.From + +description: Returns a collection of elements from a string of html. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/String + - Core/Element + - /MooTools.More + +provides: [Elements.from, Elements.From] + +... +*/ + +Elements.from = function(text, excludeScripts){ + if (excludeScripts || excludeScripts == null) text = text.stripScripts(); + + var container, match = text.match(/^\s*<(t[dhr]|tbody|tfoot|thead)/i); + + if (match){ + container = new Element('table'); + var tag = match[1].toLowerCase(); + if (['td', 'th', 'tr'].contains(tag)){ + container = new Element('tbody').inject(container); + if (tag != 'tr') container = new Element('tr').inject(container); + } + } + + return (container || new Element('div')).set('html', text).getChildren(); +}; + + +/* +--- + +name: Events.Pseudos + +description: Adds the functionality to add pseudo events + +license: MIT-style license + +authors: + - Arian Stolwijk + +requires: [Core/Class.Extras, Core/Slick.Parser, More/MooTools.More] + +provides: [Events.Pseudos] + +... +*/ + +Events.Pseudos = function(pseudos, addEvent, removeEvent){ + + var storeKey = 'monitorEvents:'; + + var storageOf = function(object){ + return { + store: object.store ? function(key, value){ + object.store(storeKey + key, value); + } : function(key, value){ + (object.$monitorEvents || (object.$monitorEvents = {}))[key] = value; + }, + retrieve: object.retrieve ? function(key, dflt){ + return object.retrieve(storeKey + key, dflt); + } : function(key, dflt){ + if (!object.$monitorEvents) return dflt; + return object.$monitorEvents[key] || dflt; + } + }; + }; + + var splitType = function(type){ + if (type.indexOf(':') == -1 || !pseudos) return null; + + var parsed = Slick.parse(type).expressions[0][0], + parsedPseudos = parsed.pseudos, + l = parsedPseudos.length, + splits = []; + + while (l--) if (pseudos[parsedPseudos[l].key]){ + splits.push({ + event: parsed.tag, + value: parsedPseudos[l].value, + pseudo: parsedPseudos[l].key, + original: type + }); + } + + return splits.length ? splits : null; + }; + + var mergePseudoOptions = function(split){ + return Object.merge.apply(this, split.map(function(item){ + return pseudos[item.pseudo].options || {}; + })); + }; + + return { + + addEvent: function(type, fn, internal){ + var split = splitType(type); + if (!split) return addEvent.call(this, type, fn, internal); + + var storage = storageOf(this), + events = storage.retrieve(type, []), + eventType = split[0].event, + options = mergePseudoOptions(split), + stack = fn, + eventOptions = options[eventType] || {}, + args = Array.slice(arguments, 2), + self = this, + monitor; + + if (eventOptions.args) args.append(Array.from(eventOptions.args)); + if (eventOptions.base) eventType = eventOptions.base; + if (eventOptions.onAdd) eventOptions.onAdd(this); + + split.each(function(item){ + var stackFn = stack; + stack = function(){ + (eventOptions.listener || pseudos[item.pseudo].listener).call(self, item, stackFn, arguments, monitor, options); + }; + }); + monitor = stack.bind(this); + + events.include({event: fn, monitor: monitor}); + storage.store(type, events); + + addEvent.apply(this, [type, fn].concat(args)); + return addEvent.apply(this, [eventType, monitor].concat(args)); + }, + + removeEvent: function(type, fn){ + var split = splitType(type); + if (!split) return removeEvent.call(this, type, fn); + + var storage = storageOf(this), + events = storage.retrieve(type); + if (!events) return this; + + var eventType = split[0].event, + options = mergePseudoOptions(split), + eventOptions = options[eventType] || {}, + args = Array.slice(arguments, 2); + + if (eventOptions.args) args.append(Array.from(eventOptions.args)); + if (eventOptions.base) eventType = eventOptions.base; + if (eventOptions.onRemove) eventOptions.onRemove(this); + + removeEvent.apply(this, [type, fn].concat(args)); + events.each(function(monitor, i){ + if (!fn || monitor.event == fn) removeEvent.apply(this, [eventType, monitor.monitor].concat(args)); + delete events[i]; + }, this); + + storage.store(type, events); + return this; + } + + }; + +}; + +(function(){ + +var pseudos = { + + once: { + listener: function(split, fn, args, monitor){ + fn.apply(this, args); + this.removeEvent(split.event, monitor) + .removeEvent(split.original, fn); + } + }, + + throttle: { + listener: function(split, fn, args){ + if (!fn._throttled){ + fn.apply(this, args); + fn._throttled = setTimeout(function(){ + fn._throttled = false; + }, split.value || 250); + } + } + }, + + pause: { + listener: function(split, fn, args){ + clearTimeout(fn._pause); + fn._pause = fn.delay(split.value || 250, this, args); + } + } + +}; + +Events.definePseudo = function(key, listener){ + pseudos[key] = Type.isFunction(listener) ? {listener: listener} : listener; + return this; +}; + +Events.lookupPseudo = function(key){ + return pseudos[key]; +}; + +var proto = Events.prototype; +Events.implement(Events.Pseudos(pseudos, proto.addEvent, proto.removeEvent)); + +['Request', 'Fx'].each(function(klass){ + if (this[klass]) this[klass].implement(Events.prototype); +}); + +})(); + + +/* +--- + +name: Element.Event.Pseudos + +description: Adds the functionality to add pseudo events for Elements + +license: MIT-style license + +authors: + - Arian Stolwijk + +requires: [Core/Element.Event, Events.Pseudos] + +provides: [Element.Event.Pseudos] + +... +*/ + +(function(){ + +var pseudos = {}, + copyFromEvents = ['once', 'throttle', 'pause'], + count = copyFromEvents.length; + +while (count--) pseudos[copyFromEvents[count]] = Events.lookupPseudo(copyFromEvents[count]); + +Event.definePseudo = function(key, listener){ + pseudos[key] = Type.isFunction(listener) ? {listener: listener} : listener; + return this; +}; + +var proto = Element.prototype; +[Element, Window, Document].invoke('implement', Events.Pseudos(pseudos, proto.addEvent, proto.removeEvent)); + +})(); + + +/* +--- + +name: Element.Event.Pseudos.Keys + +description: Adds functionality fire events if certain keycombinations are pressed + +license: MIT-style license + +authors: + - Arian Stolwijk + +requires: [Element.Event.Pseudos] + +provides: [Element.Event.Pseudos.Keys] + +... +*/ + +(function(){ + +var keysStoreKey = '$moo:keys-pressed', + keysKeyupStoreKey = '$moo:keys-keyup'; + + +Event.definePseudo('keys', function(split, fn, args){ + + var event = args[0], + keys = [], + pressed = this.retrieve(keysStoreKey, []); + + keys.append(split.value.replace('++', function(){ + keys.push('+'); // shift++ and shift+++a + return ''; + }).split('+')); + + pressed.include(event.key); + + if (keys.every(function(key){ + return pressed.contains(key); + })) fn.apply(this, args); + + this.store(keysStoreKey, pressed); + + if (!this.retrieve(keysKeyupStoreKey)){ + var keyup = function(event){ + (function(){ + pressed = this.retrieve(keysStoreKey, []).erase(event.key); + this.store(keysStoreKey, pressed); + }).delay(0, this); // Fix for IE + }; + this.store(keysKeyupStoreKey, keyup).addEvent('keyup', keyup); + } + +}); + +Object.append(Event.Keys, { + 'shift': 16, + 'control': 17, + 'alt': 18, + 'capslock': 20, + 'pageup': 33, + 'pagedown': 34, + 'end': 35, + 'home': 36, + 'numlock': 144, + 'scrolllock': 145, + ';': 186, + '=': 187, + ',': 188, + '-': Browser.firefox ? 109 : 189, + '.': 190, + '/': 191, + '`': 192, + '[': 219, + '\\': 220, + ']': 221, + "'": 222, + '+': 107 +}); + +})(); + + +/* +--- + +script: Element.Pin.js + +name: Element.Pin + +description: Extends the Element native object to include the pin method useful for fixed positioning for elements. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Element.Event + - Core/Element.Dimensions + - Core/Element.Style + - /MooTools.More + +provides: [Element.Pin] + +... +*/ + +(function(){ + var supportsPositionFixed = false, + supportTested = false; + + var testPositionFixed = function(){ + var test = new Element('div').setStyles({ + position: 'fixed', + top: 0, + right: 0 + }).inject(document.body); + supportsPositionFixed = (test.offsetTop === 0); + test.dispose(); + supportTested = true; + }; + + Element.implement({ + + pin: function(enable, forceScroll){ + if (!supportTested) testPositionFixed(); + if (this.getStyle('display') == 'none') return this; + + var pinnedPosition, + scroll = window.getScroll(), + parent, + scrollFixer; + + if (enable !== false){ + pinnedPosition = this.getPosition(supportsPositionFixed ? document.body : this.getOffsetParent()); + if (!this.retrieve('pin:_pinned')){ + var currentPosition = { + top: pinnedPosition.y - scroll.y, + left: pinnedPosition.x - scroll.x + }; + + if (supportsPositionFixed && !forceScroll){ + this.setStyle('position', 'fixed').setStyles(currentPosition); + } else { + + parent = this.getOffsetParent(); + var position = this.getPosition(parent), + styles = this.getStyles('left', 'top'); + + if (parent && styles.left == 'auto' || styles.top == 'auto') this.setPosition(position); + if (this.getStyle('position') == 'static') this.setStyle('position', 'absolute'); + + position = { + x: styles.left.toInt() - scroll.x, + y: styles.top.toInt() - scroll.y + }; + + scrollFixer = function(){ + if (!this.retrieve('pin:_pinned')) return; + var scroll = window.getScroll(); + this.setStyles({ + left: position.x + scroll.x, + top: position.y + scroll.y + }); + }.bind(this); + + this.store('pin:_scrollFixer', scrollFixer); + window.addEvent('scroll', scrollFixer); + } + this.store('pin:_pinned', true); + } + + } else { + if (!this.retrieve('pin:_pinned')) return this; + + parent = this.getParent(); + var offsetParent = (parent.getComputedStyle('position') != 'static' ? parent : parent.getOffsetParent()); + + pinnedPosition = this.getPosition(offsetParent); + + this.store('pin:_pinned', false); + scrollFixer = this.retrieve('pin:_scrollFixer'); + if (!scrollFixer){ + this.setStyles({ + position: 'absolute', + top: pinnedPosition.y + scroll.y, + left: pinnedPosition.x + scroll.x + }); + } else { + this.store('pin:_scrollFixer', null); + window.removeEvent('scroll', scrollFixer); + } + this.removeClass('isPinned'); + } + return this; + }, + + unpin: function(){ + return this.pin(false); + }, + + togglePin: function(){ + return this.pin(!this.retrieve('pin:_pinned')); + } + + }); + + + +})(); + + +/* +--- + +script: Element.Measure.js + +name: Element.Measure + +description: Extends the Element native object to include methods useful in measuring dimensions. + +credits: "Element.measure / .expose methods by Daniel Steigerwald License: MIT-style license. Copyright: Copyright (c) 2008 Daniel Steigerwald, daniel.steigerwald.cz" + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Element.Style + - Core/Element.Dimensions + - /MooTools.More + +provides: [Element.Measure] + +... +*/ + +(function(){ + +var getStylesList = function(styles, planes){ + var list = []; + Object.each(planes, function(directions){ + Object.each(directions, function(edge){ + styles.each(function(style){ + list.push(style + '-' + edge + (style == 'border' ? '-width' : '')); + }); + }); + }); + return list; +}; + +var calculateEdgeSize = function(edge, styles){ + var total = 0; + Object.each(styles, function(value, style){ + if (style.test(edge)) total = total + value.toInt(); + }); + return total; +}; + +var isVisible = function(el){ + return !!(!el || el.offsetHeight || el.offsetWidth); +}; + + +Element.implement({ + + measure: function(fn){ + if (isVisible(this)) return fn.call(this); + var parent = this.getParent(), + toMeasure = []; + while (!isVisible(parent) && parent != document.body){ + toMeasure.push(parent.expose()); + parent = parent.getParent(); + } + var restore = this.expose(), + result = fn.call(this); + restore(); + toMeasure.each(function(restore){ + restore(); + }); + return result; + }, + + expose: function(){ + if (this.getStyle('display') != 'none') return function(){}; + var before = this.style.cssText; + this.setStyles({ + display: 'block', + position: 'absolute', + visibility: 'hidden' + }); + return function(){ + this.style.cssText = before; + }.bind(this); + }, + + getDimensions: function(options){ + options = Object.merge({computeSize: false}, options); + var dim = {x: 0, y: 0}; + + var getSize = function(el, options){ + return (options.computeSize) ? el.getComputedSize(options) : el.getSize(); + }; + + var parent = this.getParent('body'); + + if (parent && this.getStyle('display') == 'none'){ + dim = this.measure(function(){ + return getSize(this, options); + }); + } else if (parent){ + try { //safari sometimes crashes here, so catch it + dim = getSize(this, options); + }catch(e){} + } + + return Object.append(dim, (dim.x || dim.x === 0) ? { + width: dim.x, + height: dim.y + } : { + x: dim.width, + y: dim.height + } + ); + }, + + getComputedSize: function(options){ + + + options = Object.merge({ + styles: ['padding','border'], + planes: { + height: ['top','bottom'], + width: ['left','right'] + }, + mode: 'both' + }, options); + + var styles = {}, + size = {width: 0, height: 0}, + dimensions; + + if (options.mode == 'vertical'){ + delete size.width; + delete options.planes.width; + } else if (options.mode == 'horizontal'){ + delete size.height; + delete options.planes.height; + } + + getStylesList(options.styles, options.planes).each(function(style){ + styles[style] = this.getStyle(style).toInt(); + }, this); + + Object.each(options.planes, function(edges, plane){ + + var capitalized = plane.capitalize(), + style = this.getStyle(plane); + + if (style == 'auto' && !dimensions) dimensions = this.getDimensions(); + + style = styles[plane] = (style == 'auto') ? dimensions[plane] : style.toInt(); + size['total' + capitalized] = style; + + edges.each(function(edge){ + var edgesize = calculateEdgeSize(edge, styles); + size['computed' + edge.capitalize()] = edgesize; + size['total' + capitalized] += edgesize; + }); + + }, this); + + return Object.append(size, styles); + } + +}); + +})(); + + +/* +--- + +script: Element.Position.js + +name: Element.Position + +description: Extends the Element native object to include methods useful positioning elements relative to others. + +license: MIT-style license + +authors: + - Aaron Newton + - Jacob Thornton + +requires: + - Core/Options + - Core/Element.Dimensions + - Element.Measure + +provides: [Element.Position] + +... +*/ + +(function(original){ + +var local = Element.Position = { + + options: {/* + edge: false, + returnPos: false, + minimum: {x: 0, y: 0}, + maximum: {x: 0, y: 0}, + relFixedPosition: false, + ignoreMargins: false, + ignoreScroll: false, + allowNegative: false,*/ + relativeTo: document.body, + position: { + x: 'center', //left, center, right + y: 'center' //top, center, bottom + }, + offset: {x: 0, y: 0} + }, + + getOptions: function(element, options){ + options = Object.merge({}, local.options, options); + local.setPositionOption(options); + local.setEdgeOption(options); + local.setOffsetOption(element, options); + local.setDimensionsOption(element, options); + return options; + }, + + setPositionOption: function(options){ + options.position = local.getCoordinateFromValue(options.position); + }, + + setEdgeOption: function(options){ + var edgeOption = local.getCoordinateFromValue(options.edge); + options.edge = edgeOption ? edgeOption : + (options.position.x == 'center' && options.position.y == 'center') ? {x: 'center', y: 'center'} : + {x: 'left', y: 'top'}; + }, + + setOffsetOption: function(element, options){ + var parentOffset = {x: 0, y: 0}, + offsetParent = element.measure(function(){ + return document.id(this.getOffsetParent()); + }), + parentScroll = offsetParent.getScroll(); + + if (!offsetParent || offsetParent == element.getDocument().body) return; + parentOffset = offsetParent.measure(function(){ + var position = this.getPosition(); + if (this.getStyle('position') == 'fixed'){ + var scroll = window.getScroll(); + position.x += scroll.x; + position.y += scroll.y; + } + return position; + }); + + options.offset = { + parentPositioned: offsetParent != document.id(options.relativeTo), + x: options.offset.x - parentOffset.x + parentScroll.x, + y: options.offset.y - parentOffset.y + parentScroll.y + }; + }, + + setDimensionsOption: function(element, options){ + options.dimensions = element.getDimensions({ + computeSize: true, + styles: ['padding', 'border', 'margin'] + }); + }, + + getPosition: function(element, options){ + var position = {}; + options = local.getOptions(element, options); + var relativeTo = document.id(options.relativeTo) || document.body; + + local.setPositionCoordinates(options, position, relativeTo); + if (options.edge) local.toEdge(position, options); + + var offset = options.offset; + position.left = ((position.x >= 0 || offset.parentPositioned || options.allowNegative) ? position.x : 0).toInt(); + position.top = ((position.y >= 0 || offset.parentPositioned || options.allowNegative) ? position.y : 0).toInt(); + + local.toMinMax(position, options); + + if (options.relFixedPosition || relativeTo.getStyle('position') == 'fixed') local.toRelFixedPosition(relativeTo, position); + if (options.ignoreScroll) local.toIgnoreScroll(relativeTo, position); + if (options.ignoreMargins) local.toIgnoreMargins(position, options); + + position.left = Math.ceil(position.left); + position.top = Math.ceil(position.top); + delete position.x; + delete position.y; + + return position; + }, + + setPositionCoordinates: function(options, position, relativeTo){ + var offsetY = options.offset.y, + offsetX = options.offset.x, + calc = (relativeTo == document.body) ? window.getScroll() : relativeTo.getPosition(), + top = calc.y, + left = calc.x, + winSize = window.getSize(); + + switch(options.position.x){ + case 'left': position.x = left + offsetX; break; + case 'right': position.x = left + offsetX + relativeTo.offsetWidth; break; + default: position.x = left + ((relativeTo == document.body ? winSize.x : relativeTo.offsetWidth) / 2) + offsetX; break; + } + + switch(options.position.y){ + case 'top': position.y = top + offsetY; break; + case 'bottom': position.y = top + offsetY + relativeTo.offsetHeight; break; + default: position.y = top + ((relativeTo == document.body ? winSize.y : relativeTo.offsetHeight) / 2) + offsetY; break; + } + }, + + toMinMax: function(position, options){ + var xy = {left: 'x', top: 'y'}, value; + ['minimum', 'maximum'].each(function(minmax){ + ['left', 'top'].each(function(lr){ + value = options[minmax] ? options[minmax][xy[lr]] : null; + if (value != null && ((minmax == 'minimum') ? position[lr] < value : position[lr] > value)) position[lr] = value; + }); + }); + }, + + toRelFixedPosition: function(relativeTo, position){ + var winScroll = window.getScroll(); + position.top += winScroll.y; + position.left += winScroll.x; + }, + + toIgnoreScroll: function(relativeTo, position){ + var relScroll = relativeTo.getScroll(); + position.top -= relScroll.y; + position.left -= relScroll.x; + }, + + toIgnoreMargins: function(position, options){ + position.left += options.edge.x == 'right' + ? options.dimensions['margin-right'] + : (options.edge.x != 'center' + ? -options.dimensions['margin-left'] + : -options.dimensions['margin-left'] + ((options.dimensions['margin-right'] + options.dimensions['margin-left']) / 2)); + + position.top += options.edge.y == 'bottom' + ? options.dimensions['margin-bottom'] + : (options.edge.y != 'center' + ? -options.dimensions['margin-top'] + : -options.dimensions['margin-top'] + ((options.dimensions['margin-bottom'] + options.dimensions['margin-top']) / 2)); + }, + + toEdge: function(position, options){ + var edgeOffset = {}, + dimensions = options.dimensions, + edge = options.edge; + + switch(edge.x){ + case 'left': edgeOffset.x = 0; break; + case 'right': edgeOffset.x = -dimensions.x - dimensions.computedRight - dimensions.computedLeft; break; + // center + default: edgeOffset.x = -(Math.round(dimensions.totalWidth / 2)); break; + } + + switch(edge.y){ + case 'top': edgeOffset.y = 0; break; + case 'bottom': edgeOffset.y = -dimensions.y - dimensions.computedTop - dimensions.computedBottom; break; + // center + default: edgeOffset.y = -(Math.round(dimensions.totalHeight / 2)); break; + } + + position.x += edgeOffset.x; + position.y += edgeOffset.y; + }, + + getCoordinateFromValue: function(option){ + if (typeOf(option) != 'string') return option; + option = option.toLowerCase(); + + return { + x: option.test('left') ? 'left' + : (option.test('right') ? 'right' : 'center'), + y: option.test(/upper|top/) ? 'top' + : (option.test('bottom') ? 'bottom' : 'center') + }; + } + +}; + +Element.implement({ + + position: function(options){ + if (options && (options.x != null || options.y != null)) { + return (original ? original.apply(this, arguments) : this); + } + var position = this.setStyle('position', 'absolute').calculatePosition(options); + return (options && options.returnPos) ? position : this.setStyles(position); + }, + + calculatePosition: function(options){ + return local.getPosition(this, options); + } + +}); + +})(Element.prototype.position); + + +/* +--- + +script: Element.Shortcuts.js + +name: Element.Shortcuts + +description: Extends the Element native object to include some shortcut methods. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Element.Style + - /MooTools.More + +provides: [Element.Shortcuts] + +... +*/ + +Element.implement({ + + isDisplayed: function(){ + return this.getStyle('display') != 'none'; + }, + + isVisible: function(){ + var w = this.offsetWidth, + h = this.offsetHeight; + return (w == 0 && h == 0) ? false : (w > 0 && h > 0) ? true : this.style.display != 'none'; + }, + + toggle: function(){ + return this[this.isDisplayed() ? 'hide' : 'show'](); + }, + + hide: function(){ + var d; + try { + //IE fails here if the element is not in the dom + d = this.getStyle('display'); + } catch(e){} + if (d == 'none') return this; + return this.store('element:_originalDisplay', d || '').setStyle('display', 'none'); + }, + + show: function(display){ + if (!display && this.isDisplayed()) return this; + display = display || this.retrieve('element:_originalDisplay') || 'block'; + return this.setStyle('display', (display == 'none') ? 'block' : display); + }, + + swapClass: function(remove, add){ + return this.removeClass(remove).addClass(add); + } + +}); + +Document.implement({ + + clearSelection: function(){ + if (window.getSelection){ + var selection = window.getSelection(); + if (selection && selection.removeAllRanges) selection.removeAllRanges(); + } else if (document.selection && document.selection.empty){ + try { + //IE fails here if selected element is not in dom + document.selection.empty(); + } catch(e){} + } + } + +}); + + +/* +--- + +script: Class.Binds.js + +name: Class.Binds + +description: Automagically binds specified methods in a class to the instance of the class. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Class + - /MooTools.More + +provides: [Class.Binds] + +... +*/ + +Class.Mutators.Binds = function(binds){ + if (!this.prototype.initialize) this.implement('initialize', function(){}); + return Array.from(binds).concat(this.prototype.Binds || []); +}; + +Class.Mutators.initialize = function(initialize){ + return function(){ + Array.from(this.Binds).each(function(name){ + var original = this[name]; + if (original) this[name] = original.bind(this); + }, this); + return initialize.apply(this, arguments); + }; +}; + + +/* +--- + +script: Class.Occlude.js + +name: Class.Occlude + +description: Prevents a class from being applied to a DOM element twice. + +license: MIT-style license. + +authors: + - Aaron Newton + +requires: + - Core/Class + - Core/Element + - /MooTools.More + +provides: [Class.Occlude] + +... +*/ + +Class.Occlude = new Class({ + + occlude: function(property, element){ + element = document.id(element || this.element); + var instance = element.retrieve(property || this.property); + if (instance && !this.occluded) + return (this.occluded = instance); + + this.occluded = false; + element.store(property || this.property, this); + return this.occluded; + } + +}); + + +/* +--- + +script: IframeShim.js + +name: IframeShim + +description: Defines IframeShim, a class for obscuring select lists and flash objects in IE. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Element.Event + - Core/Element.Style + - Core/Options + - Core/Events + - /Element.Position + - /Class.Occlude + +provides: [IframeShim] + +... +*/ + +var IframeShim = new Class({ + + Implements: [Options, Events, Class.Occlude], + + options: { + className: 'iframeShim', + src: 'javascript:false;document.write("");', + display: false, + zIndex: null, + margin: 0, + offset: {x: 0, y: 0}, + browsers: (Browser.ie6 || (Browser.firefox && Browser.version < 3 && Browser.Platform.mac)) + }, + + property: 'IframeShim', + + initialize: function(element, options){ + this.element = document.id(element); + if (this.occlude()) return this.occluded; + this.setOptions(options); + this.makeShim(); + return this; + }, + + makeShim: function(){ + if (this.options.browsers){ + var zIndex = this.element.getStyle('zIndex').toInt(); + + if (!zIndex){ + zIndex = 1; + var pos = this.element.getStyle('position'); + if (pos == 'static' || !pos) this.element.setStyle('position', 'relative'); + this.element.setStyle('zIndex', zIndex); + } + zIndex = ((this.options.zIndex != null || this.options.zIndex === 0) && zIndex > this.options.zIndex) ? this.options.zIndex : zIndex - 1; + if (zIndex < 0) zIndex = 1; + this.shim = new Element('iframe', { + src: this.options.src, + scrolling: 'no', + frameborder: 0, + styles: { + zIndex: zIndex, + position: 'absolute', + border: 'none', + filter: 'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)' + }, + 'class': this.options.className + }).store('IframeShim', this); + var inject = (function(){ + this.shim.inject(this.element, 'after'); + this[this.options.display ? 'show' : 'hide'](); + this.fireEvent('inject'); + }).bind(this); + if (!IframeShim.ready) window.addEvent('load', inject); + else inject(); + } else { + this.position = this.hide = this.show = this.dispose = Function.from(this); + } + }, + + position: function(){ + if (!IframeShim.ready || !this.shim) return this; + var size = this.element.measure(function(){ + return this.getSize(); + }); + if (this.options.margin != undefined){ + size.x = size.x - (this.options.margin * 2); + size.y = size.y - (this.options.margin * 2); + this.options.offset.x += this.options.margin; + this.options.offset.y += this.options.margin; + } + this.shim.set({width: size.x, height: size.y}).position({ + relativeTo: this.element, + offset: this.options.offset + }); + return this; + }, + + hide: function(){ + if (this.shim) this.shim.setStyle('display', 'none'); + return this; + }, + + show: function(){ + if (this.shim) this.shim.setStyle('display', 'block'); + return this.position(); + }, + + dispose: function(){ + if (this.shim) this.shim.dispose(); + return this; + }, + + destroy: function(){ + if (this.shim) this.shim.destroy(); + return this; + } + +}); + +window.addEvent('load', function(){ + IframeShim.ready = true; +}); + + +/* +--- + +script: Mask.js + +name: Mask + +description: Creates a mask element to cover another. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Options + - Core/Events + - Core/Element.Event + - /Class.Binds + - /Element.Position + - /IframeShim + +provides: [Mask] + +... +*/ + +var Mask = new Class({ + + Implements: [Options, Events], + + Binds: ['position'], + + options: {/* + onShow: function(){}, + onHide: function(){}, + onDestroy: function(){}, + onClick: function(event){}, + inject: { + where: 'after', + target: null, + }, + hideOnClick: false, + id: null, + destroyOnHide: false,*/ + style: {}, + 'class': 'mask', + maskMargins: false, + useIframeShim: true, + iframeShimOptions: {} + }, + + initialize: function(target, options){ + this.target = document.id(target) || document.id(document.body); + this.target.store('mask', this); + this.setOptions(options); + this.render(); + this.inject(); + }, + + render: function(){ + this.element = new Element('div', { + 'class': this.options['class'], + id: this.options.id || 'mask-' + String.uniqueID(), + styles: Object.merge({}, this.options.style, { + display: 'none' + }), + events: { + click: function(event){ + this.fireEvent('click', event); + if (this.options.hideOnClick) this.hide(); + }.bind(this) + } + }); + + this.hidden = true; + }, + + toElement: function(){ + return this.element; + }, + + inject: function(target, where){ + where = where || (this.options.inject ? this.options.inject.where : '') || this.target == document.body ? 'inside' : 'after'; + target = target || (this.options.inject && this.options.inject.target) || this.target; + + this.element.inject(target, where); + + if (this.options.useIframeShim){ + this.shim = new IframeShim(this.element, this.options.iframeShimOptions); + + this.addEvents({ + show: this.shim.show.bind(this.shim), + hide: this.shim.hide.bind(this.shim), + destroy: this.shim.destroy.bind(this.shim) + }); + } + }, + + position: function(){ + this.resize(this.options.width, this.options.height); + + this.element.position({ + relativeTo: this.target, + position: 'topLeft', + ignoreMargins: !this.options.maskMargins, + ignoreScroll: this.target == document.body + }); + + return this; + }, + + resize: function(x, y){ + var opt = { + styles: ['padding', 'border'] + }; + if (this.options.maskMargins) opt.styles.push('margin'); + + var dim = this.target.getComputedSize(opt); + if (this.target == document.body){ + this.element.setStyles({width: 0, height: 0}); + var win = window.getScrollSize(); + if (dim.totalHeight < win.y) dim.totalHeight = win.y; + if (dim.totalWidth < win.x) dim.totalWidth = win.x; + } + this.element.setStyles({ + width: Array.pick([x, dim.totalWidth, dim.x]), + height: Array.pick([y, dim.totalHeight, dim.y]) + }); + + return this; + }, + + show: function(){ + if (!this.hidden) return this; + + window.addEvent('resize', this.position); + this.position(); + this.showMask.apply(this, arguments); + + return this; + }, + + showMask: function(){ + this.element.setStyle('display', 'block'); + this.hidden = false; + this.fireEvent('show'); + }, + + hide: function(){ + if (this.hidden) return this; + + window.removeEvent('resize', this.position); + this.hideMask.apply(this, arguments); + if (this.options.destroyOnHide) return this.destroy(); + + return this; + }, + + hideMask: function(){ + this.element.setStyle('display', 'none'); + this.hidden = true; + this.fireEvent('hide'); + }, + + toggle: function(){ + this[this.hidden ? 'show' : 'hide'](); + }, + + destroy: function(){ + this.hide(); + this.element.destroy(); + this.fireEvent('destroy'); + this.target.eliminate('mask'); + } + +}); + +Element.Properties.mask = { + + set: function(options){ + var mask = this.retrieve('mask'); + if (mask) mask.destroy(); + return this.eliminate('mask').store('mask:options', options); + }, + + get: function(){ + var mask = this.retrieve('mask'); + if (!mask){ + mask = new Mask(this, this.retrieve('mask:options')); + this.store('mask', mask); + } + return mask; + } + +}; + +Element.implement({ + + mask: function(options){ + if (options) this.set('mask', options); + this.get('mask').show(); + return this; + }, + + unmask: function(){ + this.get('mask').hide(); + return this; + } + +}); + + +/* +--- + +script: Spinner.js + +name: Spinner + +description: Adds a semi-transparent overlay over a dom element with a spinnin ajax icon. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Fx.Tween + - Core/Request + - /Class.refactor + - /Mask + +provides: [Spinner] + +... +*/ + +var Spinner = new Class({ + + Extends: Mask, + + Implements: Chain, + + options: {/* + message: false,*/ + 'class': 'spinner', + containerPosition: {}, + content: { + 'class': 'spinner-content' + }, + messageContainer: { + 'class': 'spinner-msg' + }, + img: { + 'class': 'spinner-img' + }, + fxOptions: { + link: 'chain' + } + }, + + initialize: function(target, options){ + this.target = document.id(target) || document.id(document.body); + this.target.store('spinner', this); + this.setOptions(options); + this.render(); + this.inject(); + + // Add this to events for when noFx is true; parent methods handle hide/show. + var deactivate = function(){ this.active = false; }.bind(this); + this.addEvents({ + hide: deactivate, + show: deactivate + }); + }, + + render: function(){ + this.parent(); + + this.element.set('id', this.options.id || 'spinner-' + String.uniqueID()); + + this.content = document.id(this.options.content) || new Element('div', this.options.content); + this.content.inject(this.element); + + if (this.options.message){ + this.msg = document.id(this.options.message) || new Element('p', this.options.messageContainer).appendText(this.options.message); + this.msg.inject(this.content); + } + + if (this.options.img){ + this.img = document.id(this.options.img) || new Element('div', this.options.img); + this.img.inject(this.content); + } + + this.element.set('tween', this.options.fxOptions); + }, + + show: function(noFx){ + if (this.active) return this.chain(this.show.bind(this)); + if (!this.hidden){ + this.callChain.delay(20, this); + return this; + } + + this.active = true; + + return this.parent(noFx); + }, + + showMask: function(noFx){ + var pos = function(){ + this.content.position(Object.merge({ + relativeTo: this.element + }, this.options.containerPosition)); + }.bind(this); + + if (noFx){ + this.parent(); + pos(); + } else { + if (!this.options.style.opacity) this.options.style.opacity = this.element.getStyle('opacity').toFloat(); + this.element.setStyles({ + display: 'block', + opacity: 0 + }).tween('opacity', this.options.style.opacity); + pos(); + this.hidden = false; + this.fireEvent('show'); + this.callChain(); + } + }, + + hide: function(noFx){ + if (this.active) return this.chain(this.hide.bind(this)); + if (this.hidden){ + this.callChain.delay(20, this); + return this; + } + this.active = true; + return this.parent(noFx); + }, + + hideMask: function(noFx){ + if (noFx) return this.parent(); + this.element.tween('opacity', 0).get('tween').chain(function(){ + this.element.setStyle('display', 'none'); + this.hidden = true; + this.fireEvent('hide'); + this.callChain(); + }.bind(this)); + }, + + destroy: function(){ + this.content.destroy(); + this.parent(); + this.target.eliminate('spinner'); + } + +}); + +Request = Class.refactor(Request, { + + options: { + useSpinner: false, + spinnerOptions: {}, + spinnerTarget: false + }, + + initialize: function(options){ + this._send = this.send; + this.send = function(options){ + var spinner = this.getSpinner(); + if (spinner) spinner.chain(this._send.pass(options, this)).show(); + else this._send(options); + return this; + }; + this.previous(options); + }, + + getSpinner: function(){ + if (!this.spinner){ + var update = document.id(this.options.spinnerTarget) || document.id(this.options.update); + if (this.options.useSpinner && update){ + update.set('spinner', this.options.spinnerOptions); + var spinner = this.spinner = update.get('spinner'); + ['complete', 'exception', 'cancel'].each(function(event){ + this.addEvent(event, spinner.hide.bind(spinner)); + }, this); + } + } + return this.spinner; + } + +}); + +Element.Properties.spinner = { + + set: function(options){ + var spinner = this.retrieve('spinner'); + if (spinner) spinner.destroy(); + return this.eliminate('spinner').store('spinner:options', options); + }, + + get: function(){ + var spinner = this.retrieve('spinner'); + if (!spinner){ + spinner = new Spinner(this, this.retrieve('spinner:options')); + this.store('spinner', spinner); + } + return spinner; + } + +}; + +Element.implement({ + + spin: function(options){ + if (options) this.set('spinner', options); + this.get('spinner').show(); + return this; + }, + + unspin: function(){ + this.get('spinner').hide(); + return this; + } + +}); + + +/* +--- + +script: Element.Delegation.js + +name: Element.Delegation + +description: Extends the Element native object to include the delegate method for more efficient event management. + +credits: + - "Event checking based on the work of Daniel Steigerwald. License: MIT-style license. Copyright: Copyright (c) 2008 Daniel Steigerwald, daniel.steigerwald.cz" + +license: MIT-style license + +authors: + - Aaron Newton + - Daniel Steigerwald + +requires: [/MooTools.More, Element.Event.Pseudos] + +provides: [Element.Delegation] + +... +*/ + +(function(){ + +var eventListenerSupport = !(window.attachEvent && !window.addEventListener), + nativeEvents = Element.NativeEvents; + +nativeEvents.focusin = 2; +nativeEvents.focusout = 2; + +var check = function(split, target, event){ + var elementEvent = Element.Events[split.event], condition; + if (elementEvent) condition = elementEvent.condition; + return Slick.match(target, split.value) && (!condition || condition.call(target, event)); +}; + +var bubbleUp = function(split, event, fn){ + for (var target = event.target; target && target != this; target = document.id(target.parentNode)){ + if (target && check(split, target, event)) return fn.call(target, event, target); + } +}; + +var formObserver = function(eventName){ + + var $delegationKey = '$delegation:'; + + return { + base: 'focusin', + + onRemove: function(element){ + element.retrieve($delegationKey + 'forms', []).each(function(el){ + el.retrieve($delegationKey + 'listeners', []).each(function(listener){ + el.removeEvent(eventName, listener); + }); + el.eliminate($delegationKey + eventName + 'listeners') + .eliminate($delegationKey + eventName + 'originalFn'); + }); + }, + + listener: function(split, fn, args, monitor, options){ + var event = args[0], + forms = this.retrieve($delegationKey + 'forms', []), + target = event.target, + form = (target.get('tag') == 'form') ? target : event.target.getParent('form'); + + if (!form) return; + + var formEvents = form.retrieve($delegationKey + 'originalFn', []), + formListeners = form.retrieve($delegationKey + 'listeners', []), + self = this; + + forms.include(form); + this.store($delegationKey + 'forms', forms); + + if (!formEvents.contains(fn)){ + var formListener = function(event){ + bubbleUp.call(self, split, event, fn); + }; + form.addEvent(eventName, formListener); + + formEvents.push(fn); + formListeners.push(formListener); + + form.store($delegationKey + eventName + 'originalFn', formEvents) + .store($delegationKey + eventName + 'listeners', formListeners); + } + } + }; +}; + +var inputObserver = function(eventName){ + return { + base: 'focusin', + listener: function(split, fn, args){ + var events = {blur: function(){ + this.removeEvents(events); + }}, self = this; + events[eventName] = function(event){ + bubbleUp.call(self, split, event, fn); + }; + args[0].target.addEvents(events); + } + }; +}; + +var eventOptions = { + mouseenter: { + base: 'mouseover' + }, + mouseleave: { + base: 'mouseout' + }, + focus: { + base: 'focus' + (eventListenerSupport ? '' : 'in'), + args: [true] + }, + blur: { + base: eventListenerSupport ? 'blur' : 'focusout', + args: [true] + } +}; + +if (!eventListenerSupport) Object.append(eventOptions, { + submit: formObserver('submit'), + reset: formObserver('reset'), + change: inputObserver('change'), + select: inputObserver('select') +}); + +Event.definePseudo('relay', { + listener: function(split, fn, args){ + bubbleUp.call(this, split, args[0], fn); + }, + options: eventOptions +}); + +})(); + + +/* +--- + +script: Form.Request.js + +name: Form.Request + +description: Handles the basic functionality of submitting a form and updating a dom element with the result. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Request.HTML + - /Class.Binds + - /Class.Occlude + - /Spinner + - /String.QueryString + - /Element.Delegation + +provides: [Form.Request] + +... +*/ + +if (!window.Form) window.Form = {}; + +(function(){ + + Form.Request = new Class({ + + Binds: ['onSubmit', 'onFormValidate'], + + Implements: [Options, Events, Class.Occlude], + + options: {/* + onFailure: function(){}, + onSuccess: function(){}, // aliased to onComplete, + onSend: function(){}*/ + requestOptions: { + evalScripts: true, + useSpinner: true, + emulation: false, + link: 'ignore' + }, + sendButtonClicked: true, + extraData: {}, + resetForm: true + }, + + property: 'form.request', + + initialize: function(form, target, options){ + this.element = document.id(form); + if (this.occlude()) return this.occluded; + this.setOptions(options) + .setTarget(target) + .attach(); + }, + + setTarget: function(target){ + this.target = document.id(target); + if (!this.request){ + this.makeRequest(); + } else { + this.request.setOptions({ + update: this.target + }); + } + return this; + }, + + toElement: function(){ + return this.element; + }, + + makeRequest: function(){ + var self = this; + this.request = new Request.HTML(Object.merge({ + update: this.target, + emulation: false, + spinnerTarget: this.element, + method: this.element.get('method') || 'post' + }, this.options.requestOptions)).addEvents({ + success: function(tree, elements, html, javascript){ + ['complete', 'success'].each(function(evt){ + self.fireEvent(evt, [self.target, tree, elements, html, javascript]); + }); + }, + failure: function(){ + self.fireEvent('complete', arguments).fireEvent('failure', arguments); + }, + exception: function(){ + self.fireEvent('failure', arguments); + } + }); + return this.attachReset(); + }, + + attachReset: function(){ + if (!this.options.resetForm) return this; + this.request.addEvent('success', function(){ + Function.attempt(function(){ + this.element.reset(); + }.bind(this)); + if (window.OverText) OverText.update(); + }.bind(this)); + return this; + }, + + attach: function(attach){ + var method = (attach != false) ? 'addEvent' : 'removeEvent'; + this.element[method]('click:relay(button, input[type=submit])', this.saveClickedButton.bind(this)); + + var fv = this.element.retrieve('validator'); + if (fv) fv[method]('onFormValidate', this.onFormValidate); + else this.element[method]('submit', this.onSubmit); + + return this; + }, + + detach: function(){ + return this.attach(false); + }, + + //public method + enable: function(){ + return this.attach(); + }, + + //public method + disable: function(){ + return this.detach(); + }, + + onFormValidate: function(valid, form, event){ + //if there's no event, then this wasn't a submit event + if (!event) return; + var fv = this.element.retrieve('validator'); + if (valid || (fv && !fv.options.stopOnFailure)){ + event.stop(); + this.send(); + } + }, + + onSubmit: function(event){ + var fv = this.element.retrieve('validator'); + if (fv){ + //form validator was created after Form.Request + this.element.removeEvent('submit', this.onSubmit); + fv.addEvent('onFormValidate', this.onFormValidate); + this.element.validate(); + return; + } + if (event) event.stop(); + this.send(); + }, + + saveClickedButton: function(event, target){ + var targetName = target.get('name'); + if (!targetName || !this.options.sendButtonClicked) return; + this.options.extraData[targetName] = target.get('value') || true; + this.clickedCleaner = function(){ + delete this.options.extraData[targetName]; + this.clickedCleaner = function(){}; + }.bind(this); + }, + + clickedCleaner: function(){}, + + send: function(){ + var str = this.element.toQueryString().trim(), + data = Object.toQueryString(this.options.extraData); + + if (str) str += "&" + data; + else str = data; + + this.fireEvent('send', [this.element, str.parseQueryString()]); + this.request.send({ + data: str, + url: this.options.requestOptions.url || this.element.get('action') + }); + this.clickedCleaner(); + return this; + } + + }); + + Element.implement('formUpdate', function(update, options){ + var fq = this.retrieve('form.request'); + if (!fq) { + fq = new Form.Request(this, update, options); + } else { + if (update) fq.setTarget(update); + if (options) fq.setOptions(options).makeRequest(); + } + fq.send(); + return this; + }); + +})(); + + +/* +--- + +script: Fx.Reveal.js + +name: Fx.Reveal + +description: Defines Fx.Reveal, a class that shows and hides elements with a transition. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Fx.Morph + - /Element.Shortcuts + - /Element.Measure + +provides: [Fx.Reveal] + +... +*/ + +(function(){ + + +var hideTheseOf = function(object){ + var hideThese = object.options.hideInputs; + if (window.OverText){ + var otClasses = [null]; + OverText.each(function(ot){ + otClasses.include('.' + ot.options.labelClass); + }); + if (otClasses) hideThese += otClasses.join(', '); + } + return (hideThese) ? object.element.getElements(hideThese) : null; +}; + + +Fx.Reveal = new Class({ + + Extends: Fx.Morph, + + options: {/* + onShow: function(thisElement){}, + onHide: function(thisElement){}, + onComplete: function(thisElement){}, + heightOverride: null, + widthOverride: null,*/ + link: 'cancel', + styles: ['padding', 'border', 'margin'], + transitionOpacity: !Browser.ie6, + mode: 'vertical', + display: function(){ + return this.element.get('tag') != 'tr' ? 'block' : 'table-row'; + }, + opacity: 1, + hideInputs: Browser.ie ? 'select, input, textarea, object, embed' : null + }, + + dissolve: function(){ + if (!this.hiding && !this.showing){ + if (this.element.getStyle('display') != 'none'){ + this.hiding = true; + this.showing = false; + this.hidden = true; + this.cssText = this.element.style.cssText; + + var startStyles = this.element.getComputedSize({ + styles: this.options.styles, + mode: this.options.mode + }); + if (this.options.transitionOpacity) startStyles.opacity = this.options.opacity; + + var zero = {}; + Object.each(startStyles, function(style, name){ + zero[name] = [style, 0]; + }); + + this.element.setStyles({ + display: Function.from(this.options.display).call(this), + overflow: 'hidden' + }); + + var hideThese = hideTheseOf(this); + if (hideThese) hideThese.setStyle('visibility', 'hidden'); + + this.$chain.unshift(function(){ + if (this.hidden){ + this.hiding = false; + this.element.style.cssText = this.cssText; + this.element.setStyle('display', 'none'); + if (hideThese) hideThese.setStyle('visibility', 'visible'); + } + this.fireEvent('hide', this.element); + this.callChain(); + }.bind(this)); + + this.start(zero); + } else { + this.callChain.delay(10, this); + this.fireEvent('complete', this.element); + this.fireEvent('hide', this.element); + } + } else if (this.options.link == 'chain'){ + this.chain(this.dissolve.bind(this)); + } else if (this.options.link == 'cancel' && !this.hiding){ + this.cancel(); + this.dissolve(); + } + return this; + }, + + reveal: function(){ + if (!this.showing && !this.hiding){ + if (this.element.getStyle('display') == 'none'){ + this.hiding = false; + this.showing = true; + this.hidden = false; + this.cssText = this.element.style.cssText; + + var startStyles; + this.element.measure(function(){ + startStyles = this.element.getComputedSize({ + styles: this.options.styles, + mode: this.options.mode + }); + }.bind(this)); + if (this.options.heightOverride != null) startStyles.height = this.options.heightOverride.toInt(); + if (this.options.widthOverride != null) startStyles.width = this.options.widthOverride.toInt(); + if (this.options.transitionOpacity){ + this.element.setStyle('opacity', 0); + startStyles.opacity = this.options.opacity; + } + + var zero = { + height: 0, + display: Function.from(this.options.display).call(this) + }; + Object.each(startStyles, function(style, name){ + zero[name] = 0; + }); + zero.overflow = 'hidden'; + + this.element.setStyles(zero); + + var hideThese = hideTheseOf(this); + if (hideThese) hideThese.setStyle('visibility', 'hidden'); + + this.$chain.unshift(function(){ + this.element.style.cssText = this.cssText; + this.element.setStyle('display', Function.from(this.options.display).call(this)); + if (!this.hidden) this.showing = false; + if (hideThese) hideThese.setStyle('visibility', 'visible'); + this.callChain(); + this.fireEvent('show', this.element); + }.bind(this)); + + this.start(startStyles); + } else { + this.callChain(); + this.fireEvent('complete', this.element); + this.fireEvent('show', this.element); + } + } else if (this.options.link == 'chain'){ + this.chain(this.reveal.bind(this)); + } else if (this.options.link == 'cancel' && !this.showing){ + this.cancel(); + this.reveal(); + } + return this; + }, + + toggle: function(){ + if (this.element.getStyle('display') == 'none'){ + this.reveal(); + } else { + this.dissolve(); + } + return this; + }, + + cancel: function(){ + this.parent.apply(this, arguments); + if (this.cssText != null) this.element.style.cssText = this.cssText; + this.hiding = false; + this.showing = false; + return this; + } + +}); + +Element.Properties.reveal = { + + set: function(options){ + this.get('reveal').cancel().setOptions(options); + return this; + }, + + get: function(){ + var reveal = this.retrieve('reveal'); + if (!reveal){ + reveal = new Fx.Reveal(this); + this.store('reveal', reveal); + } + return reveal; + } + +}; + +Element.Properties.dissolve = Element.Properties.reveal; + +Element.implement({ + + reveal: function(options){ + this.get('reveal').setOptions(options).reveal(); + return this; + }, + + dissolve: function(options){ + this.get('reveal').setOptions(options).dissolve(); + return this; + }, + + nix: function(options){ + var params = Array.link(arguments, {destroy: Type.isBoolean, options: Type.isObject}); + this.get('reveal').setOptions(options).dissolve().chain(function(){ + this[params.destroy ? 'destroy' : 'dispose'](); + }.bind(this)); + return this; + }, + + wink: function(){ + var params = Array.link(arguments, {duration: Type.isNumber, options: Type.isObject}); + var reveal = this.get('reveal').setOptions(params.options); + reveal.reveal().chain(function(){ + (function(){ + reveal.dissolve(); + }).delay(params.duration || 2000); + }); + } + +}); + +})(); + + +/* +--- + +script: Form.Request.Append.js + +name: Form.Request.Append + +description: Handles the basic functionality of submitting a form and updating a dom element with the result. The result is appended to the DOM element instead of replacing its contents. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - /Form.Request + - /Fx.Reveal + - /Elements.from + +provides: [Form.Request.Append] + +... +*/ + +Form.Request.Append = new Class({ + + Extends: Form.Request, + + options: { + //onBeforeEffect: function(){}, + useReveal: true, + revealOptions: {}, + inject: 'bottom' + }, + + makeRequest: function(){ + this.request = new Request.HTML(Object.merge({ + url: this.element.get('action'), + method: this.element.get('method') || 'post', + spinnerTarget: this.element + }, this.options.requestOptions, { + evalScripts: false + }) + ).addEvents({ + success: function(tree, elements, html, javascript){ + var container; + var kids = Elements.from(html); + if (kids.length == 1){ + container = kids[0]; + } else { + container = new Element('div', { + styles: { + display: 'none' + } + }).adopt(kids); + } + container.inject(this.target, this.options.inject); + if (this.options.requestOptions.evalScripts) Browser.exec(javascript); + this.fireEvent('beforeEffect', container); + var finish = function(){ + this.fireEvent('success', [container, this.target, tree, elements, html, javascript]); + }.bind(this); + if (this.options.useReveal){ + container.set('reveal', this.options.revealOptions).get('reveal').chain(finish); + container.reveal(); + } else { + finish(); + } + }.bind(this), + failure: function(xhr){ + this.fireEvent('failure', xhr); + }.bind(this) + }); + this.attachReset(); + } + +}); + + +/* +--- + +name: Locale.en-US.Form.Validator + +description: Form Validator messages for English. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - /Locale + +provides: [Locale.en-US.Form.Validator] + +... +*/ + +Locale.define('en-US', 'FormValidator', { + + required: 'This field is required.', + minLength: 'Please enter at least {minLength} characters (you entered {length} characters).', + maxLength: 'Please enter no more than {maxLength} characters (you entered {length} characters).', + integer: 'Please enter an integer in this field. Numbers with decimals (e.g. 1.25) are not permitted.', + numeric: 'Please enter only numeric values in this field (i.e. "1" or "1.1" or "-1" or "-1.1").', + digits: 'Please use numbers and punctuation only in this field (for example, a phone number with dashes or dots is permitted).', + alpha: 'Please use only letters (a-z) within this field. No spaces or other characters are allowed.', + alphanum: 'Please use only letters (a-z) or numbers (0-9) in this field. No spaces or other characters are allowed.', + dateSuchAs: 'Please enter a valid date such as {date}', + dateInFormatMDY: 'Please enter a valid date such as MM/DD/YYYY (i.e. "12/31/1999")', + email: 'Please enter a valid email address. For example "fred@domain.com".', + url: 'Please enter a valid URL such as http://www.example.com.', + currencyDollar: 'Please enter a valid $ amount. For example $100.00 .', + oneRequired: 'Please enter something for at least one of these inputs.', + errorPrefix: 'Error: ', + warningPrefix: 'Warning: ', + + // Form.Validator.Extras + noSpace: 'There can be no spaces in this input.', + reqChkByNode: 'No items are selected.', + requiredChk: 'This field is required.', + reqChkByName: 'Please select a {label}.', + match: 'This field needs to match the {matchName} field', + startDate: 'the start date', + endDate: 'the end date', + currendDate: 'the current date', + afterDate: 'The date should be the same or after {label}.', + beforeDate: 'The date should be the same or before {label}.', + startMonth: 'Please select a start month', + sameMonth: 'These two dates must be in the same month - you must change one or the other.', + creditcard: 'The credit card number entered is invalid. Please check the number and try again. {length} digits entered.' + +}); + + +/* +--- + +script: Form.Validator.js + +name: Form.Validator + +description: A css-class based form validation system. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Options + - Core/Events + - Core/Slick.Finder + - Core/Element.Event + - Core/Element.Style + - Core/JSON + - /Locale + - /Class.Binds + - /Date + - /Element.Forms + - /Locale.en-US.Form.Validator + - /Element.Shortcuts + +provides: [Form.Validator, InputValidator, FormValidator.BaseValidators] + +... +*/ +if (!window.Form) window.Form = {}; + +var InputValidator = this.InputValidator = new Class({ + + Implements: [Options], + + options: { + errorMsg: 'Validation failed.', + test: Function.from(true) + }, + + initialize: function(className, options){ + this.setOptions(options); + this.className = className; + }, + + test: function(field, props){ + field = document.id(field); + return (field) ? this.options.test(field, props || this.getProps(field)) : false; + }, + + getError: function(field, props){ + field = document.id(field); + var err = this.options.errorMsg; + if (typeOf(err) == 'function') err = err(field, props || this.getProps(field)); + return err; + }, + + getProps: function(field){ + field = document.id(field); + return (field) ? field.get('validatorProps') : {}; + } + +}); + +Element.Properties.validators = { + + get: function(){ + return (this.get('data-validators') || this.className).clean().split(' '); + } + +}; + +Element.Properties.validatorProps = { + + set: function(props){ + return this.eliminate('$moo:validatorProps').store('$moo:validatorProps', props); + }, + + get: function(props){ + if (props) this.set(props); + if (this.retrieve('$moo:validatorProps')) return this.retrieve('$moo:validatorProps'); + if (this.getProperty('data-validator-properties') || this.getProperty('validatorProps')){ + try { + this.store('$moo:validatorProps', JSON.decode(this.getProperty('validatorProps') || this.getProperty('data-validator-properties'))); + }catch(e){ + return {}; + } + } else { + var vals = this.get('validators').filter(function(cls){ + return cls.test(':'); + }); + if (!vals.length){ + this.store('$moo:validatorProps', {}); + } else { + props = {}; + vals.each(function(cls){ + var split = cls.split(':'); + if (split[1]){ + try { + props[split[0]] = JSON.decode(split[1]); + } catch(e){} + } + }); + this.store('$moo:validatorProps', props); + } + } + return this.retrieve('$moo:validatorProps'); + } + +}; + +Form.Validator = new Class({ + + Implements: [Options, Events], + + Binds: ['onSubmit'], + + options: {/* + onFormValidate: function(isValid, form, event){}, + onElementValidate: function(isValid, field, className, warn){}, + onElementPass: function(field){}, + onElementFail: function(field, validatorsFailed){}, */ + fieldSelectors: 'input, select, textarea', + ignoreHidden: true, + ignoreDisabled: true, + useTitles: false, + evaluateOnSubmit: true, + evaluateFieldsOnBlur: true, + evaluateFieldsOnChange: true, + serial: true, + stopOnFailure: true, + warningPrefix: function(){ + return Form.Validator.getMsg('warningPrefix') || 'Warning: '; + }, + errorPrefix: function(){ + return Form.Validator.getMsg('errorPrefix') || 'Error: '; + } + }, + + initialize: function(form, options){ + this.setOptions(options); + this.element = document.id(form); + this.element.store('validator', this); + this.warningPrefix = Function.from(this.options.warningPrefix)(); + this.errorPrefix = Function.from(this.options.errorPrefix)(); + if (this.options.evaluateOnSubmit) this.element.addEvent('submit', this.onSubmit); + if (this.options.evaluateFieldsOnBlur || this.options.evaluateFieldsOnChange) this.watchFields(this.getFields()); + }, + + toElement: function(){ + return this.element; + }, + + getFields: function(){ + return (this.fields = this.element.getElements(this.options.fieldSelectors)); + }, + + watchFields: function(fields){ + fields.each(function(el){ + if (this.options.evaluateFieldsOnBlur) + el.addEvent('blur', this.validationMonitor.pass([el, false], this)); + if (this.options.evaluateFieldsOnChange) + el.addEvent('change', this.validationMonitor.pass([el, true], this)); + }, this); + }, + + validationMonitor: function(){ + clearTimeout(this.timer); + this.timer = this.validateField.delay(50, this, arguments); + }, + + onSubmit: function(event){ + if (this.validate(event)) this.reset(); + }, + + reset: function(){ + this.getFields().each(this.resetField, this); + return this; + }, + + validate: function(event){ + var result = this.getFields().map(function(field){ + return this.validateField(field, true); + }, this).every(function(v){ + return v; + }); + this.fireEvent('formValidate', [result, this.element, event]); + if (this.options.stopOnFailure && !result && event) event.preventDefault(); + return result; + }, + + validateField: function(field, force){ + if (this.paused) return true; + field = document.id(field); + var passed = !field.hasClass('validation-failed'); + var failed, warned; + if (this.options.serial && !force){ + failed = this.element.getElement('.validation-failed'); + warned = this.element.getElement('.warning'); + } + if (field && (!failed || force || field.hasClass('validation-failed') || (failed && !this.options.serial))){ + var validationTypes = field.get('validators'); + var validators = validationTypes.some(function(cn){ + return this.getValidator(cn); + }, this); + var validatorsFailed = []; + validationTypes.each(function(className){ + if (className && !this.test(className, field)) validatorsFailed.include(className); + }, this); + passed = validatorsFailed.length === 0; + if (validators && !this.hasValidator(field, 'warnOnly')){ + if (passed){ + field.addClass('validation-passed').removeClass('validation-failed'); + this.fireEvent('elementPass', [field]); + } else { + field.addClass('validation-failed').removeClass('validation-passed'); + this.fireEvent('elementFail', [field, validatorsFailed]); + } + } + if (!warned){ + var warnings = validationTypes.some(function(cn){ + if (cn.test('^warn')) + return this.getValidator(cn.replace(/^warn-/,'')); + else return null; + }, this); + field.removeClass('warning'); + var warnResult = validationTypes.map(function(cn){ + if (cn.test('^warn')) + return this.test(cn.replace(/^warn-/,''), field, true); + else return null; + }, this); + } + } + return passed; + }, + + test: function(className, field, warn){ + field = document.id(field); + if ((this.options.ignoreHidden && !field.isVisible()) || (this.options.ignoreDisabled && field.get('disabled'))) return true; + var validator = this.getValidator(className); + if (warn != null) warn = false; + if (this.hasValidator(field, 'warnOnly')) warn = true; + var isValid = this.hasValidator(field, 'ignoreValidation') || (validator ? validator.test(field) : true); + if (validator && field.isVisible()) this.fireEvent('elementValidate', [isValid, field, className, warn]); + if (warn) return true; + return isValid; + }, + + hasValidator: function(field, value){ + return field.get('validators').contains(value); + }, + + resetField: function(field){ + field = document.id(field); + if (field){ + field.get('validators').each(function(className){ + if (className.test('^warn-')) className = className.replace(/^warn-/, ''); + field.removeClass('validation-failed'); + field.removeClass('warning'); + field.removeClass('validation-passed'); + }, this); + } + return this; + }, + + stop: function(){ + this.paused = true; + return this; + }, + + start: function(){ + this.paused = false; + return this; + }, + + ignoreField: function(field, warn){ + field = document.id(field); + if (field){ + this.enforceField(field); + if (warn) field.addClass('warnOnly'); + else field.addClass('ignoreValidation'); + } + return this; + }, + + enforceField: function(field){ + field = document.id(field); + if (field) field.removeClass('warnOnly').removeClass('ignoreValidation'); + return this; + } + +}); + +Form.Validator.getMsg = function(key){ + return Locale.get('FormValidator.' + key); +}; + +Form.Validator.adders = { + + validators:{}, + + add : function(className, options){ + this.validators[className] = new InputValidator(className, options); + //if this is a class (this method is used by instances of Form.Validator and the Form.Validator namespace) + //extend these validators into it + //this allows validators to be global and/or per instance + if (!this.initialize){ + this.implement({ + validators: this.validators + }); + } + }, + + addAllThese : function(validators){ + Array.from(validators).each(function(validator){ + this.add(validator[0], validator[1]); + }, this); + }, + + getValidator: function(className){ + return this.validators[className.split(':')[0]]; + } + +}; + +Object.append(Form.Validator, Form.Validator.adders); + +Form.Validator.implement(Form.Validator.adders); + +Form.Validator.add('IsEmpty', { + + errorMsg: false, + test: function(element){ + if (element.type == 'select-one' || element.type == 'select') + return !(element.selectedIndex >= 0 && element.options[element.selectedIndex].value != ''); + else + return ((element.get('value') == null) || (element.get('value').length == 0)); + } + +}); + +Form.Validator.addAllThese([ + + ['required', { + errorMsg: function(){ + return Form.Validator.getMsg('required'); + }, + test: function(element){ + return !Form.Validator.getValidator('IsEmpty').test(element); + } + }], + + ['minLength', { + errorMsg: function(element, props){ + if (typeOf(props.minLength) != 'null') + return Form.Validator.getMsg('minLength').substitute({minLength:props.minLength,length:element.get('value').length }); + else return ''; + }, + test: function(element, props){ + if (typeOf(props.minLength) != 'null') return (element.get('value').length >= (props.minLength || 0)); + else return true; + } + }], + + ['maxLength', { + errorMsg: function(element, props){ + //props is {maxLength:10} + if (typeOf(props.maxLength) != 'null') + return Form.Validator.getMsg('maxLength').substitute({maxLength:props.maxLength,length:element.get('value').length }); + else return ''; + }, + test: function(element, props){ + return element.get('value').length <= (props.maxLength || 10000); + } + }], + + ['validate-integer', { + errorMsg: Form.Validator.getMsg.pass('integer'), + test: function(element){ + return Form.Validator.getValidator('IsEmpty').test(element) || (/^(-?[1-9]\d*|0)$/).test(element.get('value')); + } + }], + + ['validate-numeric', { + errorMsg: Form.Validator.getMsg.pass('numeric'), + test: function(element){ + return Form.Validator.getValidator('IsEmpty').test(element) || + (/^-?(?:0$0(?=\d*\.)|[1-9]|0)\d*(\.\d+)?$/).test(element.get('value')); + } + }], + + ['validate-digits', { + errorMsg: Form.Validator.getMsg.pass('digits'), + test: function(element){ + return Form.Validator.getValidator('IsEmpty').test(element) || (/^[\d() .:\-\+#]+$/.test(element.get('value'))); + } + }], + + ['validate-alpha', { + errorMsg: Form.Validator.getMsg.pass('alpha'), + test: function(element){ + return Form.Validator.getValidator('IsEmpty').test(element) || (/^[a-zA-Z]+$/).test(element.get('value')); + } + }], + + ['validate-alphanum', { + errorMsg: Form.Validator.getMsg.pass('alphanum'), + test: function(element){ + return Form.Validator.getValidator('IsEmpty').test(element) || !(/\W/).test(element.get('value')); + } + }], + + ['validate-date', { + errorMsg: function(element, props){ + if (Date.parse){ + var format = props.dateFormat || '%x'; + return Form.Validator.getMsg('dateSuchAs').substitute({date: new Date().format(format)}); + } else { + return Form.Validator.getMsg('dateInFormatMDY'); + } + }, + test: function(element, props){ + if (Form.Validator.getValidator('IsEmpty').test(element)) return true; + var dateLocale = Locale.getCurrent().sets.Date, + dateNouns = new RegExp([dateLocale.days, dateLocale.days_abbr, dateLocale.months, dateLocale.months_abbr].flatten().join('|'), 'i'), + value = element.get('value'), + wordsInValue = value.match(/[a-z]+/gi); + + if (wordsInValue && !wordsInValue.every(dateNouns.exec, dateNouns)) return false; + + var date = Date.parse(value), + format = props.dateFormat || '%x', + formatted = date.format(format); + + if (formatted != 'invalid date') element.set('value', formatted); + return date.isValid(); + } + }], + + ['validate-email', { + errorMsg: Form.Validator.getMsg.pass('email'), + test: function(element){ + /* + var chars = "[a-z0-9!#$%&'*+/=?^_`{|}~-]", + local = '(?:' + chars + '\\.?){0,63}' + chars, + + label = '[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?', + hostname = '(?:' + label + '\\.)*' + label; + + octet = '(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)', + ipv4 = '\\[(?:' + octet + '\\.){3}' + octet + '\\]', + + domain = '(?:' + hostname + '|' + ipv4 + ')'; + + var regex = new RegExp('^' + local + '@' + domain + '$', 'i'); + */ + return Form.Validator.getValidator('IsEmpty').test(element) || (/^(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]\.?){0,63}[a-z0-9!#$%&'*+\/=?^_`{|}~-]@(?:(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\])$/i).test(element.get('value')); + } + }], + + ['validate-url', { + errorMsg: Form.Validator.getMsg.pass('url'), + test: function(element){ + return Form.Validator.getValidator('IsEmpty').test(element) || (/^(https?|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i).test(element.get('value')); + } + }], + + ['validate-currency-dollar', { + errorMsg: Form.Validator.getMsg.pass('currencyDollar'), + test: function(element){ + return Form.Validator.getValidator('IsEmpty').test(element) || (/^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/).test(element.get('value')); + } + }], + + ['validate-one-required', { + errorMsg: Form.Validator.getMsg.pass('oneRequired'), + test: function(element, props){ + var p = document.id(props['validate-one-required']) || element.getParent(props['validate-one-required']); + return p.getElements('input').some(function(el){ + if (['checkbox', 'radio'].contains(el.get('type'))) return el.get('checked'); + return el.get('value'); + }); + } + }] + +]); + +Element.Properties.validator = { + + set: function(options){ + this.get('validator').setOptions(options); + }, + + get: function(){ + var validator = this.retrieve('validator'); + if (!validator){ + validator = new Form.Validator(this); + this.store('validator', validator); + } + return validator; + } + +}; + +Element.implement({ + + validate: function(options){ + if (options) this.set('validator', options); + return this.get('validator').validate(); + } + +}); + + + + + + + +/* +--- + +script: Form.Validator.Inline.js + +name: Form.Validator.Inline + +description: Extends Form.Validator to add inline messages. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - /Form.Validator + +provides: [Form.Validator.Inline] + +... +*/ + +Form.Validator.Inline = new Class({ + + Extends: Form.Validator, + + options: { + showError: function(errorElement){ + if (errorElement.reveal) errorElement.reveal(); + else errorElement.setStyle('display', 'block'); + }, + hideError: function(errorElement){ + if (errorElement.dissolve) errorElement.dissolve(); + else errorElement.setStyle('display', 'none'); + }, + scrollToErrorsOnSubmit: true, + scrollToErrorsOnBlur: false, + scrollToErrorsOnChange: false, + scrollFxOptions: { + transition: 'quad:out', + offset: { + y: -20 + } + } + }, + + initialize: function(form, options){ + this.parent(form, options); + this.addEvent('onElementValidate', function(isValid, field, className, warn){ + var validator = this.getValidator(className); + if (!isValid && validator.getError(field)){ + if (warn) field.addClass('warning'); + var advice = this.makeAdvice(className, field, validator.getError(field), warn); + this.insertAdvice(advice, field); + this.showAdvice(className, field); + } else { + this.hideAdvice(className, field); + } + }); + }, + + makeAdvice: function(className, field, error, warn){ + var errorMsg = (warn) ? this.warningPrefix : this.errorPrefix; + errorMsg += (this.options.useTitles) ? field.title || error:error; + var cssClass = (warn) ? 'warning-advice' : 'validation-advice'; + var advice = this.getAdvice(className, field); + if (advice){ + advice = advice.set('html', errorMsg); + } else { + advice = new Element('div', { + html: errorMsg, + styles: { display: 'none' }, + id: 'advice-' + className.split(':')[0] + '-' + this.getFieldId(field) + }).addClass(cssClass); + } + field.store('$moo:advice-' + className, advice); + return advice; + }, + + getFieldId : function(field){ + return field.id ? field.id : field.id = 'input_' + field.name; + }, + + showAdvice: function(className, field){ + var advice = this.getAdvice(className, field); + if ( + advice && + !field.retrieve('$moo:' + this.getPropName(className)) && + ( + advice.getStyle('display') == 'none' || + advice.getStyle('visiblity') == 'hidden' || + advice.getStyle('opacity') == 0 + ) + ){ + field.store('$moo:' + this.getPropName(className), true); + this.options.showError(advice); + this.fireEvent('showAdvice', [field, advice, className]); + } + }, + + hideAdvice: function(className, field){ + var advice = this.getAdvice(className, field); + if (advice && field.retrieve('$moo:' + this.getPropName(className))){ + field.store('$moo:' + this.getPropName(className), false); + this.options.hideError(advice); + this.fireEvent('hideAdvice', [field, advice, className]); + } + }, + + getPropName: function(className){ + return 'advice' + className; + }, + + resetField: function(field){ + field = document.id(field); + if (!field) return this; + this.parent(field); + field.get('validators').each(function(className){ + this.hideAdvice(className, field); + }, this); + return this; + }, + + getAllAdviceMessages: function(field, force){ + var advice = []; + if (field.hasClass('ignoreValidation') && !force) return advice; + var validators = field.get('validators').some(function(cn){ + var warner = cn.test('^warn-') || field.hasClass('warnOnly'); + if (warner) cn = cn.replace(/^warn-/, ''); + var validator = this.getValidator(cn); + if (!validator) return; + advice.push({ + message: validator.getError(field), + warnOnly: warner, + passed: validator.test(), + validator: validator + }); + }, this); + return advice; + }, + + getAdvice: function(className, field){ + return field.retrieve('$moo:advice-' + className); + }, + + insertAdvice: function(advice, field){ + //Check for error position prop + var props = field.get('validatorProps'); + //Build advice + if (!props.msgPos || !document.id(props.msgPos)){ + if (field.type && field.type.toLowerCase() == 'radio') field.getParent().adopt(advice); + else advice.inject(document.id(field), 'after'); + } else { + document.id(props.msgPos).grab(advice); + } + }, + + validateField: function(field, force, scroll){ + var result = this.parent(field, force); + if (((this.options.scrollToErrorsOnSubmit && scroll == null) || scroll) && !result){ + var failed = document.id(this).getElement('.validation-failed'); + var par = document.id(this).getParent(); + while (par != document.body && par.getScrollSize().y == par.getSize().y){ + par = par.getParent(); + } + var fx = par.retrieve('$moo:fvScroller'); + if (!fx && window.Fx && Fx.Scroll){ + fx = new Fx.Scroll(par, this.options.scrollFxOptions); + par.store('$moo:fvScroller', fx); + } + if (failed){ + if (fx) fx.toElement(failed); + else par.scrollTo(par.getScroll().x, failed.getPosition(par).y - 20); + } + } + return result; + }, + + watchFields: function(fields){ + fields.each(function(el){ + if (this.options.evaluateFieldsOnBlur){ + el.addEvent('blur', this.validationMonitor.pass([el, false, this.options.scrollToErrorsOnBlur], this)); + } + if (this.options.evaluateFieldsOnChange){ + el.addEvent('change', this.validationMonitor.pass([el, true, this.options.scrollToErrorsOnChange], this)); + } + }, this); + } + +}); + + +/* +--- + +script: Form.Validator.Extras.js + +name: Form.Validator.Extras + +description: Additional validators for the Form.Validator class. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - /Form.Validator + +provides: [Form.Validator.Extras] + +... +*/ +Form.Validator.addAllThese([ + + ['validate-enforce-oncheck', { + test: function(element, props){ + var fv = element.getParent('form').retrieve('validator'); + if (!fv) return true; + (props.toEnforce || document.id(props.enforceChildrenOf).getElements('input, select, textarea')).map(function(item){ + if (element.checked){ + fv.enforceField(item); + } else { + fv.ignoreField(item); + fv.resetField(item); + } + }); + return true; + } + }], + + ['validate-ignore-oncheck', { + test: function(element, props){ + var fv = element.getParent('form').retrieve('validator'); + if (!fv) return true; + (props.toIgnore || document.id(props.ignoreChildrenOf).getElements('input, select, textarea')).each(function(item){ + if (element.checked){ + fv.ignoreField(item); + fv.resetField(item); + } else { + fv.enforceField(item); + } + }); + return true; + } + }], + + ['validate-nospace', { + errorMsg: function(){ + return Form.Validator.getMsg('noSpace'); + }, + test: function(element, props){ + return !element.get('value').test(/\s/); + } + }], + + ['validate-toggle-oncheck', { + test: function(element, props){ + var fv = element.getParent('form').retrieve('validator'); + if (!fv) return true; + var eleArr = props.toToggle || document.id(props.toToggleChildrenOf).getElements('input, select, textarea'); + if (!element.checked){ + eleArr.each(function(item){ + fv.ignoreField(item); + fv.resetField(item); + }); + } else { + eleArr.each(function(item){ + fv.enforceField(item); + }); + } + return true; + } + }], + + ['validate-reqchk-bynode', { + errorMsg: function(){ + return Form.Validator.getMsg('reqChkByNode'); + }, + test: function(element, props){ + return (document.id(props.nodeId).getElements(props.selector || 'input[type=checkbox], input[type=radio]')).some(function(item){ + return item.checked; + }); + } + }], + + ['validate-required-check', { + errorMsg: function(element, props){ + return props.useTitle ? element.get('title') : Form.Validator.getMsg('requiredChk'); + }, + test: function(element, props){ + return !!element.checked; + } + }], + + ['validate-reqchk-byname', { + errorMsg: function(element, props){ + return Form.Validator.getMsg('reqChkByName').substitute({label: props.label || element.get('type')}); + }, + test: function(element, props){ + var grpName = props.groupName || element.get('name'); + var oneCheckedItem = $$(document.getElementsByName(grpName)).some(function(item, index){ + return item.checked; + }); + var fv = element.getParent('form').retrieve('validator'); + if (oneCheckedItem && fv) fv.resetField(element); + return oneCheckedItem; + } + }], + + ['validate-match', { + errorMsg: function(element, props){ + return Form.Validator.getMsg('match').substitute({matchName: props.matchName || document.id(props.matchInput).get('name')}); + }, + test: function(element, props){ + var eleVal = element.get('value'); + var matchVal = document.id(props.matchInput) && document.id(props.matchInput).get('value'); + return eleVal && matchVal ? eleVal == matchVal : true; + } + }], + + ['validate-after-date', { + errorMsg: function(element, props){ + return Form.Validator.getMsg('afterDate').substitute({ + label: props.afterLabel || (props.afterElement ? Form.Validator.getMsg('startDate') : Form.Validator.getMsg('currentDate')) + }); + }, + test: function(element, props){ + var start = document.id(props.afterElement) ? Date.parse(document.id(props.afterElement).get('value')) : new Date(); + var end = Date.parse(element.get('value')); + return end && start ? end >= start : true; + } + }], + + ['validate-before-date', { + errorMsg: function(element, props){ + return Form.Validator.getMsg('beforeDate').substitute({ + label: props.beforeLabel || (props.beforeElement ? Form.Validator.getMsg('endDate') : Form.Validator.getMsg('currentDate')) + }); + }, + test: function(element, props){ + var start = Date.parse(element.get('value')); + var end = document.id(props.beforeElement) ? Date.parse(document.id(props.beforeElement).get('value')) : new Date(); + return end && start ? end >= start : true; + } + }], + + ['validate-custom-required', { + errorMsg: function(){ + return Form.Validator.getMsg('required'); + }, + test: function(element, props){ + return element.get('value') != props.emptyValue; + } + }], + + ['validate-same-month', { + errorMsg: function(element, props){ + var startMo = document.id(props.sameMonthAs) && document.id(props.sameMonthAs).get('value'); + var eleVal = element.get('value'); + if (eleVal != '') return Form.Validator.getMsg(startMo ? 'sameMonth' : 'startMonth'); + }, + test: function(element, props){ + var d1 = Date.parse(element.get('value')); + var d2 = Date.parse(document.id(props.sameMonthAs) && document.id(props.sameMonthAs).get('value')); + return d1 && d2 ? d1.format('%B') == d2.format('%B') : true; + } + }], + + + ['validate-cc-num', { + errorMsg: function(element){ + var ccNum = element.get('value').replace(/[^0-9]/g, ''); + return Form.Validator.getMsg('creditcard').substitute({length: ccNum.length}); + }, + test: function(element){ + // required is a different test + if (Form.Validator.getValidator('IsEmpty').test(element)) return true; + + // Clean number value + var ccNum = element.get('value'); + ccNum = ccNum.replace(/[^0-9]/g, ''); + + var valid_type = false; + + if (ccNum.test(/^4[0-9]{12}([0-9]{3})?$/)) valid_type = 'Visa'; + else if (ccNum.test(/^5[1-5]([0-9]{14})$/)) valid_type = 'Master Card'; + else if (ccNum.test(/^3[47][0-9]{13}$/)) valid_type = 'American Express'; + else if (ccNum.test(/^6011[0-9]{12}$/)) valid_type = 'Discover'; + + if (valid_type){ + var sum = 0; + var cur = 0; + + for (var i=ccNum.length-1; i>=0; --i){ + cur = ccNum.charAt(i).toInt(); + if (cur == 0) continue; + + if ((ccNum.length-i) % 2 == 0) cur += cur; + if (cur > 9){ + cur = cur.toString().charAt(0).toInt() + cur.toString().charAt(1).toInt(); + } + + sum += cur; + } + if ((sum % 10) == 0) return true; + } + + var chunks = ''; + while (ccNum != ''){ + chunks += ' ' + ccNum.substr(0,4); + ccNum = ccNum.substr(4); + } + + element.getParent('form').retrieve('validator').ignoreField(element); + element.set('value', chunks.clean()); + element.getParent('form').retrieve('validator').enforceField(element); + return false; + } + }] + + +]); + + +/* +--- + +script: OverText.js + +name: OverText + +description: Shows text over an input that disappears when the user clicks into it. The text remains hidden if the user adds a value. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Options + - Core/Events + - Core/Element.Event + - Class.Binds + - Class.Occlude + - Element.Position + - Element.Shortcuts + +provides: [OverText] + +... +*/ + +var OverText = new Class({ + + Implements: [Options, Events, Class.Occlude], + + Binds: ['reposition', 'assert', 'focus', 'hide'], + + options: {/* + textOverride: null, + onFocus: function(){}, + onTextHide: function(textEl, inputEl){}, + onTextShow: function(textEl, inputEl){}, */ + element: 'label', + labelClass: 'overTxtLabel', + positionOptions: { + position: 'upperLeft', + edge: 'upperLeft', + offset: { + x: 4, + y: 2 + } + }, + poll: false, + pollInterval: 250, + wrap: false + }, + + property: 'OverText', + + initialize: function(element, options){ + element = this.element = document.id(element); + + if (this.occlude()) return this.occluded; + this.setOptions(options); + + this.attach(element); + OverText.instances.push(this); + + if (this.options.poll) this.poll(); + }, + + toElement: function(){ + return this.element; + }, + + attach: function(){ + var element = this.element, + options = this.options, + value = options.textOverride || element.get('alt') || element.get('title'); + + if (!value) return this; + + var text = this.text = new Element(options.element, { + 'class': options.labelClass, + styles: { + lineHeight: 'normal', + position: 'absolute', + cursor: 'text' + }, + html: value, + events: { + click: this.hide.pass(options.element == 'label', this) + } + }).inject(element, 'after'); + + if (options.element == 'label'){ + if (!element.get('id')) element.set('id', 'input_' + String.uniqueID()); + text.set('for', element.get('id')); + } + + if (options.wrap){ + this.textHolder = new Element('div.overTxtWrapper', { + styles: { + lineHeight: 'normal', + position: 'relative' + } + }).grab(text).inject(element, 'before'); + } + + return this.enable(); + }, + + destroy: function(){ + this.element.eliminate(this.property); // Class.Occlude storage + this.disable(); + if (this.text) this.text.destroy(); + if (this.textHolder) this.textHolder.destroy(); + return this; + }, + + disable: function(){ + this.element.removeEvents({ + focus: this.focus, + blur: this.assert, + change: this.assert + }); + window.removeEvent('resize', this.reposition); + this.hide(true, true); + return this; + }, + + enable: function(){ + this.element.addEvents({ + focus: this.focus, + blur: this.assert, + change: this.assert + }); + window.addEvent('resize', this.reposition); + this.assert(true); + this.reposition(); + return this; + }, + + wrap: function(){ + if (this.options.element == 'label'){ + if (!this.element.get('id')) this.element.set('id', 'input_' + String.uniqueID()); + this.text.set('for', this.element.get('id')); + } + }, + + startPolling: function(){ + this.pollingPaused = false; + return this.poll(); + }, + + poll: function(stop){ + //start immediately + //pause on focus + //resumeon blur + if (this.poller && !stop) return this; + if (stop){ + clearInterval(this.poller); + } else { + this.poller = (function(){ + if (!this.pollingPaused) this.assert(true); + }).periodical(this.options.pollInterval, this); + } + + return this; + }, + + stopPolling: function(){ + this.pollingPaused = true; + return this.poll(true); + }, + + focus: function(){ + if (this.text && (!this.text.isDisplayed() || this.element.get('disabled'))) return this; + return this.hide(); + }, + + hide: function(suppressFocus, force){ + if (this.text && (this.text.isDisplayed() && (!this.element.get('disabled') || force))){ + this.text.hide(); + this.fireEvent('textHide', [this.text, this.element]); + this.pollingPaused = true; + if (!suppressFocus){ + try { + this.element.fireEvent('focus'); + this.element.focus(); + } catch(e){} //IE barfs if you call focus on hidden elements + } + } + return this; + }, + + show: function(){ + if (this.text && !this.text.isDisplayed()){ + this.text.show(); + this.reposition(); + this.fireEvent('textShow', [this.text, this.element]); + this.pollingPaused = false; + } + return this; + }, + + test: function(){ + return !this.element.get('value'); + }, + + assert: function(suppressFocus){ + return this[this.test() ? 'show' : 'hide'](suppressFocus); + }, + + reposition: function(){ + this.assert(true); + if (!this.element.isVisible()) return this.stopPolling().hide(); + if (this.text && this.test()){ + this.text.position(Object.merge(this.options.positionOptions, { + relativeTo: this.element + })); + } + return this; + } + +}); + +OverText.instances = []; + +Object.append(OverText, { + + each: function(fn){ + return OverText.instances.each(function(ot, i){ + if (ot.element && ot.text) fn.call(OverText, ot, i); + }); + }, + + update: function(){ + + return OverText.each(function(ot){ + return ot.reposition(); + }); + + }, + + hideAll: function(){ + + return OverText.each(function(ot){ + return ot.hide(true, true); + }); + + }, + + showAll: function(){ + return OverText.each(function(ot){ + return ot.show(); + }); + } + +}); + + + +/* +--- + +script: Fx.Elements.js + +name: Fx.Elements + +description: Effect to change any number of CSS properties of any number of Elements. + +license: MIT-style license + +authors: + - Valerio Proietti + +requires: + - Core/Fx.CSS + - /MooTools.More + +provides: [Fx.Elements] + +... +*/ + +Fx.Elements = new Class({ + + Extends: Fx.CSS, + + initialize: function(elements, options){ + this.elements = this.subject = $$(elements); + this.parent(options); + }, + + compute: function(from, to, delta){ + var now = {}; + + for (var i in from){ + var iFrom = from[i], iTo = to[i], iNow = now[i] = {}; + for (var p in iFrom) iNow[p] = this.parent(iFrom[p], iTo[p], delta); + } + + return now; + }, + + set: function(now){ + for (var i in now){ + if (!this.elements[i]) continue; + + var iNow = now[i]; + for (var p in iNow) this.render(this.elements[i], p, iNow[p], this.options.unit); + } + + return this; + }, + + start: function(obj){ + if (!this.check(obj)) return this; + var from = {}, to = {}; + + for (var i in obj){ + if (!this.elements[i]) continue; + + var iProps = obj[i], iFrom = from[i] = {}, iTo = to[i] = {}; + + for (var p in iProps){ + var parsed = this.prepare(this.elements[i], p, iProps[p]); + iFrom[p] = parsed.from; + iTo[p] = parsed.to; + } + } + + return this.parent(from, to); + } + +}); + + +/* +--- + +script: Fx.Accordion.js + +name: Fx.Accordion + +description: An Fx.Elements extension which allows you to easily create accordion type controls. + +license: MIT-style license + +authors: + - Valerio Proietti + +requires: + - Core/Element.Event + - /Fx.Elements + +provides: [Fx.Accordion] + +... +*/ + +Fx.Accordion = new Class({ + + Extends: Fx.Elements, + + options: {/* + onActive: function(toggler, section){}, + onBackground: function(toggler, section){},*/ + fixedHeight: false, + fixedWidth: false, + display: 0, + show: false, + height: true, + width: false, + opacity: true, + alwaysHide: false, + trigger: 'click', + initialDisplayFx: true, + resetHeight: true + }, + + initialize: function(){ + var defined = function(obj){ + return obj != null; + }; + + var params = Array.link(arguments, { + 'container': Type.isElement, //deprecated + 'options': Type.isObject, + 'togglers': defined, + 'elements': defined + }); + this.parent(params.elements, params.options); + + var options = this.options, + togglers = this.togglers = $$(params.togglers); + + this.previous = -1; + this.internalChain = new Chain(); + + if (options.alwaysHide) this.options.link = 'chain'; + + if (options.show || this.options.show === 0){ + options.display = false; + this.previous = options.show; + } + + if (options.start){ + options.display = false; + options.show = false; + } + + var effects = this.effects = {}; + + if (options.opacity) effects.opacity = 'fullOpacity'; + if (options.width) effects.width = options.fixedWidth ? 'fullWidth' : 'offsetWidth'; + if (options.height) effects.height = options.fixedHeight ? 'fullHeight' : 'scrollHeight'; + + for (var i = 0, l = togglers.length; i < l; i++) this.addSection(togglers[i], this.elements[i]); + + this.elements.each(function(el, i){ + if (options.show === i){ + this.fireEvent('active', [togglers[i], el]); + } else { + for (var fx in effects) el.setStyle(fx, 0); + } + }, this); + + if (options.display || options.display === 0 || options.initialDisplayFx === false){ + this.display(options.display, options.initialDisplayFx); + } + + if (options.fixedHeight !== false) options.resetHeight = false; + this.addEvent('complete', this.internalChain.callChain.bind(this.internalChain)); + }, + + addSection: function(toggler, element){ + toggler = document.id(toggler); + element = document.id(element); + this.togglers.include(toggler); + this.elements.include(element); + + var togglers = this.togglers, + options = this.options, + test = togglers.contains(toggler), + idx = togglers.indexOf(toggler), + displayer = this.display.pass(idx, this); + + toggler.store('accordion:display', displayer) + .addEvent(options.trigger, displayer); + + if (options.height) element.setStyles({'padding-top': 0, 'border-top': 'none', 'padding-bottom': 0, 'border-bottom': 'none'}); + if (options.width) element.setStyles({'padding-left': 0, 'border-left': 'none', 'padding-right': 0, 'border-right': 'none'}); + + element.fullOpacity = 1; + if (options.fixedWidth) element.fullWidth = options.fixedWidth; + if (options.fixedHeight) element.fullHeight = options.fixedHeight; + element.setStyle('overflow', 'hidden'); + + if (!test) for (var fx in this.effects){ + element.setStyle(fx, 0); + } + return this; + }, + + removeSection: function(toggler, displayIndex){ + var togglers = this.togglers, + idx = togglers.indexOf(toggler), + element = this.elements[idx]; + + var remover = function(){ + togglers.erase(toggler); + this.elements.erase(element); + this.detach(toggler); + }.bind(this); + + if (this.now == idx || displayIndex != null){ + this.display(displayIndex != null ? displayIndex : (idx - 1 >= 0 ? idx - 1 : 0)).chain(remover); + } else { + remover(); + } + return this; + }, + + detach: function(toggler){ + var remove = function(toggler){ + toggler.removeEvent(this.options.trigger, toggler.retrieve('accordion:display')); + }.bind(this); + + if (!toggler) this.togglers.each(remove); + else remove(toggler); + return this; + }, + + display: function(index, useFx){ + if (!this.check(index, useFx)) return this; + + var obj = {}, + elements = this.elements, + options = this.options, + effects = this.effects; + + if (useFx == null) useFx = true; + if (typeOf(index) == 'element') index = elements.indexOf(index); + if (index == this.previous && !options.alwaysHide) return this; + + if (options.resetHeight){ + var prev = elements[this.previous]; + if (prev && !this.selfHidden){ + for (var fx in effects) prev.setStyle(fx, prev[effects[fx]]); + } + } + + if ((this.timer && options.link == 'chain') || (index === this.previous && !options.alwaysHide)) return this; + + this.previous = index; + this.selfHidden = false; + + elements.each(function(el, i){ + obj[i] = {}; + var hide; + if (i != index){ + hide = true; + } else if (options.alwaysHide && ((el.offsetHeight > 0 && options.height) || el.offsetWidth > 0 && options.width)){ + hide = true; + this.selfHidden = true; + } + this.fireEvent(hide ? 'background' : 'active', [this.togglers[i], el]); + for (var fx in effects) obj[i][fx] = hide ? 0 : el[effects[fx]]; + if (!useFx && !hide && options.resetHeight) obj[i].height = 'auto'; + }, this); + + this.internalChain.clearChain(); + this.internalChain.chain(function(){ + if (options.resetHeight && !this.selfHidden){ + var el = elements[index]; + if (el) el.setStyle('height', 'auto'); + } + }.bind(this)); + + return useFx ? this.start(obj) : this.set(obj).internalChain.callChain(); + } + +}); + + + + +/* +--- + +script: Fx.Move.js + +name: Fx.Move + +description: Defines Fx.Move, a class that works with Element.Position.js to transition an element from one location to another. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Fx.Morph + - /Element.Position + +provides: [Fx.Move] + +... +*/ + +Fx.Move = new Class({ + + Extends: Fx.Morph, + + options: { + relativeTo: document.body, + position: 'center', + edge: false, + offset: {x: 0, y: 0} + }, + + start: function(destination){ + var element = this.element, + topLeft = element.getStyles('top', 'left'); + if (topLeft.top == 'auto' || topLeft.left == 'auto'){ + element.setPosition(element.getPosition(element.getOffsetParent())); + } + return this.parent(element.position(Object.merge({}, this.options, destination, {returnPos: true}))); + } + +}); + +Element.Properties.move = { + + set: function(options){ + this.get('move').cancel().setOptions(options); + return this; + }, + + get: function(){ + var move = this.retrieve('move'); + if (!move){ + move = new Fx.Move(this, {link: 'cancel'}); + this.store('move', move); + } + return move; + } + +}; + +Element.implement({ + + move: function(options){ + this.get('move').start(options); + return this; + } + +}); + + +/* +--- + +script: Fx.Slide.js + +name: Fx.Slide + +description: Effect to slide an element in and out of view. + +license: MIT-style license + +authors: + - Valerio Proietti + +requires: + - Core/Fx + - Core/Element.Style + - /MooTools.More + +provides: [Fx.Slide] + +... +*/ + +Fx.Slide = new Class({ + + Extends: Fx, + + options: { + mode: 'vertical', + wrapper: false, + hideOverflow: true, + resetHeight: false + }, + + initialize: function(element, options){ + element = this.element = this.subject = document.id(element); + this.parent(options); + options = this.options; + + var wrapper = element.retrieve('wrapper'), + styles = element.getStyles('margin', 'position', 'overflow'); + + if (options.hideOverflow) styles = Object.append(styles, {overflow: 'hidden'}); + if (options.wrapper) wrapper = document.id(options.wrapper).setStyles(styles); + + if (!wrapper) wrapper = new Element('div', { + styles: styles + }).wraps(element); + + element.store('wrapper', wrapper).setStyle('margin', 0); + if (element.getStyle('overflow') == 'visible') element.setStyle('overflow', 'hidden'); + + this.now = []; + this.open = true; + this.wrapper = wrapper; + + this.addEvent('complete', function(){ + this.open = (wrapper['offset' + this.layout.capitalize()] != 0); + if (this.open && this.options.resetHeight) wrapper.setStyle('height', ''); + }, true); + }, + + vertical: function(){ + this.margin = 'margin-top'; + this.layout = 'height'; + this.offset = this.element.offsetHeight; + }, + + horizontal: function(){ + this.margin = 'margin-left'; + this.layout = 'width'; + this.offset = this.element.offsetWidth; + }, + + set: function(now){ + this.element.setStyle(this.margin, now[0]); + this.wrapper.setStyle(this.layout, now[1]); + return this; + }, + + compute: function(from, to, delta){ + return [0, 1].map(function(i){ + return Fx.compute(from[i], to[i], delta); + }); + }, + + start: function(how, mode){ + if (!this.check(how, mode)) return this; + this[mode || this.options.mode](); + + var margin = this.element.getStyle(this.margin).toInt(), + layout = this.wrapper.getStyle(this.layout).toInt(), + caseIn = [[margin, layout], [0, this.offset]], + caseOut = [[margin, layout], [-this.offset, 0]], + start; + + switch (how){ + case 'in': start = caseIn; break; + case 'out': start = caseOut; break; + case 'toggle': start = (layout == 0) ? caseIn : caseOut; + } + return this.parent(start[0], start[1]); + }, + + slideIn: function(mode){ + return this.start('in', mode); + }, + + slideOut: function(mode){ + return this.start('out', mode); + }, + + hide: function(mode){ + this[mode || this.options.mode](); + this.open = false; + return this.set([-this.offset, 0]); + }, + + show: function(mode){ + this[mode || this.options.mode](); + this.open = true; + return this.set([0, this.offset]); + }, + + toggle: function(mode){ + return this.start('toggle', mode); + } + +}); + +Element.Properties.slide = { + + set: function(options){ + this.get('slide').cancel().setOptions(options); + return this; + }, + + get: function(){ + var slide = this.retrieve('slide'); + if (!slide){ + slide = new Fx.Slide(this, {link: 'cancel'}); + this.store('slide', slide); + } + return slide; + } + +}; + +Element.implement({ + + slide: function(how, mode){ + how = how || 'toggle'; + var slide = this.get('slide'), toggle; + switch (how){ + case 'hide': slide.hide(mode); break; + case 'show': slide.show(mode); break; + case 'toggle': + var flag = this.retrieve('slide:flag', slide.open); + slide[flag ? 'slideOut' : 'slideIn'](mode); + this.store('slide:flag', !flag); + toggle = true; + break; + default: slide.start(how, mode); + } + if (!toggle) this.eliminate('slide:flag'); + return this; + } + +}); + + +/* +--- + +script: Fx.Scroll.js + +name: Fx.Scroll + +description: Effect to smoothly scroll any element, including the window. + +license: MIT-style license + +authors: + - Valerio Proietti + +requires: + - Core/Fx + - Core/Element.Event + - Core/Element.Dimensions + - /MooTools.More + +provides: [Fx.Scroll] + +... +*/ + +(function(){ + +Fx.Scroll = new Class({ + + Extends: Fx, + + options: { + offset: {x: 0, y: 0}, + wheelStops: true + }, + + initialize: function(element, options){ + this.element = this.subject = document.id(element); + this.parent(options); + + if (typeOf(this.element) != 'element') this.element = document.id(this.element.getDocument().body); + + if (this.options.wheelStops){ + var stopper = this.element, + cancel = this.cancel.pass(false, this); + this.addEvent('start', function(){ + stopper.addEvent('mousewheel', cancel); + }, true); + this.addEvent('complete', function(){ + stopper.removeEvent('mousewheel', cancel); + }, true); + } + }, + + set: function(){ + var now = Array.flatten(arguments); + if (Browser.firefox) now = [Math.round(now[0]), Math.round(now[1])]; // not needed anymore in newer firefox versions + this.element.scrollTo(now[0], now[1]); + return this; + }, + + compute: function(from, to, delta){ + return [0, 1].map(function(i){ + return Fx.compute(from[i], to[i], delta); + }); + }, + + start: function(x, y){ + if (!this.check(x, y)) return this; + var scroll = this.element.getScroll(); + return this.parent([scroll.x, scroll.y], [x, y]); + }, + + calculateScroll: function(x, y){ + var element = this.element, + scrollSize = element.getScrollSize(), + scroll = element.getScroll(), + size = element.getSize(), + offset = this.options.offset, + values = {x: x, y: y}; + + for (var z in values){ + if (!values[z] && values[z] !== 0) values[z] = scroll[z]; + if (typeOf(values[z]) != 'number') values[z] = scrollSize[z] - size[z]; + values[z] += offset[z]; + } + + return [values.x, values.y]; + }, + + toTop: function(){ + return this.start.apply(this, this.calculateScroll(false, 0)); + }, + + toLeft: function(){ + return this.start.apply(this, this.calculateScroll(0, false)); + }, + + toRight: function(){ + return this.start.apply(this, this.calculateScroll('right', false)); + }, + + toBottom: function(){ + return this.start.apply(this, this.calculateScroll(false, 'bottom')); + }, + + toElement: function(el, axes){ + axes = axes ? Array.from(axes) : ['x', 'y']; + var scroll = isBody(this.element) ? {x: 0, y: 0} : this.element.getScroll(); + var position = Object.map(document.id(el).getPosition(this.element), function(value, axis){ + return axes.contains(axis) ? value + scroll[axis] : false; + }); + return this.start.apply(this, this.calculateScroll(position.x, position.y)); + }, + + toElementEdge: function(el, axes, offset){ + axes = axes ? Array.from(axes) : ['x', 'y']; + el = document.id(el); + var to = {}, + position = el.getPosition(this.element), + size = el.getSize(), + scroll = this.element.getScroll(), + containerSize = this.element.getSize(), + edge = { + x: position.x + size.x, + y: position.y + size.y + }; + + ['x', 'y'].each(function(axis){ + if (axes.contains(axis)){ + if (edge[axis] > scroll[axis] + containerSize[axis]) to[axis] = edge[axis] - containerSize[axis]; + if (position[axis] < scroll[axis]) to[axis] = position[axis]; + } + if (to[axis] == null) to[axis] = scroll[axis]; + if (offset && offset[axis]) to[axis] = to[axis] + offset[axis]; + }, this); + + if (to.x != scroll.x || to.y != scroll.y) this.start(to.x, to.y); + return this; + }, + + toElementCenter: function(el, axes, offset){ + axes = axes ? Array.from(axes) : ['x', 'y']; + el = document.id(el); + var to = {}, + position = el.getPosition(this.element), + size = el.getSize(), + scroll = this.element.getScroll(), + containerSize = this.element.getSize(); + + ['x', 'y'].each(function(axis){ + if (axes.contains(axis)){ + to[axis] = position[axis] - (containerSize[axis] - size[axis]) / 2; + } + if (to[axis] == null) to[axis] = scroll[axis]; + if (offset && offset[axis]) to[axis] = to[axis] + offset[axis]; + }, this); + + if (to.x != scroll.x || to.y != scroll.y) this.start(to.x, to.y); + return this; + } + +}); + + + +function isBody(element){ + return (/^(?:body|html)$/i).test(element.tagName); +} + +})(); + + +/* +--- + +script: Fx.SmoothScroll.js + +name: Fx.SmoothScroll + +description: Class for creating a smooth scrolling effect to all internal links on the page. + +license: MIT-style license + +authors: + - Valerio Proietti + +requires: + - Core/Slick.Finder + - /Fx.Scroll + +provides: [Fx.SmoothScroll] + +... +*/ + +Fx.SmoothScroll = new Class({ + + Extends: Fx.Scroll, + + options: { + axes: ['x', 'y'] + }, + + initialize: function(options, context){ + context = context || document; + this.doc = context.getDocument(); + this.parent(this.doc, options); + + var win = context.getWindow(), + location = win.location.href.match(/^[^#]*/)[0] + '#', + links = $$(this.options.links || this.doc.links); + + links.each(function(link){ + if (link.href.indexOf(location) != 0) return; + var anchor = link.href.substr(location.length); + if (anchor) this.useLink(link, anchor); + }, this); + + this.addEvent('complete', function(){ + win.location.hash = this.anchor; + this.element.scrollTo(this.to[0], this.to[1]); + }, true); + }, + + useLink: function(link, anchor){ + + link.addEvent('click', function(event){ + var el = document.id(anchor) || this.doc.getElement('a[name=' + anchor + ']'); + if (!el) return; + + event.preventDefault(); + this.toElement(el, this.options.axes).chain(function(){ + this.fireEvent('scrolledTo', [link, el]); + }.bind(this)); + + this.anchor = anchor; + + }.bind(this)); + + return this; + } +}); + + +/* +--- + +script: Fx.Sort.js + +name: Fx.Sort + +description: Defines Fx.Sort, a class that reorders lists with a transition. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Element.Dimensions + - /Fx.Elements + - /Element.Measure + +provides: [Fx.Sort] + +... +*/ + +Fx.Sort = new Class({ + + Extends: Fx.Elements, + + options: { + mode: 'vertical' + }, + + initialize: function(elements, options){ + this.parent(elements, options); + this.elements.each(function(el){ + if (el.getStyle('position') == 'static') el.setStyle('position', 'relative'); + }); + this.setDefaultOrder(); + }, + + setDefaultOrder: function(){ + this.currentOrder = this.elements.map(function(el, index){ + return index; + }); + }, + + sort: function(){ + if (!this.check(arguments)) return this; + var newOrder = Array.flatten(arguments); + + var top = 0, + left = 0, + next = {}, + zero = {}, + vert = this.options.mode == 'vertical'; + + var current = this.elements.map(function(el, index){ + var size = el.getComputedSize({styles: ['border', 'padding', 'margin']}); + var val; + if (vert){ + val = { + top: top, + margin: size['margin-top'], + height: size.totalHeight + }; + top += val.height - size['margin-top']; + } else { + val = { + left: left, + margin: size['margin-left'], + width: size.totalWidth + }; + left += val.width; + } + var plane = vert ? 'top' : 'left'; + zero[index] = {}; + var start = el.getStyle(plane).toInt(); + zero[index][plane] = start || 0; + return val; + }, this); + + this.set(zero); + newOrder = newOrder.map(function(i){ return i.toInt(); }); + if (newOrder.length != this.elements.length){ + this.currentOrder.each(function(index){ + if (!newOrder.contains(index)) newOrder.push(index); + }); + if (newOrder.length > this.elements.length) + newOrder.splice(this.elements.length-1, newOrder.length - this.elements.length); + } + var margin = 0; + top = left = 0; + newOrder.each(function(item){ + var newPos = {}; + if (vert){ + newPos.top = top - current[item].top - margin; + top += current[item].height; + } else { + newPos.left = left - current[item].left; + left += current[item].width; + } + margin = margin + current[item].margin; + next[item]=newPos; + }, this); + var mapped = {}; + Array.clone(newOrder).sort().each(function(index){ + mapped[index] = next[index]; + }); + this.start(mapped); + this.currentOrder = newOrder; + + return this; + }, + + rearrangeDOM: function(newOrder){ + newOrder = newOrder || this.currentOrder; + var parent = this.elements[0].getParent(); + var rearranged = []; + this.elements.setStyle('opacity', 0); + //move each element and store the new default order + newOrder.each(function(index){ + rearranged.push(this.elements[index].inject(parent).setStyles({ + top: 0, + left: 0 + })); + }, this); + this.elements.setStyle('opacity', 1); + this.elements = $$(rearranged); + this.setDefaultOrder(); + return this; + }, + + getDefaultOrder: function(){ + return this.elements.map(function(el, index){ + return index; + }); + }, + + getCurrentOrder: function(){ + return this.currentOrder; + }, + + forward: function(){ + return this.sort(this.getDefaultOrder()); + }, + + backward: function(){ + return this.sort(this.getDefaultOrder().reverse()); + }, + + reverse: function(){ + return this.sort(this.currentOrder.reverse()); + }, + + sortByElements: function(elements){ + return this.sort(elements.map(function(el){ + return this.elements.indexOf(el); + }, this)); + }, + + swap: function(one, two){ + if (typeOf(one) == 'element') one = this.elements.indexOf(one); + if (typeOf(two) == 'element') two = this.elements.indexOf(two); + + var newOrder = Array.clone(this.currentOrder); + newOrder[this.currentOrder.indexOf(one)] = two; + newOrder[this.currentOrder.indexOf(two)] = one; + + return this.sort(newOrder); + } + +}); + + +/* +--- + +script: Drag.js + +name: Drag + +description: The base Drag Class. Can be used to drag and resize Elements using mouse events. + +license: MIT-style license + +authors: + - Valerio Proietti + - Tom Occhinno + - Jan Kassens + +requires: + - Core/Events + - Core/Options + - Core/Element.Event + - Core/Element.Style + - Core/Element.Dimensions + - /MooTools.More + +provides: [Drag] +... + +*/ + +var Drag = new Class({ + + Implements: [Events, Options], + + options: {/* + onBeforeStart: function(thisElement){}, + onStart: function(thisElement, event){}, + onSnap: function(thisElement){}, + onDrag: function(thisElement, event){}, + onCancel: function(thisElement){}, + onComplete: function(thisElement, event){},*/ + snap: 6, + unit: 'px', + grid: false, + style: true, + limit: false, + handle: false, + invert: false, + preventDefault: false, + stopPropagation: false, + modifiers: {x: 'left', y: 'top'} + }, + + initialize: function(){ + var params = Array.link(arguments, { + 'options': Type.isObject, + 'element': function(obj){ + return obj != null; + } + }); + + this.element = document.id(params.element); + this.document = this.element.getDocument(); + this.setOptions(params.options || {}); + var htype = typeOf(this.options.handle); + this.handles = ((htype == 'array' || htype == 'collection') ? $$(this.options.handle) : document.id(this.options.handle)) || this.element; + this.mouse = {'now': {}, 'pos': {}}; + this.value = {'start': {}, 'now': {}}; + + this.selection = (Browser.ie) ? 'selectstart' : 'mousedown'; + + + if (Browser.ie && !Drag.ondragstartFixed){ + document.ondragstart = Function.from(false); + Drag.ondragstartFixed = true; + } + + this.bound = { + start: this.start.bind(this), + check: this.check.bind(this), + drag: this.drag.bind(this), + stop: this.stop.bind(this), + cancel: this.cancel.bind(this), + eventStop: Function.from(false) + }; + this.attach(); + }, + + attach: function(){ + this.handles.addEvent('mousedown', this.bound.start); + return this; + }, + + detach: function(){ + this.handles.removeEvent('mousedown', this.bound.start); + return this; + }, + + start: function(event){ + var options = this.options; + + if (event.rightClick) return; + + if (options.preventDefault) event.preventDefault(); + if (options.stopPropagation) event.stopPropagation(); + this.mouse.start = event.page; + + this.fireEvent('beforeStart', this.element); + + var limit = options.limit; + this.limit = {x: [], y: []}; + + var z, coordinates; + for (z in options.modifiers){ + if (!options.modifiers[z]) continue; + + var style = this.element.getStyle(options.modifiers[z]); + + // Some browsers (IE and Opera) don't always return pixels. + if (style && !style.match(/px$/)){ + if (!coordinates) coordinates = this.element.getCoordinates(this.element.getOffsetParent()); + style = coordinates[options.modifiers[z]]; + } + + if (options.style) this.value.now[z] = (style || 0).toInt(); + else this.value.now[z] = this.element[options.modifiers[z]]; + + if (options.invert) this.value.now[z] *= -1; + + this.mouse.pos[z] = event.page[z] - this.value.now[z]; + + if (limit && limit[z]){ + var i = 2; + while (i--){ + var limitZI = limit[z][i]; + if (limitZI || limitZI === 0) this.limit[z][i] = (typeof limitZI == 'function') ? limitZI() : limitZI; + } + } + } + + if (typeOf(this.options.grid) == 'number') this.options.grid = { + x: this.options.grid, + y: this.options.grid + }; + + var events = { + mousemove: this.bound.check, + mouseup: this.bound.cancel + }; + events[this.selection] = this.bound.eventStop; + this.document.addEvents(events); + }, + + check: function(event){ + if (this.options.preventDefault) event.preventDefault(); + var distance = Math.round(Math.sqrt(Math.pow(event.page.x - this.mouse.start.x, 2) + Math.pow(event.page.y - this.mouse.start.y, 2))); + if (distance > this.options.snap){ + this.cancel(); + this.document.addEvents({ + mousemove: this.bound.drag, + mouseup: this.bound.stop + }); + this.fireEvent('start', [this.element, event]).fireEvent('snap', this.element); + } + }, + + drag: function(event){ + var options = this.options; + + if (options.preventDefault) event.preventDefault(); + this.mouse.now = event.page; + + for (var z in options.modifiers){ + if (!options.modifiers[z]) continue; + this.value.now[z] = this.mouse.now[z] - this.mouse.pos[z]; + + if (options.invert) this.value.now[z] *= -1; + + if (options.limit && this.limit[z]){ + if ((this.limit[z][1] || this.limit[z][1] === 0) && (this.value.now[z] > this.limit[z][1])){ + this.value.now[z] = this.limit[z][1]; + } else if ((this.limit[z][0] || this.limit[z][0] === 0) && (this.value.now[z] < this.limit[z][0])){ + this.value.now[z] = this.limit[z][0]; + } + } + + if (options.grid[z]) this.value.now[z] -= ((this.value.now[z] - (this.limit[z][0]||0)) % options.grid[z]); + + if (options.style) this.element.setStyle(options.modifiers[z], this.value.now[z] + options.unit); + else this.element[options.modifiers[z]] = this.value.now[z]; + } + + this.fireEvent('drag', [this.element, event]); + }, + + cancel: function(event){ + this.document.removeEvents({ + mousemove: this.bound.check, + mouseup: this.bound.cancel + }); + if (event){ + this.document.removeEvent(this.selection, this.bound.eventStop); + this.fireEvent('cancel', this.element); + } + }, + + stop: function(event){ + var events = { + mousemove: this.bound.drag, + mouseup: this.bound.stop + }; + events[this.selection] = this.bound.eventStop; + this.document.removeEvents(events); + if (event) this.fireEvent('complete', [this.element, event]); + } + +}); + +Element.implement({ + + makeResizable: function(options){ + var drag = new Drag(this, Object.merge({ + modifiers: { + x: 'width', + y: 'height' + } + }, options)); + + this.store('resizer', drag); + return drag.addEvent('drag', function(){ + this.fireEvent('resize', drag); + }.bind(this)); + } + +}); + + +/* +--- + +script: Drag.Move.js + +name: Drag.Move + +description: A Drag extension that provides support for the constraining of draggables to containers and droppables. + +license: MIT-style license + +authors: + - Valerio Proietti + - Tom Occhinno + - Jan Kassens + - Aaron Newton + - Scott Kyle + +requires: + - Core/Element.Dimensions + - /Drag + +provides: [Drag.Move] + +... +*/ + +Drag.Move = new Class({ + + Extends: Drag, + + options: {/* + onEnter: function(thisElement, overed){}, + onLeave: function(thisElement, overed){}, + onDrop: function(thisElement, overed, event){},*/ + droppables: [], + container: false, + precalculate: false, + includeMargins: true, + checkDroppables: true + }, + + initialize: function(element, options){ + this.parent(element, options); + element = this.element; + + this.droppables = $$(this.options.droppables); + this.container = document.id(this.options.container); + + if (this.container && typeOf(this.container) != 'element') + this.container = document.id(this.container.getDocument().body); + + if (this.options.style){ + if (this.options.modifiers.x == 'left' && this.options.modifiers.y == 'top'){ + var parent = element.getOffsetParent(), + styles = element.getStyles('left', 'top'); + if (parent && (styles.left == 'auto' || styles.top == 'auto')){ + element.setPosition(element.getPosition(parent)); + } + } + + if (element.getStyle('position') == 'static') element.setStyle('position', 'absolute'); + } + + this.addEvent('start', this.checkDroppables, true); + this.overed = null; + }, + + start: function(event){ + if (this.container) this.options.limit = this.calculateLimit(); + + if (this.options.precalculate){ + this.positions = this.droppables.map(function(el){ + return el.getCoordinates(); + }); + } + + this.parent(event); + }, + + calculateLimit: function(){ + var element = this.element, + container = this.container, + + offsetParent = document.id(element.getOffsetParent()) || document.body, + containerCoordinates = container.getCoordinates(offsetParent), + elementMargin = {}, + elementBorder = {}, + containerMargin = {}, + containerBorder = {}, + offsetParentPadding = {}; + + ['top', 'right', 'bottom', 'left'].each(function(pad){ + elementMargin[pad] = element.getStyle('margin-' + pad).toInt(); + elementBorder[pad] = element.getStyle('border-' + pad).toInt(); + containerMargin[pad] = container.getStyle('margin-' + pad).toInt(); + containerBorder[pad] = container.getStyle('border-' + pad).toInt(); + offsetParentPadding[pad] = offsetParent.getStyle('padding-' + pad).toInt(); + }, this); + + var width = element.offsetWidth + elementMargin.left + elementMargin.right, + height = element.offsetHeight + elementMargin.top + elementMargin.bottom, + left = 0, + top = 0, + right = containerCoordinates.right - containerBorder.right - width, + bottom = containerCoordinates.bottom - containerBorder.bottom - height; + + if (this.options.includeMargins){ + left += elementMargin.left; + top += elementMargin.top; + } else { + right += elementMargin.right; + bottom += elementMargin.bottom; + } + + if (element.getStyle('position') == 'relative'){ + var coords = element.getCoordinates(offsetParent); + coords.left -= element.getStyle('left').toInt(); + coords.top -= element.getStyle('top').toInt(); + + left -= coords.left; + top -= coords.top; + if (container.getStyle('position') != 'relative'){ + left += containerBorder.left; + top += containerBorder.top; + } + right += elementMargin.left - coords.left; + bottom += elementMargin.top - coords.top; + + if (container != offsetParent){ + left += containerMargin.left + offsetParentPadding.left; + top += ((Browser.ie6 || Browser.ie7) ? 0 : containerMargin.top) + offsetParentPadding.top; + } + } else { + left -= elementMargin.left; + top -= elementMargin.top; + if (container != offsetParent){ + left += containerCoordinates.left + containerBorder.left; + top += containerCoordinates.top + containerBorder.top; + } + } + + return { + x: [left, right], + y: [top, bottom] + }; + }, + + getDroppableCoordinates: function(element){ + var position = element.getCoordinates(); + if (element.getStyle('position') == 'fixed'){ + var scroll = window.getScroll(); + position.left += scroll.x; + position.right += scroll.x; + position.top += scroll.y; + position.bottom += scroll.y; + } + return position; + }, + + checkDroppables: function(){ + var overed = this.droppables.filter(function(el, i){ + el = this.positions ? this.positions[i] : this.getDroppableCoordinates(el); + var now = this.mouse.now; + return (now.x > el.left && now.x < el.right && now.y < el.bottom && now.y > el.top); + }, this).getLast(); + + if (this.overed != overed){ + if (this.overed) this.fireEvent('leave', [this.element, this.overed]); + if (overed) this.fireEvent('enter', [this.element, overed]); + this.overed = overed; + } + }, + + drag: function(event){ + this.parent(event); + if (this.options.checkDroppables && this.droppables.length) this.checkDroppables(); + }, + + stop: function(event){ + this.checkDroppables(); + this.fireEvent('drop', [this.element, this.overed, event]); + this.overed = null; + return this.parent(event); + } + +}); + +Element.implement({ + + makeDraggable: function(options){ + var drag = new Drag.Move(this, options); + this.store('dragger', drag); + return drag; + } + +}); + + +/* +--- + +script: Slider.js + +name: Slider + +description: Class for creating horizontal and vertical slider controls. + +license: MIT-style license + +authors: + - Valerio Proietti + +requires: + - Core/Element.Dimensions + - /Class.Binds + - /Drag + - /Element.Measure + +provides: [Slider] + +... +*/ + +var Slider = new Class({ + + Implements: [Events, Options], + + Binds: ['clickedElement', 'draggedKnob', 'scrolledElement'], + + options: {/* + onTick: function(intPosition){}, + onChange: function(intStep){}, + onComplete: function(strStep){},*/ + onTick: function(position){ + this.setKnobPosition(position); + }, + initialStep: 0, + snap: false, + offset: 0, + range: false, + wheel: false, + steps: 100, + mode: 'horizontal' + }, + + initialize: function(element, knob, options){ + this.setOptions(options); + options = this.options; + this.element = document.id(element); + knob = this.knob = document.id(knob); + this.previousChange = this.previousEnd = this.step = -1; + + var limit = {}, + modifiers = {x: false, y: false}; + + switch (options.mode){ + case 'vertical': + this.axis = 'y'; + this.property = 'top'; + this.offset = 'offsetHeight'; + break; + case 'horizontal': + this.axis = 'x'; + this.property = 'left'; + this.offset = 'offsetWidth'; + } + + this.setSliderDimensions(); + this.setRange(options.range); + + if (knob.getStyle('position') == 'static') knob.setStyle('position', 'relative'); + knob.setStyle(this.property, -options.offset); + modifiers[this.axis] = this.property; + limit[this.axis] = [-options.offset, this.full - options.offset]; + + var dragOptions = { + snap: 0, + limit: limit, + modifiers: modifiers, + onDrag: this.draggedKnob, + onStart: this.draggedKnob, + onBeforeStart: (function(){ + this.isDragging = true; + }).bind(this), + onCancel: function(){ + this.isDragging = false; + }.bind(this), + onComplete: function(){ + this.isDragging = false; + this.draggedKnob(); + this.end(); + }.bind(this) + }; + if (options.snap) this.setSnap(dragOptions); + + this.drag = new Drag(knob, dragOptions); + this.attach(); + if (options.initialStep != null) this.set(options.initialStep); + }, + + attach: function(){ + this.element.addEvent('mousedown', this.clickedElement); + if (this.options.wheel) this.element.addEvent('mousewheel', this.scrolledElement); + this.drag.attach(); + return this; + }, + + detach: function(){ + this.element.removeEvent('mousedown', this.clickedElement) + .removeEvent('mousewheel', this.scrolledElement); + this.drag.detach(); + return this; + }, + + autosize: function(){ + this.setSliderDimensions() + .setKnobPosition(this.toPosition(this.step)); + this.drag.options.limit[this.axis] = [-this.options.offset, this.full - this.options.offset]; + if (this.options.snap) this.setSnap(); + return this; + }, + + setSnap: function(options){ + if (!options) options = this.drag.options; + options.grid = Math.ceil(this.stepWidth); + options.limit[this.axis][1] = this.full; + return this; + }, + + setKnobPosition: function(position){ + if (this.options.snap) position = this.toPosition(this.step); + this.knob.setStyle(this.property, position); + return this; + }, + + setSliderDimensions: function(){ + this.full = this.element.measure(function(){ + this.half = this.knob[this.offset] / 2; + return this.element[this.offset] - this.knob[this.offset] + (this.options.offset * 2); + }.bind(this)); + return this; + }, + + set: function(step){ + if (!((this.range > 0) ^ (step < this.min))) step = this.min; + if (!((this.range > 0) ^ (step > this.max))) step = this.max; + + this.step = Math.round(step); + return this.checkStep() + .fireEvent('tick', this.toPosition(this.step)) + .end(); + }, + + setRange: function(range, pos){ + this.min = Array.pick([range[0], 0]); + this.max = Array.pick([range[1], this.options.steps]); + this.range = this.max - this.min; + this.steps = this.options.steps || this.full; + this.stepSize = Math.abs(this.range) / this.steps; + this.stepWidth = this.stepSize * this.full / Math.abs(this.range); + if (range) this.set(Array.pick([pos, this.step]).floor(this.min).max(this.max)); + return this; + }, + + clickedElement: function(event){ + if (this.isDragging || event.target == this.knob) return; + + var dir = this.range < 0 ? -1 : 1, + position = event.page[this.axis] - this.element.getPosition()[this.axis] - this.half; + + position = position.limit(-this.options.offset, this.full - this.options.offset); + + this.step = Math.round(this.min + dir * this.toStep(position)); + + this.checkStep() + .fireEvent('tick', position) + .end(); + }, + + scrolledElement: function(event){ + var mode = (this.options.mode == 'horizontal') ? (event.wheel < 0) : (event.wheel > 0); + this.set(this.step + (mode ? -1 : 1) * this.stepSize); + event.stop(); + }, + + draggedKnob: function(){ + var dir = this.range < 0 ? -1 : 1, + position = this.drag.value.now[this.axis]; + + position = position.limit(-this.options.offset, this.full -this.options.offset); + + this.step = Math.round(this.min + dir * this.toStep(position)); + this.checkStep(); + }, + + checkStep: function(){ + var step = this.step; + if (this.previousChange != step){ + this.previousChange = step; + this.fireEvent('change', step); + } + return this; + }, + + end: function(){ + var step = this.step; + if (this.previousEnd !== step){ + this.previousEnd = step; + this.fireEvent('complete', step + ''); + } + return this; + }, + + toStep: function(position){ + var step = (position + this.options.offset) * this.stepSize / this.full * this.steps; + return this.options.steps ? Math.round(step -= step % this.stepSize) : step; + }, + + toPosition: function(step){ + return (this.full * Math.abs(this.min - step)) / (this.steps * this.stepSize) - this.options.offset; + } + +}); + + +/* +--- + +script: Sortables.js + +name: Sortables + +description: Class for creating a drag and drop sorting interface for lists of items. + +license: MIT-style license + +authors: + - Tom Occhino + +requires: + - Core/Fx.Morph + - /Drag.Move + +provides: [Sortables] + +... +*/ + +var Sortables = new Class({ + + Implements: [Events, Options], + + options: {/* + onSort: function(element, clone){}, + onStart: function(element, clone){}, + onComplete: function(element){},*/ + opacity: 1, + clone: false, + revert: false, + handle: false, + dragOptions: {} + }, + + initialize: function(lists, options){ + this.setOptions(options); + + this.elements = []; + this.lists = []; + this.idle = true; + + this.addLists($$(document.id(lists) || lists)); + + if (!this.options.clone) this.options.revert = false; + if (this.options.revert) this.effect = new Fx.Morph(null, Object.merge({ + duration: 250, + link: 'cancel' + }, this.options.revert)); + }, + + attach: function(){ + this.addLists(this.lists); + return this; + }, + + detach: function(){ + this.lists = this.removeLists(this.lists); + return this; + }, + + addItems: function(){ + Array.flatten(arguments).each(function(element){ + this.elements.push(element); + var start = element.retrieve('sortables:start', function(event){ + this.start.call(this, event, element); + }.bind(this)); + (this.options.handle ? element.getElement(this.options.handle) || element : element).addEvent('mousedown', start); + }, this); + return this; + }, + + addLists: function(){ + Array.flatten(arguments).each(function(list){ + this.lists.include(list); + this.addItems(list.getChildren()); + }, this); + return this; + }, + + removeItems: function(){ + return $$(Array.flatten(arguments).map(function(element){ + this.elements.erase(element); + var start = element.retrieve('sortables:start'); + (this.options.handle ? element.getElement(this.options.handle) || element : element).removeEvent('mousedown', start); + + return element; + }, this)); + }, + + removeLists: function(){ + return $$(Array.flatten(arguments).map(function(list){ + this.lists.erase(list); + this.removeItems(list.getChildren()); + + return list; + }, this)); + }, + + getClone: function(event, element){ + if (!this.options.clone) return new Element(element.tagName).inject(document.body); + if (typeOf(this.options.clone) == 'function') return this.options.clone.call(this, event, element, this.list); + var clone = element.clone(true).setStyles({ + margin: 0, + position: 'absolute', + visibility: 'hidden', + width: element.getStyle('width') + }).addEvent('mousedown', function(event){ + element.fireEvent('mousedown', event); + }); + //prevent the duplicated radio inputs from unchecking the real one + if (clone.get('html').test('radio')){ + clone.getElements('input[type=radio]').each(function(input, i){ + input.set('name', 'clone_' + i); + if (input.get('checked')) element.getElements('input[type=radio]')[i].set('checked', true); + }); + } + + return clone.inject(this.list).setPosition(element.getPosition(element.getOffsetParent())); + }, + + getDroppables: function(){ + var droppables = this.list.getChildren().erase(this.clone).erase(this.element); + if (!this.options.constrain) droppables.append(this.lists).erase(this.list); + return droppables; + }, + + insert: function(dragging, element){ + var where = 'inside'; + if (this.lists.contains(element)){ + this.list = element; + this.drag.droppables = this.getDroppables(); + } else { + where = this.element.getAllPrevious().contains(element) ? 'before' : 'after'; + } + this.element.inject(element, where); + this.fireEvent('sort', [this.element, this.clone]); + }, + + start: function(event, element){ + if ( + !this.idle || + event.rightClick || + ['button', 'input', 'a'].contains(event.target.get('tag')) + ) return; + + this.idle = false; + this.element = element; + this.opacity = element.get('opacity'); + this.list = element.getParent(); + this.clone = this.getClone(event, element); + + this.drag = new Drag.Move(this.clone, Object.merge({ + + droppables: this.getDroppables() + }, this.options.dragOptions)).addEvents({ + onSnap: function(){ + event.stop(); + this.clone.setStyle('visibility', 'visible'); + this.element.set('opacity', this.options.opacity || 0); + this.fireEvent('start', [this.element, this.clone]); + }.bind(this), + onEnter: this.insert.bind(this), + onCancel: this.end.bind(this), + onComplete: this.end.bind(this) + }); + + this.clone.inject(this.element, 'before'); + this.drag.start(event); + }, + + end: function(){ + this.drag.detach(); + this.element.set('opacity', this.opacity); + if (this.effect){ + var dim = this.element.getStyles('width', 'height'), + clone = this.clone, + pos = clone.computePosition(this.element.getPosition(this.clone.getOffsetParent())); + + var destroy = function(){ + this.removeEvent('cancel', destroy); + clone.destroy(); + }; + + this.effect.element = clone; + this.effect.start({ + top: pos.top, + left: pos.left, + width: dim.width, + height: dim.height, + opacity: 0.25 + }).addEvent('cancel', destroy).chain(destroy); + } else { + this.clone.destroy(); + } + this.reset(); + }, + + reset: function(){ + this.idle = true; + this.fireEvent('complete', this.element); + }, + + serialize: function(){ + var params = Array.link(arguments, { + modifier: Type.isFunction, + index: function(obj){ + return obj != null; + } + }); + var serial = this.lists.map(function(list){ + return list.getChildren().map(params.modifier || function(element){ + return element.get('id'); + }, this); + }, this); + + var index = params.index; + if (this.lists.length == 1) index = 0; + return (index || index === 0) && index >= 0 && index < this.lists.length ? serial[index] : serial; + } + +}); + + +/* +--- + +script: Request.JSONP.js + +name: Request.JSONP + +description: Defines Request.JSONP, a class for cross domain javascript via script injection. + +license: MIT-style license + +authors: + - Aaron Newton + - Guillermo Rauch + - Arian Stolwijk + +requires: + - Core/Element + - Core/Request + - MooTools.More + +provides: [Request.JSONP] + +... +*/ + +Request.JSONP = new Class({ + + Implements: [Chain, Events, Options], + + options: {/* + onRequest: function(src, scriptElement){}, + onComplete: function(data){}, + onSuccess: function(data){}, + onCancel: function(){}, + onTimeout: function(){}, + onError: function(){}, */ + onRequest: function(src){ + if (this.options.log && window.console && console.log){ + console.log('JSONP retrieving script with url:' + src); + } + }, + onError: function(src){ + if (this.options.log && window.console && console.warn){ + console.warn('JSONP '+ src +' will fail in Internet Explorer, which enforces a 2083 bytes length limit on URIs'); + } + }, + url: '', + callbackKey: 'callback', + injectScript: document.head, + data: '', + link: 'ignore', + timeout: 0, + log: false + }, + + initialize: function(options){ + this.setOptions(options); + }, + + send: function(options){ + if (!Request.prototype.check.call(this, options)) return this; + this.running = true; + + var type = typeOf(options); + if (type == 'string' || type == 'element') options = {data: options}; + options = Object.merge(this.options, options || {}); + + var data = options.data; + switch (typeOf(data)){ + case 'element': data = document.id(data).toQueryString(); break; + case 'object': case 'hash': data = Object.toQueryString(data); + } + + var index = this.index = Request.JSONP.counter++; + + var src = options.url + + (options.url.test('\\?') ? '&' :'?') + + (options.callbackKey) + + '=Request.JSONP.request_map.request_'+ index + + (data ? '&' + data : ''); + + if (src.length > 2083) this.fireEvent('error', src); + + Request.JSONP.request_map['request_' + index] = function(){ + this.success(arguments, index); + }.bind(this); + + var script = this.getScript(src).inject(options.injectScript); + this.fireEvent('request', [src, script]); + + if (options.timeout) this.timeout.delay(options.timeout, this); + + return this; + }, + + getScript: function(src){ + if (!this.script) this.script = new Element('script', { + type: 'text/javascript', + async: true, + src: src + }); + return this.script; + }, + + success: function(args, index){ + if (!this.running) return; + this.clear() + .fireEvent('complete', args).fireEvent('success', args) + .callChain(); + }, + + cancel: function(){ + if (this.running) this.clear().fireEvent('cancel'); + return this; + }, + + isRunning: function(){ + return !!this.running; + }, + + clear: function(){ + this.running = false; + if (this.script){ + this.script.destroy(); + this.script = null; + } + return this; + }, + + timeout: function(){ + if (this.running){ + this.running = false; + this.fireEvent('timeout', [this.script.get('src'), this.script]).fireEvent('failure').cancel(); + } + return this; + } + +}); + +Request.JSONP.counter = 0; +Request.JSONP.request_map = {}; + + +/* +--- + +script: Request.Queue.js + +name: Request.Queue + +description: Controls several instances of Request and its variants to run only one request at a time. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Element + - Core/Request + - /Class.Binds + +provides: [Request.Queue] + +... +*/ + +Request.Queue = new Class({ + + Implements: [Options, Events], + + Binds: ['attach', 'request', 'complete', 'cancel', 'success', 'failure', 'exception'], + + options: {/* + onRequest: function(argsPassedToOnRequest){}, + onSuccess: function(argsPassedToOnSuccess){}, + onComplete: function(argsPassedToOnComplete){}, + onCancel: function(argsPassedToOnCancel){}, + onException: function(argsPassedToOnException){}, + onFailure: function(argsPassedToOnFailure){}, + onEnd: function(){}, + */ + stopOnFailure: true, + autoAdvance: true, + concurrent: 1, + requests: {} + }, + + initialize: function(options){ + var requests; + if (options){ + requests = options.requests; + delete options.requests; + } + this.setOptions(options); + this.requests = {}; + this.queue = []; + this.reqBinders = {}; + + if (requests) this.addRequests(requests); + }, + + addRequest: function(name, request){ + this.requests[name] = request; + this.attach(name, request); + return this; + }, + + addRequests: function(obj){ + Object.each(obj, function(req, name){ + this.addRequest(name, req); + }, this); + return this; + }, + + getName: function(req){ + return Object.keyOf(this.requests, req); + }, + + attach: function(name, req){ + if (req._groupSend) return this; + ['request', 'complete', 'cancel', 'success', 'failure', 'exception'].each(function(evt){ + if (!this.reqBinders[name]) this.reqBinders[name] = {}; + this.reqBinders[name][evt] = function(){ + this['on' + evt.capitalize()].apply(this, [name, req].append(arguments)); + }.bind(this); + req.addEvent(evt, this.reqBinders[name][evt]); + }, this); + req._groupSend = req.send; + req.send = function(options){ + this.send(name, options); + return req; + }.bind(this); + return this; + }, + + removeRequest: function(req){ + var name = typeOf(req) == 'object' ? this.getName(req) : req; + if (!name && typeOf(name) != 'string') return this; + req = this.requests[name]; + if (!req) return this; + ['request', 'complete', 'cancel', 'success', 'failure', 'exception'].each(function(evt){ + req.removeEvent(evt, this.reqBinders[name][evt]); + }, this); + req.send = req._groupSend; + delete req._groupSend; + return this; + }, + + getRunning: function(){ + return Object.filter(this.requests, function(r){ + return r.running; + }); + }, + + isRunning: function(){ + return !!(Object.keys(this.getRunning()).length); + }, + + send: function(name, options){ + var q = function(){ + this.requests[name]._groupSend(options); + this.queue.erase(q); + }.bind(this); + + q.name = name; + if (Object.keys(this.getRunning()).length >= this.options.concurrent || (this.error && this.options.stopOnFailure)) this.queue.push(q); + else q(); + return this; + }, + + hasNext: function(name){ + return (!name) ? !!this.queue.length : !!this.queue.filter(function(q){ return q.name == name; }).length; + }, + + resume: function(){ + this.error = false; + (this.options.concurrent - Object.keys(this.getRunning()).length).times(this.runNext, this); + return this; + }, + + runNext: function(name){ + if (!this.queue.length) return this; + if (!name){ + this.queue[0](); + } else { + var found; + this.queue.each(function(q){ + if (!found && q.name == name){ + found = true; + q(); + } + }); + } + return this; + }, + + runAll: function(){ + this.queue.each(function(q){ + q(); + }); + return this; + }, + + clear: function(name){ + if (!name){ + this.queue.empty(); + } else { + this.queue = this.queue.map(function(q){ + if (q.name != name) return q; + else return false; + }).filter(function(q){ + return q; + }); + } + return this; + }, + + cancel: function(name){ + this.requests[name].cancel(); + return this; + }, + + onRequest: function(){ + this.fireEvent('request', arguments); + }, + + onComplete: function(){ + this.fireEvent('complete', arguments); + if (!this.queue.length) this.fireEvent('end'); + }, + + onCancel: function(){ + if (this.options.autoAdvance && !this.error) this.runNext(); + this.fireEvent('cancel', arguments); + }, + + onSuccess: function(){ + if (this.options.autoAdvance && !this.error) this.runNext(); + this.fireEvent('success', arguments); + }, + + onFailure: function(){ + this.error = true; + if (!this.options.stopOnFailure && this.options.autoAdvance) this.runNext(); + this.fireEvent('failure', arguments); + }, + + onException: function(){ + this.error = true; + if (!this.options.stopOnFailure && this.options.autoAdvance) this.runNext(); + this.fireEvent('exception', arguments); + } + +}); + + +/* +--- + +script: Request.Periodical.js + +name: Request.Periodical + +description: Requests the same URL to pull data from a server but increases the intervals if no data is returned to reduce the load + +license: MIT-style license + +authors: + - Christoph Pojer + +requires: + - Core/Request + - /MooTools.More + +provides: [Request.Periodical] + +... +*/ + +Request.implement({ + + options: { + initialDelay: 5000, + delay: 5000, + limit: 60000 + }, + + startTimer: function(data){ + var fn = function(){ + if (!this.running) this.send({data: data}); + }; + this.lastDelay = this.options.initialDelay; + this.timer = fn.delay(this.lastDelay, this); + this.completeCheck = function(response){ + clearTimeout(this.timer); + this.lastDelay = (response) ? this.options.delay : (this.lastDelay + this.options.delay).min(this.options.limit); + this.timer = fn.delay(this.lastDelay, this); + }; + return this.addEvent('complete', this.completeCheck); + }, + + stopTimer: function(){ + clearTimeout(this.timer); + return this.removeEvent('complete', this.completeCheck); + } + +}); + + +/* +--- + +script: Assets.js + +name: Assets + +description: Provides methods to dynamically load JavaScript, CSS, and Image files into the document. + +license: MIT-style license + +authors: + - Valerio Proietti + +requires: + - Core/Element.Event + - /MooTools.More + +provides: [Assets] + +... +*/ + +var Asset = { + + javascript: function(source, properties){ + if (!properties) properties = {}; + + var script = new Element('script', {src: source, type: 'text/javascript'}), + doc = properties.document || document, + loaded = 0, + loadEvent = properties.onload || properties.onLoad; + + var load = loadEvent ? function(){ // make sure we only call the event once + if (++loaded == 1) loadEvent.call(this); + } : function(){}; + + delete properties.onload; + delete properties.onLoad; + delete properties.document; + + return script.addEvents({ + load: load, + readystatechange: function(){ + if (['loaded', 'complete'].contains(this.readyState)) load.call(this); + } + }).set(properties).inject(doc.head); + }, + + css: function(source, properties){ + if (!properties) properties = {}; + + var link = new Element('link', { + rel: 'stylesheet', + media: 'screen', + type: 'text/css', + href: source + }); + + var load = properties.onload || properties.onLoad, + doc = properties.document || document; + + delete properties.onload; + delete properties.onLoad; + delete properties.document; + + if (load) link.addEvent('load', load); + return link.set(properties).inject(doc.head); + }, + + image: function(source, properties){ + if (!properties) properties = {}; + + var image = new Image(), + element = document.id(image) || new Element('img'); + + ['load', 'abort', 'error'].each(function(name){ + var type = 'on' + name, + cap = 'on' + name.capitalize(), + event = properties[type] || properties[cap] || function(){}; + + delete properties[cap]; + delete properties[type]; + + image[type] = function(){ + if (!image) return; + if (!element.parentNode){ + element.width = image.width; + element.height = image.height; + } + image = image.onload = image.onabort = image.onerror = null; + event.delay(1, element, element); + element.fireEvent(name, element, 1); + }; + }); + + image.src = element.src = source; + if (image && image.complete) image.onload.delay(1); + return element.set(properties); + }, + + images: function(sources, options){ + sources = Array.from(sources); + + var fn = function(){}, + counter = 0; + + options = Object.merge({ + onComplete: fn, + onProgress: fn, + onError: fn, + properties: {} + }, options); + + return new Elements(sources.map(function(source, index){ + return Asset.image(source, Object.append(options.properties, { + onload: function(){ + counter++; + options.onProgress.call(this, counter, index, source); + if (counter == sources.length) options.onComplete(); + }, + onerror: function(){ + counter++; + options.onError.call(this, counter, index, source); + if (counter == sources.length) options.onComplete(); + } + })); + })); + } + +}; + + +/* +--- + +script: Color.js + +name: Color + +description: Class for creating and manipulating colors in JavaScript. Supports HSB -> RGB Conversions and vice versa. + +license: MIT-style license + +authors: + - Valerio Proietti + +requires: + - Core/Array + - Core/String + - Core/Number + - Core/Hash + - Core/Function + - MooTools.More + +provides: [Color] + +... +*/ + +(function(){ + +var Color = this.Color = new Type('Color', function(color, type){ + if (arguments.length >= 3){ + type = 'rgb'; color = Array.slice(arguments, 0, 3); + } else if (typeof color == 'string'){ + if (color.match(/rgb/)) color = color.rgbToHex().hexToRgb(true); + else if (color.match(/hsb/)) color = color.hsbToRgb(); + else color = color.hexToRgb(true); + } + type = type || 'rgb'; + switch (type){ + case 'hsb': + var old = color; + color = color.hsbToRgb(); + color.hsb = old; + break; + case 'hex': color = color.hexToRgb(true); break; + } + color.rgb = color.slice(0, 3); + color.hsb = color.hsb || color.rgbToHsb(); + color.hex = color.rgbToHex(); + return Object.append(color, this); +}); + +Color.implement({ + + mix: function(){ + var colors = Array.slice(arguments); + var alpha = (typeOf(colors.getLast()) == 'number') ? colors.pop() : 50; + var rgb = this.slice(); + colors.each(function(color){ + color = new Color(color); + for (var i = 0; i < 3; i++) rgb[i] = Math.round((rgb[i] / 100 * (100 - alpha)) + (color[i] / 100 * alpha)); + }); + return new Color(rgb, 'rgb'); + }, + + invert: function(){ + return new Color(this.map(function(value){ + return 255 - value; + })); + }, + + setHue: function(value){ + return new Color([value, this.hsb[1], this.hsb[2]], 'hsb'); + }, + + setSaturation: function(percent){ + return new Color([this.hsb[0], percent, this.hsb[2]], 'hsb'); + }, + + setBrightness: function(percent){ + return new Color([this.hsb[0], this.hsb[1], percent], 'hsb'); + } + +}); + +this.$RGB = function(r, g, b){ + return new Color([r, g, b], 'rgb'); +}; + +this.$HSB = function(h, s, b){ + return new Color([h, s, b], 'hsb'); +}; + +this.$HEX = function(hex){ + return new Color(hex, 'hex'); +}; + +Array.implement({ + + rgbToHsb: function(){ + var red = this[0], + green = this[1], + blue = this[2], + hue = 0; + var max = Math.max(red, green, blue), + min = Math.min(red, green, blue); + var delta = max - min; + var brightness = max / 255, + saturation = (max != 0) ? delta / max : 0; + if (saturation != 0){ + var rr = (max - red) / delta; + var gr = (max - green) / delta; + var br = (max - blue) / delta; + if (red == max) hue = br - gr; + else if (green == max) hue = 2 + rr - br; + else hue = 4 + gr - rr; + hue /= 6; + if (hue < 0) hue++; + } + return [Math.round(hue * 360), Math.round(saturation * 100), Math.round(brightness * 100)]; + }, + + hsbToRgb: function(){ + var br = Math.round(this[2] / 100 * 255); + if (this[1] == 0){ + return [br, br, br]; + } else { + var hue = this[0] % 360; + var f = hue % 60; + var p = Math.round((this[2] * (100 - this[1])) / 10000 * 255); + var q = Math.round((this[2] * (6000 - this[1] * f)) / 600000 * 255); + var t = Math.round((this[2] * (6000 - this[1] * (60 - f))) / 600000 * 255); + switch (Math.floor(hue / 60)){ + case 0: return [br, t, p]; + case 1: return [q, br, p]; + case 2: return [p, br, t]; + case 3: return [p, q, br]; + case 4: return [t, p, br]; + case 5: return [br, p, q]; + } + } + return false; + } + +}); + +String.implement({ + + rgbToHsb: function(){ + var rgb = this.match(/\d{1,3}/g); + return (rgb) ? rgb.rgbToHsb() : null; + }, + + hsbToRgb: function(){ + var hsb = this.match(/\d{1,3}/g); + return (hsb) ? hsb.hsbToRgb() : null; + } + +}); + +})(); + + + +/* +--- + +script: Group.js + +name: Group + +description: Class for monitoring collections of events + +license: MIT-style license + +authors: + - Valerio Proietti + +requires: + - Core/Events + - /MooTools.More + +provides: [Group] + +... +*/ + +(function(){ + +this.Group = new Class({ + + initialize: function(){ + this.instances = Array.flatten(arguments); + this.events = {}; + this.checker = {}; + }, + + addEvent: function(type, fn){ + this.checker[type] = this.checker[type] || {}; + this.events[type] = this.events[type] || []; + if (this.events[type].contains(fn)) return false; + else this.events[type].push(fn); + this.instances.each(function(instance, i){ + instance.addEvent(type, this.check.pass([type, instance, i], this)); + }, this); + return this; + }, + + check: function(type, instance, i){ + this.checker[type][i] = true; + var every = this.instances.every(function(current, j){ + return this.checker[type][j] || false; + }, this); + if (!every) return; + this.checker[type] = {}; + this.events[type].each(function(event){ + event.call(this, this.instances, instance); + }, this); + } + +}); + +})(); + + + +/* +--- + +script: Hash.Cookie.js + +name: Hash.Cookie + +description: Class for creating, reading, and deleting Cookies in JSON format. + +license: MIT-style license + +authors: + - Valerio Proietti + - Aaron Newton + +requires: + - Core/Cookie + - Core/JSON + - /MooTools.More + - /Hash + +provides: [Hash.Cookie] + +... +*/ + +Hash.Cookie = new Class({ + + Extends: Cookie, + + options: { + autoSave: true + }, + + initialize: function(name, options){ + this.parent(name, options); + this.load(); + }, + + save: function(){ + var value = JSON.encode(this.hash); + if (!value || value.length > 4096) return false; //cookie would be truncated! + if (value == '{}') this.dispose(); + else this.write(value); + return true; + }, + + load: function(){ + this.hash = new Hash(JSON.decode(this.read(), true)); + return this; + } + +}); + +Hash.each(Hash.prototype, function(method, name){ + if (typeof method == 'function') Hash.Cookie.implement(name, function(){ + var value = method.apply(this.hash, arguments); + if (this.options.autoSave) this.save(); + return value; + }); +}); + + +/* +--- +name: Table +description: LUA-Style table implementation. +license: MIT-style license +authors: + - Valerio Proietti +requires: [Core/Array] +provides: [Table] +... +*/ + +(function(){ + +var Table = this.Table = function(){ + + this.length = 0; + var keys = [], + values = []; + + this.set = function(key, value){ + var index = keys.indexOf(key); + if (index == -1){ + var length = keys.length; + keys[length] = key; + values[length] = value; + this.length++; + } else { + values[index] = value; + } + return this; + }; + + this.get = function(key){ + var index = keys.indexOf(key); + return (index == -1) ? null : values[index]; + }; + + this.erase = function(key){ + var index = keys.indexOf(key); + if (index != -1){ + this.length--; + keys.splice(index, 1); + return values.splice(index, 1)[0]; + } + return null; + }; + + this.each = this.forEach = function(fn, bind){ + for (var i = 0, l = this.length; i < l; i++) fn.call(bind, keys[i], values[i], this); + }; + +}; + +if (this.Type) new Type('Table', Table); + +})(); + + +/* +--- + +script: HtmlTable.js + +name: HtmlTable + +description: Builds table elements with methods to add rows. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Options + - Core/Events + - /Class.Occlude + +provides: [HtmlTable] + +... +*/ + +var HtmlTable = new Class({ + + Implements: [Options, Events, Class.Occlude], + + options: { + properties: { + cellpadding: 0, + cellspacing: 0, + border: 0 + }, + rows: [], + headers: [], + footers: [] + }, + + property: 'HtmlTable', + + initialize: function(){ + var params = Array.link(arguments, {options: Type.isObject, table: Type.isElement, id: Type.isString}); + this.setOptions(params.options); + if (!params.table && params.id) params.table = document.id(params.id); + this.element = params.table || new Element('table', this.options.properties); + if (this.occlude()) return this.occluded; + this.build(); + }, + + build: function(){ + this.element.store('HtmlTable', this); + + this.body = document.id(this.element.tBodies[0]) || new Element('tbody').inject(this.element); + $$(this.body.rows); + + if (this.options.headers.length) this.setHeaders(this.options.headers); + else this.thead = document.id(this.element.tHead); + + if (this.thead) this.head = this.getHead(); + if (this.options.footers.length) this.setFooters(this.options.footers); + + this.tfoot = document.id(this.element.tFoot); + if (this.tfoot) this.foot = document.id(this.tfoot.rows[0]); + + this.options.rows.each(function(row){ + this.push(row); + }, this); + }, + + toElement: function(){ + return this.element; + }, + + empty: function(){ + this.body.empty(); + return this; + }, + + set: function(what, items){ + var target = (what == 'headers') ? 'tHead' : 'tFoot', + lower = target.toLowerCase(); + + this[lower] = (document.id(this.element[target]) || new Element(lower).inject(this.element, 'top')).empty(); + var data = this.push(items, {}, this[lower], what == 'headers' ? 'th' : 'td'); + + if (what == 'headers') this.head = this.getHead(); + else this.foot = this.getHead(); + + return data; + }, + + getHead: function(){ + var rows = this.thead.rows; + return rows.length > 1 ? $$(rows) : rows.length ? document.id(rows[0]) : false; + }, + + setHeaders: function(headers){ + this.set('headers', headers); + return this; + }, + + setFooters: function(footers){ + this.set('footers', footers); + return this; + }, + + push: function(row, rowProperties, target, tag, where){ + if (typeOf(row) == 'element' && row.get('tag') == 'tr'){ + row.inject(target || this.body, where); + return { + tr: row, + tds: row.getChildren('td') + }; + } + + var tds = row.map(function(data){ + var td = new Element(tag || 'td', data ? data.properties : {}), + content = (data ? data.content : '') || data, + type = typeOf(content); + + if (['element', 'array', 'collection', 'elements'].contains(type)) td.adopt(content); + else td.set('html', content); + + return td; + }); + + return { + tr: new Element('tr', rowProperties).inject(target || this.body, where).adopt(tds), + tds: tds + }; + } + +}); + + +['adopt', 'inject', 'wraps', 'grab', 'replaces', 'dispose'].each(function(method){ + HtmlTable.implement(method, function(){ + this.element[method].apply(this.element, arguments); + return this; + }); +}); + + + + +/* +--- + +script: HtmlTable.Zebra.js + +name: HtmlTable.Zebra + +description: Builds a stripy table with methods to add rows. + +license: MIT-style license + +authors: + - Harald Kirschner + - Aaron Newton + +requires: + - /HtmlTable + - /Class.refactor + +provides: [HtmlTable.Zebra] + +... +*/ + +HtmlTable = Class.refactor(HtmlTable, { + + options: { + classZebra: 'table-tr-odd', + zebra: true + }, + + initialize: function(){ + this.previous.apply(this, arguments); + if (this.occluded) return this.occluded; + if (this.options.zebra) this.updateZebras(); + }, + + updateZebras: function(){ + Array.each(this.body.rows, this.zebra, this); + }, + + setRowStyle: function(row, i){ + if (this.previous) this.previous(row, i); + this.zebra(row, i); + }, + + zebra: function(row, i){ + return row[((i % 2) ? 'remove' : 'add')+'Class'](this.options.classZebra); + }, + + push: function(){ + var pushed = this.previous.apply(this, arguments); + if (this.options.zebra) this.updateZebras(); + return pushed; + } + +}); + + +/* +--- + +script: HtmlTable.Sort.js + +name: HtmlTable.Sort + +description: Builds a stripy, sortable table with methods to add rows. + +license: MIT-style license + +authors: + - Harald Kirschner + - Aaron Newton + - Jacob Thornton + +requires: + - Core/Hash + - /HtmlTable + - /Class.refactor + - /Element.Delegation + - /String.Extras + - /Date + +provides: [HtmlTable.Sort] + +... +*/ + +HtmlTable = Class.refactor(HtmlTable, { + + options: {/* + onSort: function(){}, */ + sortIndex: 0, + sortReverse: false, + parsers: [], + defaultParser: 'string', + classSortable: 'table-sortable', + classHeadSort: 'table-th-sort', + classHeadSortRev: 'table-th-sort-rev', + classNoSort: 'table-th-nosort', + classGroupHead: 'table-tr-group-head', + classGroup: 'table-tr-group', + classCellSort: 'table-td-sort', + classSortSpan: 'table-th-sort-span', + sortable: false, + thSelector: 'th' + }, + + initialize: function (){ + this.previous.apply(this, arguments); + if (this.occluded) return this.occluded; + this.sorted = {index: null, dir: 1}; + this.bound = { + headClick: this.headClick.bind(this) + }; + this.sortSpans = new Elements(); + if (this.options.sortable){ + this.enableSort(); + if (this.options.sortIndex != null) this.sort(this.options.sortIndex, this.options.sortReverse); + } + }, + + attachSorts: function(attach){ + this.detachSorts(); + if (attach !== false) this.element.addEvent('click:relay(' + this.options.thSelector + ')', this.bound.headClick); + }, + + detachSorts: function(){ + this.element.removeEvents('click:relay(' + this.options.thSelector + ')'); + }, + + setHeaders: function(){ + this.previous.apply(this, arguments); + if (this.sortEnabled) this.setParsers(); + }, + + setParsers: function(){ + this.parsers = this.detectParsers(); + }, + + detectParsers: function(){ + return this.head && this.head.getElements(this.options.thSelector).flatten().map(this.detectParser, this); + }, + + detectParser: function(cell, index){ + if (cell.hasClass(this.options.classNoSort) || cell.retrieve('htmltable-parser')) return cell.retrieve('htmltable-parser'); + var thDiv = new Element('div'); + thDiv.adopt(cell.childNodes).inject(cell); + var sortSpan = new Element('span', {'class': this.options.classSortSpan}).inject(thDiv, 'top'); + this.sortSpans.push(sortSpan); + var parser = this.options.parsers[index], + rows = this.body.rows, + cancel; + switch (typeOf(parser)){ + case 'function': parser = {convert: parser}; cancel = true; break; + case 'string': parser = parser; cancel = true; break; + } + if (!cancel){ + HtmlTable.ParserPriority.some(function(parserName){ + var current = HtmlTable.Parsers[parserName], + match = current.match; + if (!match) return false; + for (var i = 0, j = rows.length; i < j; i++){ + var cell = document.id(rows[i].cells[index]), + text = cell ? cell.get('html').clean() : ''; + if (text && match.test(text)){ + parser = current; + return true; + } + } + }); + } + if (!parser) parser = this.options.defaultParser; + cell.store('htmltable-parser', parser); + return parser; + }, + + headClick: function(event, el){ + if (!this.head || el.hasClass(this.options.classNoSort)) return; + return this.sort(Array.indexOf(this.head.getElements(this.options.thSelector).flatten(), el) % this.body.rows[0].cells.length); + }, + + serialize: function() { + var previousSerialization = this.previous.apply(this, arguments) || {}; + if (this.options.sortable) { + previousSerialization.sortIndex = this.sorted.index; + previousSerialization.sortReverse = this.sorted.reverse; + } + return previousSerialization; + }, + + restore: function(tableState) { + if(this.options.sortable && tableState.sortIndex) { + this.sort(tableState.sortIndex, tableState.sortReverse); + } + this.previous.apply(this, arguments); + }, + + setSortedState: function(index, reverse){ + if (reverse != null) this.sorted.reverse = reverse; + else if (this.sorted.index == index) this.sorted.reverse = !this.sorted.reverse; + else this.sorted.reverse = this.sorted.index == null; + + if (index != null) this.sorted.index = index; + }, + + setHeadSort: function(sorted){ + var head = $$(!this.head.length ? this.head.cells[this.sorted.index] : this.head.map(function(row){ + return row.getElements(this.options.thSelector)[this.sorted.index]; + }, this).clean()); + if (!head.length) return; + if (sorted){ + head.addClass(this.options.classHeadSort); + if (this.sorted.reverse) head.addClass(this.options.classHeadSortRev); + else head.removeClass(this.options.classHeadSortRev); + } else { + head.removeClass(this.options.classHeadSort).removeClass(this.options.classHeadSortRev); + } + }, + + setRowSort: function(data, pre){ + var count = data.length, + body = this.body, + group, + rowIndex; + + while (count){ + var item = data[--count], + position = item.position, + row = body.rows[position]; + + if (row.disabled) continue; + if (!pre){ + group = this.setGroupSort(group, row, item); + this.setRowStyle(row, count); + } + body.appendChild(row); + + for (rowIndex = 0; rowIndex < count; rowIndex++){ + if (data[rowIndex].position > position) data[rowIndex].position--; + } + } + }, + + setRowStyle: function(row, i){ + this.previous(row, i); + row.cells[this.sorted.index].addClass(this.options.classCellSort); + }, + + setGroupSort: function(group, row, item){ + if (group == item.value) row.removeClass(this.options.classGroupHead).addClass(this.options.classGroup); + else row.removeClass(this.options.classGroup).addClass(this.options.classGroupHead); + return item.value; + }, + + getParser: function(){ + var parser = this.parsers[this.sorted.index]; + return typeOf(parser) == 'string' ? HtmlTable.Parsers[parser] : parser; + }, + + sort: function(index, reverse, pre){ + if (!this.head) return; + + if (!pre){ + this.clearSort(); + this.setSortedState(index, reverse); + this.setHeadSort(true); + } + + var parser = this.getParser(); + if (!parser) return; + + var rel; + if (!Browser.ie){ + rel = this.body.getParent(); + this.body.dispose(); + } + + var data = this.parseData(parser).sort(function(a, b){ + if (a.value === b.value) return 0; + return a.value > b.value ? 1 : -1; + }); + + if (this.sorted.reverse == (parser == HtmlTable.Parsers['input-checked'])) data.reverse(true); + this.setRowSort(data, pre); + + if (rel) rel.grab(this.body); + this.fireEvent('stateChanged'); + return this.fireEvent('sort', [this.body, this.sorted.index]); + }, + + parseData: function(parser){ + return Array.map(this.body.rows, function(row, i){ + var value = parser.convert.call(document.id(row.cells[this.sorted.index])); + return { + position: i, + value: value + }; + }, this); + }, + + clearSort: function(){ + this.setHeadSort(false); + this.body.getElements('td').removeClass(this.options.classCellSort); + }, + + reSort: function(){ + if (this.sortEnabled) this.sort.call(this, this.sorted.index, this.sorted.reverse); + return this; + }, + + enableSort: function(){ + this.element.addClass(this.options.classSortable); + this.attachSorts(true); + this.setParsers(); + this.sortEnabled = true; + return this; + }, + + disableSort: function(){ + this.element.removeClass(this.options.classSortable); + this.attachSorts(false); + this.sortSpans.each(function(span){ + span.destroy(); + }); + this.sortSpans.empty(); + this.sortEnabled = false; + return this; + } + +}); + +HtmlTable.ParserPriority = ['date', 'input-checked', 'input-value', 'float', 'number']; + +HtmlTable.Parsers = { + + 'date': { + match: /^\d{2}[-\/ ]\d{2}[-\/ ]\d{2,4}$/, + convert: function(){ + var d = Date.parse(this.get('text').stripTags()); + return (typeOf(d) == 'date') ? d.format('db') : ''; + }, + type: 'date' + }, + 'input-checked': { + match: / type="(radio|checkbox)" /, + convert: function(){ + return this.getElement('input').checked; + } + }, + 'input-value': { + match: /= rows.length) index = null; + + return index; + }, + + attachSelects: function(attach){ + attach = attach != null ? attach : true; + + var method = attach ? 'addEvents' : 'removeEvents'; + this.element[method]({ + mouseleave: this.bound.mouseleave, + click: this.bound.activateKeyboard + }); + + this.body[method]({ + 'click:relay(tr)': this.bound.clickRow, + 'contextmenu:relay(tr)': this.bound.clickRow + }); + + if (this.options.useKeyboard || this.keyboard){ + if (!this.keyboard) this.keyboard = new Keyboard(); + if (!this.selectKeysDefined) { + this.selectKeysDefined = true; + var timer, held; + + var move = function(offset){ + var mover = function(e){ + clearTimeout(timer); + e.preventDefault(); + + var to = this.body.rows[this.getRowByOffset(offset)]; + if (e.shift && to && this.isSelected(to)){ + this.deselectRow(this.focused); + this.focused = to; + } else { + if (to && (!this.options.allowMultiSelect || !e.shift)){ + this.selectNone(); + } + this.shiftFocus(offset, e); + } + + if (held){ + timer = mover.delay(100, this, e); + } else { + timer = (function(){ + held = true; + mover(e); + }).delay(400); + } + }.bind(this); + return mover; + }.bind(this); + + var clear = function(){ + clearTimeout(timer); + held = false; + }; + + this.keyboard.addEvents({ + 'keydown:shift+up': move(-1), + 'keydown:shift+down': move(1), + 'keyup:shift+up': clear, + 'keyup:shift+down': clear, + 'keyup:up': clear, + 'keyup:down': clear + }); + + var shiftHint = ''; + if (this.options.allowMultiSelect && this.options.shiftForMultiSelect && this.options.useKeyboard){ + shiftHint = " (Shift multi-selects)."; + } + + this.keyboard.addShortcuts({ + 'Select Previous Row': { + keys: 'up', + shortcut: 'up arrow', + handler: move(-1), + description: 'Select the previous row in the table.' + shiftHint + }, + 'Select Next Row': { + keys: 'down', + shortcut: 'down arrow', + handler: move(1), + description: 'Select the next row in the table.' + shiftHint + } + }); + + } + this.keyboard[attach ? 'activate' : 'deactivate'](); + } + this.updateSelects(); + }, + + mouseleave: function(){ + if (this.hovered) this.leaveRow(this.hovered); + } + +}); + + +/* +--- + +script: Scroller.js + +name: Scroller + +description: Class which scrolls the contents of any Element (including the window) when the mouse reaches the Element's boundaries. + +license: MIT-style license + +authors: + - Valerio Proietti + +requires: + - Core/Events + - Core/Options + - Core/Element.Event + - Core/Element.Dimensions + - MooTools.More + +provides: [Scroller] + +... +*/ + +var Scroller = new Class({ + + Implements: [Events, Options], + + options: { + area: 20, + velocity: 1, + onChange: function(x, y){ + this.element.scrollTo(x, y); + }, + fps: 50 + }, + + initialize: function(element, options){ + this.setOptions(options); + this.element = document.id(element); + this.docBody = document.id(this.element.getDocument().body); + this.listener = (typeOf(this.element) != 'element') ? this.docBody : this.element; + this.timer = null; + this.bound = { + attach: this.attach.bind(this), + detach: this.detach.bind(this), + getCoords: this.getCoords.bind(this) + }; + }, + + start: function(){ + this.listener.addEvents({ + mouseover: this.bound.attach, + mouseleave: this.bound.detach + }); + return this; + }, + + stop: function(){ + this.listener.removeEvents({ + mouseover: this.bound.attach, + mouseleave: this.bound.detach + }); + this.detach(); + this.timer = clearInterval(this.timer); + return this; + }, + + attach: function(){ + this.listener.addEvent('mousemove', this.bound.getCoords); + }, + + detach: function(){ + this.listener.removeEvent('mousemove', this.bound.getCoords); + this.timer = clearInterval(this.timer); + }, + + getCoords: function(event){ + this.page = (this.listener.get('tag') == 'body') ? event.client : event.page; + if (!this.timer) this.timer = this.scroll.periodical(Math.round(1000 / this.options.fps), this); + }, + + scroll: function(){ + var size = this.element.getSize(), + scroll = this.element.getScroll(), + pos = this.element != this.docBody ? this.element.getOffsets() : {x: 0, y:0}, + scrollSize = this.element.getScrollSize(), + change = {x: 0, y: 0}, + top = this.options.area.top || this.options.area, + bottom = this.options.area.bottom || this.options.area; + for (var z in this.page){ + if (this.page[z] < (top + pos[z]) && scroll[z] != 0){ + change[z] = (this.page[z] - top - pos[z]) * this.options.velocity; + } else if (this.page[z] + bottom > (size[z] + pos[z]) && scroll[z] + size[z] != scrollSize[z]){ + change[z] = (this.page[z] - size[z] + bottom - pos[z]) * this.options.velocity; + } + change[z] = change[z].round(); + } + if (change.y || change.x) this.fireEvent('change', [scroll.x + change.x, scroll.y + change.y]); + } + +}); + + +/* +--- + +script: Tips.js + +name: Tips + +description: Class for creating nice tips that follow the mouse cursor when hovering an element. + +license: MIT-style license + +authors: + - Valerio Proietti + - Christoph Pojer + - Luis Merino + +requires: + - Core/Options + - Core/Events + - Core/Element.Event + - Core/Element.Style + - Core/Element.Dimensions + - /MooTools.More + +provides: [Tips] + +... +*/ + +(function(){ + +var read = function(option, element){ + return (option) ? (typeOf(option) == 'function' ? option(element) : element.get(option)) : ''; +}; + +this.Tips = new Class({ + + Implements: [Events, Options], + + options: {/* + onAttach: function(element){}, + onDetach: function(element){}, + onBound: function(coords){},*/ + onShow: function(){ + this.tip.setStyle('display', 'block'); + }, + onHide: function(){ + this.tip.setStyle('display', 'none'); + }, + title: 'title', + text: function(element){ + return element.get('rel') || element.get('href'); + }, + showDelay: 100, + hideDelay: 100, + className: 'tip-wrap', + offset: {x: 16, y: 16}, + windowPadding: {x:0, y:0}, + fixed: false + }, + + initialize: function(){ + var params = Array.link(arguments, { + options: Type.isObject, + elements: function(obj){ + return obj != null; + } + }); + this.setOptions(params.options); + if (params.elements) this.attach(params.elements); + this.container = new Element('div', {'class': 'tip'}); + }, + + toElement: function(){ + if (this.tip) return this.tip; + + this.tip = new Element('div', { + 'class': this.options.className, + styles: { + position: 'absolute', + top: 0, + left: 0 + } + }).adopt( + new Element('div', {'class': 'tip-top'}), + this.container, + new Element('div', {'class': 'tip-bottom'}) + ); + + return this.tip; + }, + + attach: function(elements){ + $$(elements).each(function(element){ + var title = read(this.options.title, element), + text = read(this.options.text, element); + + element.set('title', '').store('tip:native', title).retrieve('tip:title', title); + element.retrieve('tip:text', text); + this.fireEvent('attach', [element]); + + var events = ['enter', 'leave']; + if (!this.options.fixed) events.push('move'); + + events.each(function(value){ + var event = element.retrieve('tip:' + value); + if (!event) event = function(event){ + this['element' + value.capitalize()].apply(this, [event, element]); + }.bind(this); + + element.store('tip:' + value, event).addEvent('mouse' + value, event); + }, this); + }, this); + + return this; + }, + + detach: function(elements){ + $$(elements).each(function(element){ + ['enter', 'leave', 'move'].each(function(value){ + element.removeEvent('mouse' + value, element.retrieve('tip:' + value)).eliminate('tip:' + value); + }); + + this.fireEvent('detach', [element]); + + if (this.options.title == 'title'){ // This is necessary to check if we can revert the title + var original = element.retrieve('tip:native'); + if (original) element.set('title', original); + } + }, this); + + return this; + }, + + elementEnter: function(event, element){ + clearTimeout(this.timer); + this.timer = (function(){ + this.container.empty(); + + ['title', 'text'].each(function(value){ + var content = element.retrieve('tip:' + value); + var div = this['_' + value + 'Element'] = new Element('div', { + 'class': 'tip-' + value + }).inject(this.container); + if (content) this.fill(div, content); + }, this); + this.show(element); + this.position((this.options.fixed) ? {page: element.getPosition()} : event); + }).delay(this.options.showDelay, this); + }, + + elementLeave: function(event, element){ + clearTimeout(this.timer); + this.timer = this.hide.delay(this.options.hideDelay, this, element); + this.fireForParent(event, element); + }, + + setTitle: function(title){ + if (this._titleElement){ + this._titleElement.empty(); + this.fill(this._titleElement, title); + } + return this; + }, + + setText: function(text){ + if (this._textElement){ + this._textElement.empty(); + this.fill(this._textElement, text); + } + return this; + }, + + fireForParent: function(event, element){ + element = element.getParent(); + if (!element || element == document.body) return; + if (element.retrieve('tip:enter')) element.fireEvent('mouseenter', event); + else this.fireForParent(event, element); + }, + + elementMove: function(event, element){ + this.position(event); + }, + + position: function(event){ + if (!this.tip) document.id(this); + + var size = window.getSize(), scroll = window.getScroll(), + tip = {x: this.tip.offsetWidth, y: this.tip.offsetHeight}, + props = {x: 'left', y: 'top'}, + bounds = {y: false, x2: false, y2: false, x: false}, + obj = {}; + + for (var z in props){ + obj[props[z]] = event.page[z] + this.options.offset[z]; + if (obj[props[z]] < 0) bounds[z] = true; + if ((obj[props[z]] + tip[z] - scroll[z]) > size[z] - this.options.windowPadding[z]){ + obj[props[z]] = event.page[z] - this.options.offset[z] - tip[z]; + bounds[z+'2'] = true; + } + } + + this.fireEvent('bound', bounds); + this.tip.setStyles(obj); + }, + + fill: function(element, contents){ + if (typeof contents == 'string') element.set('html', contents); + else element.adopt(contents); + }, + + show: function(element){ + if (!this.tip) document.id(this); + if (!this.tip.getParent()) this.tip.inject(document.body); + this.fireEvent('show', [this.tip, element]); + }, + + hide: function(element){ + if (!this.tip) document.id(this); + this.fireEvent('hide', [this.tip, element]); + } + +}); + +})(); + + +/* +--- + +name: Locale.en-GB.Date + +description: Date messages for British English. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - /Locale + - /Locale.en-US.Date + +provides: [Locale.en-GB.Date] + +... +*/ + +Locale.define('en-GB', 'Date', { + + // Culture's date order: DD/MM/YYYY + dateOrder: ['date', 'month', 'year'], + shortDate: '%d/%m/%Y', + shortTime: '%H:%M' + +}).inherit('en-US', 'Date'); + diff --git a/web/tools/mootools/mootools-more-1.3.2.1-yc.js b/web/tools/mootools/mootools-more-1.3.2.1-yc.js new file mode 100644 index 000000000..807e27ecf --- /dev/null +++ b/web/tools/mootools/mootools-more-1.3.2.1-yc.js @@ -0,0 +1,742 @@ +// MooTools: the javascript framework. +// Load this file's selection again by visiting: http://mootools.net/more/09f3e47813269cd5026cbf8c1f828e72 +// Or build this file again with packager using: packager build More/Chain.Wait More/Array.Extras More/Date More/Date.Extras More/Number.Format More/String.Extras More/String.QueryString More/URI More/URI.Relative More/Hash More/Hash.Extras More/Element.Forms More/Elements.From More/Element.Event.Pseudos.Keys More/Element.Pin More/Element.Position More/Element.Shortcuts More/Form.Request More/Form.Request.Append More/Form.Validator.Inline More/Form.Validator.Extras More/OverText More/Fx.Accordion More/Fx.Move More/Fx.Reveal More/Fx.Slide More/Fx.SmoothScroll More/Fx.Sort More/Drag.Move More/Slider More/Sortables More/Request.JSONP More/Request.Queue More/Request.Periodical More/Assets More/Color More/Group More/Hash.Cookie More/Table More/HtmlTable.Zebra More/HtmlTable.Sort More/HtmlTable.Select More/Keyboard.Extras More/Mask More/Scroller More/Tips More/Locale.en-GB.Date +/* +--- +copyrights: + - [MooTools](http://mootools.net) + +licenses: + - [MIT License](http://mootools.net/license.txt) +... +*/ +MooTools.More={version:"1.3.2.1",build:"e586bcd2496e9b22acfde32e12f84d49ce09e59d"};(function(){var a={wait:function(b){return this.chain(function(){this.callChain.delay(b==null?500:b,this); +return this;}.bind(this));}};Chain.implement(a);if(this.Fx){Fx.implement(a);}if(this.Element&&Element.implement&&this.Fx){Element.implement({chains:function(b){Array.from(b||["tween","morph","reveal"]).each(function(c){c=this.get(c); +if(!c){return;}c.setOptions({link:"chain"});},this);return this;},pauseFx:function(c,b){this.chains(b).get(b||"tween").wait(c);return this;}});}})();(function(a){Array.implement({min:function(){return Math.min.apply(null,this); +},max:function(){return Math.max.apply(null,this);},average:function(){return this.length?this.sum()/this.length:0;},sum:function(){var b=0,c=this.length; +if(c){while(c--){b+=this[c];}}return b;},unique:function(){return[].combine(this);},shuffle:function(){for(var c=this.length;c&&--c;){var b=this[c],d=Math.floor(Math.random()*(c+1)); +this[c]=this[d];this[d]=b;}return this;},reduce:function(d,e){for(var c=0,b=this.length;c3&&a<21)?"th":["th","st","nd","rd","th"][Math.min(a%10,4)]; +},lessThanMinuteAgo:"less than a minute ago",minuteAgo:"about a minute ago",minutesAgo:"{delta} minutes ago",hourAgo:"about an hour ago",hoursAgo:"about {delta} hours ago",dayAgo:"1 day ago",daysAgo:"{delta} days ago",weekAgo:"1 week ago",weeksAgo:"{delta} weeks ago",monthAgo:"1 month ago",monthsAgo:"{delta} months ago",yearAgo:"1 year ago",yearsAgo:"{delta} years ago",lessThanMinuteUntil:"less than a minute from now",minuteUntil:"about a minute from now",minutesUntil:"{delta} minutes from now",hourUntil:"about an hour from now",hoursUntil:"about {delta} hours from now",dayUntil:"1 day from now",daysUntil:"{delta} days from now",weekUntil:"1 week from now",weeksUntil:"{delta} weeks from now",monthUntil:"1 month from now",monthsUntil:"{delta} months from now",yearUntil:"1 year from now",yearsUntil:"{delta} years from now"}); +(function(){var a=this.Date;var f=a.Methods={ms:"Milliseconds",year:"FullYear",min:"Minutes",mo:"Month",sec:"Seconds",hr:"Hours"};["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds","Time","TimezoneOffset","Week","Timezone","GMTOffset","DayOfYear","LastMonth","LastDayOfMonth","UTCDate","UTCDay","UTCFullYear","AMPM","Ordinal","UTCHours","UTCMilliseconds","UTCMinutes","UTCMonth","UTCSeconds","UTCMilliseconds"].each(function(t){a.Methods[t.toLowerCase()]=t; +});var p=function(v,u,t){if(u==1){return v;}return v28){return 1;}if(z==0&&t<-2){y=new a(y).decrement("day",v); +v=0;}x=new a(y.get("year"),0,1).get("day")||7;if(x>4){u=-7;}}else{x=new a(y.get("year"),0,1).get("day");}u+=y.get("dayofyear");u+=6-v;u+=(7+x-w)%7;return(u/7); +},getOrdinal:function(t){return a.getMsg("ordinal",t||this.get("date"));},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3"); +},getGMTOffset:function(){var t=this.get("timezoneOffset");return((t>0)?"-":"+")+p((t.abs()/60).floor(),2)+p(t%60,2);},setAMPM:function(t){t=t.toUpperCase(); +var u=this.get("hr");if(u>11&&t=="AM"){return this.decrement("hour",12);}else{if(u<12&&t=="PM"){return this.increment("hour",12);}}return this;},getAMPM:function(){return(this.get("hr")<12)?"AM":"PM"; +},parse:function(t){this.set("time",a.parse(t));return this;},isValid:function(t){return !isNaN((t||this).valueOf());},format:function(u){if(!this.isValid()){return"invalid date"; +}if(!u){u="%x %X";}var t=u.toLowerCase();if(s[t]){return s[t](this);}u=g[t]||u;var v=this;return u.replace(/%([a-z%])/gi,function(x,w){switch(w){case"a":return a.getMsg("days_abbr")[v.get("day")]; +case"A":return a.getMsg("days")[v.get("day")];case"b":return a.getMsg("months_abbr")[v.get("month")];case"B":return a.getMsg("months")[v.get("month")]; +case"c":return v.format("%a %b %d %H:%M:%S %Y");case"d":return p(v.get("date"),2);case"e":return p(v.get("date"),2," ");case"H":return p(v.get("hr"),2); +case"I":return p((v.get("hr")%12)||12,2);case"j":return p(v.get("dayofyear"),3);case"k":return p(v.get("hr"),2," ");case"l":return p((v.get("hr")%12)||12,2," "); +case"L":return p(v.get("ms"),3);case"m":return p((v.get("mo")+1),2);case"M":return p(v.get("min"),2);case"o":return v.get("ordinal");case"p":return a.getMsg(v.get("ampm")); +case"s":return Math.round(v/1000);case"S":return p(v.get("seconds"),2);case"T":return v.format("%H:%M:%S");case"U":return p(v.get("week"),2);case"w":return v.get("day"); +case"x":return v.format(a.getMsg("shortDate"));case"X":return v.format(a.getMsg("shortTime"));case"y":return v.get("year").toString().substr(2);case"Y":return v.get("year"); +case"z":return v.get("GMTOffset");case"Z":return v.get("Timezone");}return w;});},toISOString:function(){return this.format("iso8601");}}).alias({toJSON:"toISOString",compare:"diff",strftime:"format"}); +var g={db:"%Y-%m-%d %H:%M:%S",compact:"%Y%m%dT%H%M%S","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M"};var k=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]; +var s={rfc822:function(t){return k[t.get("day")]+t.format(", %d ")+h[t.get("month")]+t.format(" %Y %H:%M:%S %Z");},rfc2822:function(t){return k[t.get("day")]+t.format(", %d ")+h[t.get("month")]+t.format(" %Y %H:%M:%S %z"); +},iso8601:function(t){return(t.getUTCFullYear()+"-"+p(t.getUTCMonth()+1,2)+"-"+p(t.getUTCDate(),2)+"T"+p(t.getUTCHours(),2)+":"+p(t.getUTCMinutes(),2)+":"+p(t.getUTCSeconds(),2)+"."+p(t.getUTCMilliseconds(),3)+"Z"); +}};var c=[],n=a.parse;var r=function(w,y,v){var u=-1,x=a.getMsg(w+"s");switch(typeOf(y)){case"object":u=x[y.get(w)];break;case"number":u=x[y];if(!u){throw new Error("Invalid "+w+" index: "+y); +}break;case"string":var t=x.filter(function(z){return this.test(z);},new RegExp("^"+y,"i"));if(!t.length){throw new Error("Invalid "+w+" string");}if(t.length>1){throw new Error("Ambiguous "+w); +}u=t[0];}return(v)?x.indexOf(u):u;};var i=1900,o=70;a.extend({getMsg:function(u,t){return Locale.get("Date."+u,t);},units:{ms:Function.from(1),second:Function.from(1000),minute:Function.from(60000),hour:Function.from(3600000),day:Function.from(86400000),week:Function.from(608400000),month:function(u,t){var v=new a; +return a.daysInMonth(u!=null?u:v.get("mo"),t!=null?t:v.get("year"))*86400000;},year:function(t){t=t||new a().get("year");return a.isLeapYear(t)?31622400000:31536000000; +}},daysInMonth:function(u,t){return[31,a.isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][u];},isLeapYear:function(t){return((t%4===0)&&(t%100!==0))||(t%400===0); +},parse:function(w){var v=typeOf(w);if(v=="number"){return new a(w);}if(v!="string"){return w;}w=w.clean();if(!w.length){return null;}var u;c.some(function(x){var t=x.re.exec(w); +return(t)?(u=x.handler(t)):false;});if(!(u&&u.isValid())){u=new a(n(w));if(!(u&&u.isValid())){u=new a(w.toInt());}}return u;},parseDay:function(t,u){return r("day",t,u); +},parseMonth:function(u,t){return r("month",u,t);},parseUTC:function(u){var t=new a(u);var v=a.UTC(t.get("year"),t.get("mo"),t.get("date"),t.get("hr"),t.get("min"),t.get("sec"),t.get("ms")); +return new a(v);},orderIndex:function(t){return a.getMsg("dateOrder").indexOf(t)+1;},defineFormat:function(t,u){g[t]=u;return this;},defineFormats:function(t){for(var u in t){a.defineFormat(u,t[u]); +}return this;},defineParser:function(t){c.push((t.re&&t.handler)?t:l(t));return this;},defineParsers:function(){Array.flatten(arguments).each(a.defineParser); +return this;},define2DigitYearStart:function(t){o=t%100;i=t-o;return this;}});var d=function(t){return new RegExp("(?:"+a.getMsg(t).map(function(u){return u.substr(0,3); +}).join("|")+")[a-z]*");};var m=function(t){switch(t){case"T":return"%H:%M:%S";case"x":return((a.orderIndex("month")==1)?"%m[-./]%d":"%d[-./]%m")+"([-./]%y)?"; +case"X":return"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?";}return null;};var j={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\d/,s:/\d+/,o:/[a-z]*/,p:/[ap]\.?m\.?/,y:/\d{2}|\d{4}/,Y:/\d{4}/,z:/Z|[+-]\d{2}(?::?\d{2})?/}; +j.m=j.I;j.S=j.M;var e;var b=function(t){e=t;j.a=j.A=d("days");j.b=j.B=d("months");c.each(function(v,u){if(v.format){c[u]=l(v.format);}});};var l=function(v){if(!e){return{format:v}; +}var t=[];var u=(v.source||v).replace(/%([a-z])/gi,function(x,w){return m(w)||x;}).replace(/\((?!\?)/g,"(?:").replace(/ (?!\?|\*)/g,",? ").replace(/%([a-z%])/gi,function(x,w){var y=j[w]; +if(!y){return w;}t.push(w);return"("+y.source+")";}).replace(/\[a-z\]/gi,"[a-z\\u00c0-\\uffff;&]");return{format:v,re:new RegExp("^"+u+"$","i"),handler:function(z){z=z.slice(1).associate(t); +var w=new a().clearTime(),y=z.y||z.Y;if(y!=null){q.call(w,"y",y);}if("d" in z){q.call(w,"d",1);}if("m" in z||z.b||z.B){q.call(w,"m",1);}for(var x in z){q.call(w,x,z[x]); +}return w;}};};var q=function(t,u){if(!u){return this;}switch(t){case"a":case"A":return this.set("day",a.parseDay(u,true));case"b":case"B":return this.set("mo",a.parseMonth(u,true)); +case"d":return this.set("date",u);case"H":case"I":return this.set("hr",u);case"m":return this.set("mo",u-1);case"M":return this.set("min",u);case"p":return this.set("ampm",u.replace(/\./g,"")); +case"S":return this.set("sec",u);case"s":return this.set("ms",("0."+u)*1000);case"w":return this.set("day",u);case"Y":return this.set("year",u);case"y":u=+u; +if(u<100){u+=i+(u0.75*a){e=c;}break;}f/=a;e=c+"s";}f=f.round();return Date.getMsg(e+d,f).substitute({delta:f});}}).defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(a){var b=new Date().clearTime(); +switch(a[0]){case"tom":return b.increment();case"yes":return b.decrement();default:return b;}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(e){var f=new Date().clearTime(); +var b=f.getDay();var c=Date.parseDay(e[2],true);var a=c-b;if(c<=b){a+=7;}if(e[1]=="last"){a-=7;}return f.set("date",f.getDate()+a);}}).alias("timeAgoInWords","timeDiffInWords"); +Locale.define("en-US","Number",{decimal:".",group:",",currency:{prefix:"$ "}});Number.implement({format:function(q){var n=this;q=q?Object.clone(q):{};var a=function(i){if(q[i]!=null){return q[i]; +}return Locale.get("Number."+i);};var f=n<0,h=a("decimal"),k=a("precision"),o=a("group"),c=a("decimals");if(f){var e=a("negative")||{};if(e.prefix==null&&e.suffix==null){e.prefix="-"; +}["prefix","suffix"].each(function(i){if(e[i]){q[i]=a(i)+e[i];}});n=-n;}var l=a("prefix"),p=a("suffix");if(c!==""&&c>=0&&c<=20){n=n.toFixed(c);}if(k>=1&&k<=21){n=(+n).toPrecision(k); +}n+="";var m;if(a("scientific")===false&&n.indexOf("e")>-1){var j=n.split("e"),b=+j[1];n=j[0].replace(".","");if(b<0){b=-b-1;m=j[0].indexOf(".");if(m>-1){b-=m-1; +}while(b--){n="0"+n;}n="0."+n;}else{m=j[0].lastIndexOf(".");if(m>-1){b-=j[0].length-m-1;}while(b--){n+="0";}}}if(h!="."){n=n.replace(".",h);}if(o){m=n.lastIndexOf(h); +m=(m>-1)?m:n.length;var d=n.substring(m),g=m;while(g--){if((m-g-1)%3==0&&g!=(m-1)){d=o+d;}d=n.charAt(g)+d;}n=d;}if(l){n=l+n;}if(p){n+=p;}return n;},formatCurrency:function(){var a=Locale.get("Number.currency")||{}; +if(a.scientific==null){a.scientific=false;}if(a.decimals==null){a.decimals=2;}return this.format(a);},formatPercentage:function(){var a=Locale.get("Number.percentage")||{}; +if(a.suffix==null){a.suffix="%";}if(a.decimals==null){a.decimals=2;}return this.format(a);}});(function(){var c={a:/[àáâãäåăą]/g,A:/[ÀÃÂÃÄÅĂĄ]/g,c:/[ćÄç]/g,C:/[ĆČÇ]/g,d:/[ÄÄ‘]/g,D:/[ÄŽÃ]/g,e:/[èéêëěę]/g,E:/[ÈÉÊËĚĘ]/g,g:/[ÄŸ]/g,G:/[Äž]/g,i:/[ìíîï]/g,I:/[ÃŒÃÃŽÃ]/g,l:/[ĺľł]/g,L:/[ĹĽÅ]/g,n:/[ñňń]/g,N:/[ÑŇŃ]/g,o:/[òóôõöøő]/g,O:/[ÒÓÔÕÖØ]/g,r:/[řŕ]/g,R:/[ŘŔ]/g,s:/[Å¡Å¡ÅŸ]/g,S:/[ŠŞŚ]/g,t:/[ťţ]/g,T:/[ŤŢ]/g,ue:/[ü]/g,UE:/[Ãœ]/g,u:/[ùúûůµ]/g,U:/[ÙÚÛŮ]/g,y:/[ÿý]/g,Y:/[ŸÃ]/g,z:/[žźż]/g,Z:/[ŽŹŻ]/g,th:/[þ]/g,TH:/[Þ]/g,dh:/[ð]/g,DH:/[Ã]/g,ss:/[ß]/g,oe:/[Å“]/g,OE:/[Å’]/g,ae:/[æ]/g,AE:/[Æ]/g},b={" ":/[\xa0\u2002\u2003\u2009]/g,"*":/[\xb7]/g,"'":/[\u2018\u2019]/g,'"':/[\u201c\u201d]/g,"...":/[\u2026]/g,"-":/[\u2013]/g,"»":/[\uFFFD]/g}; +var a=function(f,h){var e=f,g;for(g in h){e=e.replace(h[g],g);}return e;};var d=function(e,g){e=e||"";var h=g?"<"+e+"(?!\\w)[^>]*>([\\s\\S]*?)":"]+)?>",f=new RegExp(h,"gi"); +return f;};String.implement({standardize:function(){return a(this,c);},repeat:function(e){return new Array(e+1).join(this);},pad:function(e,h,g){if(this.length>=e){return this; +}var f=(h==null?" ":""+h).repeat(e-this.length).substr(0,e-this.length);if(!g||g=="right"){return this+f;}if(g=="left"){return f+this;}return f.substr(0,(f.length/2).floor())+this+f.substr(0,(f.length/2).ceil()); +},getTags:function(e,f){return this.match(d(e,f))||[];},stripTags:function(e,f){return this.replace(d(e,f),"");},tidy:function(){return a(this,b);},truncate:function(e,f,i){var h=this; +if(f==null&&arguments.length==1){f="…";}if(h.length>e){h=h.substring(0,e);if(i){var g=h.lastIndexOf(i);if(g!=-1){h=h.substr(0,g);}}if(f){h+=f;}}return h; +}});})();String.implement({parseQueryString:function(d,a){if(d==null){d=true;}if(a==null){a=true;}var c=this.split(/[&;]/),b={};if(!c.length){return b; +}c.each(function(i){var e=i.indexOf("=")+1,g=e?i.substr(e):"",f=e?i.substr(0,e-1).match(/([^\]\[]+|(\B)(?=\]))/g):[i],h=b;if(!f){return;}if(a){g=decodeURIComponent(g); +}f.each(function(k,j){if(d){k=decodeURIComponent(k);}var l=h[k];if(j0){c.pop(); +}else{if(f!="."){c.push(f);}}});return c.join("/")+"/";},combine:function(c){return c.value||c.scheme+"://"+(c.user?c.user+(c.password?":"+c.password:"")+"@":"")+(c.host||"")+(c.port&&c.port!=this.schemes[c.scheme]?":"+c.port:"")+(c.directory||"/")+(c.file||"")+(c.query?"?"+c.query:"")+(c.fragment?"#"+c.fragment:""); +},set:function(d,f,e){if(d=="value"){var c=f.match(a.regs.scheme);if(c){c=c[1];}if(c&&this.schemes[c.toLowerCase()]==null){this.parsed={scheme:c,value:f}; +}else{this.parsed=this.parse(f,(e||this).parsed)||(c?{scheme:c,value:f}:{value:f});}}else{if(d=="data"){this.setData(f);}else{this.parsed[d]=f;}}return this; +},get:function(c,d){switch(c){case"value":return this.combine(this.parsed,d?d.parsed:false);case"data":return this.getData();}return this.parsed[c]||""; +},go:function(){document.location.href=this.toString();},toURI:function(){return this;},getData:function(e,d){var c=this.get(d||"query");if(!(c||c===0)){return e?null:{}; +}var f=c.parseQueryString();return e?f[e]:f;},setData:function(c,f,d){if(typeof c=="string"){var e=this.getData();e[arguments[0]]=arguments[1];c=e;}else{if(f){c=Object.merge(this.getData(),c); +}}return this.set(d||"query",Object.toQueryString(c));},clearData:function(c){return this.set(c||"query","");},toString:b,valueOf:b});a.regs={endSlash:/\/$/,scheme:/^(\w+):/,directoryDot:/\.\/|\.$/}; +a.base=new a(Array.from(document.getElements("base[href]",true)).getLast(),{base:document.location});String.implement({toURI:function(c){return new a(this,c); +}});})();Class.refactor=function(b,a){Object.each(a,function(e,d){var c=b.prototype[d];c=(c&&c.$origin)||c||function(){};b.implement(d,(typeof e=="function")?function(){var f=this.previous; +this.previous=c;var g=e.apply(this,arguments);this.previous=f;return g;}:e);});return b;};URI=Class.refactor(URI,{combine:function(f,e){if(!e||f.scheme!=e.scheme||f.host!=e.host||f.port!=e.port){return this.previous.apply(this,arguments); +}var a=f.file+(f.query?"?"+f.query:"")+(f.fragment?"#"+f.fragment:"");if(!e.directory){return(f.directory||(f.file?"":"./"))+a;}var d=e.directory.split("/"),c=f.directory.split("/"),g="",h; +var b=0;for(h=0;h=0||g.parentPositioned||d.allowNegative)?c.x:0).toInt(); +c.top=((c.y>=0||g.parentPositioned||d.allowNegative)?c.y:0).toInt();a.toMinMax(c,d);if(d.relFixedPosition||f.getStyle("position")=="fixed"){a.toRelFixedPosition(f,c); +}if(d.ignoreScroll){a.toIgnoreScroll(f,c);}if(d.ignoreMargins){a.toIgnoreMargins(c,d);}c.left=Math.ceil(c.left);c.top=Math.ceil(c.top);delete c.x;delete c.y; +return c;},setPositionCoordinates:function(k,g,d){var f=k.offset.y,h=k.offset.x,e=(d==document.body)?window.getScroll():d.getPosition(),j=e.y,c=e.x,i=window.getSize(); +switch(k.position.x){case"left":g.x=c+h;break;case"right":g.x=c+h+d.offsetWidth;break;default:g.x=c+((d==document.body?i.x:d.offsetWidth)/2)+h;break;}switch(k.position.y){case"top":g.y=j+f; +break;case"bottom":g.y=j+f+d.offsetHeight;break;default:g.y=j+((d==document.body?i.y:d.offsetHeight)/2)+f;break;}},toMinMax:function(c,d){var f={left:"x",top:"y"},e; +["minimum","maximum"].each(function(g){["left","top"].each(function(h){e=d[g]?d[g][f[h]]:null;if(e!=null&&((g=="minimum")?c[h]e)){c[h]=e;}});}); +},toRelFixedPosition:function(e,c){var d=window.getScroll();c.top+=d.y;c.left+=d.x;},toIgnoreScroll:function(e,d){var c=e.getScroll();d.top-=c.y;d.left-=c.x; +},toIgnoreMargins:function(c,d){c.left+=d.edge.x=="right"?d.dimensions["margin-right"]:(d.edge.x!="center"?-d.dimensions["margin-left"]:-d.dimensions["margin-left"]+((d.dimensions["margin-right"]+d.dimensions["margin-left"])/2)); +c.top+=d.edge.y=="bottom"?d.dimensions["margin-bottom"]:(d.edge.y!="center"?-d.dimensions["margin-top"]:-d.dimensions["margin-top"]+((d.dimensions["margin-bottom"]+d.dimensions["margin-top"])/2)); +},toEdge:function(c,d){var e={},g=d.dimensions,f=d.edge;switch(f.x){case"left":e.x=0;break;case"right":e.x=-g.x-g.computedRight-g.computedLeft;break;default:e.x=-(Math.round(g.totalWidth/2)); +break;}switch(f.y){case"top":e.y=0;break;case"bottom":e.y=-g.y-g.computedTop-g.computedBottom;break;default:e.y=-(Math.round(g.totalHeight/2));break;}c.x+=e.x; +c.y+=e.y;},getCoordinateFromValue:function(c){if(typeOf(c)!="string"){return c;}c=c.toLowerCase();return{x:c.test("left")?"left":(c.test("right")?"right":"center"),y:c.test(/upper|top/)?"top":(c.test("bottom")?"bottom":"center")}; +}};Element.implement({position:function(d){if(d&&(d.x!=null||d.y!=null)){return(b?b.apply(this,arguments):this);}var c=this.setStyle("position","absolute").calculatePosition(d); +return(d&&d.returnPos)?c:this.setStyles(c);},calculatePosition:function(c){return a.getPosition(this,c);}});})(Element.prototype.position);Element.implement({isDisplayed:function(){return this.getStyle("display")!="none"; +},isVisible:function(){var a=this.offsetWidth,b=this.offsetHeight;return(a==0&&b==0)?false:(a>0&&b>0)?true:this.style.display!="none";},toggle:function(){return this[this.isDisplayed()?"hide":"show"](); +},hide:function(){var b;try{b=this.getStyle("display");}catch(a){}if(b=="none"){return this;}return this.store("element:_originalDisplay",b||"").setStyle("display","none"); +},show:function(a){if(!a&&this.isDisplayed()){return this;}a=a||this.retrieve("element:_originalDisplay")||"block";return this.setStyle("display",(a=="none")?"block":a); +},swapClass:function(a,b){return this.removeClass(a).addClass(b);}});Document.implement({clearSelection:function(){if(window.getSelection){var a=window.getSelection(); +if(a&&a.removeAllRanges){a.removeAllRanges();}}else{if(document.selection&&document.selection.empty){try{document.selection.empty();}catch(b){}}}}});Class.Mutators.Binds=function(a){if(!this.prototype.initialize){this.implement("initialize",function(){}); +}return Array.from(a).concat(this.prototype.Binds||[]);};Class.Mutators.initialize=function(a){return function(){Array.from(this.Binds).each(function(b){var c=this[b]; +if(c){this[b]=c.bind(this);}},this);return a.apply(this,arguments);};};Class.Occlude=new Class({occlude:function(c,b){b=document.id(b||this.element);var a=b.retrieve(c||this.property); +if(a&&!this.occluded){return(this.occluded=a);}this.occluded=false;b.store(c||this.property,this);return this.occluded;}});var IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:"iframeShim",src:'javascript:false;document.write("");',display:false,zIndex:null,margin:0,offset:{x:0,y:0},browsers:(Browser.ie6||(Browser.firefox&&Browser.version<3&&Browser.Platform.mac))},property:"IframeShim",initialize:function(b,a){this.element=document.id(b); +if(this.occlude()){return this.occluded;}this.setOptions(a);this.makeShim();return this;},makeShim:function(){if(this.options.browsers){var c=this.element.getStyle("zIndex").toInt(); +if(!c){c=1;var b=this.element.getStyle("position");if(b=="static"||!b){this.element.setStyle("position","relative");}this.element.setStyle("zIndex",c); +}c=((this.options.zIndex!=null||this.options.zIndex===0)&&c>this.options.zIndex)?this.options.zIndex:c-1;if(c<0){c=1;}this.shim=new Element("iframe",{src:this.options.src,scrolling:"no",frameborder:0,styles:{zIndex:c,position:"absolute",border:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"},"class":this.options.className}).store("IframeShim",this); +var a=(function(){this.shim.inject(this.element,"after");this[this.options.display?"show":"hide"]();this.fireEvent("inject");}).bind(this);if(!IframeShim.ready){window.addEvent("load",a); +}else{a();}}else{this.position=this.hide=this.show=this.dispose=Function.from(this);}},position:function(){if(!IframeShim.ready||!this.shim){return this; +}var a=this.element.measure(function(){return this.getSize();});if(this.options.margin!=undefined){a.x=a.x-(this.options.margin*2);a.y=a.y-(this.options.margin*2); +this.options.offset.x+=this.options.margin;this.options.offset.y+=this.options.margin;}this.shim.set({width:a.x,height:a.y}).position({relativeTo:this.element,offset:this.options.offset}); +return this;},hide:function(){if(this.shim){this.shim.setStyle("display","none");}return this;},show:function(){if(this.shim){this.shim.setStyle("display","block"); +}return this.position();},dispose:function(){if(this.shim){this.shim.dispose();}return this;},destroy:function(){if(this.shim){this.shim.destroy();}return this; +}});window.addEvent("load",function(){IframeShim.ready=true;});var Mask=new Class({Implements:[Options,Events],Binds:["position"],options:{style:{},"class":"mask",maskMargins:false,useIframeShim:true,iframeShimOptions:{}},initialize:function(b,a){this.target=document.id(b)||document.id(document.body); +this.target.store("mask",this);this.setOptions(a);this.render();this.inject();},render:function(){this.element=new Element("div",{"class":this.options["class"],id:this.options.id||"mask-"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:"none"}),events:{click:function(a){this.fireEvent("click",a); +if(this.options.hideOnClick){this.hide();}}.bind(this)}});this.hidden=true;},toElement:function(){return this.element;},inject:function(b,a){a=a||(this.options.inject?this.options.inject.where:"")||this.target==document.body?"inside":"after"; +b=b||(this.options.inject&&this.options.inject.target)||this.target;this.element.inject(b,a);if(this.options.useIframeShim){this.shim=new IframeShim(this.element,this.options.iframeShimOptions); +this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)});}},position:function(){this.resize(this.options.width,this.options.height); +this.element.position({relativeTo:this.target,position:"topLeft",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body});return this; +},resize:function(a,e){var b={styles:["padding","border"]};if(this.options.maskMargins){b.styles.push("margin");}var d=this.target.getComputedSize(b);if(this.target==document.body){this.element.setStyles({width:0,height:0}); +var c=window.getScrollSize();if(d.totalHeight=0&&a.options[a.selectedIndex].value!=""); +}else{return((a.get("value")==null)||(a.get("value").length==0));}}});Form.Validator.addAllThese([["required",{errorMsg:function(){return Form.Validator.getMsg("required"); +},test:function(a){return !Form.Validator.getValidator("IsEmpty").test(a);}}],["minLength",{errorMsg:function(a,b){if(typeOf(b.minLength)!="null"){return Form.Validator.getMsg("minLength").substitute({minLength:b.minLength,length:a.get("value").length}); +}else{return"";}},test:function(a,b){if(typeOf(b.minLength)!="null"){return(a.get("value").length>=(b.minLength||0));}else{return true;}}}],["maxLength",{errorMsg:function(a,b){if(typeOf(b.maxLength)!="null"){return Form.Validator.getMsg("maxLength").substitute({maxLength:b.maxLength,length:a.get("value").length}); +}else{return"";}},test:function(a,b){return a.get("value").length<=(b.maxLength||10000);}}],["validate-integer",{errorMsg:Form.Validator.getMsg.pass("integer"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^(-?[1-9]\d*|0)$/).test(a.get("value")); +}}],["validate-numeric",{errorMsg:Form.Validator.getMsg.pass("numeric"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^-?(?:0$0(?=\d*\.)|[1-9]|0)\d*(\.\d+)?$/).test(a.get("value")); +}}],["validate-digits",{errorMsg:Form.Validator.getMsg.pass("digits"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^[\d() .:\-\+#]+$/.test(a.get("value"))); +}}],["validate-alpha",{errorMsg:Form.Validator.getMsg.pass("alpha"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^[a-zA-Z]+$/).test(a.get("value")); +}}],["validate-alphanum",{errorMsg:Form.Validator.getMsg.pass("alphanum"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||!(/\W/).test(a.get("value")); +}}],["validate-date",{errorMsg:function(a,b){if(Date.parse){var c=b.dateFormat||"%x";return Form.Validator.getMsg("dateSuchAs").substitute({date:new Date().format(c)}); +}else{return Form.Validator.getMsg("dateInFormatMDY");}},test:function(e,g){if(Form.Validator.getValidator("IsEmpty").test(e)){return true;}var a=Locale.getCurrent().sets.Date,b=new RegExp([a.days,a.days_abbr,a.months,a.months_abbr].flatten().join("|"),"i"),i=e.get("value"),f=i.match(/[a-z]+/gi); +if(f&&!f.every(b.exec,b)){return false;}var c=Date.parse(i),h=g.dateFormat||"%x",d=c.format(h);if(d!="invalid date"){e.set("value",d);}return c.isValid(); +}}],["validate-email",{errorMsg:Form.Validator.getMsg.pass("email"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]\.?){0,63}[a-z0-9!#$%&'*+\/=?^_`{|}~-]@(?:(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\])$/i).test(a.get("value")); +}}],["validate-url",{errorMsg:Form.Validator.getMsg.pass("url"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^(https?|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i).test(a.get("value")); +}}],["validate-currency-dollar",{errorMsg:Form.Validator.getMsg.pass("currencyDollar"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/).test(a.get("value")); +}}],["validate-one-required",{errorMsg:Form.Validator.getMsg.pass("oneRequired"),test:function(a,b){var c=document.id(b["validate-one-required"])||a.getParent(b["validate-one-required"]); +return c.getElements("input").some(function(d){if(["checkbox","radio"].contains(d.get("type"))){return d.get("checked");}return d.get("value");});}}]]); +Element.Properties.validator={set:function(a){this.get("validator").setOptions(a);},get:function(){var a=this.retrieve("validator");if(!a){a=new Form.Validator(this); +this.store("validator",a);}return a;}};Element.implement({validate:function(a){if(a){this.set("validator",a);}return this.get("validator").validate();}}); +Form.Validator.Inline=new Class({Extends:Form.Validator,options:{showError:function(a){if(a.reveal){a.reveal();}else{a.setStyle("display","block");}},hideError:function(a){if(a.dissolve){a.dissolve(); +}else{a.setStyle("display","none");}},scrollToErrorsOnSubmit:true,scrollToErrorsOnBlur:false,scrollToErrorsOnChange:false,scrollFxOptions:{transition:"quad:out",offset:{y:-20}}},initialize:function(b,a){this.parent(b,a); +this.addEvent("onElementValidate",function(g,f,e,h){var d=this.getValidator(e);if(!g&&d.getError(f)){if(h){f.addClass("warning");}var c=this.makeAdvice(e,f,d.getError(f),h); +this.insertAdvice(c,f);this.showAdvice(e,f);}else{this.hideAdvice(e,f);}});},makeAdvice:function(d,f,c,g){var e=(g)?this.warningPrefix:this.errorPrefix; +e+=(this.options.useTitles)?f.title||c:c;var a=(g)?"warning-advice":"validation-advice";var b=this.getAdvice(d,f);if(b){b=b.set("html",e);}else{b=new Element("div",{html:e,styles:{display:"none"},id:"advice-"+d.split(":")[0]+"-"+this.getFieldId(f)}).addClass(a); +}f.store("$moo:advice-"+d,b);return b;},getFieldId:function(a){return a.id?a.id:a.id="input_"+a.name;},showAdvice:function(b,c){var a=this.getAdvice(b,c); +if(a&&!c.retrieve("$moo:"+this.getPropName(b))&&(a.getStyle("display")=="none"||a.getStyle("visiblity")=="hidden"||a.getStyle("opacity")==0)){c.store("$moo:"+this.getPropName(b),true); +this.options.showError(a);this.fireEvent("showAdvice",[c,a,b]);}},hideAdvice:function(b,c){var a=this.getAdvice(b,c);if(a&&c.retrieve("$moo:"+this.getPropName(b))){c.store("$moo:"+this.getPropName(b),false); +this.options.hideError(a);this.fireEvent("hideAdvice",[c,a,b]);}},getPropName:function(a){return"advice"+a;},resetField:function(a){a=document.id(a);if(!a){return this; +}this.parent(a);a.get("validators").each(function(b){this.hideAdvice(b,a);},this);return this;},getAllAdviceMessages:function(d,c){var b=[];if(d.hasClass("ignoreValidation")&&!c){return b; +}var a=d.get("validators").some(function(g){var e=g.test("^warn-")||d.hasClass("warnOnly");if(e){g=g.replace(/^warn-/,"");}var f=this.getValidator(g);if(!f){return; +}b.push({message:f.getError(d),warnOnly:e,passed:f.test(),validator:f});},this);return b;},getAdvice:function(a,b){return b.retrieve("$moo:advice-"+a); +},insertAdvice:function(a,c){var b=c.get("validatorProps");if(!b.msgPos||!document.id(b.msgPos)){if(c.type&&c.type.toLowerCase()=="radio"){c.getParent().adopt(a); +}else{a.inject(document.id(c),"after");}}else{document.id(b.msgPos).grab(a);}},validateField:function(g,f,b){var a=this.parent(g,f);if(((this.options.scrollToErrorsOnSubmit&&b==null)||b)&&!a){var c=document.id(this).getElement(".validation-failed"); +var d=document.id(this).getParent();while(d!=document.body&&d.getScrollSize().y==d.getSize().y){d=d.getParent();}var e=d.retrieve("$moo:fvScroller");if(!e&&window.Fx&&Fx.Scroll){e=new Fx.Scroll(d,this.options.scrollFxOptions); +d.store("$moo:fvScroller",e);}if(c){if(e){e.toElement(c);}else{d.scrollTo(d.getScroll().x,c.getPosition(d).y-20);}}}return a;},watchFields:function(a){a.each(function(b){if(this.options.evaluateFieldsOnBlur){b.addEvent("blur",this.validationMonitor.pass([b,false,this.options.scrollToErrorsOnBlur],this)); +}if(this.options.evaluateFieldsOnChange){b.addEvent("change",this.validationMonitor.pass([b,true,this.options.scrollToErrorsOnChange],this));}},this);}}); +Form.Validator.addAllThese([["validate-enforce-oncheck",{test:function(a,b){var c=a.getParent("form").retrieve("validator");if(!c){return true;}(b.toEnforce||document.id(b.enforceChildrenOf).getElements("input, select, textarea")).map(function(d){if(a.checked){c.enforceField(d); +}else{c.ignoreField(d);c.resetField(d);}});return true;}}],["validate-ignore-oncheck",{test:function(a,b){var c=a.getParent("form").retrieve("validator"); +if(!c){return true;}(b.toIgnore||document.id(b.ignoreChildrenOf).getElements("input, select, textarea")).each(function(d){if(a.checked){c.ignoreField(d); +c.resetField(d);}else{c.enforceField(d);}});return true;}}],["validate-nospace",{errorMsg:function(){return Form.Validator.getMsg("noSpace");},test:function(a,b){return !a.get("value").test(/\s/); +}}],["validate-toggle-oncheck",{test:function(b,c){var d=b.getParent("form").retrieve("validator");if(!d){return true;}var a=c.toToggle||document.id(c.toToggleChildrenOf).getElements("input, select, textarea"); +if(!b.checked){a.each(function(e){d.ignoreField(e);d.resetField(e);});}else{a.each(function(e){d.enforceField(e);});}return true;}}],["validate-reqchk-bynode",{errorMsg:function(){return Form.Validator.getMsg("reqChkByNode"); +},test:function(a,b){return(document.id(b.nodeId).getElements(b.selector||"input[type=checkbox], input[type=radio]")).some(function(c){return c.checked; +});}}],["validate-required-check",{errorMsg:function(a,b){return b.useTitle?a.get("title"):Form.Validator.getMsg("requiredChk");},test:function(a,b){return !!a.checked; +}}],["validate-reqchk-byname",{errorMsg:function(a,b){return Form.Validator.getMsg("reqChkByName").substitute({label:b.label||a.get("type")});},test:function(b,d){var c=d.groupName||b.get("name"); +var a=$$(document.getElementsByName(c)).some(function(g,f){return g.checked;});var e=b.getParent("form").retrieve("validator");if(a&&e){e.resetField(b); +}return a;}}],["validate-match",{errorMsg:function(a,b){return Form.Validator.getMsg("match").substitute({matchName:b.matchName||document.id(b.matchInput).get("name")}); +},test:function(b,c){var d=b.get("value");var a=document.id(c.matchInput)&&document.id(c.matchInput).get("value");return d&&a?d==a:true;}}],["validate-after-date",{errorMsg:function(a,b){return Form.Validator.getMsg("afterDate").substitute({label:b.afterLabel||(b.afterElement?Form.Validator.getMsg("startDate"):Form.Validator.getMsg("currentDate"))}); +},test:function(b,c){var d=document.id(c.afterElement)?Date.parse(document.id(c.afterElement).get("value")):new Date();var a=Date.parse(b.get("value")); +return a&&d?a>=d:true;}}],["validate-before-date",{errorMsg:function(a,b){return Form.Validator.getMsg("beforeDate").substitute({label:b.beforeLabel||(b.beforeElement?Form.Validator.getMsg("endDate"):Form.Validator.getMsg("currentDate"))}); +},test:function(b,c){var d=Date.parse(b.get("value"));var a=document.id(c.beforeElement)?Date.parse(document.id(c.beforeElement).get("value")):new Date(); +return a&&d?a>=d:true;}}],["validate-custom-required",{errorMsg:function(){return Form.Validator.getMsg("required");},test:function(a,b){return a.get("value")!=b.emptyValue; +}}],["validate-same-month",{errorMsg:function(a,b){var c=document.id(b.sameMonthAs)&&document.id(b.sameMonthAs).get("value");var d=a.get("value");if(d!=""){return Form.Validator.getMsg(c?"sameMonth":"startMonth"); +}},test:function(a,b){var d=Date.parse(a.get("value"));var c=Date.parse(document.id(b.sameMonthAs)&&document.id(b.sameMonthAs).get("value"));return d&&c?d.format("%B")==c.format("%B"):true; +}}],["validate-cc-num",{errorMsg:function(a){var b=a.get("value").replace(/[^0-9]/g,"");return Form.Validator.getMsg("creditcard").substitute({length:b.length}); +},test:function(c){if(Form.Validator.getValidator("IsEmpty").test(c)){return true;}var g=c.get("value");g=g.replace(/[^0-9]/g,"");var a=false;if(g.test(/^4[0-9]{12}([0-9]{3})?$/)){a="Visa"; +}else{if(g.test(/^5[1-5]([0-9]{14})$/)){a="Master Card";}else{if(g.test(/^3[47][0-9]{13}$/)){a="American Express";}else{if(g.test(/^6011[0-9]{12}$/)){a="Discover"; +}}}}if(a){var d=0;var e=0;for(var b=g.length-1;b>=0;--b){e=g.charAt(b).toInt();if(e==0){continue;}if((g.length-b)%2==0){e+=e;}if(e>9){e=e.toString().charAt(0).toInt()+e.toString().charAt(1).toInt(); +}d+=e;}if((d%10)==0){return true;}}var f="";while(g!=""){f+=" "+g.substr(0,4);g=g.substr(4);}c.getParent("form").retrieve("validator").ignoreField(c);c.set("value",f.clean()); +c.getParent("form").retrieve("validator").enforceField(c);return false;}}]]);var OverText=new Class({Implements:[Options,Events,Class.Occlude],Binds:["reposition","assert","focus","hide"],options:{element:"label",labelClass:"overTxtLabel",positionOptions:{position:"upperLeft",edge:"upperLeft",offset:{x:4,y:2}},poll:false,pollInterval:250,wrap:false},property:"OverText",initialize:function(b,a){b=this.element=document.id(b); +if(this.occlude()){return this.occluded;}this.setOptions(a);this.attach(b);OverText.instances.push(this);if(this.options.poll){this.poll();}},toElement:function(){return this.element; +},attach:function(){var b=this.element,a=this.options,c=a.textOverride||b.get("alt")||b.get("title");if(!c){return this;}var d=this.text=new Element(a.element,{"class":a.labelClass,styles:{lineHeight:"normal",position:"absolute",cursor:"text"},html:c,events:{click:this.hide.pass(a.element=="label",this)}}).inject(b,"after"); +if(a.element=="label"){if(!b.get("id")){b.set("id","input_"+String.uniqueID());}d.set("for",b.get("id"));}if(a.wrap){this.textHolder=new Element("div.overTxtWrapper",{styles:{lineHeight:"normal",position:"relative"}}).grab(d).inject(b,"before"); +}return this.enable();},destroy:function(){this.element.eliminate(this.property);this.disable();if(this.text){this.text.destroy();}if(this.textHolder){this.textHolder.destroy(); +}return this;},disable:function(){this.element.removeEvents({focus:this.focus,blur:this.assert,change:this.assert});window.removeEvent("resize",this.reposition); +this.hide(true,true);return this;},enable:function(){this.element.addEvents({focus:this.focus,blur:this.assert,change:this.assert});window.addEvent("resize",this.reposition); +this.assert(true);this.reposition();return this;},wrap:function(){if(this.options.element=="label"){if(!this.element.get("id")){this.element.set("id","input_"+String.uniqueID()); +}this.text.set("for",this.element.get("id"));}},startPolling:function(){this.pollingPaused=false;return this.poll();},poll:function(a){if(this.poller&&!a){return this; +}if(a){clearInterval(this.poller);}else{this.poller=(function(){if(!this.pollingPaused){this.assert(true);}}).periodical(this.options.pollInterval,this); +}return this;},stopPolling:function(){this.pollingPaused=true;return this.poll(true);},focus:function(){if(this.text&&(!this.text.isDisplayed()||this.element.get("disabled"))){return this; +}return this.hide();},hide:function(c,a){if(this.text&&(this.text.isDisplayed()&&(!this.element.get("disabled")||a))){this.text.hide();this.fireEvent("textHide",[this.text,this.element]); +this.pollingPaused=true;if(!c){try{this.element.fireEvent("focus");this.element.focus();}catch(b){}}}return this;},show:function(){if(this.text&&!this.text.isDisplayed()){this.text.show(); +this.reposition();this.fireEvent("textShow",[this.text,this.element]);this.pollingPaused=false;}return this;},test:function(){return !this.element.get("value"); +},assert:function(a){return this[this.test()?"show":"hide"](a);},reposition:function(){this.assert(true);if(!this.element.isVisible()){return this.stopPolling().hide(); +}if(this.text&&this.test()){this.text.position(Object.merge(this.options.positionOptions,{relativeTo:this.element}));}return this;}});OverText.instances=[]; +Object.append(OverText,{each:function(a){return OverText.instances.each(function(c,b){if(c.element&&c.text){a.call(OverText,c,b);}});},update:function(){return OverText.each(function(a){return a.reposition(); +});},hideAll:function(){return OverText.each(function(a){return a.hide(true,true);});},showAll:function(){return OverText.each(function(a){return a.show(); +});}});Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(b,a){this.elements=this.subject=$$(b);this.parent(a);},compute:function(g,h,j){var c={}; +for(var d in g){var a=g[d],e=h[d],f=c[d]={};for(var b in a){f[b]=this.parent(a[b],e[b],j);}}return c;},set:function(b){for(var c in b){if(!this.elements[c]){continue; +}var a=b[c];for(var d in a){this.render(this.elements[c],d,a[d],this.options.unit);}}return this;},start:function(c){if(!this.check(c)){return this;}var h={},j={}; +for(var d in c){if(!this.elements[d]){continue;}var f=c[d],a=h[d]={},g=j[d]={};for(var b in f){var e=this.prepare(this.elements[d],b,f[b]);a[b]=e.from; +g[b]=e.to;}}return this.parent(h,j);}});Fx.Accordion=new Class({Extends:Fx.Elements,options:{fixedHeight:false,fixedWidth:false,display:0,show:false,height:true,width:false,opacity:true,alwaysHide:false,trigger:"click",initialDisplayFx:true,resetHeight:true},initialize:function(){var g=function(h){return h!=null; +};var f=Array.link(arguments,{container:Type.isElement,options:Type.isObject,togglers:g,elements:g});this.parent(f.elements,f.options);var b=this.options,e=this.togglers=$$(f.togglers); +this.previous=-1;this.internalChain=new Chain();if(b.alwaysHide){this.options.link="chain";}if(b.show||this.options.show===0){b.display=false;this.previous=b.show; +}if(b.start){b.display=false;b.show=false;}var d=this.effects={};if(b.opacity){d.opacity="fullOpacity";}if(b.width){d.width=b.fixedWidth?"fullWidth":"offsetWidth"; +}if(b.height){d.height=b.fixedHeight?"fullHeight":"scrollHeight";}for(var c=0,a=e.length;c=0?a-1:0)).chain(d);}else{d();}return this;},detach:function(b){var a=function(c){c.removeEvent(this.options.trigger,c.retrieve("accordion:display")); +}.bind(this);if(!b){this.togglers.each(a);}else{a(b);}return this;},display:function(b,c){if(!this.check(b,c)){return this;}var h={},g=this.elements,a=this.options,f=this.effects; +if(c==null){c=true;}if(typeOf(b)=="element"){b=g.indexOf(b);}if(b==this.previous&&!a.alwaysHide){return this;}if(a.resetHeight){var e=g[this.previous]; +if(e&&!this.selfHidden){for(var d in f){e.setStyle(d,e[f[d]]);}}}if((this.timer&&a.link=="chain")||(b===this.previous&&!a.alwaysHide)){return this;}this.previous=b; +this.selfHidden=false;g.each(function(l,k){h[k]={};var j;if(k!=b){j=true;}else{if(a.alwaysHide&&((l.offsetHeight>0&&a.height)||l.offsetWidth>0&&a.width)){j=true; +this.selfHidden=true;}}this.fireEvent(j?"background":"active",[this.togglers[k],l]);for(var m in f){h[k][m]=j?0:l[f[m]];}if(!c&&!j&&a.resetHeight){h[k].height="auto"; +}},this);this.internalChain.clearChain();this.internalChain.chain(function(){if(a.resetHeight&&!this.selfHidden){var i=g[b];if(i){i.setStyle("height","auto"); +}}}.bind(this));return c?this.start(h):this.set(h).internalChain.callChain();}});Fx.Move=new Class({Extends:Fx.Morph,options:{relativeTo:document.body,position:"center",edge:false,offset:{x:0,y:0}},start:function(a){var b=this.element,c=b.getStyles("top","left"); +if(c.top=="auto"||c.left=="auto"){b.setPosition(b.getPosition(b.getOffsetParent()));}return this.parent(b.position(Object.merge({},this.options,a,{returnPos:true}))); +}});Element.Properties.move={set:function(a){this.get("move").cancel().setOptions(a);return this;},get:function(){var a=this.retrieve("move");if(!a){a=new Fx.Move(this,{link:"cancel"}); +this.store("move",a);}return a;}};Element.implement({move:function(a){this.get("move").start(a);return this;}});Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical",wrapper:false,hideOverflow:true,resetHeight:false},initialize:function(b,a){b=this.element=this.subject=document.id(b); +this.parent(a);a=this.options;var d=b.retrieve("wrapper"),c=b.getStyles("margin","position","overflow");if(a.hideOverflow){c=Object.append(c,{overflow:"hidden"}); +}if(a.wrapper){d=document.id(a.wrapper).setStyles(c);}if(!d){d=new Element("div",{styles:c}).wraps(b);}b.store("wrapper",d).setStyle("margin",0);if(b.getStyle("overflow")=="visible"){b.setStyle("overflow","hidden"); +}this.now=[];this.open=true;this.wrapper=d;this.addEvent("complete",function(){this.open=(d["offset"+this.layout.capitalize()]!=0);if(this.open&&this.options.resetHeight){d.setStyle("height",""); +}},true);},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight;},horizontal:function(){this.margin="margin-left"; +this.layout="width";this.offset=this.element.offsetWidth;},set:function(a){this.element.setStyle(this.margin,a[0]);this.wrapper.setStyle(this.layout,a[1]); +return this;},compute:function(c,b,a){return[0,1].map(function(d){return Fx.compute(c[d],b[d],a);});},start:function(b,e){if(!this.check(b,e)){return this; +}this[e||this.options.mode]();var d=this.element.getStyle(this.margin).toInt(),c=this.wrapper.getStyle(this.layout).toInt(),a=[[d,c],[0,this.offset]],g=[[d,c],[-this.offset,0]],f; +switch(b){case"in":f=a;break;case"out":f=g;break;case"toggle":f=(c==0)?a:g;}return this.parent(f[0],f[1]);},slideIn:function(a){return this.start("in",a); +},slideOut:function(a){return this.start("out",a);},hide:function(a){this[a||this.options.mode]();this.open=false;return this.set([-this.offset,0]);},show:function(a){this[a||this.options.mode](); +this.open=true;return this.set([0,this.offset]);},toggle:function(a){return this.start("toggle",a);}});Element.Properties.slide={set:function(a){this.get("slide").cancel().setOptions(a); +return this;},get:function(){var a=this.retrieve("slide");if(!a){a=new Fx.Slide(this,{link:"cancel"});this.store("slide",a);}return a;}};Element.implement({slide:function(d,e){d=d||"toggle"; +var b=this.get("slide"),a;switch(d){case"hide":b.hide(e);break;case"show":b.show(e);break;case"toggle":var c=this.retrieve("slide:flag",b.open);b[c?"slideOut":"slideIn"](e); +this.store("slide:flag",!c);a=true;break;default:b.start(d,e);}if(!a){this.eliminate("slide:flag");}return this;}});(function(){Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(c,b){this.element=this.subject=document.id(c); +this.parent(b);if(typeOf(this.element)!="element"){this.element=document.id(this.element.getDocument().body);}if(this.options.wheelStops){var d=this.element,e=this.cancel.pass(false,this); +this.addEvent("start",function(){d.addEvent("mousewheel",e);},true);this.addEvent("complete",function(){d.removeEvent("mousewheel",e);},true);}},set:function(){var b=Array.flatten(arguments); +if(Browser.firefox){b=[Math.round(b[0]),Math.round(b[1])];}this.element.scrollTo(b[0],b[1]);return this;},compute:function(d,c,b){return[0,1].map(function(e){return Fx.compute(d[e],c[e],b); +});},start:function(c,d){if(!this.check(c,d)){return this;}var b=this.element.getScroll();return this.parent([b.x,b.y],[c,d]);},calculateScroll:function(g,f){var d=this.element,b=d.getScrollSize(),h=d.getScroll(),j=d.getSize(),c=this.options.offset,i={x:g,y:f}; +for(var e in i){if(!i[e]&&i[e]!==0){i[e]=h[e];}if(typeOf(i[e])!="number"){i[e]=b[e]-j[e];}i[e]+=c[e];}return[i.x,i.y];},toTop:function(){return this.start.apply(this,this.calculateScroll(false,0)); +},toLeft:function(){return this.start.apply(this,this.calculateScroll(0,false));},toRight:function(){return this.start.apply(this,this.calculateScroll("right",false)); +},toBottom:function(){return this.start.apply(this,this.calculateScroll(false,"bottom"));},toElement:function(d,e){e=e?Array.from(e):["x","y"];var c=a(this.element)?{x:0,y:0}:this.element.getScroll(); +var b=Object.map(document.id(d).getPosition(this.element),function(g,f){return e.contains(f)?g+c[f]:false;});return this.start.apply(this,this.calculateScroll(b.x,b.y)); +},toElementEdge:function(d,g,e){g=g?Array.from(g):["x","y"];d=document.id(d);var i={},f=d.getPosition(this.element),j=d.getSize(),h=this.element.getScroll(),b=this.element.getSize(),c={x:f.x+j.x,y:f.y+j.y}; +["x","y"].each(function(k){if(g.contains(k)){if(c[k]>h[k]+b[k]){i[k]=c[k]-b[k];}if(f[k]this.elements.length){e.splice(this.elements.length-1,e.length-this.elements.length); +}}var b=0;i=a=0;e.each(function(k){var j={};if(d){j.top=i-f[k].top-b;i+=f[k].height;}else{j.left=a-f[k].left;a+=f[k].width;}b=b+f[k].margin;c[k]=j;},this); +var g={};Array.clone(e).sort().each(function(j){g[j]=c[j];});this.start(g);this.currentOrder=e;return this;},rearrangeDOM:function(a){a=a||this.currentOrder; +var b=this.elements[0].getParent();var c=[];this.elements.setStyle("opacity",0);a.each(function(d){c.push(this.elements[d].inject(b).setStyles({top:0,left:0})); +},this);this.elements.setStyle("opacity",1);this.elements=$$(c);this.setDefaultOrder();return this;},getDefaultOrder:function(){return this.elements.map(function(b,a){return a; +});},getCurrentOrder:function(){return this.currentOrder;},forward:function(){return this.sort(this.getDefaultOrder());},backward:function(){return this.sort(this.getDefaultOrder().reverse()); +},reverse:function(){return this.sort(this.currentOrder.reverse());},sortByElements:function(a){return this.sort(a.map(function(b){return this.elements.indexOf(b); +},this));},swap:function(c,b){if(typeOf(c)=="element"){c=this.elements.indexOf(c);}if(typeOf(b)=="element"){b=this.elements.indexOf(b);}var a=Array.clone(this.currentOrder); +a[this.currentOrder.indexOf(c)]=b;a[this.currentOrder.indexOf(b)]=c;return this.sort(a);}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,stopPropagation:false,modifiers:{x:"left",y:"top"}},initialize:function(){var b=Array.link(arguments,{options:Type.isObject,element:function(c){return c!=null; +}});this.element=document.id(b.element);this.document=this.element.getDocument();this.setOptions(b.options||{});var a=typeOf(this.options.handle);this.handles=((a=="array"||a=="collection")?$$(this.options.handle):document.id(this.options.handle))||this.element; +this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.ie)?"selectstart":"mousedown";if(Browser.ie&&!Drag.ondragstartFixed){document.ondragstart=Function.from(false); +Drag.ondragstartFixed=true;}this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:Function.from(false)}; +this.attach();},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this;},detach:function(){this.handles.removeEvent("mousedown",this.bound.start); +return this;},start:function(a){var j=this.options;if(a.rightClick){return;}if(j.preventDefault){a.preventDefault();}if(j.stopPropagation){a.stopPropagation(); +}this.mouse.start=a.page;this.fireEvent("beforeStart",this.element);var c=j.limit;this.limit={x:[],y:[]};var e,g;for(e in j.modifiers){if(!j.modifiers[e]){continue; +}var b=this.element.getStyle(j.modifiers[e]);if(b&&!b.match(/px$/)){if(!g){g=this.element.getCoordinates(this.element.getOffsetParent());}b=g[j.modifiers[e]]; +}if(j.style){this.value.now[e]=(b||0).toInt();}else{this.value.now[e]=this.element[j.modifiers[e]];}if(j.invert){this.value.now[e]*=-1;}this.mouse.pos[e]=a.page[e]-this.value.now[e]; +if(c&&c[e]){var d=2;while(d--){var f=c[e][d];if(f||f===0){this.limit[e][d]=(typeof f=="function")?f():f;}}}}if(typeOf(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid}; +}var h={mousemove:this.bound.check,mouseup:this.bound.cancel};h[this.selection]=this.bound.eventStop;this.document.addEvents(h);},check:function(a){if(this.options.preventDefault){a.preventDefault(); +}var b=Math.round(Math.sqrt(Math.pow(a.page.x-this.mouse.start.x,2)+Math.pow(a.page.y-this.mouse.start.y,2)));if(b>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop}); +this.fireEvent("start",[this.element,a]).fireEvent("snap",this.element);}},drag:function(b){var a=this.options;if(a.preventDefault){b.preventDefault(); +}this.mouse.now=b.page;for(var c in a.modifiers){if(!a.modifiers[c]){continue;}this.value.now[c]=this.mouse.now[c]-this.mouse.pos[c];if(a.invert){this.value.now[c]*=-1; +}if(a.limit&&this.limit[c]){if((this.limit[c][1]||this.limit[c][1]===0)&&(this.value.now[c]>this.limit[c][1])){this.value.now[c]=this.limit[c][1];}else{if((this.limit[c][0]||this.limit[c][0]===0)&&(this.value.now[c]d.left&&b.xd.top);},this).getLast();if(this.overed!=a){if(this.overed){this.fireEvent("leave",[this.element,this.overed]); +}if(a){this.fireEvent("enter",[this.element,a]);}this.overed=a;}},drag:function(a){this.parent(a);if(this.options.checkDroppables&&this.droppables.length){this.checkDroppables(); +}},stop:function(a){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed,a]);this.overed=null;return this.parent(a);}});Element.implement({makeDraggable:function(a){var b=new Drag.Move(this,a); +this.store("dragger",b);return b;}});var Slider=new Class({Implements:[Events,Options],Binds:["clickedElement","draggedKnob","scrolledElement"],options:{onTick:function(a){this.setKnobPosition(a); +},initialStep:0,snap:false,offset:0,range:false,wheel:false,steps:100,mode:"horizontal"},initialize:function(f,a,e){this.setOptions(e);e=this.options;this.element=document.id(f); +a=this.knob=document.id(a);this.previousChange=this.previousEnd=this.step=-1;var b={},d={x:false,y:false};switch(e.mode){case"vertical":this.axis="y";this.property="top"; +this.offset="offsetHeight";break;case"horizontal":this.axis="x";this.property="left";this.offset="offsetWidth";}this.setSliderDimensions();this.setRange(e.range); +if(a.getStyle("position")=="static"){a.setStyle("position","relative");}a.setStyle(this.property,-e.offset);d[this.axis]=this.property;b[this.axis]=[-e.offset,this.full-e.offset]; +var c={snap:0,limit:b,modifiers:d,onDrag:this.draggedKnob,onStart:this.draggedKnob,onBeforeStart:(function(){this.isDragging=true;}).bind(this),onCancel:function(){this.isDragging=false; +}.bind(this),onComplete:function(){this.isDragging=false;this.draggedKnob();this.end();}.bind(this)};if(e.snap){this.setSnap(c);}this.drag=new Drag(a,c); +this.attach();if(e.initialStep!=null){this.set(e.initialStep);}},attach:function(){this.element.addEvent("mousedown",this.clickedElement);if(this.options.wheel){this.element.addEvent("mousewheel",this.scrolledElement); +}this.drag.attach();return this;},detach:function(){this.element.removeEvent("mousedown",this.clickedElement).removeEvent("mousewheel",this.scrolledElement); +this.drag.detach();return this;},autosize:function(){this.setSliderDimensions().setKnobPosition(this.toPosition(this.step));this.drag.options.limit[this.axis]=[-this.options.offset,this.full-this.options.offset]; +if(this.options.snap){this.setSnap();}return this;},setSnap:function(a){if(!a){a=this.drag.options;}a.grid=Math.ceil(this.stepWidth);a.limit[this.axis][1]=this.full; +return this;},setKnobPosition:function(a){if(this.options.snap){a=this.toPosition(this.step);}this.knob.setStyle(this.property,a);return this;},setSliderDimensions:function(){this.full=this.element.measure(function(){this.half=this.knob[this.offset]/2; +return this.element[this.offset]-this.knob[this.offset]+(this.options.offset*2);}.bind(this));return this;},set:function(a){if(!((this.range>0)^(a0)^(a>this.max))){a=this.max;}this.step=Math.round(a);return this.checkStep().fireEvent("tick",this.toPosition(this.step)).end();},setRange:function(a,b){this.min=Array.pick([a[0],0]); +this.max=Array.pick([a[1],this.options.steps]);this.range=this.max-this.min;this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps; +this.stepWidth=this.stepSize*this.full/Math.abs(this.range);if(a){this.set(Array.pick([b,this.step]).floor(this.min).max(this.max));}return this;},clickedElement:function(c){if(this.isDragging||c.target==this.knob){return; +}var b=this.range<0?-1:1,a=c.page[this.axis]-this.element.getPosition()[this.axis]-this.half;a=a.limit(-this.options.offset,this.full-this.options.offset); +this.step=Math.round(this.min+b*this.toStep(a));this.checkStep().fireEvent("tick",a).end();},scrolledElement:function(a){var b=(this.options.mode=="horizontal")?(a.wheel<0):(a.wheel>0); +this.set(this.step+(b?-1:1)*this.stepSize);a.stop();},draggedKnob:function(){var b=this.range<0?-1:1,a=this.drag.value.now[this.axis];a=a.limit(-this.options.offset,this.full-this.options.offset); +this.step=Math.round(this.min+b*this.toStep(a));this.checkStep();},checkStep:function(){var a=this.step;if(this.previousChange!=a){this.previousChange=a; +this.fireEvent("change",a);}return this;},end:function(){var a=this.step;if(this.previousEnd!==a){this.previousEnd=a;this.fireEvent("complete",a+"");}return this; +},toStep:function(a){var b=(a+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(b-=b%this.stepSize):b;},toPosition:function(a){return(this.full*Math.abs(this.min-a))/(this.steps*this.stepSize)-this.options.offset; +}});var Sortables=new Class({Implements:[Events,Options],options:{opacity:1,clone:false,revert:false,handle:false,dragOptions:{}},initialize:function(a,b){this.setOptions(b); +this.elements=[];this.lists=[];this.idle=true;this.addLists($$(document.id(a)||a));if(!this.options.clone){this.options.revert=false;}if(this.options.revert){this.effect=new Fx.Morph(null,Object.merge({duration:250,link:"cancel"},this.options.revert)); +}},attach:function(){this.addLists(this.lists);return this;},detach:function(){this.lists=this.removeLists(this.lists);return this;},addItems:function(){Array.flatten(arguments).each(function(a){this.elements.push(a); +var b=a.retrieve("sortables:start",function(c){this.start.call(this,c,a);}.bind(this));(this.options.handle?a.getElement(this.options.handle)||a:a).addEvent("mousedown",b); +},this);return this;},addLists:function(){Array.flatten(arguments).each(function(a){this.lists.include(a);this.addItems(a.getChildren());},this);return this; +},removeItems:function(){return $$(Array.flatten(arguments).map(function(a){this.elements.erase(a);var b=a.retrieve("sortables:start");(this.options.handle?a.getElement(this.options.handle)||a:a).removeEvent("mousedown",b); +return a;},this));},removeLists:function(){return $$(Array.flatten(arguments).map(function(a){this.lists.erase(a);this.removeItems(a.getChildren());return a; +},this));},getClone:function(b,a){if(!this.options.clone){return new Element(a.tagName).inject(document.body);}if(typeOf(this.options.clone)=="function"){return this.options.clone.call(this,b,a,this.list); +}var c=a.clone(true).setStyles({margin:0,position:"absolute",visibility:"hidden",width:a.getStyle("width")}).addEvent("mousedown",function(d){a.fireEvent("mousedown",d); +});if(c.get("html").test("radio")){c.getElements("input[type=radio]").each(function(d,e){d.set("name","clone_"+e);if(d.get("checked")){a.getElements("input[type=radio]")[e].set("checked",true); +}});}return c.inject(this.list).setPosition(a.getPosition(a.getOffsetParent()));},getDroppables:function(){var a=this.list.getChildren().erase(this.clone).erase(this.element); +if(!this.options.constrain){a.append(this.lists).erase(this.list);}return a;},insert:function(c,b){var a="inside";if(this.lists.contains(b)){this.list=b; +this.drag.droppables=this.getDroppables();}else{a=this.element.getAllPrevious().contains(b)?"before":"after";}this.element.inject(b,a);this.fireEvent("sort",[this.element,this.clone]); +},start:function(b,a){if(!this.idle||b.rightClick||["button","input","a"].contains(b.target.get("tag"))){return;}this.idle=false;this.element=a;this.opacity=a.get("opacity"); +this.list=a.getParent();this.clone=this.getClone(b,a);this.drag=new Drag.Move(this.clone,Object.merge({droppables:this.getDroppables()},this.options.dragOptions)).addEvents({onSnap:function(){b.stop(); +this.clone.setStyle("visibility","visible");this.element.set("opacity",this.options.opacity||0);this.fireEvent("start",[this.element,this.clone]);}.bind(this),onEnter:this.insert.bind(this),onCancel:this.end.bind(this),onComplete:this.end.bind(this)}); +this.clone.inject(this.element,"before");this.drag.start(b);},end:function(){this.drag.detach();this.element.set("opacity",this.opacity);if(this.effect){var b=this.element.getStyles("width","height"),d=this.clone,c=d.computePosition(this.element.getPosition(this.clone.getOffsetParent())); +var a=function(){this.removeEvent("cancel",a);d.destroy();};this.effect.element=d;this.effect.start({top:c.top,left:c.left,width:b.width,height:b.height,opacity:0.25}).addEvent("cancel",a).chain(a); +}else{this.clone.destroy();}this.reset();},reset:function(){this.idle=true;this.fireEvent("complete",this.element);},serialize:function(){var c=Array.link(arguments,{modifier:Type.isFunction,index:function(d){return d!=null; +}});var b=this.lists.map(function(d){return d.getChildren().map(c.modifier||function(e){return e.get("id");},this);},this);var a=c.index;if(this.lists.length==1){a=0; +}return(a||a===0)&&a>=0&&a2083){this.fireEvent("error",f);}Request.JSONP.request_map["request_"+b]=function(){this.success(arguments,b);}.bind(this);var a=this.getScript(f).inject(c.injectScript); +this.fireEvent("request",[f,a]);if(c.timeout){this.timeout.delay(c.timeout,this);}return this;},getScript:function(a){if(!this.script){this.script=new Element("script",{type:"text/javascript",async:true,src:a}); +}return this.script;},success:function(b,a){if(!this.running){return;}this.clear().fireEvent("complete",b).fireEvent("success",b).callChain();},cancel:function(){if(this.running){this.clear().fireEvent("cancel"); +}return this;},isRunning:function(){return !!this.running;},clear:function(){this.running=false;if(this.script){this.script.destroy();this.script=null; +}return this;},timeout:function(){if(this.running){this.running=false;this.fireEvent("timeout",[this.script.get("src"),this.script]).fireEvent("failure").cancel(); +}return this;}});Request.JSONP.counter=0;Request.JSONP.request_map={};Request.Queue=new Class({Implements:[Options,Events],Binds:["attach","request","complete","cancel","success","failure","exception"],options:{stopOnFailure:true,autoAdvance:true,concurrent:1,requests:{}},initialize:function(a){var b; +if(a){b=a.requests;delete a.requests;}this.setOptions(a);this.requests={};this.queue=[];this.reqBinders={};if(b){this.addRequests(b);}},addRequest:function(a,b){this.requests[a]=b; +this.attach(a,b);return this;},addRequests:function(a){Object.each(a,function(c,b){this.addRequest(b,c);},this);return this;},getName:function(a){return Object.keyOf(this.requests,a); +},attach:function(a,b){if(b._groupSend){return this;}["request","complete","cancel","success","failure","exception"].each(function(c){if(!this.reqBinders[a]){this.reqBinders[a]={}; +}this.reqBinders[a][c]=function(){this["on"+c.capitalize()].apply(this,[a,b].append(arguments));}.bind(this);b.addEvent(c,this.reqBinders[a][c]);},this); +b._groupSend=b.send;b.send=function(c){this.send(a,c);return b;}.bind(this);return this;},removeRequest:function(b){var a=typeOf(b)=="object"?this.getName(b):b; +if(!a&&typeOf(a)!="string"){return this;}b=this.requests[a];if(!b){return this;}["request","complete","cancel","success","failure","exception"].each(function(c){b.removeEvent(c,this.reqBinders[a][c]); +},this);b.send=b._groupSend;delete b._groupSend;return this;},getRunning:function(){return Object.filter(this.requests,function(a){return a.running;}); +},isRunning:function(){return !!(Object.keys(this.getRunning()).length);},send:function(b,a){var c=function(){this.requests[b]._groupSend(a);this.queue.erase(c); +}.bind(this);c.name=b;if(Object.keys(this.getRunning()).length>=this.options.concurrent||(this.error&&this.options.stopOnFailure)){this.queue.push(c);}else{c(); +}return this;},hasNext:function(a){return(!a)?!!this.queue.length:!!this.queue.filter(function(b){return b.name==a;}).length;},resume:function(){this.error=false; +(this.options.concurrent-Object.keys(this.getRunning()).length).times(this.runNext,this);return this;},runNext:function(a){if(!this.queue.length){return this; +}if(!a){this.queue[0]();}else{var b;this.queue.each(function(c){if(!b&&c.name==a){b=true;c();}});}return this;},runAll:function(){this.queue.each(function(a){a(); +});return this;},clear:function(a){if(!a){this.queue.empty();}else{this.queue=this.queue.map(function(b){if(b.name!=a){return b;}else{return false;}}).filter(function(b){return b; +});}return this;},cancel:function(a){this.requests[a].cancel();return this;},onRequest:function(){this.fireEvent("request",arguments);},onComplete:function(){this.fireEvent("complete",arguments); +if(!this.queue.length){this.fireEvent("end");}},onCancel:function(){if(this.options.autoAdvance&&!this.error){this.runNext();}this.fireEvent("cancel",arguments); +},onSuccess:function(){if(this.options.autoAdvance&&!this.error){this.runNext();}this.fireEvent("success",arguments);},onFailure:function(){this.error=true; +if(!this.options.stopOnFailure&&this.options.autoAdvance){this.runNext();}this.fireEvent("failure",arguments);},onException:function(){this.error=true; +if(!this.options.stopOnFailure&&this.options.autoAdvance){this.runNext();}this.fireEvent("exception",arguments);}});Request.implement({options:{initialDelay:5000,delay:5000,limit:60000},startTimer:function(b){var a=function(){if(!this.running){this.send({data:b}); +}};this.lastDelay=this.options.initialDelay;this.timer=a.delay(this.lastDelay,this);this.completeCheck=function(c){clearTimeout(this.timer);this.lastDelay=(c)?this.options.delay:(this.lastDelay+this.options.delay).min(this.options.limit); +this.timer=a.delay(this.lastDelay,this);};return this.addEvent("complete",this.completeCheck);},stopTimer:function(){clearTimeout(this.timer);return this.removeEvent("complete",this.completeCheck); +}});var Asset={javascript:function(f,c){if(!c){c={};}var a=new Element("script",{src:f,type:"text/javascript"}),g=c.document||document,b=0,d=c.onload||c.onLoad; +var e=d?function(){if(++b==1){d.call(this);}}:function(){};delete c.onload;delete c.onLoad;delete c.document;return a.addEvents({load:e,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){e.call(this); +}}}).set(c).inject(g.head);},css:function(d,a){if(!a){a={};}var b=new Element("link",{rel:"stylesheet",media:"screen",type:"text/css",href:d});var c=a.onload||a.onLoad,e=a.document||document; +delete a.onload;delete a.onLoad;delete a.document;if(c){b.addEvent("load",c);}return b.set(a).inject(e.head);},image:function(c,b){if(!b){b={};}var d=new Image(),a=document.id(d)||new Element("img"); +["load","abort","error"].each(function(e){var g="on"+e,f="on"+e.capitalize(),h=b[g]||b[f]||function(){};delete b[f];delete b[g];d[g]=function(){if(!d){return; +}if(!a.parentNode){a.width=d.width;a.height=d.height;}d=d.onload=d.onabort=d.onerror=null;h.delay(1,a,a);a.fireEvent(e,a,1);};});d.src=a.src=c;if(d&&d.complete){d.onload.delay(1); +}return a.set(b);},images:function(c,b){c=Array.from(c);var d=function(){},a=0;b=Object.merge({onComplete:d,onProgress:d,onError:d,properties:{}},b);return new Elements(c.map(function(f,e){return Asset.image(f,Object.append(b.properties,{onload:function(){a++; +b.onProgress.call(this,a,e,f);if(a==c.length){b.onComplete();}},onerror:function(){a++;b.onError.call(this,a,e,f);if(a==c.length){b.onComplete();}}})); +}));}};(function(){var a=this.Color=new Type("Color",function(c,d){if(arguments.length>=3){d="rgb";c=Array.slice(arguments,0,3);}else{if(typeof c=="string"){if(c.match(/rgb/)){c=c.rgbToHex().hexToRgb(true); +}else{if(c.match(/hsb/)){c=c.hsbToRgb();}else{c=c.hexToRgb(true);}}}}d=d||"rgb";switch(d){case"hsb":var b=c;c=c.hsbToRgb();c.hsb=b;break;case"hex":c=c.hexToRgb(true); +break;}c.rgb=c.slice(0,3);c.hsb=c.hsb||c.rgbToHsb();c.hex=c.rgbToHex();return Object.append(c,this);});a.implement({mix:function(){var b=Array.slice(arguments); +var d=(typeOf(b.getLast())=="number")?b.pop():50;var c=this.slice();b.each(function(e){e=new a(e);for(var f=0;f<3;f++){c[f]=Math.round((c[f]/100*(100-d))+(e[f]/100*d)); +}});return new a(c,"rgb");},invert:function(){return new a(this.map(function(b){return 255-b;}));},setHue:function(b){return new a([b,this.hsb[1],this.hsb[2]],"hsb"); +},setSaturation:function(b){return new a([this.hsb[0],b,this.hsb[2]],"hsb");},setBrightness:function(b){return new a([this.hsb[0],this.hsb[1],b],"hsb"); +}});this.$RGB=function(e,d,c){return new a([e,d,c],"rgb");};this.$HSB=function(e,d,c){return new a([e,d,c],"hsb");};this.$HEX=function(b){return new a(b,"hex"); +};Array.implement({rgbToHsb:function(){var c=this[0],d=this[1],k=this[2],h=0;var j=Math.max(c,d,k),f=Math.min(c,d,k);var l=j-f;var i=j/255,g=(j!=0)?l/j:0; +if(g!=0){var e=(j-c)/l;var b=(j-d)/l;var m=(j-k)/l;if(c==j){h=m-b;}else{if(d==j){h=2+e-m;}else{h=4+b-e;}}h/=6;if(h<0){h++;}}return[Math.round(h*360),Math.round(g*100),Math.round(i*100)]; +},hsbToRgb:function(){var d=Math.round(this[2]/100*255);if(this[1]==0){return[d,d,d];}else{var b=this[0]%360;var g=b%60;var h=Math.round((this[2]*(100-this[1]))/10000*255); +var e=Math.round((this[2]*(6000-this[1]*g))/600000*255);var c=Math.round((this[2]*(6000-this[1]*(60-g)))/600000*255);switch(Math.floor(b/60)){case 0:return[d,c,h]; +case 1:return[e,d,h];case 2:return[h,d,c];case 3:return[h,e,d];case 4:return[c,h,d];case 5:return[d,h,e];}}return false;}});String.implement({rgbToHsb:function(){var b=this.match(/\d{1,3}/g); +return(b)?b.rgbToHsb():null;},hsbToRgb:function(){var b=this.match(/\d{1,3}/g);return(b)?b.hsbToRgb():null;}});})();(function(){this.Group=new Class({initialize:function(){this.instances=Array.flatten(arguments); +this.events={};this.checker={};},addEvent:function(b,a){this.checker[b]=this.checker[b]||{};this.events[b]=this.events[b]||[];if(this.events[b].contains(a)){return false; +}else{this.events[b].push(a);}this.instances.each(function(c,d){c.addEvent(b,this.check.pass([b,c,d],this));},this);return this;},check:function(c,a,b){this.checker[c][b]=true; +var d=this.instances.every(function(f,e){return this.checker[c][e]||false;},this);if(!d){return;}this.checker[c]={};this.events[c].each(function(e){e.call(this,this.instances,a); +},this);}});})();Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:true},initialize:function(b,a){this.parent(b,a);this.load();},save:function(){var a=JSON.encode(this.hash); +if(!a||a.length>4096){return false;}if(a=="{}"){this.dispose();}else{this.write(a);}return true;},load:function(){this.hash=new Hash(JSON.decode(this.read(),true)); +return this;}});Hash.each(Hash.prototype,function(b,a){if(typeof b=="function"){Hash.Cookie.implement(a,function(){var c=b.apply(this.hash,arguments);if(this.options.autoSave){this.save(); +}return c;});}});(function(){var a=this.Table=function(){this.length=0;var c=[],b=[];this.set=function(e,g){var d=c.indexOf(e);if(d==-1){var f=c.length; +c[f]=e;b[f]=g;this.length++;}else{b[d]=g;}return this;};this.get=function(e){var d=c.indexOf(e);return(d==-1)?null:b[d];};this.erase=function(e){var d=c.indexOf(e); +if(d!=-1){this.length--;c.splice(d,1);return b.splice(d,1)[0];}return null;};this.each=this.forEach=function(f,g){for(var e=0,d=this.length;e1?$$(a):a.length?document.id(a[0]):false;},setHeaders:function(a){this.set("headers",a); +return this;},setFooters:function(a){this.set("footers",a);return this;},push:function(f,c,e,a,b){if(typeOf(f)=="element"&&f.get("tag")=="tr"){f.inject(e||this.body,b); +return{tr:f,tds:f.getChildren("td")};}var d=f.map(function(i){var j=new Element(a||"td",i?i.properties:{}),h=(i?i.content:"")||i,g=typeOf(h);if(["element","array","collection","elements"].contains(g)){j.adopt(h); +}else{j.set("html",h);}return j;});return{tr:new Element("tr",c).inject(e||this.body,b).adopt(d),tds:d};}});["adopt","inject","wraps","grab","replaces","dispose"].each(function(a){HtmlTable.implement(a,function(){this.element[a].apply(this.element,arguments); +return this;});});HtmlTable=Class.refactor(HtmlTable,{options:{classZebra:"table-tr-odd",zebra:true},initialize:function(){this.previous.apply(this,arguments); +if(this.occluded){return this.occluded;}if(this.options.zebra){this.updateZebras();}},updateZebras:function(){Array.each(this.body.rows,this.zebra,this); +},setRowStyle:function(b,a){if(this.previous){this.previous(b,a);}this.zebra(b,a);},zebra:function(b,a){return b[((a%2)?"remove":"add")+"Class"](this.options.classZebra); +},push:function(){var a=this.previous.apply(this,arguments);if(this.options.zebra){this.updateZebras();}return a;}});HtmlTable=Class.refactor(HtmlTable,{options:{sortIndex:0,sortReverse:false,parsers:[],defaultParser:"string",classSortable:"table-sortable",classHeadSort:"table-th-sort",classHeadSortRev:"table-th-sort-rev",classNoSort:"table-th-nosort",classGroupHead:"table-tr-group-head",classGroup:"table-tr-group",classCellSort:"table-td-sort",classSortSpan:"table-th-sort-span",sortable:false,thSelector:"th"},initialize:function(){this.previous.apply(this,arguments); +if(this.occluded){return this.occluded;}this.sorted={index:null,dir:1};this.bound={headClick:this.headClick.bind(this)};this.sortSpans=new Elements();if(this.options.sortable){this.enableSort(); +if(this.options.sortIndex!=null){this.sort(this.options.sortIndex,this.options.sortReverse);}}},attachSorts:function(a){this.detachSorts();if(a!==false){this.element.addEvent("click:relay("+this.options.thSelector+")",this.bound.headClick); +}},detachSorts:function(){this.element.removeEvents("click:relay("+this.options.thSelector+")");},setHeaders:function(){this.previous.apply(this,arguments); +if(this.sortEnabled){this.setParsers();}},setParsers:function(){this.parsers=this.detectParsers();},detectParsers:function(){return this.head&&this.head.getElements(this.options.thSelector).flatten().map(this.detectParser,this); +},detectParser:function(a,b){if(a.hasClass(this.options.classNoSort)||a.retrieve("htmltable-parser")){return a.retrieve("htmltable-parser");}var c=new Element("div"); +c.adopt(a.childNodes).inject(a);var f=new Element("span",{"class":this.options.classSortSpan}).inject(c,"top");this.sortSpans.push(f);var g=this.options.parsers[b],e=this.body.rows,d; +switch(typeOf(g)){case"function":g={convert:g};d=true;break;case"string":g=g;d=true;break;}if(!d){HtmlTable.ParserPriority.some(function(k){var o=HtmlTable.Parsers[k],m=o.match; +if(!m){return false;}for(var n=0,l=e.length;nc){b[f].position--;}}}},setRowStyle:function(b,a){this.previous(b,a);b.cells[this.sorted.index].addClass(this.options.classCellSort); +},setGroupSort:function(b,c,a){if(b==a.value){c.removeClass(this.options.classGroupHead).addClass(this.options.classGroup);}else{c.removeClass(this.options.classGroup).addClass(this.options.classGroupHead); +}return a.value;},getParser:function(){var a=this.parsers[this.sorted.index];return typeOf(a)=="string"?HtmlTable.Parsers[a]:a;},sort:function(c,b,e){if(!this.head){return; +}if(!e){this.clearSort();this.setSortedState(c,b);this.setHeadSort(true);}var f=this.getParser();if(!f){return;}var a;if(!Browser.ie){a=this.body.getParent(); +this.body.dispose();}var d=this.parseData(f).sort(function(h,g){if(h.value===g.value){return 0;}return h.value>g.value?1:-1;});if(this.sorted.reverse==(f==HtmlTable.Parsers["input-checked"])){d.reverse(true); +}this.setRowSort(d,e);if(a){a.grab(this.body);}this.fireEvent("stateChanged");return this.fireEvent("sort",[this.body,this.sorted.index]);},parseData:function(a){return Array.map(this.body.rows,function(d,b){var c=a.convert.call(document.id(d.cells[this.sorted.index])); +return{position:b,value:c};},this);},clearSort:function(){this.setHeadSort(false);this.body.getElements("td").removeClass(this.options.classCellSort);},reSort:function(){if(this.sortEnabled){this.sort.call(this,this.sorted.index,this.sorted.reverse); +}return this;},enableSort:function(){this.element.addClass(this.options.classSortable);this.attachSorts(true);this.setParsers();this.sortEnabled=true;return this; +},disableSort:function(){this.element.removeClass(this.options.classSortable);this.attachSorts(false);this.sortSpans.each(function(a){a.destroy();});this.sortSpans.empty(); +this.sortEnabled=false;return this;}});HtmlTable.ParserPriority=["date","input-checked","input-value","float","number"];HtmlTable.Parsers={date:{match:/^\d{2}[-\/ ]\d{2}[-\/ ]\d{2,4}$/,convert:function(){var a=Date.parse(this.get("text").stripTags()); +return(typeOf(a)=="date")?a.format("db"):"";},type:"date"},"input-checked":{match:/ type="(radio|checkbox)" /,convert:function(){return this.getElement("input").checked; +}},"input-value":{match:/=b.length){a=null;}return a;},attachSelects:function(d){d=d!=null?d:true; +var g=d?"addEvents":"removeEvents";this.element[g]({mouseleave:this.bound.mouseleave,click:this.bound.activateKeyboard});this.body[g]({"click:relay(tr)":this.bound.clickRow,"contextmenu:relay(tr)":this.bound.clickRow}); +if(this.options.useKeyboard||this.keyboard){if(!this.keyboard){this.keyboard=new Keyboard();}if(!this.selectKeysDefined){this.selectKeysDefined=true;var f,e; +var c=function(i){var h=function(j){clearTimeout(f);j.preventDefault();var k=this.body.rows[this.getRowByOffset(i)];if(j.shift&&k&&this.isSelected(k)){this.deselectRow(this.focused); +this.focused=k;}else{if(k&&(!this.options.allowMultiSelect||!j.shift)){this.selectNone();}this.shiftFocus(i,j);}if(e){f=h.delay(100,this,j);}else{f=(function(){e=true; +h(j);}).delay(400);}}.bind(this);return h;}.bind(this);var b=function(){clearTimeout(f);e=false;};this.keyboard.addEvents({"keydown:shift+up":c(-1),"keydown:shift+down":c(1),"keyup:shift+up":b,"keyup:shift+down":b,"keyup:up":b,"keyup:down":b}); +var a="";if(this.options.allowMultiSelect&&this.options.shiftForMultiSelect&&this.options.useKeyboard){a=" (Shift multi-selects).";}this.keyboard.addShortcuts({"Select Previous Row":{keys:"up",shortcut:"up arrow",handler:c(-1),description:"Select the previous row in the table."+a},"Select Next Row":{keys:"down",shortcut:"down arrow",handler:c(1),description:"Select the next row in the table."+a}}); +}this.keyboard[d?"activate":"deactivate"]();}this.updateSelects();},mouseleave:function(){if(this.hovered){this.leaveRow(this.hovered);}}});var Scroller=new Class({Implements:[Events,Options],options:{area:20,velocity:1,onChange:function(a,b){this.element.scrollTo(a,b); +},fps:50},initialize:function(b,a){this.setOptions(a);this.element=document.id(b);this.docBody=document.id(this.element.getDocument().body);this.listener=(typeOf(this.element)!="element")?this.docBody:this.element; +this.timer=null;this.bound={attach:this.attach.bind(this),detach:this.detach.bind(this),getCoords:this.getCoords.bind(this)};},start:function(){this.listener.addEvents({mouseover:this.bound.attach,mouseleave:this.bound.detach}); +return this;},stop:function(){this.listener.removeEvents({mouseover:this.bound.attach,mouseleave:this.bound.detach});this.detach();this.timer=clearInterval(this.timer); +return this;},attach:function(){this.listener.addEvent("mousemove",this.bound.getCoords);},detach:function(){this.listener.removeEvent("mousemove",this.bound.getCoords); +this.timer=clearInterval(this.timer);},getCoords:function(a){this.page=(this.listener.get("tag")=="body")?a.client:a.page;if(!this.timer){this.timer=this.scroll.periodical(Math.round(1000/this.options.fps),this); +}},scroll:function(){var c=this.element.getSize(),a=this.element.getScroll(),h=this.element!=this.docBody?this.element.getOffsets():{x:0,y:0},d=this.element.getScrollSize(),g={x:0,y:0},e=this.options.area.top||this.options.area,b=this.options.area.bottom||this.options.area; +for(var f in this.page){if(this.page[f]<(e+h[f])&&a[f]!=0){g[f]=(this.page[f]-e-h[f])*this.options.velocity;}else{if(this.page[f]+b>(c[f]+h[f])&&a[f]+c[f]!=d[f]){g[f]=(this.page[f]-c[f]+b-h[f])*this.options.velocity; +}}g[f]=g[f].round();}if(g.y||g.x){this.fireEvent("change",[a.x+g.x,a.y+g.y]);}}});(function(){var a=function(c,b){return(c)?(typeOf(c)=="function"?c(b):b.get(c)):""; +};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle("display","block");},onHide:function(){this.tip.setStyle("display","none"); +},title:"title",text:function(b){return b.get("rel")||b.get("href");},showDelay:100,hideDelay:100,className:"tip-wrap",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:false},initialize:function(){var b=Array.link(arguments,{options:Type.isObject,elements:function(c){return c!=null; +}});this.setOptions(b.options);if(b.elements){this.attach(b.elements);}this.container=new Element("div",{"class":"tip"});},toElement:function(){if(this.tip){return this.tip; +}this.tip=new Element("div",{"class":this.options.className,styles:{position:"absolute",top:0,left:0}}).adopt(new Element("div",{"class":"tip-top"}),this.container,new Element("div",{"class":"tip-bottom"})); +return this.tip;},attach:function(b){$$(b).each(function(d){var f=a(this.options.title,d),e=a(this.options.text,d);d.set("title","").store("tip:native",f).retrieve("tip:title",f); +d.retrieve("tip:text",e);this.fireEvent("attach",[d]);var c=["enter","leave"];if(!this.options.fixed){c.push("move");}c.each(function(h){var g=d.retrieve("tip:"+h); +if(!g){g=function(i){this["element"+h.capitalize()].apply(this,[i,d]);}.bind(this);}d.store("tip:"+h,g).addEvent("mouse"+h,g);},this);},this);return this; +},detach:function(b){$$(b).each(function(d){["enter","leave","move"].each(function(e){d.removeEvent("mouse"+e,d.retrieve("tip:"+e)).eliminate("tip:"+e); +});this.fireEvent("detach",[d]);if(this.options.title=="title"){var c=d.retrieve("tip:native");if(c){d.set("title",c);}}},this);return this;},elementEnter:function(c,b){clearTimeout(this.timer); +this.timer=(function(){this.container.empty();["title","text"].each(function(e){var d=b.retrieve("tip:"+e);var f=this["_"+e+"Element"]=new Element("div",{"class":"tip-"+e}).inject(this.container); +if(d){this.fill(f,d);}},this);this.show(b);this.position((this.options.fixed)?{page:b.getPosition()}:c);}).delay(this.options.showDelay,this);},elementLeave:function(c,b){clearTimeout(this.timer); +this.timer=this.hide.delay(this.options.hideDelay,this,b);this.fireForParent(c,b);},setTitle:function(b){if(this._titleElement){this._titleElement.empty(); +this.fill(this._titleElement,b);}return this;},setText:function(b){if(this._textElement){this._textElement.empty();this.fill(this._textElement,b);}return this; +},fireForParent:function(c,b){b=b.getParent();if(!b||b==document.body){return;}if(b.retrieve("tip:enter")){b.fireEvent("mouseenter",c);}else{this.fireForParent(c,b); +}},elementMove:function(c,b){this.position(c);},position:function(f){if(!this.tip){document.id(this);}var c=window.getSize(),b=window.getScroll(),g={x:this.tip.offsetWidth,y:this.tip.offsetHeight},d={x:"left",y:"top"},e={y:false,x2:false,y2:false,x:false},h={}; +for(var i in d){h[d[i]]=f.page[i]+this.options.offset[i];if(h[d[i]]<0){e[i]=true;}if((h[d[i]]+g[i]-b[i])>c[i]-this.options.windowPadding[i]){h[d[i]]=f.page[i]-this.options.offset[i]-g[i]; +e[i+"2"]=true;}}this.fireEvent("bound",e);this.tip.setStyles(h);},fill:function(b,c){if(typeof c=="string"){b.set("html",c);}else{b.adopt(c);}},show:function(b){if(!this.tip){document.id(this); +}if(!this.tip.getParent()){this.tip.inject(document.body);}this.fireEvent("show",[this.tip,b]);},hide:function(b){if(!this.tip){document.id(this);}this.fireEvent("hide",[this.tip,b]); +}});})();Locale.define("en-GB","Date",{dateOrder:["date","month","year"],shortDate:"%d/%m/%Y",shortTime:"%H:%M"}).inherit("en-US","Date"); \ No newline at end of file diff --git a/web/views/Makefile.am b/web/views/Makefile.am new file mode 100644 index 000000000..6ecec9d8b --- /dev/null +++ b/web/views/Makefile.am @@ -0,0 +1,6 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/views + +dist_web_DATA = file.php \ + image.php diff --git a/web/views/Makefile.in b/web/views/Makefile.in new file mode 100644 index 000000000..2eeca05aa --- /dev/null +++ b/web/views/Makefile.in @@ -0,0 +1,453 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = web/views +DIST_COMMON = $(dist_web_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(webdir)" +DATA = $(dist_web_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BINDIR = @BINDIR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CGI_PREFIX = @CGI_PREFIX@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_MMAP = @ENABLE_MMAP@ +EXEEXT = @EXEEXT@ +EXTRA_LIBS = @EXTRA_LIBS@ +EXTRA_PERL_LIB = @EXTRA_PERL_LIB@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FFMPEG_PREFIX = @FFMPEG_PREFIX@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_ARCH = @LIB_ARCH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +MYSQL_PREFIX = @MYSQL_PREFIX@ +OBJEXT = @OBJEXT@ +OPT_FFMPEG = @OPT_FFMPEG@ +OPT_NETPBM = @OPT_NETPBM@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_BUILD = @PATH_BUILD@ +PATH_FFMPEG = @PATH_FFMPEG@ +PATH_NETPBM = @PATH_NETPBM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_MM_PARMS = @PERL_MM_PARMS@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +TIME_BUILD = @TIME_BUILD@ +VERSION = @VERSION@ +WEB_GROUP = @WEB_GROUP@ +WEB_HOST = @WEB_HOST@ +WEB_PREFIX = @WEB_PREFIX@ +WEB_USER = @WEB_USER@ +ZM_CONFIG = @ZM_CONFIG@ +ZM_DB_HOST = @ZM_DB_HOST@ +ZM_DB_NAME = @ZM_DB_NAME@ +ZM_DB_PASS = @ZM_DB_PASS@ +ZM_DB_USER = @ZM_DB_USER@ +ZM_HAS_GNUTLS = @ZM_HAS_GNUTLS@ +ZM_HAS_GNUTLS_OPENSSL = @ZM_HAS_GNUTLS_OPENSSL@ +ZM_HAS_V4L = @ZM_HAS_V4L@ +ZM_HAS_V4L1 = @ZM_HAS_V4L1@ +ZM_HAS_V4L2 = @ZM_HAS_V4L2@ +ZM_LOGDIR = @ZM_LOGDIR@ +ZM_MYSQL_ENGINE = @ZM_MYSQL_ENGINE@ +ZM_PCRE = @ZM_PCRE@ +ZM_PID = @ZM_PID@ +ZM_RUNDIR = @ZM_RUNDIR@ +ZM_SSL_LIB = @ZM_SSL_LIB@ +ZM_TMPDIR = @ZM_TMPDIR@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = gnu +webdir = @WEB_PREFIX@/views +dist_web_DATA = file.php \ + image.php + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu web/views/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu web/views/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-dist_webDATA: $(dist_web_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(webdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(webdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(webdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(webdir)" || exit $$?; \ + done + +uninstall-dist_webDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web_DATA)'; test -n "$(webdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(webdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(webdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_webDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_webDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_webDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-dist_webDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/web/views/file.php b/web/views/file.php new file mode 100644 index 000000000..772226a55 --- /dev/null +++ b/web/views/file.php @@ -0,0 +1,56 @@ + diff --git a/web/views/image.php b/web/views/image.php new file mode 100644 index 000000000..b56f34730 --- /dev/null +++ b/web/views/image.php @@ -0,0 +1,102 @@ + diff --git a/zm.conf.in b/zm.conf.in new file mode 100644 index 000000000..6a95e1b76 --- /dev/null +++ b/zm.conf.in @@ -0,0 +1,50 @@ +# ========================================================================== +# +# ZoneMinder Base Configuration, $Date$, $Revision$ +# +# ========================================================================== +# +# This file is generated by 'configure'. Care should be taken if manually +# editing this file as an changes may be overwritten by subsequent configuration +# or installations. +# + +# Current version of ZoneMinder +ZM_VERSION=@VERSION@ + +# Path to build directory, used mostly for finding DB upgrade scripts +ZM_PATH_BUILD=@PATH_BUILD@ + +# Build time, used to record when to trigger various checks +ZM_TIME_BUILD=@TIME_BUILD@ + +# Path to ZoneMinder binaries +ZM_PATH_BIN=@BINDIR@ + +# Path to ZoneMinder libraries (none at present, for future use) +ZM_PATH_LIB=@LIBDIR@ + +# Path to ZoneMinder configuration (this file only at present) +ZM_PATH_CONF=@SYSCONFDIR@ + +# Path to ZoneMinder web files +ZM_PATH_WEB=@WEB_PREFIX@ + +# Path to ZoneMinder cgi files +ZM_PATH_CGI=@CGI_PREFIX@ + +# Username and group that web daemon (httpd/apache) runs as +ZM_WEB_USER=@WEB_USER@ +ZM_WEB_GROUP=@WEB_GROUP@ + +# ZoneMinder database hostname or ip address +ZM_DB_HOST=@ZM_DB_HOST@ + +# ZoneMinder database name +ZM_DB_NAME=@ZM_DB_NAME@ + +# ZoneMinder database user +ZM_DB_USER=@ZM_DB_USER@ + +# ZoneMinder database password +ZM_DB_PASS=@ZM_DB_PASS@ diff --git a/zmconfgen.pl.in b/zmconfgen.pl.in new file mode 100644 index 000000000..5acc98daa --- /dev/null +++ b/zmconfgen.pl.in @@ -0,0 +1,190 @@ +#!/usr/bin/perl -w +# +# ========================================================================== +# +# Zone Minder Configuration Script, $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. +# +# ========================================================================== +# +# This script is used to generate initial config headers and database data. +# + +use strict; +use lib './scripts/ZoneMinder/lib'; +use ZoneMinder::ConfigData qw/:data/; + +$| = 1; + +my $config_header = "src/zm_config_defines.h"; +my $config_sql = "db/zm_create.sql"; + +generateConfigFiles(); + +exit; + +sub generateConfigFiles +{ + generateConfigHeader(); + generateConfigSQL(); +} + +sub generateConfigHeader +{ + print( "Generating '$config_header'\n" ); + open( CFG_HDR_FILE, ">$config_header" ) or die( "Can't open '$config_header' for writing" ); + print( CFG_HDR_FILE "// The file is autogenerated by zmconfgen.pl\n" ); + print( CFG_HDR_FILE "// Do not edit this file as any changes will be overwritten\n\n" ); + my $last_id = 0; + my $define_list = ""; + my $declare_list = ""; + my $assign_list = ""; + foreach my $option ( @options ) + { + next if ( !defined($option->{id}) ); + + my $opt_id = $option->{id}; + my $opt_name = $option->{name}; + my $opt_type = $option->{type}; + my $var_name = substr( lc($opt_name), 3 ); + + $define_list .= sprintf( "#define $opt_name $opt_id\n" ); + + $declare_list .= sprintf( "\t" ); + if ( $opt_type->{db_type} eq 'boolean' ) + { + $declare_list .= sprintf( "bool " ); + } + elsif ( $opt_type->{db_type} eq 'integer' || $opt_type->{db_type} eq 'hexadecimal' ) + { + $declare_list .= sprintf( "int " ); + } + elsif ( $opt_type->{db_type} eq 'decimal' ) + { + $declare_list .= sprintf( "double " ); + } + else + { + $declare_list .= sprintf( "const char *" ); + } + $declare_list .= sprintf( $var_name.";\\\n" ); + + $assign_list .= sprintf( "\t" ); + $assign_list .= sprintf( $var_name." = " ); + if ( $opt_type->{db_type} eq 'boolean' ) + { + $assign_list .= sprintf( "(bool)" ); + } + elsif ( $opt_type->{db_type} eq 'integer' || $opt_type->{db_type} eq 'hexadecimal' ) + { + $assign_list .= sprintf( "(int)" ); + } + elsif ( $opt_type->{db_type} eq 'decimal' ) + { + $assign_list .= sprintf( "(double) " ); + } + else + { + $assign_list .= sprintf( "(const char *)" ); + } + $assign_list .= sprintf( "config.Item( ".$opt_name." );\\\n" ); + + $last_id = $option->{id}; + } + print( CFG_HDR_FILE $define_list."\n\n" ); + print( CFG_HDR_FILE "#define ZM_MAX_CFG_ID $last_id\n\n" ); + print( CFG_HDR_FILE "#define ZM_CFG_DECLARE_LIST \\\n" ); + print( CFG_HDR_FILE $declare_list."\n\n" ); + print( CFG_HDR_FILE "#define ZM_CFG_ASSIGN_LIST \\\n" ); + print( CFG_HDR_FILE $assign_list."\n\n" ); + close( CFG_HDR_FILE ); +} + +sub generateConfigSQL +{ + print( "Updating '$config_sql'\n" ); + my $config_sql_temp = $config_sql.".temp"; + open( CFG_SQL_FILE, "<$config_sql" ) or die( "Can't open '$config_sql' for reading" ); + open( CFG_TEMP_SQL_FILE, ">$config_sql_temp" ) or die( "Can't open '$config_sql_temp' for writing" ); + while ( my $line = ) + { + last if ( $line =~ /^-- This section is autogenerated/ ); + print( CFG_TEMP_SQL_FILE $line ); + } + close( CFG_SQL_FILE ); + + print( CFG_TEMP_SQL_FILE "-- This section is autogenerated by zmconfgen.pl\n" ); + print( CFG_TEMP_SQL_FILE "-- Do not edit this file as any changes will be overwritten\n" ); + print( CFG_TEMP_SQL_FILE "--\n\n" ); + print( CFG_TEMP_SQL_FILE "delete from Config;\n\n" ); + foreach my $option ( @options ) + { + #print( $option->{name}."\n" ) if ( !$option->{category} ); + $option->{db_type} = $option->{type}->{db_type}; + $option->{db_hint} = $option->{type}->{hint}; + $option->{db_pattern} = $option->{type}->{pattern}; + $option->{db_format} = $option->{type}->{format}; + if ( $option->{db_type} eq "boolean" ) + { + $option->{db_value} = ($option->{value} eq "yes")?"1":"0"; + } + else + { + $option->{db_value} = $option->{value}; + } + if ( $option->{name} eq "ZM_DYN_CURR_VERSION" || $option->{name} eq "ZM_DYN_DB_VERSION" ) + { + $option->{db_value} = '@VERSION@'; + } + if ( my $requires = $option->{requires} ) + { + $option->{db_requires} = join( ";", map { my $value = $_->{value}; $value = ($value eq "yes")?1:0 if ( $options_hash{$_->{name}}->{db_type} eq "boolean" ); ( "$_->{name}=$value" ) } @$requires ); + } + else + { + $option->{db_requires} = ""; + } + printf( CFG_TEMP_SQL_FILE + "insert into Config set Id = %d, Name = '%s', Value = '%s', Type = '%s', DefaultValue = '%s', Hint = '%s', Pattern = '%s', Format = '%s', Prompt = '%s', Help = '%s', Category = '%s', Readonly = '%s', Requires = '%s';\n", + $option->{id}, + $option->{name}, + addSlashes($option->{db_value}), + $option->{db_type}, + addSlashes($option->{default}), + addSlashes($option->{db_hint}), + addSlashes($option->{db_pattern}), + addSlashes($option->{db_format}), + addSlashes($option->{description}), + addSlashes($option->{help}), + $option->{category}, + $option->{readonly}?1:0, + $option->{db_requires} + ); + } + print( CFG_TEMP_SQL_FILE "\n" ); + close( CFG_TEMP_SQL_FILE ); + + rename( $config_sql_temp, $config_sql ) or die( "Can't rename '$config_sql_temp' to '$config_sql': $!" ); +} + +sub addSlashes +{ + my $string = shift; + return( "" ) if ( !defined($string) ); + $string =~ s|(['"])|\\$1|g; + return( $string ); +}