summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2017-09-01 15:00:12 +1000
committerMatthew Waters <matthew@centricular.com>2017-09-05 21:16:33 +1000
commit38b5a9bf3396720c615d63d8ec420e206a70964d (patch)
tree8e209f024efc758d1136852cbeea59099c492192 /ext
parenta4d74fda9a1a279fdf27534a53634095cc094c09 (diff)
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.
Diffstat (limited to 'ext')
-rw-r--r--ext/gtk/gstgtkglsink.c3
-rw-r--r--ext/gtk/gtkgstglwidget.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/ext/gtk/gstgtkglsink.c b/ext/gtk/gstgtkglsink.c
index 39b54faf8..d9d389b36 100644
--- a/ext/gtk/gstgtkglsink.c
+++ b/ext/gtk/gstgtkglsink.c
@@ -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;
}
diff --git a/ext/gtk/gtkgstglwidget.c b/ext/gtk/gtkgstglwidget.c
index 2423afca0..cfad4f175 100644
--- a/ext/gtk/gtkgstglwidget.c
+++ b/ext/gtk/gtkgstglwidget.c
@@ -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;