From: Nicolas Dufresne Date: Sat, 3 Aug 2019 17:14:53 +0000 (-0400) Subject: gldownload: Wait on sync meta if any X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=747ae7d7693e4fc448f3b3229b44eaf9d85e4b04;p=platform%2Fupstream%2Fgst-plugins-base.git gldownload: Wait on sync meta if any This is possibly not strictly needed when pixels are being downloaded to CPU memory, but would cause issue when exporting DMABuf, as the data may not be yet ready when the DMABuf reaches the consumer. --- diff --git a/ext/gl/gstgldownloadelement.c b/ext/gl/gstgldownloadelement.c index 7541ae6..b7cf474 100644 --- a/ext/gl/gstgldownloadelement.c +++ b/ext/gl/gstgldownloadelement.c @@ -414,7 +414,15 @@ gst_gl_download_element_prepare_output_buffer (GstBaseTransform * bt, #if GST_GL_HAVE_PLATFORM_EGL && GST_GL_HAVE_DMABUF else if (dl->dmabuf_allocator) { GstBuffer *buffer = _try_export_dmabuf (dl, inbuf); + if (buffer) { + GstGLContext *context = GST_GL_BASE_FILTER (bt)->context; + GstGLSyncMeta *in_sync_meta; + + in_sync_meta = gst_buffer_get_gl_sync_meta (inbuf); + if (in_sync_meta) + gst_gl_sync_meta_wait (in_sync_meta, context); + if (GST_BASE_TRANSFORM_GET_CLASS (bt)->copy_metadata) if (!GST_BASE_TRANSFORM_GET_CLASS (bt)->copy_metadata (bt, inbuf, buffer)) {