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

Side by Side Diff: webrtc/video/end_to_end_tests.cc

Issue 2613443002: EndToEndTest.ReceivesAndRetransmitsNack now handles reordering. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | 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) 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 #include <algorithm> 10 #include <algorithm>
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 private: 464 private:
465 Action OnSendRtp(const uint8_t* packet, size_t length) override { 465 Action OnSendRtp(const uint8_t* packet, size_t length) override {
466 rtc::CritScope lock(&crit_); 466 rtc::CritScope lock(&crit_);
467 RTPHeader header; 467 RTPHeader header;
468 EXPECT_TRUE(parser_->Parse(packet, length, &header)); 468 EXPECT_TRUE(parser_->Parse(packet, length, &header));
469 469
470 // Never drop retransmitted packets. 470 // Never drop retransmitted packets.
471 if (dropped_packets_.find(header.sequenceNumber) != 471 if (dropped_packets_.find(header.sequenceNumber) !=
472 dropped_packets_.end()) { 472 dropped_packets_.end()) {
473 retransmitted_packets_.insert(header.sequenceNumber); 473 retransmitted_packets_.insert(header.sequenceNumber);
474 if (nacks_left_ <= 0 &&
475 retransmitted_packets_.size() == dropped_packets_.size()) {
476 observation_complete_.Set();
477 }
478 return SEND_PACKET; 474 return SEND_PACKET;
479 } 475 }
480 476
477 if (nacks_left_ <= 0 &&
478 retransmitted_packets_.size() == dropped_packets_.size()) {
479 observation_complete_.Set();
480 }
481
481 ++sent_rtp_packets_; 482 ++sent_rtp_packets_;
482 483
483 // Enough NACKs received, stop dropping packets. 484 // Enough NACKs received, stop dropping packets.
484 if (nacks_left_ <= 0) 485 if (nacks_left_ <= 0)
485 return SEND_PACKET; 486 return SEND_PACKET;
486 487
487 // Check if it's time for a new loss burst. 488 // Check if it's time for a new loss burst.
488 if (sent_rtp_packets_ % kPacketsBetweenLossBursts == 0) 489 if (sent_rtp_packets_ % kPacketsBetweenLossBursts == 0)
489 packets_left_to_drop_ = kLossBurstSize; 490 packets_left_to_drop_ = kLossBurstSize;
490 491
(...skipping 3573 matching lines...) Expand 10 before | Expand all | Expand 10 after
4064 std::unique_ptr<VideoEncoder> encoder_; 4065 std::unique_ptr<VideoEncoder> encoder_;
4065 std::unique_ptr<VideoDecoder> decoder_; 4066 std::unique_ptr<VideoDecoder> decoder_;
4066 rtc::CriticalSection crit_; 4067 rtc::CriticalSection crit_;
4067 int recorded_frames_ GUARDED_BY(crit_); 4068 int recorded_frames_ GUARDED_BY(crit_);
4068 } test(this); 4069 } test(this);
4069 4070
4070 RunBaseTest(&test); 4071 RunBaseTest(&test);
4071 } 4072 }
4072 4073
4073 } // namespace webrtc 4074 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698