Delete unused method ReportBlockStats::AggregateAndStore
Bug: None Change-Id: I5511593b1459b1501c08ac41aa9220ed54ed73ed Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/142164 Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28286}
This commit is contained in:
parent
0292e9703f
commit
856ca198e2
@ -48,34 +48,6 @@ void ReportBlockStats::Store(const RtcpStatistics& rtcp_stats,
|
||||
&num_lost_sequence_numbers);
|
||||
}
|
||||
|
||||
RTCPReportBlock ReportBlockStats::AggregateAndStore(
|
||||
const ReportBlockVector& report_blocks) {
|
||||
RTCPReportBlock aggregate;
|
||||
if (report_blocks.empty()) {
|
||||
return aggregate;
|
||||
}
|
||||
uint32_t num_sequence_numbers = 0;
|
||||
uint32_t num_lost_sequence_numbers = 0;
|
||||
ReportBlockVector::const_iterator report_block = report_blocks.begin();
|
||||
for (; report_block != report_blocks.end(); ++report_block) {
|
||||
aggregate.packets_lost += report_block->packets_lost;
|
||||
aggregate.jitter += report_block->jitter;
|
||||
StoreAndAddPacketIncrement(*report_block, &num_sequence_numbers,
|
||||
&num_lost_sequence_numbers);
|
||||
}
|
||||
|
||||
if (report_blocks.size() == 1) {
|
||||
// No aggregation needed.
|
||||
return report_blocks[0];
|
||||
}
|
||||
// Fraction lost since previous report block.
|
||||
aggregate.fraction_lost =
|
||||
FractionLost(num_lost_sequence_numbers, num_sequence_numbers);
|
||||
aggregate.jitter = static_cast<uint32_t>(
|
||||
(aggregate.jitter + report_blocks.size() / 2) / report_blocks.size());
|
||||
return aggregate;
|
||||
}
|
||||
|
||||
void ReportBlockStats::StoreAndAddPacketIncrement(
|
||||
const RTCPReportBlock& report_block,
|
||||
uint32_t* num_sequence_numbers,
|
||||
|
||||
@ -28,10 +28,6 @@ class ReportBlockStats {
|
||||
ReportBlockStats();
|
||||
~ReportBlockStats();
|
||||
|
||||
// Updates stats and stores report blocks.
|
||||
// Returns an aggregate of the |report_blocks|.
|
||||
RTCPReportBlock AggregateAndStore(const ReportBlockVector& report_blocks);
|
||||
|
||||
// Updates stats and stores report block.
|
||||
void Store(const RtcpStatistics& rtcp_stats,
|
||||
uint32_t remote_ssrc,
|
||||
|
||||
@ -77,54 +77,6 @@ class ReportBlockStatsTest : public ::testing::Test {
|
||||
std::vector<RTCPReportBlock> ssrc12block2_;
|
||||
};
|
||||
|
||||
TEST_F(ReportBlockStatsTest, AggregateAndStore_NoSsrc) {
|
||||
ReportBlockStats stats;
|
||||
std::vector<RTCPReportBlock> empty;
|
||||
RTCPReportBlock aggregated = stats.AggregateAndStore(empty);
|
||||
EXPECT_EQ(0U, aggregated.fraction_lost);
|
||||
EXPECT_EQ(0, aggregated.packets_lost);
|
||||
EXPECT_EQ(0U, aggregated.jitter);
|
||||
EXPECT_EQ(0U, aggregated.extended_highest_sequence_number);
|
||||
}
|
||||
|
||||
TEST_F(ReportBlockStatsTest, AggregateAndStore_OneSsrc) {
|
||||
ReportBlockStats stats;
|
||||
RTCPReportBlock aggregated = stats.AggregateAndStore(ssrc1block1_);
|
||||
// One ssrc, no aggregation done.
|
||||
EXPECT_EQ(123U, aggregated.fraction_lost);
|
||||
EXPECT_EQ(10, aggregated.packets_lost);
|
||||
EXPECT_EQ(777U, aggregated.jitter);
|
||||
EXPECT_EQ(24000U, aggregated.extended_highest_sequence_number);
|
||||
|
||||
aggregated = stats.AggregateAndStore(ssrc1block2_);
|
||||
EXPECT_EQ(0U, aggregated.fraction_lost);
|
||||
EXPECT_EQ(15, aggregated.packets_lost);
|
||||
EXPECT_EQ(222U, aggregated.jitter);
|
||||
EXPECT_EQ(24100U, aggregated.extended_highest_sequence_number);
|
||||
|
||||
// fl: 100 * (15-10) / (24100-24000) = 5%
|
||||
EXPECT_EQ(5, stats.FractionLostInPercent());
|
||||
}
|
||||
|
||||
TEST_F(ReportBlockStatsTest, AggregateAndStore_TwoSsrcs) {
|
||||
ReportBlockStats stats;
|
||||
RTCPReportBlock aggregated = stats.AggregateAndStore(ssrc12block1_);
|
||||
EXPECT_EQ(0U, aggregated.fraction_lost);
|
||||
EXPECT_EQ(10 + 111, aggregated.packets_lost);
|
||||
EXPECT_EQ((777U + 555U) / 2, aggregated.jitter);
|
||||
EXPECT_EQ(0U, aggregated.extended_highest_sequence_number);
|
||||
|
||||
aggregated = stats.AggregateAndStore(ssrc12block2_);
|
||||
// fl: 255 * ((15-10) + (136-111)) / ((24100-24000) + (8800-8500)) = 19
|
||||
EXPECT_EQ(19U, aggregated.fraction_lost);
|
||||
EXPECT_EQ(15 + 136, aggregated.packets_lost);
|
||||
EXPECT_EQ((222U + 888U) / 2, aggregated.jitter);
|
||||
EXPECT_EQ(0U, aggregated.extended_highest_sequence_number);
|
||||
|
||||
// fl: 100 * ((15-10) + (136-111)) / ((24100-24000) + (8800-8500)) = 7%
|
||||
EXPECT_EQ(7, stats.FractionLostInPercent());
|
||||
}
|
||||
|
||||
TEST_F(ReportBlockStatsTest, StoreAndGetFractionLost) {
|
||||
const uint32_t kRemoteSsrc = 1;
|
||||
ReportBlockStats stats;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user