From dfb0ec6d4dd5ebdc6d87c486aea42188d8af6252 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Thu, 19 Feb 2015 23:08:34 -0500 Subject: [PATCH] v4l2bufferpool: Update allocator flags When we hit emulated formats, we disable CREATE_BUFS since libv4l2 cope very badly with it. Also clear the allocator flags so we will never try to allocate more buffers. This fixes failure when the copy threshold is reached as we where calling CREATE_BUFS, which lead to libv4l2 instability. --- sys/v4l2/gstv4l2bufferpool.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c index d0f985b57a..e782c157d2 100644 --- a/sys/v4l2/gstv4l2bufferpool.c +++ b/sys/v4l2/gstv4l2bufferpool.c @@ -490,6 +490,10 @@ gst_v4l2_buffer_pool_set_config (GstBufferPool * bpool, GstStructure * config) GST_WARNING_OBJECT (pool, "libv4l2 converter detected, disabling CREATE_BUFS"); can_allocate = FALSE; + GST_OBJECT_FLAG_UNSET (pool->vallocator, + GST_V4L2_ALLOCATOR_FLAG_MMAP_CREATE_BUFS + | GST_V4L2_ALLOCATOR_FLAG_USERPTR_CREATE_BUFS + | GST_V4L2_ALLOCATOR_FLAG_DMABUF_CREATE_BUFS); } if (min_buffers < GST_V4L2_MIN_BUFFERS) {