mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-03 04:52:28 +00:00
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.
This commit is contained in:
parent
b507a3e175
commit
139b13b747
1 changed files with 31 additions and 2 deletions
|
@ -129,6 +129,8 @@ static GstStateChangeReturn gst_spectrum_change_state (GstElement * element,
|
||||||
static gboolean gst_spectrum_set_caps (GstBaseTransform * trans, GstCaps * in,
|
static gboolean gst_spectrum_set_caps (GstBaseTransform * trans, GstCaps * in,
|
||||||
GstCaps * out);
|
GstCaps * out);
|
||||||
static gboolean gst_spectrum_start (GstBaseTransform * trans);
|
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,
|
static GstFlowReturn gst_spectrum_transform_ip (GstBaseTransform * trans,
|
||||||
GstBuffer * in);
|
GstBuffer * in);
|
||||||
|
|
||||||
|
@ -161,9 +163,10 @@ gst_spectrum_class_init (GstSpectrumClass * klass)
|
||||||
gobject_class->get_property = gst_spectrum_get_property;
|
gobject_class->get_property = gst_spectrum_get_property;
|
||||||
gobject_class->dispose = gst_spectrum_dispose;
|
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->set_caps = GST_DEBUG_FUNCPTR (gst_spectrum_set_caps);
|
||||||
trans_class->start = GST_DEBUG_FUNCPTR (gst_spectrum_start);
|
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->transform_ip = GST_DEBUG_FUNCPTR (gst_spectrum_transform_ip);
|
||||||
trans_class->passthrough_on_same_caps = TRUE;
|
trans_class->passthrough_on_same_caps = TRUE;
|
||||||
|
|
||||||
|
@ -349,12 +352,38 @@ gst_spectrum_start (GstBaseTransform * trans)
|
||||||
{
|
{
|
||||||
GstSpectrum *filter = GST_SPECTRUM (trans);
|
GstSpectrum *filter = GST_SPECTRUM (trans);
|
||||||
|
|
||||||
gst_adapter_clear (filter->adapter);
|
|
||||||
filter->num_frames = 0;
|
filter->num_frames = 0;
|
||||||
|
|
||||||
return TRUE;
|
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 *
|
static GstMessage *
|
||||||
gst_spectrum_message_new (GstSpectrum * spectrum, GstClockTime endtime)
|
gst_spectrum_message_new (GstSpectrum * spectrum, GstClockTime endtime)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue