update for tag event change

This commit is contained in:
Wim Taymans 2012-06-06 13:02:12 +02:00
parent 37df608fdc
commit b5df4f0e62
18 changed files with 52 additions and 35 deletions

View file

@ -302,8 +302,8 @@ gst_dvdemux_add_pad (GstDVDemux * dvdemux, GstStaticPadTemplate * template)
if (no_more_pads) {
gst_pad_push_event (pad,
gst_event_new_tag (gst_tag_list_new (GST_TAG_CONTAINER_FORMAT, "DV",
NULL)));
gst_event_new_tag ("GstDemuxer",
gst_tag_list_new (GST_TAG_CONTAINER_FORMAT, "DV", NULL)));
}
return pad;

View file

@ -319,7 +319,7 @@ gst_flac_tag_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
id_data, 4, NULL);
if (tag->tags != NULL) {
gst_pad_push_event (tag->srcpad,
gst_event_new_tag (gst_tag_list_copy (tag->tags)));
gst_event_new_tag ("GstFlacTag", gst_tag_list_copy (tag->tags)));
}
gst_buffer_unref (tag->vorbiscomment);

View file

@ -788,7 +788,8 @@ 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_pad_push_event (GST_BASE_SRC_PAD (src), gst_event_new_tag (tag_list));
gst_pad_push_event (GST_BASE_SRC_PAD (src), gst_event_new_tag ("GstSrc",
tag_list));
} else {
gst_tag_list_free (tag_list);
}

View file

@ -1503,7 +1503,7 @@ gst_flac_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
/* Push tags */
if (flacparse->tags) {
gst_pad_push_event (GST_BASE_PARSE_SRC_PAD (flacparse),
gst_event_new_tag (flacparse->tags));
gst_event_new_tag ("GstParser", flacparse->tags));
flacparse->tags = NULL;
}

View file

@ -1350,7 +1350,7 @@ gst_mpeg_audio_parse_pre_push_frame (GstBaseParse * parse,
GST_TAG_NOMINAL_BITRATE, mp3parse->hdr_bitrate, NULL);
}
gst_pad_push_event (GST_BASE_PARSE_SRC_PAD (mp3parse),
gst_event_new_tag (taglist));
gst_event_new_tag ("GstParser", taglist));
g_free (codec);
/* also signals the end of first-frame processing */
@ -1389,7 +1389,7 @@ gst_mpeg_audio_parse_pre_push_frame (GstBaseParse * parse,
/* if the taglist exists, we need to send it */
if (taglist) {
gst_pad_push_event (GST_BASE_PARSE_SRC_PAD (mp3parse),
gst_event_new_tag (taglist));
gst_event_new_tag ("GstParser", taglist));
}
/* usual clipping applies */

View file

@ -5119,7 +5119,7 @@ push_tag_lists (GstAviDemux * avi)
if (pad && tags) {
GST_DEBUG_OBJECT (pad, "Tags: %" GST_PTR_FORMAT, tags);
gst_pad_push_event (pad, gst_event_new_tag (tags));
gst_pad_push_event (pad, gst_event_new_tag ("GstDemuxer", tags));
stream->taglist = NULL;
}
}
@ -5131,7 +5131,7 @@ push_tag_lists (GstAviDemux * avi)
GST_TAG_CONTAINER_FORMAT, "AVI", NULL);
GST_DEBUG_OBJECT (avi, "Global tags: %" GST_PTR_FORMAT, tags);
gst_avi_demux_push_event (avi, gst_event_new_tag (tags));
gst_avi_demux_push_event (avi, gst_event_new_tag ("GstDemuxer", tags));
avi->globaltags = NULL;
avi->got_tags = FALSE;
}

View file

@ -177,7 +177,8 @@ static void
gst_avi_subtitle_title_tag (GstAviSubtitle * sub, gchar * title)
{
gst_pad_push_event (sub->src,
gst_event_new_tag (gst_tag_list_new (GST_TAG_TITLE, title, NULL)));
gst_event_new_tag ("GstParser", gst_tag_list_new (GST_TAG_TITLE, title,
NULL)));
}
static GstFlowReturn

View file

@ -148,7 +148,7 @@ gst_tag_inject_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
if (self->tags && !gst_tag_list_is_empty (self->tags)) {
GST_DEBUG ("tag event :%" GST_PTR_FORMAT, self->tags);
gst_pad_push_event (GST_BASE_TRANSFORM_SRC_PAD (trans),
gst_event_new_tag (gst_tag_list_copy (self->tags)));
gst_event_new_tag ("GstTagInject", gst_tag_list_copy (self->tags)));
}
}

View file

