From d03bcba3db15d06dbdea6b776a6f28ed2f03272a Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Tue, 8 Jul 2014 17:50:47 -0400 Subject: [PATCH] v4l2bufferpool: Workaround elements not requesting any buffers This is a workaround for element that don't request buffers when they should. https://bugzilla.gnome.org/show_bug.cgi?id=732288 --- sys/v4l2/gstv4l2bufferpool.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c index b3a3b80067..f5e3bbc267 100644 --- a/sys/v4l2/gstv4l2bufferpool.c +++ b/sys/v4l2/gstv4l2bufferpool.c @@ -718,6 +718,12 @@ gst_v4l2_buffer_pool_start (GstBufferPool * bpool) else max_latency = min_buffers; + /* FIXME Encoder don't negotiate amount of buffers. If we can't grow the + * pool, or the minimum is at V4L2 maximum, enabled copy on threshold + * https://bugzilla.gnome.org/show_bug.cgi?id=732288 */ + if (!can_allocate || min_buffers == VIDEO_MAX_FRAME) + copy_threshold = min_latency; + pool->size = size; pool->copy_threshold = copy_threshold; pool->max_latency = max_latency;