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.
This commit is contained in:
Matthew Waters 2014-09-23 12:02:18 +10:00 committed by Tim-Philipp Müller
parent 14630fac38
commit ccf8f014f0

View file

@ -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,