mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 04:56:24 +00:00
v4l2bufferpool: Update pool limit with hardware requiremenst
If the driver need more buffers than requested by the config, update the pool min/max values. The minimum value for the pool could be provided either by the driver or by the pool. This is best effort for drivers that don't support CID V4L2_CID_MIN_BUFFERS_FOR_CAPTURE. https://bugzilla.gnome.org/show_bug.cgi?id=730200
This commit is contained in:
parent
541a9670d2
commit
0d852cf235
1 changed files with 8 additions and 5 deletions
|
@ -668,8 +668,8 @@ gst_v4l2_buffer_pool_start (GstBufferPool * bpool)
|
||||||
copy_threshold =
|
copy_threshold =
|
||||||
MAX (GST_V4L2_MIN_BUFFERS, obj->min_buffers_for_capture);
|
MAX (GST_V4L2_MIN_BUFFERS, obj->min_buffers_for_capture);
|
||||||
|
|
||||||
/* Ensure GstBufferPool don't expect initial minimum */
|
/* The initial minimum could be provide either by GstBufferPool or
|
||||||
if (min_buffers > count)
|
* driver needs. */
|
||||||
min_buffers = count;
|
min_buffers = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -696,7 +696,7 @@ gst_v4l2_buffer_pool_start (GstBufferPool * bpool)
|
||||||
goto no_buffers;
|
goto no_buffers;
|
||||||
}
|
}
|
||||||
|
|
||||||
num_buffers = count;
|
min_buffers = num_buffers = count;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GST_V4L2_IO_DMABUF_IMPORT:
|
case GST_V4L2_IO_DMABUF_IMPORT:
|
||||||
|
@ -720,7 +720,7 @@ gst_v4l2_buffer_pool_start (GstBufferPool * bpool)
|
||||||
goto no_buffers;
|
goto no_buffers;
|
||||||
}
|
}
|
||||||
|
|
||||||
num_buffers = count;
|
min_buffers = num_buffers = count;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -735,6 +735,9 @@ gst_v4l2_buffer_pool_start (GstBufferPool * bpool)
|
||||||
pool->num_buffers = num_buffers;
|
pool->num_buffers = num_buffers;
|
||||||
pool->num_queued = 0;
|
pool->num_queued = 0;
|
||||||
|
|
||||||
|
if (max_buffers < min_buffers)
|
||||||
|
max_buffers = min_buffers;
|
||||||
|
|
||||||
gst_buffer_pool_config_set_params (config, caps, size, min_buffers,
|
gst_buffer_pool_config_set_params (config, caps, size, min_buffers,
|
||||||
max_buffers);
|
max_buffers);
|
||||||
GST_BUFFER_POOL_CLASS (parent_class)->set_config (bpool, config);
|
GST_BUFFER_POOL_CLASS (parent_class)->set_config (bpool, config);
|
||||||
|
|
Loading…
Reference in a new issue