mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
gtkglsink: reset the context/display in READY_TO_NULL
Fixes context propagation in pipelines with upstream GL elements.
This commit is contained in:
parent
5beeccdba2
commit
d99b7d4219
1 changed files with 14 additions and 23 deletions
|
@ -133,32 +133,11 @@ gst_gtk_gl_sink_set_property (GObject * object, guint prop_id,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_reset (GstGtkGLSink * gtk_sink)
|
||||
{
|
||||
if (gtk_sink->display) {
|
||||
gst_object_unref (gtk_sink->display);
|
||||
gtk_sink->display = NULL;
|
||||
}
|
||||
|
||||
if (gtk_sink->context) {
|
||||
gst_object_unref (gtk_sink->context);
|
||||
gtk_sink->context = NULL;
|
||||
}
|
||||
|
||||
if (gtk_sink->gtk_context) {
|
||||
gst_object_unref (gtk_sink->gtk_context);
|
||||
gtk_sink->gtk_context = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gtk_gl_sink_finalize (GObject * object)
|
||||
{
|
||||
GstGtkGLSink *gtk_sink = GST_GTK_GL_SINK (object);;
|
||||
|
||||
_reset (gtk_sink);
|
||||
|
||||
g_object_unref (gtk_sink->widget);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
|
@ -316,6 +295,20 @@ gst_gtk_gl_sink_change_state (GstElement * element, GstStateChange transition)
|
|||
gtk_gst_gl_widget_set_buffer (gtk_sink->widget, NULL);
|
||||
break;
|
||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||
if (gtk_sink->display) {
|
||||
gst_object_unref (gtk_sink->display);
|
||||
gtk_sink->display = NULL;
|
||||
}
|
||||
|
||||
if (gtk_sink->context) {
|
||||
gst_object_unref (gtk_sink->context);
|
||||
gtk_sink->context = NULL;
|
||||
}
|
||||
|
||||
if (gtk_sink->gtk_context) {
|
||||
gst_object_unref (gtk_sink->gtk_context);
|
||||
gtk_sink->gtk_context = NULL;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -354,8 +347,6 @@ gst_gtk_gl_sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
|
|||
|
||||
GST_DEBUG ("set caps with %" GST_PTR_FORMAT, caps);
|
||||
|
||||
_reset (gtk_sink);
|
||||
|
||||
if (!gst_video_info_from_caps (>k_sink->v_info, caps))
|
||||
return FALSE;
|
||||
|
||||
|
|
Loading…
Reference in a new issue