check for V4L2 header in sys/videoio.h as well as linux/videodev.h

This commit is contained in:
Stuart Henderson
2014-10-23 12:56:30 +01:00
parent 80633f222b
commit eef23f02b5
3 changed files with 12 additions and 5 deletions

View File

@@ -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 <sys/time.h>
#include <linux/videodev.h>])
#ifdef HAVE_LINUX_VIDEODEV_H
#include <linux/videodev.h>
#elif HAVE_SYS_VIDEOIO_H
#include <sys/videoio.h>
#endif])
AC_MSG_CHECKING(for V42L support)
if test x$SUPPORTED_V4L2 = xtrue; then
AC_MSG_RESULT(yes)

View File

@@ -9,7 +9,7 @@
#include <math.h>
#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

View File

@@ -14,8 +14,12 @@
#include <sys/mman.h>
#if defined(HAVE_LINUX_VIDEODEV_H) && (!defined(WITHOUT_V4L))
#if !defined(WITHOUT_V4L)
#if defined(HAVE_LINUX_VIDEODEV_H)
#include <linux/videodev.h>
#elif defined(HAVE_SYS_VIDEOIO_H)
#include <sys/videoio.h>
#endif
#include "vloopback_motion.h"
#include "pwc-ioctl.h"
#endif