-lgstriff-@GST_API_VERSION@ \
-lgstaudio-@GST_API_VERSION@ \
-lgsttag-@GST_API_VERSION@ \
+ -lgstpbutils-@GST_API_VERSION@ \
$(GST_BASE_LIBS) \
$(GST_LIBS) \
$(LIBM)
#include "gstwavparse.h"
#include "gst/riff/riff-media.h"
#include <gst/base/gsttypefindhelper.h>
+#include <gst/pbutils/descriptions.h>
#include <gst/gst-i18n-plugin.h>
GST_DEBUG_CATEGORY_STATIC (wavparse_debug);
wav->got_fmt = TRUE;
- if (codec_name) {
+ if (wav->tags == NULL)
wav->tags = gst_tag_list_new_empty ();
+ {
+ GstCaps *templ_caps = gst_pad_get_pad_template_caps (wav->sinkpad);
+ gst_pb_utils_add_codec_description_to_tag_list (wav->tags,
+ GST_TAG_CONTAINER_FORMAT, templ_caps);
+ gst_caps_unref (templ_caps);
+ }
+
+ /* If bps is nonzero, then we do have a valid bitrate that can be
+ * announced in a tag list. */
+ if (wav->bps) {
+ guint bitrate = wav->bps * 8;
+ gst_tag_list_add (wav->tags, GST_TAG_MERGE_REPLACE,
+ GST_TAG_BITRATE, bitrate, NULL);
+ }
+
+ if (codec_name) {
gst_tag_list_add (wav->tags, GST_TAG_MERGE_REPLACE,
GST_TAG_AUDIO_CODEC, codec_name, NULL);