From: Nicolas Dufresne Date: Fri, 26 Jun 2020 17:11:04 +0000 (-0400) Subject: v4l2object: Only offer inactive pools and if needed X-Git-Tag: 1.19.3~509^2~517 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=85b9893e963ea5d342289e318daeefba35ff4a07;p=platform%2Fupstream%2Fgstreamer.git v4l2object: Only offer inactive pools and if needed Avoid offering a pool if it's not needed or if it's still active. This works around the fact the we only have one pool in V4L2. Part-of: --- diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index 0e2d922..eed4f1a 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -4980,7 +4980,7 @@ no_downstream_pool: gboolean gst_v4l2_object_propose_allocation (GstV4l2Object * obj, GstQuery * query) { - GstBufferPool *pool; + GstBufferPool *pool = NULL; /* we need at least 2 buffers to operate */ guint size, min, max; GstCaps *caps; @@ -4999,11 +4999,12 @@ gst_v4l2_object_propose_allocation (GstV4l2Object * obj, GstQuery * query) switch (obj->mode) { case GST_V4L2_IO_MMAP: case GST_V4L2_IO_DMABUF: - if ((pool = obj->pool)) - gst_object_ref (pool); + if (need_pool && obj->pool) { + if (!gst_buffer_pool_is_active (obj->pool)) + pool = gst_object_ref (obj->pool); + } break; default: - pool = NULL; break; }