From f6fe1935082d9dc1c6f923e80f62c9e9c90d1169 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Wed, 24 Feb 2010 23:57:04 +0000 Subject: Fix up V4L/V4L2 for non-Linux. --- ChangeLog | 1 + configure.ac | 10 +++++++--- src/input/Makefile.am | 5 ++++- src/input/input_v4l2.c | 8 +++++++- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 507ad6c07..1e92e2a7b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ xine-lib (1.1.18.1) 2010-??-?? * Oops. compat.c (for DXR3 support) was omitted. + * Fix up V4L/V4L2 compilation. Some non-Linux have V4L2 but not V4L. xine-lib (1.1.18) 2010-02-23 * Bump the FLAC decoder's priority above ffmpegaudio. This should fix diff --git a/configure.ac b/configure.ac index d41b0442c..f5310590c 100644 --- a/configure.ac +++ b/configure.ac @@ -678,15 +678,19 @@ dnl ---------------------------------------------- AC_ARG_ENABLE([v4l], AS_HELP_STRING([--disable-v4l], [do not build Video4Linux input plugins])) +have_v4l=no +have_v4l2=no if test "x$enable_v4l" != "xno"; then - AC_CHECK_HEADERS([linux/videodev.h linux/videodev2.h], [have_v4l=yes], [have_v4l=no]) + AC_CHECK_HEADERS([linux/videodev.h], [have_v4l=yes], []) + AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h sys/videodev2.h], [have_v4l2=yes], []) AC_CHECK_HEADERS([asm/types.h]) - if test "x$enable_v4l" = "xyes" && test "x$have_v4l" = "xno"; then + if test "x$enable_v4l" = "xyes" && test "x$have_v4l$have_v4l2" = "xnono"; then AC_MSG_ERROR([Video4Linux support requested, but prerequisite headers not found.]) fi fi AM_CONDITIONAL(HAVE_V4L, [test "x$have_v4l" = "xyes"]) +AM_CONDITIONAL(HAVE_V4L2, [test "x$have_v4l2" = "xyes"]) dnl ---------------------------------------------- dnl Check for libv4l support @@ -694,7 +698,7 @@ dnl ---------------------------------------------- AC_ARG_ENABLE([libv4l], AS_HELP_STRING([--disable-libv4l], [do not build with libv4l support])) -if test "x$have_v4l" = xyes; then +if test "x$have_v4l2" = xyes; then have_libv4l=no PKG_CHECK_MODULES([V4L2], [libv4l2], [have_libv4l=yes diff --git a/src/input/Makefile.am b/src/input/Makefile.am index 1c34f9aaa..beb101f8c 100644 --- a/src/input/Makefile.am +++ b/src/input/Makefile.am @@ -21,10 +21,13 @@ endif if HAVE_V4L in_v4l = xineplug_inp_v4l.la -in_v4l2 = xineplug_inp_v4l2.la in_pvr = xineplug_inp_pvr.la endif +if HAVE_V4L2 +in_v4l2 = xineplug_inp_v4l2.la +endif + if HAVE_GNOME_VFS in_gnome_vfs = xineplug_inp_gnome_vfs.la endif diff --git a/src/input/input_v4l2.c b/src/input/input_v4l2.c index 255b1f17c..5396594f4 100644 --- a/src/input/input_v4l2.c +++ b/src/input/input_v4l2.c @@ -37,7 +37,13 @@ #include #include #include -#include +#ifdef HAVE_SYS_VIDEOIO_H +# include +#elif defined(HAVE_SYS_VIDEODEV2_H) +# include +#else +# include +#endif #include #include #include -- cgit v1.2.3