From: Darren S. <li...@yo...> - 2010-02-25 00:49:39
|
# HG changeset patch # User Darren Salt <li...@yo...> # Date 1267055824 0 # Node ID e151f2347850c5cf889f59450ca00cf29ab25584 # Parent 2d095c55834956aacb9d9058cfbf2f9b5010b4bc Fix up V4L/V4L2 for non-Linux. diff --git a/ChangeLog b/ChangeLog --- 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 --- a/configure.ac +++ b/configure.ac @@ -678,15 +678,19 @@ 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 @@ 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 --- a/src/input/Makefile.am +++ b/src/input/Makefile.am @@ -21,8 +21,11 @@ if HAVE_V4L in_v4l = xineplug_inp_v4l.la +in_pvr = xineplug_inp_pvr.la +endif + +if HAVE_V4L2 in_v4l2 = xineplug_inp_v4l2.la -in_pvr = xineplug_inp_pvr.la endif if HAVE_GNOME_VFS diff --git a/src/input/input_v4l2.c b/src/input/input_v4l2.c --- a/src/input/input_v4l2.c +++ b/src/input/input_v4l2.c @@ -37,7 +37,13 @@ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> -#include <linux/videodev2.h> +#ifdef HAVE_SYS_VIDEOIO_H +# include <sys/videoio.h> +#elif defined(HAVE_SYS_VIDEODEV2_H) +# include <sys/videodev2.h> +#else +# include <linux/videodev2.h> +#endif #include <sys/mman.h> #include <stdio.h> #include <errno.h> |