glupload: Do not propose allocators with sysmem

None of the GL allocators actually offer a generic alloc() implementation. As a
side effect, they cannot be offered as they don't work with generic video
buffer pool.

Our specialized buffer pool can be dropped by tee or alphacombine as sharing the
same buffer pool over two branch is not supported by the pool API.

Fixes #3372

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6350>
This commit is contained in:
Nicolas Dufresne 2024-03-11 11:56:51 -04:00 committed by GStreamer Marge Bot
parent 44d4eb096d
commit 8c850dba9e

View file

@ -525,7 +525,7 @@ _gl_memory_upload_propose_allocation (gpointer impl, GstQuery * decide_query,
guint n_pools, i;
GstCaps *caps;
GstCapsFeatures *features_gl, *features_sys;
GstAllocator *allocator;
GstAllocator *allocator = NULL;
GstAllocationParams params;
gboolean use_sys_mem = FALSE;
const gchar *target_pool_option_str = NULL;
@ -567,20 +567,26 @@ _gl_memory_upload_propose_allocation (gpointer impl, GstQuery * decide_query,
gst_allocation_params_init (&params);
allocator =
GST_ALLOCATOR (gst_gl_memory_allocator_get_default (upload->
upload->context));
if (!use_sys_mem) {
allocator =
GST_ALLOCATOR (gst_gl_memory_allocator_get_default (upload->
upload->context));
}
gst_query_add_allocation_param (query, allocator, &params);
gst_object_unref (allocator);
gst_clear_object (&allocator);
#if GST_GL_HAVE_PLATFORM_EGL
if (upload->upload->context
&& gst_gl_context_get_gl_platform (upload->upload->context) ==
GST_GL_PLATFORM_EGL) {
allocator =
GST_ALLOCATOR (gst_allocator_find (GST_GL_MEMORY_EGL_ALLOCATOR_NAME));
if (!use_sys_mem) {
allocator =
GST_ALLOCATOR (gst_allocator_find (GST_GL_MEMORY_EGL_ALLOCATOR_NAME));
}
gst_query_add_allocation_param (query, allocator, &params);
gst_object_unref (allocator);
gst_clear_object (&allocator);
}
#endif