@ -796,7 +796,8 @@ gst_flv_demux_push_tags (GstFlvDemux * demux)
if (demux->taglist) {
GST_DEBUG_OBJECT (demux, "pushing tags out %" GST_PTR_FORMAT,
demux->taglist);
gst_flv_demux_push_src_event (demux, gst_event_new_tag (demux->taglist));
gst_flv_demux_push_src_event (demux, gst_event_new_tag ("GstDemuxer",
demux->taglist));
demux->taglist = gst_tag_list_new_empty ();
demux->push_tags = FALSE;
}

View file

@ -617,7 +617,7 @@ gst_icydemux_send_tag_event (GstICYDemux * icydemux, GstTagList * tags)
gst_element_post_message (GST_ELEMENT (icydemux),
gst_message_new_tag (GST_OBJECT (icydemux), gst_tag_list_copy (tags)));
event = gst_event_new_tag (tags);
event = gst_event_new_tag ("GstDemuxer", tags);
GST_EVENT_TIMESTAMP (event) = 0;
GST_DEBUG_OBJECT (icydemux, "Sending tag event on src pad");

View file

@ -794,7 +794,7 @@ gst_qtdemux_push_tags (GstQTDemux * qtdemux, QtDemuxStream * stream)
GST_DEBUG_OBJECT (qtdemux, "Sending tags %" GST_PTR_FORMAT,
stream->pending_tags);
gst_pad_push_event (stream->pad,
gst_event_new_tag (stream->pending_tags));
gst_event_new_tag ("GstDemuxer", stream->pending_tags));
stream->pending_tags = NULL;
}
@ -802,7 +802,8 @@ gst_qtdemux_push_tags (GstQTDemux * qtdemux, QtDemuxStream * stream)
GST_DEBUG_OBJECT (qtdemux, "Sending global tags %" GST_PTR_FORMAT,
qtdemux->tag_list);
gst_pad_push_event (stream->pad,
gst_event_new_tag (gst_tag_list_copy (qtdemux->tag_list)));
gst_event_new_tag ("GstDemuxer",
gst_tag_list_copy (qtdemux->tag_list)));
stream->send_global_tags = FALSE;
}
}

View file

@ -1502,7 +1502,7 @@ gst_matroska_demux_send_event (GstMatroskaDemux * demux, GstEvent * event)
GST_PTR_FORMAT, stream->pending_tags,
GST_DEBUG_PAD_NAME (stream->pad), stream->pending_tags);
gst_pad_push_event (stream->pad,
gst_event_new_tag (stream->pending_tags));
gst_event_new_tag ("GstDemuxer", stream->pending_tags));
stream->pending_tags = NULL;
}
}
@ -1514,7 +1514,7 @@ gst_matroska_demux_send_event (GstMatroskaDemux * demux, GstEvent * event)
GST_DEBUG_OBJECT (demux, "Sending global_tags %p : %" GST_PTR_FORMAT,
demux->common.global_tags, demux->common.global_tags);
tag_event = gst_event_new_tag (demux->common.global_tags);
tag_event = gst_event_new_tag ("GstDemuxer", demux->common.global_tags);
for (i = 0; i < demux->common.src->len; i++) {
GstMatroskaTrackContext *stream;
@ -4371,7 +4371,7 @@ gst_matroska_demux_parse_id (GstMatroskaDemux * demux, guint32 id,
if (demux->common.toc) {
gst_matroska_demux_send_event (demux,
gst_event_new_toc (demux->common.toc, FALSE));
gst_event_new_toc ("GstDemuxer", demux->common.toc, FALSE));
gst_element_post_message (GST_ELEMENT_CAST (demux),
gst_message_new_toc (GST_OBJECT_CAST (demux),
demux->common.toc, FALSE));

View file

@ -439,7 +439,7 @@ gst_matroska_read_common_found_global_tag (GstMatroskaReadCommon * common,
gst_tag_list_insert (common->global_tags, taglist, GST_TAG_MERGE_APPEND);
gst_tag_list_free (taglist);
} else {
GstEvent *tag_event = gst_event_new_tag (taglist);
GstEvent *tag_event = gst_event_new_tag ("GstDemuxer", taglist);
gint i;
/* hm, already sent, no need to cache and wait anymore */

View file

@ -609,7 +609,8 @@ gst_multipart_demux_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
gst_pad_push_event (srcpad->pad, gst_event_new_segment (&segment));
tags = gst_tag_list_new (GST_TAG_CONTAINER_FORMAT, "Multipart", NULL);
gst_pad_push_event (srcpad->pad, gst_event_new_tag (tags));
gst_pad_push_event (srcpad->pad, gst_event_new_tag ("GstDemuxer",
tags));
GST_BUFFER_TIMESTAMP (outbuf) = 0;
} else {

View file

@ -634,7 +634,8 @@ gst_rg_analysis_handle_eos (GstRgAnalysis * filter)
GST_TAG_REFERENCE_LEVEL, filter->reference_level, NULL);
/* This steals our reference to the list: */
gst_pad_push_event (GST_BASE_TRANSFORM_SRC_PAD (GST_BASE_TRANSFORM
(filter)), gst_event_new_tag (gst_tag_list_copy (tag_list)));
(filter)), gst_event_new_tag ("GstAnalysis",
gst_tag_list_copy (tag_list)));
/* special case element, also post here */
gst_element_post_message (GST_ELEMENT_CAST (filter),
gst_message_new_tag (GST_OBJECT (filter), tag_list));

