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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/651>
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;
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;
}