Commit e038ab5a authored by Wim Taymans's avatar Wim Taymans

tags: update for tag API removal

parent 22eb0d23
......@@ -584,7 +584,7 @@ gst_cmml_dec_parse_head (GstCmmlDec * dec, GstCmmlTagHead * head)
gst_tag_list_add_values (tags, GST_TAG_MERGE_APPEND,
GST_TAG_TITLE, &title_val, NULL);
gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_CMML_HEAD, head, NULL);
gst_element_found_tags_for_pad (GST_ELEMENT (dec), dec->srcpad, tags);
gst_pad_push_event (dec->srcpad, gst_event_new_tag (tags));
g_value_unset (&str_val);
g_value_unset (&title_val);
......@@ -609,7 +609,7 @@ gst_cmml_dec_send_clip_tag (GstCmmlDec * dec, GstCmmlTagClip * clip)
GST_DEBUG_OBJECT (dec, "sending clip tag %s", clip->id);
tags = gst_tag_list_new (GST_TAG_CMML_CLIP, clip, NULL);
gst_element_found_tags_for_pad (GST_ELEMENT (dec), dec->srcpad, tags);
gst_pad_push_event (dec->srcpad, gst_event_new_tag (tags));
}
/* push the string representation of a clip */
......
......@@ -315,8 +315,8 @@ gst_flac_tag_chain (GstPad * pad, GstBuffer * buffer)
tag->tags = gst_tag_list_from_vorbiscomment_buffer (tag->vorbiscomment,
id_data, 4, NULL);
if (tag->tags != NULL) {
gst_element_found_tags (GST_ELEMENT (tag),
gst_tag_list_copy (tag->tags));
gst_pad_push_event (tag->srcpad,
gst_event_new_tag (gst_tag_list_copy (tag->tags)));
}
gst_buffer_unref (tag->vorbiscomment);
......
......@@ -839,7 +839,7 @@ gst_soup_http_src_got_headers_cb (SoupMessage * msg, GstSoupHTTPSrc * src)
if (!gst_tag_list_is_empty (tag_list)) {
GST_DEBUG_OBJECT (src,
"calling gst_element_found_tags with %" GST_PTR_FORMAT, tag_list);
gst_element_found_tags (GST_ELEMENT_CAST (src), tag_list);
gst_pad_push_event (GST_BASE_SRC_PAD (src), gst_event_new_tag (tag_list));
} else {
gst_tag_list_free (tag_list);
}
......
......@@ -306,8 +306,8 @@ gst_speex_dec_parse_comments (GstSpeexDec * dec, GstBuffer * buf)
GST_INFO_OBJECT (dec, "tags: %" GST_PTR_FORMAT, list);
gst_element_found_tags_for_pad (GST_ELEMENT (dec),
GST_AUDIO_DECODER_SRC_PAD (dec), list);
gst_pad_push_event (GST_AUDIO_DECODER_SRC_PAD (dec),
gst_event_new_tag (list));
g_free (encoder);
g_free (ver);
......
......@@ -1423,7 +1423,8 @@ gst_flac_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
/* Push tags */
if (flacparse->tags) {
gst_element_found_tags (GST_ELEMENT (flacparse), flacparse->tags);
gst_pad_push_event (GST_BASE_PARSE_SRC_PAD (flacparse),
gst_event_new_tag (flacparse->tags));
flacparse->tags = NULL;
}
......
......@@ -1240,8 +1240,8 @@ gst_mpeg_audio_parse_pre_push_frame (GstBaseParse * parse,
gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE,
GST_TAG_NOMINAL_BITRATE, mp3parse->hdr_bitrate, NULL);
}
gst_element_found_tags_for_pad (GST_ELEMENT (mp3parse),
GST_BASE_PARSE_SRC_PAD (mp3parse), taglist);
gst_pad_push_event (GST_BASE_PARSE_SRC_PAD (mp3parse),
gst_event_new_tag (taglist));
g_free (codec);
/* also signals the end of first-frame processing */
......@@ -1279,8 +1279,8 @@ gst_mpeg_audio_parse_pre_push_frame (GstBaseParse * parse,
/* if the taglist exists, we need to send it */
if (taglist) {
gst_element_found_tags_for_pad (GST_ELEMENT (mp3parse),
GST_BASE_PARSE_SRC_PAD (mp3parse), taglist);
gst_pad_push_event (GST_BASE_PARSE_SRC_PAD (mp3parse),
gst_event_new_tag (taglist));
}
/* usual clipping applies */
......
......@@ -3979,7 +3979,7 @@ gst_avi_demux_do_seek (GstAviDemux * avi, GstSegment * segment)
GstAviStream *stream;
seek_time = segment->position;
keyframe = ! !(segment->flags & GST_SEEK_FLAG_KEY_UNIT);
keyframe = !!(segment->flags & GST_SEEK_FLAG_KEY_UNIT);
GST_DEBUG_OBJECT (avi, "seek to: %" GST_TIME_FORMAT
" keyframe seeking:%d", GST_TIME_ARGS (seek_time), keyframe);
......@@ -4219,7 +4219,7 @@ avi_demux_handle_seek_push (GstAviDemux * avi, GstPad * pad, GstEvent * event)
gst_segment_do_seek (&seeksegment, rate, format, flags,
cur_type, cur, stop_type, stop, &update);
keyframe = ! !(flags & GST_SEEK_FLAG_KEY_UNIT);
keyframe = !!(flags & GST_SEEK_FLAG_KEY_UNIT);
cur = seeksegment.position;
GST_DEBUG_OBJECT (avi,
......@@ -5052,7 +5052,7 @@ push_tag_lists (GstAviDemux * avi)
if (pad && tags) {
GST_DEBUG_OBJECT (pad, "Tags: %" GST_PTR_FORMAT, tags);
gst_element_found_tags_for_pad (GST_ELEMENT_CAST (avi), pad, tags);
gst_pad_push_event (pad, gst_event_new_tag (tags));
stream->taglist = NULL;
}
}
......@@ -5064,7 +5064,7 @@ push_tag_lists (GstAviDemux * avi)
GST_TAG_CONTAINER_FORMAT, "AVI", NULL);
GST_DEBUG_OBJECT (avi, "Global tags: %" GST_PTR_FORMAT, tags);
gst_element_found_tags (GST_ELEMENT_CAST (avi), tags);
gst_avi_demux_push_event (avi, gst_event_new_tag (tags));
avi->globaltags = NULL;
avi->got_tags = FALSE;
}
......
......@@ -143,8 +143,8 @@ gst_tag_inject_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
/* send tags */
if (self->tags && !gst_tag_list_is_empty (self->tags)) {
GST_DEBUG ("tag event :%" GST_PTR_FORMAT, self->tags);
gst_element_found_tags (GST_ELEMENT (trans),
gst_tag_list_copy (self->tags));
gst_pad_push_event (GST_BASE_TRANSFORM_SRC_PAD (trans),
gst_event_new_tag (gst_tag_list_copy (self->tags)));
}
}
......
......@@ -119,11 +119,11 @@ gst_flv_demux_parse_and_add_index_entry (GstFlvDemux * demux, GstClockTime ts,
gboolean key;
gst_index_entry_assoc_map (entry, GST_FORMAT_TIME, &time);
key = ! !(GST_INDEX_ASSOC_FLAGS (entry) & GST_ASSOCIATION_FLAG_KEY_UNIT);
key = !!(GST_INDEX_ASSOC_FLAGS (entry) & GST_ASSOCIATION_FLAG_KEY_UNIT);
GST_LOG_OBJECT (demux, "position already mapped to time %" GST_TIME_FORMAT
", keyframe %d", GST_TIME_ARGS (time), key);
/* there is not really a way to delete the existing one */
if (time != ts || key != ! !keyframe)
if (time != ts || key != !!keyframe)
GST_DEBUG_OBJECT (demux, "metadata mismatch");
#endif
return;
......@@ -750,6 +750,22 @@ beach:
return ret;
}
static gboolean
gst_flv_demux_push_src_event (GstFlvDemux * demux, GstEvent * event)
{
gboolean ret = TRUE;
if (demux->audio_pad)
ret |= gst_pad_push_event (demux->audio_pad, gst_event_ref (event));
if (demux->video_pad)
ret |= gst_pad_push_event (demux->video_pad, gst_event_ref (event));
gst_event_unref (event);
return ret;
}
static void
gst_flv_demux_push_tags (GstFlvDemux * demux)
{
......@@ -766,7 +782,7 @@ gst_flv_demux_push_tags (GstFlvDemux * demux)
if (demux->taglist) {
GST_DEBUG_OBJECT (demux, "pushing tags out %" GST_PTR_FORMAT,
demux->taglist);
gst_element_found_tags (GST_ELEMENT (demux), demux->taglist);
gst_flv_demux_push_src_event (demux, gst_event_new_tag (demux->taglist));
demux->taglist = gst_tag_list_new_empty ();
demux->push_tags = FALSE;
}
......@@ -2174,22 +2190,6 @@ done:
return ret;
}
static gboolean
gst_flv_demux_push_src_event (GstFlvDemux * demux, GstEvent * event)
{
gboolean ret = TRUE;
if (demux->audio_pad)
ret |= gst_pad_push_event (demux->audio_pad, gst_event_ref (event));
if (demux->video_pad)
ret |= gst_pad_push_event (demux->video_pad, gst_event_ref (event));
gst_event_unref (event);
return ret;
}
static GstFlowReturn
gst_flv_demux_create_index (GstFlvDemux * demux, gint64 pos, GstClockTime ts)
{
......@@ -2493,7 +2493,7 @@ flv_demux_handle_seek_push (GstFlvDemux * demux, GstEvent * event)
if (format != GST_FORMAT_TIME)
goto wrong_format;
flush = ! !(flags & GST_SEEK_FLAG_FLUSH);
flush = !!(flags & GST_SEEK_FLAG_FLUSH);
/* FIXME : the keyframe flag is never used ! */
/* Work on a copy until we are sure the seek succeeded. */
......@@ -2654,7 +2654,7 @@ gst_flv_demux_handle_seek_pull (GstFlvDemux * demux, GstEvent * event,
demux->seeking = seeking;
GST_OBJECT_UNLOCK (demux);
flush = ! !(flags & GST_SEEK_FLAG_FLUSH);
flush = !!(flags & GST_SEEK_FLAG_FLUSH);
/* FIXME : the keyframe flag is never used */
if (flush) {
......
......@@ -625,8 +625,8 @@ gst_rg_analysis_handle_eos (GstRgAnalysis * filter)
gst_tag_list_add (tag_list, GST_TAG_MERGE_APPEND,
GST_TAG_REFERENCE_LEVEL, filter->reference_level, NULL);
/* This steals our reference to the list: */
gst_element_found_tags_for_pad (GST_ELEMENT (filter),
GST_BASE_TRANSFORM_SRC_PAD (GST_BASE_TRANSFORM (filter)), tag_list);
gst_pad_push_event (GST_BASE_TRANSFORM_SRC_PAD (GST_BASE_TRANSFORM
(filter)), gst_event_new_tag (tag_list));
}
}
......
......@@ -1776,8 +1776,7 @@ gst_wavparse_add_src_pad (GstWavParse * wav, GstBuffer * buf)
}
if (wav->tags) {
gst_element_found_tags_for_pad (GST_ELEMENT_CAST (wav), wav->srcpad,
wav->tags);
gst_pad_push_event (wav->srcpad, gst_event_new_tag (wav->tags));
wav->tags = NULL;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment