glcolorconvert: put GstGLSyncMeta on output buffers

allows thread safely using the provided output buffer in a separate
thread
This commit is contained in:
Matthew Waters 2015-02-03 13:32:47 +11:00 committed by Tim-Philipp Müller
parent f180fe8dc8
commit 68dc0fef6d
2 changed files with 13 additions and 0 deletions

View file

@ -1379,6 +1379,7 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)
const GstGLFuncs *gl = NULL;
GstGLWindow *window = NULL;
gboolean do_redisplay;
GstGLSyncMeta *sync_meta;
g_return_if_fail (GST_IS_GLIMAGE_SINK (gl_sink));
@ -1407,6 +1408,10 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)
gl_sink->caps_change = FALSE;
}
sync_meta = gst_buffer_get_gl_sync_meta (gl_sink->stored_buffer);
if (sync_meta)
gst_gl_sync_meta_wait (sync_meta);
/* make sure that the environnement is clean */
gst_gl_context_clear_shader (gl_sink->context);

View file

@ -1560,6 +1560,14 @@ out:
convert->outbuf = NULL;
}
if (convert->outbuf) {
GstGLSyncMeta *sync_meta =
gst_buffer_add_gl_sync_meta (convert->context, convert->outbuf);
if (sync_meta)
gst_gl_sync_meta_set_sync_point (sync_meta, convert->context);
}
convert->priv->result = res;
return;
}