From b3f198b67d022ee1a9bbbf6b77cedea578881c96 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 16 Dec 2013 10:25:22 +0100 Subject: [PATCH] vc1parse: Post VIDEO_CODEC tag --- gst/videoparsers/gstvc1parse.c | 22 +++++++++++++++++++++- gst/videoparsers/gstvc1parse.h | 2 ++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/gst/videoparsers/gstvc1parse.c b/gst/videoparsers/gstvc1parse.c index 7495df2..9868afa 100644 --- a/gst/videoparsers/gstvc1parse.c +++ b/gst/videoparsers/gstvc1parse.c @@ -81,7 +81,8 @@ #include "gstvc1parse.h" -#include +#include +#include #include GST_DEBUG_CATEGORY (vc1_parse_debug); @@ -1218,6 +1219,25 @@ gst_vc1_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) { GstVC1Parse *vc1parse = GST_VC1_PARSE (parse); + if (!vc1parse->sent_codec_tag) { + GstTagList *taglist; + GstCaps *caps; + + taglist = gst_tag_list_new_empty (); + + /* codec tag */ + caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (parse)); + gst_pb_utils_add_codec_description_to_tag_list (taglist, + GST_TAG_VIDEO_CODEC, caps); + gst_caps_unref (caps); + + gst_pad_push_event (GST_BASE_PARSE_SRC_PAD (vc1parse), + gst_event_new_tag (taglist)); + + /* also signals the end of first-frame processing */ + vc1parse->sent_codec_tag = TRUE; + } + if (vc1parse->input_header_format != vc1parse->output_header_format || vc1parse->input_stream_format != vc1parse->output_stream_format) { GST_WARNING_OBJECT (vc1parse, "stream conversion not implemented yet"); diff --git a/gst/videoparsers/gstvc1parse.h b/gst/videoparsers/gstvc1parse.h index ec09fd4..6d97ec8 100644 --- a/gst/videoparsers/gstvc1parse.h +++ b/gst/videoparsers/gstvc1parse.h @@ -88,6 +88,8 @@ struct _GstVC1Parse /* TRUE if the srcpads should be updated */ gboolean update_caps; + gboolean sent_codec_tag; + VC1HeaderFormat input_header_format; VC1HeaderFormat output_header_format; VC1StreamFormat input_stream_format; -- 2.7.4