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

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

Issue 1263383002: Changed loopback transport in RtxNackTest to not store sequence numbers for retransmitted packets. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase Created 5 years, 3 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 | « no previous file | 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/nack_rtx_unittest.cc
diff --git a/webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc b/webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc
index 0dc33227711f62c219ee9d9b50ed4bf6262d36f3..9edf3ed2813d49dccf3fc7ab2c628b59dc9c775b 100644
--- a/webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc
@@ -102,16 +102,6 @@ class RtxLoopBackTransport : public webrtc::Transport {
uint32_t ssrc = (ptr[8] << 24) + (ptr[9] << 16) + (ptr[10] << 8) + ptr[11];
if (ssrc == rtx_ssrc_) count_rtx_ssrc_++;
uint16_t sequence_number = (ptr[2] << 8) + ptr[3];
- expected_sequence_numbers_.insert(expected_sequence_numbers_.end(),
- sequence_number);
- if (packet_loss_ > 0) {
- if ((count_ % packet_loss_) == 0) {
- return static_cast<int>(len);
- }
- } else if (count_ >= consecutive_drop_start_ &&
- count_ < consecutive_drop_end_) {
- return static_cast<int>(len);
- }
size_t packet_length = len;
// TODO(pbos): Figure out why this needs to be initialized. Likely this
// is hiding a bug either in test setup or other code.
@@ -123,6 +113,21 @@ class RtxLoopBackTransport : public webrtc::Transport {
if (!parser->Parse(ptr, len, &header)) {
return -1;
}
+
+ if (!rtp_payload_registry_->IsRtx(header)) {
+ // Don't store retransmitted packets since we compare it to the list
+ // created by the receiver.
+ expected_sequence_numbers_.insert(expected_sequence_numbers_.end(),
+ sequence_number);
+ }
+ if (packet_loss_ > 0) {
+ if ((count_ % packet_loss_) == 0) {
+ return static_cast<int>(len);
+ }
+ } else if (count_ >= consecutive_drop_start_ &&
+ count_ < consecutive_drop_end_) {
+ return static_cast<int>(len);
+ }
if (rtp_payload_registry_->IsRtx(header)) {
// Remove the RTX header and parse the original RTP header.
EXPECT_TRUE(rtp_payload_registry_->RestoreOriginalPacket(
@@ -257,7 +262,9 @@ class RtpRtcpRtxNackTest : public ::testing::Test {
receiver_.sequence_numbers_.end(),
std::back_inserter(received_sorted));
received_sorted.sort();
- return std::equal(received_sorted.begin(), received_sorted.end(),
+ return received_sorted.size() ==
+ transport_.expected_sequence_numbers_.size() &&
+ std::equal(received_sorted.begin(), received_sorted.end(),
transport_.expected_sequence_numbers_.begin());
}
« 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