v4l2videoenc: Make sure min_buffers is valid

When upstream does no use the v4l2videoenc pool, we need to activate
that internal pool. Though, we relied the driver to provide a minimum
required buffer, which Qualcomm Venus driver don't currently provide.

https://bugzilla.gnome.org/show_bug.cgi?id=783361
This commit is contained in:
Nicolas Dufresne 2017-06-02 14:01:17 -04:00
parent 18b53c2236
commit b9532fc6fb

View file

@ -514,9 +514,10 @@ gst_v4l2_video_enc_handle_frame (GstVideoEncoder * encoder,
/* 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);
gst_buffer_pool_config_set_params (config, self->input_state->caps,
self->v4l2output->info.size, self->v4l2output->min_buffers,
self->v4l2output->min_buffers);
self->v4l2output->info.size, min, min);
/* There is no reason to refuse this config */
if (!gst_buffer_pool_set_config (pool, config))