gldownload: use gst_gl_sync_meta_wait_cpu()
authorJakub Adam <jakub.adam@collabora.com>
Wed, 29 May 2024 17:12:21 +0000 (19:12 +0200)
committerBackport Bot <gitlab-backport-bot@gstreamer-foundation.org>
Tue, 1 Oct 2024 16:12:37 +0000 (17:12 +0100)
Simple gst_gl_sync_meta_wait() is not sufficient to ensure GL commands
are executed before dma-buf devices get to see the buffer.

This is the first step that should make the code behave correctly for
everybody, although there may be performance penalty. In the future we
should introduce a more general sync meta that would allow to move the
waiting from gldownload (the producer) to the sink elements (the
consumers).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7595>

subprojects/gst-plugins-base/ext/gl/gstgldownloadelement.c

index 1a3bb7eaa1c6ef376eb587b25932f338d87ada76..da1f1dc26bd1d67ce580848daa7e9b4ebbf27e02 100644 (file)
@@ -1240,7 +1240,7 @@ gst_gl_download_element_prepare_output_buffer (GstBaseTransform * bt,
   in_sync_meta = gst_buffer_get_gl_sync_meta (inbuf);
   if (in_sync_meta) {
     if (context) {
-      gst_gl_sync_meta_wait (in_sync_meta, context);
+      gst_gl_sync_meta_wait_cpu (in_sync_meta, context);
     } else if (dl->mode != GST_GL_DOWNLOAD_MODE_PASSTHROUGH) {
       GST_WARNING_OBJECT (dl, "No configured GL context in non-passthrough "
           "mode. Cannot wait on incoming `GstGLSyncMeta`");