Allow FakeNetworkPipe to drop packets in bursts.
The fake network pipe will still only drop packets at an average rate of
|loss_percent| but in bursts at an average length specified by
|avg_burst_loss_length|.
Also added the flag -avg_burst_loss_length to video loopback.
BUG=
Review-Url: https://codereview.webrtc.org/1995683003
Cr-Commit-Position: refs/heads/master@{#12969}
diff --git a/webrtc/video/video_loopback.cc b/webrtc/video/video_loopback.cc
index 0974d58..70a940d 100644
--- a/webrtc/video/video_loopback.cc
+++ b/webrtc/video/video_loopback.cc
@@ -101,6 +101,11 @@
return static_cast<int>(FLAGS_loss_percent);
}
+DEFINE_int32(avg_burst_loss_length, 1, "Average burst length of lost packets.");
+int AvgBurstLossLength() {
+ return static_cast<int>(FLAGS_avg_burst_loss_length);
+}
+
DEFINE_int32(link_capacity,
0,
"Capacity (kbps) of the fake link. 0 means infinite.");
@@ -201,6 +206,7 @@
void Loopback() {
FakeNetworkPipe::Config pipe_config;
pipe_config.loss_percent = flags::LossPercent();
+ pipe_config.avg_burst_loss_length = flags::AvgBurstLossLength();
pipe_config.link_capacity_kbps = flags::LinkCapacityKbps();
pipe_config.queue_length_packets = flags::QueueSize();
pipe_config.queue_delay_ms = flags::AvgPropagationDelayMs();