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

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

Issue 2032463003: Revert of Propagate probing cluster id to SendTimeHistory. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 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/modules/rtp_rtcp/source/rtp_sender.cc ('k') | webrtc/voice_engine/channel.cc » ('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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 // Packet should be stored in a send bucket. 759 // Packet should be stored in a send bucket.
760 EXPECT_EQ(0, rtp_sender_->SendToNetwork(packet_, 0, rtp_length, 760 EXPECT_EQ(0, rtp_sender_->SendToNetwork(packet_, 0, rtp_length,
761 capture_time_ms, kAllowRetransmission, 761 capture_time_ms, kAllowRetransmission,
762 RtpPacketSender::kNormalPriority)); 762 RtpPacketSender::kNormalPriority));
763 763
764 EXPECT_EQ(0, transport_.packets_sent_); 764 EXPECT_EQ(0, transport_.packets_sent_);
765 765
766 const int kStoredTimeInMs = 100; 766 const int kStoredTimeInMs = 100;
767 fake_clock_.AdvanceTimeMilliseconds(kStoredTimeInMs); 767 fake_clock_.AdvanceTimeMilliseconds(kStoredTimeInMs);
768 768
769 rtp_sender_->TimeToSendPacket(kSeqNum, capture_time_ms, false, 769 rtp_sender_->TimeToSendPacket(kSeqNum, capture_time_ms, false);
770 PacketInfo::kNotAProbe);
771 770
772 // Process send bucket. Packet should now be sent. 771 // Process send bucket. Packet should now be sent.
773 EXPECT_EQ(1, transport_.packets_sent_); 772 EXPECT_EQ(1, transport_.packets_sent_);
774 EXPECT_EQ(rtp_length, transport_.last_sent_packet_len_); 773 EXPECT_EQ(rtp_length, transport_.last_sent_packet_len_);
775 // Parse sent packet. 774 // Parse sent packet.
776 webrtc::RtpUtility::RtpHeaderParser rtp_parser(transport_.last_sent_packet_, 775 webrtc::RtpUtility::RtpHeaderParser rtp_parser(transport_.last_sent_packet_,
777 rtp_length); 776 rtp_length);
778 webrtc::RTPHeader rtp_header; 777 webrtc::RTPHeader rtp_header;
779 RtpHeaderExtensionMap map; 778 RtpHeaderExtensionMap map;
780 map.Register(kRtpExtensionTransmissionTimeOffset, 779 map.Register(kRtpExtensionTransmissionTimeOffset,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 818
820 EXPECT_CALL(mock_paced_sender_, InsertPacket(RtpPacketSender::kNormalPriority, 819 EXPECT_CALL(mock_paced_sender_, InsertPacket(RtpPacketSender::kNormalPriority,
821 _, kSeqNum, _, _, _)); 820 _, kSeqNum, _, _, _));
822 821
823 const int kStoredTimeInMs = 100; 822 const int kStoredTimeInMs = 100;
824 fake_clock_.AdvanceTimeMilliseconds(kStoredTimeInMs); 823 fake_clock_.AdvanceTimeMilliseconds(kStoredTimeInMs);
825 824
826 EXPECT_EQ(rtp_length_int, rtp_sender_->ReSendPacket(kSeqNum)); 825 EXPECT_EQ(rtp_length_int, rtp_sender_->ReSendPacket(kSeqNum));
827 EXPECT_EQ(0, transport_.packets_sent_); 826 EXPECT_EQ(0, transport_.packets_sent_);
828 827
829 rtp_sender_->TimeToSendPacket(kSeqNum, capture_time_ms, false, 828 rtp_sender_->TimeToSendPacket(kSeqNum, capture_time_ms, false);
830 PacketInfo::kNotAProbe);
831 829
832 // Process send bucket. Packet should now be sent. 830 // Process send bucket. Packet should now be sent.
833 EXPECT_EQ(1, transport_.packets_sent_); 831 EXPECT_EQ(1, transport_.packets_sent_);
834 EXPECT_EQ(rtp_length, transport_.last_sent_packet_len_); 832 EXPECT_EQ(rtp_length, transport_.last_sent_packet_len_);
835 833
836 // Parse sent packet. 834 // Parse sent packet.
837 webrtc::RtpUtility::RtpHeaderParser rtp_parser(transport_.last_sent_packet_, 835 webrtc::RtpUtility::RtpHeaderParser rtp_parser(transport_.last_sent_packet_,
838 rtp_length); 836 rtp_length);
839 webrtc::RTPHeader rtp_header; 837 webrtc::RTPHeader rtp_header;
840 RtpHeaderExtensionMap map; 838 RtpHeaderExtensionMap map;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 // Packet should be stored in a send bucket. 894 // Packet should be stored in a send bucket.
897 EXPECT_EQ(0, rtp_sender_->SendToNetwork(packet_, 0, rtp_length, 895 EXPECT_EQ(0, rtp_sender_->SendToNetwork(packet_, 0, rtp_length,
898 capture_time_ms, kAllowRetransmission, 896 capture_time_ms, kAllowRetransmission,
899 RtpPacketSender::kNormalPriority)); 897 RtpPacketSender::kNormalPriority));
900 898
901 int total_packets_sent = 0; 899 int total_packets_sent = 0;
902 EXPECT_EQ(total_packets_sent, transport_.packets_sent_); 900 EXPECT_EQ(total_packets_sent, transport_.packets_sent_);
903 901
904 const int kStoredTimeInMs = 100; 902 const int kStoredTimeInMs = 100;
905 fake_clock_.AdvanceTimeMilliseconds(kStoredTimeInMs); 903 fake_clock_.AdvanceTimeMilliseconds(kStoredTimeInMs);
906 rtp_sender_->TimeToSendPacket(seq_num++, capture_time_ms, false, 904 rtp_sender_->TimeToSendPacket(seq_num++, capture_time_ms, false);
907 PacketInfo::kNotAProbe);
908 // Packet should now be sent. This test doesn't verify the regular video 905 // Packet should now be sent. This test doesn't verify the regular video
909 // packet, since it is tested in another test. 906 // packet, since it is tested in another test.
910 EXPECT_EQ(++total_packets_sent, transport_.packets_sent_); 907 EXPECT_EQ(++total_packets_sent, transport_.packets_sent_);
911 timestamp += 90 * kStoredTimeInMs; 908 timestamp += 90 * kStoredTimeInMs;
912 909
913 // Send padding 4 times, waiting 50 ms between each. 910 // Send padding 4 times, waiting 50 ms between each.
914 for (int i = 0; i < 4; ++i) { 911 for (int i = 0; i < 4; ++i) {
915 const int kPaddingPeriodMs = 50; 912 const int kPaddingPeriodMs = 50;
916 const size_t kPaddingBytes = 100; 913 const size_t kPaddingBytes = 100;
917 const size_t kMaxPaddingLength = 224; // Value taken from rtp_sender.cc. 914 const size_t kMaxPaddingLength = 224; // Value taken from rtp_sender.cc.
918 // Padding will be forced to full packets. 915 // Padding will be forced to full packets.
919 EXPECT_EQ(kMaxPaddingLength, rtp_sender_->TimeToSendPadding( 916 EXPECT_EQ(kMaxPaddingLength, rtp_sender_->TimeToSendPadding(kPaddingBytes));
920 kPaddingBytes, PacketInfo::kNotAProbe));
921 917
922 // Process send bucket. Padding should now be sent. 918 // Process send bucket. Padding should now be sent.
923 EXPECT_EQ(++total_packets_sent, transport_.packets_sent_); 919 EXPECT_EQ(++total_packets_sent, transport_.packets_sent_);
924 EXPECT_EQ(kMaxPaddingLength + rtp_header_len, 920 EXPECT_EQ(kMaxPaddingLength + rtp_header_len,
925 transport_.last_sent_packet_len_); 921 transport_.last_sent_packet_len_);
926 // Parse sent packet. 922 // Parse sent packet.
927 ASSERT_TRUE(rtp_parser->Parse(transport_.last_sent_packet_, 923 ASSERT_TRUE(rtp_parser->Parse(transport_.last_sent_packet_,
928 transport_.last_sent_packet_len_, 924 transport_.last_sent_packet_len_,
929 &rtp_header)); 925 &rtp_header));
930 EXPECT_EQ(kMaxPaddingLength, rtp_header.paddingLength); 926 EXPECT_EQ(kMaxPaddingLength, rtp_header.paddingLength);
(...skipping 20 matching lines...) Expand all
951 rtp_length = static_cast<size_t>(rtp_length_int); 947 rtp_length = static_cast<size_t>(rtp_length_int);
952 948
953 EXPECT_CALL(mock_paced_sender_, 949 EXPECT_CALL(mock_paced_sender_,
954 InsertPacket(RtpPacketSender::kNormalPriority, _, _, _, _, _)); 950 InsertPacket(RtpPacketSender::kNormalPriority, _, _, _, _, _));
955 951
956 // Packet should be stored in a send bucket. 952 // Packet should be stored in a send bucket.
957 EXPECT_EQ(0, rtp_sender_->SendToNetwork(packet_, 0, rtp_length, 953 EXPECT_EQ(0, rtp_sender_->SendToNetwork(packet_, 0, rtp_length,
958 capture_time_ms, kAllowRetransmission, 954 capture_time_ms, kAllowRetransmission,
959 RtpPacketSender::kNormalPriority)); 955 RtpPacketSender::kNormalPriority));
960 956
961 rtp_sender_->TimeToSendPacket(seq_num, capture_time_ms, false, 957 rtp_sender_->TimeToSendPacket(seq_num, capture_time_ms, false);
962 PacketInfo::kNotAProbe);
963 // Process send bucket. 958 // Process send bucket.
964 EXPECT_EQ(++total_packets_sent, transport_.packets_sent_); 959 EXPECT_EQ(++total_packets_sent, transport_.packets_sent_);
965 EXPECT_EQ(rtp_length, transport_.last_sent_packet_len_); 960 EXPECT_EQ(rtp_length, transport_.last_sent_packet_len_);
966 // Parse sent packet. 961 // Parse sent packet.
967 ASSERT_TRUE( 962 ASSERT_TRUE(
968 rtp_parser->Parse(transport_.last_sent_packet_, rtp_length, &rtp_header)); 963 rtp_parser->Parse(transport_.last_sent_packet_, rtp_length, &rtp_header));
969 964
970 // Verify sequence number and timestamp. 965 // Verify sequence number and timestamp.
971 EXPECT_EQ(seq_num, rtp_header.sequenceNumber); 966 EXPECT_EQ(seq_num, rtp_header.sequenceNumber);
972 EXPECT_EQ(timestamp, rtp_header.timestamp); 967 EXPECT_EQ(timestamp, rtp_header.timestamp);
(...skipping 12 matching lines...) Expand all
985 EXPECT_CALL(send_packet_observer_, 980 EXPECT_CALL(send_packet_observer_,
986 OnSendPacket(kTransportSequenceNumber, _, _)) 981 OnSendPacket(kTransportSequenceNumber, _, _))
987 .Times(1); 982 .Times(1);
988 EXPECT_CALL(seq_num_allocator_, AllocateSequenceNumber()) 983 EXPECT_CALL(seq_num_allocator_, AllocateSequenceNumber())
989 .WillOnce(testing::Return(kTransportSequenceNumber)); 984 .WillOnce(testing::Return(kTransportSequenceNumber));
990 EXPECT_CALL(mock_paced_sender_, InsertPacket(_, _, _, _, _, _)).Times(1); 985 EXPECT_CALL(mock_paced_sender_, InsertPacket(_, _, _, _, _, _)).Times(1);
991 986
992 SendGenericPayload(); // Packet passed to pacer. 987 SendGenericPayload(); // Packet passed to pacer.
993 const bool kIsRetransmit = false; 988 const bool kIsRetransmit = false;
994 rtp_sender_->TimeToSendPacket(kSeqNum, fake_clock_.TimeInMilliseconds(), 989 rtp_sender_->TimeToSendPacket(kSeqNum, fake_clock_.TimeInMilliseconds(),
995 kIsRetransmit, PacketInfo::kNotAProbe); 990 kIsRetransmit);
996 EXPECT_EQ(1, transport_.packets_sent_); 991 EXPECT_EQ(1, transport_.packets_sent_);
997 } 992 }
998 993
999 TEST_F(RtpSenderTest, OnSendPacketNotUpdatedForRetransmits) { 994 TEST_F(RtpSenderTest, OnSendPacketNotUpdatedForRetransmits) {
1000 EXPECT_CALL(mock_rtc_event_log_, // Ignore rtc event calls. 995 EXPECT_CALL(mock_rtc_event_log_, // Ignore rtc event calls.
1001 LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _)); 996 LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _));
1002 rtp_sender_->SetStorePacketsStatus(true, 10); 997 rtp_sender_->SetStorePacketsStatus(true, 10);
1003 998
1004 EXPECT_CALL(send_packet_observer_, OnSendPacket(_, _, _)).Times(0); 999 EXPECT_CALL(send_packet_observer_, OnSendPacket(_, _, _)).Times(0);
1005 EXPECT_CALL(seq_num_allocator_, AllocateSequenceNumber()) 1000 EXPECT_CALL(seq_num_allocator_, AllocateSequenceNumber())
1006 .WillOnce(testing::Return(kTransportSequenceNumber)); 1001 .WillOnce(testing::Return(kTransportSequenceNumber));
1007 EXPECT_CALL(mock_paced_sender_, InsertPacket(_, _, _, _, _, _)).Times(1); 1002 EXPECT_CALL(mock_paced_sender_, InsertPacket(_, _, _, _, _, _)).Times(1);
1008 1003
1009 SendGenericPayload(); // Packet passed to pacer. 1004 SendGenericPayload(); // Packet passed to pacer.
1010 const bool kIsRetransmit = true; 1005 const bool kIsRetransmit = true;
1011 rtp_sender_->TimeToSendPacket(kSeqNum, fake_clock_.TimeInMilliseconds(), 1006 rtp_sender_->TimeToSendPacket(kSeqNum, fake_clock_.TimeInMilliseconds(),
1012 kIsRetransmit, PacketInfo::kNotAProbe); 1007 kIsRetransmit);
1013 EXPECT_EQ(1, transport_.packets_sent_); 1008 EXPECT_EQ(1, transport_.packets_sent_);
1014 } 1009 }
1015 1010
1016 TEST_F(RtpSenderTest, OnSendPacketNotUpdatedWithoutSeqNumAllocator) { 1011 TEST_F(RtpSenderTest, OnSendPacketNotUpdatedWithoutSeqNumAllocator) {
1017 rtp_sender_.reset(new RTPSender( 1012 rtp_sender_.reset(new RTPSender(
1018 false, &fake_clock_, &transport_, &mock_paced_sender_, 1013 false, &fake_clock_, &transport_, &mock_paced_sender_,
1019 nullptr /* TransportSequenceNumberAllocator */, nullptr, nullptr, nullptr, 1014 nullptr /* TransportSequenceNumberAllocator */, nullptr, nullptr, nullptr,
1020 nullptr, nullptr, &send_packet_observer_)); 1015 nullptr, nullptr, &send_packet_observer_));
1021 rtp_sender_->SetSequenceNumber(kSeqNum); 1016 rtp_sender_->SetSequenceNumber(kSeqNum);
1022 rtp_sender_->SetStorePacketsStatus(true, 10); 1017 rtp_sender_->SetStorePacketsStatus(true, 10);
1023 1018
1024 EXPECT_CALL(send_packet_observer_, OnSendPacket(_, _, _)).Times(0); 1019 EXPECT_CALL(send_packet_observer_, OnSendPacket(_, _, _)).Times(0);
1025 EXPECT_CALL(mock_paced_sender_, InsertPacket(_, _, _, _, _, _)).Times(1); 1020 EXPECT_CALL(mock_paced_sender_, InsertPacket(_, _, _, _, _, _)).Times(1);
1026 1021
1027 SendGenericPayload(); // Packet passed to pacer. 1022 SendGenericPayload(); // Packet passed to pacer.
1028 const bool kIsRetransmit = false; 1023 const bool kIsRetransmit = false;
1029 rtp_sender_->TimeToSendPacket(kSeqNum, fake_clock_.TimeInMilliseconds(), 1024 rtp_sender_->TimeToSendPacket(kSeqNum, fake_clock_.TimeInMilliseconds(),
1030 kIsRetransmit, PacketInfo::kNotAProbe); 1025 kIsRetransmit);
1031 EXPECT_EQ(1, transport_.packets_sent_); 1026 EXPECT_EQ(1, transport_.packets_sent_);
1032 } 1027 }
1033 1028
1034 TEST_F(RtpSenderTest, SendRedundantPayloads) { 1029 TEST_F(RtpSenderTest, SendRedundantPayloads) {
1035 MockTransport transport; 1030 MockTransport transport;
1036 rtp_sender_.reset(new RTPSender( 1031 rtp_sender_.reset(new RTPSender(
1037 false, &fake_clock_, &transport, &mock_paced_sender_, nullptr, nullptr, 1032 false, &fake_clock_, &transport, &mock_paced_sender_, nullptr, nullptr,
1038 nullptr, nullptr, nullptr, &mock_rtc_event_log_, nullptr)); 1033 nullptr, nullptr, nullptr, &mock_rtc_event_log_, nullptr));
1039 1034
1040 rtp_sender_->SetSequenceNumber(kSeqNum); 1035 rtp_sender_->SetSequenceNumber(kSeqNum);
(...skipping 29 matching lines...) Expand all
1070 .Times(kNumPayloadSizes); 1065 .Times(kNumPayloadSizes);
1071 EXPECT_CALL(mock_rtc_event_log_, 1066 EXPECT_CALL(mock_rtc_event_log_,
1072 LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _)) 1067 LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _))
1073 .Times(kNumPayloadSizes); 1068 .Times(kNumPayloadSizes);
1074 1069
1075 // Send 10 packets of increasing size. 1070 // Send 10 packets of increasing size.
1076 for (size_t i = 0; i < kNumPayloadSizes; ++i) { 1071 for (size_t i = 0; i < kNumPayloadSizes; ++i) {
1077 int64_t capture_time_ms = fake_clock_.TimeInMilliseconds(); 1072 int64_t capture_time_ms = fake_clock_.TimeInMilliseconds();
1078 EXPECT_CALL(transport, SendRtp(_, _, _)).WillOnce(testing::Return(true)); 1073 EXPECT_CALL(transport, SendRtp(_, _, _)).WillOnce(testing::Return(true));
1079 SendPacket(capture_time_ms, kPayloadSizes[i]); 1074 SendPacket(capture_time_ms, kPayloadSizes[i]);
1080 rtp_sender_->TimeToSendPacket(seq_num++, capture_time_ms, false, 1075 rtp_sender_->TimeToSendPacket(seq_num++, capture_time_ms, false);
1081 PacketInfo::kNotAProbe);
1082 fake_clock_.AdvanceTimeMilliseconds(33); 1076 fake_clock_.AdvanceTimeMilliseconds(33);
1083 } 1077 }
1084 1078
1085 EXPECT_CALL(mock_rtc_event_log_, 1079 EXPECT_CALL(mock_rtc_event_log_,
1086 LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _)) 1080 LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _))
1087 .Times(::testing::AtLeast(4)); 1081 .Times(::testing::AtLeast(4));
1088 1082
1089 // The amount of padding to send it too small to send a payload packet. 1083 // The amount of padding to send it too small to send a payload packet.
1090 EXPECT_CALL(transport, SendRtp(_, kMaxPaddingSize + rtp_header_len, _)) 1084 EXPECT_CALL(transport, SendRtp(_, kMaxPaddingSize + rtp_header_len, _))
1091 .WillOnce(testing::Return(true)); 1085 .WillOnce(testing::Return(true));
1092 EXPECT_EQ(kMaxPaddingSize, 1086 EXPECT_EQ(kMaxPaddingSize, rtp_sender_->TimeToSendPadding(49));
1093 rtp_sender_->TimeToSendPadding(49, PacketInfo::kNotAProbe));
1094 1087
1095 EXPECT_CALL(transport, 1088 EXPECT_CALL(transport,
1096 SendRtp(_, kPayloadSizes[0] + rtp_header_len + kRtxHeaderSize, _)) 1089 SendRtp(_, kPayloadSizes[0] + rtp_header_len + kRtxHeaderSize, _))
1097 .WillOnce(testing::Return(true)); 1090 .WillOnce(testing::Return(true));
1098 EXPECT_EQ(kPayloadSizes[0], 1091 EXPECT_EQ(kPayloadSizes[0], rtp_sender_->TimeToSendPadding(500));
1099 rtp_sender_->TimeToSendPadding(500, PacketInfo::kNotAProbe));
1100 1092
1101 EXPECT_CALL(transport, SendRtp(_, kPayloadSizes[kNumPayloadSizes - 1] + 1093 EXPECT_CALL(transport, SendRtp(_, kPayloadSizes[kNumPayloadSizes - 1] +
1102 rtp_header_len + kRtxHeaderSize, 1094 rtp_header_len + kRtxHeaderSize,
1103 _)) 1095 _))
1104 .WillOnce(testing::Return(true)); 1096 .WillOnce(testing::Return(true));
1105 EXPECT_CALL(transport, SendRtp(_, kMaxPaddingSize + rtp_header_len, _)) 1097 EXPECT_CALL(transport, SendRtp(_, kMaxPaddingSize + rtp_header_len, _))
1106 .WillOnce(testing::Return(true)); 1098 .WillOnce(testing::Return(true));
1107 EXPECT_EQ(kPayloadSizes[kNumPayloadSizes - 1] + kMaxPaddingSize, 1099 EXPECT_EQ(kPayloadSizes[kNumPayloadSizes - 1] + kMaxPaddingSize,
1108 rtp_sender_->TimeToSendPadding(999, PacketInfo::kNotAProbe)); 1100 rtp_sender_->TimeToSendPadding(999));
1109 } 1101 }
1110 1102
1111 TEST_F(RtpSenderTestWithoutPacer, SendGenericVideo) { 1103 TEST_F(RtpSenderTestWithoutPacer, SendGenericVideo) {
1112 char payload_name[RTP_PAYLOAD_NAME_SIZE] = "GENERIC"; 1104 char payload_name[RTP_PAYLOAD_NAME_SIZE] = "GENERIC";
1113 const uint8_t payload_type = 127; 1105 const uint8_t payload_type = 127;
1114 ASSERT_EQ(0, rtp_sender_->RegisterPayload(payload_name, payload_type, 90000, 1106 ASSERT_EQ(0, rtp_sender_->RegisterPayload(payload_name, payload_type, 90000,
1115 0, 1500)); 1107 0, 1500));
1116 uint8_t payload[] = {47, 11, 32, 93, 89}; 1108 uint8_t payload[] = {47, 11, 32, 93, 89};
1117 1109
1118 // Send keyframe 1110 // Send keyframe
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 expected.transmitted.payload_bytes = 12; 1353 expected.transmitted.payload_bytes = 12;
1362 expected.transmitted.header_bytes = 24; 1354 expected.transmitted.header_bytes = 24;
1363 expected.transmitted.packets = 2; 1355 expected.transmitted.packets = 2;
1364 expected.retransmitted.payload_bytes = 6; 1356 expected.retransmitted.payload_bytes = 6;
1365 expected.retransmitted.header_bytes = 12; 1357 expected.retransmitted.header_bytes = 12;
1366 expected.retransmitted.padding_bytes = 0; 1358 expected.retransmitted.padding_bytes = 0;
1367 expected.retransmitted.packets = 1; 1359 expected.retransmitted.packets = 1;
1368 callback.Matches(ssrc, expected); 1360 callback.Matches(ssrc, expected);
1369 1361
1370 // Send padding. 1362 // Send padding.
1371 rtp_sender_->TimeToSendPadding(kMaxPaddingSize, PacketInfo::kNotAProbe); 1363 rtp_sender_->TimeToSendPadding(kMaxPaddingSize);
1372 expected.transmitted.payload_bytes = 12; 1364 expected.transmitted.payload_bytes = 12;
1373 expected.transmitted.header_bytes = 36; 1365 expected.transmitted.header_bytes = 36;
1374 expected.transmitted.padding_bytes = kMaxPaddingSize; 1366 expected.transmitted.padding_bytes = kMaxPaddingSize;
1375 expected.transmitted.packets = 3; 1367 expected.transmitted.packets = 3;
1376 callback.Matches(ssrc, expected); 1368 callback.Matches(ssrc, expected);
1377 1369
1378 // Send FEC. 1370 // Send FEC.
1379 rtp_sender_->SetGenericFECStatus(true, kRedPayloadType, kUlpfecPayloadType); 1371 rtp_sender_->SetGenericFECStatus(true, kRedPayloadType, kUlpfecPayloadType);
1380 FecProtectionParams fec_params; 1372 FecProtectionParams fec_params;
1381 fec_params.fec_mask_type = kFecMaskRandom; 1373 fec_params.fec_mask_type = kFecMaskRandom;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 1510
1519 ASSERT_EQ(0, rtp_sender_->RegisterPayload(kPayloadName, kPayloadType, 90000, 1511 ASSERT_EQ(0, rtp_sender_->RegisterPayload(kPayloadName, kPayloadType, 90000,
1520 0, 1500)); 1512 0, 1500));
1521 uint8_t payload[] = {47, 11, 32, 93, 89}; 1513 uint8_t payload[] = {47, 11, 32, 93, 89};
1522 1514
1523 ASSERT_EQ( 1515 ASSERT_EQ(
1524 0, rtp_sender_->SendOutgoingData(kVideoFrameKey, kPayloadType, 1234, 4321, 1516 0, rtp_sender_->SendOutgoingData(kVideoFrameKey, kPayloadType, 1234, 4321,
1525 payload, sizeof(payload), 0)); 1517 payload, sizeof(payload), 0));
1526 1518
1527 // Will send 2 full-size padding packets. 1519 // Will send 2 full-size padding packets.
1528 rtp_sender_->TimeToSendPadding(1, PacketInfo::kNotAProbe); 1520 rtp_sender_->TimeToSendPadding(1);
1529 rtp_sender_->TimeToSendPadding(1, PacketInfo::kNotAProbe); 1521 rtp_sender_->TimeToSendPadding(1);
1530 1522
1531 StreamDataCounters rtp_stats; 1523 StreamDataCounters rtp_stats;
1532 StreamDataCounters rtx_stats; 1524 StreamDataCounters rtx_stats;
1533 rtp_sender_->GetDataCounters(&rtp_stats, &rtx_stats); 1525 rtp_sender_->GetDataCounters(&rtp_stats, &rtx_stats);
1534 1526
1535 // Payload + 1-byte generic header. 1527 // Payload + 1-byte generic header.
1536 EXPECT_GT(rtp_stats.first_packet_time_ms, -1); 1528 EXPECT_GT(rtp_stats.first_packet_time_ms, -1);
1537 EXPECT_EQ(rtp_stats.transmitted.payload_bytes, sizeof(payload) + 1); 1529 EXPECT_EQ(rtp_stats.transmitted.payload_bytes, sizeof(payload) + 1);
1538 EXPECT_EQ(rtp_stats.transmitted.header_bytes, 12u); 1530 EXPECT_EQ(rtp_stats.transmitted.header_bytes, 12u);
1539 EXPECT_EQ(rtp_stats.transmitted.padding_bytes, 0u); 1531 EXPECT_EQ(rtp_stats.transmitted.padding_bytes, 0u);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1609 reinterpret_cast<uint8_t*>(transport_.sent_packets_[0]->data()), 1601 reinterpret_cast<uint8_t*>(transport_.sent_packets_[0]->data()),
1610 transport_.sent_packets_[0]->size(), true, &map, kSeqNum, hdr.rotation); 1602 transport_.sent_packets_[0]->size(), true, &map, kSeqNum, hdr.rotation);
1611 1603
1612 // Verify that this packet does have CVO byte. 1604 // Verify that this packet does have CVO byte.
1613 VerifyCVOPacket( 1605 VerifyCVOPacket(
1614 reinterpret_cast<uint8_t*>(transport_.sent_packets_[1]->data()), 1606 reinterpret_cast<uint8_t*>(transport_.sent_packets_[1]->data()),
1615 transport_.sent_packets_[1]->size(), true, &map, kSeqNum + 1, 1607 transport_.sent_packets_[1]->size(), true, &map, kSeqNum + 1,
1616 hdr.rotation); 1608 hdr.rotation);
1617 } 1609 }
1618 } // namespace webrtc 1610 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender.cc ('k') | webrtc/voice_engine/channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698