diff options
author | Kurt Jaeger <pi@FreeBSD.org> | 2016-06-05 18:47:54 +0000 |
---|---|---|
committer | Kurt Jaeger <pi@FreeBSD.org> | 2016-06-05 18:47:54 +0000 |
commit | bfde1e8cb6c339dfdc2ff94f7c096727da64ada7 (patch) | |
tree | 819c09b8f92d3945a365e0ccf40f157b0bdc21a7 /multimedia/zoneminder/files | |
parent | d9d8dafa7aa8ca67c46e92c1161078bc40a59b33 (diff) | |
download | ports-bfde1e8cb6c339dfdc2ff94f7c096727da64ada7.tar.gz ports-bfde1e8cb6c339dfdc2ff94f7c096727da64ada7.zip |
Notes
Diffstat (limited to 'multimedia/zoneminder/files')
32 files changed, 258 insertions, 2063 deletions
diff --git a/multimedia/zoneminder/files/README.FreeBSD b/multimedia/zoneminder/files/README.FreeBSD index 0d2240c12921..ff112cc402be 100644 --- a/multimedia/zoneminder/files/README.FreeBSD +++ b/multimedia/zoneminder/files/README.FreeBSD @@ -1,216 +1,169 @@ -== Origin == - -This port project started its life based on quadra's original port for -version 1.19.2. Brooktree (bktr) video input support code written by -quadra is virtually unchanged in this port other than some function -argument changes to match the latest ZoneMinder version (1.22.3). -Although this code compiles, I have not tested its functionality. -Currently, I only have two Axis 206 network cameras, which work fine, -but I have not tested the set up with any other camera -configurations. - -I have tested this port on FreeBSD 5.5 (i386) as well as FreeBSD 6.2 -(i386) without any problems. - -== Preparation == - -* Download the port (zoneminder-freebsd-port-1.22.3p[version].tgz) -* Become root and 'cd' to /usr/ports/multimedia/ -* Extract the port files. You know how to do 'tar zxf' right? - -You should now have /usr/ports/multimedia/zoneminder/ - -Now, go to the directory and look at files/patch-SharedMem.pm - -What this patch does is to hard-wire native size to 4 (32-bits). -On FreeBSD, Perl is configured with -Duse64bitint by default and the -method that is used by SharedMem.pm to determine architectural bit -width incorrectly considers an i386 machine as 64-bit capable. I'm -not a perl expert -- in fact, I hate perl -- and I really have no -idea how to properly determine pointer size in Perl, so this patch -exists. Obviously, if you are running FreeBSD-AMD64 (or Alpha or -something, although I have no idea if this software would work on -that architecture), you will want to get rid of this patch file. -Just delete it _before_ you make. - -And if you're bored, feel free to go through all the patch files just -marvelling at all the trouble I had to go through ^_^; - -Now that we've gotten that little quirk out of the way, we'll move on -to Makefile. Open Makefile using your favorite text editor and modify -the following items if they're not suitable for you. - -* WWWDIR : This is where your web server will serve from. If you - already have apache installed, you should point this to the same - place where apache thinks is the web base. Default is - /usr/local/www, as can be seen in the Makefile. -* ZM_DB_HOST : This is where mysql server runs. If you're running - mysql server on a different machine, you'll want to update this - line, but I'm not sure if you can avoid installing mysql on this - machine. Disk space is cheap, so I don't think it's that big a deal - having mysql just sitting there, as long as it's not started. -* ZM_DB_NAME : This is the database name that ZoneMinder will use. - I'm pretty sure ZoneMinder won't mind sharing a base database with - other applications, but it certainly doesn't hurt to let it have its - own database space, so this defaults to "zm" -* ZM_DB_USER and ZM_DB_PASS are username and password for the - database. - -We're almost ready to "make," but first, consider the following points -and just imagine how things can break based on your situation. - -* If you do not have apache installed, this port will install version - 1.xx.xx of apache. On the other hand, if you already have apache - 2.xx.xx installed, I do not know what will happen. My guess is that - things will work just fine since php5 port will see apache2 - installation and skip apache1 installation. -* If you have mysql version other than 5.0.xx installed, this port - build will probably fail. Even if it doesn't fail, you probably do - not want multiple versions of mysql installed on your machine. You - can either edit the dependency in the Makefile to point to your - version of mysql, or get rid of the dependency statement for mysql. - Getting rid of it is not as nice, but I'm sure you're able to keep - the dependencies in mind when messing around with ports in the - future. -* If you have PHP4 installed, you should modify the dependencies in - the Makefile to point to php4-extensions instead of - php5-extensions. I know for a fact that both versions work fine - with ZoneMinder. -* I have not set up dependencies for perl modules Device::SerialPort - and X10::ActiveHome because I do not have PTZ camera and my X10 is - handled by another dedicated machine. If you want this, you'll want - to tinker with the port some more. You can also manually install - those ports (if they exist) before doing make. I imagine - ZoneMinder's configure script will pick them up. -That's about it. Let's make! +ZoneMinder is a free, open source Closed-circuit television software +application developed for Unix-like operating systems which supports +IP, USB and Analog cameras. + +New installs +============ + +ZoneMinder requires a MySQL (or MySQL forks) database backend and +a http server, capable to execute PHP and CGI scripts. + +To simplify things, we assume, that you use MySQL and NGINX on +the same server. + +1. Preliminary steps + +1.1 Install databases/mysql56-server + You may choose your favourite method - ports or packages here. + FreeBSD default setting use STRICT_TRANS_TABLES sql_mode. It's mandatory to disable it. Edit your my.cnf or create new in /var/db/mysql + + The following example works with ZoneMinder quite well + + [server] + skip-networking + skip-name-resolve + innodb_flush_method = O_DIRECT + skip-innodb_doublewrite + innodb_file_per_table + + ZoneMinder use very simple queries, however it tends to write to + the database quite a lot depending on your capture mode and number + of cameras. So tweak your MySQL instance accordantly + + Now, enable and start MySQL + sysrc mysql_server_enable="YES" + service mysql-server start -== Making == - -There's really nothing special about making. Just 'make' will do. -However, during the dependency builds, make sure PHP install includes -the apache module. If you already have PHP installed without apache -module, you can always tinker with the Makefile in -/usr/ports/lang/php5/ and do 'make deinstall' followed by 'make -reinstall' to reinstall the port with additional modules. - -If the build fails, take a deep breath, yell at your computer for -a moment, and try to figure out if you messed up anything while -changing the Makefile in one of the above steps. If you do not -believe you've done anything wrong and still can't figure out why -the build fails, there's always the forum.... - -If it builds fine, feel free to 'make install' - -However, do NOT 'make clean' yet! - -== Seeding the database == - -If this is the first time installing ZoneMinder, you'll need to seed -the mysql database with ZoneMinder's configuration information. To do -this, follow these steps as a root user. - -First, if this is the first time mysql was installed, you'll want to -consider where you want the database files to reside. Default is -/var/db/mysql/ but you may have set up a dedicated partition for it. -If you want to change it, just put the following line in /etc/rc.conf - -* mysql_dbdir="/somewhere/else/you/want" - -Obviously, you'll want this line in there, too: - -* mysql_enable="YES" - -Now, start the sucker up. - -shell> /usr/local/etc/rc.d/mysql-server start - -Assuming it started fine, give it a few seconds and then continue. -Note that you should be at /usr/ports/multimedia/zoneminder/ for the -following steps. - -shell> mysql -h localhost -u root -p - -This will ask for a password. Just press enter to go with an empty -password. You should now be in mysql command line interface. - -mysql> source work/ZoneMinder-1.22.3/db/zm_create.sql - -Above runs bunch of SQL commands from the file, seeding the -database. - -mysql> grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass'; flush privileges; - -Above sets up permissions. Note that if you changed database name, -user name, or password in the Makefile, you'll need to modify above -command accordingly. - -mysql> quit - -That one should be obvious to you. - -== Post-Installation Quirks == - -PHP5 installation does not necessarily set up the apache configuration -file properly. You will want to make sure that following lines are in -apache configuration file, /usr/local/etc/apache/httpd.conf - -* AddType application/x-httpd-php .php -* AddType application/x-httpd-php-source .phps - -While you're at it, you might also want to check that following line -is in the configuration file. - -* LoadModule php5_module libexec/apache/libphp5.so - -== Automatic Execution at Boot == - -Obviously, if this is to be used as a security device, you'll want it -to start automatically on a reboot. Again obviously, you need to have -both apache and mysql start up as well, unless of course, you're -running mysql on a remote machine. If you are, I'm sure you're an -expert at this stuff already. - -Add following lines into /etc/rc.conf, if not already present. Order -is not important. - -* apache_enable="YES" -* mysql_enable="YES" -* zm_enable="YES" - -Just for your information, I had to put 'sleep 10' in ZoneMinder -startup script because mysql port does not become available -immediately after mysql startup script finishes. - -== More Quirks == - -Depending on the number of cameras and their resolution settings, you -may need a lot more shared memory than provided by a default kernel. -If you've never built a custom kernel before, umm, time for you to -read the FreeBSD Handbook. It can be found at -/usr/share/doc/handbook/index.html or at http://freebsd.org/ - -For the rest of you, just add a reasonable-looking version of the -following lines into your kernel configuration file and go though the -buildkernel, installkernel process. - -* options SHMMAXPGS=65536 -* options SHMMNI=384 -* options SHMSEG=256 - -I think above gives maximum of 256MB of shared memory. SHMMNI -statement probably isn't required since ZoneMinder probably creates -one big instance per camera instead of many little instances. I'm not -sure about the last one. Whatever the case, above works for me with -two Axis 206 cameras. - -Adding the following line into /etc/sysctl.conf may speed up the -shared memory accesses, so even though it's not required, it's -probably a good idea. - -* kern.ipc.shm_use_phys=1 - -== Modify php.ini === -Change in php.ini short_open_tag to On (short_open_tag = On) - -That's all folks! +1.2 Install www/nginx + We provide an example for an HTTP install, however, you should use + HTTPS if you plan to expose your installation to the public. There + are plenty guides how to do it and security/letsencrypt.sh is a + good way to get a valid SSL certificate. + + Your server block should include the following: + + server { + root /usr/local/www/zoneminder; + try_files $uri $uri/ /index.php$is_args$args; + index index.php; + + location = /cgi-bin/nph-zms { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_pass unix:/var/run/fcgiwrap/fcgiwrap.sock; + } + + location ~ \.php$ { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_pass unix:/var/run/php-fpm.sock; + } + + location /api { + rewrite ^/api/(.+)$ /api/index.php?p=$1 last; + } + } + +1.2.1 ZoneMinder has it's own authentication system, however it's recommend to use NGINX basic + auth over HTTPS if you don't need fine grain control to ZoneMinder components. + +1.2.2 If you choose ZoneMinder authentication, it's recommended to prohibit access to + image and events folder as it's possible to guess file names inside it. + + location ~ ^/(?:images|events)/ { + deny all; + } + + Enable and start NGINX + sysrc nginx_enable="YES" + service nginx start + +1.3 Install www/fcgiwrap + As NGINX lacks it's own CGI wrapper, we need external one. Please + note that ZoneMinder's montage page use simultaneous access to all + cameras, so you need to use at least as many fcgiwrap workers as + your number of cameras. The following example assumes you have 4. + + Enable and start FcgiWrap + sysrc fcgiwrap_enable="YES" + sysrc fcgiwrap_user="www" + sysrc fcgiwrap_flags="-c 4" + +1.4 PHP is installed as a dependency to ZoneMinder. However, you should + tweak some of it's settings. + Edit /usr/local/etc/php-fpm.conf and set + + listen = /var/run/php-fpm.sock + listen.owner = www + listen.group = www + env[PATH] = /usr/local/bin:/usr/bin:/bin + + If you want to set another path for the socket file, make sure you + change it in your NGINX config well. The env[PATH] needs to be set + to locate the zip utility as ZoneMinder's export functions rely on + exec(). Sorry, chroot folks. + + PHP throws warning if date.timezone option is not set. The best place + to do it is an ini file in /usr/local/etc/php + + date.timezone = "UTC" + + Enable and start php-fpm + sysrc php_fpm_enable="YES" + service php-fpm start + +1.5 ZoneMinder constantly keeps the last N frames from its cameras to + preserve them when alarm occurs. This can be a performance hog if + placed on spindle drive. The best practice is put it on tmpfs. + See https://www.freebsd.org/cgi/man.cgi?query=tmpfs for more + information. + + ZoneMinder will use /tmp for default. If you plan to change it, see + ZM_PATH_MAP setting. + + Mapping /tmp to tmpfs is actually a recommended step under FreeBSD. + Edit /etc/fstab and add the following: + + tmpfs /tmp tmpfs rw,nosuid,mode=01777 0 0 + + The size of temporary files depends on your number of cameras + number and frames you plan to keep. My 12 3Mbit cameras with 25 + last frames consumes 6 GB. + +2. ZoneMinder installation + + Connect to MySQL under root and create zm user and populate database. + + mysql -u root -p + + CREATE DATABASE zm; + GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' IDENTIFIED BY 'zmpass'; + FLUSH PRIVILEGES; + quit; + + mysql -u root -p zm < /usr/local/share/zoneminder/db/zm_create.sql + +2.1 If you have chosen to change the ZoneMinder MySQL credentials to something + other than zmuser/zmpass then you must now edit /usr/local/etc/zm.conf. Change + ZM_DB_USER and ZM_DB_PASS to the values you created in the previous step. + + Additionally, you must also edit + /usr/local/www/zoneminder/api/app/Config/database.php in a similar + manner. Scroll down and change login and password to the values you created in the previous step. + + Enable and start ZoneMinder + sysrc zoneminder_enable="YES" + service zoneminder start + +Upgrades +======== + +1. Stop ZoneMinder + service zoneminder stop + +2. Upgrade database + sudo -u www zmupdate.pl + +3. Start ZoneMinder + service zoneminder start diff --git a/multimedia/zoneminder/files/extra-patch-scripts_ZoneMinder_lib_ZoneMinder_Memory.pm.in b/multimedia/zoneminder/files/extra-patch-scripts_ZoneMinder_lib_ZoneMinder_Memory.pm.in deleted file mode 100644 index be7698c9d7ea..000000000000 --- a/multimedia/zoneminder/files/extra-patch-scripts_ZoneMinder_lib_ZoneMinder_Memory.pm.in +++ /dev/null @@ -1,11 +0,0 @@ ---- scripts/ZoneMinder/lib/ZoneMinder/Memory.pm.in.orig 2011-05-20 19:43:27.000000000 +0400 -+++ scripts/ZoneMinder/lib/ZoneMinder/Memory.pm.in 2011-06-27 16:28:59.894374784 +0400 -@@ -127,7 +127,7 @@ else - } - - # Native architecture --our $arch = int(3.2*length(~0)); -+our $arch = 32; - our $native = $arch/8; - our $mem_seq = 0; - diff --git a/multimedia/zoneminder/files/patch-CMakeLists.txt b/multimedia/zoneminder/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..458c1aec33b8 --- /dev/null +++ b/multimedia/zoneminder/files/patch-CMakeLists.txt @@ -0,0 +1,32 @@ +--- CMakeLists.txt.orig 2016-06-01 00:41:17 UTC ++++ CMakeLists.txt +@@ -385,13 +385,13 @@ find_library(MYSQLCLIENT_LIBRARIES mysql + if(MYSQLCLIENT_LIBRARIES) + set(HAVE_LIBMYSQLCLIENT 1) + list(APPEND ZM_BIN_LIBS "${MYSQLCLIENT_LIBRARIES}") +- find_path(MYSQLCLIENT_INCLUDE_DIR mysql/mysql.h) ++ find_path(MYSQLCLIENT_INCLUDE_DIR mysql.h /usr/local/include/mysql /usr/include/mysql) + if(MYSQLCLIENT_INCLUDE_DIR) + include_directories("${MYSQLCLIENT_INCLUDE_DIR}") + set(CMAKE_REQUIRED_INCLUDES "${MYSQLCLIENT_INCLUDE_DIR}") + endif(MYSQLCLIENT_INCLUDE_DIR) + mark_as_advanced(FORCE MYSQLCLIENT_LIBRARIES MYSQLCLIENT_INCLUDE_DIR) +- check_include_file("mysql/mysql.h" HAVE_MYSQL_H) ++ check_include_file("mysql.h" HAVE_MYSQL_H) + if(NOT HAVE_MYSQL_H) + message(FATAL_ERROR + "ZoneMinder requires MySQL headers - check that MySQL development packages are installed") +@@ -658,13 +658,6 @@ endif(NOT ZM_WEB_GROUP) + message(STATUS "Using web user: ${ZM_WEB_USER}") + message(STATUS "Using web group: ${ZM_WEB_GROUP}") + +-# Check for polkit +-find_package(Polkit) +-if(NOT POLKIT_FOUND) +- message(FATAL_ERROR +- "Running ZoneMinder requires polkit. Building ZoneMinder requires the polkit development package.") +-endif(NOT POLKIT_FOUND) +- + # Some variables that zm expects + set(ZM_PID "${ZM_RUNDIR}/zm.pid") + set(ZM_CONFIG "${ZM_CONFIG_DIR}/zm.conf") diff --git a/multimedia/zoneminder/files/patch-Makefile.in b/multimedia/zoneminder/files/patch-Makefile.in deleted file mode 100644 index 4cf77de0512f..000000000000 --- a/multimedia/zoneminder/files/patch-Makefile.in +++ /dev/null @@ -1,50 +0,0 @@ ---- Makefile.in.orig 2011-08-23 08:10:37.000000000 -0700 -+++ Makefile.in 2014-07-24 13:33:49.000000000 -0700 -@@ -742,7 +742,6 @@ - - install-data-am: - @$(NORMAL_INSTALL) -- $(MAKE) $(AM_MAKEFLAGS) install-data-hook - install-dvi: install-dvi-recursive - - install-dvi-am: -@@ -789,7 +788,6 @@ - - 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 -@@ -801,29 +799,17 @@ - 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-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 \ - 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 \ -+ tags-recursive uninstall uninstall-am \ - 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. diff --git a/multimedia/zoneminder/files/patch-configure b/multimedia/zoneminder/files/patch-configure deleted file mode 100644 index 1b3ab24ebc20..000000000000 --- a/multimedia/zoneminder/files/patch-configure +++ /dev/null @@ -1,38 +0,0 @@ ---- configure.orig 2011-04-27 18:25:46.000000000 +0400 -+++ configure 2011-05-05 18:40:08.676173137 +0400 -@@ -2995,7 +2995,7 @@ fi - - - MYSQL_LIBS="-L${MYSQL_PREFIX}/${LIB_ARCH}/mysql" --MYSQL_CFLAGS="-I${MYSQL_PREFIX}/include" -+MYSQL_CFLAGS="-I${MYSQL_PREFIX}/include/mysql" - - - -@@ -6426,7 +6426,7 @@ if test "${ac_cv_lib_mysqlclient_mysql_i - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lmysqlclient $LIBS" -+LIBS="-lmysqlclient $LIBS -lz" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -6567,7 +6567,7 @@ if test "${ac_cv_lib_dl_dlsym+set}" = se - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-ldl $LIBS" -+LIBS="-lc $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -6602,7 +6602,7 @@ if test "x$ac_cv_lib_dl_dlsym" = x""yes; - #define HAVE_LIBDL 1 - _ACEOF - -- LIBS="-ldl $LIBS" -+ LIBS="-lc $LIBS" - - else - as_fn_error "zm requires libdl.a" "$LINENO" 5 diff --git a/multimedia/zoneminder/files/patch-db_zm_create.sql.in b/multimedia/zoneminder/files/patch-db_zm_create.sql.in deleted file mode 100644 index 27a3fbbacd79..000000000000 --- a/multimedia/zoneminder/files/patch-db_zm_create.sql.in +++ /dev/null @@ -1,155 +0,0 @@ ---- db/zm_create.sql.in.orig 2011-01-10 15:34:49.000000000 +0300 -+++ db/zm_create.sql.in 2011-05-05 17:58:17.886348039 +0400 -@@ -41,7 +41,7 @@ CREATE TABLE `Config` ( - `Readonly` tinyint(3) unsigned NOT NULL default '0', - `Requires` text, - PRIMARY KEY (`Name`) --) ENGINE=@ZM_MYSQL_ENGINE@; -+); - - -- - -- Table structure for table `ControlPresets` -@@ -53,7 +53,7 @@ CREATE TABLE `ControlPresets` ( - `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` -@@ -161,7 +161,7 @@ CREATE TABLE `Controls` ( - `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` -@@ -174,7 +174,7 @@ CREATE TABLE `Devices` ( - `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` -@@ -208,7 +208,7 @@ CREATE TABLE `Events` ( - KEY `StartTime` (`StartTime`), - KEY `Frames` (`Frames`), - KEY `Archived` (`Archived`) --) ENGINE=@ZM_MYSQL_ENGINE@; -+); - - -- - -- Table structure for table `Filters` -@@ -228,7 +228,7 @@ CREATE TABLE `Filters` ( - `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` -@@ -245,7 +245,7 @@ CREATE TABLE `Frames` ( - PRIMARY KEY (`EventId`,`FrameId`), - KEY `Type` (`Type`), - KEY `TimeStamp` (`TimeStamp`) --) ENGINE=@ZM_MYSQL_ENGINE@; -+); - - -- - -- Table structure for table `Groups` -@@ -257,7 +257,7 @@ CREATE TABLE `Groups` ( - `Name` varchar(64) NOT NULL default '', - `MonitorIds` tinytext NOT NULL, - PRIMARY KEY (`Id`) --) ENGINE=@ZM_MYSQL_ENGINE@; -+); - - -- - -- Table structure for table `MonitorPresets` -@@ -288,7 +288,7 @@ CREATE TABLE `MonitorPresets` ( - `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` -@@ -352,7 +352,7 @@ CREATE TABLE `Monitors` ( - `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` -@@ -363,7 +363,7 @@ 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` -@@ -390,7 +390,7 @@ CREATE TABLE `Stats` ( - KEY `EventId` (`EventId`), - KEY `MonitorId` (`MonitorId`), - KEY `ZoneId` (`ZoneId`) --) ENGINE=@ZM_MYSQL_ENGINE@; -+); - - -- - -- Table structure for table `TriggersX10` -@@ -403,7 +403,7 @@ CREATE TABLE `TriggersX10` ( - `AlarmInput` varchar(32) default NULL, - `AlarmOutput` varchar(32) default NULL, - PRIMARY KEY (`MonitorId`) --) ENGINE=@ZM_MYSQL_ENGINE@; -+); - - -- - -- Table structure for table `Users` -@@ -426,7 +426,7 @@ CREATE TABLE `Users` ( - `MonitorIds` tinytext NOT NULL, - PRIMARY KEY (`Id`), - UNIQUE KEY `UC_Username` (`Username`) --) ENGINE=@ZM_MYSQL_ENGINE@; -+); - - -- - -- Table structure for table `ZonePresets` -@@ -453,7 +453,7 @@ CREATE TABLE `ZonePresets` ( - `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` -@@ -486,7 +486,7 @@ CREATE TABLE `Zones` ( - `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 */; -@@ -584,7 +584,7 @@ INSERT INTO MonitorPresets VALUES ('','B - 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','<ip-address>',80,'/cgi-bin/nph-zms?mode=jpeg&monitor=<monitor-id>&scale=100&maxfps=5&buffer=0',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); -+INSERT INTO MonitorPresets VALUES ('','Remote ZoneMinder','Remote',NULL,NULL,NULL,'http','simple','<ip-address>',80,'/cgi-bin/zms?mode=jpeg&monitor=<monitor-id>&scale=100&maxfps=5&buffer=0',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); - - -- - -- Add some zone preset values diff --git a/multimedia/zoneminder/files/patch-misc_CMakeLists.txt b/multimedia/zoneminder/files/patch-misc_CMakeLists.txt new file mode 100644 index 000000000000..38ee0040d457 --- /dev/null +++ b/multimedia/zoneminder/files/patch-misc_CMakeLists.txt @@ -0,0 +1,12 @@ +--- misc/CMakeLists.txt.orig 2016-06-01 00:41:17 UTC ++++ misc/CMakeLists.txt +@@ -13,6 +13,7 @@ configure_file(zoneminder-tmpfiles.conf. + #install(FILES "${CMAKE_CURRENT_BINARY_DIR}/apache.conf" "${CMAKE_CURRENT_BINARY_DIR}/logrotate.conf" "${CMAKE_CURRENT_BINARY_DIR}/syslog.conf" DESTINATION "${CMAKE_INSTALL_DATADIR}/zoneminder/misc") + + # Install Policykit rules and actions into the proper folders +-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/com.zoneminder.systemctl.policy" DESTINATION "${PC_POLKIT_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/polkit-1/actions") +-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/com.zoneminder.systemctl.rules" DESTINATION "${PC_POLKIT_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/polkit-1/rules.d") ++# polkit is not required for FreeBSD ++#install(FILES "${CMAKE_CURRENT_BINARY_DIR}/com.zoneminder.systemctl.policy" DESTINATION "${PC_POLKIT_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/polkit-1/actions") ++#install(FILES "${CMAKE_CURRENT_BINARY_DIR}/com.zoneminder.systemctl.rules" DESTINATION "${PC_POLKIT_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/polkit-1/rules.d") + diff --git a/multimedia/zoneminder/files/patch-scripts_CMakeLists.txt b/multimedia/zoneminder/files/patch-scripts_CMakeLists.txt new file mode 100644 index 000000000000..fbb04fab58d5 --- /dev/null +++ b/multimedia/zoneminder/files/patch-scripts_CMakeLists.txt @@ -0,0 +1,11 @@ +--- scripts/CMakeLists.txt.orig 2016-06-01 00:41:17 UTC ++++ scripts/CMakeLists.txt +@@ -32,7 +32,7 @@ FOREACH(PERLSCRIPT ${perlscripts}) + ENDFOREACH(PERLSCRIPT ${perlscripts}) + + # Install the perl scripts +-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zmaudit.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmcontrol.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmdc.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmfilter.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmpkg.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmtrack.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmtrigger.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmupdate.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmvideo.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmwatch.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmcamtool.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmsystemctl.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmtelemetry.pl" DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) ++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zmaudit.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmcontrol.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmdc.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmfilter.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmpkg.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmtrack.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmtrigger.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmupdate.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmvideo.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmwatch.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmcamtool.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmtelemetry.pl" DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + if(NOT ZM_NO_X10) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zmx10.pl" DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + endif(NOT ZM_NO_X10) diff --git a/multimedia/zoneminder/files/patch-scripts_zmpkg.pl.in b/multimedia/zoneminder/files/patch-scripts_zmpkg.pl.in deleted file mode 100644 index 5cad889cb25e..000000000000 --- a/multimedia/zoneminder/files/patch-scripts_zmpkg.pl.in +++ /dev/null @@ -1,29 +0,0 @@ ---- scripts/zmpkg.pl.in.orig 2011-06-15 13:51:07.462291191 +0400 -+++ scripts/zmpkg.pl.in 2011-06-15 13:52:15.097496895 +0400 -@@ -61,7 +61,7 @@ - - my $dbh = zmDbConnect(); - --if ( !$command || $command !~ /^(?:start|stop|restart|status|logrot)$/ ) -+if ( !$command || $command !~ /^(?:start|stop|restart|status|logrot|faststart|faststop)$/ ) - { - if ( $command ) - { -@@ -132,7 +132,7 @@ - $command = "restart"; - } - --if ( $command =~ /^(?:stop|restart)$/ ) -+if ( $command =~ /^(?:stop|restart|faststop)$/ ) - { - my $status = runCommand( "zmdc.pl check" ); - -@@ -149,7 +149,7 @@ - - runCommand( "zmupdate.pl -f" ); - --if ( $command =~ /^(?:start|restart)$/ ) -+if ( $command =~ /^(?:start|restart|faststart)$/ ) - { - my $status = runCommand( "zmdc.pl check" ); - diff --git a/multimedia/zoneminder/files/patch-src_Makefile.am b/multimedia/zoneminder/files/patch-src_Makefile.am deleted file mode 100644 index cb3c8a96ccaf..000000000000 --- a/multimedia/zoneminder/files/patch-src_Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ ---- src/Makefile.am.orig 2011-01-22 01:09:46.000000000 +0300 -+++ src/Makefile.am 2011-05-05 18:11:47.076749885 +0400 -@@ -1,6 +1,6 @@ - AUTOMAKE_OPTIONS = gnu - --AM_CPPFLAGS = @MYSQL_CFLAGS@ @FFMPEG_CFLAGS@ -Wall -Wno-sign-compare -fno-inline -+AM_CPPFLAGS = @MYSQL_CFLAGS@ @FFMPEG_CFLAGS@ - #AM_CXXFLAGS = -frepo - - CLEANFILES = *.rpo diff --git a/multimedia/zoneminder/files/patch-src_zm-local-camera.cpp b/multimedia/zoneminder/files/patch-src_zm-local-camera.cpp deleted file mode 100644 index c95b427290a9..000000000000 --- a/multimedia/zoneminder/files/patch-src_zm-local-camera.cpp +++ /dev/null @@ -1,20 +0,0 @@ ---- src/zm_local_camera.cpp.orig 2015-01-25 12:05:37.455924920 +0100 -+++ src/zm_local_camera.cpp 2015-01-25 12:06:24.903920783 +0100 -@@ -739,7 +739,7 @@ - { - 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) ); - -@@ -1519,7 +1519,7 @@ - - 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) ); - } diff --git a/multimedia/zoneminder/files/patch-src_zm__signal.cpp b/multimedia/zoneminder/files/patch-src_zm__signal.cpp new file mode 100644 index 000000000000..752c2f96b90a --- /dev/null +++ b/multimedia/zoneminder/files/patch-src_zm__signal.cpp @@ -0,0 +1,20 @@ +--- src/zm_signal.cpp.orig 2016-06-01 00:41:17 UTC ++++ src/zm_signal.cpp +@@ -63,17 +63,9 @@ RETSIGTYPE zm_die_handler(int signal) + ucontext_t *uc = (ucontext_t *) context; + cr2 = info->si_addr; + #if defined(__x86_64__) +- #ifdef __FreeBSD_kernel__ + ip = (void *)(uc->uc_mcontext.mc_rip); +- #else +- ip = (void *)(uc->uc_mcontext.gregs[REG_RIP]); +- #endif + #else +- #ifdef __FreeBSD_kernel__ + ip = (void *)(uc->uc_mcontext.mc_eip); +- #else +- ip = (void *)(uc->uc_mcontext.gregs[REG_EIP]); +- #endif + #endif // defined(__x86_64__) + + // Print the signal address and instruction pointer if available diff --git a/multimedia/zoneminder/files/patch-src_zm_comms.cpp b/multimedia/zoneminder/files/patch-src_zm_comms.cpp deleted file mode 100644 index 35fbd7e627da..000000000000 --- a/multimedia/zoneminder/files/patch-src_zm_comms.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- src/zm_comms.cpp.orig 2009-03-20 15:07:00.000000000 +0300 -+++ src/zm_comms.cpp 2011-04-08 17:48:07.408806977 +0400 -@@ -25,7 +25,7 @@ - #include <fcntl.h> - #include <stdarg.h> - //#include <memory.h> --#include <alloca.h> -+#include <stdlib.h> - #include <string.h> - //#include <unistd.h> - #include <sys/ioctl.h> diff --git a/multimedia/zoneminder/files/patch-src_zm_comms.h b/multimedia/zoneminder/files/patch-src_zm_comms.h deleted file mode 100644 index 439c1d2cd266..000000000000 --- a/multimedia/zoneminder/files/patch-src_zm_comms.h +++ /dev/null @@ -1,16 +0,0 @@ ---- src/zm_comms.h.orig 2009-10-14 06:08:49.000000000 -0700 -+++ src/zm_comms.h 2014-07-23 08:26:15.000000000 -0700 -@@ -26,9 +26,12 @@ - #include <netdb.h> - #include <errno.h> - #include <sys/un.h> -- -+#include <sys/socket.h> - #include <set> - #include <vector> -+#include <sys/uio.h> -+#include <netinet/in.h> -+#include <string.h> - - class CommsException : public Exception - { diff --git a/multimedia/zoneminder/files/patch-src_zm_event.cpp b/multimedia/zoneminder/files/patch-src_zm_event.cpp deleted file mode 100644 index 6042119e94c0..000000000000 --- a/multimedia/zoneminder/files/patch-src_zm_event.cpp +++ /dev/null @@ -1,44 +0,0 @@ ---- src/zm_event.cpp.orig 2010-11-11 15:22:37.000000000 +0300 -+++ src/zm_event.cpp 2011-05-05 18:24:59.141170446 +0400 -@@ -27,6 +27,7 @@ - #include <getopt.h>
- #include <arpa/inet.h>
- #include <glob.h>
-+#include <time.h> -
- #include "zm.h"
- #include "zm_db.h"
-@@ -68,8 +69,10 @@ Event::Event( Monitor *p_monitor, struct - }
-
- static char sql[ZM_SQL_MED_BUFSIZ];
-+ static char start_time_str[32]; -
- struct tm *stime = localtime( &start_time.tv_sec );
-+ strftime( start_time_str, sizeof(start_time_str), "%Y-%m-%d %H:%M:%S", localtime((time_t *) &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 ) )
- {
-@@ -161,10 +164,13 @@ Event::Event( Monitor *p_monitor, struct -
- Event::~Event()
- {
-+ static char end_time_str[32]; -+ - if ( frames > last_db_frame )
- {
- struct DeltaTimeval delta_time;
- DELTA_TIMEVAL( delta_time, end_time, start_time, DT_PREC_2 );
-+ strftime( end_time_str, sizeof(end_time_str), "%Y-%m-%d %H:%M:%S", localtime( (time_t *) &end_time.tv_sec ) ); -
- Debug( 1, "Adding closing frame %d to DB", frames );
- static char sql[ZM_SQL_SML_BUFSIZ];
-@@ -639,7 +645,7 @@ void Event::AddFrame( Image *image, stru - }
- }
-
--bool EventStream::loadInitialEventData( int monitor_id, time_t event_time )
-+bool EventStream::loadInitialEventData( int monitor_id, long event_time )
- {
- static char sql[ZM_SQL_SML_BUFSIZ];
-
diff --git a/multimedia/zoneminder/files/patch-src_zm_event.h b/multimedia/zoneminder/files/patch-src_zm_event.h deleted file mode 100644 index 2850a706b041..000000000000 --- a/multimedia/zoneminder/files/patch-src_zm_event.h +++ /dev/null @@ -1,20 +0,0 @@ ---- src/zm_event.h.orig 2009-03-20 15:07:00.000000000 +0300 -+++ src/zm_event.h 2011-04-08 17:48:07.357806760 +0400 -@@ -228,7 +228,7 @@ protected: - 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 ); -+ bool loadInitialEventData( int monitor_id, long event_time ); - - void checkEventLoaded(); - void processCommand( const CmdMsg *msg ); -@@ -251,7 +251,7 @@ public: - loadInitialEventData( init_event_id, init_frame_id ); - loadMonitor( event_data->monitor_id ); - } -- void setStreamStart( int monitor_id, time_t event_time ) -+ void setStreamStart( int monitor_id, long event_time ) - { - loadInitialEventData( monitor_id, event_time ); - loadMonitor( monitor_id ); diff --git a/multimedia/zoneminder/files/patch-src_zm_ffmpeg_camera.cpp b/multimedia/zoneminder/files/patch-src_zm_ffmpeg_camera.cpp deleted file mode 100644 index dfb0711ddd53..000000000000 --- a/multimedia/zoneminder/files/patch-src_zm_ffmpeg_camera.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- src/zm_ffmpeg_camera.cpp.orig 2009-05-25 22:04:00.000000000 +0400 -+++ src/zm_ffmpeg_camera.cpp 2011-04-08 17:48:07.366805007 +0400 -@@ -18,7 +18,7 @@ - // - - #include "zm.h" -- -+#include <errno.h> - #if HAVE_LIBAVFORMAT - - #include "zm_ffmpeg_camera.h" diff --git a/multimedia/zoneminder/files/patch-src_zm_local_camera.h b/multimedia/zoneminder/files/patch-src_zm_local_camera.h deleted file mode 100644 index c782f6553eb3..000000000000 --- a/multimedia/zoneminder/files/patch-src_zm_local_camera.h +++ /dev/null @@ -1,25 +0,0 @@ ---- src/zm_local_camera.h.orig 2011-02-16 00:59:06.000000000 +0300 -+++ src/zm_local_camera.h 2011-05-05 18:31:35.024175230 +0400 -@@ -83,6 +83,14 @@ protected: - protected: - static int camera_count; - static int channel_count; -+ static int last_channel; -+static int m_cap_frame; -+static int m_cap_frame_active; -+static int m_sync_frame; -+static video_mbuf m_vmb; -+static video_mmap *m_vmm; -+static int m_videohandle; -+static unsigned char *m_buffer; - static int channels[VIDEO_MAX_FRAME]; - static int standards[VIDEO_MAX_FRAME]; - -@@ -114,6 +122,7 @@ protected: - - 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_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ); -+ LocalCamera( const char *p_device, int p_channel, int p_format, int p_width, int p_height, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ); - ~LocalCamera(); - - void Initialise(); diff --git a/multimedia/zoneminder/files/patch-src_zm_logger.cpp b/multimedia/zoneminder/files/patch-src_zm_logger.cpp deleted file mode 100644 index ff138b1a0951..000000000000 --- a/multimedia/zoneminder/files/patch-src_zm_logger.cpp +++ /dev/null @@ -1,25 +0,0 @@ ---- src/zm_logger.cpp.orig 2011-06-28 04:07:35.000000000 -0700 -+++ src/zm_logger.cpp 2014-07-23 00:23:50.000000000 -0700 -@@ -33,6 +33,8 @@ - #include <signal.h> - #include <stdarg.h> - #include <errno.h> -+#include <sys/thr.h> -+#include <unistd.h> - - bool Logger::smInitialised = false; - Logger *Logger::smInstance = 0; -@@ -515,8 +517,12 @@ - #endif - - pid_t tid; -+ long lwpid; -+ thr_self(&lwpid); -+ tid = lwpid; -+ - #ifdef HAVE_SYSCALL -- if ( (tid = syscall(SYS_gettid)) < 0 ) // Thread/Process id -+ if (tid < 0 ) // Thread/Process id - #endif // HAVE_SYSCALL - tid = getpid(); // Process id - diff --git a/multimedia/zoneminder/files/patch-src_zm_monitor.cpp b/multimedia/zoneminder/files/patch-src_zm_monitor.cpp deleted file mode 100644 index c79a4eececa4..000000000000 --- a/multimedia/zoneminder/files/patch-src_zm_monitor.cpp +++ /dev/null @@ -1,10 +0,0 @@ ---- src/zm_monitor.cpp.orig 2011-03-02 15:23:10.000000000 +0300 -+++ src/zm_monitor.cpp 2011-05-05 18:31:35.028176099 +0400 -@@ -45,6 +45,7 @@ - #include <sys/mman.h> - #include <fcntl.h> - #else // ZM_MEM_MAPPED -+#include <unistd.h> - #include <sys/ipc.h> - #include <sys/shm.h> - #endif // ZM_MEM_MAPPED diff --git a/multimedia/zoneminder/files/patch-src_zm_mpeg.cpp b/multimedia/zoneminder/files/patch-src_zm_mpeg.cpp deleted file mode 100644 index 0d5910d9c9ff..000000000000 --- a/multimedia/zoneminder/files/patch-src_zm_mpeg.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- src/zm_mpeg.cpp.orig 2009-05-25 22:04:00.000000000 +0400 -+++ src/zm_mpeg.cpp 2011-04-08 17:48:07.391806718 +0400 -@@ -19,7 +19,7 @@ - - #include <stdlib.h> - #include <string.h> -- -+#include <errno.h> - #include "zm.h" - #include "zm_mpeg.h" - diff --git a/multimedia/zoneminder/files/patch-src_zm_remote_camera.h b/multimedia/zoneminder/files/patch-src_zm_remote_camera.h deleted file mode 100644 index 2efa986f67ed..000000000000 --- a/multimedia/zoneminder/files/patch-src_zm_remote_camera.h +++ /dev/null @@ -1,14 +0,0 @@ ---- src/zm_remote_camera.h.orig 2009-06-02 00:59:26.000000000 -0700 -+++ src/zm_remote_camera.h 2014-07-23 00:39:49.000000000 -0700 -@@ -21,9 +21,10 @@ - #define ZM_REMOTE_CAMERA_H - - #include "zm_camera.h" -- -+#include <netinet/in.h> - #include <string> - #include <netdb.h> -+#include <unistd.h> - - // - // Class representing 'remote' cameras, i.e. those which are diff --git a/multimedia/zoneminder/files/patch-src_zm_sdp.cpp b/multimedia/zoneminder/files/patch-src_zm_sdp.cpp deleted file mode 100644 index 5f879575984f..000000000000 --- a/multimedia/zoneminder/files/patch-src_zm_sdp.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- src/zm_sdp.cpp.orig 2009-05-28 12:45:49.000000000 +0400 -+++ src/zm_sdp.cpp 2011-04-08 17:48:07.394806320 +0400 -@@ -287,7 +287,7 @@ SessionDescriptor::SessionDescriptor( co - - AVFormatContext *SessionDescriptor::generateFormatContext() const - { -- AVFormatContext *formatContext = avformat_alloc_context(); -+ AVFormatContext *formatContext = av_alloc_format_context(); - - strncpy( formatContext->filename, mUrl.c_str(), sizeof(formatContext->filename) ); - diff --git a/multimedia/zoneminder/files/patch-src_zm_signal.h b/multimedia/zoneminder/files/patch-src_zm_signal.h deleted file mode 100644 index cb1481c3f5c0..000000000000 --- a/multimedia/zoneminder/files/patch-src_zm_signal.h +++ /dev/null @@ -1,16 +0,0 @@ ---- src/zm_signal.h.orig 2009-03-20 15:07:00.000000000 +0300 -+++ src/zm_signal.h 2011-04-08 17:48:07.396806893 +0400 -@@ -20,8 +20,12 @@ - #ifndef ZM_SIGNAL_H - #define ZM_SIGNAL_H - --#include <signal.h> -+ -+#ifndef ZM_NO_CRASHTRACE - #include <execinfo.h> -+#endif -+ -+#include <signal.h> - - #include "zm.h" - diff --git a/multimedia/zoneminder/files/patch-src_zm_stream.cpp b/multimedia/zoneminder/files/patch-src_zm_stream.cpp deleted file mode 100644 index 2299f079c095..000000000000 --- a/multimedia/zoneminder/files/patch-src_zm_stream.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- src/zm_stream.cpp.orig 2009-05-08 16:47:27.000000000 +0300 -+++ src/zm_stream.cpp 2011-05-31 12:53:35.182245374 +0300 -@@ -289,7 +289,7 @@ - - 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 ) -+ if ( bind( sd, (struct sockaddr *)&loc_addr, strlen(loc_addr.sun_path) + 1 +sizeof(loc_addr.sun_family)) < 0 ) - { - Fatal( "Can't bind: %s", strerror(errno) ); - } diff --git a/multimedia/zoneminder/files/patch-src_zm_thread.h b/multimedia/zoneminder/files/patch-src_zm_thread.h deleted file mode 100644 index 8d9ab38c9ee4..000000000000 --- a/multimedia/zoneminder/files/patch-src_zm_thread.h +++ /dev/null @@ -1,10 +0,0 @@ ---- src/zm_thread.h.orig 2009-06-08 02:20:17.000000000 -0700 -+++ src/zm_thread.h 2014-07-23 00:50:23.000000000 -0700 -@@ -21,6 +21,7 @@ - #define ZM_THREAD_H - - #include <pthread.h> -+#include <unistd.h> - #include "zm_exception.h" - #include "zm_utils.h" - diff --git a/multimedia/zoneminder/files/patch-src_zmc.cpp b/multimedia/zoneminder/files/patch-src_zmc.cpp deleted file mode 100644 index 8c6384bf4016..000000000000 --- a/multimedia/zoneminder/files/patch-src_zmc.cpp +++ /dev/null @@ -1,27 +0,0 @@ ---- src/zmc.cpp.orig 2009-05-08 13:17:10.000000000 +0400 -+++ src/zmc.cpp 2011-04-08 17:48:07.405805978 +0400 -@@ -19,7 +19,7 @@ - - #include <getopt.h> - #include <signal.h> --#include <values.h> -+#include <limits.h> - - #include "zm.h" - #include "zm_db.h" -@@ -27,12 +27,14 @@ - #include "zm_signal.h" - #include "zm_monitor.h" - -+#define MAXINT INT_MAX -+ - void Usage() - { - fprintf( stderr, "zmc -d <device_path> or -r <proto> -H <host> -P <port> -p <path> or -f <file_path> or -m <monitor_id>\n" ); - - fprintf( stderr, "Options:\n" ); -- fprintf( stderr, " -d, --device <device_path> : For local cameras, device to access. E.g /dev/video0 etc\n" ); -+ fprintf( stderr, " -d, --device <device_path> : For local cameras, device to access. E.g /dev/bktr0 etc\n" ); - fprintf( stderr, " -r <proto> -H <host> -P <port> -p <path> : For remote cameras\n" ); - fprintf( stderr, " -f, --file <file_path> : For local images, jpg file to access.\n" ); - fprintf( stderr, " -m, --monitor <monitor_id> : For sources associated with a single monitor\n" ); diff --git a/multimedia/zoneminder/files/patch-src_zmu.cpp b/multimedia/zoneminder/files/patch-src_zmu.cpp deleted file mode 100644 index 9bb03d1c5568..000000000000 --- a/multimedia/zoneminder/files/patch-src_zmu.cpp +++ /dev/null @@ -1,20 +0,0 @@ ---- src/zmu.cpp.orig 2011-02-16 00:59:06.000000000 +0300 -+++ src/zmu.cpp 2011-05-05 18:31:35.038175339 +0400 -@@ -18,7 +18,7 @@ - // - - #include <getopt.h> -- -+#include <iostream> - #include "zm.h" - #include "zm_db.h" - #include "zm_user.h" -@@ -435,7 +435,7 @@ int main( int argc, char *argv[] ) - { - 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 ) ); -+ strftime( timestamp_str, sizeof(timestamp_str), "%Y-%m-%d %H:%M:%S", localtime( (time_t *) ×tamp.tv_sec ) ); - if ( image_idx == -1 ) - printf( "Time of last image capture: %s.%02ld\n", timestamp_str, timestamp.tv_usec/10000 ); - else diff --git a/multimedia/zoneminder/files/patch-web-includes-functions.php b/multimedia/zoneminder/files/patch-web-includes-functions.php deleted file mode 100644 index 330720fdd373..000000000000 --- a/multimedia/zoneminder/files/patch-web-includes-functions.php +++ /dev/null @@ -1,11 +0,0 @@ ---- web/includes/functions.php.orig 2011-08-03 10:33:59.000000000 -0700 -+++ web/includes/functions.php 2014-08-03 00:19:38.000000000 -0700 -@@ -648,7 +648,7 @@ - foreach ( $contents as $contentValue => $contentText ) - { - ?> --<option value="<?= $contentValue ?>"<?php if ( $value == $contentValue ) { ?> selected="selected"<? } ?>><?= validHtmlStr($contentText) ?></option> -+<option value="<?= $contentValue ?>"<?php if ( $value == $contentValue ) { ?> selected="selected"<?php } ?>><?= validHtmlStr($contentText) ?></option> - <?php - } - ?> diff --git a/multimedia/zoneminder/files/videodev.h b/multimedia/zoneminder/files/videodev.h deleted file mode 100644 index a2278b214717..000000000000 --- a/multimedia/zoneminder/files/videodev.h +++ /dev/null @@ -1,404 +0,0 @@ -#ifndef __LINUX_VIDEODEV_H -#define __LINUX_VIDEODEV_H - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - -//#include <linux/types.h> -//#include <linux/version.h> - -#ifdef __KERNEL__ - -#include <linux/poll.h> -#include <linux/devfs_fs_kernel.h> - -struct video_device -{ - struct module *owner; - char name[32]; - int type; - int hardware; - - int (*open)(struct video_device *, int mode); - void (*close)(struct video_device *); - long (*read)(struct video_device *, char *, unsigned long, int noblock); - /* Do we need a write method ? */ - long (*write)(struct video_device *, const char *, unsigned long, int noblock); -#if LINUX_VERSION_CODE >= 0x020100 - unsigned int (*poll)(struct video_device *, struct file *, poll_table *); -#endif - int (*ioctl)(struct video_device *, unsigned int , void *); - int (*mmap)(struct video_device *, const char *, unsigned long); - int (*initialize)(struct video_device *); - void *priv; /* Used to be 'private' but that upsets C++ */ - int busy; - int minor; - devfs_handle_t devfs_handle; -}; - -#define VIDEO_MAJOR 81 -extern int video_register_device(struct video_device *, int type, int nr); - -#define VFL_TYPE_GRABBER 0 -#define VFL_TYPE_VBI 1 -#define VFL_TYPE_RADIO 2 -#define VFL_TYPE_VTX 3 - -extern void video_unregister_device(struct video_device *); -#endif - - -#define VID_TYPE_CAPTURE 1 /* Can capture */ -#define VID_TYPE_TUNER 2 /* Can tune */ -#define VID_TYPE_TELETEXT 4 /* Does teletext */ -#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */ -#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */ -#define VID_TYPE_CLIPPING 32 /* Can clip */ -#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */ -#define VID_TYPE_SCALES 128 /* Scalable */ -#define VID_TYPE_MONOCHROME 256 /* Monochrome only */ -#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */ -#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */ -#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ -#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ -#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ - -struct video_capability -{ - char name[32]; - int type; - int channels; /* Num channels */ - int audios; /* Num audio devices */ - int maxwidth; /* Supported width */ - int maxheight; /* And height */ - int minwidth; /* Supported width */ - int minheight; /* And height */ -}; - - -struct video_channel -{ - int channel; - char name[32]; - int tuners; - __u32 flags; -#define VIDEO_VC_TUNER 1 /* Channel has a tuner */ -#define VIDEO_VC_AUDIO 2 /* Channel has audio */ - __u16 type; -#define VIDEO_TYPE_TV 1 -#define VIDEO_TYPE_CAMERA 2 - __u16 norm; /* Norm set by channel */ -}; - -struct video_tuner -{ - int tuner; - char name[32]; - u_long rangelow, rangehigh; /* Tuner range */ - __u32 flags; -#define VIDEO_TUNER_PAL 1 -#define VIDEO_TUNER_NTSC 2 -#define VIDEO_TUNER_SECAM 4 -#define VIDEO_TUNER_LOW 8 /* Uses KHz not MHz */ -#define VIDEO_TUNER_NORM 16 /* Tuner can set norm */ -#define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */ -#define VIDEO_TUNER_RDS_ON 256 /* Tuner is seeing an RDS datastream */ -#define VIDEO_TUNER_MBS_ON 512 /* Tuner is seeing an MBS datastream */ - __u16 mode; /* PAL/NTSC/SECAM/OTHER */ -#define VIDEO_MODE_PAL 0 -#define VIDEO_MODE_NTSC 1 -#define VIDEO_MODE_SECAM 2 -#define VIDEO_MODE_AUTO 3 - __u16 signal; /* Signal strength 16bit scale */ -}; - -struct video_picture -{ - __u16 brightness; - __u16 hue; - __u16 colour; - __u16 contrast; - __u16 whiteness; /* Black and white only */ - __u16 depth; /* Capture depth */ - __u16 palette; /* Palette in use */ -#define VIDEO_PALETTE_GREY 1 /* Linear greyscale */ -#define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */ -#define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */ -#define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */ -#define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */ -#define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */ -#define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */ -#define VIDEO_PALETTE_YUYV 8 -#define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */ -#define VIDEO_PALETTE_YUV420 10 -#define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */ -#define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */ -#define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */ -#define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */ -#define VIDEO_PALETTE_YUV420P 15 /* YUV 4:2:0 Planar */ -#define VIDEO_PALETTE_YUV410P 16 /* YUV 4:1:0 Planar */ -#define VIDEO_PALETTE_PLANAR 13 /* start of planar entries */ -#define VIDEO_PALETTE_COMPONENT 7 /* start of component entries */ -}; - -struct video_audio -{ - int audio; /* Audio channel */ - __u16 volume; /* If settable */ - __u16 bass, treble; - __u32 flags; -#define VIDEO_AUDIO_MUTE 1 -#define VIDEO_AUDIO_MUTABLE 2 -#define VIDEO_AUDIO_VOLUME 4 -#define VIDEO_AUDIO_BASS 8 -#define VIDEO_AUDIO_TREBLE 16 - char name[16]; -#define VIDEO_SOUND_MONO 1 -#define VIDEO_SOUND_STEREO 2 -#define VIDEO_SOUND_LANG1 4 -#define VIDEO_SOUND_LANG2 8 - __u16 mode; - __u16 balance; /* Stereo balance */ - __u16 step; /* Step actual volume uses */ -}; - -struct video_clip -{ - __s32 x,y; - __s32 width, height; - struct video_clip *next; /* For user use/driver use only */ -}; - -struct video_window -{ - __u32 x,y; /* Position of window */ - __u32 width,height; /* Its size */ - __u32 chromakey; - __u32 flags; - struct video_clip *clips; /* Set only */ - int clipcount; -#define VIDEO_WINDOW_INTERLACE 1 -#define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */ -#define VIDEO_CLIP_BITMAP -1 -/* bitmap is 1024x625, a '1' bit represents a clipped pixel */ -#define VIDEO_CLIPMAP_SIZE (128 * 625) -}; - -struct video_capture -{ - __u32 x,y; /* Offsets into image */ - __u32 width, height; /* Area to capture */ - __u16 decimation; /* Decimation divder */ - __u16 flags; /* Flags for capture */ -#define VIDEO_CAPTURE_ODD 0 /* Temporal */ -#define VIDEO_CAPTURE_EVEN 1 -}; - -struct video_buffer -{ - void *base; - int height,width; - int depth; - int bytesperline; -}; - -struct video_mmap -{ - unsigned int frame; /* Frame (0 - n) for double buffer */ - int height,width; - unsigned int format; /* should be VIDEO_PALETTE_* */ -}; - -struct video_key -{ - __u8 key[8]; - __u32 flags; -}; - - -#define VIDEO_MAX_FRAME 32 - -struct video_mbuf -{ - int size; /* Total memory to map */ - int frames; /* Frames */ - int offsets[VIDEO_MAX_FRAME]; -}; - - -#define VIDEO_NO_UNIT (-1) - - -struct video_unit -{ - int video; /* Video minor */ - int vbi; /* VBI minor */ - int radio; /* Radio minor */ - int audio; /* Audio minor */ - int teletext; /* Teletext minor */ -}; - -struct vbi_format { - __u32 sampling_rate; /* in Hz */ - __u32 samples_per_line; - __u32 sample_format; /* VIDEO_PALETTE_RAW only (1 byte) */ - __s32 start[2]; /* starting line for each frame */ - __u32 count[2]; /* count of lines for each frame */ - __u32 flags; -#define VBI_UNSYNC 1 /* can distingues between top/bottom field */ -#define VBI_INTERLACED 2 /* lines are interlaced */ -}; - -/* video_info is biased towards hardware mpeg encode/decode */ -/* but it could apply generically to any hardware compressor/decompressor */ -struct video_info -{ - __u32 frame_count; /* frames output since decode/encode began */ - __u32 h_size; /* current unscaled horizontal size */ - __u32 v_size; /* current unscaled veritcal size */ - __u32 smpte_timecode; /* current SMPTE timecode (for current GOP) */ - __u32 picture_type; /* current picture type */ - __u32 temporal_reference; /* current temporal reference */ - __u8 user_data[256]; /* user data last found in compressed stream */ - /* user_data[0] contains user data flags, user_data[1] has count */ -}; - -/* generic structure for setting playback modes */ -struct video_play_mode -{ - int mode; - int p1; - int p2; -}; - -/* for loading microcode / fpga programming */ -struct video_code -{ - char loadwhat[16]; /* name or tag of file being passed */ - int datasize; - __u8 *data; -}; - -#define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */ -#define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */ -#define VIDIOCSCHAN _IOW('v',3,struct video_channel) /* Set channel */ -#define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */ -#define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */ -#define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */ -#define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */ -#define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */ -#define VIDIOCGWIN _IOR('v',9, struct video_window) /* Get the video overlay window */ -#define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */ -#define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */ -#define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */ -#define VIDIOCKEY _IOR('v',13, struct video_key) /* Video key event - to dev 255 is to all - cuts capture on all DMA windows with this key (0xFFFFFFFF == all) */ -#define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */ -#define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */ -#define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */ -#define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */ -#define VIDIOCSYNC _IOW('v',18, int) /* Sync with mmap grabbing */ -#define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */ -#define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */ -#define VIDIOCGUNIT _IOR('v',21, struct video_unit) /* Get attached units */ -#define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get subcapture */ -#define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set subcapture */ -#define VIDIOCSPLAYMODE _IOW('v',24, struct video_play_mode) /* Set output video mode/feature */ -#define VIDIOCSWRITEMODE _IOW('v',25, int) /* Set write mode */ -#define VIDIOCGPLAYINFO _IOR('v',26, struct video_info) /* Get current playback info from hardware */ -#define VIDIOCSMICROCODE _IOW('v',27, struct video_code) /* Load microcode into hardware */ -#define VIDIOCGVBIFMT _IOR('v',28, struct vbi_format) /* Get VBI information */ -#define VIDIOCSVBIFMT _IOW('v',29, struct vbi_format) /* Set VBI information */ - - -#define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */ - -/* VIDIOCSWRITEMODE */ -#define VID_WRITE_MPEG_AUD 0 -#define VID_WRITE_MPEG_VID 1 -#define VID_WRITE_OSD 2 -#define VID_WRITE_TTX 3 -#define VID_WRITE_CC 4 -#define VID_WRITE_MJPEG 5 - -/* VIDIOCSPLAYMODE */ -#define VID_PLAY_VID_OUT_MODE 0 - /* p1: = VIDEO_MODE_PAL, VIDEO_MODE_NTSC, etc ... */ -#define VID_PLAY_GENLOCK 1 - /* p1: 0 = OFF, 1 = ON */ - /* p2: GENLOCK FINE DELAY value */ -#define VID_PLAY_NORMAL 2 -#define VID_PLAY_PAUSE 3 -#define VID_PLAY_SINGLE_FRAME 4 -#define VID_PLAY_FAST_FORWARD 5 -#define VID_PLAY_SLOW_MOTION 6 -#define VID_PLAY_IMMEDIATE_NORMAL 7 -#define VID_PLAY_SWITCH_CHANNELS 8 -#define VID_PLAY_FREEZE_FRAME 9 -#define VID_PLAY_STILL_MODE 10 -#define VID_PLAY_MASTER_MODE 11 - /* p1: see below */ -#define VID_PLAY_MASTER_NONE 1 -#define VID_PLAY_MASTER_VIDEO 2 -#define VID_PLAY_MASTER_AUDIO 3 -#define VID_PLAY_ACTIVE_SCANLINES 12 - /* p1 = first active; p2 = last active */ -#define VID_PLAY_RESET 13 -#define VID_PLAY_END_MARK 14 - - - -#define VID_HARDWARE_BT848 1 -#define VID_HARDWARE_QCAM_BW 2 -#define VID_HARDWARE_PMS 3 -#define VID_HARDWARE_QCAM_C 4 -#define VID_HARDWARE_PSEUDO 5 -#define VID_HARDWARE_SAA5249 6 -#define VID_HARDWARE_AZTECH 7 -#define VID_HARDWARE_SF16MI 8 -#define VID_HARDWARE_RTRACK 9 -#define VID_HARDWARE_ZOLTRIX 10 -#define VID_HARDWARE_SAA7146 11 -#define VID_HARDWARE_VIDEUM 12 /* Reserved for Winnov videum */ -#define VID_HARDWARE_RTRACK2 13 -#define VID_HARDWARE_PERMEDIA2 14 /* Reserved for Permedia2 */ -#define VID_HARDWARE_RIVA128 15 /* Reserved for RIVA 128 */ -#define VID_HARDWARE_PLANB 16 /* PowerMac motherboard video-in */ -#define VID_HARDWARE_BROADWAY 17 /* Broadway project */ -#define VID_HARDWARE_GEMTEK 18 -#define VID_HARDWARE_TYPHOON 19 -#define VID_HARDWARE_VINO 20 /* SGI Indy Vino */ -#define VID_HARDWARE_CADET 21 /* Cadet radio */ -#define VID_HARDWARE_TRUST 22 /* Trust FM Radio */ -#define VID_HARDWARE_TERRATEC 23 /* TerraTec ActiveRadio */ -#define VID_HARDWARE_CPIA 24 -#define VID_HARDWARE_ZR36120 25 /* Zoran ZR36120/ZR36125 */ -#define VID_HARDWARE_ZR36067 26 /* Zoran ZR36067/36060 */ -#define VID_HARDWARE_OV511 27 -#define VID_HARDWARE_ZR356700 28 /* Zoran 36700 series */ -#define VID_HARDWARE_W9966 29 -#define VID_HARDWARE_SE401 30 /* SE401 USB webcams */ -#define VID_HARDWARE_PWC 31 /* Philips webcams */ - -/* - * Initialiser list - */ - -struct video_init -{ - char *name; - int (*init)(struct video_init *); -}; - -#endif - diff --git a/multimedia/zoneminder/files/zm_fbsd_camera.cpp b/multimedia/zoneminder/files/zm_fbsd_camera.cpp deleted file mode 100644 index 739351fc046d..000000000000 --- a/multimedia/zoneminder/files/zm_fbsd_camera.cpp +++ /dev/null @@ -1,807 +0,0 @@ -// -// ZoneMinder Local Camera Class Implementation, $Date: 2004/04/19 16:02:17 $, $Revision: 1.19 $ -// Copyright (C) 2003 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 <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <unistd.h> -#include <sys/shm.h> -#include <sys/mman.h> -#include <signal.h> -#include <dev/bktr/ioctl_bt848.h> -#include <dev/bktr/ioctl_meteor.h> - -#include "zm.h" -#include "zm_local_camera.h" - -int LocalCamera::camera_count = 0; -int LocalCamera::channel_count = 0; -int LocalCamera::last_channel = -1; - -int LocalCamera::m_cap_frame = 0; -int LocalCamera::m_cap_frame_active = 0; -int LocalCamera::m_sync_frame = 0; -video_mbuf LocalCamera::m_vmb; -video_mmap *LocalCamera::m_vmm; -int LocalCamera::m_videohandle; -unsigned char *LocalCamera::m_buffer=0; - -unsigned char *LocalCamera::y_table; -signed char *LocalCamera::uv_table; -short *LocalCamera::r_v_table; -short *LocalCamera::g_v_table; -short *LocalCamera::g_u_table; -short *LocalCamera::b_u_table; - -LocalCamera::LocalCamera( const char *p_device, int p_channel, int p_format, int p_width, int p_height, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ) : Camera( LOCAL, p_width, p_height, p_palette, p_brightness, p_contrast, p_hue, p_colour, p_capture ), channel( p_channel ), format( p_format ) -{ - strncpy( device, p_device, sizeof(device) ); - if ( !camera_count++ && capture ) - { - Initialise(); - } - if ( channel != last_channel ) - { - channel_index = 0; - channel_count++; - last_channel = channel; - } - else - { - channel_index = 1; - } -} - -LocalCamera::~LocalCamera() -{ - if ( !--camera_count && capture ) - { - Terminate(); - } -} - -void LocalCamera::Initialise() -{ - struct meteor_geomet geom; - struct bktr_capture_area cap_area; - // char *arg; - int c; - // int idev = 0; // Input port - static int bktr_dev[] = { METEOR_DEV0, METEOR_DEV1, METEOR_DEV2, METEOR_DEV3, METEOR_DEV_SVIDEO }; - struct meteor_pixfmt pf; // pixel format - int i; - - // arg = getenv ("BKTR_DEV"); - // if (arg) - // idev = atoi (arg); - // if (idev < 0 || idev > 4) - // idev = 0; - // Debug( 1, ( "using Meteor device: %d", idev )); - - if ( (m_videohandle=open(device, O_RDONLY)) < 0 ) - { - Error(( "Failed to open video device %s: %s", device, strerror(errno) )); - exit(-1); - } - - Info(("Initialize: using Meteor device: %d", channel)); - - c = bktr_dev[channel]; - - if (ioctl(m_videohandle, METEORSINPUT, &c) < 0) { - Error(( "Failed to set video input : %s", strerror(errno) )); - if ( (bool)config.Item( ZM_STRICT_VIDEO_CONFIG ) ) exit(-1); - } - - - static int meteor_formats[] = { METEOR_FMT_PAL, METEOR_FMT_NTSC, METEOR_FMT_SECAM, METEOR_FMT_AUTOMODE, METEOR_FMT_AUTOMODE,METEOR_FMT_AUTOMODE,METEOR_FMT_AUTOMODE,METEOR_FMT_AUTOMODE }; - - int VIDformat = meteor_formats[format]; - ioctl(m_videohandle, METEORSFMT, &VIDformat); - - - // Setup Pixel Format - - - for( i=0; ; i++ ) { - pf.index = i; - if( ioctl( m_videohandle, METEORGSUPPIXFMT, &pf ) < 0 ){ - if( errno == EINVAL ) - break; - Error(("Error getting pixformat %d: %s", i, strerror(errno) )); - if ( (bool)config.Item( ZM_STRICT_VIDEO_CONFIG ) ) exit(-1); - - } //if - - if( pf.type == METEOR_PIXTYPE_RGB && pf.Bpp == 3 ) { - // Found a good pixeltype -- set it up - if( ioctl( m_videohandle, METEORSACTPIXFMT, &i ) < 0 ){ - Error(("Error setting pixformat: %s", strerror( errno ))); - } - } // if - } // for - - - memset( &geom, 0, sizeof(geom) ); - memset( &m_vmb, 0, sizeof(m_vmb)); - geom.rows = height; - geom.columns = width; - geom.oformat = METEOR_GEO_RGB24; - geom.frames = 1; - m_vmb.size = width * height * 3; - m_vmb.frames = 1; - - - m_vmm = new video_mmap[m_vmb.frames]; - Debug( 1, ( "vmb.frames = %d", m_vmb.frames )); - Debug( 1, ( "vmb.size = %d", m_vmb.size )); - - for ( int i=0; i < m_vmb.frames; i++) - { - m_vmm[i].frame = i; - m_vmm[i].width = width; - m_vmm[i].height = height; - m_vmm[i].format = palette; - } - - - if ( ioctl( m_videohandle, METEORSETGEO, &geom ) < 0 ) - { - Error(( "Failed to set window attributes: %s", strerror(errno) )); - if ( (bool)config.Item( ZM_STRICT_VIDEO_CONFIG ) ) exit(-1); - } - - if ( ioctl( m_videohandle, BT848_GCAPAREA, &cap_area ) < 0 ) - { - Error(( "Failed to set window attributes: %s", strerror(errno) )); - if ( (bool)config.Item( ZM_STRICT_VIDEO_CONFIG ) ) exit(-1); - } - - Info(( "Geometry: xo: %d yo: %d xs: %d ys: %d " - , cap_area.x_offset - , cap_area.y_offset - , cap_area.x_size - , cap_area.y_size)); - - - - // Set Input Format - c = BT848_IFORM_F_AUTO; - - if (ioctl(m_videohandle, BT848SFMT, &c) < 0) { - Error(( "Failed to set window attributes: %s", strerror(errno) )); - if ( (bool)config.Item( ZM_STRICT_VIDEO_CONFIG ) ) exit(-1); - - } - - - c = METEOR_CAP_CONTINOUS; - ioctl(m_videohandle, METEORCAPTUR, &c); - - - m_buffer = (u_int8_t *) mmap((caddr_t)0, m_vmb.size, - PROT_READ, MAP_SHARED, m_videohandle, (off_t) 0); - - if ( m_buffer == MAP_FAILED ) - { - Error(( "Could not mmap video: %s", strerror(errno) )); - exit(-1); - } - Info(( "Mapping %d bytes for image", m_vmb.size)); - - - 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]; - r_v_table += 128; - g_v_table += 128; - g_u_table += 128; - b_u_table += 128; - for ( int i = -127; i <= 127; i++ ) - { - signed char c = i; - r_v_table[c] = (1402*c)/1000; - g_u_table[c] = (344*c)/1000; - g_v_table[c] = (714*c)/1000; - b_u_table[c] = (1772*c)/1000; - } -} - -void LocalCamera::Terminate() -{ - munmap((char*)m_buffer, m_vmb.size); - - delete[] m_vmm; - - close(m_videohandle); -} - -bool LocalCamera::GetCurrentSettings( const char *device, char *output, bool verbose ) -{ - output[0] = 0; - if ( verbose ) - sprintf( output, output+strlen(output), "Checking Video Device: %s\n", device ); - if ( (m_videohandle=open(device, O_RDONLY)) <=0 ) - { - Error(( "Failed to open video device %s: %s", device, strerror(errno) )); - if ( verbose ) - sprintf( output+strlen(output), "Error, failed to open video device: %s\n", strerror(errno) ); - else - sprintf( output+strlen(output), "error%d\n", errno ); - return( false ); - } - - struct video_capability vid_cap; - if ( ioctl( m_videohandle, VIDIOCGCAP, &vid_cap ) < 0 ) - { - Error(( "Failed to get video capabilities: %s", strerror(errno) )); - if ( verbose ) - sprintf( output, "Error, failed to get video capabilities: %s\n", 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; - if ( ioctl( m_videohandle, 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; - if ( ioctl( m_videohandle, 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 Atributes\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_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; - vid_src.channel = chan; - if ( ioctl( m_videohandle, 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)?"":"," ); - } - } - return( true ); -} - -int LocalCamera::Brightness( int p_brightness ) -{ - unsigned char b; - if ( ioctl( m_videohandle, METEORGBRIG, &b) < 0 ) - { - Error(( "Failed to get picture attributes: %s", strerror(errno) )); - return( -1 ); - } - - if ( p_brightness >= 0 ) - { - b = (unsigned char) p_brightness; - if ( ioctl( m_videohandle, METEORSBRIG, &b) < 0 ) - { - Error(( "Failed to set picture attributes: %s", strerror(errno) )); - return( -1 ); - } - } - return( (int) b ); -} - -int LocalCamera::Hue( int p_hue ) -{ - signed char dev_hue; - if ( ioctl( m_videohandle, METEORGHUE, &dev_hue) < 0 ) - { - Error(( "Failed to get picture attributes: %s", strerror(errno) )); - return( -1 ); - } - - if ( p_hue >= 0 ) - { - dev_hue = (signed char ) p_hue; - if ( ioctl( m_videohandle, METEORSHUE, &dev_hue ) < 0 ) - { - Error(( "Failed to set picture attributes: %s", strerror(errno) )); - return( -1 ); - } - } - return( (int) dev_hue ); -} - -int LocalCamera::Colour( int p_colour ) -{ - - unsigned char vid_pic; - if ( ioctl( m_videohandle, METEORGCSAT, &vid_pic) < 0 ) - { - Error(( "Failed to get picture attributes: %s", strerror(errno) )); - return( -1 ); - } - - if ( p_colour >= 0 ) - { - vid_pic = (unsigned char) p_colour; - if ( ioctl( m_videohandle, METEORSCSAT, &vid_pic ) < 0 ) - { - Error(( "Failed to set picture attributes: %s", strerror(errno) )); - return( -1 ); - } - } - return( (int) vid_pic ); -} - -int LocalCamera::Contrast( int p_contrast ) -{ - unsigned char vid_pic; - - if ( ioctl( m_videohandle, METEORGCONT, &vid_pic) < 0 ) - { - Error(( "Failed to get picture attributes: %s", strerror(errno) )); - return( -1 ); - } - - if ( p_contrast >= 0 ) - { - vid_pic = (unsigned char) p_contrast; - if ( ioctl( m_videohandle, METEORSCONT, &vid_pic ) < 0 ) - { - Error(( "Failed to set picture attributes: %s", strerror(errno) )); - return( -1 ); - } - } - return( (int) vid_pic ); -} - -int LocalCamera::PrimeCapture() -{ - if ( channel_count == 1 && channel_index == 0 ) - { - return( PreCapture() ); - } - return( 0 ); -} - -int LocalCamera::PreCapture() -{ - - static int bktr_dev[] = { METEOR_DEV0, METEOR_DEV1, METEOR_DEV2, METEOR_DEV3, METEOR_DEV_SVIDEO }; - if ( camera_count > 1 ) - { - //Info(( "Switching" )); - struct video_channel vid_src; - - vid_src.channel = channel; - vid_src.norm = format; - vid_src.flags = 0; - vid_src.type = VIDEO_TYPE_CAMERA; - unsigned int tmpchannel= (unsigned)channel; - // Info(("CHANNEL = %d",tmpchannel)); - static int meteor_formats[] = { METEOR_FMT_PAL, METEOR_FMT_NTSC, METEOR_FMT_SECAM, METEOR_FMT_AUTOMODE, METEOR_FMT_AUTOMODE,METEOR_FMT_AUTOMODE,METEOR_FMT_AUTOMODE,METEOR_FMT_AUTOMODE }; - - int tmpc = METEOR_CAP_STOP_CONT; - ioctl(m_videohandle, METEORCAPTUR, &tmpc); - - int VIDformat=meteor_formats[format]; - ioctl(m_videohandle, METEORSFMT, &VIDformat); - - int tmpint=bktr_dev[tmpchannel]; - if (ioctl(m_videohandle, METEORSINPUT, &tmpint) < 0) { - Error(( "Funk2!! Failed to set camera source %d: %s", tmpchannel, strerror(errno) )); - return( -1 ); - } - - tmpc = METEOR_CAP_SINGLE; - ioctl(m_videohandle, METEORCAPTUR, &tmpc); - } - /* - if ( ioctl( m_videohandle, METEORCAPFRM, &m_vmm[m_cap_frame] ) < 0 ) - { - Error(( "Capture failure for frame %d: %s", m_cap_frame, strerror(errno))); - return( -1 ); - } - */ - m_cap_frame = (m_cap_frame+1)%m_vmb.frames; - - return( 0 ); -} - -int LocalCamera::PostCapture( Image &image ) -{ - - /* - if ( ioctl( m_videohandle, VIDIOCSYNC, &m_sync_frame ) ) - { - Error(( "Sync failure for frame %d: %s", m_sync_frame, strerror(errno))); - return( -1 ); - } - */ - - unsigned char *buffer = m_buffer; - m_sync_frame = (m_sync_frame+1)%m_vmb.frames; - - static unsigned char temp_buffer[ZM_MAX_IMAGE_SIZE]; - switch( palette ) - { - case VIDEO_PALETTE_YUV420P : - { - static unsigned char y_plane[ZM_MAX_IMAGE_DIM]; - static char u_plane[ZM_MAX_IMAGE_DIM]; - static char v_plane[ZM_MAX_IMAGE_DIM]; - - unsigned char *rgb_ptr = temp_buffer; - unsigned char *y_ptr = y_plane; - char *u1_ptr = u_plane; - char *u2_ptr = u_plane+width; - char *v1_ptr = v_plane; - char *v2_ptr = v_plane+width; - - int Y_size = width*height; - int C_size = Y_size>>2; // Every little bit helps... - unsigned char *Y_ptr = buffer; - unsigned char *Cb_ptr = buffer + Y_size; - unsigned char *Cr_ptr = Cb_ptr + C_size; - - int y,u,v; - for ( int i = 0; i < Y_size; i++ ) - { - *y_ptr++ = y_table[*Y_ptr++]; - } - int half_width = width>>1; // We are the king of optimisations! - for ( int i = 0, j = 0; i < C_size; i++, j++ ) - { - if ( j == half_width ) - { - j = 0; - u1_ptr += width; - u2_ptr += width; - v1_ptr += width; - v2_ptr += width; - } - u = uv_table[*Cb_ptr++]; - - *u1_ptr++ = u; - *u1_ptr++ = u; - *u2_ptr++ = u; - *u2_ptr++ = u; - - v = uv_table[*Cr_ptr++]; - - *v1_ptr++ = v; - *v1_ptr++ = v; - *v2_ptr++ = v; - *v2_ptr++ = v; - } - - y_ptr = y_plane; - u1_ptr = u_plane; - v1_ptr = v_plane; - int size = Y_size*3; - int r,g,b; - for ( int i = 0; i < size; i += 3 ) - { - y = *y_ptr++; - u = *u1_ptr++; - v = *v1_ptr++; - - r = y + r_v_table[v]; - g = y - (g_u_table[u]+g_v_table[v]); - b = y + b_u_table[u]; - - *rgb_ptr++ = r<0?0:(r>255?255:r); - *rgb_ptr++ = g<0?0:(g>255?255:g); - *rgb_ptr++ = b<0?0:(b>255?255:b); - } - buffer = temp_buffer; - break; - } - case VIDEO_PALETTE_YUV422P : - { - static unsigned char y_plane[ZM_MAX_IMAGE_DIM]; - static char u_plane[ZM_MAX_IMAGE_DIM]; - static char v_plane[ZM_MAX_IMAGE_DIM]; - - unsigned char *rgb_ptr = temp_buffer; - unsigned char *y_ptr = y_plane; - char *u1_ptr = u_plane; - char *v1_ptr = v_plane; - - int Y_size = width*height; - int C_size = Y_size>>1; // Every little bit helps... - unsigned char *Y_ptr = buffer; - unsigned char *Cb_ptr = buffer + Y_size; - unsigned char *Cr_ptr = Cb_ptr + C_size; - - int y,u,v; - for ( int i = 0; i < Y_size; i++ ) - { - *y_ptr++ = y_table[*Y_ptr++]; - } - for ( int i = 0, j = 0; i < C_size; i++, j++ ) - { - u = uv_table[*Cb_ptr++]; - - *u1_ptr++ = u; - *u1_ptr++ = u; - - v = uv_table[*Cr_ptr++]; - - *v1_ptr++ = v; - *v1_ptr++ = v; - } - - y_ptr = y_plane; - u1_ptr = u_plane; - v1_ptr = v_plane; - int size = Y_size*3; - int r,g,b; - for ( int i = 0; i < size; i += 3 ) - { - y = *y_ptr++; - u = *u1_ptr++; - v = *v1_ptr++; - - r = y + r_v_table[v]; - g = y - (g_u_table[u]+g_v_table[v]); - b = y + b_u_table[u]; - - *rgb_ptr++ = r<0?0:(r>255?255:r); - *rgb_ptr++ = g<0?0:(g>255?255:g); - *rgb_ptr++ = b<0?0:(b>255?255:b); - } - buffer = temp_buffer; - break; - } - case VIDEO_PALETTE_RGB555 : - { - int size = width*height*2; - unsigned char r,g,b; - unsigned char *s_ptr = buffer; - unsigned char *d_ptr = temp_buffer; - for ( int i = 0; i < size; i += 2 ) - { - b = ((*s_ptr)<<3)&0xf8; - g = (((*(s_ptr+1))<<6)|((*s_ptr)>>2))&0xf8; - r = ((*(s_ptr+1))<<1)&0xf8; - - *d_ptr++ = r; - *d_ptr++ = g; - *d_ptr++ = b; - s_ptr += 2; - } - buffer = temp_buffer; - break; - } - case VIDEO_PALETTE_RGB565 : - { - int size = width*height*2; - unsigned char r,g,b; - unsigned char *s_ptr = buffer; - unsigned char *d_ptr = temp_buffer; - for ( int i = 0; i < size; i += 2 ) - { - b = ((*s_ptr)<<3)&0xf8; - g = (((*(s_ptr+1))<<5)|((*s_ptr)>>3))&0xfc; - r = (*(s_ptr+1))&0xf8; - - *d_ptr++ = r; - *d_ptr++ = g; - *d_ptr++ = b; - s_ptr += 2; - } - buffer = temp_buffer; - break; - } - case VIDEO_PALETTE_RGB24 : - { - if ( (bool)config.Item( ZM_LOCAL_BGR_INVERT ) ) - { - int size = width*height*3; - unsigned char *s_ptr = buffer; - unsigned char *d_ptr = temp_buffer; - for ( int i = 0; i < size; i += 3 ) - { - *d_ptr++ = *(s_ptr+2); - *d_ptr++ = *(s_ptr+1); - *d_ptr++ = *s_ptr; - s_ptr += 3; - } - buffer = temp_buffer; - } - break; - } - case VIDEO_PALETTE_GREY : - { - //int size = width*height; - //for ( int i = 0; i < size; i++ ) - //{ - //if ( buffer[i] < 16 ) - //Info(( "Lo grey %d", buffer[i] )); - //if ( buffer[i] > 235 ) - //Info(( "Hi grey %d", buffer[i] )); - //} - } - default : // Everything else is straightforward, for now. - { - break; - } - } - - image.Assign( width, height, colours, buffer ); - - return( 0 ); -} diff --git a/multimedia/zoneminder/files/zoneminder.in b/multimedia/zoneminder/files/zoneminder.in index d1708642b9c2..b7a30a941a6c 100644 --- a/multimedia/zoneminder/files/zoneminder.in +++ b/multimedia/zoneminder/files/zoneminder.in @@ -1,54 +1,38 @@ #!/bin/sh - +# # $FreeBSD$ # # PROVIDE: zoneminder -# REQUIRE: mysql apache +# REQUIRE: LOGIN mysql # KEYWORD: shutdown # -# Add the following line to /etc/rc.conf.local or /etc/rc.conf +# Add these lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # -# zoneminder_enable (bool): Set to NO by default. -# Set it to YES to enable zoneminder. +# zoneminder_enable (bool): Set to NO by default. +# Set it to YES to enable zoneminder. . /etc/rc.subr -name="zoneminder" +name=zoneminder rcvar=zoneminder_enable -load_rc_config "$name" +load_rc_config $name + : ${zoneminder_enable="NO"} command=%%PREFIX%%/bin/zmpkg.pl -command_args="$1" pidfile=/var/run/zm/zm.pid +extra_commands="logrot version" -start_precmd=zm_prestart -stop_cmd="zm_stop" -status_cmd="zm_status" - -zm_stop() { - ${command} ${command_args} -} - -zm_status() { - %%PREFIX%%/bin/zmdc.pl status -} - -zm_prestart() { -local _count=0 - - while : ; do - echo "USE zm; SELECT Username from Users where Id=1;" | \ - %%LOCALBASE%%/bin/mysqltest -u root zm > /dev/null 2>&1 && return - _count=$(( $_count + 1 )) - if [ $_count -gt 10 ]; then - err 1 "${name}: mysqltest command failed" - fi +start_cmd="zm_cmd" +stop_cmd="zm_cmd" +status_cmd="zm_cmd" +logrot_cmd="zm_cmd" +version_cmd="zm_cmd" - sleep 1 - done +zm_cmd() { + ${command} ${rc_arg} } run_rc_command "$1" |