2 * Copyright (C) 2004 Wim Taymans <wim@fluendo.com>
3 * Copyright (C) 2006 Tim-Philipp Müller <tim centricular net>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
22 * SECTION:element-speexdec
23 * @see_also: speexenc, oggdemux
25 * This element decodes a Speex stream to raw integer audio.
26 * <ulink url="http://www.speex.org/">Speex</ulink> is a royalty-free
27 * audio codec maintained by the <ulink url="http://www.xiph.org/">Xiph.org
31 * <title>Example pipelines</title>
33 * gst-launch -v filesrc location=speex.ogg ! oggdemux ! speexdec ! audioconvert ! audioresample ! alsasink
34 * ]| Decode an Ogg/Speex file. To create an Ogg/Speex file refer to the
35 * documentation of speexenc.
38 * Last reviewed on 2006-04-05 (0.10.2)
45 #include "gstspeexdec.h"
47 #include <gst/tag/tag.h>
49 GST_DEBUG_CATEGORY_STATIC (speexdec_debug);
50 #define GST_CAT_DEFAULT speexdec_debug
52 static const GstElementDetails speex_dec_details =
53 GST_ELEMENT_DETAILS ("Speex audio decoder",
54 "Codec/Decoder/Audio",
55 "decode speex streams to audio",
56 "Wim Taymans <wim@fluendo.com>");
58 #define DEFAULT_ENH TRUE
66 static GstStaticPadTemplate speex_dec_src_factory =
67 GST_STATIC_PAD_TEMPLATE ("src",
70 GST_STATIC_CAPS ("audio/x-raw-int, "
71 "rate = (int) [ 6000, 48000 ], "
72 "channels = (int) [ 1, 2 ], "
73 "endianness = (int) BYTE_ORDER, "
74 "signed = (boolean) true, " "width = (int) 16, " "depth = (int) 16")
77 static GstStaticPadTemplate speex_dec_sink_factory =
78 GST_STATIC_PAD_TEMPLATE ("sink",
81 GST_STATIC_CAPS ("audio/x-speex")
84 GST_BOILERPLATE (GstSpeexDec, gst_speex_dec, GstElement, GST_TYPE_ELEMENT);
86 static gboolean speex_dec_sink_event (GstPad * pad, GstEvent * event);
87 static GstFlowReturn speex_dec_chain (GstPad * pad, GstBuffer * buf);
88 static GstStateChangeReturn speex_dec_change_state (GstElement * element,
89 GstStateChange transition);
91 static gboolean speex_dec_src_event (GstPad * pad, GstEvent * event);
92 static gboolean speex_dec_src_query (GstPad * pad, GstQuery * query);
93 static gboolean speex_dec_sink_query (GstPad * pad, GstQuery * query);
94 static const GstQueryType *speex_get_src_query_types (GstPad * pad);
95 static const GstQueryType *speex_get_sink_query_types (GstPad * pad);
96 static gboolean speex_dec_convert (GstPad * pad,
97 GstFormat src_format, gint64 src_value,
98 GstFormat * dest_format, gint64 * dest_value);
100 static void gst_speex_dec_get_property (GObject * object, guint prop_id,
101 GValue * value, GParamSpec * pspec);
102 static void gst_speex_dec_set_property (GObject * object, guint prop_id,
103 const GValue * value, GParamSpec * pspec);
105 static GstFlowReturn speex_dec_chain_parse_data (GstSpeexDec * dec,
106 GstBuffer * buf, GstClockTime timestamp, GstClockTime duration);
109 gst_speex_dec_base_init (gpointer g_class)
111 GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
113 gst_element_class_add_pad_template (element_class,
114 gst_static_pad_template_get (&speex_dec_src_factory));
115 gst_element_class_add_pad_template (element_class,
116 gst_static_pad_template_get (&speex_dec_sink_factory));
117 gst_element_class_set_details (element_class, &speex_dec_details);
121 gst_speex_dec_class_init (GstSpeexDecClass * klass)
123 GObjectClass *gobject_class;
124 GstElementClass *gstelement_class;
126 gobject_class = (GObjectClass *) klass;
127 gstelement_class = (GstElementClass *) klass;
129 gobject_class->set_property = gst_speex_dec_set_property;
130 gobject_class->get_property = gst_speex_dec_get_property;
132 g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ENH,
133 g_param_spec_boolean ("enh", "Enh", "Enable perceptual enhancement",
134 DEFAULT_ENH, G_PARAM_READWRITE));
136 gstelement_class->change_state = GST_DEBUG_FUNCPTR (speex_dec_change_state);
138 GST_DEBUG_CATEGORY_INIT (speexdec_debug, "speexdec", 0,
139 "speex decoding element");
143 gst_speex_dec_reset (GstSpeexDec * dec)
145 gst_segment_init (&dec->segment, GST_FORMAT_UNDEFINED);
146 dec->granulepos = -1;
149 dec->frame_duration = 0;
153 speex_bits_destroy (&dec->bits);
155 speex_decoder_destroy (dec->state);
161 gst_speex_dec_init (GstSpeexDec * dec, GstSpeexDecClass * g_class)
164 gst_pad_new_from_static_template (&speex_dec_sink_factory, "sink");
165 gst_pad_set_chain_function (dec->sinkpad,
166 GST_DEBUG_FUNCPTR (speex_dec_chain));
167 gst_pad_set_event_function (dec->sinkpad,
168 GST_DEBUG_FUNCPTR (speex_dec_sink_event));
169 gst_pad_set_query_type_function (dec->sinkpad,
170 GST_DEBUG_FUNCPTR (speex_get_sink_query_types));
171 gst_pad_set_query_function (dec->sinkpad,
172 GST_DEBUG_FUNCPTR (speex_dec_sink_query));
173 gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad);
176 gst_pad_new_from_static_template (&speex_dec_src_factory, "src");
177 gst_pad_use_fixed_caps (dec->srcpad);
178 gst_pad_set_event_function (dec->srcpad,
179 GST_DEBUG_FUNCPTR (speex_dec_src_event));
180 gst_pad_set_query_type_function (dec->srcpad,
181 GST_DEBUG_FUNCPTR (speex_get_src_query_types));
182 gst_pad_set_query_function (dec->srcpad,
183 GST_DEBUG_FUNCPTR (speex_dec_src_query));
184 gst_element_add_pad (GST_ELEMENT (dec), dec->srcpad);
186 dec->enh = DEFAULT_ENH;
188 gst_speex_dec_reset (dec);
192 speex_dec_convert (GstPad * pad,
193 GstFormat src_format, gint64 src_value,
194 GstFormat * dest_format, gint64 * dest_value)
200 dec = GST_SPEEX_DEC (gst_pad_get_parent (pad));
202 if (src_format == *dest_format) {
203 *dest_value = src_value;
208 if (dec->packetno < 1) {
213 if (pad == dec->sinkpad &&
214 (src_format == GST_FORMAT_BYTES || *dest_format == GST_FORMAT_BYTES)) {
219 switch (src_format) {
220 case GST_FORMAT_TIME:
221 switch (*dest_format) {
222 case GST_FORMAT_BYTES:
223 scale = 2 * dec->header->nb_channels;
224 case GST_FORMAT_DEFAULT:
226 gst_util_uint64_scale_int (scale * src_value, dec->header->rate,
234 case GST_FORMAT_DEFAULT:
235 switch (*dest_format) {
236 case GST_FORMAT_BYTES:
237 *dest_value = src_value * 2 * dec->header->nb_channels;
239 case GST_FORMAT_TIME:
241 gst_util_uint64_scale_int (src_value, GST_SECOND,
249 case GST_FORMAT_BYTES:
250 switch (*dest_format) {
251 case GST_FORMAT_DEFAULT:
252 *dest_value = src_value / (2 * dec->header->nb_channels);
254 case GST_FORMAT_TIME:
255 *dest_value = gst_util_uint64_scale_int (src_value, GST_SECOND,
256 dec->header->rate * 2 * dec->header->nb_channels);
269 gst_object_unref (dec);
273 static const GstQueryType *
274 speex_get_sink_query_types (GstPad * pad)
276 static const GstQueryType speex_dec_sink_query_types[] = {
281 return speex_dec_sink_query_types;
285 speex_dec_sink_query (GstPad * pad, GstQuery * query)
290 dec = GST_SPEEX_DEC (gst_pad_get_parent (pad));
292 switch (GST_QUERY_TYPE (query)) {
293 case GST_QUERY_CONVERT:
295 GstFormat src_fmt, dest_fmt;
296 gint64 src_val, dest_val;
298 gst_query_parse_convert (query, &src_fmt, &src_val, &dest_fmt, &dest_val);
299 res = speex_dec_convert (pad, src_fmt, src_val, &dest_fmt, &dest_val);
301 gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val);
306 res = gst_pad_query_default (pad, query);
310 gst_object_unref (dec);
314 static const GstQueryType *
315 speex_get_src_query_types (GstPad * pad)
317 static const GstQueryType speex_dec_src_query_types[] = {
323 return speex_dec_src_query_types;
327 speex_dec_src_query (GstPad * pad, GstQuery * query)
330 gboolean res = FALSE;
332 dec = GST_SPEEX_DEC (gst_pad_get_parent (pad));
334 switch (GST_QUERY_TYPE (query)) {
335 case GST_QUERY_POSITION:{
340 gst_query_parse_position (query, &format, NULL);
342 GST_PAD_STREAM_LOCK (dec->sinkpad);
343 segment = dec->segment;
344 GST_PAD_STREAM_UNLOCK (dec->sinkpad);
346 if (segment.format != GST_FORMAT_TIME) {
347 GST_DEBUG_OBJECT (dec, "segment not initialised yet");
351 if ((res = speex_dec_convert (dec->srcpad, GST_FORMAT_TIME,
352 segment.last_stop, &format, &cur))) {
353 gst_query_set_position (query, format, cur);
357 case GST_QUERY_DURATION:{
358 GstFormat format = GST_FORMAT_TIME;
361 /* get duration from demuxer */
362 if (!gst_pad_query_peer_duration (dec->sinkpad, &format, &dur))
365 gst_query_parse_duration (query, &format, NULL);
367 /* and convert it into the requested format */
368 if ((res = speex_dec_convert (dec->srcpad, GST_FORMAT_TIME,
369 dur, &format, &dur))) {
370 gst_query_set_duration (query, format, dur);
375 res = gst_pad_query_default (pad, query);
379 gst_object_unref (dec);
384 speex_dec_src_event (GstPad * pad, GstEvent * event)
386 gboolean res = FALSE;
387 GstSpeexDec *dec = GST_SPEEX_DEC (gst_pad_get_parent (pad));
389 GST_LOG_OBJECT (dec, "handling %s event", GST_EVENT_TYPE_NAME (event));
391 switch (GST_EVENT_TYPE (event)) {
392 case GST_EVENT_SEEK:{
393 GstFormat format, tformat;
397 GstSeekType cur_type, stop_type;
401 gst_event_parse_seek (event, &rate, &format, &flags, &cur_type, &cur,
404 /* we have to ask our peer to seek to time here as we know
405 * nothing about how to generate a granulepos from the src
406 * formats or anything.
408 * First bring the requested format to time
410 tformat = GST_FORMAT_TIME;
411 if (!(res = speex_dec_convert (pad, format, cur, &tformat, &tcur)))
413 if (!(res = speex_dec_convert (pad, format, stop, &tformat, &tstop)))
416 /* then seek with time on the peer */
417 real_seek = gst_event_new_seek (rate, GST_FORMAT_TIME,
418 flags, cur_type, tcur, stop_type, tstop);
420 GST_LOG_OBJECT (dec, "seek to %" GST_TIME_FORMAT, GST_TIME_ARGS (tcur));
422 res = gst_pad_push_event (dec->sinkpad, real_seek);
423 gst_event_unref (event);
427 res = gst_pad_event_default (pad, event);
431 gst_object_unref (dec);
436 speex_dec_sink_event (GstPad * pad, GstEvent * event)
439 gboolean ret = FALSE;
441 dec = GST_SPEEX_DEC (gst_pad_get_parent (pad));
443 GST_LOG_OBJECT (dec, "handling %s event", GST_EVENT_TYPE_NAME (event));
445 switch (GST_EVENT_TYPE (event)) {
446 case GST_EVENT_NEWSEGMENT:{
449 gint64 start, stop, time;
452 gst_event_parse_new_segment_full (event, &update, &rate, &arate, &format,
453 &start, &stop, &time);
455 if (format != GST_FORMAT_TIME)
456 goto newseg_wrong_format;
459 goto newseg_wrong_rate;
462 /* time progressed without data, see if we can fill the gap with
463 * some concealment data */
464 if (dec->segment.last_stop < start) {
465 GstClockTime duration;
467 duration = start - dec->segment.last_stop;
468 speex_dec_chain_parse_data (dec, NULL, dec->segment.last_stop,
473 /* now configure the values */
474 gst_segment_set_newsegment_full (&dec->segment, update,
475 rate, arate, GST_FORMAT_TIME, start, stop, time);
477 dec->granulepos = -1;
479 GST_DEBUG_OBJECT (dec, "segment now: cur = %" GST_TIME_FORMAT " [%"
480 GST_TIME_FORMAT " - %" GST_TIME_FORMAT "]",
481 GST_TIME_ARGS (dec->segment.last_stop),
482 GST_TIME_ARGS (dec->segment.start),
483 GST_TIME_ARGS (dec->segment.stop));
485 ret = gst_pad_push_event (dec->srcpad, event);
489 ret = gst_pad_event_default (pad, event);
493 gst_object_unref (dec);
499 GST_DEBUG_OBJECT (dec, "received non TIME newsegment");
500 gst_object_unref (dec);
505 GST_DEBUG_OBJECT (dec, "negative rates not supported yet");
506 gst_object_unref (dec);
512 speex_dec_chain_parse_header (GstSpeexDec * dec, GstBuffer * buf)
517 dec->header = speex_packet_to_header ((char *) GST_BUFFER_DATA (buf),
518 GST_BUFFER_SIZE (buf));
523 if (dec->header->mode >= SPEEX_NB_MODES || dec->header->mode < 0)
526 dec->mode = (SpeexMode *) speex_mode_list[dec->header->mode];
528 /* initialize the decoder */
529 dec->state = speex_decoder_init (dec->mode);
533 speex_decoder_ctl (dec->state, SPEEX_SET_ENH, &dec->enh);
534 speex_decoder_ctl (dec->state, SPEEX_GET_FRAME_SIZE, &dec->frame_size);
536 if (dec->header->nb_channels != 1) {
537 dec->callback.callback_id = SPEEX_INBAND_STEREO;
538 dec->callback.func = speex_std_stereo_request_handler;
539 dec->callback.data = &dec->stereo;
540 speex_decoder_ctl (dec->state, SPEEX_SET_HANDLER, &dec->callback);
543 speex_decoder_ctl (dec->state, SPEEX_SET_SAMPLING_RATE, &dec->header->rate);
545 dec->frame_duration = gst_util_uint64_scale_int (dec->frame_size,
546 GST_SECOND, dec->header->rate);
548 speex_bits_init (&dec->bits);
551 caps = gst_caps_new_simple ("audio/x-raw-int",
552 "rate", G_TYPE_INT, dec->header->rate,
553 "channels", G_TYPE_INT, dec->header->nb_channels,
554 "signed", G_TYPE_BOOLEAN, TRUE,
555 "endianness", G_TYPE_INT, G_BYTE_ORDER,
556 "width", G_TYPE_INT, 16, "depth", G_TYPE_INT, 16, NULL);
558 if (!gst_pad_set_caps (dec->srcpad, caps))
561 gst_caps_unref (caps);
567 GST_ELEMENT_ERROR (GST_ELEMENT (dec), STREAM, DECODE,
568 (NULL), ("couldn't read header"));
569 return GST_FLOW_ERROR;
573 GST_ELEMENT_ERROR (GST_ELEMENT (dec), STREAM, DECODE,
575 ("Mode number %d does not (yet/any longer) exist in this version",
577 return GST_FLOW_ERROR;
581 GST_ELEMENT_ERROR (GST_ELEMENT (dec), STREAM, DECODE,
582 (NULL), ("couldn't initialize decoder"));
583 return GST_FLOW_ERROR;
587 GST_ELEMENT_ERROR (GST_ELEMENT (dec), STREAM, DECODE,
588 (NULL), ("couldn't negotiate format"));
589 gst_caps_unref (caps);
590 return GST_FLOW_NOT_NEGOTIATED;
595 speex_dec_chain_parse_comments (GstSpeexDec * dec, GstBuffer * buf)
598 gchar *ver, *encoder = NULL;
600 list = gst_tag_list_from_vorbiscomment_buffer (buf, NULL, 0, &encoder);
603 GST_WARNING_OBJECT (dec, "couldn't decode comments");
604 list = gst_tag_list_new ();
608 gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
609 GST_TAG_ENCODER, encoder, NULL);
612 gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
613 GST_TAG_AUDIO_CODEC, "Speex", NULL);
615 ver = g_strndup (dec->header->speex_version, SPEEX_HEADER_VERSION_LENGTH);
618 if (ver != NULL && *ver != '\0') {
619 gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
620 GST_TAG_ENCODER_VERSION, ver, NULL);
623 if (dec->header->bitrate > 0) {
624 gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
625 GST_TAG_BITRATE, (guint) dec->header->bitrate, NULL);
628 GST_INFO_OBJECT (dec, "tags: %" GST_PTR_FORMAT, list);
630 gst_element_found_tags_for_pad (GST_ELEMENT (dec), dec->srcpad, list);
639 speex_dec_chain_parse_data (GstSpeexDec * dec, GstBuffer * buf,
640 GstClockTime timestamp, GstClockTime duration)
642 GstFlowReturn res = GST_FLOW_OK;
648 if (timestamp != -1) {
649 dec->segment.last_stop = timestamp;
650 dec->granulepos = -1;
654 data = GST_BUFFER_DATA (buf);
655 size = GST_BUFFER_SIZE (buf);
657 /* send data to the bitstream */
658 speex_bits_read_from (&dec->bits, (char *) data, size);
663 GST_DEBUG_OBJECT (dec, "received buffer of size %u, fpp %d", size, fpp);
665 if (!GST_BUFFER_TIMESTAMP_IS_VALID (buf)
666 && GST_BUFFER_OFFSET_END_IS_VALID (buf)) {
667 dec->granulepos = GST_BUFFER_OFFSET_END (buf);
668 GST_DEBUG_OBJECT (dec,
669 "Taking granulepos from upstream: %" G_GUINT64_FORMAT,
675 /* concealment data, pass NULL as the bits parameters */
676 GST_DEBUG_OBJECT (dec, "creating concealment data");
677 fpp = dec->header->frames_per_packet;
682 /* now decode each frame, catering for unknown number of them (e.g. rtp) */
683 for (i = 0; (!fpp || i < fpp) && (!bits || speex_bits_remaining (bits) > 0);
689 GST_LOG_OBJECT (dec, "decoding frame %d/%d", i, fpp);
691 res = gst_pad_alloc_buffer_and_set_caps (dec->srcpad,
692 GST_BUFFER_OFFSET_NONE, dec->frame_size * dec->header->nb_channels * 2,
693 GST_PAD_CAPS (dec->srcpad), &outbuf);
695 if (res != GST_FLOW_OK) {
696 GST_DEBUG_OBJECT (dec, "buf alloc flow: %s", gst_flow_get_name (res));
700 out_data = (gint16 *) GST_BUFFER_DATA (outbuf);
702 ret = speex_decode_int (dec->state, bits, out_data);
704 /* uh? end of stream */
705 GST_WARNING_OBJECT (dec, "Unexpected end of stream found");
706 gst_buffer_unref (outbuf);
709 } else if (ret == -2) {
710 GST_WARNING_OBJECT (dec, "Decoding error: corrupted stream?");
711 gst_buffer_unref (outbuf);
716 if (bits && speex_bits_remaining (bits) < 0) {
717 GST_WARNING_OBJECT (dec, "Decoding overflow: corrupted stream?");
718 gst_buffer_unref (outbuf);
722 if (dec->header->nb_channels == 2)
723 speex_decode_stereo_int (out_data, dec->frame_size, &dec->stereo);
725 if (dec->granulepos == -1) {
726 if (dec->segment.format != GST_FORMAT_TIME) {
727 GST_WARNING_OBJECT (dec, "segment not initialized or not TIME format");
728 dec->granulepos = dec->frame_size;
730 dec->granulepos = gst_util_uint64_scale_int (dec->segment.last_stop,
731 dec->header->rate, GST_SECOND) + dec->frame_size;
733 GST_DEBUG_OBJECT (dec, "granulepos=%" G_GINT64_FORMAT, dec->granulepos);
736 if (timestamp == -1) {
737 timestamp = gst_util_uint64_scale_int (dec->granulepos - dec->frame_size,
738 GST_SECOND, dec->header->rate);
741 GST_BUFFER_OFFSET (outbuf) = dec->granulepos - dec->frame_size;
742 GST_BUFFER_OFFSET_END (outbuf) = dec->granulepos;
743 GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
744 GST_BUFFER_DURATION (outbuf) = dec->frame_duration;
746 dec->granulepos += dec->frame_size;
747 dec->segment.last_stop += dec->frame_duration;
749 GST_LOG_OBJECT (dec, "pushing buffer with ts=%" GST_TIME_FORMAT ", dur=%"
750 GST_TIME_FORMAT, GST_TIME_ARGS (timestamp),
751 GST_TIME_ARGS (dec->frame_duration));
753 res = gst_pad_push (dec->srcpad, outbuf);
755 if (res != GST_FLOW_OK) {
756 GST_DEBUG_OBJECT (dec, "flow: %s", gst_flow_get_name (res));
766 speex_dec_chain (GstPad * pad, GstBuffer * buf)
771 dec = GST_SPEEX_DEC (gst_pad_get_parent (pad));
773 switch (dec->packetno) {
775 res = speex_dec_chain_parse_header (dec, buf);
778 res = speex_dec_chain_parse_comments (dec, buf);
782 speex_dec_chain_parse_data (dec, buf, GST_BUFFER_TIMESTAMP (buf),
783 GST_BUFFER_DURATION (buf));
789 gst_buffer_unref (buf);
790 gst_object_unref (dec);
796 gst_speex_dec_get_property (GObject * object, guint prop_id,
797 GValue * value, GParamSpec * pspec)
799 GstSpeexDec *speexdec;
801 speexdec = GST_SPEEX_DEC (object);
805 g_value_set_boolean (value, speexdec->enh);
808 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
814 gst_speex_dec_set_property (GObject * object, guint prop_id,
815 const GValue * value, GParamSpec * pspec)
817 GstSpeexDec *speexdec;
819 speexdec = GST_SPEEX_DEC (object);
823 speexdec->enh = g_value_get_boolean (value);
826 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
832 static GstStateChangeReturn
833 speex_dec_change_state (GstElement * element, GstStateChange transition)
835 GstStateChangeReturn ret;
836 GstSpeexDec *dec = GST_SPEEX_DEC (element);
838 switch (transition) {
839 case GST_STATE_CHANGE_NULL_TO_READY:
840 case GST_STATE_CHANGE_READY_TO_PAUSED:
841 case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
846 ret = parent_class->change_state (element, transition);
847 if (ret != GST_STATE_CHANGE_SUCCESS)
850 switch (transition) {
851 case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
853 case GST_STATE_CHANGE_PAUSED_TO_READY:
854 gst_speex_dec_reset (dec);
856 case GST_STATE_CHANGE_READY_TO_NULL: