Send seek event to baseparse when aacparse seek failed in push mode
[platform/upstream/gst-plugins-good.git] / gst / icydemux / gsticydemux.c
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */
2 /* Copyright 2005 Jan Schmidt <thaytan@mad.scientist.com>
3  *           2006 Michael Smith <msmith@fluendo.com>
4  * Copyright (C) 2003-2004 Benjamin Otte <otte@gnome.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21
22 /**
23  * SECTION:element-icydemux
24  *
25  * icydemux accepts data streams with ICY metadata at known intervals, as
26  * transmitted from an upstream element (usually read as response headers from
27  * an HTTP stream). The mime type of the data between the tag blocks is
28  * detected using typefind functions, and the appropriate output mime type set
29  * on outgoing buffers. 
30  *
31  * <refsect2>
32  * <title>Example launch line</title>
33  * |[
34  * gst-launch-1.0 souphttpsrc location=http://some.server/ iradio-mode=true ! icydemux ! fakesink -t
35  * ]| This pipeline should read any available ICY tag information and output it.
36  * The contents of the stream should be detected, and the appropriate mime
37  * type set on buffers produced from icydemux. (Using gnomevfssrc, neonhttpsrc
38  * or giosrc instead of souphttpsrc should also work.)
39  * </refsect2>
40  */
41 #ifdef HAVE_CONFIG_H
42 #include "config.h"
43 #endif
44 #include <gst/gst.h>
45 #include <gst/gst-i18n-plugin.h>
46 #include <gst/tag/tag.h>
47
48 #include "gsticydemux.h"
49
50 #include <string.h>
51
52 #define ICY_TYPE_FIND_MAX_SIZE (40*1024)
53
54 GST_DEBUG_CATEGORY_STATIC (icydemux_debug);
55 #define GST_CAT_DEFAULT (icydemux_debug)
56
57 static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
58     GST_PAD_SINK,
59     GST_PAD_ALWAYS,
60     GST_STATIC_CAPS ("application/x-icy, metadata-interval = (int)[0, MAX]")
61     );
62
63 static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
64     GST_PAD_SRC,
65     GST_PAD_SOMETIMES,
66     GST_STATIC_CAPS ("ANY")
67     );
68
69 static void gst_icydemux_dispose (GObject * object);
70
71 static GstFlowReturn gst_icydemux_chain (GstPad * pad, GstObject * parent,
72     GstBuffer * buf);
73 static gboolean gst_icydemux_handle_event (GstPad * pad, GstObject * parent,
74     GstEvent * event);
75
76 static gboolean gst_icydemux_add_srcpad (GstICYDemux * icydemux,
77     GstCaps * new_caps);
78 static gboolean gst_icydemux_remove_srcpad (GstICYDemux * icydemux);
79
80 static GstStateChangeReturn gst_icydemux_change_state (GstElement * element,
81     GstStateChange transition);
82 static gboolean gst_icydemux_sink_setcaps (GstPad * pad, GstCaps * caps);
83
84 static gboolean gst_icydemux_send_tag_event (GstICYDemux * icydemux,
85     GstTagList * taglist);
86
87
88 #define gst_icydemux_parent_class parent_class
89 G_DEFINE_TYPE (GstICYDemux, gst_icydemux, GST_TYPE_ELEMENT);
90
91 static void
92 gst_icydemux_class_init (GstICYDemuxClass * klass)
93 {
94   GObjectClass *gobject_class;
95   GstElementClass *gstelement_class;
96
97   gobject_class = (GObjectClass *) klass;
98   gstelement_class = (GstElementClass *) klass;
99
100   parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
101
102   gobject_class->dispose = gst_icydemux_dispose;
103
104   gstelement_class->change_state = gst_icydemux_change_state;
105
106   gst_element_class_add_static_pad_template (gstelement_class, &src_factory);
107   gst_element_class_add_static_pad_template (gstelement_class, &sink_factory);
108
109   gst_element_class_set_static_metadata (gstelement_class, "ICY tag demuxer",
110       "Codec/Demuxer/Metadata",
111       "Read and output ICY tags while demuxing the contents",
112       "Jan Schmidt <thaytan@mad.scientist.com>, "
113       "Michael Smith <msmith@fluendo.com>");
114 }
115
116 static void
117 gst_icydemux_reset (GstICYDemux * icydemux)
118 {
119   /* Unknown at the moment (this is a fatal error if don't have a value by the
120    * time we get to our chain function)
121    */
122   icydemux->meta_interval = -1;
123   icydemux->remaining = 0;
124
125   icydemux->typefinding = TRUE;
126
127   gst_caps_replace (&(icydemux->src_caps), NULL);
128
129   gst_icydemux_remove_srcpad (icydemux);
130
131   if (icydemux->cached_tags) {
132     gst_tag_list_unref (icydemux->cached_tags);
133     icydemux->cached_tags = NULL;
134   }
135
136   if (icydemux->cached_events) {
137     g_list_foreach (icydemux->cached_events,
138         (GFunc) gst_mini_object_unref, NULL);
139     g_list_free (icydemux->cached_events);
140     icydemux->cached_events = NULL;
141   }
142
143   if (icydemux->meta_adapter) {
144     gst_adapter_clear (icydemux->meta_adapter);
145     g_object_unref (icydemux->meta_adapter);
146     icydemux->meta_adapter = NULL;
147   }
148
149   if (icydemux->typefind_buf) {
150     gst_buffer_unref (icydemux->typefind_buf);
151     icydemux->typefind_buf = NULL;
152   }
153
154   if (icydemux->content_type) {
155     g_free (icydemux->content_type);
156     icydemux->content_type = NULL;
157   }
158 }
159
160 static void
161 gst_icydemux_init (GstICYDemux * icydemux)
162 {
163   GstElementClass *klass = GST_ELEMENT_GET_CLASS (icydemux);
164
165   icydemux->sinkpad =
166       gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
167           "sink"), "sink");
168   gst_pad_set_chain_function (icydemux->sinkpad,
169       GST_DEBUG_FUNCPTR (gst_icydemux_chain));
170   gst_pad_set_event_function (icydemux->sinkpad,
171       GST_DEBUG_FUNCPTR (gst_icydemux_handle_event));
172   gst_element_add_pad (GST_ELEMENT (icydemux), icydemux->sinkpad);
173
174   gst_icydemux_reset (icydemux);
175 }
176
177 static gboolean
178 gst_icydemux_sink_setcaps (GstPad * pad, GstCaps * caps)
179 {
180   GstICYDemux *icydemux = GST_ICYDEMUX (GST_PAD_PARENT (pad));
181   GstStructure *structure = gst_caps_get_structure (caps, 0);
182   const gchar *tmp;
183
184   if (!gst_structure_get_int (structure, "metadata-interval",
185           &icydemux->meta_interval))
186     return FALSE;
187
188   /* If incoming caps have the HTTP Content-Type, copy that over */
189   if ((tmp = gst_structure_get_string (structure, "content-type")))
190     icydemux->content_type = g_strdup (tmp);
191
192   /* We have a meta interval, so initialise the rest */
193   icydemux->remaining = icydemux->meta_interval;
194   icydemux->meta_remaining = 0;
195   return TRUE;
196 }
197
198 static void
199 gst_icydemux_dispose (GObject * object)
200 {
201   GstICYDemux *icydemux = GST_ICYDEMUX (object);
202
203   gst_icydemux_reset (icydemux);
204
205   G_OBJECT_CLASS (parent_class)->dispose (object);
206 }
207
208 typedef struct
209 {
210   GstCaps *caps;
211   GstPad *pad;
212 } CopyStickyEventsData;
213
214 static gboolean
215 copy_sticky_events (GstPad * pad, GstEvent ** event, gpointer user_data)
216 {
217   CopyStickyEventsData *data = user_data;
218
219   if (GST_EVENT_TYPE (*event) >= GST_EVENT_CAPS && data->caps) {
220     gst_pad_set_caps (data->pad, data->caps);
221     data->caps = NULL;
222   }
223
224   if (GST_EVENT_TYPE (*event) != GST_EVENT_CAPS)
225     gst_pad_push_event (data->pad, gst_event_ref (*event));
226
227   return TRUE;
228 }
229
230 static gboolean
231 gst_icydemux_add_srcpad (GstICYDemux * icydemux, GstCaps * new_caps)
232 {
233   if (icydemux->src_caps == NULL ||
234       !gst_caps_is_equal (new_caps, icydemux->src_caps)) {
235     gst_caps_replace (&(icydemux->src_caps), new_caps);
236     if (icydemux->srcpad != NULL) {
237       GST_DEBUG_OBJECT (icydemux, "Changing src pad caps to %" GST_PTR_FORMAT,
238           icydemux->src_caps);
239
240       gst_pad_set_caps (icydemux->srcpad, icydemux->src_caps);
241     }
242   } else {
243     /* Caps never changed */
244     gst_caps_unref (new_caps);
245   }
246
247   if (icydemux->srcpad == NULL) {
248     CopyStickyEventsData data;
249
250     icydemux->srcpad =
251         gst_pad_new_from_template (gst_element_class_get_pad_template
252         (GST_ELEMENT_GET_CLASS (icydemux), "src"), "src");
253     g_return_val_if_fail (icydemux->srcpad != NULL, FALSE);
254
255     gst_pad_use_fixed_caps (icydemux->srcpad);
256     gst_pad_set_active (icydemux->srcpad, TRUE);
257
258     data.pad = icydemux->srcpad;
259     data.caps = icydemux->src_caps;
260     gst_pad_sticky_events_foreach (icydemux->sinkpad, copy_sticky_events,
261         &data);
262     if (data.caps)
263       gst_pad_set_caps (data.pad, data.caps);
264
265     GST_DEBUG_OBJECT (icydemux, "Adding src pad with caps %" GST_PTR_FORMAT,
266         icydemux->src_caps);
267
268     if (!(gst_element_add_pad (GST_ELEMENT (icydemux), icydemux->srcpad)))
269       return FALSE;
270     gst_element_no_more_pads (GST_ELEMENT (icydemux));
271   }
272
273   return TRUE;
274 }
275
276 static gboolean
277 gst_icydemux_remove_srcpad (GstICYDemux * icydemux)
278 {
279   gboolean res = TRUE;
280
281   if (icydemux->srcpad != NULL) {
282     res = gst_element_remove_pad (GST_ELEMENT (icydemux), icydemux->srcpad);
283     g_return_val_if_fail (res != FALSE, FALSE);
284     icydemux->srcpad = NULL;
285   }
286
287   return res;
288 };
289
290 static gchar *
291 gst_icydemux_unicodify (const gchar * str)
292 {
293   const gchar *env_vars[] = { "GST_ICY_TAG_ENCODING",
294     "GST_TAG_ENCODING", NULL
295   };
296
297   return gst_tag_freeform_string_to_utf8 (str, -1, env_vars);
298 }
299
300 /* takes ownership of tag list */
301 static gboolean
302 gst_icydemux_tag_found (GstICYDemux * icydemux, GstTagList * tags)
303 {
304   /* send the tag event if we have finished typefinding and have a src pad */
305   if (icydemux->srcpad)
306     return gst_icydemux_send_tag_event (icydemux, tags);
307
308   /* if we haven't a source pad yet, cache the tags */
309   if (!icydemux->cached_tags) {
310     icydemux->cached_tags = tags;
311   } else {
312     gst_tag_list_insert (icydemux->cached_tags, tags,
313         GST_TAG_MERGE_REPLACE_ALL);
314     gst_tag_list_unref (tags);
315   }
316
317   return TRUE;
318 }
319
320 static void
321 gst_icydemux_parse_and_send_tags (GstICYDemux * icydemux)
322 {
323   GstTagList *tags;
324   const guint8 *data;
325   int length, i;
326   gboolean tags_found = FALSE;
327   gchar *buffer;
328   gchar **strings;
329
330   length = gst_adapter_available (icydemux->meta_adapter);
331
332   data = gst_adapter_map (icydemux->meta_adapter, length);
333
334   /* Now, copy this to a buffer where we can NULL-terminate it to make things
335    * a bit easier, then do that parsing. */
336   buffer = g_strndup ((const gchar *) data, length);
337
338   tags = gst_tag_list_new_empty ();
339   strings = g_strsplit (buffer, "';", 0);
340
341   for (i = 0; strings[i]; i++) {
342     if (!g_ascii_strncasecmp (strings[i], "StreamTitle=", 12)) {
343       char *title = gst_icydemux_unicodify (strings[i] + 13);
344       tags_found = TRUE;
345
346       if (title && *title) {
347         gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_TITLE,
348             title, NULL);
349         g_free (title);
350       }
351     } else if (!g_ascii_strncasecmp (strings[i], "StreamUrl=", 10)) {
352       char *url = gst_icydemux_unicodify (strings[i] + 11);
353       tags_found = TRUE;
354
355       if (url && *url) {
356         gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_HOMEPAGE,
357             url, NULL);
358         g_free (url);
359       }
360     }
361   }
362
363   g_strfreev (strings);
364   g_free (buffer);
365   gst_adapter_unmap (icydemux->meta_adapter);
366   gst_adapter_flush (icydemux->meta_adapter, length);
367
368   if (tags_found)
369     gst_icydemux_tag_found (icydemux, tags);
370   else
371     gst_tag_list_unref (tags);
372 }
373
374 static gboolean
375 gst_icydemux_handle_event (GstPad * pad, GstObject * parent, GstEvent * event)
376 {
377   GstICYDemux *icydemux = GST_ICYDEMUX (parent);
378   gboolean result;
379
380   switch (GST_EVENT_TYPE (event)) {
381     case GST_EVENT_TAG:
382     {
383       GstTagList *tags;
384
385       gst_event_parse_tag (event, &tags);
386       result = gst_icydemux_tag_found (icydemux, gst_tag_list_copy (tags));
387       gst_event_unref (event);
388       return result;
389     }
390     case GST_EVENT_CAPS:
391     {
392       GstCaps *caps;
393
394       gst_event_parse_caps (event, &caps);
395       result = gst_icydemux_sink_setcaps (pad, caps);
396       gst_event_unref (event);
397       return result;
398     }
399     default:
400       break;
401   }
402
403   if (icydemux->typefinding) {
404     switch (GST_EVENT_TYPE (event)) {
405       case GST_EVENT_FLUSH_STOP:
406         g_list_foreach (icydemux->cached_events,
407             (GFunc) gst_mini_object_unref, NULL);
408         g_list_free (icydemux->cached_events);
409         icydemux->cached_events = NULL;
410
411         return gst_pad_event_default (pad, parent, event);
412       default:
413         if (!GST_EVENT_IS_STICKY (event)) {
414           icydemux->cached_events =
415               g_list_append (icydemux->cached_events, event);
416         } else {
417           gst_event_unref (event);
418         }
419         return TRUE;
420     }
421   } else {
422     return gst_pad_event_default (pad, parent, event);
423   }
424 }
425
426 static void
427 gst_icydemux_send_cached_events (GstICYDemux * icydemux)
428 {
429   GList *l;
430
431   for (l = icydemux->cached_events; l != NULL; l = l->next) {
432     GstEvent *event = GST_EVENT (l->data);
433
434     gst_pad_push_event (icydemux->srcpad, event);
435   }
436   g_list_free (icydemux->cached_events);
437   icydemux->cached_events = NULL;
438 }
439
440 static GstFlowReturn
441 gst_icydemux_typefind_or_forward (GstICYDemux * icydemux, GstBuffer * buf)
442 {
443   if (icydemux->typefinding) {
444     GstBuffer *tf_buf;
445     GstCaps *caps = NULL;
446     GstTypeFindProbability prob;
447
448     /* If we have a content-type from upstream, let's see if we can shortcut
449      * typefinding */
450     if (G_UNLIKELY (icydemux->content_type)) {
451       if (!g_ascii_strcasecmp (icydemux->content_type, "video/nsv")) {
452         GST_DEBUG ("We have a NSV stream");
453         caps = gst_caps_new_empty_simple ("video/x-nsv");
454       } else {
455         GST_DEBUG ("Upstream Content-Type isn't supported");
456         g_free (icydemux->content_type);
457         icydemux->content_type = NULL;
458       }
459     }
460
461     if (icydemux->typefind_buf) {
462       icydemux->typefind_buf = gst_buffer_append (icydemux->typefind_buf, buf);
463     } else {
464       icydemux->typefind_buf = buf;
465     }
466
467     /* Only typefind if we haven't already got some caps */
468     if (caps == NULL) {
469       caps = gst_type_find_helper_for_buffer (GST_OBJECT (icydemux),
470           icydemux->typefind_buf, &prob);
471
472       if (caps == NULL) {
473         if (gst_buffer_get_size (icydemux->typefind_buf) <
474             ICY_TYPE_FIND_MAX_SIZE) {
475           /* Just break for more data */
476           return GST_FLOW_OK;
477         }
478
479         /* We failed typefind */
480         GST_ELEMENT_ERROR (icydemux, STREAM, TYPE_NOT_FOUND, (NULL),
481             ("No caps found for contents within an ICY stream"));
482         gst_buffer_unref (icydemux->typefind_buf);
483         icydemux->typefind_buf = NULL;
484         return GST_FLOW_ERROR;
485       }
486     }
487
488     if (!gst_icydemux_add_srcpad (icydemux, caps)) {
489       GST_DEBUG_OBJECT (icydemux, "Failed to add srcpad");
490       gst_caps_unref (caps);
491       gst_buffer_unref (icydemux->typefind_buf);
492       icydemux->typefind_buf = NULL;
493       return GST_FLOW_ERROR;
494     }
495     gst_caps_unref (caps);
496
497     if (icydemux->cached_events) {
498       gst_icydemux_send_cached_events (icydemux);
499     }
500
501     if (icydemux->cached_tags) {
502       gst_icydemux_send_tag_event (icydemux, icydemux->cached_tags);
503       icydemux->cached_tags = NULL;
504     }
505
506     /* Move onto streaming: call ourselves recursively with the typefind buffer
507      * to get that forwarded. */
508     icydemux->typefinding = FALSE;
509
510     tf_buf = icydemux->typefind_buf;
511     icydemux->typefind_buf = NULL;
512     return gst_icydemux_typefind_or_forward (icydemux, tf_buf);
513   } else {
514     if (G_UNLIKELY (icydemux->srcpad == NULL)) {
515       gst_buffer_unref (buf);
516       return GST_FLOW_ERROR;
517     }
518
519     buf = gst_buffer_make_writable (buf);
520
521     /* Most things don't care, and it's a pain to track (we should preserve a
522      * 0 offset on the first buffer though if it's there, for id3demux etc.) */
523     if (GST_BUFFER_OFFSET (buf) != 0) {
524       GST_BUFFER_OFFSET (buf) = GST_BUFFER_OFFSET_NONE;
525     }
526
527     return gst_pad_push (icydemux->srcpad, buf);
528   }
529 }
530
531 static void
532 gst_icydemux_add_meta (GstICYDemux * icydemux, GstBuffer * buf)
533 {
534   if (!icydemux->meta_adapter)
535     icydemux->meta_adapter = gst_adapter_new ();
536
537   gst_adapter_push (icydemux->meta_adapter, buf);
538 }
539
540 static GstFlowReturn
541 gst_icydemux_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
542 {
543   GstICYDemux *icydemux;
544   guint size, chunk, offset;
545   GstBuffer *sub;
546   GstFlowReturn ret = GST_FLOW_OK;
547
548   icydemux = GST_ICYDEMUX (parent);
549
550   if (G_UNLIKELY (icydemux->meta_interval < 0))
551     goto not_negotiated;
552
553   if (icydemux->meta_interval == 0) {
554     ret = gst_icydemux_typefind_or_forward (icydemux, buf);
555     buf = NULL;
556     goto done;
557   }
558
559   /* Go through the buffer, chopping it into appropriate chunks. Forward as
560    * tags or buffers, as appropriate
561    */
562   size = gst_buffer_get_size (buf);
563   offset = 0;
564   while (size) {
565     if (icydemux->remaining) {
566       chunk = (size <= icydemux->remaining) ? size : icydemux->remaining;
567       if (offset == 0 && chunk == size) {
568         sub = buf;
569         buf = NULL;
570       } else {
571         sub = gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL, offset, chunk);
572       }
573       offset += chunk;
574       icydemux->remaining -= chunk;
575       size -= chunk;
576
577       /* This buffer goes onto typefinding, and/or directly pushed out */
578       ret = gst_icydemux_typefind_or_forward (icydemux, sub);
579       if (ret != GST_FLOW_OK)
580         goto done;
581     } else if (icydemux->meta_remaining) {
582       chunk = (size <= icydemux->meta_remaining) ?
583           size : icydemux->meta_remaining;
584       sub = gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL, offset, chunk);
585       gst_icydemux_add_meta (icydemux, sub);
586
587       offset += chunk;
588       icydemux->meta_remaining -= chunk;
589       size -= chunk;
590
591       if (icydemux->meta_remaining == 0) {
592         /* Parse tags from meta_adapter, send off as tag messages */
593         GST_DEBUG_OBJECT (icydemux, "No remaining metadata, parsing for tags");
594         gst_icydemux_parse_and_send_tags (icydemux);
595
596         icydemux->remaining = icydemux->meta_interval;
597       }
598     } else {
599       guint8 byte;
600       /* We need to read a single byte (always safe at this point in the loop)
601        * to figure out how many bytes of metadata exist. 
602        * The 'spec' tells us to read 16 * (byte_value) bytes of metadata after
603        * this (zero is common, and means the metadata hasn't changed).
604        */
605       gst_buffer_extract (buf, offset, &byte, 1);
606       icydemux->meta_remaining = 16 * byte;
607       if (icydemux->meta_remaining == 0)
608         icydemux->remaining = icydemux->meta_interval;
609
610       offset += 1;
611       size -= 1;
612     }
613   }
614
615 done:
616   if (buf)
617     gst_buffer_unref (buf);
618
619   return ret;
620
621   /* ERRORS */
622 not_negotiated:
623   {
624     GST_WARNING_OBJECT (icydemux, "meta_interval not set, buffer probably had "
625         "no caps set. Try enabling iradio-mode on the http source element");
626     gst_buffer_unref (buf);
627     return GST_FLOW_NOT_NEGOTIATED;
628   }
629 }
630
631 static GstStateChangeReturn
632 gst_icydemux_change_state (GstElement * element, GstStateChange transition)
633 {
634   GstStateChangeReturn ret;
635   GstICYDemux *icydemux = GST_ICYDEMUX (element);
636
637   ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
638
639   switch (transition) {
640     case GST_STATE_CHANGE_PAUSED_TO_READY:
641       gst_icydemux_reset (icydemux);
642       break;
643     default:
644       break;
645   }
646   return ret;
647 }
648
649 /* takes ownership of tag list */
650 static gboolean
651 gst_icydemux_send_tag_event (GstICYDemux * icydemux, GstTagList * tags)
652 {
653   GstEvent *event;
654
655   event = gst_event_new_tag (tags);
656
657   GST_DEBUG_OBJECT (icydemux, "Sending tag event on src pad");
658   return gst_pad_push_event (icydemux->srcpad, event);
659
660 }
661
662 static gboolean
663 plugin_init (GstPlugin * plugin)
664 {
665   GST_DEBUG_CATEGORY_INIT (icydemux_debug, "icydemux", 0,
666       "GStreamer ICY tag demuxer");
667
668   return gst_element_register (plugin, "icydemux",
669       GST_RANK_PRIMARY, GST_TYPE_ICYDEMUX);
670 }
671
672 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
673     GST_VERSION_MINOR,
674     icydemux,
675     "Demux ICY tags from a stream",
676     plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)