Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc

Issue 2385143002: Revert "Revert of Use sps and pps to determine decodability of H.264 frames. (patchset #4 id:60001 … (Closed)
Patch Set: Add unittest. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc
index 81ff499f87d0196375819fd4763a6db51c9dc3e2..894415da8a7960d70bad206f115182e67e35f235 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc
@@ -771,10 +771,8 @@ TEST_F(RtpDepacketizerH264Test, TestFuA) {
const RTPVideoHeaderH264& h264 = payload.type.Video.codecHeader.H264;
EXPECT_EQ(kH264FuA, h264.packetization_type);
EXPECT_EQ(kIdr, h264.nalu_type);
- ASSERT_EQ(1u, h264.nalus_length);
- EXPECT_EQ(static_cast<H264::NaluType>(kIdr), h264.nalus[0].type);
- EXPECT_EQ(-1, h264.nalus[0].sps_id);
- EXPECT_EQ(-1, h264.nalus[0].pps_id);
+ // NALU info is only expected for the first FU-A packet.
+ EXPECT_EQ(0u, h264.nalus_length);
}
payload = RtpDepacketizer::ParsedPayload();
@@ -787,10 +785,8 @@ TEST_F(RtpDepacketizerH264Test, TestFuA) {
const RTPVideoHeaderH264& h264 = payload.type.Video.codecHeader.H264;
EXPECT_EQ(kH264FuA, h264.packetization_type);
EXPECT_EQ(kIdr, h264.nalu_type);
- ASSERT_EQ(1u, h264.nalus_length);
- EXPECT_EQ(static_cast<H264::NaluType>(kIdr), h264.nalus[0].type);
- EXPECT_EQ(-1, h264.nalus[0].sps_id);
- EXPECT_EQ(-1, h264.nalus[0].pps_id);
+ // NALU info is only expected for the first FU-A packet.
+ ASSERT_EQ(0u, h264.nalus_length);
}
}
@@ -825,4 +821,20 @@ TEST_F(RtpDepacketizerH264Test, TestShortSpsPacket) {
EXPECT_TRUE(depacketizer_->Parse(&payload, kPayload, sizeof(kPayload)));
}
+TEST_F(RtpDepacketizerH264Test, TestSeiPacket) {
+ const uint8_t kPayload[] = {
+ kSei, // F=0, NRI=0, Type=6.
+ 0x03, 0x03, 0x03, 0x03 // Payload.
+ };
+ RtpDepacketizer::ParsedPayload payload;
+ ASSERT_TRUE(depacketizer_->Parse(&payload, kPayload, sizeof(kPayload)));
+ const RTPVideoHeaderH264& h264 = payload.type.Video.codecHeader.H264;
+ EXPECT_EQ(kH264SingleNalu, h264.packetization_type);
+ EXPECT_EQ(kSei, h264.nalu_type);
+ ASSERT_EQ(1u, h264.nalus_length);
+ EXPECT_EQ(static_cast<H264::NaluType>(kSei), h264.nalus[0].type);
+ EXPECT_EQ(-1, h264.nalus[0].sps_id);
+ EXPECT_EQ(-1, h264.nalus[0].pps_id);
+}
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698