Commit 29df8cb8 authored by Nicolas Dufresne's avatar Nicolas Dufresne
Browse files

WIP: h264parse: Don't push NALs before we have HEADERS

Otherwise we may endup pushing incomplete caps.

This patch isn't ready yet, as it will merge PPS/SPS in the same
GstBuffer. This is valid as per current definition of alignment=nal,
but is also a behaviour change. It's also weird, since it only merge
these for the first set.
parent cd11a069
......@@ -1264,23 +1264,29 @@ gst_h264_parse_handle_frame (GstBaseParse * parse,
/* if no next nal, we reached the end of this buffer */
if (nonext) {
/* 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;
}
/* We may have complete frame ff we have valid header */
if (GST_H264_PARSE_STATE_VALID (h264parse,
GST_H264_PARSE_STATE_VALID_PICTURE_HEADERS)) {
/* If there is a marker flag, or input is AU */
if (GST_BUFFER_FLAG_IS_SET (frame->buffer, GST_BUFFER_FLAG_MARKER) ||
h264parse->in_align == GST_H264_PARSE_ALIGN_AU) {
h264parse->marker = TRUE;
break;
}
/* or if we are draining */
if (drain || h264parse->align == GST_H264_PARSE_ALIGN_NAL)
break;
/* or if we are draining */
if (drain || h264parse->align == GST_H264_PARSE_ALIGN_NAL)
break;
}
current_off = nalu.offset + nalu.size;
goto more;
}
/* If the output is NAL, we are done */
if (h264parse->align == GST_H264_PARSE_ALIGN_NAL)
if (h264parse->align == GST_H264_PARSE_ALIGN_NAL &&
GST_H264_PARSE_STATE_VALID (h264parse,
GST_H264_PARSE_STATE_VALID_PICTURE_HEADERS))
break;
GST_DEBUG_OBJECT (h264parse, "Looking for more");
......
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