gldownload: use gst_gl_sync_meta_wait_cpu()

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/6968>
This commit is contained in:
Jakub Adam 2024-05-29 19:12:21 +02:00 committed by GStreamer Marge Bot
parent 5d2421b8c8
commit c56a87b73d

View 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`");