video: Merge upstream stream tags

This commit is contained in:
Sebastian Dröge 2012-08-09 16:19:32 +02:00
parent 5989d75e10
commit b141bfed60
2 changed files with 43 additions and 0 deletions

View file

@ -1012,6 +1012,20 @@ gst_video_decoder_sink_event_default (GstVideoDecoder * decoder,
gst_video_decoder_flush (decoder, TRUE);
GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
}
case GST_EVENT_TAG:
{
GstTagList *tags;
gst_event_parse_tag (event, &tags);
if (gst_tag_list_get_scope (tags) == GST_TAG_SCOPE_STREAM) {
gst_video_decoder_merge_tags (decoder, tags, GST_TAG_MERGE_REPLACE);
gst_event_unref (event);
event = NULL;
ret = TRUE;
}
break;
}
default:
break;
}

View file

@ -988,6 +988,35 @@ gst_video_encoder_sink_event_default (GstVideoEncoder * encoder,
}
break;
}
case GST_EVENT_TAG:
{
GstTagList *tags;
gst_event_parse_tag (event, &tags);
if (gst_tag_list_get_scope (tags) == GST_TAG_SCOPE_STREAM) {
tags = gst_tag_list_copy (tags);
/* FIXME: make generic based on GST_TAG_FLAG_ENCODED */
gst_tag_list_remove_tag (tags, GST_TAG_CODEC);
gst_tag_list_remove_tag (tags, GST_TAG_AUDIO_CODEC);
gst_tag_list_remove_tag (tags, GST_TAG_VIDEO_CODEC);
gst_tag_list_remove_tag (tags, GST_TAG_SUBTITLE_CODEC);
gst_tag_list_remove_tag (tags, GST_TAG_CONTAINER_FORMAT);
gst_tag_list_remove_tag (tags, GST_TAG_BITRATE);
gst_tag_list_remove_tag (tags, GST_TAG_NOMINAL_BITRATE);
gst_tag_list_remove_tag (tags, GST_TAG_MAXIMUM_BITRATE);
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);
gst_video_encoder_merge_tags (encoder, tags, GST_TAG_MERGE_REPLACE);
gst_event_unref (event);
event = NULL;
ret = TRUE;
}
break;
}
default:
break;
}