diff options
author | Stefan Kost <ensonic@users.sourceforge.net> | 2006-09-12 20:18:55 +0000 |
---|---|---|
committer | Stefan Kost <ensonic@users.sourceforge.net> | 2006-09-12 20:18:55 +0000 |
commit | 5b377ab1431b9dc1b63a10595d0864502dcbc473 (patch) | |
tree | 2de3774710fd0fa50c68f7b8d3e5ca92bef7377c | |
parent | 22ebcc3091b84f0082581ee30a944da993fc5bc7 (diff) | |
download | gst-plugins-bad-5b377ab1431b9dc1b63a10595d0864502dcbc473.tar.gz gst-plugins-bad-5b377ab1431b9dc1b63a10595d0864502dcbc473.tar.bz2 gst-plugins-bad-5b377ab1431b9dc1b63a10595d0864502dcbc473.zip |
gst/spectrum/gstspectrum.c: Implements stop() to clear the adapter and event() to clear the adapter on FLUSH_STOP and...
Original commit message from CVS:
* gst/spectrum/gstspectrum.c: (gst_spectrum_class_init),
(gst_spectrum_start), (gst_spectrum_stop), (gst_spectrum_event):
Implements stop() to clear the adapter and event() to clear the
adapter on FLUSH_STOP and EOS.
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | gst/spectrum/gstspectrum.c | 33 |
2 files changed, 42 insertions, 6 deletions
@@ -1,21 +1,28 @@ +2006-09-12 Stefan Kost <ensonic@users.sf.net> + + * gst/spectrum/gstspectrum.c: (gst_spectrum_class_init), + (gst_spectrum_start), (gst_spectrum_stop), (gst_spectrum_event): + Implements stop() to clear the adapter and event() to clear the + adapter on FLUSH_STOP and EOS. + 2006-09-11 Stefan Kost <ensonic@users.sf.net> * gst/spectrum/gstspectrum.c: (gst_spectrum_init), (gst_spectrum_set_property): * gst/spectrum/gstspectrum.h: - Fix type mixup in spectrum->interval (gdouble<->guint64). Spotted by - René Stadler + Fix type mixup in spectrum->interval (gdouble<->guint64). Spotted by + René Stadler 2006-09-11 Stefan Kost <ensonic@users.sf.net> * gst/spectrum/demo-osssrc.c: (draw_spectrum), (main): - Use more defines + Use more defines * gst/spectrum/gstspectrum.c: (gst_spectrum_init), (gst_spectrum_dispose), (gst_spectrum_set_caps), (gst_spectrum_transform_ip): * gst/spectrum/gstspectrum.h: - Apply some of the spectrum cleanup changes suggested in #348085. + Apply some of the spectrum cleanup changes suggested in #348085. 2006-09-08 Tim-Philipp Müller <tim at centricular dot net> diff --git a/gst/spectrum/gstspectrum.c b/gst/spectrum/gstspectrum.c index ae3645bb..cfb31e5e 100644 --- a/gst/spectrum/gstspectrum.c +++ b/gst/spectrum/gstspectrum.c @@ -129,6 +129,8 @@ static GstStateChangeReturn gst_spectrum_change_state (GstElement * element, static gboolean gst_spectrum_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out); static gboolean gst_spectrum_start (GstBaseTransform * trans); +static gboolean gst_spectrum_stop (GstBaseTransform * trans); +static gboolean gst_spectrum_event (GstBaseTransform * trans, GstEvent * event); static GstFlowReturn gst_spectrum_transform_ip (GstBaseTransform * trans, GstBuffer * in); @@ -161,9 +163,10 @@ gst_spectrum_class_init (GstSpectrumClass * klass) gobject_class->get_property = gst_spectrum_get_property; gobject_class->dispose = gst_spectrum_dispose; - /*element->change_state = gst_spectrum_change_state; */ trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_spectrum_set_caps); trans_class->start = GST_DEBUG_FUNCPTR (gst_spectrum_start); + trans_class->stop = GST_DEBUG_FUNCPTR (gst_spectrum_stop); + trans_class->event = GST_DEBUG_FUNCPTR (gst_spectrum_event); trans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_spectrum_transform_ip); trans_class->passthrough_on_same_caps = TRUE; @@ -349,12 +352,38 @@ gst_spectrum_start (GstBaseTransform * trans) { GstSpectrum *filter = GST_SPECTRUM (trans); - gst_adapter_clear (filter->adapter); filter->num_frames = 0; return TRUE; } +static gboolean +gst_spectrum_stop (GstBaseTransform * trans) +{ + GstSpectrum *filter = GST_SPECTRUM (trans); + + gst_adapter_clear (filter->adapter); + + return TRUE; +} + +static gboolean +gst_spectrum_event (GstBaseTransform * trans, GstEvent * event) +{ + GstSpectrum *filter = GST_SPECTRUM (trans); + + switch (GST_EVENT_TYPE (event)) { + case GST_EVENT_FLUSH_STOP: + case GST_EVENT_EOS: + gst_adapter_clear (filter->adapter); + break; + default: + break; + } + + return TRUE; +} + static GstMessage * gst_spectrum_message_new (GstSpectrum * spectrum, GstClockTime endtime) { |