From 48b9b3f938847204fc01553ecfffc7719af70b3d Mon Sep 17 00:00:00 2001 From: Angel Carpintero Date: Sat, 19 Nov 2011 11:06:03 +0100 Subject: [PATCH] * Made micro-lightswitch optional (see lightwitch option in motion.conf) * Fixed help text for options event_gap and area_detect * Fixed motion.conf-dist , adding text according with config options. --- CHANGELOG | 3 + conf.c | 17 +- configure | 595 ++++++++++++++++++++++++++++++++++++++++++-- configure.in | 36 +-- event.c | 12 +- motion-dist.conf.in | 15 +- motion.c | 14 +- 7 files changed, 622 insertions(+), 70 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5f1ef82..c3f8f3e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -66,6 +66,9 @@ Bugfixes http://www.lavrsen.dk/foswiki/bin/view/Motion/BugReport2011x10x05x071936 (Angel Carpintero) * Fix issue with JPEG , adding dinfo.do_fancy_upsampling = FALSE; http://www.lavrsen.dk/foswiki/bin/view/Motion/BugReport2011x08x20x194659 + * Made micro-lightswitch optional (see lightwitch option in motion.conf) + * Fixed help text for options event_gap and area_detect + * Fixed motion.conf-dist , adding text according with config options. 3.2.12 Summary of Changes diff --git a/conf.c b/conf.c index c3565e0..a30792d 100644 --- a/conf.c +++ b/conf.c @@ -363,7 +363,7 @@ config_param config_params[] = { }, { "netcam_url", - "# URL to use if you are using a network camera, size will be autodetected (incl http:// ftp:// or file:///)\n" + "# URL to use if you are using a network camera, size will be autodetected (incl http:// ftp:// mjpg:// or file:///)\n" "# Must be a URL that returns single jpeg pictures or a raw mjpeg stream. Default: Not defined", 0, CONF_OFFSET(netcam_url), @@ -538,7 +538,8 @@ config_param config_params[] = { "# Detect motion in predefined areas (1 - 9). Areas are numbered like that: 1 2 3\n" "# A script (on_area_detected) is started immediately when motion is 4 5 6\n" "# detected in one of the given areas, but only once during an event. 7 8 9\n" - "# One or more areas can be specified with this option. (Default: not defined)", + "# One or more areas can be specified with this option. Take care: This option\n" + "# does NOT restrict detection to these areas! (Default: not defined)", 0, CONF_OFFSET(area_detect), copy_string, @@ -565,7 +566,9 @@ config_param config_params[] = { { "lightswitch", "# Ignore sudden massive light intensity changes given as a percentage of the picture\n" - "# area that changed intensity. Valid range: 0 - 100 , default: 0 = disabled", + "# area that changed intensity. If set to 1, motion will do some kind of\n" + "# auto-lightswitch. Valid range: 0 - 100 , default: 0 = disabled", + 0, CONF_OFFSET(lightswitch), copy_int, @@ -603,10 +606,12 @@ config_param config_params[] = { }, { "event_gap", - "# Event Gap is the seconds of no motion detection that triggers the end of an event\n" + "# Event Gap is the seconds of no motion detection that triggers the end of an event.\n" "# An event is defined as a series of motion images taken within a short timeframe.\n" - "# Recommended value is 60 seconds (Default). The value 0 is allowed and disables\n" - "# events causing all Motion to be written to one single movie file and no pre_capture.", + "# Recommended value is 60 seconds (Default). The value -1 is allowed and disables\n" + "# events causing all Motion to be written to one single movie file and no pre_capture.\n" + "# If set to 0, motion is running in gapless mode. Movies don't have gaps anymore. An\n" + "# event ends right after no more motion is detected and post_capture is over.", 0, CONF_OFFSET(event_gap), copy_int, diff --git a/configure b/configure index b149ab8..ccb7f2c 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67 for motion Git-c167611de9791425c5440305e1af3972d040e558. +# Generated by GNU Autoconf 2.67 for motion Git-944d1ee5adebe1c9cc99da64975e599ebee5aeb6. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -549,8 +549,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='motion' PACKAGE_TARNAME='motion' -PACKAGE_VERSION='Git-c167611de9791425c5440305e1af3972d040e558' -PACKAGE_STRING='motion Git-c167611de9791425c5440305e1af3972d040e558' +PACKAGE_VERSION='Git-944d1ee5adebe1c9cc99da64975e599ebee5aeb6' +PACKAGE_STRING='motion Git-944d1ee5adebe1c9cc99da64975e599ebee5aeb6' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1217,7 +1217,7 @@ 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 motion Git-c167611de9791425c5440305e1af3972d040e558 to adapt to many kinds of systems. +\`configure' configures motion Git-944d1ee5adebe1c9cc99da64975e599ebee5aeb6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1278,7 +1278,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of motion Git-c167611de9791425c5440305e1af3972d040e558:";; + short | recursive ) echo "Configuration of motion Git-944d1ee5adebe1c9cc99da64975e599ebee5aeb6:";; esac cat <<\_ACEOF @@ -1424,7 +1424,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -motion configure Git-c167611de9791425c5440305e1af3972d040e558 +motion configure Git-944d1ee5adebe1c9cc99da64975e599ebee5aeb6 generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2021,7 +2021,7 @@ 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 motion $as_me Git-c167611de9791425c5440305e1af3972d040e558, which was +It was created by motion $as_me Git-944d1ee5adebe1c9cc99da64975e599ebee5aeb6, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ @@ -3246,6 +3246,548 @@ fi +# Checks for programs. +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 test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_ac_ct_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_ac_ct_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_c_compiler_gnu+set}" = set; 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 test "${ac_cv_prog_cc_g+set}" = set; 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 test "${ac_cv_prog_cc_c89+set}" = set; 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 +#include +#include +/* 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=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 + + TEMP_LIBS="-lm ${TEMP_LIBS}" TEMP_CFLAGS="${TEMP_CFLAGS} ${CFLAGS}" TEMP_LDFLAGS="${TEMP_LDFLAGS} ${LDFLAGS}" @@ -3275,6 +3817,7 @@ if test "${with_bktr+set}" = set; then : fi + if test "${BKTR}" = "no"; then TEMP_CFLAGS="${TEMP_CFLAGS} -DWITHOUT_V4L" fi @@ -3310,10 +3853,10 @@ $as_echo_n "checking for linuxthreads... " >&6; } # Check for thread header # if test -f "${THREAD_CHECK}"; then - HEADERS_THREAD_CFLAGS="-I/usr/local/include/pthread/linuxthreads" - THREADS="yes" + HEADERS_THREAD_CFLAGS="-I/usr/local/include/pthread/linuxthreads" + THREADS="yes" else - THREADS="no" + THREADS="no" fi # @@ -3323,7 +3866,7 @@ $as_echo_n "checking for linuxthreads... " >&6; } THREADS="yes" LIB_THREAD="-llthread -llgcc_r" else - THREADS="no" + THREADS="no" fi # Checks for Library linuxthreads for FreeBSD @@ -3336,19 +3879,19 @@ $as_echo_n "checking for linuxthreads... " >&6; } if test "${THREADS}" = "yes"; then TEMP_CFLAGS="${HEADERS_THREAD_CFLAGS} $TEMP_CFLAGS -DWITH_LINUXTREADS" - TEMP_LIBS="$TEMP_LIBS ${LIB_THREAD}" - THREAD_CFLAGS="-D_THREAD_SAFE" - PTHREAD_SUPPORT="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $THREADS" >&5 + TEMP_LIBS="$TEMP_LIBS ${LIB_THREAD}" + THREAD_CFLAGS="-D_THREAD_SAFE" + PTHREAD_SUPPORT="yes" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $THREADS" >&5 $as_echo "$THREADS" >&6; } - else - PTHREAD_SUPPORT="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $THREADS" >&5 + else + PTHREAD_SUPPORT="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $THREADS" >&5 $as_echo "$THREADS" >&6; } - echo - echo "You do not have linuxthread installed" - echo - fi + echo + echo "You do not have linuxthread installed" + echo + fi elif test -f "${THREAD_CHECK}"; then @@ -4054,8 +4597,8 @@ $as_echo_n "checking for mysql headers in $MYSQL_HEADERS... " >&6; } $as_echo "not found" >&6; } echo "Invalid MySQL directory - unable to find mysql.h." else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL_INCDIR yes" >&5 +$as_echo "$MYSQL_INCDIR yes" >&6; } MYSQL_HEADERS="yes" fi @@ -5989,7 +6532,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by motion $as_me Git-c167611de9791425c5440305e1af3972d040e558, which was +This file was extended by motion $as_me Git-944d1ee5adebe1c9cc99da64975e599ebee5aeb6, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6051,7 +6594,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -motion config.status Git-c167611de9791425c5440305e1af3972d040e558 +motion config.status Git-944d1ee5adebe1c9cc99da64975e599ebee5aeb6 configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" diff --git a/configure.in b/configure.in index 0f34c6f..b230d34 100644 --- a/configure.in +++ b/configure.in @@ -77,6 +77,9 @@ fi AC_SUBST(VIDEO) +# Checks for programs. +AC_PROG_CC + TEMP_LIBS="-lm ${TEMP_LIBS}" TEMP_CFLAGS="${TEMP_CFLAGS} ${CFLAGS}" TEMP_LDFLAGS="${TEMP_LDFLAGS} ${LDFLAGS}" @@ -103,6 +106,7 @@ AC_ARG_WITH(bktr, BKTR="$withval" ) + if test "${BKTR}" = "no"; then TEMP_CFLAGS="${TEMP_CFLAGS} -DWITHOUT_V4L" fi @@ -136,10 +140,10 @@ AC_MSG_CHECKING(for linuxthreads) # Check for thread header # if test -f "${THREAD_CHECK}"; then - HEADERS_THREAD_CFLAGS="-I/usr/local/include/pthread/linuxthreads" - THREADS="yes" + HEADERS_THREAD_CFLAGS="-I/usr/local/include/pthread/linuxthreads" + THREADS="yes" else - THREADS="no" + THREADS="no" fi # @@ -149,7 +153,7 @@ AC_MSG_CHECKING(for linuxthreads) THREADS="yes" LIB_THREAD="-llthread -llgcc_r" else - THREADS="no" + THREADS="no" fi # Checks for Library linuxthreads for FreeBSD @@ -162,17 +166,17 @@ AC_MSG_CHECKING(for linuxthreads) if test "${THREADS}" = "yes"; then TEMP_CFLAGS="${HEADERS_THREAD_CFLAGS} $TEMP_CFLAGS -DWITH_LINUXTREADS" - TEMP_LIBS="$TEMP_LIBS ${LIB_THREAD}" - THREAD_CFLAGS="-D_THREAD_SAFE" - PTHREAD_SUPPORT="yes" - AC_MSG_RESULT($THREADS) - else - PTHREAD_SUPPORT="no" - AC_MSG_RESULT($THREADS) - echo - echo "You do not have linuxthread installed" - echo - fi + TEMP_LIBS="$TEMP_LIBS ${LIB_THREAD}" + THREAD_CFLAGS="-D_THREAD_SAFE" + PTHREAD_SUPPORT="yes" + AC_MSG_RESULT($THREADS) + else + PTHREAD_SUPPORT="no" + AC_MSG_RESULT($THREADS) + echo + echo "You do not have linuxthread installed" + echo + fi elif test -f "${THREAD_CHECK}"; then @@ -646,7 +650,7 @@ else AC_MSG_RESULT(not found) echo "Invalid MySQL directory - unable to find mysql.h." else - AC_MSG_RESULT(yes) + AC_MSG_RESULT($MYSQL_INCDIR yes) MYSQL_HEADERS="yes" fi diff --git a/event.c b/event.c index e9fdb55..e93c8d5 100644 --- a/event.c +++ b/event.c @@ -158,9 +158,9 @@ static void event_sqlnewfile(struct context *cnt, int type ATTRIBUTE_UNUSED, MOTION_LOG(INF, TYPE_DB, NO_ERRNO, "%s: Re-Connection to Mysql database '%s' Succeed", cnt->conf.database_dbname); if (mysql_query(cnt->database, sqlquery) != 0) { - int err_code = mysql_errno(cnt->database); + int error_my = mysql_errno(cnt->database); MOTION_LOG(ERR, TYPE_DB, SHOW_ERRNO, "%s: after re-connection Mysql query failed %s error code %d", - mysql_error(cnt->database), err_code); + mysql_error(cnt->database), error_my); } } } @@ -238,7 +238,6 @@ static void on_event_end_command(struct context *cnt, int type ATTRIBUTE_UNUSED, char *dummy2 ATTRIBUTE_UNUSED, void *dummy3 ATTRIBUTE_UNUSED, struct tm *tm ATTRIBUTE_UNUSED) { - if (cnt->conf.on_event_end) exec_command(cnt, cnt->conf.on_event_end, NULL, 0); } @@ -406,9 +405,6 @@ static void on_movie_end_command(struct context *cnt, int type ATTRIBUTE_UNUSED, { int filetype = (unsigned long) arg; - MOTION_LOG(NTC, TYPE_EVENTS, NO_ERRNO, "%s: Closing File: %s", - filename); - if ((filetype & FTYPE_MPEG_ANY) && cnt->conf.on_movie_end) exec_command(cnt, cnt->conf.on_movie_end, filename, filetype); } @@ -420,9 +416,9 @@ static void event_extpipe_end(struct context *cnt, int type ATTRIBUTE_UNUSED, if (cnt->extpipe_open) { cnt->extpipe_open = 0; fflush(cnt->extpipe); - MOTION_LOG(NTC, TYPE_EVENTS, NO_ERRNO, "%s: CLOSING: extpipe file desc %d, error state %d", + MOTION_LOG(ERR, TYPE_EVENTS, NO_ERRNO, "%s: CLOSING: extpipe file desc %d, error state %d", fileno(cnt->extpipe), ferror(cnt->extpipe)); - MOTION_LOG(NTC, TYPE_EVENTS, NO_ERRNO, "%s: pclose return: %d", + MOTION_LOG(ERR, TYPE_EVENTS, NO_ERRNO, "%s: pclose return: %d", pclose(cnt->extpipe)); event(cnt, EVENT_FILECLOSE, NULL, cnt->extpipefilename, (void *)FTYPE_MPEG, NULL); } diff --git a/motion-dist.conf.in b/motion-dist.conf.in index 4d688b1..f1542ea 100644 --- a/motion-dist.conf.in +++ b/motion-dist.conf.in @@ -101,7 +101,7 @@ framerate 2 # This option is used when you want to capture images at a rate lower than 2 per second. minimum_frame_time 0 -# URL to use if you are using a network camera, size will be autodetected (incl http:// ftp:// or file:///) +# URL to use if you are using a network camera, size will be autodetected (incl http:// ftp:// mjpg:// or file:///) # Must be a URL that returns single jpeg pictures or a raw mjpeg stream. Default: Not defined ; netcam_url value @@ -190,7 +190,8 @@ despeckle_filter EedDl # Detect motion in predefined areas (1 - 9). Areas are numbered like that: 1 2 3 # A script (on_area_detected) is started immediately when motion is 4 5 6 # detected in one of the given areas, but only once during an event. 7 8 9 -# One or more areas can be specified with this option. (Default: not defined) +# One or more areas can be specified with this option. Take care: This option +# does NOT restrict detection to these areas! (Default: not defined) ; area_detect value # PGM file to use as a sensitivity mask. @@ -220,12 +221,12 @@ pre_capture 0 # Number of frames to capture after motion is no longer detected (default: 0) post_capture 0 -# Event Gap is the seconds of no motion detection that triggers the end of an event +# Event Gap is the seconds of no motion detection that triggers the end of an event. # An event is defined as a series of motion images taken within a short timeframe. -# Recommended value is 60 seconds (Default). A value of 0 allows to generate 'gapless' -# movies - an event ends right after post_capture if any. The value -1 is allowed and -# disables events causing all Motion to be written to one single movie file and no -# pre_capture. +# Recommended value is 60 seconds (Default). The value -1 is allowed and disables +# events causing all Motion to be written to one single movie file and no pre_capture. +# If set to 0, motion is running in gapless mode. Movies don't have gaps anymore. An +# event ends right after no more motion is detected and post_capture is over. event_gap 60 # Maximum length in seconds of a movie diff --git a/motion.c b/motion.c index 1a8f8e9..09a19b4 100644 --- a/motion.c +++ b/motion.c @@ -1519,7 +1519,7 @@ static void *motion_loop(void *arg) * 5 frames to allow the camera to settle. * Don't check if we have lost connection, we detect "Lost signal" frame as lightswitch */ - if (cnt->conf.lightswitch && !cnt->lost_connection) { + if (cnt->conf.lightswitch > 1 && !cnt->lost_connection) { if (alg_lightswitch(cnt, cnt->current_image->diffs)) { MOTION_LOG(INF, TYPE_ALL, NO_ERRNO, "%s: Lightswitch detected"); @@ -1634,15 +1634,17 @@ static void *motion_loop(void *arg) /* * Update reference frame. - * micro-lighswitch: e.g. neighbors cat switched on the motion sensitive + * micro-lighswitch: trying to auto-detect lightswitch events. * frontdoor illumination. Updates are rate-limited to 3 per second at * framerates above 5fps to save CPU resources and to keep sensitivity * at a constant level. */ - if ((cnt->current_image->diffs > cnt->threshold) && - (cnt->lightswitch_framecounter < (cnt->lastrate * 2)) && /* two seconds window */ + if ((cnt->current_image->diffs > cnt->threshold) && (cnt->conf.lightswitch == 1) && + (cnt->lightswitch_framecounter < (cnt->lastrate * 2)) && /* two seconds window only */ + /* number of changed pixels almost the same in two consecutive frames and */ ((abs(previous_diffs - cnt->current_image->diffs)) < (previous_diffs / 15)) && + /* center of motion in about the same place ? */ ((abs(cnt->current_image->location.x - previous_location_x)) <= (cnt->imgs.width / 150)) && ((abs(cnt->current_image->location.y - previous_location_y)) <= (cnt->imgs.height / 150))) { alg_update_reference_frame(cnt, RESET_REF_FRAME); @@ -1882,10 +1884,8 @@ static void *motion_loop(void *arg) * First test for max_movie_time */ if ((cnt->conf.max_movie_time && cnt->event_nr == cnt->prev_event) && - (cnt->currenttime - cnt->eventtime >= cnt->conf.max_movie_time)) { - MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, "%s: max movie time reached , making movie"); + (cnt->currenttime - cnt->eventtime >= cnt->conf.max_movie_time)) cnt->makemovie = 1; - } /* * Now test for quiet longer than 'gap' OR make movie as decided in