gtkglsink: expose the created display and context correctly

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.
This commit is contained in:
Matthew Waters 2017-09-01 15:00:12 +10:00
parent a4d74fda9a
commit 38b5a9bf33
2 changed files with 7 additions and 0 deletions

View file

@ -166,6 +166,9 @@ gst_gtk_gl_sink_start (GstBaseSink * bsink)
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;
}

View file

@ -515,12 +515,16 @@ gtk_gst_gl_widget_init_winsys (GtkGstGLWidget * gst_widget)
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;