Replacing NetEq discard rate with secondary discarded rate.

NetEq network statistics contains discard rate but has not been used and even not been implemented until recently.

According to w3c.github.io/webrtc-stats/#dom-rtcreceivedrtpstreamstats-packetsdiscarded,
this statistics needs to be replaced with an accumulative stats. Such work will be carried out separately.

Meanwhile, we need to add a rate to reflect rate of discarded redundant packets. See webrtc:8025.

In this CL, we replace the existing discard rate with secondary discarded rate, so as to
1. fulfill the requests on webrtc:8025
2. get ready to implement an accumulative statistics for discarded packets.

BUG: webrtc:7903,webrtc:8025
Change-Id: Idbf143a105db76ca15f0af54848e1448f2a810ec
Reviewed-on: https://chromium-review.googlesource.com/582863
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19495}
This commit is contained in:
minyue-webrtc
2017-08-23 15:59:38 +02:00
committed by Commit Bot
parent d950d9eda1
commit 0c3ca753c5
14 changed files with 88 additions and 64 deletions

View File

@ -292,9 +292,13 @@ TEST(PacketBuffer, ExtractOrderRedundancy) {
packet_facts[i].payload_type,
kFrameSize);
Packet packet = gen.NextPacket(kPayloadLength);
packet.priority.red_level = packet_facts[i].primary ? 0 : 1;
packet.priority.codec_level = packet_facts[i].primary ? 0 : 1;
if (packet_facts[i].extract_order < 0) {
EXPECT_CALL(mock_stats, PacketsDiscarded(1));
if (packet.priority.codec_level > 0) {
EXPECT_CALL(mock_stats, SecondaryPacketsDiscarded(1));
} else {
EXPECT_CALL(mock_stats, PacketsDiscarded(1));
}
}
EXPECT_CALL(check, Call(i));
EXPECT_EQ(PacketBuffer::kOK,
@ -358,7 +362,8 @@ TEST(PacketBuffer, DiscardPackets) {
// This will discard all remaining packets but one. The oldest packet is older
// than the indicated horizon_samples, and will thus be left in the buffer.
constexpr size_t kSkipPackets = 1;
EXPECT_CALL(mock_stats, PacketsDiscarded(kRemainingPackets - kSkipPackets));
EXPECT_CALL(mock_stats, PacketsDiscarded(1))
.Times(kRemainingPackets - kSkipPackets);
EXPECT_CALL(check, Call(17)); // Arbitrary id number.
buffer.DiscardOldPackets(start_ts + kTotalPackets * ts_increment,
kRemainingPackets * ts_increment, &mock_stats);