Correctly mark video frame type for FU packets.

Mark FU packets with type between kBlaWLp and kRsvIrapVcl23 as key frames.
This behavior aligns with AP and single NALU.

Bug: webrtc:13485
Change-Id: I51762e89ebb4829b50524d9f5476f2d5d9c093f7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/338860
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41764}
This commit is contained in:
Jianjun Zhu 2024-02-09 14:18:58 +08:00 committed by WebRTC LUCI CQ
parent 0355f455a4
commit dba3fd6c1b
2 changed files with 8 additions and 7 deletions

View File

@ -202,9 +202,8 @@ absl::optional<VideoRtpDepacketizer::ParsedRtpPayload> ParseFuNalu(
rtp_payload.size() - kH265NalHeaderSizeBytes - kH265FuHeaderSizeBytes);
}
if (original_nal_type == H265::NaluType::kIdrWRadl ||
original_nal_type == H265::NaluType::kIdrNLp ||
original_nal_type == H265::NaluType::kCra) {
if (original_nal_type >= H265::NaluType::kBlaWLp &&
original_nal_type <= H265::NaluType::kRsvIrapVcl23) {
parsed_payload->video_header.frame_type = VideoFrameType::kVideoFrameKey;
} else {
parsed_payload->video_header.frame_type = VideoFrameType::kVideoFrameDelta;

View File

@ -297,15 +297,15 @@ TEST(VideoRtpDepacketizerH265Test, Fu) {
0x08, 0x4a, 0x31, 0x11, 0x15, 0xe5, 0xc0};
uint8_t packet2[] = {
0x62, 0x02, // F=0, Type=49 (kH265Fu).
H265::kIdrWRadl, // FU header.
0x02 // Payload.
0x62, 0x02, // F=0, Type=49 (kH265Fu).
H265::kBlaWLp, // FU header.
0x02 // Payload.
};
const uint8_t kExpected2[] = {0x02};
uint8_t packet3[] = {
0x62, 0x02, // F=0, Type=49 (kH265Fu).
0x33, // FU header kH265EBitMask | H265::kIdrWRadl.
0x53, // FU header kH265EBitMask | H265::kIdrWRadl.
0x03 // Payload.
};
const uint8_t kExpected3[] = {0x03};
@ -330,6 +330,7 @@ TEST(VideoRtpDepacketizerH265Test, Fu) {
parsed2->video_payload.size()),
ElementsAreArray(kExpected2));
EXPECT_FALSE(parsed2->video_header.is_first_packet_in_frame);
EXPECT_EQ(parsed2->video_header.frame_type, VideoFrameType::kVideoFrameKey);
EXPECT_EQ(parsed2->video_header.codec, kVideoCodecH265);
auto parsed3 = depacketizer.Parse(rtc::CopyOnWriteBuffer(packet3));
@ -337,6 +338,7 @@ TEST(VideoRtpDepacketizerH265Test, Fu) {
parsed3->video_payload.size()),
ElementsAreArray(kExpected3));
EXPECT_FALSE(parsed3->video_header.is_first_packet_in_frame);
EXPECT_EQ(parsed3->video_header.frame_type, VideoFrameType::kVideoFrameKey);
EXPECT_EQ(parsed3->video_header.codec, kVideoCodecH265);
}