From 1905e95ceaf47a26dfc9c79f42e93e926c9f5e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 30 Oct 2011 11:51:58 +0000 Subject: [PATCH] ext, gst: update for taglist API changes --- ext/a52dec/gsta52dec.c | 5 +---- ext/lame/gstlamemp3enc.c | 2 +- ext/mad/gstmad.c | 15 +++++++-------- ext/sidplay/gstsiddec.cc | 2 +- gst/asfdemux/gstasfdemux.c | 24 ++++++++++-------------- gst/dvdlpcmdec/gstdvdlpcmdec.c | 6 ++---- 6 files changed, 22 insertions(+), 32 deletions(-) diff --git a/ext/a52dec/gsta52dec.c b/ext/a52dec/gsta52dec.c index 19faa5d88f..15a06b4c5c 100644 --- a/ext/a52dec/gsta52dec.c +++ b/ext/a52dec/gsta52dec.c @@ -545,10 +545,7 @@ gst_a52dec_update_streaminfo (GstA52Dec * a52dec) { GstTagList *taglist; - taglist = gst_tag_list_new (); - - gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND, - GST_TAG_AUDIO_CODEC, "Dolby Digital (AC-3)", + taglist = gst_tag_list_new (GST_TAG_AUDIO_CODEC, "Dolby Digital (AC-3)", GST_TAG_BITRATE, (guint) a52dec->bit_rate, NULL); gst_element_found_tags_for_pad (GST_ELEMENT (a52dec), diff --git a/ext/lame/gstlamemp3enc.c b/ext/lame/gstlamemp3enc.c index f2269fe7dc..0128a6f9ab 100644 --- a/ext/lame/gstlamemp3enc.c +++ b/ext/lame/gstlamemp3enc.c @@ -602,7 +602,7 @@ gst_lamemp3enc_setup (GstLameMP3Enc * lame, GstTagList ** tags) if (lame->lgf == NULL) return FALSE; - *tags = gst_tag_list_new (); + *tags = gst_tag_list_new_empty (); /* copy the parameters over */ lame_set_in_samplerate (lame->lgf, lame->samplerate); diff --git a/ext/mad/gstmad.c b/ext/mad/gstmad.c index 67cf79c43d..cfe1250349 100644 --- a/ext/mad/gstmad.c +++ b/ext/mad/gstmad.c @@ -26,7 +26,7 @@ * * Example pipelines * |[ - * gst-launch filesrc location=music.mp3 ! mad ! audioconvert ! audioresample ! autoaudiosink + * gst-launch filesrc location=music.mp3 ! mpegaudioparse ! mad ! audioconvert ! audioresample ! autoaudiosink * ]| Decode the mp3 file and play * */ @@ -906,9 +906,7 @@ G_STMT_START{ \ emphasis = g_enum_get_value (g_type_class_peek (GST_TYPE_MAD_EMPHASIS), mad->header.emphasis); - list = gst_tag_list_new (); - gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, - GST_TAG_LAYER, mad->header.layer, + list = gst_tag_list_new (GST_TAG_LAYER, mad->header.layer, GST_TAG_MODE, mode->value_nick, GST_TAG_EMPHASIS, emphasis->value_nick, NULL); if (!mad->framed) { @@ -925,7 +923,7 @@ G_STMT_START{ \ CHECK_HEADER (bitrate, "bitrate"); if (!mad->xing_found && changed) { if (!list) - list = gst_tag_list_new (); + list = gst_tag_list_new_empty (); gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, GST_TAG_BITRATE, mad->header.bitrate, NULL); } @@ -1547,9 +1545,8 @@ gst_mad_chain (GstPad * pad, GstBuffer * buffer) if (mpg123_parse_xing_header (&mad->frame.header, mad->stream.this_frame, frame_len, &bitrate, &time)) { mad->xing_found = TRUE; - list = gst_tag_list_new (); - gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, - GST_TAG_DURATION, (gint64) time * 1000 * 1000 * 1000, + list = gst_tag_list_new (GST_TAG_DURATION, + (gint64) time * 1000 * 1000 * 1000, GST_TAG_BITRATE, bitrate, NULL); gst_element_post_message (GST_ELEMENT (mad), gst_message_new_tag (GST_OBJECT (mad), gst_tag_list_copy (list))); @@ -1852,6 +1849,8 @@ plugin_init (GstPlugin * plugin) { GST_DEBUG_CATEGORY_INIT (mad_debug, "mad", 0, "mad mp3 decoding"); + /* FIXME 0.11: rename to something better like madmp3dec or madmpegaudiodec + * or so? */ return gst_element_register (plugin, "mad", GST_RANK_SECONDARY, gst_mad_get_type ()); } diff --git a/ext/sidplay/gstsiddec.cc b/ext/sidplay/gstsiddec.cc index e59ac57a0d..fa6cbbd2f7 100644 --- a/ext/sidplay/gstsiddec.cc +++ b/ext/sidplay/gstsiddec.cc @@ -257,7 +257,7 @@ update_tags (GstSidDec * siddec) GstTagList *list; if (siddec->tune->getInfo (info)) { - list = gst_tag_list_new (); + list = gst_tag_list_new_empty (); if (info.nameString) { gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c index a1d94bc6cc..3cbdaa8cac 100644 --- a/gst/asfdemux/gstasfdemux.c +++ b/gst/asfdemux/gstasfdemux.c @@ -1390,7 +1390,7 @@ gst_asf_demux_push_complete_payloads (GstASFDemux * demux, gboolean force) /* now post any global tags we may have found */ if (demux->taglist == NULL) - demux->taglist = gst_tag_list_new (); + demux->taglist = gst_tag_list_new_empty (); gst_tag_list_add (demux->taglist, GST_TAG_MERGE_REPLACE, GST_TAG_CONTAINER_FORMAT, "ASF", NULL); @@ -2195,9 +2195,7 @@ gst_asf_demux_add_audio_stream (GstASFDemux * demux, /* Informing about that audio format we just added */ if (codec_name) { - tags = gst_tag_list_new (); - gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_AUDIO_CODEC, - codec_name, NULL); + tags = gst_tag_list_new (GST_TAG_AUDIO_CODEC, codec_name, NULL); g_free (codec_name); } @@ -2279,9 +2277,7 @@ gst_asf_demux_add_video_stream (GstASFDemux * demux, gst_caps_set_simple (caps, "format", G_TYPE_UINT, video->tag, NULL); if (codec_name) { - tags = gst_tag_list_new (); - gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_VIDEO_CODEC, - codec_name, NULL); + tags = gst_tag_list_new (GST_TAG_VIDEO_CODEC, codec_name, NULL); g_free (codec_name); } @@ -2601,7 +2597,7 @@ gst_asf_demux_process_ext_content_desc (GstASFDemux * demux, guint8 * data, GST_INFO_OBJECT (demux, "object is an extended content description"); - taglist = gst_tag_list_new (); + taglist = gst_tag_list_new_empty (); /* Content Descriptor Count */ if (size < 2) @@ -3063,7 +3059,7 @@ gst_asf_demux_process_comment (GstASFDemux * demux, guint8 * data, guint64 size) } /* parse metadata into taglist */ - taglist = gst_tag_list_new (); + taglist = gst_tag_list_new_empty (); g_value_init (&value, G_TYPE_STRING); for (i = 0; i < G_N_ELEMENTS (tags); ++i) { if (tags[i].val_utf8 && strlen (tags[i].val_utf8) > 0 && tags[i].gst_tag) { @@ -3120,10 +3116,10 @@ gst_asf_demux_process_bitrate_props_object (GstASFDemux * demux, guint8 * data, GST_DEBUG_OBJECT (demux, "bitrate of stream %u = %u", stream_id, bitrate); stream = gst_asf_demux_get_stream (demux, stream_id); if (stream) { - if (stream->pending_tags == NULL) - stream->pending_tags = gst_tag_list_new (); - gst_tag_list_add (stream->pending_tags, GST_TAG_MERGE_REPLACE, - GST_TAG_BITRATE, bitrate, NULL); + if (stream->pending_tags == NULL) { + stream->pending_tags = + gst_tag_list_new (GST_TAG_BITRATE, bitrate, NULL); + } } else { GST_WARNING_OBJECT (demux, "Stream id %u wasn't found", stream_id); } @@ -3479,7 +3475,7 @@ done: /* add language info now if we have it */ if (stream->ext_props.lang_idx < demux->num_languages) { if (stream->pending_tags == NULL) - stream->pending_tags = gst_tag_list_new (); + stream->pending_tags = gst_tag_list_new_empty (); GST_LOG_OBJECT (demux, "stream %u has language '%s'", stream->id, demux->languages[stream->ext_props.lang_idx]); gst_tag_list_add (stream->pending_tags, GST_TAG_MERGE_APPEND, diff --git a/gst/dvdlpcmdec/gstdvdlpcmdec.c b/gst/dvdlpcmdec/gstdvdlpcmdec.c index f99be701e6..35dc29d76d 100644 --- a/gst/dvdlpcmdec/gstdvdlpcmdec.c +++ b/gst/dvdlpcmdec/gstdvdlpcmdec.c @@ -219,10 +219,8 @@ gst_dvdlpcmdec_send_tags (GstDvdLpcmDec * dvdlpcmdec) bitrate = bpf * 8 * rate; - taglist = gst_tag_list_new (); - - gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND, - GST_TAG_AUDIO_CODEC, "LPCM Audio", GST_TAG_BITRATE, bitrate, NULL); + taglist = gst_tag_list_new (GST_TAG_AUDIO_CODEC, "LPCM Audio", + GST_TAG_BITRATE, bitrate, NULL); gst_element_found_tags_for_pad (GST_ELEMENT (dvdlpcmdec), dvdlpcmdec->srcpad, taglist);