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

Side by Side Diff: webrtc/video/video_loopback.cc

Issue 1995683003: Allow FakeNetworkPipe to drop packets in bursts. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Included cmath for std::ceil. Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « webrtc/test/fake_network_pipe_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 "If empty, title will be generated automatically."); 94 "If empty, title will be generated automatically.");
95 std::string GraphTitle() { 95 std::string GraphTitle() {
96 return static_cast<std::string>(FLAGS_graph_title); 96 return static_cast<std::string>(FLAGS_graph_title);
97 } 97 }
98 98
99 DEFINE_int32(loss_percent, 0, "Percentage of packets randomly lost."); 99 DEFINE_int32(loss_percent, 0, "Percentage of packets randomly lost.");
100 int LossPercent() { 100 int LossPercent() {
101 return static_cast<int>(FLAGS_loss_percent); 101 return static_cast<int>(FLAGS_loss_percent);
102 } 102 }
103 103
104 DEFINE_int32(avg_burst_loss_length, 1, "Average burst length of lost packets.");
105 int AvgBurstLossLength() {
106 return static_cast<int>(FLAGS_avg_burst_loss_length);
107 }
108
104 DEFINE_int32(link_capacity, 109 DEFINE_int32(link_capacity,
105 0, 110 0,
106 "Capacity (kbps) of the fake link. 0 means infinite."); 111 "Capacity (kbps) of the fake link. 0 means infinite.");
107 int LinkCapacityKbps() { 112 int LinkCapacityKbps() {
108 return static_cast<int>(FLAGS_link_capacity); 113 return static_cast<int>(FLAGS_link_capacity);
109 } 114 }
110 115
111 DEFINE_int32(queue_size, 0, "Size of the bottleneck link queue in packets."); 116 DEFINE_int32(queue_size, 0, "Size of the bottleneck link queue in packets.");
112 int QueueSize() { 117 int QueueSize() {
113 return static_cast<int>(FLAGS_queue_size); 118 return static_cast<int>(FLAGS_queue_size);
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 "Name of the clip to show. If empty, using chroma generator."); 199 "Name of the clip to show. If empty, using chroma generator.");
195 std::string Clip() { 200 std::string Clip() {
196 return static_cast<std::string>(FLAGS_clip); 201 return static_cast<std::string>(FLAGS_clip);
197 } 202 }
198 203
199 } // namespace flags 204 } // namespace flags
200 205
201 void Loopback() { 206 void Loopback() {
202 FakeNetworkPipe::Config pipe_config; 207 FakeNetworkPipe::Config pipe_config;
203 pipe_config.loss_percent = flags::LossPercent(); 208 pipe_config.loss_percent = flags::LossPercent();
209 pipe_config.avg_burst_loss_length = flags::AvgBurstLossLength();
204 pipe_config.link_capacity_kbps = flags::LinkCapacityKbps(); 210 pipe_config.link_capacity_kbps = flags::LinkCapacityKbps();
205 pipe_config.queue_length_packets = flags::QueueSize(); 211 pipe_config.queue_length_packets = flags::QueueSize();
206 pipe_config.queue_delay_ms = flags::AvgPropagationDelayMs(); 212 pipe_config.queue_delay_ms = flags::AvgPropagationDelayMs();
207 pipe_config.delay_standard_deviation_ms = flags::StdPropagationDelayMs(); 213 pipe_config.delay_standard_deviation_ms = flags::StdPropagationDelayMs();
208 pipe_config.allow_reordering = flags::FLAGS_allow_reordering; 214 pipe_config.allow_reordering = flags::FLAGS_allow_reordering;
209 215
210 Call::Config::BitrateConfig call_bitrate_config; 216 Call::Config::BitrateConfig call_bitrate_config;
211 call_bitrate_config.min_bitrate_bps = flags::MinBitrateKbps() * 1000; 217 call_bitrate_config.min_bitrate_bps = flags::MinBitrateKbps() * 1000;
212 call_bitrate_config.start_bitrate_bps = flags::StartBitrateKbps() * 1000; 218 call_bitrate_config.start_bitrate_bps = flags::StartBitrateKbps() * 1000;
213 call_bitrate_config.max_bitrate_bps = flags::MaxBitrateKbps() * 1000; 219 call_bitrate_config.max_bitrate_bps = flags::MaxBitrateKbps() * 1000;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 } // namespace webrtc 254 } // namespace webrtc
249 255
250 int main(int argc, char* argv[]) { 256 int main(int argc, char* argv[]) {
251 ::testing::InitGoogleTest(&argc, argv); 257 ::testing::InitGoogleTest(&argc, argv);
252 google::ParseCommandLineFlags(&argc, &argv, true); 258 google::ParseCommandLineFlags(&argc, &argv, true);
253 webrtc::test::InitFieldTrialsFromString( 259 webrtc::test::InitFieldTrialsFromString(
254 webrtc::flags::FLAGS_force_fieldtrials); 260 webrtc::flags::FLAGS_force_fieldtrials);
255 webrtc::test::RunTest(webrtc::Loopback); 261 webrtc::test::RunTest(webrtc::Loopback);
256 return 0; 262 return 0;
257 } 263 }
OLDNEW
« no previous file with comments | « webrtc/test/fake_network_pipe_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698