diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2009-06-19 00:15:51 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2009-06-22 10:49:02 +0100 |
commit | 98fa27dcd129dd8034405ffb19fb6d5b03aadebb (patch) | |
tree | 0bcf8ec78fb59afc25b8100222e2c41de0d39256 | |
parent | d0056049d3f9f225d2295bd0b2d39f6cc1b5b55b (diff) |
id3demux: add container-format tag
Using pbutils here because the string is translated.
-rw-r--r-- | gst/id3demux/Makefile.am | 3 | ||||
-rw-r--r-- | gst/id3demux/gstid3demux.c | 19 |
2 files changed, 19 insertions, 3 deletions
diff --git a/gst/id3demux/Makefile.am b/gst/id3demux/Makefile.am index f3cdd15f..3f004437 100644 --- a/gst/id3demux/Makefile.am +++ b/gst/id3demux/Makefile.am @@ -2,7 +2,8 @@ plugin_LTLIBRARIES = libgstid3demux.la libgstid3demux_la_SOURCES = gstid3demux.c id3tags.c id3v2frames.c libgstid3demux_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) -libgstid3demux_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgsttag-@GST_MAJORMINOR@ $(GST_BASE_LIBS) $(ZLIB_LIBS) +libgstid3demux_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgsttag-@GST_MAJORMINOR@ \ + -lgstpbutils-@GST_MAJORMINOR@ $(GST_BASE_LIBS) $(ZLIB_LIBS) libgstid3demux_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstid3demux_la_LIBTOOLFLAGS = --tag=disable-static diff --git a/gst/id3demux/gstid3demux.c b/gst/id3demux/gstid3demux.c index 3e7a2b73..1b0210b2 100644 --- a/gst/id3demux/gstid3demux.c +++ b/gst/id3demux/gstid3demux.c @@ -51,6 +51,7 @@ #include <gst/gst.h> #include <gst/gst-i18n-plugin.h> #include <gst/tag/tag.h> +#include <gst/pbutils/pbutils.h> #include <string.h> #include "gstid3demux.h" @@ -164,6 +165,17 @@ no_marker: } } +static void +gst_id3demux_add_container_format (GstTagList * tags) +{ + GstCaps *sink_caps; + + sink_caps = gst_static_pad_template_get_caps (&sink_factory); + gst_pb_utils_add_codec_description_to_tag_list (tags, + GST_TAG_CONTAINER_FORMAT, sink_caps); + gst_caps_unref (sink_caps); +} + static GstTagDemuxResult gst_id3demux_parse_tag (GstTagDemux * demux, GstBuffer * buffer, gboolean start_tag, guint * tag_size, GstTagList ** tags) @@ -173,16 +185,19 @@ gst_id3demux_parse_tag (GstTagDemux * demux, GstBuffer * buffer, res = id3demux_read_id3v2_tag (buffer, tag_size, tags); - if (G_LIKELY (res == ID3TAGS_READ_TAG)) + if (G_LIKELY (res == ID3TAGS_READ_TAG)) { + gst_id3demux_add_container_format (*tags); return GST_TAG_DEMUX_RESULT_OK; - else + } else { return GST_TAG_DEMUX_RESULT_BROKEN_TAG; + } } else { *tags = gst_tag_list_new_from_id3v1 (GST_BUFFER_DATA (buffer)); if (G_UNLIKELY (*tags == NULL)) return GST_TAG_DEMUX_RESULT_BROKEN_TAG; + gst_id3demux_add_container_format (*tags); *tag_size = ID3V1_TAG_SIZE; return GST_TAG_DEMUX_RESULT_OK; } |