From 67468c5b926b39cf1962395bc990101ce3e2ea2f Mon Sep 17 00:00:00 2001 From: Qiu Jianlin Date: Tue, 20 Jul 2021 12:09:15 +0800 Subject: [PATCH] Ignore prefix NAL unit for slice parsing. For temporal scalability, prefix NALU contains layer information, but should not be parsed as a slice. Bug: webrtc:12991 Change-Id: Ic1e7d41f568310390a743d4ace016aa7d57a4864 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226501 Reviewed-by: Sergey Silkin Commit-Queue: Sergey Silkin Cr-Commit-Position: refs/heads/master@{#34523} --- common_video/h264/h264_bitstream_parser.cc | 1 + common_video/h264/h264_common.h | 1 + 2 files changed, 2 insertions(+) diff --git a/common_video/h264/h264_bitstream_parser.cc b/common_video/h264/h264_bitstream_parser.cc index 3b41599fa0..6eee02ed24 100644 --- a/common_video/h264/h264_bitstream_parser.cc +++ b/common_video/h264/h264_bitstream_parser.cc @@ -288,6 +288,7 @@ void H264BitstreamParser::ParseSlice(const uint8_t* slice, size_t length) { } case H264::NaluType::kAud: case H264::NaluType::kSei: + case H264::NaluType::kPrefix: break; // Ignore these nalus, as we don't care about their contents. default: Result res = ParseNonParameterSetNalu(slice, length, nalu_type); diff --git a/common_video/h264/h264_common.h b/common_video/h264/h264_common.h index 2beef16ac5..0b1843ee38 100644 --- a/common_video/h264/h264_common.h +++ b/common_video/h264/h264_common.h @@ -42,6 +42,7 @@ enum NaluType : uint8_t { kEndOfSequence = 10, kEndOfStream = 11, kFiller = 12, + kPrefix = 14, kStapA = 24, kFuA = 28 };