h264parse: Propagate MARKER flag

This commit is contained in:
Nicolas Dufresne 2018-09-28 16:49:52 -04:00 committed by Nicolas Dufresne
parent a194a87b26
commit ba8b605c6f
2 changed files with 18 additions and 0 deletions

View file

@ -302,6 +302,7 @@ gst_h264_parse_reset (GstH264Parse * h264parse)
h264parse->discont = FALSE;
h264parse->discard_bidirectional = FALSE;
h264parse->marker = FALSE;
gst_h264_parse_reset_stream_info (h264parse);
}
@ -1247,6 +1248,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
@ -1263,6 +1270,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 {
@ -1485,6 +1493,7 @@ gst_h264_parse_handle_frame (GstBaseParse * parse,
if (current_off > 0) {
nalu.size = 0;
nalu.offset = nalu.sc_offset;
h264parse->marker = TRUE;
break;
}
}
@ -1508,6 +1517,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;
}
@ -2567,6 +2577,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) {

View file

@ -116,6 +116,7 @@ struct _GstH264Parse
gboolean do_ts;
gboolean discont;
gboolean marker;
/* frame parsing */
/*guint last_nal_pos;*/