diracparse: Post VIDEO_CODEC tag

This commit is contained in:
Sebastian Dröge 2013-12-16 10:13:36 +01:00
parent 44b9429516
commit e65b9b974a
2 changed files with 28 additions and 1 deletions

View file

@ -35,7 +35,8 @@
#endif #endif
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/base/gstbytereader.h> #include <gst/base/base.h>
#include <gst/pbutils/pbutils.h>
#include <string.h> #include <string.h>
#include "gstdiracparse.h" #include "gstdiracparse.h"
#include "dirac_parse.h" #include "dirac_parse.h"
@ -189,8 +190,12 @@ gst_dirac_parse_finalize (GObject * object)
static gboolean static gboolean
gst_dirac_parse_start (GstBaseParse * parse) gst_dirac_parse_start (GstBaseParse * parse)
{ {
GstDiracParse *diracparse = GST_DIRAC_PARSE (parse);
gst_base_parse_set_min_frame_size (parse, 13); gst_base_parse_set_min_frame_size (parse, 13);
diracparse->sent_codec_tag = FALSE;
return TRUE; return TRUE;
} }
@ -384,6 +389,26 @@ gst_dirac_parse_convert (GstBaseParse * parse, GstFormat src_format,
static GstFlowReturn static GstFlowReturn
gst_dirac_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) 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; return GST_FLOW_OK;
} }

View file

@ -42,6 +42,8 @@ struct _GstDiracParse
DiracSequenceHeader sequence_header; DiracSequenceHeader sequence_header;
guint32 frame_number; guint32 frame_number;
gboolean sent_codec_tag;
}; };
struct _GstDiracParseClass struct _GstDiracParseClass