From 898d8abc16128d4fe89eaad214abe1c028fe8dda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mu=C5=BCy=C5=82o?= Date: Thu, 14 Jul 2011 21:38:14 +0200 Subject: [PATCH] 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 2694c59093f..0e050743831 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 #endif #include @@ -6143,9 +6144,9 @@ do : #include #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 dccc4d34053..afc937f4909 100644 --- a/configure.ac +++ b/configure.ac @@ -642,7 +642,7 @@ AC_CHECK_HEADERS([pthread_np.h],,, #include #endif]) -AC_CHECK_HEADERS([linux/videodev.h],,, +AC_CHECK_HEADERS([linux/videodev.h linux/videodev2.h],,, [#ifdef HAVE_SYS_TIME_H #include #endif diff --git a/dlls/avicap32/avicap32_main.c b/dlls/avicap32/avicap32_main.c index 349ee5d28fd..3d0b6619b0d 100644 --- a/dlls/avicap32/avicap32_main.c +++ b/dlls/avicap32/avicap32_main.c @@ -38,8 +38,8 @@ #ifdef HAVE_ASM_TYPES_H # include #endif -#ifdef HAVE_LINUX_VIDEODEV_H -# include +#ifdef HAVE_LINUX_VIDEODEV2_H +# include #endif #ifdef HAVE_UNISTD_H # include @@ -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 04507e06f96..6758bc6aa87 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -446,6 +446,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_UCDROM_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_VIDEODEV2_H + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_VIDEODEV_H