summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2015-06-05 15:32:10 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2015-06-05 15:34:12 -0400
commit0196fdb5ec918a5fa9f8be3090f6e1c76baefccc (patch)
tree7b6dd0f0cef35150ed868c371c1c0659e4f8af2d /sys
parentd650a310da7768f775080278b9e0c5d26f95a2ab (diff)
downloadgstreamer-plugins-good-0196fdb5ec918a5fa9f8be3090f6e1c76baefccc.tar.gz
v4l2: Don't warn when optional CID are not implement
gst_v4l2_get_attributre() shall only be used when the CID is expected to be supported. Otherwise, we get unwanted warning posted to the bus.
Diffstat (limited to 'sys')
-rw-r--r--sys/v4l2/gstv4l2object.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
index 816b42c91..d76b9a2c6 100644
--- a/sys/v4l2/gstv4l2object.c
+++ b/sys/v4l2/gstv4l2object.c
@@ -723,20 +723,19 @@ gst_v4l2_object_get_property_helper (GstV4l2Object * v4l2object,
static void
gst_v4l2_get_driver_min_buffers (GstV4l2Object * v4l2object)
{
- int min;
- gboolean ret = FALSE;
+ struct v4l2_control control = { 0, };
+
+ g_return_if_fail (GST_V4L2_IS_OPEN (v4l2object));
- /* Certain driver may expose a minimum number of buffers through controls. */
- /* If the ioctl is not supported by the driver, min_buffers remains zero. */
- ret = gst_v4l2_get_attribute (v4l2object,
- V4L2_TYPE_IS_OUTPUT (v4l2object->type)
- ? V4L2_CID_MIN_BUFFERS_FOR_OUTPUT : V4L2_CID_MIN_BUFFERS_FOR_CAPTURE,
- &min);
+ if (V4L2_TYPE_IS_OUTPUT (v4l2object->type))
+ control.id = V4L2_CID_MIN_BUFFERS_FOR_OUTPUT;
+ else
+ control.id = V4L2_CID_MIN_BUFFERS_FOR_CAPTURE;
- if (ret) {
+ if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_G_CTRL, &control) == 0) {
GST_DEBUG_OBJECT (v4l2object->element,
- "driver requires a minimum of %d buffers", min);
- v4l2object->min_buffers = min;
+ "driver requires a minimum of %d buffers", control.value);
+ v4l2object->min_buffers = control.value;
} else {
v4l2object->min_buffers = 0;
}