gstglcontext: micro optimization to gst_gl_context_thread_add

Invoke the callback right away when called on the context thread. Removes
overhead when nesting libgstgl calls (for example when working with the sync
meta).
This commit is contained in:
Alessandro Decina 2016-02-10 13:08:43 +11:00
parent 2b457a46a0
commit 2c0aca52a8

View file

@ -1489,8 +1489,10 @@ gst_gl_context_thread_add (GstGLContext * context,
g_return_if_fail (GST_IS_GL_CONTEXT (context)); g_return_if_fail (GST_IS_GL_CONTEXT (context));
g_return_if_fail (func != NULL); g_return_if_fail (func != NULL);
if (GST_IS_GL_WRAPPED_CONTEXT (context)) { if (GST_IS_GL_WRAPPED_CONTEXT (context))
g_return_if_fail (context->priv->active_thread == g_thread_self ()); g_return_if_fail (context->priv->active_thread == g_thread_self ());
if (context->priv->active_thread == g_thread_self ()) {
func (context, data); func (context, data);
return; return;
} }