From: Sebastian Dröge Date: Mon, 16 Dec 2013 09:13:36 +0000 (+0100) Subject: diracparse: Post VIDEO_CODEC tag X-Git-Tag: 1.19.3~507^2~12863 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e65b9b974a7abf0bd80b0608d3197f9de254462a;p=platform%2Fupstream%2Fgstreamer.git diracparse: Post VIDEO_CODEC tag --- diff --git a/gst/videoparsers/gstdiracparse.c b/gst/videoparsers/gstdiracparse.c index e71383c..9307f10 100644 --- a/gst/videoparsers/gstdiracparse.c +++ b/gst/videoparsers/gstdiracparse.c @@ -35,7 +35,8 @@ #endif #include -#include +#include +#include #include #include "gstdiracparse.h" #include "dirac_parse.h" @@ -189,8 +190,12 @@ gst_dirac_parse_finalize (GObject * object) static gboolean gst_dirac_parse_start (GstBaseParse * parse) { + GstDiracParse *diracparse = GST_DIRAC_PARSE (parse); + gst_base_parse_set_min_frame_size (parse, 13); + diracparse->sent_codec_tag = FALSE; + return TRUE; } @@ -384,6 +389,26 @@ gst_dirac_parse_convert (GstBaseParse * parse, GstFormat src_format, static GstFlowReturn gst_dirac_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) { + GstDiracParse *diracparse = GST_DIRAC_PARSE (parse); + + if (!diracparse->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 (diracparse), + gst_event_new_tag (taglist)); + + /* also signals the end of first-frame processing */ + diracparse->sent_codec_tag = TRUE; + } return GST_FLOW_OK; } diff --git a/gst/videoparsers/gstdiracparse.h b/gst/videoparsers/gstdiracparse.h index 407f272..8b764de 100644 --- a/gst/videoparsers/gstdiracparse.h +++ b/gst/videoparsers/gstdiracparse.h @@ -42,6 +42,8 @@ struct _GstDiracParse DiracSequenceHeader sequence_header; guint32 frame_number; + + gboolean sent_codec_tag; }; struct _GstDiracParseClass