mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-08 23:42:28 +00:00
v4l2src: handle old and odd driver behaviour when listing controls
This commit is contained in:
parent
7a65277119
commit
43a9c7652b
1 changed files with 6 additions and 2 deletions
|
@ -257,6 +257,7 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
|
||||||
if (!next)
|
if (!next)
|
||||||
n++;
|
n++;
|
||||||
|
|
||||||
|
retry:
|
||||||
/* when we reached the last official CID, continue with private CIDs */
|
/* when we reached the last official CID, continue with private CIDs */
|
||||||
if (n == V4L2_CID_LASTP1) {
|
if (n == V4L2_CID_LASTP1) {
|
||||||
GST_DEBUG_OBJECT (e, "checking private CIDs");
|
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.");
|
GST_DEBUG_OBJECT (e, "V4L2_CTRL_FLAG_NEXT_CTRL not supported.");
|
||||||
next = 0;
|
next = 0;
|
||||||
n = V4L2_CID_BASE;
|
n = V4L2_CID_BASE;
|
||||||
continue;
|
goto retry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (errno == EINVAL || errno == ENOTTY || errno == EIO || errno == ENOENT) {
|
if (errno == EINVAL || errno == ENOTTY || errno == EIO || errno == ENOENT) {
|
||||||
|
@ -292,6 +293,9 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* 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;
|
n = control.id;
|
||||||
if (control.flags & V4L2_CTRL_FLAG_DISABLED) {
|
if (control.flags & V4L2_CTRL_FLAG_DISABLED) {
|
||||||
GST_DEBUG_OBJECT (e, "skipping disabled control");
|
GST_DEBUG_OBJECT (e, "skipping disabled control");
|
||||||
|
|
Loading…
Reference in a new issue