summaryrefslogtreecommitdiff
path: root/sys/v4l2/gstv4l2videoenc.c
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2017-06-02 14:01:17 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2017-06-05 10:55:28 -0400
commitb9532fc6fb94293505cf14441f14009cf9250975 (patch)
treefc85fb2cf1cdb6fd20e2286da04f27100de3a877 /sys/v4l2/gstv4l2videoenc.c
parent18b53c223647e86a91eccbac4563aa906030cc05 (diff)
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
Diffstat (limited to 'sys/v4l2/gstv4l2videoenc.c')
-rw-r--r--sys/v4l2/gstv4l2videoenc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/v4l2/gstv4l2videoenc.c b/sys/v4l2/gstv4l2videoenc.c
index e0e8e0030..24595ae2d 100644
--- a/sys/v4l2/gstv4l2videoenc.c
+++ b/sys/v4l2/gstv4l2videoenc.c
@@ -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))