&max_buffers))
goto wrong_config;
- /* TODO Also consider min_buffers_for_output when implemented */
- min_latency = MAX (GST_V4L2_MIN_BUFFERS, obj->min_buffers_for_capture);
+ if (V4L2_TYPE_IS_OUTPUT (obj->type))
+ min_latency = MAX (GST_V4L2_MIN_BUFFERS, obj->min_buffers_for_output);
+ else
+ min_latency = MAX (GST_V4L2_MIN_BUFFERS, obj->min_buffers_for_capture);
switch (obj->mode) {
case GST_V4L2_IO_RW:
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);
+ obj->min_buffers_for_output = ctl.value;
+ } else {
+ obj->min_buffers_for_output = 0;
}
+ min = MAX (obj->min_buffers_for_output, GST_V4L2_MIN_BUFFERS);
+
gst_query_add_allocation_pool (query, pool, size, min, max);
/* we also support various metadata */
* calculate the minimum latency of a m2m decoder. */
guint32 min_buffers_for_capture;
+ /* This will be set if supported in propose allocation. */
+ guint32 min_buffers_for_output;
+
/* wanted mode */
GstV4l2IOMode req_mode;