From f9941b135f258c13dc0ab5486521d8d9d4a2d7be Mon Sep 17 00:00:00 2001 From: Jakub Adam Date: Thu, 10 Apr 2025 13:48:58 +0200 Subject: [PATCH] gldmabufferpool: disable "free cache" workaround in GstGLBufferPool This pool isn't reusing its buffers, which makes it pointless to enable the cache Holding an extra buffer in free queue can also lead to a deadlock when the pool's max buffer count is configured low (commonly 2). Part-of: --- .../gst-plugins-base/ext/gl/gstgldmabufbufferpool.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/subprojects/gst-plugins-base/ext/gl/gstgldmabufbufferpool.c b/subprojects/gst-plugins-base/ext/gl/gstgldmabufbufferpool.c index 4718dca777..cc9fbf65be 100644 --- a/subprojects/gst-plugins-base/ext/gl/gstgldmabufbufferpool.c +++ b/subprojects/gst-plugins-base/ext/gl/gstgldmabufbufferpool.c @@ -112,6 +112,14 @@ gst_gl_dmabuf_buffer_pool_set_config (GstBufferPool * pool, g_clear_pointer (&glparams, gst_gl_allocation_params_free); } + /* + * This pool isn't reusing its buffers, which makes it pointless to enable + * "free cache" workaround in GstGLBufferPool base class. Holding an extra + * buffer in free queue can also lead to a deadlock when the pool's max buffer + * count is configured low (commonly 2). + */ + gst_buffer_pool_config_set_gl_min_free_queue_size (config, 0); + self->priv->add_glsyncmeta = gst_buffer_pool_config_has_option (config, GST_BUFFER_POOL_OPTION_GL_SYNC_META);