View file

@ -1786,7 +1786,8 @@ gst_wavparse_add_src_pad (GstWavParse * wav, GstBuffer * buf)
}
if (wav->tags) {
gst_pad_push_event (wav->srcpad, gst_event_new_tag (wav->tags));
gst_pad_push_event (wav->srcpad, gst_event_new_tag ("GstParser",
wav->tags));
wav->tags = NULL;
}
}

View file

@ -218,7 +218,7 @@ static void
send_tag_event (GstElement * element, GstTagList * tag_list)
{
GstPad *pad = gst_element_get_static_pad (element, "sink");
GstEvent *event = gst_event_new_tag (tag_list);
GstEvent *event = gst_event_new_tag ("test", tag_list);
fail_unless (gst_pad_send_event (pad, event),
"Cannot send TAG event: Not handled.");

View file

@ -349,7 +349,7 @@ GST_START_TEST (test_events)
GST_TAG_TRACK_GAIN, +4.95, GST_TAG_TRACK_PEAK, 0.59463,
GST_TAG_ALBUM_GAIN, -1.54, GST_TAG_ALBUM_PEAK, 0.693415,
GST_TAG_ARTIST, "Foobar", NULL);
event = gst_event_new_tag (tag_list);
event = gst_event_new_tag ("test", tag_list);
new_event = send_tag_event (element, event);
gst_event_parse_tag (new_event, &tag_list);
fail_unless (gst_tag_list_get_string (tag_list, GST_TAG_ARTIST, &artist));
@ -364,7 +364,7 @@ GST_START_TEST (test_events)
GST_TAG_TRACK_GAIN, +4.95, GST_TAG_TRACK_PEAK, 0.59463,
GST_TAG_ALBUM_GAIN, -1.54, GST_TAG_ALBUM_PEAK, 0.693415,
GST_TAG_ARTIST, "Foobar", NULL);
event = gst_event_new_tag (tag_list);
event = gst_event_new_tag ("test", tag_list);
new_event = send_tag_event (element, event);
gst_event_parse_tag (new_event, &tag_list);
fail_unless (gst_tag_list_get_string (tag_list, GST_TAG_ARTIST, &artist));
@ -392,7 +392,8 @@ GST_START_TEST (test_simple)
gst_tag_list_add (tag_list, GST_TAG_MERGE_REPLACE,
GST_TAG_TRACK_GAIN, -3.45, GST_TAG_TRACK_PEAK, 1.0,
GST_TAG_ALBUM_GAIN, +2.09, GST_TAG_ALBUM_PEAK, 1.0, NULL);
fail_unless (send_tag_event (element, gst_event_new_tag (tag_list)) == NULL);
fail_unless (send_tag_event (element, gst_event_new_tag ("test",
tag_list)) == NULL);
fail_unless_gain (element, -9.45); /* pre-amp + track gain */
send_eos_event (element);
@ -402,7 +403,8 @@ GST_START_TEST (test_simple)
gst_tag_list_add (tag_list, GST_TAG_MERGE_REPLACE,
GST_TAG_TRACK_GAIN, -3.45, GST_TAG_TRACK_PEAK, 1.0,
GST_TAG_ALBUM_GAIN, +2.09, GST_TAG_ALBUM_PEAK, 1.0, NULL);
fail_unless (send_tag_event (element, gst_event_new_tag (tag_list)) == NULL);
fail_unless (send_tag_event (element, gst_event_new_tag ("test",
tag_list)) == NULL);
fail_unless_gain (element, -3.91); /* pre-amp + album gain */
/* Switching back to track mode in the middle of a stream: */
@ -434,7 +436,8 @@ GST_START_TEST (test_fallback_gain)
gst_tag_list_add (tag_list, GST_TAG_MERGE_REPLACE,
GST_TAG_TRACK_GAIN, +3.5, GST_TAG_TRACK_PEAK, 1.0,
GST_TAG_ALBUM_GAIN, -0.5, GST_TAG_ALBUM_PEAK, 1.0, NULL);
fail_unless (send_tag_event (element, gst_event_new_tag (tag_list)) == NULL);
fail_unless (send_tag_event (element, gst_event_new_tag ("test",
tag_list)) == NULL);
fail_unless_gain (element, -2.50); /* pre-amp + track gain */
send_eos_event (element);
@ -478,7 +481,8 @@ GST_START_TEST (test_fallback_track)
tag_list = gst_tag_list_new_empty ();
gst_tag_list_add (tag_list, GST_TAG_MERGE_REPLACE,
GST_TAG_TRACK_GAIN, +2.11, GST_TAG_TRACK_PEAK, 1.0, NULL);
fail_unless (send_tag_event (element, gst_event_new_tag (tag_list)) == NULL);
fail_unless (send_tag_event (element, gst_event_new_tag ("test",
tag_list)) == NULL);
fail_unless_gain (element, -3.89); /* pre-amp + track gain */
send_eos_event (element);
@ -505,7 +509,8 @@ GST_START_TEST (test_fallback_album)
tag_list = gst_tag_list_new_empty ();
gst_tag_list_add (tag_list, GST_TAG_MERGE_REPLACE,
GST_TAG_ALBUM_GAIN, +3.73, GST_TAG_ALBUM_PEAK, 1.0, NULL);
fail_unless (send_tag_event (element, gst_event_new_tag (tag_list)) == NULL);
fail_unless (send_tag_event (element, gst_event_new_tag ("test",
tag_list)) == NULL);
fail_unless_gain (element, -2.27); /* pre-amp + album gain */
send_eos_event (element);
@ -529,7 +534,8 @@ GST_START_TEST (test_headroom)
tag_list = gst_tag_list_new_empty ();
gst_tag_list_add (tag_list, GST_TAG_MERGE_REPLACE,
GST_TAG_TRACK_GAIN, +3.50, GST_TAG_TRACK_PEAK, 1.0, NULL);
fail_unless (send_tag_event (element, gst_event_new_tag (tag_list)) == NULL);
fail_unless (send_tag_event (element, gst_event_new_tag ("test",
tag_list)) == NULL);
fail_unless_target_gain (element, +3.50); /* pre-amp + track gain */
fail_unless_result_gain (element, +0.00);
send_eos_event (element);
@ -538,7 +544,8 @@ GST_START_TEST (test_headroom)
tag_list = gst_tag_list_new_empty ();
gst_tag_list_add (tag_list, GST_TAG_MERGE_REPLACE,
GST_TAG_TRACK_GAIN, +9.18, GST_TAG_TRACK_PEAK, 0.687149, NULL);
fail_unless (send_tag_event (element, gst_event_new_tag (tag_list)) == NULL);
fail_unless (send_tag_event (element, gst_event_new_tag ("test",
tag_list)) == NULL);
fail_unless_target_gain (element, +9.18); /* pre-amp + track gain */
/* Result is 20. * log10 (1. / peak) + headroom. */
fail_unless_result_gain (element, 5.2589816238303335);
@ -548,7 +555,8 @@ GST_START_TEST (test_headroom)
tag_list = gst_tag_list_new_empty ();
gst_tag_list_add (tag_list, GST_TAG_MERGE_REPLACE,
GST_TAG_ALBUM_GAIN, +5.50, GST_TAG_ALBUM_PEAK, 1.0, NULL);
fail_unless (send_tag_event (element, gst_event_new_tag (tag_list)) == NULL);
fail_unless (send_tag_event (element, gst_event_new_tag ("test",
tag_list)) == NULL);
fail_unless_target_gain (element, +5.50); /* pre-amp + album gain */
fail_unless_result_gain (element, +2.00); /* headroom */
send_eos_event (element);
@ -574,7 +582,8 @@ GST_START_TEST (test_reference_level)
gst_tag_list_add (tag_list, GST_TAG_MERGE_REPLACE,
GST_TAG_TRACK_GAIN, 0.00, GST_TAG_TRACK_PEAK, 0.2,
GST_TAG_REFERENCE_LEVEL, 83., NULL);
fail_unless (send_tag_event (element, gst_event_new_tag (tag_list)) == NULL);
fail_unless (send_tag_event (element, gst_event_new_tag ("test",
tag_list)) == NULL);
/* Because our authorative reference is 89 dB, we bump it up by +6 dB. */
fail_unless_gain (element, +6.00); /* pre-amp + track gain */
send_eos_event (element);
@ -588,7 +597,8 @@ GST_START_TEST (test_reference_level)
GST_TAG_TRACK_GAIN, 1.23, GST_TAG_TRACK_PEAK, 0.1,
GST_TAG_ALBUM_GAIN, 0.00, GST_TAG_ALBUM_PEAK, 0.2,
GST_TAG_REFERENCE_LEVEL, 83., NULL);
fail_unless (send_tag_event (element, gst_event_new_tag (tag_list)) == NULL);
fail_unless (send_tag_event (element, gst_event_new_tag ("test",
tag_list)) == NULL);
fail_unless_gain (element, +6.00); /* pre-amp + album gain */
cleanup_rgvolume (element);