From 82a3a34475ed56c26a0d168e2bd478bc51f89564 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Tue, 23 Sep 2014 12:02:18 +1000 Subject: [PATCH] glupload: fallback to upload if contexts cannot share GL resources Fixes pipelines of the form gleffects ! tee ! glimagesink as tee does not pass on the allocation query. --- gst-libs/gst/gl/gstglupload.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c index 2a80647775..7cbdbdbcf0 100644 --- a/gst-libs/gst/gl/gstglupload.c +++ b/gst-libs/gst/gl/gstglupload.c @@ -252,6 +252,11 @@ gst_gl_upload_perform_with_buffer (GstGLUpload * upload, GstBuffer * buffer, mem = gst_buffer_peek_memory (buffer, 0); if (gst_is_gl_memory (mem)) { + GstGLMemory *gl_mem = (GstGLMemory *) gst_buffer_peek_memory (buffer, 0); + + if (!gst_gl_context_can_share (upload->context, gl_mem->context)) + goto raw_data_upload; + if (GST_VIDEO_INFO_FORMAT (&upload->in_info) == GST_VIDEO_FORMAT_RGBA) { GstMapInfo map_info; @@ -312,6 +317,7 @@ gst_gl_upload_perform_with_buffer (GstGLUpload * upload, GstBuffer * buffer, } } +raw_data_upload: GST_LOG_OBJECT (upload, "Attempting upload with raw data"); /* GstVideoMeta map */ if (!gst_video_frame_map (&upload->priv->frame, &upload->in_info, buffer,