mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-23 09:04:15 +00:00
glcolorconvert: put GstGLSyncMeta on output buffers
allows thread safely using the provided output buffer in a separate thread
This commit is contained in:
parent
73c2ab70fc
commit
e7a10a2d44
2 changed files with 13 additions and 0 deletions
|
@ -1379,6 +1379,7 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)
|
||||||
const GstGLFuncs *gl = NULL;
|
const GstGLFuncs *gl = NULL;
|
||||||
GstGLWindow *window = NULL;
|
GstGLWindow *window = NULL;
|
||||||
gboolean do_redisplay;
|
gboolean do_redisplay;
|
||||||
|
GstGLSyncMeta *sync_meta;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_GLIMAGE_SINK (gl_sink));
|
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;
|
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 */
|
/* make sure that the environnement is clean */
|
||||||
gst_gl_context_clear_shader (gl_sink->context);
|
gst_gl_context_clear_shader (gl_sink->context);
|
||||||
|
|
||||||
|
|
|
@ -1560,6 +1560,14 @@ out:
|
||||||
convert->outbuf = NULL;
|
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;
|
convert->priv->result = res;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue