mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-07-28 01:05:07 +00:00
glbasefilter: Unref other context in finalize, and display in READY->NULL
https://bugzilla.gnome.org/show_bug.cgi?id=748405
This commit is contained in:
parent
4e05044734
commit
db3bd840b9
|
@ -56,6 +56,7 @@ static void gst_gl_base_filter_set_property (GObject * object, guint prop_id,
|
||||||
const GValue * value, GParamSpec * pspec);
|
const GValue * value, GParamSpec * pspec);
|
||||||
static void gst_gl_base_filter_get_property (GObject * object, guint prop_id,
|
static void gst_gl_base_filter_get_property (GObject * object, guint prop_id,
|
||||||
GValue * value, GParamSpec * pspec);
|
GValue * value, GParamSpec * pspec);
|
||||||
|
static void gst_gl_base_filter_finalize (GObject * object);
|
||||||
|
|
||||||
static void gst_gl_base_filter_set_context (GstElement * element,
|
static void gst_gl_base_filter_set_context (GstElement * element,
|
||||||
GstContext * context);
|
GstContext * context);
|
||||||
|
@ -88,6 +89,7 @@ gst_gl_base_filter_class_init (GstGLBaseFilterClass * klass)
|
||||||
|
|
||||||
gobject_class->set_property = gst_gl_base_filter_set_property;
|
gobject_class->set_property = gst_gl_base_filter_set_property;
|
||||||
gobject_class->get_property = gst_gl_base_filter_get_property;
|
gobject_class->get_property = gst_gl_base_filter_get_property;
|
||||||
|
gobject_class->finalize = gst_gl_base_filter_finalize;
|
||||||
|
|
||||||
GST_BASE_TRANSFORM_CLASS (klass)->query = gst_gl_base_filter_query;
|
GST_BASE_TRANSFORM_CLASS (klass)->query = gst_gl_base_filter_query;
|
||||||
GST_BASE_TRANSFORM_CLASS (klass)->start = gst_gl_base_filter_start;
|
GST_BASE_TRANSFORM_CLASS (klass)->start = gst_gl_base_filter_start;
|
||||||
|
@ -115,6 +117,19 @@ gst_gl_base_filter_init (GstGLBaseFilter * filter)
|
||||||
filter->priv = GST_GL_BASE_FILTER_GET_PRIVATE (filter);
|
filter->priv = GST_GL_BASE_FILTER_GET_PRIVATE (filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_gl_base_filter_finalize (GObject * object)
|
||||||
|
{
|
||||||
|
GstGLBaseFilter *filter = GST_GL_BASE_FILTER (object);
|
||||||
|
|
||||||
|
if (filter->priv->other_context) {
|
||||||
|
gst_object_unref (filter->priv->other_context);
|
||||||
|
filter->priv->other_context = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (gst_gl_base_filter_parent_class)->finalize (object);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_gl_base_filter_set_property (GObject * object, guint prop_id,
|
gst_gl_base_filter_set_property (GObject * object, guint prop_id,
|
||||||
const GValue * value, GParamSpec * pspec)
|
const GValue * value, GParamSpec * pspec)
|
||||||
|
@ -273,16 +288,6 @@ gst_gl_base_filter_reset (GstGLBaseFilter * filter)
|
||||||
gst_object_unref (filter->context);
|
gst_object_unref (filter->context);
|
||||||
filter->context = NULL;
|
filter->context = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filter->display) {
|
|
||||||
gst_object_unref (filter->display);
|
|
||||||
filter->display = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (filter->priv->other_context) {
|
|
||||||
gst_object_unref (filter->priv->other_context);
|
|
||||||
filter->priv->other_context = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -418,6 +423,12 @@ gst_gl_base_filter_change_state (GstElement * element,
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||||
|
if (filter->display) {
|
||||||
|
gst_object_unref (filter->display);
|
||||||
|
filter->display = NULL;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue