[PATCH] libv4l: Fixed videodev.h header moving away from glibc to libv4l-devel

Marcus Meissner marcus at jet.franken.de
Mon Jul 11 02:12:04 CDT 2011


Hi,

As seen in openSUSE 12.1 development, <linux/videodev.h> is no longer, ioctls
come from the libv4l compat library.

Ciao, Marcus
---
 configure.ac                  |    9 +++++++++
 dlls/avicap32/avicap32_main.c |   10 +++++++---
 dlls/qcap/v4l.c               |    8 ++++++--
 dlls/qcap/yuv.c               |    2 +-
 4 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0e86713..8df9993 100644
--- a/configure.ac
+++ b/configure.ac
@@ -651,6 +651,15 @@ AC_CHECK_HEADERS([linux/videodev.h],,,
 #include <asm/types.h>
 #endif])
 
+AC_CHECK_HEADERS([libv4l1-videodev.h],,,
+[#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/types.h>
+#ifdef HAVE_ASM_TYPES_H
+#include <asm/types.h>
+#endif])
+
 dnl Check for broken kernel header that doesn't define __user
 AC_CHECK_HEADERS([linux/capi.h],,,[#define __user])
 
diff --git a/dlls/avicap32/avicap32_main.c b/dlls/avicap32/avicap32_main.c
index 349ee5d..d6a9609 100644
--- a/dlls/avicap32/avicap32_main.c
+++ b/dlls/avicap32/avicap32_main.c
@@ -40,6 +40,10 @@
 #endif
 #ifdef HAVE_LINUX_VIDEODEV_H
 # include <linux/videodev.h>
+#else
+# ifdef HAVE_LIBV4L1_VIDEODEV_H
+#  include <libv4l1-videodev.h>
+# endif
 #endif
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
@@ -91,7 +95,7 @@ HWND VFWAPI capCreateCaptureWindowA(LPCSTR lpszWindowName, DWORD dwStyle, INT x,
     return retW;
 }
 
-#ifdef HAVE_LINUX_VIDEODEV_H
+#if defined(HAVE_LINUX_VIDEODEV_H) || defined(HAVE_LIBV4L1_VIDEODEV_H)
 
 static int xioctl(int fd, int request, void * arg)
 {
@@ -163,7 +167,7 @@ static BOOL query_video_device(int devnum, char *name, int namesize, char *versi
    return TRUE;
 }
 
-#else /* HAVE_LINUX_VIDEODEV_H */
+#else /* HAVE_LINUX_VIDEODEV_H || HAVE_LIBV4L1_VIDEODEV_H */
 
 static BOOL query_video_device(int devnum, char *name, int namesize, char *version, int versionsize)
 {
@@ -171,7 +175,7 @@ static BOOL query_video_device(int devnum, char *name, int namesize, char *versi
    return FALSE;
 }
 
-#endif /* HAVE_LINUX_VIDEODEV_H */
+#endif /* HAVE_LINUX_VIDEODEV_H | HAVE_LIBV4L1_VIDEODEV_H */
 
 /***********************************************************************
  *             capGetDriverDescriptionA   (AVICAP32.@)
diff --git a/dlls/qcap/v4l.c b/dlls/qcap/v4l.c
index fadcd49..0d35cfe 100644
--- a/dlls/qcap/v4l.c
+++ b/dlls/qcap/v4l.c
@@ -63,7 +63,11 @@
 #include <asm/types.h>
 #endif
 #ifdef HAVE_LINUX_VIDEODEV_H
-#include <linux/videodev.h>
+# include <linux/videodev.h>
+#else
+# ifdef HAVE_LIBV4L1_VIDEODEV_H
+#  include <libv4l1-videodev.h>
+# endif
 #endif
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
@@ -71,7 +75,7 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(qcap_v4l);
 
-#ifdef HAVE_LINUX_VIDEODEV_H
+#if defined(HAVE_LINUX_VIDEODEV_H) || defined(HAVE_LIBV4L1_VIDEODEV_H)
 
 static typeof(open) *video_open = open;
 static typeof(close) *video_close = close;
diff --git a/dlls/qcap/yuv.c b/dlls/qcap/yuv.c
index 608e571..bbc1b50 100644
--- a/dlls/qcap/yuv.c
+++ b/dlls/qcap/yuv.c
@@ -32,7 +32,7 @@
 #include "wine/debug.h"
 
 /* This is not used if V4L support is missing */
-#ifdef HAVE_LINUX_VIDEODEV_H
+#if defined(HAVE_LINUX_VIDEODEV_H) || defined(HAVE_LIBV4L1_VIDEODEV_H)
 
 WINE_DEFAULT_DEBUG_CHANNEL(qcap);
 
-- 
1.7.3.4




More information about the wine-patches mailing list