From eef23f02b5ca42b9dcc4ab6dfcaf459d2a58cade Mon Sep 17 00:00:00 2001 From: Stuart Henderson Date: Thu, 23 Oct 2014 12:56:30 +0100 Subject: [PATCH] check for V4L2 header in sys/videoio.h as well as linux/videodev.h --- configure.ac | 9 ++++++--- track.c | 2 +- video.h | 6 +++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index a92e8b8d..6730d62e 100755 --- a/configure.ac +++ b/configure.ac @@ -915,7 +915,7 @@ fi #Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(stdio.h unistd.h stdint.h fcntl.h time.h signal.h sys/ioctl.h sys/mman.h linux/videodev.h linux/videodev2.h sys/param.h sys/types.h) +AC_CHECK_HEADERS(stdio.h unistd.h stdint.h fcntl.h time.h signal.h sys/ioctl.h sys/mman.h linux/videodev.h linux/videodev2.h sys/param.h sys/types.h sys/videoio.h) AC_CHECK_FUNCS(get_current_dir_name) @@ -931,8 +931,11 @@ else [SUPPORTED_V4L2=true], [SUPPORTED_V4L2=false], [#include - #include ]) - + #ifdef HAVE_LINUX_VIDEODEV_H + #include + #elif HAVE_SYS_VIDEOIO_H + #include + #endif]) AC_MSG_CHECKING(for V42L support) if test x$SUPPORTED_V4L2 = xtrue; then AC_MSG_RESULT(yes) diff --git a/track.c b/track.c index 0d7e3b3e..46e65ff7 100644 --- a/track.c +++ b/track.c @@ -9,7 +9,7 @@ #include #include "motion.h" -#if defined(HAVE_LINUX_VIDEODEV_H) && (!defined(WITHOUT_V4L)) +#if (defined(HAVE_LINUX_VIDEODEV_H) || defined(HAVE_SYS_VIDEOIO_H)) && (!defined(WITHOUT_V4L)) #include "pwc-ioctl.h" #endif diff --git a/video.h b/video.h index 12f29285..193087bd 100644 --- a/video.h +++ b/video.h @@ -14,8 +14,12 @@ #include -#if defined(HAVE_LINUX_VIDEODEV_H) && (!defined(WITHOUT_V4L)) +#if !defined(WITHOUT_V4L) +#if defined(HAVE_LINUX_VIDEODEV_H) #include +#elif defined(HAVE_SYS_VIDEOIO_H) +#include +#endif #include "vloopback_motion.h" #include "pwc-ioctl.h" #endif