HEVC parse fail to determine AU boundary correctly
Some conformance test stream like:
The stream insert prefix SEI into different slices of on picture. Then, the h265 parse fail to give the correct AU size, just only push the data of first slice to downstream.
The problem is in gst_h265_parse_handle_frame, the gst_h265_parse_collect_nal recognize GST_H265_NAL_PREFIX_SEI as an AU delimiter and finish this incomplete frame.
This will cause decoder lose slices and decoder error.
The spec F.126.96.36.199.3 says:
The first of any of the following NAL units preceding the first VCL NAL unit firstVclNalUnitInAu and succeeding the last VCL NAL unit preceding firstVclNalUnitInAu, if any, specifies the start of a new access unit: – Access unit delimiter NAL unit (when present). – VPS NAL unit (when present) – SPS NAL unit (when present) – PPS NAL unit (when present) – Prefix SEI NAL unit (when present) – NAL units with nal_unit_type in the range of RSV_NVCL41..RSV_NVCL44 (when present) – NAL units with nal_unit_type in the range of UNSPEC48..UNSPEC55 (when present) When there is none of the above NAL units preceding firstVclNalUnitInAu and succeeding the last VCL NAL unit preceding firstVclNalUnitInAu, if any, firstVclNalUnitInAu starts a new access unit.
So, the SPS, VPS, PPS and SEI should not determine the AU boundary. We still need to find the next slice NAL with first_slice_segment_in_pic_flag set to 1.