diff options
author | hans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain> | 2009-06-05 16:02:40 +0200 |
---|---|---|
committer | hans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain> | 2009-06-05 16:02:40 +0200 |
commit | 5fefedb3c3a7a0ceaa161e4a3c1e180ba22cd364 (patch) | |
tree | 05ec6fcc2c3021b629aa683df00559119fc0d667 /v4l2-apps/libv4l/libv4lconvert | |
parent | 5999b7d164dbf3118a3a75ee3f6f0b48cb8845c1 (diff) | |
download | mediapointer-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/libv4l/libv4lconvert')
-rw-r--r-- | v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; } } |