#include "gstbaseaudiodecoder.h"
#include <gst/audio/audio.h>
#include <gst/base/gstadapter.h>
+#include <gst/pbutils/descriptions.h>
#include <string.h>
guint64 samples_out;
/* bytes flushed during parsing */
guint sync_flush;
+ /* codec id tag */
+ GstTagList *taglist;
/* whether circumstances allow output aggregation */
gint agg;
g_free (dec->ctx->state.channel_pos);
memset (dec->ctx, 0, sizeof (dec->ctx));
+ if (dec->priv->taglist) {
+ gst_tag_list_free (dec->priv->taglist);
+ dec->priv->taglist = NULL;
+ }
+
gst_segment_init (&dec->segment, GST_FORMAT_TIME);
}
GST_DEBUG_OBJECT (dec, "caps: %" GST_PTR_FORMAT, caps);
+ /* NOTE pbutils only needed here */
+ /* TODO maybe (only) upstream demuxer/parser etc should handle this ? */
+ if (dec->priv->taglist)
+ gst_tag_list_free (dec->priv->taglist);
+ dec->priv->taglist = gst_tag_list_new ();
+ gst_pb_utils_add_codec_description_to_tag_list (dec->priv->taglist,
+ GST_TAG_AUDIO_CODEC, caps);
+
if (klass->set_format)
res = klass->set_format (dec, caps);
}
if (G_LIKELY (buf)) {
+
+ /* delayed one-shot stuff until confirmed data */
+ if (priv->taglist) {
+ GST_DEBUG_OBJECT (dec, "codec tag %" GST_PTR_FORMAT, priv->taglist);
+ if (gst_tag_list_is_empty (priv->taglist)) {
+ gst_tag_list_free (priv->taglist);
+ } else {
+ gst_element_found_tags (GST_ELEMENT (dec), priv->taglist);
+ }
+ priv->taglist = NULL;
+ }
+
buf = gst_buffer_make_metadata_writable (buf);
if (G_LIKELY (GST_CLOCK_TIME_IS_VALID (priv->base_ts))) {
GST_BUFFER_TIMESTAMP (buf) =