Rafał Mużyło : avicap32: Drop v4l1 support.

Alexandre Julliard julliard at winehq.org
Fri Jul 15 11:45:11 CDT 2011


Module: wine
Branch: master
Commit: 898d8abc16128d4fe89eaad214abe1c028fe8dda
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=898d8abc16128d4fe89eaad214abe1c028fe8dda

Author: Rafał Mużyło <galtgendo at gmail.com>
Date:   Thu Jul 14 21:38:14 2011 +0200

avicap32: Drop v4l1 support.

---

 configure                     |    9 +++++----
 configure.ac                  |    2 +-
 dlls/avicap32/avicap32_main.c |   32 ++++++++------------------------
 include/config.h.in           |    3 +++
 4 files changed, 17 insertions(+), 29 deletions(-)

diff --git a/configure b/configure
index 2694c59..0e05074 100755
--- a/configure
+++ b/configure
@@ -6133,9 +6133,10 @@ fi
 done
 
 
-for ac_header in linux/videodev.h
+for ac_header in linux/videodev.h linux/videodev2.h
 do :
-  ac_fn_c_check_header_compile "$LINENO" "linux/videodev.h" "ac_cv_header_linux_videodev_h" "#ifdef HAVE_SYS_TIME_H
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
 #include <sys/types.h>
@@ -6143,9 +6144,9 @@ do :
 #include <asm/types.h>
 #endif
 "
-if test "x$ac_cv_header_linux_videodev_h" = xyes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LINUX_VIDEODEV_H 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
diff --git a/configure.ac b/configure.ac
index dccc4d3..afc937f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -642,7 +642,7 @@ AC_CHECK_HEADERS([pthread_np.h],,,
 #include <pthread.h>
 #endif])
 
-AC_CHECK_HEADERS([linux/videodev.h],,,
+AC_CHECK_HEADERS([linux/videodev.h linux/videodev2.h],,,
 [#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
diff --git a/dlls/avicap32/avicap32_main.c b/dlls/avicap32/avicap32_main.c
index 349ee5d..3d0b661 100644
--- a/dlls/avicap32/avicap32_main.c
+++ b/dlls/avicap32/avicap32_main.c
@@ -38,8 +38,8 @@
 #ifdef HAVE_ASM_TYPES_H
 # include <asm/types.h>
 #endif
-#ifdef HAVE_LINUX_VIDEODEV_H
-# include <linux/videodev.h>
+#ifdef HAVE_LINUX_VIDEODEV2_H
+# include <linux/videodev2.h>
 #endif
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
@@ -91,7 +91,7 @@ HWND VFWAPI capCreateCaptureWindowA(LPCSTR lpszWindowName, DWORD dwStyle, INT x,
     return retW;
 }
 
-#ifdef HAVE_LINUX_VIDEODEV_H
+#ifdef HAVE_LINUX_VIDEODEV2_H
 
 static int xioctl(int fd, int request, void * arg)
 {
@@ -108,10 +108,7 @@ static BOOL query_video_device(int devnum, char *name, int namesize, char *versi
    int fd;
    char device[16];
    struct stat st;
-   struct video_capability capa;
-#ifdef HAVE_V4L2
    struct v4l2_capability caps;
-#endif
 
    snprintf(device, sizeof(device), "/dev/video%i", devnum);
 
@@ -132,7 +129,6 @@ static BOOL query_video_device(int devnum, char *name, int namesize, char *versi
       return FALSE;
    }
 
-#ifdef HAVE_V4L2
    memset(&caps, 0, sizeof(caps));
    if (xioctl(fd, VIDIOC_QUERYCAP, &caps) != -1) {
       lstrcpynA(name, (char *)caps.card, namesize);
@@ -143,27 +139,15 @@ static BOOL query_video_device(int devnum, char *name, int namesize, char *versi
    }
 
    if (errno != EINVAL && errno != 515)
-      WARN("%s: ioctl failed: %s -- Falling back to V4L\n", device, strerror(errno));
-   else WARN("%s: Not a V4L2 compatible device, trying V4l 1\n", device);
-#endif /* HAVE_V4L2 */
-
-   memset(&capa, 0, sizeof(capa));
-   if (xioctl(fd, VIDIOCGCAP, &capa) == -1) {
 /* errno 515 is used by some webcam drivers for unknown IOICTL command */
-      if (errno != EINVAL && errno != 515)
-         ERR("%s: Querying failed: %s\n", device, strerror(errno));
-      else ERR("%s: Querying failed: Not a V4L compatible device\n", device);
-      close(fd);
-      return FALSE;
-   }
+      ERR("%s: Querying failed: %s\n", device, strerror(errno));
+   else ERR("%s: Querying failed: Not a V4L compatible device\n", device);
 
-   lstrcpynA(name, capa.name, namesize);
-   lstrcpynA(version, device, versionsize);
    close(fd);
-   return TRUE;
+   return FALSE;
 }
 
-#else /* HAVE_LINUX_VIDEODEV_H */
+#else /* HAVE_LINUX_VIDEODEV2_H */
 
 static BOOL query_video_device(int devnum, char *name, int namesize, char *version, int versionsize)
 {
@@ -171,7 +155,7 @@ static BOOL query_video_device(int devnum, char *name, int namesize, char *versi
    return FALSE;
 }
 
-#endif /* HAVE_LINUX_VIDEODEV_H */
+#endif /* HAVE_LINUX_VIDEODEV2_H */
 
 /***********************************************************************
  *             capGetDriverDescriptionA   (AVICAP32.@)
diff --git a/include/config.h.in b/include/config.h.in
index 04507e0..6758bc6 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -446,6 +446,9 @@
 /* Define to 1 if you have the <linux/ucdrom.h> header file. */
 #undef HAVE_LINUX_UCDROM_H
 
+/* Define to 1 if you have the <linux/videodev2.h> header file. */
+#undef HAVE_LINUX_VIDEODEV2_H
+
 /* Define to 1 if you have the <linux/videodev.h> header file. */
 #undef HAVE_LINUX_VIDEODEV_H
 




More information about the wine-cvs mailing list