guint size, min, max;
GstCaps *caps;
gboolean need_pool;
+ struct v4l2_control ctl = { 0, };
/* Set defaults allocation parameters */
size = obj->info.size;
gst_structure_free (config);
}
+ /* Some devices may expose a minimum */
+ ctl.id = V4L2_CID_MIN_BUFFERS_FOR_OUTPUT;
+ if (v4l2_ioctl (obj->video_fd, VIDIOC_G_CTRL, &ctl) >= 0) {
+ GST_DEBUG_OBJECT (obj->element, "driver require a miminum of %d buffers",
+ ctl.value);
+
+ min = MAX (ctl.value, GST_V4L2_MIN_BUFFERS);
+ }
+
gst_query_add_allocation_pool (query, pool, size, min, max);
/* we also support various metadata */