summaryrefslogtreecommitdiff
path: root/sys/v4l2/v4l2_calls.c
diff options
context:
space:
mode:
authorMark Nauwelaerts <mnauw@users.sourceforge.net>2014-02-22 21:31:21 +0100
committerMark Nauwelaerts <mnauw@users.sourceforge.net>2014-02-22 21:31:43 +0100
commit43a9c7652bed2b2a9d544d82b574d84a36267fa5 (patch)
tree65ee4f4267a3eb854d5ba8b65cca9aa1ad68d4cc /sys/v4l2/v4l2_calls.c
parent7a652771195f11141e094e15aa7c3f8eda016baa (diff)
v4l2src: handle old and odd driver behaviour when listing controls
Diffstat (limited to 'sys/v4l2/v4l2_calls.c')
-rw-r--r--sys/v4l2/v4l2_calls.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c
index 986df76af..4e71fbeec 100644
--- a/sys/v4l2/v4l2_calls.c
+++ b/sys/v4l2/v4l2_calls.c
@@ -257,6 +257,7 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
if (!next)
n++;
+ retry:
/* when we reached the last official CID, continue with private CIDs */
if (n == V4L2_CID_LASTP1) {
GST_DEBUG_OBJECT (e, "checking private CIDs");
@@ -274,7 +275,7 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
GST_DEBUG_OBJECT (e, "V4L2_CTRL_FLAG_NEXT_CTRL not supported.");
next = 0;
n = V4L2_CID_BASE;
- continue;
+ goto retry;
}
}
if (errno == EINVAL || errno == ENOTTY || errno == EIO || errno == ENOENT) {
@@ -292,7 +293,10 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
continue;
}
}
- n = control.id;
+ /* bogus driver might mess with id in unexpected ways (e.g. set to 0), so
+ * make sure to simply try all if V4L2_CTRL_FLAG_NEXT_CTRL not supported */
+ if (next)
+ n = control.id;
if (control.flags & V4L2_CTRL_FLAG_DISABLED) {
GST_DEBUG_OBJECT (e, "skipping disabled control");
continue;