From 183a494574808def9dfbf906e45a482ee88f465a Mon Sep 17 00:00:00 2001 From: Marcus Wichelmann Date: Tue, 10 Aug 2021 12:40:17 +0200 Subject: [PATCH 1/5] Set array_completeness in HEVCDecoderConfigurationRecord correctly --- packager/media/codecs/h265_byte_to_unit_stream_converter.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packager/media/codecs/h265_byte_to_unit_stream_converter.cc b/packager/media/codecs/h265_byte_to_unit_stream_converter.cc index 1c177a8d5e9..6e8378f6e20 100644 --- a/packager/media/codecs/h265_byte_to_unit_stream_converter.cc +++ b/packager/media/codecs/h265_byte_to_unit_stream_converter.cc @@ -74,8 +74,10 @@ bool H265ByteToUnitStreamConverter::GetDecoderConfigurationRecord( buffer.AppendInt(static_cast(kUnitStreamNaluLengthSize - 1)); buffer.AppendInt(static_cast(3) /* numOfArrays */); + // More parameter set NALUs may follow when strip_parameter_set_nalus is disabled. + const uint8_t kArrayCompleteness = strip_parameter_set_nalus() ? 0x80 : 0; + // VPS - const uint8_t kArrayCompleteness = 0x80; buffer.AppendInt(static_cast(kArrayCompleteness | Nalu::H265_VPS)); buffer.AppendInt(static_cast(1) /* numNalus */); buffer.AppendInt(static_cast(last_vps_.size())); From df1b4f8e074c55fe4dd03d658a35a2c8e7738984 Mon Sep 17 00:00:00 2001 From: Cosmin Stejerean Date: Wed, 14 Feb 2024 16:49:20 -0800 Subject: [PATCH 2/5] rename kArrayCompleteness to array_completeness now that is no longer a compile time constant --- .../media/codecs/h265_byte_to_unit_stream_converter.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packager/media/codecs/h265_byte_to_unit_stream_converter.cc b/packager/media/codecs/h265_byte_to_unit_stream_converter.cc index 6e8378f6e20..7862c998075 100644 --- a/packager/media/codecs/h265_byte_to_unit_stream_converter.cc +++ b/packager/media/codecs/h265_byte_to_unit_stream_converter.cc @@ -75,22 +75,22 @@ bool H265ByteToUnitStreamConverter::GetDecoderConfigurationRecord( buffer.AppendInt(static_cast(3) /* numOfArrays */); // More parameter set NALUs may follow when strip_parameter_set_nalus is disabled. - const uint8_t kArrayCompleteness = strip_parameter_set_nalus() ? 0x80 : 0; + const uint8_t array_completeness = strip_parameter_set_nalus() ? 0x80 : 0; // VPS - buffer.AppendInt(static_cast(kArrayCompleteness | Nalu::H265_VPS)); + buffer.AppendInt(static_cast(array_completeness | Nalu::H265_VPS)); buffer.AppendInt(static_cast(1) /* numNalus */); buffer.AppendInt(static_cast(last_vps_.size())); buffer.AppendVector(last_vps_); // SPS - buffer.AppendInt(static_cast(kArrayCompleteness | Nalu::H265_SPS)); + buffer.AppendInt(static_cast(array_completeness | Nalu::H265_SPS)); buffer.AppendInt(static_cast(1) /* numNalus */); buffer.AppendInt(static_cast(last_sps_.size())); buffer.AppendVector(last_sps_); // PPS - buffer.AppendInt(static_cast(kArrayCompleteness | Nalu::H265_PPS)); + buffer.AppendInt(static_cast(array_completeness | Nalu::H265_PPS)); buffer.AppendInt(static_cast(1) /* numNalus */); buffer.AppendInt(static_cast(last_pps_.size())); buffer.AppendVector(last_pps_); From 580f01012cf3826f5e839c281da64849dc22f340 Mon Sep 17 00:00:00 2001 From: Cosmin Stejerean Date: Wed, 14 Feb 2024 16:50:07 -0800 Subject: [PATCH 3/5] fix format --- packager/media/codecs/h265_byte_to_unit_stream_converter.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packager/media/codecs/h265_byte_to_unit_stream_converter.cc b/packager/media/codecs/h265_byte_to_unit_stream_converter.cc index 7862c998075..3235b0a0cae 100644 --- a/packager/media/codecs/h265_byte_to_unit_stream_converter.cc +++ b/packager/media/codecs/h265_byte_to_unit_stream_converter.cc @@ -74,7 +74,8 @@ bool H265ByteToUnitStreamConverter::GetDecoderConfigurationRecord( buffer.AppendInt(static_cast(kUnitStreamNaluLengthSize - 1)); buffer.AppendInt(static_cast(3) /* numOfArrays */); - // More parameter set NALUs may follow when strip_parameter_set_nalus is disabled. + // More parameter set NALUs may follow when strip_parameter_set_nalus is + // disabled. const uint8_t array_completeness = strip_parameter_set_nalus() ? 0x80 : 0; // VPS From 3d9dab437c7287f9325e468772b82a7d329ec63f Mon Sep 17 00:00:00 2001 From: Cosmin Stejerean Date: Wed, 14 Feb 2024 18:27:50 -0800 Subject: [PATCH 4/5] manually fix clang-format since local version disagrees with remote version --- packager/media/codecs/h265_byte_to_unit_stream_converter.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packager/media/codecs/h265_byte_to_unit_stream_converter.cc b/packager/media/codecs/h265_byte_to_unit_stream_converter.cc index 3235b0a0cae..7862c998075 100644 --- a/packager/media/codecs/h265_byte_to_unit_stream_converter.cc +++ b/packager/media/codecs/h265_byte_to_unit_stream_converter.cc @@ -74,8 +74,7 @@ bool H265ByteToUnitStreamConverter::GetDecoderConfigurationRecord( buffer.AppendInt(static_cast(kUnitStreamNaluLengthSize - 1)); buffer.AppendInt(static_cast(3) /* numOfArrays */); - // More parameter set NALUs may follow when strip_parameter_set_nalus is - // disabled. + // More parameter set NALUs may follow when strip_parameter_set_nalus is disabled. const uint8_t array_completeness = strip_parameter_set_nalus() ? 0x80 : 0; // VPS From 3dbf31e113b01c7fec01ff97da17a91b3e2436c2 Mon Sep 17 00:00:00 2001 From: Cosmin Stejerean Date: Wed, 14 Feb 2024 20:07:52 -0800 Subject: [PATCH 5/5] format again --- packager/media/codecs/h265_byte_to_unit_stream_converter.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packager/media/codecs/h265_byte_to_unit_stream_converter.cc b/packager/media/codecs/h265_byte_to_unit_stream_converter.cc index 7862c998075..3235b0a0cae 100644 --- a/packager/media/codecs/h265_byte_to_unit_stream_converter.cc +++ b/packager/media/codecs/h265_byte_to_unit_stream_converter.cc @@ -74,7 +74,8 @@ bool H265ByteToUnitStreamConverter::GetDecoderConfigurationRecord( buffer.AppendInt(static_cast(kUnitStreamNaluLengthSize - 1)); buffer.AppendInt(static_cast(3) /* numOfArrays */); - // More parameter set NALUs may follow when strip_parameter_set_nalus is disabled. + // More parameter set NALUs may follow when strip_parameter_set_nalus is + // disabled. const uint8_t array_completeness = strip_parameter_set_nalus() ? 0x80 : 0; // VPS