h265parse: Propagate MARKER flag

This commit is contained in:
Nicolas Dufresne 2018-10-03 16:35:39 -04:00 committed by Nicolas Dufresne
parent e88d848070
commit ceb68c4cf8
2 changed files with 18 additions and 0 deletions

View file

@ -260,6 +260,7 @@ gst_h265_parse_reset (GstH265Parse * h265parse)
h265parse->discont = FALSE;
h265parse->discard_bidirectional = FALSE;
h265parse->marker = FALSE;
gst_h265_parse_reset_stream_info (h265parse);
}
@ -1071,6 +1072,12 @@ gst_h265_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))
h265parse->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
@ -1087,6 +1094,7 @@ gst_h265_parse_handle_frame_packetized (GstBaseParse * parse,
gst_buffer_unmap (buffer, &map);
if (!h265parse->split_packetized) {
h265parse->marker = TRUE;
gst_h265_parse_parse_frame (parse, frame);
ret = gst_base_parse_finish_frame (parse, frame, map.size);
} else {
@ -1287,6 +1295,7 @@ gst_h265_parse_handle_frame (GstBaseParse * parse,
if (current_off > 0) {
nalu.size = 0;
nalu.offset = nalu.sc_offset;
h265parse->marker = TRUE;
break;
}
}
@ -1303,6 +1312,7 @@ gst_h265_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) ||
h265parse->in_align == GST_H265_PARSE_ALIGN_AU) {
h265parse->marker = TRUE;
break;
}
@ -2332,6 +2342,13 @@ gst_h265_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
h265parse->discont = FALSE;
}
if (h265parse->marker) {
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_MARKER);
h265parse->marker = FALSE;
} else {
GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_MARKER);
}
/* replace with transformed HEVC output if applicable */
av = gst_adapter_available (h265parse->frame_out);
if (av) {

View file

@ -100,6 +100,7 @@ struct _GstH265Parse
GstH265TimeCode time_code;
gboolean discont;
gboolean marker;
/* frame parsing */
gint idr_pos, sei_pos;