mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
ext, gst: update for taglist API changes
This commit is contained in:
parent
6e4acbec6b
commit
1905e95cea
6 changed files with 22 additions and 32 deletions
|
@ -545,10 +545,7 @@ gst_a52dec_update_streaminfo (GstA52Dec * a52dec)
|
||||||
{
|
{
|
||||||
GstTagList *taglist;
|
GstTagList *taglist;
|
||||||
|
|
||||||
taglist = gst_tag_list_new ();
|
taglist = gst_tag_list_new (GST_TAG_AUDIO_CODEC, "Dolby Digital (AC-3)",
|
||||||
|
|
||||||
gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND,
|
|
||||||
GST_TAG_AUDIO_CODEC, "Dolby Digital (AC-3)",
|
|
||||||
GST_TAG_BITRATE, (guint) a52dec->bit_rate, NULL);
|
GST_TAG_BITRATE, (guint) a52dec->bit_rate, NULL);
|
||||||
|
|
||||||
gst_element_found_tags_for_pad (GST_ELEMENT (a52dec),
|
gst_element_found_tags_for_pad (GST_ELEMENT (a52dec),
|
||||||
|
|
|
@ -602,7 +602,7 @@ gst_lamemp3enc_setup (GstLameMP3Enc * lame, GstTagList ** tags)
|
||||||
if (lame->lgf == NULL)
|
if (lame->lgf == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
*tags = gst_tag_list_new ();
|
*tags = gst_tag_list_new_empty ();
|
||||||
|
|
||||||
/* copy the parameters over */
|
/* copy the parameters over */
|
||||||
lame_set_in_samplerate (lame->lgf, lame->samplerate);
|
lame_set_in_samplerate (lame->lgf, lame->samplerate);
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
* <refsect2>
|
* <refsect2>
|
||||||
* <title>Example pipelines</title>
|
* <title>Example pipelines</title>
|
||||||
* |[
|
* |[
|
||||||
* 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
|
* ]| Decode the mp3 file and play
|
||||||
* </refsect2>
|
* </refsect2>
|
||||||
*/
|
*/
|
||||||
|
@ -906,9 +906,7 @@ G_STMT_START{ \
|
||||||
emphasis =
|
emphasis =
|
||||||
g_enum_get_value (g_type_class_peek (GST_TYPE_MAD_EMPHASIS),
|
g_enum_get_value (g_type_class_peek (GST_TYPE_MAD_EMPHASIS),
|
||||||
mad->header.emphasis);
|
mad->header.emphasis);
|
||||||
list = gst_tag_list_new ();
|
list = gst_tag_list_new (GST_TAG_LAYER, mad->header.layer,
|
||||||
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
|
||||||
GST_TAG_LAYER, mad->header.layer,
|
|
||||||
GST_TAG_MODE, mode->value_nick,
|
GST_TAG_MODE, mode->value_nick,
|
||||||
GST_TAG_EMPHASIS, emphasis->value_nick, NULL);
|
GST_TAG_EMPHASIS, emphasis->value_nick, NULL);
|
||||||
if (!mad->framed) {
|
if (!mad->framed) {
|
||||||
|
@ -925,7 +923,7 @@ G_STMT_START{ \
|
||||||
CHECK_HEADER (bitrate, "bitrate");
|
CHECK_HEADER (bitrate, "bitrate");
|
||||||
if (!mad->xing_found && changed) {
|
if (!mad->xing_found && changed) {
|
||||||
if (!list)
|
if (!list)
|
||||||
list = gst_tag_list_new ();
|
list = gst_tag_list_new_empty ();
|
||||||
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||||
GST_TAG_BITRATE, mad->header.bitrate, NULL);
|
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,
|
if (mpg123_parse_xing_header (&mad->frame.header,
|
||||||
mad->stream.this_frame, frame_len, &bitrate, &time)) {
|
mad->stream.this_frame, frame_len, &bitrate, &time)) {
|
||||||
mad->xing_found = TRUE;
|
mad->xing_found = TRUE;
|
||||||
list = gst_tag_list_new ();
|
list = gst_tag_list_new (GST_TAG_DURATION,
|
||||||
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
(gint64) time * 1000 * 1000 * 1000,
|
||||||
GST_TAG_DURATION, (gint64) time * 1000 * 1000 * 1000,
|
|
||||||
GST_TAG_BITRATE, bitrate, NULL);
|
GST_TAG_BITRATE, bitrate, NULL);
|
||||||
gst_element_post_message (GST_ELEMENT (mad),
|
gst_element_post_message (GST_ELEMENT (mad),
|
||||||
gst_message_new_tag (GST_OBJECT (mad), gst_tag_list_copy (list)));
|
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");
|
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,
|
return gst_element_register (plugin, "mad", GST_RANK_SECONDARY,
|
||||||
gst_mad_get_type ());
|
gst_mad_get_type ());
|
||||||
}
|
}
|
||||||
|
|
|
@ -257,7 +257,7 @@ update_tags (GstSidDec * siddec)
|
||||||
GstTagList *list;
|
GstTagList *list;
|
||||||
|
|
||||||
if (siddec->tune->getInfo (info)) {
|
if (siddec->tune->getInfo (info)) {
|
||||||
list = gst_tag_list_new ();
|
list = gst_tag_list_new_empty ();
|
||||||
|
|
||||||
if (info.nameString) {
|
if (info.nameString) {
|
||||||
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||||
|
|
|
@ -1390,7 +1390,7 @@ gst_asf_demux_push_complete_payloads (GstASFDemux * demux, gboolean force)
|
||||||
|
|
||||||
/* now post any global tags we may have found */
|
/* now post any global tags we may have found */
|
||||||
if (demux->taglist == NULL)
|
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_list_add (demux->taglist, GST_TAG_MERGE_REPLACE,
|
||||||
GST_TAG_CONTAINER_FORMAT, "ASF", NULL);
|
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 */
|
/* Informing about that audio format we just added */
|
||||||
if (codec_name) {
|
if (codec_name) {
|
||||||
tags = gst_tag_list_new ();
|
tags = gst_tag_list_new (GST_TAG_AUDIO_CODEC, codec_name, NULL);
|
||||||
gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_AUDIO_CODEC,
|
|
||||||
codec_name, NULL);
|
|
||||||
g_free (codec_name);
|
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);
|
gst_caps_set_simple (caps, "format", G_TYPE_UINT, video->tag, NULL);
|
||||||
|
|
||||||
if (codec_name) {
|
if (codec_name) {
|
||||||
tags = gst_tag_list_new ();
|
tags = gst_tag_list_new (GST_TAG_VIDEO_CODEC, codec_name, NULL);
|
||||||
gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_VIDEO_CODEC,
|
|
||||||
codec_name, NULL);
|
|
||||||
g_free (codec_name);
|
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");
|
GST_INFO_OBJECT (demux, "object is an extended content description");
|
||||||
|
|
||||||
taglist = gst_tag_list_new ();
|
taglist = gst_tag_list_new_empty ();
|
||||||
|
|
||||||
/* Content Descriptor Count */
|
/* Content Descriptor Count */
|
||||||
if (size < 2)
|
if (size < 2)
|
||||||
|
@ -3063,7 +3059,7 @@ gst_asf_demux_process_comment (GstASFDemux * demux, guint8 * data, guint64 size)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* parse metadata into taglist */
|
/* parse metadata into taglist */
|
||||||
taglist = gst_tag_list_new ();
|
taglist = gst_tag_list_new_empty ();
|
||||||
g_value_init (&value, G_TYPE_STRING);
|
g_value_init (&value, G_TYPE_STRING);
|
||||||
for (i = 0; i < G_N_ELEMENTS (tags); ++i) {
|
for (i = 0; i < G_N_ELEMENTS (tags); ++i) {
|
||||||
if (tags[i].val_utf8 && strlen (tags[i].val_utf8) > 0 && tags[i].gst_tag) {
|
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);
|
GST_DEBUG_OBJECT (demux, "bitrate of stream %u = %u", stream_id, bitrate);
|
||||||
stream = gst_asf_demux_get_stream (demux, stream_id);
|
stream = gst_asf_demux_get_stream (demux, stream_id);
|
||||||
if (stream) {
|
if (stream) {
|
||||||
if (stream->pending_tags == NULL)
|
if (stream->pending_tags == NULL) {
|
||||||
stream->pending_tags = gst_tag_list_new ();
|
stream->pending_tags =
|
||||||
gst_tag_list_add (stream->pending_tags, GST_TAG_MERGE_REPLACE,
|
gst_tag_list_new (GST_TAG_BITRATE, bitrate, NULL);
|
||||||
GST_TAG_BITRATE, bitrate, NULL);
|
}
|
||||||
} else {
|
} else {
|
||||||
GST_WARNING_OBJECT (demux, "Stream id %u wasn't found", stream_id);
|
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 */
|
/* add language info now if we have it */
|
||||||
if (stream->ext_props.lang_idx < demux->num_languages) {
|
if (stream->ext_props.lang_idx < demux->num_languages) {
|
||||||
if (stream->pending_tags == NULL)
|
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,
|
GST_LOG_OBJECT (demux, "stream %u has language '%s'", stream->id,
|
||||||
demux->languages[stream->ext_props.lang_idx]);
|
demux->languages[stream->ext_props.lang_idx]);
|
||||||
gst_tag_list_add (stream->pending_tags, GST_TAG_MERGE_APPEND,
|
gst_tag_list_add (stream->pending_tags, GST_TAG_MERGE_APPEND,
|
||||||
|
|
|
@ -219,10 +219,8 @@ gst_dvdlpcmdec_send_tags (GstDvdLpcmDec * dvdlpcmdec)
|
||||||
|
|
||||||
bitrate = bpf * 8 * rate;
|
bitrate = bpf * 8 * rate;
|
||||||
|
|
||||||
taglist = gst_tag_list_new ();
|
taglist = gst_tag_list_new (GST_TAG_AUDIO_CODEC, "LPCM Audio",
|
||||||
|
GST_TAG_BITRATE, bitrate, NULL);
|
||||||
gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND,
|
|
||||||
GST_TAG_AUDIO_CODEC, "LPCM Audio", GST_TAG_BITRATE, bitrate, NULL);
|
|
||||||
|
|
||||||
gst_element_found_tags_for_pad (GST_ELEMENT (dvdlpcmdec), dvdlpcmdec->srcpad,
|
gst_element_found_tags_for_pad (GST_ELEMENT (dvdlpcmdec), dvdlpcmdec->srcpad,
|
||||||
taglist);
|
taglist);
|
||||||
|
|
Loading…
Reference in a new issue