summaryrefslogtreecommitdiff
path: root/v4l2-apps
diff options
context:
space:
mode:
authorhans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain>2009-06-05 16:02:40 +0200
committerhans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain>2009-06-05 16:02:40 +0200
commit5fefedb3c3a7a0ceaa161e4a3c1e180ba22cd364 (patch)
tree05ec6fcc2c3021b629aa683df00559119fc0d667 /v4l2-apps
parent5999b7d164dbf3118a3a75ee3f6f0b48cb8845c1 (diff)
downloadmediapointer-dvb-s2-5fefedb3c3a7a0ceaa161e4a3c1e180ba22cd364.tar.gz
mediapointer-dvb-s2-5fefedb3c3a7a0ceaa161e4a3c1e180ba22cd364.tar.bz2
libv4l: recognize when controls are disabled
From: Hans de Goede <hdegoede@redhat.com> libv4l: recognize when controls are disabled Priority: normal Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'v4l2-apps')
-rw-r--r--v4l2-apps/libv4l/ChangeLog9
-rw-r--r--v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c5
2 files changed, 10 insertions, 4 deletions
diff --git a/v4l2-apps/libv4l/ChangeLog b/v4l2-apps/libv4l/ChangeLog
index 08b221c2a..3d0733a2d 100644
--- a/v4l2-apps/libv4l/ChangeLog
+++ b/v4l2-apps/libv4l/ChangeLog
@@ -1,11 +1,16 @@
+libv4l-0.6.0
+------------
+* Recognize disabled controls and replace with fake equivalents where
+ available
+
libv4l-0.5.99
-----------
+-------------
* Link libv4lconvert with -lm for powf by Gregor Jasny
* Fix black screen on devices with hardware gamma control
* Fix crash with devices on which we do not emulate fake controls
* Add a patch by Hans Petter Selasky <hselasky@freebsd.org>, which should
lead to allowing use of libv4l (and the Linux webcam drivers ported
- to userspace usb drivers) on FreeBSd, this is a work in progress
+ to userspace usb drivers) on FreeBSD, this is a work in progress
libv4l-0.5.98
-------------
diff --git a/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c b/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c
index 2f459c396..b50b686df 100644
--- a/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c
+++ b/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c
@@ -203,7 +203,7 @@ static void v4lcontrol_init_flags(struct v4lcontrol_data *data)
struct v4lcontrol_data *v4lcontrol_create(int fd, int always_needs_conversion)
{
int shm_fd;
- int i, init = 0;
+ int i, rc, init = 0;
char *s, shm_name[256];
struct v4l2_capability cap;
struct v4l2_queryctrl ctrl;
@@ -230,7 +230,8 @@ struct v4lcontrol_data *v4lcontrol_create(int fd, int always_needs_conversion)
if (always_needs_conversion || v4lcontrol_needs_conversion(data)) {
for (i = 0; i < V4LCONTROL_AUTO_ENABLE_COUNT; i++) {
ctrl.id = fake_controls[i].id;
- if (SYS_IOCTL(data->fd, VIDIOC_QUERYCTRL, &ctrl) == -1)
+ rc = SYS_IOCTL(data->fd, VIDIOC_QUERYCTRL, &ctrl);
+ if (rc == -1 || (rc == 0 && (ctrl.flags & V4L2_CTRL_FLAG_DISABLED)))
data->controls |= 1 << i;
}
}