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

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

Issue 2265023002: Revert of Add pps id and sps id parsing to the h.264 depacketizer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e84d5f959b70b442557f0c8444c377c987e6c4ba..6729be419c9770121bfae78c0de51a3c7fdac24c 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc
@@ -531,42 +531,21 @@
}
TEST_F(RtpDepacketizerH264Test, TestStapAKey) {
- // clang-format off
- const NaluInfo kExpectedNalus[] = { {H264::kSps, 0, -1},
- {H264::kPps, 1, 2},
- {H264::kIdr, -1, 0} };
- uint8_t packet[] = {kStapA, // F=0, NRI=0, Type=24.
- // Length, nal header, payload.
- 0, 0x18, kExpectedNalus[0].type,
- 0x7A, 0x00, 0x1F, 0xBC, 0xD9, 0x40, 0x50, 0x05, 0xBA,
- 0x10, 0x00, 0x00, 0x03, 0x00, 0xC0, 0x00, 0x00, 0x03,
- 0x2A, 0xE0, 0xF1, 0x83, 0x25,
- 0, 0xD, kExpectedNalus[1].type,
- 0x69, 0xFC, 0x0, 0x0, 0x3, 0x0, 0x7, 0xFF, 0xFF, 0xFF,
- 0xF6, 0x40,
- 0, 0xB, kExpectedNalus[2].type,
- 0x85, 0xB8, 0x0, 0x4, 0x0, 0x0, 0x13, 0x93, 0x12, 0x0};
- // clang-format on
-
- RtpDepacketizer::ParsedPayload payload;
+ uint8_t packet[16] = {kStapA, // F=0, NRI=0, Type=24.
+ // Length, nal header, payload.
+ 0, 0x02, kSps, 0xFF,
+ 0, 0x03, kPps, 0xFF, 0x00,
+ 0, 0x04, kIdr, 0xFF, 0x00, 0x11};
+ RtpDepacketizer::ParsedPayload payload;
+
ASSERT_TRUE(depacketizer_->Parse(&payload, packet, sizeof(packet)));
ExpectPacket(&payload, packet, sizeof(packet));
EXPECT_EQ(kVideoFrameKey, payload.frame_type);
EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec);
EXPECT_TRUE(payload.type.Video.isFirstPacket);
- const RTPVideoHeaderH264& h264 = payload.type.Video.codecHeader.H264;
- EXPECT_EQ(kH264StapA, h264.packetization_type);
+ EXPECT_EQ(kH264StapA, payload.type.Video.codecHeader.H264.packetization_type);
// NALU type for aggregated packets is the type of the first packet only.
- EXPECT_EQ(kSps, h264.nalu_type);
- ASSERT_EQ(3u, h264.nalus_length);
- for (size_t i = 0; i < h264.nalus_length; ++i) {
- EXPECT_EQ(kExpectedNalus[i].type, h264.nalus[i].type)
- << "Failed parsing nalu " << i;
- EXPECT_EQ(kExpectedNalus[i].sps_id, h264.nalus[i].sps_id)
- << "Failed parsing nalu " << i;
- EXPECT_EQ(kExpectedNalus[i].pps_id, h264.nalus[i].pps_id)
- << "Failed parsing nalu " << i;
- }
+ EXPECT_EQ(kSps, payload.type.Video.codecHeader.H264.nalu_type);
}
TEST_F(RtpDepacketizerH264Test, TestStapANaluSpsWithResolution) {
@@ -718,29 +697,26 @@
}
TEST_F(RtpDepacketizerH264Test, TestFuA) {
- // clang-format off
- uint8_t packet1[] = {
+ uint8_t packet1[3] = {
kFuA, // F=0, NRI=0, Type=28.
kSBit | kIdr, // FU header.
- 0x85, 0xB8, 0x0, 0x4, 0x0, 0x0, 0x13, 0x93, 0x12, 0x0 // Payload.
+ 0x01 // Payload.
};
- // clang-format on
- const uint8_t kExpected1[] = {kIdr, 0x85, 0xB8, 0x0, 0x4, 0x0,
- 0x0, 0x13, 0x93, 0x12, 0x0};
-
- uint8_t packet2[] = {
+ const uint8_t kExpected1[2] = {kIdr, 0x01};
+
+ uint8_t packet2[3] = {
kFuA, // F=0, NRI=0, Type=28.
kIdr, // FU header.
0x02 // Payload.
};
- const uint8_t kExpected2[] = {0x02};
-
- uint8_t packet3[] = {
+ const uint8_t kExpected2[1] = {0x02};
+
+ uint8_t packet3[3] = {
kFuA, // F=0, NRI=0, Type=28.
kEBit | kIdr, // FU header.
0x03 // Payload.
};
- const uint8_t kExpected3[] = {0x03};
+ const uint8_t kExpected3[1] = {0x03};
RtpDepacketizer::ParsedPayload payload;
@@ -751,13 +727,8 @@
EXPECT_EQ(kVideoFrameKey, payload.frame_type);
EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec);
EXPECT_TRUE(payload.type.Video.isFirstPacket);
- 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(0, h264.nalus[0].pps_id);
+ EXPECT_EQ(kH264FuA, payload.type.Video.codecHeader.H264.packetization_type);
+ EXPECT_EQ(kIdr, payload.type.Video.codecHeader.H264.nalu_type);
// Following packets will be 2 bytes shorter since they will only be appended
// onto the first packet.
@@ -767,15 +738,8 @@
EXPECT_EQ(kVideoFrameKey, payload.frame_type);
EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec);
EXPECT_FALSE(payload.type.Video.isFirstPacket);
- {
- 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);
- }
+ EXPECT_EQ(kH264FuA, payload.type.Video.codecHeader.H264.packetization_type);
+ EXPECT_EQ(kIdr, payload.type.Video.codecHeader.H264.nalu_type);
payload = RtpDepacketizer::ParsedPayload();
ASSERT_TRUE(depacketizer_->Parse(&payload, packet3, sizeof(packet3)));
@@ -783,15 +747,8 @@
EXPECT_EQ(kVideoFrameKey, payload.frame_type);
EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec);
EXPECT_FALSE(payload.type.Video.isFirstPacket);
- {
- 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);
- }
+ EXPECT_EQ(kH264FuA, payload.type.Video.codecHeader.H264.packetization_type);
+ EXPECT_EQ(kIdr, payload.type.Video.codecHeader.H264.nalu_type);
}
TEST_F(RtpDepacketizerH264Test, TestEmptyPayload) {
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698