1. Propagate the GstGLDisplay we create
2. Add the created GstGLContext to the propagated GstGLDisplay
Otherwise with multi-branch GL pipelines involving gtkglsink, things
will fall apart and errors will be genarated somewhere.
if (!gtk_sink->display || !gtk_sink->context || !gtk_sink->gtk_context)
return FALSE;
+ gst_gl_element_propagate_display_context (GST_ELEMENT (bsink),
+ gtk_sink->display);
+
return TRUE;
}
return FALSE;
}
+ GST_OBJECT_LOCK (priv->display);
if (!gst_gl_display_create_context (priv->display, priv->other_context,
&priv->context, &error)) {
g_clear_error (&error);
+ GST_OBJECT_UNLOCK (priv->display);
GTK_GST_BASE_WIDGET_UNLOCK (gst_widget);
return FALSE;
}
+ gst_gl_display_add_context (priv->display, priv->context);
+ GST_OBJECT_UNLOCK (priv->display);
GTK_GST_BASE_WIDGET_UNLOCK (gst_widget);
return TRUE;