#include "aiffparse.h"
#include <gst/audio/audio.h>
#include <gst/tag/tag.h>
+#include <gst/pbutils/descriptions.h>
#include <gst/gst-i18n-plugin.h>
GST_DEBUG_CATEGORY (aiffparse_debug);
aiff->bytes_per_sample = aiff->channels * aiff->width / 8;
aiff->bps = aiff->bytes_per_sample * aiff->rate;
+ if (!aiff->tags)
+ aiff->tags = gst_tag_list_new_empty ();
+
+ {
+ GstCaps *templ_caps = gst_pad_get_pad_template_caps (aiff->sinkpad);
+ gst_pb_utils_add_codec_description_to_tag_list (aiff->tags,
+ GST_TAG_CONTAINER_FORMAT, templ_caps);
+ gst_caps_unref (templ_caps);
+ }
+
+ if (aiff->bps) {
+ guint bitrate = aiff->bps * 8;
+
+ GST_DEBUG_OBJECT (aiff, "adding bitrate of %u bps to tag list",
+ bitrate);
+
+ /* At the moment, aiffparse only supports uncompressed PCM data.
+ * Therefore, nominal, actual, minimum, maximum bitrate are the same.
+ * XXX: If AIFF-C support is extended to include compression,
+ * make sure that aiff->bps is set properly. */
+ gst_tag_list_add (aiff->tags, GST_TAG_MERGE_REPLACE,
+ GST_TAG_BITRATE, bitrate, GST_TAG_NOMINAL_BITRATE, bitrate,
+ GST_TAG_MINIMUM_BITRATE, bitrate, GST_TAG_MAXIMUM_BITRATE,
+ bitrate, NULL);
+ }
+
if (aiff->bytes_per_sample <= 0)
goto no_bytes_per_sample;