Commit 368af467 authored by Nicolas Dufresne's avatar Nicolas Dufresne
Browse files

h264parse: Propagate MARKER flag

parent 21be756e
......@@ -252,6 +252,7 @@ gst_h264_parse_reset (GstH264Parse * h264parse)
gst_event_replace (&h264parse->force_key_unit_event, NULL);
h264parse->discont = FALSE;
h264parse->marker = FALSE;
gst_h264_parse_reset_stream_info (h264parse);
}
......@@ -1000,6 +1001,12 @@ gst_h264_parse_handle_frame_packetized (GstBaseParse * parse,
tmp_frame.buffer = gst_buffer_copy_region (buffer, GST_BUFFER_COPY_ALL,
nalu.offset, nalu.size);
/* Set marker on last packet */
if (nl + nalu.size == left) {
if (GST_BUFFER_FLAG_IS_SET (frame->buffer, GST_BUFFER_FLAG_MARKER))
h264parse->marker = TRUE;
}
/* note we don't need to come up with a sub-buffer, since
* subsequent code only considers input buffer's metadata.
* Real data is either taken from input by baseclass or
......@@ -1016,6 +1023,7 @@ gst_h264_parse_handle_frame_packetized (GstBaseParse * parse,
gst_buffer_unmap (buffer, &map);
if (!h264parse->split_packetized) {
h264parse->marker = TRUE;
gst_h264_parse_parse_frame (parse, frame);
ret = gst_base_parse_finish_frame (parse, frame, map.size);
} else {
......@@ -1224,6 +1232,7 @@ gst_h264_parse_handle_frame (GstBaseParse * parse,
if (current_off > 0) {
nalu.size = 0;
nalu.offset = nalu.sc_offset;
h264parse->marker = TRUE;
break;
}
}
......@@ -1247,6 +1256,7 @@ gst_h264_parse_handle_frame (GstBaseParse * parse,
/* If there is a marker flag, or input is AU, we know this is complete */
if (GST_BUFFER_FLAG_IS_SET (frame->buffer, GST_BUFFER_FLAG_MARKER) ||
h264parse->in_align == GST_H264_PARSE_ALIGN_AU) {
h264parse->marker = TRUE;
break;
}
......@@ -2175,6 +2185,13 @@ gst_h264_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
h264parse->discont = FALSE;
}
if (h264parse->marker) {
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_MARKER);
h264parse->marker = FALSE;
} else {
GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_MARKER);
}
/* replace with transformed AVC output if applicable */
av = gst_adapter_available (h264parse->frame_out);
if (av) {
......
......@@ -105,6 +105,7 @@ struct _GstH264Parse
gboolean do_ts;
gboolean discont;
gboolean marker;
/* frame parsing */
/*guint last_nal_pos;*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment