Add method for incrementing RtpPacketCounter. Removes duplicate code.

Correction to check if rtx is enabled on send-side (and not receive) when updating rtx send bitrate stat.

Remove unneeded guarded by annotations.

BUG=
R=mflodman@webrtc.org, stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/41729004

Cr-Commit-Position: refs/heads/master@{#8239}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8239 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
asapersson@webrtc.org
2015-02-04 08:34:47 +00:00
parent e2506670a4
commit 4414939954
7 changed files with 108 additions and 136 deletions

View File

@ -257,29 +257,22 @@ class RtpTestCallback : public StreamDataCountersCallback {
++num_calls_;
}
void MatchPacketCounter(const RtpPacketCounter& expected,
const RtpPacketCounter& actual) {
EXPECT_EQ(expected.payload_bytes, actual.payload_bytes);
EXPECT_EQ(expected.header_bytes, actual.header_bytes);
EXPECT_EQ(expected.padding_bytes, actual.padding_bytes);
EXPECT_EQ(expected.packets, actual.packets);
}
void Matches(uint32_t num_calls,
uint32_t ssrc,
const StreamDataCounters& expected) {
EXPECT_EQ(num_calls, num_calls_);
EXPECT_EQ(ssrc, ssrc_);
EXPECT_EQ(expected.transmitted.payload_bytes,
stats_.transmitted.payload_bytes);
EXPECT_EQ(expected.transmitted.header_bytes,
stats_.transmitted.header_bytes);
EXPECT_EQ(expected.transmitted.padding_bytes,
stats_.transmitted.padding_bytes);
EXPECT_EQ(expected.transmitted.packets, stats_.transmitted.packets);
EXPECT_EQ(expected.retransmitted.payload_bytes,
stats_.retransmitted.payload_bytes);
EXPECT_EQ(expected.retransmitted.header_bytes,
stats_.retransmitted.header_bytes);
EXPECT_EQ(expected.retransmitted.padding_bytes,
stats_.retransmitted.padding_bytes);
EXPECT_EQ(expected.retransmitted.packets, stats_.retransmitted.packets);
EXPECT_EQ(expected.fec.payload_bytes, stats_.fec.payload_bytes);
EXPECT_EQ(expected.fec.header_bytes, stats_.fec.header_bytes);
EXPECT_EQ(expected.fec.padding_bytes, stats_.fec.padding_bytes);
EXPECT_EQ(expected.fec.packets, stats_.fec.packets);
MatchPacketCounter(expected.transmitted, stats_.transmitted);
MatchPacketCounter(expected.retransmitted, stats_.retransmitted);
MatchPacketCounter(expected.fec, stats_.fec);
}
uint32_t num_calls_;