From 10ffa089a05a229e1bdbbfdcdba8e61438154664 Mon Sep 17 00:00:00 2001 From: Sebastian Dröge Date: Fri, 28 Mar 2014 18:27:16 +0100 Subject: h264parse: Copy over DISCONT flag from input buffers --- gst/videoparsers/gsth264parse.c | 12 ++++++++++++ gst/videoparsers/gsth264parse.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c index c641fb008..9105d7f5a 100644 --- a/gst/videoparsers/gsth264parse.c +++ b/gst/videoparsers/gsth264parse.c @@ -211,6 +211,8 @@ gst_h264_parse_reset (GstH264Parse * h264parse) h264parse->pending_key_unit_ts = GST_CLOCK_TIME_NONE; h264parse->force_key_unit_event = NULL; + h264parse->discont = FALSE; + gst_h264_parse_reset_frame (h264parse); } @@ -809,6 +811,11 @@ gst_h264_parse_handle_frame (GstBaseParse * parse, GstH264ParserResult pres; gint framesize; + if (G_UNLIKELY (GST_BUFFER_FLAG_IS_SET (frame->buffer, + GST_BUFFER_FLAG_DISCONT))) { + h264parse->discont = TRUE; + } + /* delegate in packetized case, no skipping should be needed */ if (h264parse->packetized) return gst_h264_parse_handle_frame_packetized (parse, frame); @@ -1457,6 +1464,11 @@ gst_h264_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame) else GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT); + if (h264parse->discont) { + GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT); + h264parse->discont = FALSE; + } + /* replace with transformed AVC output if applicable */ av = gst_adapter_available (h264parse->frame_out); if (av) { diff --git a/gst/videoparsers/gsth264parse.h b/gst/videoparsers/gsth264parse.h index d8eb4d94d..4c3fdd4d1 100644 --- a/gst/videoparsers/gsth264parse.h +++ b/gst/videoparsers/gsth264parse.h @@ -97,6 +97,8 @@ struct _GstH264Parse GstClockTime ts_trn_nb; gboolean do_ts; + gboolean discont; + /* frame parsing */ /*guint last_nal_pos;*/ /*guint next_sc_pos;*/ -- cgit v1.2.3