Commit 5b499dec authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

gst-libs/gst/audio/gstaudiofilter.c: Clear our formats structure and free the...

gst-libs/gst/audio/gstaudiofilter.c: Clear our formats structure and free the caps contained in it when shutting down.

Original commit message from CVS:
* gst-libs/gst/audio/gstaudiofilter.c:
(gst_audio_filter_class_init), (gst_audio_filter_change_state):
Clear our formats structure and free the caps contained in it when
shutting down.
parent 451ff2f9
2007-02-06 Tim-Philipp Müller <tim at centricular dot net>
* gst-libs/gst/audio/gstaudiofilter.c:
(gst_audio_filter_class_init), (gst_audio_filter_change_state):
Clear our formats structure and free the caps contained in it when
shutting down.
2007-02-05 Andy Wingo <wingo@pobox.com> 2007-02-05 Andy Wingo <wingo@pobox.com>
   
* gst-libs/gst/audio/gstbaseaudiosink.c * gst-libs/gst/audio/gstbaseaudiosink.c
...@@ -61,7 +61,8 @@ GST_ELEMENT_DETAILS ("Audio filter base class", ...@@ -61,7 +61,8 @@ GST_ELEMENT_DETAILS ("Audio filter base class",
static void gst_audio_filter_base_init (gpointer g_class); static void gst_audio_filter_base_init (gpointer g_class);
static void gst_audio_filter_class_init (gpointer g_class, gpointer class_data); static void gst_audio_filter_class_init (gpointer g_class, gpointer class_data);
static void gst_audio_filter_init (GTypeInstance * instance, gpointer g_class); static void gst_audio_filter_init (GTypeInstance * instance, gpointer g_class);
static GstStateChangeReturn gst_audio_filter_change_state (GstElement * element,
GstStateChange transition);
static gboolean gst_audio_filter_set_caps (GstBaseTransform * btrans, static gboolean gst_audio_filter_set_caps (GstBaseTransform * btrans,
GstCaps * incaps, GstCaps * outcaps); GstCaps * incaps, GstCaps * outcaps);
...@@ -106,21 +107,59 @@ static void ...@@ -106,21 +107,59 @@ static void
gst_audio_filter_class_init (gpointer klass, gpointer class_data) gst_audio_filter_class_init (gpointer klass, gpointer class_data)
{ {
GstBaseTransformClass *basetrans_class; GstBaseTransformClass *basetrans_class;
GstElementClass *gstelement_class;
parent_class = g_type_class_peek_parent (klass); parent_class = g_type_class_peek_parent (klass);
gstelement_class = (GstElementClass *) klass;
basetrans_class = (GstBaseTransformClass *) klass; basetrans_class = (GstBaseTransformClass *) klass;
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_audio_filter_change_state);
basetrans_class->set_caps = GST_DEBUG_FUNCPTR (gst_audio_filter_set_caps); basetrans_class->set_caps = GST_DEBUG_FUNCPTR (gst_audio_filter_set_caps);
} }
static void static void
gst_audio_filter_init (GTypeInstance * instance, gpointer g_class) gst_audio_filter_init (GTypeInstance * instance, gpointer g_class)
{ {
GstAudioFilter *filter = GST_AUDIO_FILTER (instance); /* nothing to do here */
}
/* we override the state change vfunc here instead of GstBaseTransform's stop
* vfunc, so GstAudioFilter-derived elements can override ::stop() for their
* own purposes without having to worry about chaining up */
static GstStateChangeReturn
gst_audio_filter_change_state (GstElement * element, GstStateChange transition)
{
GstStateChangeReturn ret;
GstAudioFilter *filter;
filter = GST_AUDIO_FILTER (element);
/* to make gst_buffer_spec_parse_caps() happy, not used in our case */ switch (transition) {
filter->format.latency_time = GST_SECOND; case GST_STATE_CHANGE_NULL_TO_READY:
memset (&filter->format, 0, sizeof (GstRingBufferSpec));
/* to make gst_buffer_spec_parse_caps() happy */
filter->format.latency_time = GST_SECOND;
break;
default:
break;
}
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
if (ret == GST_STATE_CHANGE_FAILURE)
return ret;
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
case GST_STATE_CHANGE_READY_TO_NULL:
gst_caps_replace (&filter->format.caps, NULL);
break;
default:
break;
}
return ret;
} }
static gboolean static gboolean
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment