glmixer: Add GL_SYNC_META option to bufferpool

when pipline is
glvideomixerelement->glcolorconvertelement->gldownloadelement and
glcolorconvertelement is not passthrough, the gl bufferpool between
glvideomixerelement and glcolorconvertelement will not add gl sync meta
during allocating buffer. This will cause that glcolorconvert's inbuf
has no sync meta to wait for.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6784>
This commit is contained in:
Shengqi Yu 2024-04-29 15:25:28 +08:00 committed by Backport Bot
parent 204ba57e81
commit f74bdaf4d5
2 changed files with 9 additions and 3 deletions

View file

@ -23,6 +23,7 @@
#endif
#include <gst/gl/gl.h>
#include <gst/gl/gstglfuncs.h>
#if GST_GL_HAVE_PLATFORM_EGL && GST_GL_HAVE_DMABUF
#include <gst/gl/egl/gsteglimage.h>
#include <gst/allocators/gstdmabuf.h>
@ -1454,13 +1455,15 @@ gst_gl_download_element_propose_allocation (GstBaseTransform * bt,
size = info.size;
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
gst_buffer_pool_config_set_gl_min_free_queue_size (config, 1);
gst_buffer_pool_config_add_option (config,
GST_BUFFER_POOL_OPTION_GL_SYNC_META);
if (!gst_buffer_pool_set_config (pool, config)) {
gst_object_unref (pool);
goto config_failed;
}
if (context->gl_vtable->FenceSync)
gst_query_add_allocation_meta (query, GST_GL_SYNC_META_API_TYPE, NULL);
gst_query_add_allocation_pool (query, pool, size, 1, 0);
gst_object_unref (pool);

View file

@ -239,7 +239,7 @@ gst_gl_mixer_propose_allocation (GstAggregator * agg,
/* we also support various metadata */
if (context->gl_vtable->FenceSync)
gst_query_add_allocation_meta (query, GST_GL_SYNC_META_API_TYPE, 0);
gst_query_add_allocation_meta (query, GST_GL_SYNC_META_API_TYPE, NULL);
return TRUE;
@ -644,6 +644,9 @@ gst_gl_mixer_decide_allocation (GstAggregator * agg, GstQuery * query)
gst_buffer_pool_config_set_params (config, caps, size, min, max);
gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META);
if (gst_query_find_allocation_meta (query, GST_GL_SYNC_META_API_TYPE, NULL))
gst_buffer_pool_config_add_option (config,
GST_BUFFER_POOL_OPTION_GL_SYNC_META);
gst_buffer_pool_set_config (pool, config);