From 98fa27dcd129dd8034405ffb19fb6d5b03aadebb Mon Sep 17 00:00:00 2001 From: Tim-Philipp Müller Date: Fri, 19 Jun 2009 00:15:51 +0100 Subject: id3demux: add container-format tag Using pbutils here because the string is translated. --- gst/id3demux/Makefile.am | 3 ++- gst/id3demux/gstid3demux.c | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'gst/id3demux') 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 #include #include +#include #include #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; } -- cgit