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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc

Issue 2681673004: Replace RtpStreamReceiver::DeliverRtp with OnRtpPacket. (Closed)
Patch Set: Move test involving incorrect h264 data. Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « webrtc/call/packet_injection_tests.cc ('k') | webrtc/video/rtp_stream_receiver.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 RtpDepacketizer::ParsedPayload payload; 860 RtpDepacketizer::ParsedPayload payload;
861 EXPECT_FALSE(depacketizer_->Parse(&payload, kPayload, sizeof(kPayload))); 861 EXPECT_FALSE(depacketizer_->Parse(&payload, kPayload, sizeof(kPayload)));
862 } 862 }
863 863
864 TEST_F(RtpDepacketizerH264Test, TestTruncatedSingleStapANalu) { 864 TEST_F(RtpDepacketizerH264Test, TestTruncatedSingleStapANalu) {
865 const uint8_t kPayload[] = {0xd8, 0x27}; 865 const uint8_t kPayload[] = {0xd8, 0x27};
866 RtpDepacketizer::ParsedPayload payload; 866 RtpDepacketizer::ParsedPayload payload;
867 EXPECT_FALSE(depacketizer_->Parse(&payload, kPayload, sizeof(kPayload))); 867 EXPECT_FALSE(depacketizer_->Parse(&payload, kPayload, sizeof(kPayload)));
868 } 868 }
869 869
870 TEST_F(RtpDepacketizerH264Test, TestStapAPacketWithTruncatedNalUnits) {
871 const uint8_t kPayload[] = { 0x58, 0xCB, 0xED, 0xDF};
nisse-webrtc 2017/02/13 12:44:57 This is the same payload as in the deleted testcas
872 RtpDepacketizer::ParsedPayload payload;
873 EXPECT_FALSE(depacketizer_->Parse(&payload, kPayload, sizeof(kPayload)));
874 }
875
870 TEST_F(RtpDepacketizerH264Test, TestTruncationJustAfterSingleStapANalu) { 876 TEST_F(RtpDepacketizerH264Test, TestTruncationJustAfterSingleStapANalu) {
871 const uint8_t kPayload[] = {0x38, 0x27, 0x27}; 877 const uint8_t kPayload[] = {0x38, 0x27, 0x27};
872 RtpDepacketizer::ParsedPayload payload; 878 RtpDepacketizer::ParsedPayload payload;
873 EXPECT_FALSE(depacketizer_->Parse(&payload, kPayload, sizeof(kPayload))); 879 EXPECT_FALSE(depacketizer_->Parse(&payload, kPayload, sizeof(kPayload)));
874 } 880 }
875 881
876 TEST_F(RtpDepacketizerH264Test, TestShortSpsPacket) { 882 TEST_F(RtpDepacketizerH264Test, TestShortSpsPacket) {
877 const uint8_t kPayload[] = {0x27, 0x80, 0x00}; 883 const uint8_t kPayload[] = {0x27, 0x80, 0x00};
878 RtpDepacketizer::ParsedPayload payload; 884 RtpDepacketizer::ParsedPayload payload;
879 EXPECT_TRUE(depacketizer_->Parse(&payload, kPayload, sizeof(kPayload))); 885 EXPECT_TRUE(depacketizer_->Parse(&payload, kPayload, sizeof(kPayload)));
880 } 886 }
881 887
882 TEST_F(RtpDepacketizerH264Test, TestSeiPacket) { 888 TEST_F(RtpDepacketizerH264Test, TestSeiPacket) {
883 const uint8_t kPayload[] = { 889 const uint8_t kPayload[] = {
884 kSei, // F=0, NRI=0, Type=6. 890 kSei, // F=0, NRI=0, Type=6.
885 0x03, 0x03, 0x03, 0x03 // Payload. 891 0x03, 0x03, 0x03, 0x03 // Payload.
886 }; 892 };
887 RtpDepacketizer::ParsedPayload payload; 893 RtpDepacketizer::ParsedPayload payload;
888 ASSERT_TRUE(depacketizer_->Parse(&payload, kPayload, sizeof(kPayload))); 894 ASSERT_TRUE(depacketizer_->Parse(&payload, kPayload, sizeof(kPayload)));
889 const RTPVideoHeaderH264& h264 = payload.type.Video.codecHeader.H264; 895 const RTPVideoHeaderH264& h264 = payload.type.Video.codecHeader.H264;
890 EXPECT_EQ(kH264SingleNalu, h264.packetization_type); 896 EXPECT_EQ(kH264SingleNalu, h264.packetization_type);
891 EXPECT_EQ(kSei, h264.nalu_type); 897 EXPECT_EQ(kSei, h264.nalu_type);
892 ASSERT_EQ(1u, h264.nalus_length); 898 ASSERT_EQ(1u, h264.nalus_length);
893 EXPECT_EQ(static_cast<H264::NaluType>(kSei), h264.nalus[0].type); 899 EXPECT_EQ(static_cast<H264::NaluType>(kSei), h264.nalus[0].type);
894 EXPECT_EQ(-1, h264.nalus[0].sps_id); 900 EXPECT_EQ(-1, h264.nalus[0].sps_id);
895 EXPECT_EQ(-1, h264.nalus[0].pps_id); 901 EXPECT_EQ(-1, h264.nalus[0].pps_id);
896 } 902 }
897 903
898 } // namespace webrtc 904 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/call/packet_injection_tests.cc ('k') | webrtc/video/rtp_stream_receiver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698