mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 15:48:23 +00:00
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.
This commit is contained in:
parent
d650a310da
commit
0196fdb5ec
1 changed files with 10 additions and 11 deletions
|
@ -723,20 +723,19 @@ gst_v4l2_object_get_property_helper (GstV4l2Object * v4l2object,
|
||||||
static void
|
static void
|
||||||
gst_v4l2_get_driver_min_buffers (GstV4l2Object * v4l2object)
|
gst_v4l2_get_driver_min_buffers (GstV4l2Object * v4l2object)
|
||||||
{
|
{
|
||||||
int min;
|
struct v4l2_control control = { 0, };
|
||||||
gboolean ret = FALSE;
|
|
||||||
|
|
||||||
/* Certain driver may expose a minimum number of buffers through controls. */
|
g_return_if_fail (GST_V4L2_IS_OPEN (v4l2object));
|
||||||
/* 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 (ret) {
|
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 (v4l2_ioctl (v4l2object->video_fd, VIDIOC_G_CTRL, &control) == 0) {
|
||||||
GST_DEBUG_OBJECT (v4l2object->element,
|
GST_DEBUG_OBJECT (v4l2object->element,
|
||||||
"driver requires a minimum of %d buffers", min);
|
"driver requires a minimum of %d buffers", control.value);
|
||||||
v4l2object->min_buffers = min;
|
v4l2object->min_buffers = control.value;
|
||||||
} else {
|
} else {
|
||||||
v4l2object->min_buffers = 0;
|
v4l2object->min_buffers = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue