From 99d73c94e98cc0ea49a295244edb3eb52c05ad67 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 27 Jul 2012 23:59:31 +0200 Subject: [PATCH] tag: Update for taglist/tag event API changes --- ext/ogg/gstoggdemux.c | 5 +++-- ext/ogg/gstogmparse.c | 4 ++-- ext/theora/gsttheoradec.c | 2 +- ext/vorbis/gstvorbisdec.c | 9 +-------- gst-libs/gst/audio/gstaudiocdsrc.c | 3 +-- gst-libs/gst/audio/gstaudiodecoder.c | 3 +-- gst-libs/gst/audio/gstaudioencoder.c | 4 ++-- gst-libs/gst/tag/gsttagdemux.c | 7 +------ gst-libs/gst/tag/gsttagmux.c | 2 +- gst/audiotestsrc/gstaudiotestsrc.c | 2 +- gst/subparse/gstssaparse.c | 2 +- gst/subparse/gstsubparse.c | 2 +- 12 files changed, 16 insertions(+), 29 deletions(-) diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index 030dda6..ba0dc6d 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -2630,7 +2630,8 @@ gst_ogg_demux_activate_chain (GstOggDemux * ogg, GstOggChain * chain, gst_ogg_demux_send_event (ogg, event); tags = gst_tag_list_new (GST_TAG_CONTAINER_FORMAT, "Ogg", NULL); - gst_ogg_demux_send_event (ogg, gst_event_new_tag ("GstDemuxer", tags)); + gst_tag_list_set_scope (tags, GST_TAG_SCOPE_GLOBAL); + gst_ogg_demux_send_event (ogg, gst_event_new_tag (tags)); } GST_DEBUG_OBJECT (ogg, "starting chain"); @@ -2646,7 +2647,7 @@ gst_ogg_demux_activate_chain (GstOggDemux * ogg, GstOggChain * chain, if (pad->map.taglist) { GST_DEBUG_OBJECT (ogg, "pushing tags"); gst_pad_push_event (GST_PAD_CAST (pad), - gst_event_new_tag ("GstDemuxer", pad->map.taglist)); + gst_event_new_tag (pad->map.taglist)); pad->map.taglist = NULL; } diff --git a/ext/ogg/gstogmparse.c b/ext/ogg/gstogmparse.c index 0b6024a..b8bd212 100644 --- a/ext/ogg/gstogmparse.c +++ b/ext/ogg/gstogmparse.c @@ -659,7 +659,7 @@ gst_ogm_parse_stream_header (GstOgmParse * ogm, const guint8 * data, guint size) GstTagList *tags; tags = gst_tag_list_new (GST_TAG_SUBTITLE_CODEC, "Ogm", NULL); - gst_pad_push_event (ogm->srcpad, gst_event_new_tag ("GstParser", tags)); + gst_pad_push_event (ogm->srcpad, gst_event_new_tag (tags)); } } @@ -701,7 +701,7 @@ gst_ogm_parse_comment_packet (GstOgmParse * ogm, GstBuffer * buf) if (tags) { GST_DEBUG_OBJECT (ogm, "tags = %" GST_PTR_FORMAT, tags); - gst_pad_push_event (ogm->srcpad, gst_event_new_tag ("GstParser", tags)); + gst_pad_push_event (ogm->srcpad, gst_event_new_tag (tags)); } else { GST_DEBUG_OBJECT (ogm, "failed to extract tags from vorbis comment"); } diff --git a/ext/theora/gsttheoradec.c b/ext/theora/gsttheoradec.c index f07530a..f7906df 100644 --- a/ext/theora/gsttheoradec.c +++ b/ext/theora/gsttheoradec.c @@ -512,7 +512,7 @@ theora_handle_type_packet (GstTheoraDec * dec) /* FIXME : */ if (dec->tags) { gst_pad_push_event (GST_VIDEO_DECODER (dec)->srcpad, - gst_event_new_tag ("GstDecoder", dec->tags)); + gst_event_new_tag (dec->tags)); dec->tags = NULL; } diff --git a/ext/vorbis/gstvorbisdec.c b/ext/vorbis/gstvorbisdec.c index 680ad58..b19aafa 100644 --- a/ext/vorbis/gstvorbisdec.c +++ b/ext/vorbis/gstvorbisdec.c @@ -257,14 +257,7 @@ vorbis_handle_comment_packet (GstVorbisDec * vd, ogg_packet * packet) gst_audio_decoder_merge_tags (GST_AUDIO_DECODER_CAST (vd), list, GST_TAG_MERGE_REPLACE); - if (vd->initialized) { - gst_tag_list_free (list); - } else { - /* Only post them as messages for the time being. * - * They will be pushed on the pad once the decoder is initialized */ - gst_element_post_message (GST_ELEMENT_CAST (vd), - gst_message_new_tag (GST_OBJECT (vd), list)); - } + gst_tag_list_free (list); return GST_FLOW_OK; } diff --git a/gst-libs/gst/audio/gstaudiocdsrc.c b/gst-libs/gst/audio/gstaudiocdsrc.c index 2fb5a58..1bbd44c 100644 --- a/gst-libs/gst/audio/gstaudiocdsrc.c +++ b/gst-libs/gst/audio/gstaudiocdsrc.c @@ -1722,8 +1722,7 @@ gst_audio_cd_src_create (GstPushSrc * pushsrc, GstBuffer ** buffer) gst_tag_list_merge (src->tags, src->priv->tracks[src->priv->cur_track].tags, GST_TAG_MERGE_REPLACE); GST_LOG_OBJECT (src, "announcing tags: %" GST_PTR_FORMAT, tags); - gst_pad_push_event (GST_BASE_SRC_PAD (src), gst_event_new_tag ("GstSrc", - tags)); + gst_pad_push_event (GST_BASE_SRC_PAD (src), gst_event_new_tag (tags)); src->priv->prev_track = src->priv->cur_track; gst_audio_cd_src_update_duration (src); diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c index 01c9d3b..ce85d41 100644 --- a/gst-libs/gst/audio/gstaudiodecoder.c +++ b/gst-libs/gst/audio/gstaudiodecoder.c @@ -1015,8 +1015,7 @@ gst_audio_decoder_finish_frame (GstAudioDecoder * dec, GstBuffer * buf, if (gst_tag_list_is_empty (priv->taglist)) { gst_tag_list_free (priv->taglist); } else { - gst_audio_decoder_push_event (dec, gst_event_new_tag ("GstDecoder", - priv->taglist)); + gst_audio_decoder_push_event (dec, gst_event_new_tag (priv->taglist)); } priv->taglist = NULL; } diff --git a/gst-libs/gst/audio/gstaudioencoder.c b/gst-libs/gst/audio/gstaudioencoder.c index 801609d..05ef689 100644 --- a/gst-libs/gst/audio/gstaudioencoder.c +++ b/gst-libs/gst/audio/gstaudioencoder.c @@ -654,7 +654,7 @@ gst_audio_encoder_finish_frame (GstAudioEncoder * enc, GstBuffer * buf, caps); #endif GST_DEBUG_OBJECT (enc, "sending tags %" GST_PTR_FORMAT, tags); - gst_audio_encoder_push_event (enc, gst_event_new_tag ("GstEncoder", tags)); + gst_audio_encoder_push_event (enc, gst_event_new_tag (tags)); } /* remove corresponding samples from input */ @@ -1506,7 +1506,7 @@ gst_audio_encoder_sink_event_default (GstAudioEncoder * enc, GstEvent * event) gst_tag_list_remove_tag (tags, GST_TAG_MINIMUM_BITRATE); gst_tag_list_remove_tag (tags, GST_TAG_ENCODER); gst_tag_list_remove_tag (tags, GST_TAG_ENCODER_VERSION); - event = gst_event_new_tag ("GstEncoder", tags); + event = gst_event_new_tag (tags); GST_AUDIO_ENCODER_STREAM_LOCK (enc); enc->priv->pending_events = diff --git a/gst-libs/gst/tag/gsttagdemux.c b/gst-libs/gst/tag/gsttagdemux.c index ced2710..b765e29 100644 --- a/gst-libs/gst/tag/gsttagdemux.c +++ b/gst-libs/gst/tag/gsttagdemux.c @@ -1519,13 +1519,8 @@ gst_tag_demux_send_tag_event (GstTagDemux * demux) GstTagList *merged = gst_tag_list_merge (demux->priv->event_tags, demux->priv->parsed_tags, GST_TAG_MERGE_KEEP); - if (demux->priv->parsed_tags) - gst_element_post_message (GST_ELEMENT (demux), - gst_message_new_tag (GST_OBJECT (demux), - gst_tag_list_copy (demux->priv->parsed_tags))); - if (merged) { - GstEvent *event = gst_event_new_tag ("GstTagDemuxer", merged); + GstEvent *event = gst_event_new_tag (merged); GST_EVENT_TIMESTAMP (event) = 0; GST_DEBUG_OBJECT (demux, "Sending tag event on src pad"); diff --git a/gst-libs/gst/tag/gsttagmux.c b/gst-libs/gst/tag/gsttagmux.c index 6fbf195..10c9bd2 100644 --- a/gst-libs/gst/tag/gsttagmux.c +++ b/gst-libs/gst/tag/gsttagmux.c @@ -264,7 +264,7 @@ gst_tag_mux_render_start_tag (GstTagMux * mux) /* Send an event about the new tags to downstream elements */ /* gst_event_new_tag takes ownership of the list, so use a copy */ - event = gst_event_new_tag ("GstTagMuxer", gst_tag_list_copy (taglist)); + event = gst_event_new_tag (gst_tag_list_ref (taglist)); gst_pad_push_event (mux->priv->srcpad, event); GST_BUFFER_OFFSET (buffer) = 0; diff --git a/gst/audiotestsrc/gstaudiotestsrc.c b/gst/audiotestsrc/gstaudiotestsrc.c index 2c7cf98..ae9ca10 100644 --- a/gst/audiotestsrc/gstaudiotestsrc.c +++ b/gst/audiotestsrc/gstaudiotestsrc.c @@ -1131,7 +1131,7 @@ gst_audio_test_src_fill (GstBaseSrc * basesrc, guint64 offset, eclass = GST_ELEMENT_CLASS (parent_class); if (eclass->send_event) eclass->send_event (GST_ELEMENT_CAST (basesrc), - gst_event_new_tag ("GstSrc", taglist)); + gst_event_new_tag (taglist)); else gst_tag_list_free (taglist); src->tags_pushed = TRUE; diff --git a/gst/subparse/gstssaparse.c b/gst/subparse/gstssaparse.c index 0749bd2..bea39b6 100644 --- a/gst/subparse/gstssaparse.c +++ b/gst/subparse/gstssaparse.c @@ -341,7 +341,7 @@ gst_ssa_parse_chain (GstPad * sinkpad, GstObject * parent, GstBuffer * buf) tags = gst_tag_list_new_empty (); gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_SUBTITLE_CODEC, "SubStation Alpha", NULL); - gst_pad_push_event (parse->srcpad, gst_event_new_tag ("GstParser", tags)); + gst_pad_push_event (parse->srcpad, gst_event_new_tag (tags)); parse->send_tags = FALSE; } diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c index 3d6d31b..fa98efd 100644 --- a/gst/subparse/gstsubparse.c +++ b/gst/subparse/gstsubparse.c @@ -1468,7 +1468,7 @@ handle_buffer (GstSubParse * self, GstBuffer * buf) tags = gst_tag_list_new (GST_TAG_SUBTITLE_CODEC, self->subtitle_codec, NULL); - gst_pad_push_event (self->srcpad, gst_event_new_tag ("GstParser", tags)); + gst_pad_push_event (self->srcpad, gst_event_new_tag (tags)); } } -- 2.7.4