OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 168 |
169 class RtpRtcpRtxNackTest : public ::testing::Test { | 169 class RtpRtcpRtxNackTest : public ::testing::Test { |
170 protected: | 170 protected: |
171 RtpRtcpRtxNackTest() | 171 RtpRtcpRtxNackTest() |
172 : rtp_payload_registry_(RTPPayloadStrategy::CreateStrategy(false)), | 172 : rtp_payload_registry_(RTPPayloadStrategy::CreateStrategy(false)), |
173 rtp_rtcp_module_(nullptr), | 173 rtp_rtcp_module_(nullptr), |
174 transport_(kTestSsrc + 1), | 174 transport_(kTestSsrc + 1), |
175 receiver_(), | 175 receiver_(), |
176 payload_data_length(sizeof(payload_data)), | 176 payload_data_length(sizeof(payload_data)), |
177 fake_clock(123456), | 177 fake_clock(123456), |
178 retranmission_rate_limiter_(&fake_clock, kMaxRttMs) {} | 178 retransmission_rate_limiter_(&fake_clock, kMaxRttMs) {} |
179 ~RtpRtcpRtxNackTest() {} | 179 ~RtpRtcpRtxNackTest() {} |
180 | 180 |
181 void SetUp() override { | 181 void SetUp() override { |
182 RtpRtcp::Configuration configuration; | 182 RtpRtcp::Configuration configuration; |
183 configuration.audio = false; | 183 configuration.audio = false; |
184 configuration.clock = &fake_clock; | 184 configuration.clock = &fake_clock; |
185 receive_statistics_.reset(ReceiveStatistics::Create(&fake_clock)); | 185 receive_statistics_.reset(ReceiveStatistics::Create(&fake_clock)); |
186 configuration.receive_statistics = receive_statistics_.get(); | 186 configuration.receive_statistics = receive_statistics_.get(); |
187 configuration.outgoing_transport = &transport_; | 187 configuration.outgoing_transport = &transport_; |
188 configuration.retransmission_rate_limiter = &retranmission_rate_limiter_; | 188 configuration.retransmission_rate_limiter = &retransmission_rate_limiter_; |
189 rtp_rtcp_module_ = RtpRtcp::CreateRtpRtcp(configuration); | 189 rtp_rtcp_module_ = RtpRtcp::CreateRtpRtcp(configuration); |
190 | 190 |
191 rtp_feedback_.reset(new TestRtpFeedback(rtp_rtcp_module_)); | 191 rtp_feedback_.reset(new TestRtpFeedback(rtp_rtcp_module_)); |
192 | 192 |
193 rtp_receiver_.reset(RtpReceiver::CreateVideoReceiver( | 193 rtp_receiver_.reset(RtpReceiver::CreateVideoReceiver( |
194 &fake_clock, &receiver_, rtp_feedback_.get(), &rtp_payload_registry_)); | 194 &fake_clock, &receiver_, rtp_feedback_.get(), &rtp_payload_registry_)); |
195 | 195 |
196 rtp_rtcp_module_->SetSSRC(kTestSsrc); | 196 rtp_rtcp_module_->SetSSRC(kTestSsrc); |
197 rtp_rtcp_module_->SetRTCPStatus(RtcpMode::kCompound); | 197 rtp_rtcp_module_->SetRTCPStatus(RtcpMode::kCompound); |
198 rtp_rtcp_module_->SetStorePacketsStatus(true, 600); | 198 rtp_rtcp_module_->SetStorePacketsStatus(true, 600); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 std::unique_ptr<ReceiveStatistics> receive_statistics_; | 285 std::unique_ptr<ReceiveStatistics> receive_statistics_; |
286 RTPPayloadRegistry rtp_payload_registry_; | 286 RTPPayloadRegistry rtp_payload_registry_; |
287 std::unique_ptr<RtpReceiver> rtp_receiver_; | 287 std::unique_ptr<RtpReceiver> rtp_receiver_; |
288 RtpRtcp* rtp_rtcp_module_; | 288 RtpRtcp* rtp_rtcp_module_; |
289 std::unique_ptr<TestRtpFeedback> rtp_feedback_; | 289 std::unique_ptr<TestRtpFeedback> rtp_feedback_; |
290 RtxLoopBackTransport transport_; | 290 RtxLoopBackTransport transport_; |
291 VerifyingRtxReceiver receiver_; | 291 VerifyingRtxReceiver receiver_; |
292 uint8_t payload_data[65000]; | 292 uint8_t payload_data[65000]; |
293 size_t payload_data_length; | 293 size_t payload_data_length; |
294 SimulatedClock fake_clock; | 294 SimulatedClock fake_clock; |
295 RateLimiter retranmission_rate_limiter_; | 295 RateLimiter retransmission_rate_limiter_; |
296 }; | 296 }; |
297 | 297 |
298 TEST_F(RtpRtcpRtxNackTest, LongNackList) { | 298 TEST_F(RtpRtcpRtxNackTest, LongNackList) { |
299 const int kNumPacketsToDrop = 900; | 299 const int kNumPacketsToDrop = 900; |
300 const int kNumRequiredRtcp = 4; | 300 const int kNumRequiredRtcp = 4; |
301 uint32_t timestamp = 3000; | 301 uint32_t timestamp = 3000; |
302 uint16_t nack_list[kNumPacketsToDrop]; | 302 uint16_t nack_list[kNumPacketsToDrop]; |
303 // Disable StorePackets to be able to set a larger packet history. | 303 // Disable StorePackets to be able to set a larger packet history. |
304 rtp_rtcp_module_->SetStorePacketsStatus(false, 0); | 304 rtp_rtcp_module_->SetStorePacketsStatus(false, 0); |
305 // Enable StorePackets with a packet history of 2000 packets. | 305 // Enable StorePackets with a packet history of 2000 packets. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 RunRtxTest(kRtxRetransmitted, 10); | 337 RunRtxTest(kRtxRetransmitted, 10); |
338 EXPECT_EQ(kTestSequenceNumber, *(receiver_.sequence_numbers_.begin())); | 338 EXPECT_EQ(kTestSequenceNumber, *(receiver_.sequence_numbers_.begin())); |
339 EXPECT_EQ(kTestSequenceNumber + kTestNumberOfPackets - 1, | 339 EXPECT_EQ(kTestSequenceNumber + kTestNumberOfPackets - 1, |
340 *(receiver_.sequence_numbers_.rbegin())); | 340 *(receiver_.sequence_numbers_.rbegin())); |
341 EXPECT_EQ(kTestNumberOfPackets, receiver_.sequence_numbers_.size()); | 341 EXPECT_EQ(kTestNumberOfPackets, receiver_.sequence_numbers_.size()); |
342 EXPECT_EQ(kTestNumberOfRtxPackets, transport_.count_rtx_ssrc_); | 342 EXPECT_EQ(kTestNumberOfRtxPackets, transport_.count_rtx_ssrc_); |
343 EXPECT_TRUE(ExpectedPacketsReceived()); | 343 EXPECT_TRUE(ExpectedPacketsReceived()); |
344 } | 344 } |
345 | 345 |
346 } // namespace webrtc | 346 } // namespace webrtc |
OLD | NEW |