Commit 9cd17092 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller

ext, gst: update for taglist API changes

parent 8d43ab15
......@@ -573,13 +573,14 @@ gst_cmml_dec_parse_head (GstCmmlDec * dec, GstCmmlTagHead * head)
GST_DEBUG_OBJECT (dec, "found CMML head (title: %s base: %s)",
head->title, head->base);
/* FIXME: what's the point of all this GValue transform crack? */
/* create the GST_TAG_TITLE tag */
g_value_init (&str_val, G_TYPE_STRING);
g_value_init (&title_val, gst_tag_get_type (GST_TAG_TITLE));
g_value_set_string (&str_val, (gchar *) head->title);
g_value_transform (&str_val, &title_val);
tags = gst_tag_list_new ();
tags = gst_tag_list_new_empty ();
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);
......@@ -607,8 +608,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_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_CMML_CLIP, clip, NULL);
tags = gst_tag_list_new (GST_TAG_CMML_CLIP, clip, NULL);
gst_element_found_tags_for_pad (GST_ELEMENT (dec), dec->srcpad, tags);
}
......
......@@ -242,9 +242,7 @@ gst_flac_dec_setup_decoder (GstFlacDec * dec)
{
gst_flac_dec_reset_decoders (dec);
dec->tags = gst_tag_list_new ();
gst_tag_list_add (dec->tags, GST_TAG_MERGE_REPLACE,
GST_TAG_AUDIO_CODEC, "FLAC", NULL);
dec->tags = gst_tag_list_new (GST_TAG_AUDIO_CODEC, "FLAC", NULL);
dec->adapter = gst_adapter_new ();
......@@ -281,7 +279,7 @@ gst_flac_dec_update_metadata (GstFlacDec * flacdec,
if (flacdec->tags)
list = flacdec->tags;
else
flacdec->tags = list = gst_tag_list_new ();
flacdec->tags = list = gst_tag_list_new_empty ();
num = metadata->data.vorbis_comment.num_comments;
GST_DEBUG_OBJECT (flacdec, "%u tag(s) found", num);
......@@ -455,7 +453,7 @@ gst_flac_extract_picture_buffer (GstFlacDec * dec,
GST_STR_NULL (picture.mime_type));
GST_DEBUG_OBJECT (dec, "image data is %u bytes", picture.data_length);
tags = gst_tag_list_new ();
tags = gst_tag_list_new_empty ();
gst_tag_list_add_id3_image (tags, (guint8 *) picture.data,
picture.data_length, picture.type);
......
......@@ -428,7 +428,7 @@ gst_flac_enc_start (GstAudioEncoder * enc)
flacenc->depth = 0;
flacenc->sample_rate = 0;
flacenc->eos = FALSE;
flacenc->tags = gst_tag_list_new ();
flacenc->tags = gst_tag_list_new_empty ();
return TRUE;
}
......
......@@ -754,7 +754,7 @@ gst_soup_http_src_got_headers_cb (SoupMessage * msg, GstSoupHTTPSrc * src)
}
/* Icecast stuff */
tag_list = gst_tag_list_new ();
tag_list = gst_tag_list_new_empty ();
if ((value =
soup_message_headers_get (msg->response_headers,
......
......@@ -280,7 +280,7 @@ gst_speex_dec_parse_comments (GstSpeexDec * dec, GstBuffer * buf)
if (!list) {
GST_WARNING_OBJECT (dec, "couldn't decode comments");
list = gst_tag_list_new ();
list = gst_tag_list_new_empty ();
}
if (encoder) {
......
......@@ -247,7 +247,7 @@ gst_speex_enc_start (GstAudioEncoder * benc)
GST_DEBUG_OBJECT (enc, "start");
speex_bits_init (&enc->bits);
enc->tags = gst_tag_list_new ();
enc->tags = gst_tag_list_new_empty ();
enc->header_sent = FALSE;
return TRUE;
......@@ -341,7 +341,7 @@ gst_speex_enc_create_metadata_buffer (GstSpeexEnc * enc)
gst_tag_setter_get_tag_merge_mode (GST_TAG_SETTER (enc)));
if (merged_tags == NULL)
merged_tags = gst_tag_list_new ();
merged_tags = gst_tag_list_new_empty ();
GST_DEBUG_OBJECT (enc, "merged tags = %" GST_PTR_FORMAT, merged_tags);
comments = gst_tag_list_to_vorbiscomment_buffer (merged_tags, NULL,
......
......@@ -910,7 +910,7 @@ gst_flac_parse_handle_picture (GstFlacParse * flacparse, GstBuffer * buffer)
goto error;
if (!flacparse->tags)
flacparse->tags = gst_tag_list_new ();
flacparse->tags = gst_tag_list_new_empty ();
gst_tag_list_add_id3_image (flacparse->tags,
data + gst_byte_reader_get_pos (&reader), img_len, img_type);
......@@ -1207,7 +1207,7 @@ gst_flac_parse_generate_headers (GstFlacParse * flacparse)
/* empty vorbiscomment */
{
GstTagList *taglist = gst_tag_list_new ();
GstTagList *taglist = gst_tag_list_new_empty ();
guchar header[4];
guint size;
......
......@@ -1232,9 +1232,7 @@ gst_mpeg_audio_parse_pre_push_frame (GstBaseParse * parse,
codec = g_strdup_printf ("MPEG %d Audio, Layer %d",
mp3parse->version, mp3parse->layer);
}
taglist = gst_tag_list_new ();
gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE,
GST_TAG_AUDIO_CODEC, codec, NULL);
taglist = gst_tag_list_new (GST_TAG_AUDIO_CODEC, codec, NULL);
if (mp3parse->hdr_bitrate > 0 && mp3parse->xing_bitrate == 0 &&
mp3parse->vbri_bitrate == 0) {
/* We don't have a VBR bitrate, so post the available bitrate as
......@@ -1257,7 +1255,7 @@ gst_mpeg_audio_parse_pre_push_frame (GstBaseParse * parse,
gboolean using_crc;
if (!taglist) {
taglist = gst_tag_list_new ();
taglist = gst_tag_list_new_empty ();
}
mp3parse->last_posted_crc = mp3parse->last_crc;
if (mp3parse->last_posted_crc == CRC_PROTECTED) {
......@@ -1271,7 +1269,7 @@ gst_mpeg_audio_parse_pre_push_frame (GstBaseParse * parse,
if (mp3parse->last_posted_channel_mode != mp3parse->last_mode) {
if (!taglist) {
taglist = gst_tag_list_new ();
taglist = gst_tag_list_new_empty ();
}
mp3parse->last_posted_channel_mode = mp3parse->last_mode;
......
......@@ -2293,7 +2293,7 @@ gst_avi_demux_parse_stream (GstAviDemux * avi, GstBuffer * buf)
/* make tags */
if (codec_name) {
if (!stream->taglist)
stream->taglist = gst_tag_list_new ();
stream->taglist = gst_tag_list_new_empty ();
avi->got_tags = TRUE;
......@@ -3423,7 +3423,7 @@ gst_avi_demux_add_date_tag (GstAviDemux * avi, gint y, gint m, gint d,
dt = gst_date_time_new_local_time (y, m, d, h, min, s);
if (avi->globaltags == NULL)
avi->globaltags = gst_tag_list_new ();
avi->globaltags = gst_tag_list_new_empty ();
gst_tag_list_add (avi->globaltags, GST_TAG_MERGE_REPLACE, GST_TAG_DATE, date,
NULL);
......@@ -5058,7 +5058,7 @@ push_tag_lists (GstAviDemux * avi)
}
if (!(tags = avi->globaltags))
tags = gst_tag_list_new ();
tags = gst_tag_list_new_empty ();
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE,
GST_TAG_CONTAINER_FORMAT, "AVI", NULL);
......
......@@ -175,11 +175,8 @@ done:
static void
gst_avi_subtitle_title_tag (GstAviSubtitle * sub, gchar * title)
{
GstTagList *temp_list = gst_tag_list_new ();
gst_tag_list_add (temp_list, GST_TAG_MERGE_APPEND, GST_TAG_TITLE, title,
NULL);
gst_pad_push_event (sub->src, gst_event_new_tag (temp_list));
gst_pad_push_event (sub->src,
gst_event_new_tag (gst_tag_list_new (GST_TAG_TITLE, title, NULL)));
}
static GstFlowReturn
......
......@@ -161,7 +161,7 @@ gst_tag_inject_set_property (GObject * object, guint prop_id,
case PROP_TAGS:{
gchar *structure =
g_strdup_printf ("taglist,%s", g_value_get_string (value));
if (!(self->tags = gst_structure_from_string (structure, NULL))) {
if (!(self->tags = gst_tag_list_new_from_string (structure))) {
GST_WARNING ("unparsable taglist = '%s'", structure);
}
......
......@@ -731,7 +731,7 @@ gst_flv_demux_audio_negotiate (GstFlvDemux * demux, guint32 codec_tag,
if (codec_name) {
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_AUDIO_CODEC, codec_name, NULL);
g_free (codec_name);
......@@ -767,7 +767,7 @@ gst_flv_demux_push_tags (GstFlvDemux * demux)
GST_DEBUG_OBJECT (demux, "pushing tags out %" GST_PTR_FORMAT,
demux->taglist);
gst_element_found_tags (GST_ELEMENT (demux), demux->taglist);
demux->taglist = gst_tag_list_new ();
demux->taglist = gst_tag_list_new_empty ();
demux->push_tags = FALSE;
}
}
......@@ -1137,7 +1137,7 @@ gst_flv_demux_video_negotiate (GstFlvDemux * demux, guint32 codec_tag)
if (codec_name) {
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_VIDEO_CODEC, codec_name, NULL);
g_free (codec_name);
......@@ -3256,7 +3256,7 @@ gst_flv_demux_init (GstFlvDemux * demux)
gst_element_add_pad (GST_ELEMENT (demux), demux->sinkpad);
demux->adapter = gst_adapter_new ();
demux->taglist = gst_tag_list_new ();
demux->taglist = gst_tag_list_new_empty ();
gst_segment_init (&demux->segment, GST_FORMAT_TIME);
demux->own_index = FALSE;
......
......@@ -306,7 +306,7 @@ gst_icydemux_parse_and_send_tags (GstICYDemux * icydemux)
* a bit easier, then do that parsing. */
buffer = g_strndup ((const gchar *) data, length);
tags = gst_tag_list_new ();
tags = gst_tag_list_new_empty ();
strings = g_strsplit (buffer, "';", 0);
for (i = 0; strings[i]; i++) {
......
......@@ -6494,7 +6494,7 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
stream->caps =
qtdemux_video_caps (qtdemux, stream, fourcc, stsd_data, &codec);
if (codec) {
list = gst_tag_list_new ();
list = gst_tag_list_new_empty ();
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
GST_TAG_VIDEO_CODEC, codec, NULL);
g_free (codec);
......@@ -6588,7 +6588,7 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
}
if (!list)
list = gst_tag_list_new ();
list = gst_tag_list_new_empty ();
if (max_bitrate > 0 && max_bitrate < G_MAXUINT32) {
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
......@@ -7151,7 +7151,7 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
GstStructure *s;
gint bitrate = 0;
list = gst_tag_list_new ();
list = gst_tag_list_new_empty ();
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
GST_TAG_AUDIO_CODEC, codec, NULL);
g_free (codec);
......@@ -7313,7 +7313,7 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
if ((len - 0x34) > 8 &&
(bitrate = qtdemux_parse_amr_bitrate (buf, amrwb))) {
if (!list)
list = gst_tag_list_new ();
list = gst_tag_list_new_empty ();
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
GST_TAG_MAXIMUM_BITRATE, bitrate, NULL);
}
......@@ -7350,7 +7350,7 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
stream->caps =
qtdemux_sub_caps (qtdemux, stream, fourcc, stsd_data, &codec);
if (codec) {
list = gst_tag_list_new ();
list = gst_tag_list_new_empty ();
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
GST_TAG_SUBTITLE_CODEC, codec, NULL);
g_free (codec);
......@@ -7462,7 +7462,7 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
const gchar *lang_code;
if (!list)
list = gst_tag_list_new ();
list = gst_tag_list_new_empty ();
/* convert ISO 639-2 code to ISO 639-1 */
lang_code = gst_tag_get_language_code (stream->lang_id);
......@@ -7605,7 +7605,7 @@ gst_qtdemux_guess_bitrate (GstQTDemux * qtdemux)
", Stream bitrate = %u", sys_bitrate, bitrate);
if (!stream->pending_tags)
stream->pending_tags = gst_tag_list_new ();
stream->pending_tags = gst_tag_list_new_empty ();
gst_tag_list_add (stream->pending_tags, GST_TAG_MERGE_REPLACE,
GST_TAG_BITRATE, bitrate, NULL);
......@@ -8569,7 +8569,7 @@ qtdemux_parse_udta (GstQTDemux * qtdemux, GNode * udta)
GST_DEBUG_OBJECT (qtdemux, "new tag list");
if (!qtdemux->tag_list)
qtdemux->tag_list = gst_tag_list_new ();
qtdemux->tag_list = gst_tag_list_new_empty ();
i = 0;
while (i < G_N_ELEMENTS (add_funcs)) {
......@@ -8787,7 +8787,7 @@ qtdemux_add_container_format (GstQTDemux * qtdemux, GstTagList * tags)
const gchar *fmt;
if (tags == NULL)
tags = gst_tag_list_new ();
tags = gst_tag_list_new_empty ();
if (qtdemux->major_brand == FOURCC_mjp2)
fmt = "Motion JPEG 2000";
......@@ -8857,7 +8857,7 @@ qtdemux_parse_tree (GstQTDemux * qtdemux)
}
if (datetime) {
if (!qtdemux->tag_list)
qtdemux->tag_list = gst_tag_list_new ();
qtdemux->tag_list = gst_tag_list_new_empty ();
/* Use KEEP as explicit tags should have a higher priority than mvhd tag */
gst_tag_list_add (qtdemux->tag_list, GST_TAG_MERGE_KEEP, GST_TAG_DATE_TIME,
......
......@@ -607,8 +607,7 @@ gst_multipart_demux_chain (GstPad * pad, GstBuffer * buf)
/* Push new segment, first buffer has 0 timestamp */
gst_pad_push_event (srcpad->pad, gst_event_new_segment (&segment));
tags =
gst_tag_list_new_full (GST_TAG_CONTAINER_FORMAT, "Multipart", NULL);
tags = gst_tag_list_new (GST_TAG_CONTAINER_FORMAT, "Multipart", NULL);
gst_pad_push_event (srcpad->pad, gst_event_new_tag (tags));
GST_BUFFER_TIMESTAMP (outbuf) = 0;
......
......@@ -664,7 +664,7 @@ gst_rg_analysis_track_result (GstRgAnalysis * filter, GstTagList ** tag_list)
if (track_success) {
if (*tag_list == NULL)
*tag_list = gst_tag_list_new ();
*tag_list = gst_tag_list_new_empty ();
gst_tag_list_add (*tag_list, GST_TAG_MERGE_APPEND,
GST_TAG_TRACK_PEAK, track_peak, GST_TAG_TRACK_GAIN, track_gain, NULL);
}
......@@ -691,7 +691,7 @@ gst_rg_analysis_album_result (GstRgAnalysis * filter, GstTagList ** tag_list)
if (album_success) {
if (*tag_list == NULL)
*tag_list = gst_tag_list_new ();
*tag_list = gst_tag_list_new_empty ();
gst_tag_list_add (*tag_list, GST_TAG_MERGE_APPEND,
GST_TAG_ALBUM_PEAK, album_peak, GST_TAG_ALBUM_GAIN, album_gain, NULL);
}
......
......@@ -1266,7 +1266,7 @@ gst_wavparse_stream_headers (GstWavParse * wav)
wav->got_fmt = TRUE;
if (codec_name) {
wav->tags = gst_tag_list_new ();
wav->tags = gst_tag_list_new_empty ();
gst_tag_list_add (wav->tags, GST_TAG_MERGE_REPLACE,
GST_TAG_AUDIO_CODEC, codec_name, NULL);
......@@ -1419,7 +1419,7 @@ gst_wavparse_stream_headers (GstWavParse * wav)
}
/* send data as tags */
if (!wav->tags)
wav->tags = gst_tag_list_new ();
wav->tags = gst_tag_list_new_empty ();
gst_tag_list_add (wav->tags, GST_TAG_MERGE_REPLACE,
GST_TAG_BEATS_PER_MINUTE, tempo, 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