v4l2videodec: Increase internal bitstream pool size

This patch will now set the maximum of buffers to 32, allowing to grow the
pool for drivers that supports that and will respect the minimum buffers
reported by the driver. This was made to fix a stall with the virtio CODEC
driver.

Fixes #672
This commit is contained in:
Nicolas Dufresne 2020-04-15 12:36:29 -04:00 committed by Nicolas Dufresne
parent d75ea5b340
commit 8e3184a213

View file

@ -621,8 +621,12 @@ gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder,
/* Ensure input internal pool is active */
if (!gst_buffer_pool_is_active (pool)) {
GstStructure *config = gst_buffer_pool_get_config (pool);
guint min = MAX (self->v4l2output->min_buffers,
GST_V4L2_MIN_BUFFERS (self->v4l2output));
guint max = VIDEO_MAX_FRAME;
gst_buffer_pool_config_set_params (config, self->input_state->caps,
self->v4l2output->info.size, 2, 2);
self->v4l2output->info.size, min, max);
/* There is no reason to refuse this config */
if (!gst_buffer_pool_set_config (pool, config))