diff options
author | hans@localhost.localdomain <hans@localhost.localdomain> | 2008-07-29 23:26:45 +0200 |
---|---|---|
committer | hans@localhost.localdomain <hans@localhost.localdomain> | 2008-07-29 23:26:45 +0200 |
commit | 5e786b0e454373ed7282b56cd43a13503d2d98c2 (patch) | |
tree | 7eadf37b4f8048968db82c7934f9d26fa3865e9c /v4l2-apps | |
parent | a94d7a5e69e739ce5afae5a7c8d02dcf68c04b91 (diff) | |
download | mediapointer-dvb-s2-5e786b0e454373ed7282b56cd43a13503d2d98c2.tar.gz mediapointer-dvb-s2-5e786b0e454373ed7282b56cd43a13503d2d98c2.tar.bz2 |
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 'v4l2-apps')
-rw-r--r-- | v4l2-apps/lib/libv4l/ChangeLog | 1 | ||||
-rw-r--r-- | v4l2-apps/lib/libv4l/libv4l2/libv4l2.c | 16 |
2 files changed, 16 insertions, 1 deletions
diff --git a/v4l2-apps/lib/libv4l/ChangeLog b/v4l2-apps/lib/libv4l/ChangeLog index 3fec060c3..b54ab92f4 100644 --- a/v4l2-apps/lib/libv4l/ChangeLog +++ b/v4l2-apps/lib/libv4l/ChangeLog @@ -4,6 +4,7 @@ libv4l-0.3.8 * add pkg-config (.pc) files for easier detection if libv4l is available * check capabilities for streaming, if the driver cannot do streaming don't insert ourselves between the application and the driver +* intercept get capabilites and report read capability (which we always offer) libv4l-0.3.7 diff --git a/v4l2-apps/lib/libv4l/libv4l2/libv4l2.c b/v4l2-apps/lib/libv4l/libv4l2/libv4l2.c index 95c581079..930ef5f1e 100644 --- a/v4l2-apps/lib/libv4l/libv4l2/libv4l2.c +++ b/v4l2-apps/lib/libv4l/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) |