diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fa6ccb59..65ba59144 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,7 +112,10 @@ include_directories("${CMAKE_BINARY_DIR}") set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON) # System checks -check_include_file("linux/videodev.h" HAVE_LINUX_VIDEODEV_H) +check_include_file("libv4l1-videodev.h" HAVE_LIBV4L1_VIDEODEV_H) +if(NOT HAVE_LIBV4L1_VIDEODEV_H) + check_include_file("linux/videodev.h" HAVE_LINUX_VIDEODEV_H) +endif(NOT HAVE_LIBV4L1_VIDEODEV_H) check_include_file("linux/videodev2.h" HAVE_LINUX_VIDEODEV2_H) check_include_file("execinfo.h" HAVE_EXECINFO_H) check_include_file("ucontext.h" HAVE_UCONTEXT_H) @@ -413,17 +416,17 @@ endif((NOT HAVE_LIBCRYPTO) AND (NOT HAVE_LIBGNUTLS)) set(ZM_HAS_V4L 0) set(ZM_HAS_V4L1 0) set(ZM_HAS_V4L2 0) -if(HAVE_LINUX_VIDEODEV_H) +if(HAVE_LINUX_VIDEODEV_H OR HAVE_LIBV4L1_VIDEODEV_H) set(ZM_HAS_V4L 1) set(ZM_HAS_V4L1 1) -endif(HAVE_LINUX_VIDEODEV_H) +endif(HAVE_LINUX_VIDEODEV_H OR HAVE_LIBV4L1_VIDEODEV_H) if(HAVE_LINUX_VIDEODEV2_H) set(ZM_HAS_V4L 1) set(ZM_HAS_V4L2 1) endif(HAVE_LINUX_VIDEODEV2_H) -if((NOT HAVE_LINUX_VIDEODEV_H) AND (NOT HAVE_LINUX_VIDEODEV2_H)) +if((NOT HAVE_LINUX_VIDEODEV_H) AND (NOT HAVE_LIBV4L1_VIDEODEV_H) AND (NOT HAVE_LINUX_VIDEODEV2_H)) message(AUTHOR_WARNING " Video 4 Linux headers weren't found - Analog and USB camera support will not be available") -endif((NOT HAVE_LINUX_VIDEODEV_H) AND (NOT HAVE_LINUX_VIDEODEV2_H)) +endif((NOT HAVE_LINUX_VIDEODEV_H) AND (NOT HAVE_LIBV4L1_VIDEODEV_H) AND (NOT HAVE_LINUX_VIDEODEV2_H)) # Check for PCRE and enable ZM_PCRE accordingly set(ZM_PCRE 0) if(HAVE_LIBPCRE AND HAVE_PCRE_H) diff --git a/configure.ac b/configure.ac index c42847877..a73821150 100644 --- a/configure.ac +++ b/configure.ac @@ -368,14 +368,26 @@ AC_CHECK_HEADERS(execinfo.h,,,) AC_CHECK_HEADERS(ucontext.h,,,) AC_CHECK_HEADERS(sys/syscall.h,,,) AC_CHECK_HEADERS(pthread.h,,,) -AC_CHECK_HEADERS(linux/videodev.h,AC_SUBST(ZM_HAS_V4L1,1),AC_SUBST(ZM_HAS_V4L1,0),) -AC_CHECK_HEADERS(linux/videodev2.h,AC_SUBST(ZM_HAS_V4L2,1),AC_SUBST(ZM_HAS_V4L2,0),) + +# Check for Video for Linux 1 Header Files +ZM_HAS_V4L1=0 +AC_CHECK_HEADERS([libv4l1-videodev.h linux/videodev.h],[ZM_HAS_V4L1=1; break;],,) +AC_SUBST(ZM_HAS_V4L1) + +# Check for Video for Linux 2 Header Files +ZM_HAS_V4L2=0 +AC_CHECK_HEADERS(linux/videodev2.h,ZM_HAS_V4L2=1,,) +AC_SUBST(ZM_HAS_V4L2) + +# Set global Video for Linux flag +ZM_HAS_V4L=0 if test "$ZM_HAS_V4L1" == "1" || test "$ZM_HAS_V4L2" == "1"; then -AC_SUBST(ZM_HAS_V4L,1) +ZM_HAS_V4L=1 else -AC_SUBST(ZM_HAS_V4L,0) AC_MSG_WARN(zm requires Video4Linux or Video4Linux2 to be installed for analog or USB camera support) fi +AC_SUBST(ZM_HAS_V4L) + AC_CHECK_HEADERS(jpeglib.h,,AC_MSG_ERROR(zm requires libjpeg headers to be installed),) AC_CHECK_HEADERS(mysql/mysql.h,,AC_MSG_ERROR(zm requires MySQL headers - check that MySQL development packages are installed),) AC_LANG_PUSH([C]) diff --git a/distros/fedora/zoneminder.f20.spec b/distros/fedora/zoneminder.f20.spec index a49361ef3..4d9c629d1 100644 --- a/distros/fedora/zoneminder.f20.spec +++ b/distros/fedora/zoneminder.f20.spec @@ -31,7 +31,7 @@ BuildRequires: perl(MIME::Entity) perl(MIME::Lite) BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap) BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign) BuildRequires: perl(Expect) perl(Sys::Syslog) -BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel +BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel libv4l-devel %{!?_without_ffmpeg:BuildRequires: ffmpeg-devel} %{!?_without_x10:BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)} # cmake needs the following installed at build time due to the way it auto-detects certain parameters diff --git a/distros/fedora/zoneminder.f21.spec b/distros/fedora/zoneminder.f21.spec index 31afc0417..de97aea94 100644 --- a/distros/fedora/zoneminder.f21.spec +++ b/distros/fedora/zoneminder.f21.spec @@ -31,7 +31,7 @@ BuildRequires: perl(MIME::Entity) perl(MIME::Lite) BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap) BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign) BuildRequires: perl(Expect) perl(Sys::Syslog) -BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel +BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel libv4l-devel %{!?_without_ffmpeg:BuildRequires: ffmpeg-devel} %{!?_without_x10:BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)} # cmake needs the following installed at build time due to the way it auto-detects certain parameters diff --git a/distros/redhat/zoneminder.el7.spec b/distros/redhat/zoneminder.el7.spec index b21a3901d..ebd22aa00 100644 --- a/distros/redhat/zoneminder.el7.spec +++ b/distros/redhat/zoneminder.el7.spec @@ -27,7 +27,7 @@ BuildRequires: perl(MIME::Entity) perl(MIME::Lite) BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap) BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign) BuildRequires: perl(Expect) perl(Sys::Syslog) -BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel +BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel libv4l-devel BuildRequires: ffmpeg ffmpeg-devel perl(X10::ActiveHome) perl(Astro::SunTime) # cmake needs the following installed at build time due to the way it auto-detects certain parameters BuildRequires: httpd polkit-devel diff --git a/src/zm_local_camera.h b/src/zm_local_camera.h index 0dbe44c21..89c6799ca 100644 --- a/src/zm_local_camera.h +++ b/src/zm_local_camera.h @@ -29,6 +29,9 @@ #ifdef HAVE_LINUX_VIDEODEV_H #include #endif // HAVE_LINUX_VIDEODEV_H +#ifdef HAVE_LIBV4L1_VIDEODEV_H +#include +#endif // HAVE_LIB4VL1_VIDEODEV_H #ifdef HAVE_LINUX_VIDEODEV2_H #include #endif // HAVE_LINUX_VIDEODEV2_H diff --git a/zoneminder-config.cmake b/zoneminder-config.cmake index 90759c1b6..3854dfe31 100644 --- a/zoneminder-config.cmake +++ b/zoneminder-config.cmake @@ -5,6 +5,7 @@ /* General system checks */ #cmakedefine HAVE_LINUX_VIDEODEV_H 1 +#cmakedefine HAVE_LIBV4L1_VIDEODEV_H 1 #cmakedefine HAVE_LINUX_VIDEODEV2_H 1 #cmakedefine HAVE_EXECINFO_H 1 #cmakedefine HAVE_UCONTEXT_H 1