2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
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-auparse
24 * Parses .au files mostly originating from sun os based computers.
34 #include "gstauparse.h"
35 #include <gst/audio/audio.h>
37 GST_DEBUG_CATEGORY_STATIC (auparse_debug);
38 #define GST_CAT_DEFAULT (auparse_debug)
40 static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
43 GST_STATIC_CAPS ("audio/x-au")
46 #define GST_AU_PARSE_ALAW_PAD_TEMPLATE_CAPS \
48 "rate = (int) [ 8000, 192000 ], " \
49 "channels = (int) [ 1, 2 ]"
51 #define GST_AU_PARSE_MULAW_PAD_TEMPLATE_CAPS \
53 "rate = (int) [ 8000, 192000 ], " \
54 "channels = (int) [ 1, 2 ]"
56 /* Nothing to decode those ADPCM streams for now */
57 #define GST_AU_PARSE_ADPCM_PAD_TEMPLATE_CAPS \
59 "layout = (string) { g721, g722, g723_3, g723_5 }"
61 static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
64 GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS "; "
65 GST_AUDIO_FLOAT_PAD_TEMPLATE_CAPS ";"
66 GST_AU_PARSE_ALAW_PAD_TEMPLATE_CAPS ";"
67 GST_AU_PARSE_MULAW_PAD_TEMPLATE_CAPS ";"
68 GST_AU_PARSE_ADPCM_PAD_TEMPLATE_CAPS));
71 static void gst_au_parse_dispose (GObject * object);
72 static GstFlowReturn gst_au_parse_chain (GstPad * pad, GstBuffer * buf);
73 static GstStateChangeReturn gst_au_parse_change_state (GstElement * element,
74 GstStateChange transition);
75 static void gst_au_parse_reset (GstAuParse * auparse);
76 static gboolean gst_au_parse_remove_srcpad (GstAuParse * auparse);
77 static gboolean gst_au_parse_add_srcpad (GstAuParse * auparse, GstCaps * caps);
78 static gboolean gst_au_parse_src_query (GstPad * pad, GstQuery * query);
79 static gboolean gst_au_parse_src_event (GstPad * pad, GstEvent * event);
80 static gboolean gst_au_parse_sink_event (GstPad * pad, GstEvent * event);
81 static gboolean gst_au_parse_src_convert (GstAuParse * auparse,
82 GstFormat src_format, gint64 srcval, GstFormat dest_format,
85 GST_BOILERPLATE (GstAuParse, gst_au_parse, GstElement, GST_TYPE_ELEMENT);
88 gst_au_parse_base_init (gpointer g_class)
90 GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
92 gst_element_class_add_static_pad_template (element_class,
94 gst_element_class_add_static_pad_template (element_class, &src_template);
95 gst_element_class_set_details_simple (element_class, "AU audio demuxer",
96 "Codec/Demuxer/Audio",
97 "Parse an .au file into raw audio",
98 "Erik Walthinsen <omega@cse.ogi.edu>");
100 GST_DEBUG_CATEGORY_INIT (auparse_debug, "auparse", 0, ".au parser");
104 gst_au_parse_class_init (GstAuParseClass * klass)
106 GObjectClass *gobject_class;
107 GstElementClass *gstelement_class;
109 gobject_class = (GObjectClass *) klass;
110 gstelement_class = (GstElementClass *) klass;
112 gobject_class->dispose = gst_au_parse_dispose;
114 gstelement_class->change_state =
115 GST_DEBUG_FUNCPTR (gst_au_parse_change_state);
119 gst_au_parse_init (GstAuParse * auparse, GstAuParseClass * klass)
121 auparse->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink");
122 gst_pad_set_chain_function (auparse->sinkpad,
123 GST_DEBUG_FUNCPTR (gst_au_parse_chain));
124 gst_pad_set_event_function (auparse->sinkpad,
125 GST_DEBUG_FUNCPTR (gst_au_parse_sink_event));
126 gst_element_add_pad (GST_ELEMENT (auparse), auparse->sinkpad);
128 auparse->srcpad = NULL;
129 auparse->adapter = gst_adapter_new ();
130 gst_au_parse_reset (auparse);
134 gst_au_parse_dispose (GObject * object)
136 GstAuParse *au = GST_AU_PARSE (object);
138 if (au->adapter != NULL) {
139 g_object_unref (au->adapter);
142 G_OBJECT_CLASS (parent_class)->dispose (object);
146 gst_au_parse_reset (GstAuParse * auparse)
148 gst_au_parse_remove_srcpad (auparse);
151 auparse->buffer_offset = 0;
152 auparse->encoding = 0;
153 auparse->samplerate = 0;
154 auparse->channels = 0;
156 gst_adapter_clear (auparse->adapter);
158 /* gst_segment_init (&auparse->segment, GST_FORMAT_TIME); */
162 gst_au_parse_add_srcpad (GstAuParse * auparse, GstCaps * new_caps)
164 if (auparse->src_caps && gst_caps_is_equal (new_caps, auparse->src_caps)) {
165 GST_LOG_OBJECT (auparse, "same caps, nothing to do");
169 gst_caps_replace (&auparse->src_caps, new_caps);
170 if (auparse->srcpad != NULL) {
171 GST_DEBUG_OBJECT (auparse, "Changing src pad caps to %" GST_PTR_FORMAT,
173 gst_pad_set_caps (auparse->srcpad, auparse->src_caps);
176 if (auparse->srcpad == NULL) {
177 auparse->srcpad = gst_pad_new_from_static_template (&src_template, "src");
178 g_return_val_if_fail (auparse->srcpad != NULL, FALSE);
181 gst_pad_set_query_type_function (auparse->srcpad,
182 GST_DEBUG_FUNCPTR (gst_au_parse_src_get_query_types));
184 gst_pad_set_query_function (auparse->srcpad,
185 GST_DEBUG_FUNCPTR (gst_au_parse_src_query));
186 gst_pad_set_event_function (auparse->srcpad,
187 GST_DEBUG_FUNCPTR (gst_au_parse_src_event));
189 gst_pad_use_fixed_caps (auparse->srcpad);
190 gst_pad_set_active (auparse->srcpad, TRUE);
192 if (auparse->src_caps)
193 gst_pad_set_caps (auparse->srcpad, auparse->src_caps);
195 GST_DEBUG_OBJECT (auparse, "Adding src pad with caps %" GST_PTR_FORMAT,
198 gst_object_ref (auparse->srcpad);
199 if (!gst_element_add_pad (GST_ELEMENT (auparse), auparse->srcpad))
201 gst_element_no_more_pads (GST_ELEMENT (auparse));
208 gst_au_parse_remove_srcpad (GstAuParse * auparse)
212 if (auparse->srcpad != NULL) {
213 GST_DEBUG_OBJECT (auparse, "Removing src pad");
214 res = gst_element_remove_pad (GST_ELEMENT (auparse), auparse->srcpad);
215 g_return_val_if_fail (res != FALSE, FALSE);
216 gst_object_unref (auparse->srcpad);
217 auparse->srcpad = NULL;
224 gst_au_parse_parse_header (GstAuParse * auparse)
229 gchar layout[7] = { 0, };
230 gint law = 0, depth = 0, ieee = 0;
232 head = (guint8 *) gst_adapter_peek (auparse->adapter, 24);
233 g_assert (head != NULL);
235 GST_DEBUG_OBJECT (auparse, "[%c%c%c%c]", head[0], head[1], head[2], head[3]);
237 switch (GST_READ_UINT32_BE (head)) {
238 /* normal format is big endian (au is a Sparc format) */
239 case 0x2e736e64:{ /* ".snd" */
240 auparse->endianness = G_BIG_ENDIAN;
243 /* and of course, someone had to invent a little endian
244 * version. Used by DEC systems. */
245 case 0x646e732e: /* dns. */
246 case 0x0064732e:{ /* other source say it is "dns." */
247 auparse->endianness = G_LITTLE_ENDIAN;
255 auparse->offset = GST_READ_UINT32_BE (head + 4);
256 /* Do not trust size, could be set to -1 : unknown
257 * otherwise: filesize = size + auparse->offset
259 size = GST_READ_UINT32_BE (head + 8);
260 auparse->encoding = GST_READ_UINT32_BE (head + 12);
261 auparse->samplerate = GST_READ_UINT32_BE (head + 16);
262 auparse->channels = GST_READ_UINT32_BE (head + 20);
264 if (auparse->samplerate < 8000 || auparse->samplerate > 192000)
265 goto unsupported_sample_rate;
267 if (auparse->channels < 1 || auparse->channels > 2)
268 goto unsupported_number_of_channels;
270 GST_DEBUG_OBJECT (auparse, "offset %" G_GINT64_FORMAT ", size %u, "
271 "encoding %u, frequency %u, channels %u", auparse->offset, size,
272 auparse->encoding, auparse->samplerate, auparse->channels);
275 * http://www.opengroup.org/public/pubs/external/auformat.html
276 * http://astronomy.swin.edu.au/~pbourke/dataformats/au/
277 * Solaris headers : /usr/include/audio/au.h
278 * libsndfile : src/au.c
281 * http://www.tsp.ece.mcgill.ca/MMSP/Documents/AudioFormats/AU/Samples.html
284 switch (auparse->encoding) {
285 case 1: /* 8-bit ISDN mu-law G.711 */
289 case 27: /* 8-bit ISDN A-law G.711 */
294 case 2: /* 8-bit linear PCM */
297 case 3: /* 16-bit linear PCM */
300 case 4: /* 24-bit linear PCM */
303 case 5: /* 32-bit linear PCM */
307 case 6: /* 32-bit IEEE floating point */
311 case 7: /* 64-bit IEEE floating point */
316 case 23: /* 4-bit CCITT G.721 ADPCM 32kbps -> modplug/libsndfile (compressed 8-bit mu-law) */
317 strcpy (layout, "g721");
319 case 24: /* 8-bit CCITT G.722 ADPCM -> rtp */
320 strcpy (layout, "g722");
322 case 25: /* 3-bit CCITT G.723.3 ADPCM 24kbps -> rtp/xine/modplug/libsndfile */
323 strcpy (layout, "g723_3");
325 case 26: /* 5-bit CCITT G.723.5 ADPCM 40kbps -> rtp/xine/modplug/libsndfile */
326 strcpy (layout, "g723_5");
329 case 8: /* Fragmented sample data */
330 case 9: /* AU_ENCODING_NESTED */
332 case 10: /* DSP program */
333 case 11: /* DSP 8-bit fixed point */
334 case 12: /* DSP 16-bit fixed point */
335 case 13: /* DSP 24-bit fixed point */
336 case 14: /* DSP 32-bit fixed point */
338 case 16: /* AU_ENCODING_DISPLAY : non-audio display data */
339 case 17: /* AU_ENCODING_MULAW_SQUELCH */
341 case 18: /* 16-bit linear with emphasis */
342 case 19: /* 16-bit linear compressed (NeXT) */
343 case 20: /* 16-bit linear with emphasis and compression */
345 case 21: /* Music kit DSP commands */
346 case 22: /* Music kit DSP commands samples */
354 gst_caps_new_simple ((law == 1) ? "audio/x-mulaw" : "audio/x-alaw",
355 "rate", G_TYPE_INT, auparse->samplerate,
356 "channels", G_TYPE_INT, auparse->channels, NULL);
357 auparse->sample_size = auparse->channels;
359 tempcaps = gst_caps_new_simple ("audio/x-raw-float",
360 "rate", G_TYPE_INT, auparse->samplerate,
361 "channels", G_TYPE_INT, auparse->channels,
362 "endianness", G_TYPE_INT, auparse->endianness,
363 "width", G_TYPE_INT, depth, NULL);
364 auparse->sample_size = auparse->channels * depth / 8;
365 } else if (layout[0]) {
366 tempcaps = gst_caps_new_simple ("audio/x-adpcm",
367 "layout", G_TYPE_STRING, layout, NULL);
368 auparse->sample_size = 0;
370 tempcaps = gst_caps_new_simple ("audio/x-raw-int",
371 "rate", G_TYPE_INT, auparse->samplerate,
372 "channels", G_TYPE_INT, auparse->channels,
373 "endianness", G_TYPE_INT, auparse->endianness,
374 "depth", G_TYPE_INT, depth, "width", G_TYPE_INT, depth,
375 /* FIXME: signed TRUE even for 8-bit PCM? */
376 "signed", G_TYPE_BOOLEAN, TRUE, NULL);
377 auparse->sample_size = auparse->channels * depth / 8;
380 GST_DEBUG_OBJECT (auparse, "sample_size=%d", auparse->sample_size);
382 if (!gst_au_parse_add_srcpad (auparse, tempcaps))
385 GST_DEBUG_OBJECT (auparse, "offset=%" G_GINT64_FORMAT, auparse->offset);
386 gst_adapter_flush (auparse->adapter, auparse->offset);
388 gst_caps_unref (tempcaps);
394 GST_ELEMENT_ERROR (auparse, STREAM, WRONG_TYPE, (NULL), (NULL));
395 return GST_FLOW_ERROR;
397 unsupported_sample_rate:
399 GST_ELEMENT_ERROR (auparse, STREAM, FORMAT, (NULL),
400 ("Unsupported samplerate: %u", auparse->samplerate));
401 return GST_FLOW_ERROR;
403 unsupported_number_of_channels:
405 GST_ELEMENT_ERROR (auparse, STREAM, FORMAT, (NULL),
406 ("Unsupported number of channels: %u", auparse->channels));
407 return GST_FLOW_ERROR;
411 GST_ELEMENT_ERROR (auparse, STREAM, FORMAT, (NULL),
412 ("Unsupported encoding: %u", auparse->encoding));
413 return GST_FLOW_ERROR;
417 GST_ELEMENT_ERROR (auparse, STREAM, FAILED, (NULL),
418 ("Failed to add srcpad"));
419 gst_caps_unref (tempcaps);
420 return GST_FLOW_ERROR;
424 #define AU_HEADER_SIZE 24
427 gst_au_parse_chain (GstPad * pad, GstBuffer * buf)
429 GstFlowReturn ret = GST_FLOW_OK;
431 gint avail, sendnow = 0;
436 auparse = GST_AU_PARSE (gst_pad_get_parent (pad));
438 GST_LOG_OBJECT (auparse, "got buffer of size %u", GST_BUFFER_SIZE (buf));
440 gst_adapter_push (auparse->adapter, buf);
443 /* if we haven't seen any data yet... */
444 if (auparse->srcpad == NULL) {
445 if (gst_adapter_available (auparse->adapter) < AU_HEADER_SIZE) {
446 GST_DEBUG_OBJECT (auparse, "need more data to parse header");
451 ret = gst_au_parse_parse_header (auparse);
452 if (ret != GST_FLOW_OK)
455 gst_pad_push_event (auparse->srcpad,
456 gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_TIME,
457 0, GST_CLOCK_TIME_NONE, 0));
460 avail = gst_adapter_available (auparse->adapter);
462 if (auparse->sample_size > 0) {
463 /* Ensure we push a buffer that's a multiple of the frame size downstream */
464 sendnow = avail - (avail % auparse->sample_size);
466 /* It's something non-trivial (such as ADPCM), we don't understand it, so
467 * just push downstream and assume it will know what to do with it */
476 ret = gst_pad_alloc_buffer_and_set_caps (auparse->srcpad,
477 auparse->buffer_offset, sendnow, GST_PAD_CAPS (auparse->srcpad),
480 if (ret != GST_FLOW_OK) {
481 GST_DEBUG_OBJECT (auparse, "pad alloc flow: %s", gst_flow_get_name (ret));
485 data = gst_adapter_peek (auparse->adapter, sendnow);
486 memcpy (GST_BUFFER_DATA (outbuf), data, sendnow);
487 gst_adapter_flush (auparse->adapter, sendnow);
489 pos = auparse->buffer_offset - auparse->offset;
492 if (auparse->sample_size > 0 && auparse->samplerate > 0) {
493 gst_au_parse_src_convert (auparse, GST_FORMAT_BYTES, pos,
494 GST_FORMAT_DEFAULT, &offset);
495 gst_au_parse_src_convert (auparse, GST_FORMAT_BYTES, pos,
496 GST_FORMAT_TIME, ×tamp);
497 gst_au_parse_src_convert (auparse, GST_FORMAT_BYTES,
498 sendnow, GST_FORMAT_TIME, &duration);
500 GST_BUFFER_OFFSET (outbuf) = offset;
501 GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
502 GST_BUFFER_DURATION (outbuf) = duration;
505 auparse->buffer_offset += sendnow;
507 ret = gst_pad_push (auparse->srcpad, outbuf);
512 gst_object_unref (auparse);
517 gst_au_parse_src_convert (GstAuParse * auparse, GstFormat src_format,
518 gint64 srcval, GstFormat dest_format, gint64 * destval)
521 guint samplesize, rate;
523 if (dest_format == src_format) {
528 GST_OBJECT_LOCK (auparse);
529 samplesize = auparse->sample_size;
530 rate = auparse->samplerate;
531 GST_OBJECT_UNLOCK (auparse);
533 if (samplesize == 0 || rate == 0) {
534 GST_LOG_OBJECT (auparse, "cannot convert, sample_size or rate unknown");
538 switch (src_format) {
539 case GST_FORMAT_BYTES:
540 srcval /= samplesize;
542 case GST_FORMAT_DEFAULT:{
543 switch (dest_format) {
544 case GST_FORMAT_DEFAULT:
547 case GST_FORMAT_BYTES:
548 *destval = srcval * samplesize;
550 case GST_FORMAT_TIME:
551 *destval = gst_util_uint64_scale_int (srcval, GST_SECOND, rate);
559 case GST_FORMAT_TIME:{
560 switch (dest_format) {
561 case GST_FORMAT_BYTES:
562 *destval = samplesize *
563 gst_util_uint64_scale_int (srcval, rate, GST_SECOND);
565 case GST_FORMAT_DEFAULT:
566 *destval = gst_util_uint64_scale_int (srcval, rate, GST_SECOND);
581 GST_DEBUG_OBJECT (auparse, "could not convert from %s to %s format",
582 gst_format_get_name (src_format), gst_format_get_name (dest_format));
589 gst_au_parse_src_query (GstPad * pad, GstQuery * query)
592 gboolean ret = FALSE;
594 auparse = GST_AU_PARSE (gst_pad_get_parent (pad));
596 switch (GST_QUERY_TYPE (query)) {
597 case GST_QUERY_DURATION:{
598 GstFormat bformat = GST_FORMAT_BYTES;
602 gst_query_parse_duration (query, &format, NULL);
603 if (!gst_pad_query_peer_duration (auparse->sinkpad, &bformat, &len)) {
604 GST_DEBUG_OBJECT (auparse, "failed to query upstream length");
607 GST_OBJECT_LOCK (auparse);
608 len -= auparse->offset;
609 GST_OBJECT_UNLOCK (auparse);
611 ret = gst_au_parse_src_convert (auparse, bformat, len, format, &val);
614 gst_query_set_duration (query, format, val);
618 case GST_QUERY_POSITION:{
619 GstFormat bformat = GST_FORMAT_BYTES;
623 gst_query_parse_position (query, &format, NULL);
624 if (!gst_pad_query_peer_position (auparse->sinkpad, &bformat, &pos)) {
625 GST_DEBUG_OBJECT (auparse, "failed to query upstream position");
628 GST_OBJECT_LOCK (auparse);
629 pos -= auparse->offset;
630 GST_OBJECT_UNLOCK (auparse);
632 ret = gst_au_parse_src_convert (auparse, GST_FORMAT_BYTES, pos,
636 gst_query_set_position (query, format, val);
640 case GST_QUERY_SEEKING:{
643 gst_query_parse_seeking (query, &format, NULL, NULL, NULL);
644 /* FIXME: query duration in 'format'
645 gst_query_set_seeking (query, format, TRUE, 0, duration);
647 gst_query_set_seeking (query, format, TRUE, 0, GST_CLOCK_TIME_NONE);
652 ret = gst_pad_query_default (pad, query);
656 gst_object_unref (auparse);
661 gst_au_parse_handle_seek (GstAuParse * auparse, GstEvent * event)
663 GstSeekType start_type, stop_type;
670 gst_event_parse_seek (event, &rate, &format, &flags, &start_type, &start,
673 if (format != GST_FORMAT_TIME) {
674 GST_DEBUG_OBJECT (auparse, "only support seeks in TIME format");
678 res = gst_au_parse_src_convert (auparse, GST_FORMAT_TIME, start,
679 GST_FORMAT_BYTES, &start);
682 res = gst_au_parse_src_convert (auparse, GST_FORMAT_TIME, stop,
683 GST_FORMAT_BYTES, &stop);
686 GST_INFO_OBJECT (auparse,
687 "seeking: %" G_GINT64_FORMAT " ... %" G_GINT64_FORMAT, start, stop);
689 event = gst_event_new_seek (rate, GST_FORMAT_BYTES, flags, start_type, start,
691 res = gst_pad_push_event (auparse->sinkpad, event);
696 gst_au_parse_sink_event (GstPad * pad, GstEvent * event)
701 auparse = GST_AU_PARSE (gst_pad_get_parent (pad));
703 switch (GST_EVENT_TYPE (event)) {
704 case GST_EVENT_NEWSEGMENT:
708 gint64 start, stop, time, offset = 0;
711 GstEvent *new_event = NULL;
713 gst_segment_init (&segment, GST_FORMAT_UNDEFINED);
714 gst_event_parse_new_segment_full (event, &update, &rate, &arate, &format,
715 &start, &stop, &time);
716 gst_segment_set_newsegment_full (&segment, update, rate, arate, format,
719 if (auparse->sample_size > 0) {
722 start -= auparse->offset;
723 start = MAX (start, 0);
726 stop -= auparse->offset;
727 stop = MAX (stop, 0);
729 gst_au_parse_src_convert (auparse, GST_FORMAT_BYTES, start,
730 GST_FORMAT_TIME, &start);
731 gst_au_parse_src_convert (auparse, GST_FORMAT_BYTES, stop,
732 GST_FORMAT_TIME, &stop);
735 if (auparse->srcpad) {
736 GST_INFO_OBJECT (auparse,
737 "new segment: %" GST_TIME_FORMAT " ... %" GST_TIME_FORMAT,
738 GST_TIME_ARGS (start), GST_TIME_ARGS (stop));
740 new_event = gst_event_new_new_segment_full (update, rate, arate,
741 GST_FORMAT_TIME, start, stop, start);
743 ret = gst_pad_push_event (auparse->srcpad, new_event);
746 auparse->buffer_offset = offset;
748 gst_event_unref (event);
752 if (!auparse->srcpad) {
753 GST_ELEMENT_ERROR (auparse, STREAM, WRONG_TYPE,
754 ("No valid input found before end of stream"), (NULL));
758 ret = gst_pad_event_default (pad, event);
762 gst_object_unref (auparse);
767 gst_au_parse_src_event (GstPad * pad, GstEvent * event)
772 auparse = GST_AU_PARSE (gst_pad_get_parent (pad));
774 switch (GST_EVENT_TYPE (event)) {
776 ret = gst_au_parse_handle_seek (auparse, event);
779 ret = gst_pad_event_default (pad, event);
783 gst_object_unref (auparse);
787 static GstStateChangeReturn
788 gst_au_parse_change_state (GstElement * element, GstStateChange transition)
790 GstAuParse *auparse = GST_AU_PARSE (element);
791 GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
793 ret = parent_class->change_state (element, transition);
794 if (ret == GST_STATE_CHANGE_FAILURE)
797 switch (transition) {
798 case GST_STATE_CHANGE_PAUSED_TO_READY:
799 gst_au_parse_reset (auparse);
808 plugin_init (GstPlugin * plugin)
810 if (!gst_element_register (plugin, "auparse", GST_RANK_SECONDARY,
811 GST_TYPE_AU_PARSE)) {
818 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
821 "parses au streams", plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME,