Commit c1c858f2 authored by Gary Ching-Pang Lin's avatar Gary Ching-Pang Lin Committed by Tim-Philipp Müller
Browse files

v4l2src: failure to query some optional controls is not a fatal error

Don't post a (fatal) error message on the bus just because we
failed to query some control. Fixes issue with built-in
Suyin Corp webcam for HP notebook (usbid 064e:e28a) on
OpenSuse 12.1, where querying red/blue balance fails.

https://bugzilla.gnome.org/show_bug.cgi?id=670197
parent ef37bb48
...@@ -253,7 +253,7 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object) ...@@ -253,7 +253,7 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
control.id = n; control.id = n;
if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_QUERYCTRL, &control) < 0) { if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_QUERYCTRL, &control) < 0) {
if (errno == EINVAL || errno == ENOTTY) { if (errno == EINVAL || errno == ENOTTY || errno == EIO) {
if (n < V4L2_CID_PRIVATE_BASE) { if (n < V4L2_CID_PRIVATE_BASE) {
GST_DEBUG_OBJECT (e, "skipping control %08x", n); GST_DEBUG_OBJECT (e, "skipping control %08x", n);
/* continue so that we also check private controls */ /* continue so that we also check private controls */
...@@ -263,12 +263,9 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object) ...@@ -263,12 +263,9 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
break; break;
} }
} else { } else {
GST_ELEMENT_ERROR (e, RESOURCE, SETTINGS, GST_WARNING_OBJECT (e, "Failed querying control %d on device '%s'. "
(_("Failed getting controls attributes on device '%s'."), "(%d - %s)", n, v4l2object->videodev, errno, strerror (errno));
v4l2object->videodev), continue;
("Failed querying control %d on device '%s'. (%d - %s)",
n, v4l2object->videodev, errno, strerror (errno)));
return FALSE;
} }
} }
if (control.flags & V4L2_CTRL_FLAG_DISABLED) { if (control.flags & V4L2_CTRL_FLAG_DISABLED) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment