h265parse: Fix the logic for constructing a complete AU
Submitted by KyungYong KIM
Link to original bug (#740748)
Description
In h265parse, it doesn't consider all nal_unit_type about VCL(Video Coding Layer) to construct a complete AU.
It can resolve using following patch.
diff --git a/gst/videoparsers/gsth265parse.c b/gst/videoparsers/gsth265parse.c
index 2d7b997..4a36e3b 100644
--- a/gst/videoparsers/gsth265parse.c
+++ b/gst/videoparsers/gsth265parse.c
@@ -693,10 +693,8 @@ gst_h265_parse_collect_nal (GstH265Parse * h265parse, const
GST_LOG_OBJECT (h265parse, "nal type: %d %s", nal_type, _nal_name (nal_type))
/* coded slice NAL starts a picture,
* i.e. other types become aggregated in front of it */
- h265parse->picture_start |= ((nal_type >= GST_H265_NAL_SLICE_TRAIL_N
-
&& nal_type <= GST_H265_NAL_SLICE_TRAIL_R)
-
|| (nal_type >= GST_H265_NAL_SLICE_BLA_W_LP
-
&& nal_type <= RESERVED_IRAP_NAL_TYPE_MAX));
-
h265parse->picture_start |= (nal_type >= GST_H265_NAL_SLICE_TRAIL_N
-
&& nal_type <= RESERVED_IRAP_NAL_TYPE_MAX);
/* consider a coded slices (IRAP or not) to start a picture,
- (so ending the previous one) if first_slice_segment_in_pic_flag == 1*/
@@ -711,10 +709,8 @@ gst_h265_parse_collect_nal (GstH265Parse * h265parse, const
/* Any VCL Nal unit with first_slice_segment_in_pic_flag == 1 considered star
complete |= h265parse->picture_start - (so ending the previous one) if first_slice_segment_in_pic_flag == 1*/
-
&& (((nal_type >= GST_H265_NAL_SLICE_TRAIL_N
-
&& nal_type <= GST_H265_NAL_SLICE_TRAIL_R)
-
|| (nal_type >= GST_H265_NAL_SLICE_BLA_W_LP
-
&& nal_type <= RESERVED_IRAP_NAL_TYPE_MAX))
-
&& ((nal_type >= GST_H265_NAL_SLICE_TRAIL_N
-
&& nal_type <= RESERVED_IRAP_NAL_TYPE_MAX) && (nnalu.data[nnalu.offset + 2] & 0x80));
GST_LOG_OBJECT (h265parse, "au complete: %d", complete);
Version: 1.4.4