avicap32: Drop v4l1 support.

This commit is contained in:
Rafał Mużyło 2011-07-14 21:38:14 +02:00 committed by Alexandre Julliard
parent 2b7c6a9599
commit 898d8abc16
4 changed files with 17 additions and 29 deletions

9
configure vendored
View File

@ -6133,9 +6133,10 @@ fi
done done
for ac_header in linux/videodev.h for ac_header in linux/videodev.h linux/videodev2.h
do : 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> #include <sys/time.h>
#endif #endif
#include <sys/types.h> #include <sys/types.h>
@ -6143,9 +6144,9 @@ do :
#include <asm/types.h> #include <asm/types.h>
#endif #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 cat >>confdefs.h <<_ACEOF
#define HAVE_LINUX_VIDEODEV_H 1 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF _ACEOF
fi fi

View File

@ -642,7 +642,7 @@ AC_CHECK_HEADERS([pthread_np.h],,,
#include <pthread.h> #include <pthread.h>
#endif]) #endif])
AC_CHECK_HEADERS([linux/videodev.h],,, AC_CHECK_HEADERS([linux/videodev.h linux/videodev2.h],,,
[#ifdef HAVE_SYS_TIME_H [#ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif #endif

View File

@ -38,8 +38,8 @@
#ifdef HAVE_ASM_TYPES_H #ifdef HAVE_ASM_TYPES_H
# include <asm/types.h> # include <asm/types.h>
#endif #endif
#ifdef HAVE_LINUX_VIDEODEV_H #ifdef HAVE_LINUX_VIDEODEV2_H
# include <linux/videodev.h> # include <linux/videodev2.h>
#endif #endif
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
# include <unistd.h> # include <unistd.h>
@ -91,7 +91,7 @@ HWND VFWAPI capCreateCaptureWindowA(LPCSTR lpszWindowName, DWORD dwStyle, INT x,
return retW; return retW;
} }
#ifdef HAVE_LINUX_VIDEODEV_H #ifdef HAVE_LINUX_VIDEODEV2_H
static int xioctl(int fd, int request, void * arg) 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; int fd;
char device[16]; char device[16];
struct stat st; struct stat st;
struct video_capability capa;
#ifdef HAVE_V4L2
struct v4l2_capability caps; struct v4l2_capability caps;
#endif
snprintf(device, sizeof(device), "/dev/video%i", devnum); 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; return FALSE;
} }
#ifdef HAVE_V4L2
memset(&caps, 0, sizeof(caps)); memset(&caps, 0, sizeof(caps));
if (xioctl(fd, VIDIOC_QUERYCAP, &caps) != -1) { if (xioctl(fd, VIDIOC_QUERYCAP, &caps) != -1) {
lstrcpynA(name, (char *)caps.card, namesize); 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) 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 */ /* 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)); ERR("%s: Querying failed: %s\n", device, strerror(errno));
else ERR("%s: Querying failed: Not a V4L compatible device\n", device); else ERR("%s: Querying failed: Not a V4L compatible device\n", device);
close(fd); close(fd);
return FALSE; return FALSE;
}
lstrcpynA(name, capa.name, namesize);
lstrcpynA(version, device, versionsize);
close(fd);
return TRUE;
} }
#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) 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; return FALSE;
} }
#endif /* HAVE_LINUX_VIDEODEV_H */ #endif /* HAVE_LINUX_VIDEODEV2_H */
/*********************************************************************** /***********************************************************************
* capGetDriverDescriptionA (AVICAP32.@) * capGetDriverDescriptionA (AVICAP32.@)

View File

@ -446,6 +446,9 @@
/* Define to 1 if you have the <linux/ucdrom.h> header file. */ /* Define to 1 if you have the <linux/ucdrom.h> header file. */
#undef HAVE_LINUX_UCDROM_H #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. */ /* Define to 1 if you have the <linux/videodev.h> header file. */
#undef HAVE_LINUX_VIDEODEV_H #undef HAVE_LINUX_VIDEODEV_H