aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libv4l2/libv4l2.c
diff options
context:
space:
mode:
authorhans@localhost.localdomain <hans@localhost.localdomain>2008-07-29 21:26:45 (GMT)
committerhans@localhost.localdomain <hans@localhost.localdomain>2008-07-29 21:26:45 (GMT)
commit0215f2ac08c3ad0dc66ad8036f4e186a5e8f56d6 (patch)
tree17a7c0bd2df7c68c4c90e4fd690a850029d469fc /lib/libv4l2/libv4l2.c
parentab60e93dacdb1c8cee829fc8d92e136bc8ccfec8 (diff)
libv4l: intercept get capabilites and report read capability
From: Hans de Goede <j.w.r.degoede@hhs.nl> libv4l: intercept get capabilites and report read capability Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
Diffstat (limited to 'lib/libv4l2/libv4l2.c')
-rw-r--r--lib/libv4l2/libv4l2.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/libv4l2/libv4l2.c b/lib/libv4l2/libv4l2.c
index 95c5810..930ef5f 100644
--- a/lib/libv4l2/libv4l2.c
+++ b/lib/libv4l2/libv4l2.c
@@ -550,6 +550,9 @@ int v4l2_ioctl (int fd, unsigned long int request, ...)
/* Is this a capture request and do we need to take the stream lock? */
switch (request) {
+ case VIDIOC_QUERYCAP:
+ is_capture_request = 1;
+ break;
case VIDIOC_ENUM_FMT:
if (((struct v4l2_fmtdesc *)arg)->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
is_capture_request = 1;
@@ -605,6 +608,17 @@ int v4l2_ioctl (int fd, unsigned long int request, ...)
switch (request) {
+ case VIDIOC_QUERYCAP:
+ {
+ struct v4l2_capability *cap = arg;
+
+ result = syscall(SYS_ioctl, devices[index].fd, VIDIOC_QUERYCAP, cap);
+ if (result == 0)
+ /* We always support read() as we fake it using mmap mode */
+ cap->capabilities |= V4L2_CAP_READWRITE;
+ }
+ break;
+
case VIDIOC_ENUM_FMT:
result = v4lconvert_enum_fmt(devices[index].convert, arg);
break;
@@ -727,7 +741,7 @@ int v4l2_ioctl (int fd, unsigned long int request, ...)
result = syscall(SYS_ioctl, devices[index].fd, VIDIOC_REQBUFS, req);
if (result < 0)
break;
- result = 0; // some drivers return the number of buffers on success
+ result = 0; /* some drivers return the number of buffers on success */
/* If we got more frames then we can handle lie to the app */
if (req->count > V4L2_MAX_NO_FRAMES)

Privacy Policy