OLD | NEW |
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 "Name of a target graph data file. If set, no preview will be shown."); | 132 "Name of a target graph data file. If set, no preview will be shown."); |
133 std::string OutputFilename() { | 133 std::string OutputFilename() { |
134 return static_cast<std::string>(FLAGS_output_filename); | 134 return static_cast<std::string>(FLAGS_output_filename); |
135 } | 135 } |
136 | 136 |
137 DEFINE_int32(duration, 60, "Duration of the test in seconds."); | 137 DEFINE_int32(duration, 60, "Duration of the test in seconds."); |
138 int DurationSecs() { | 138 int DurationSecs() { |
139 return static_cast<int>(FLAGS_duration); | 139 return static_cast<int>(FLAGS_duration); |
140 } | 140 } |
141 | 141 |
142 DEFINE_bool(send_side_bwe, true, "Use send-side bandwidth estimation"); | |
143 | |
144 DEFINE_string( | 142 DEFINE_string( |
145 force_fieldtrials, | 143 force_fieldtrials, |
146 "", | 144 "", |
147 "Field trials control experimental feature code which can be forced. " | 145 "Field trials control experimental feature code which can be forced. " |
148 "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enable/" | 146 "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enable/" |
149 " will assign the group Enable to field trial WebRTC-FooFeature. Multiple " | 147 " will assign the group Enable to field trial WebRTC-FooFeature. Multiple " |
150 "trials are separated by \"/\""); | 148 "trials are separated by \"/\""); |
151 } // namespace flags | 149 } // namespace flags |
152 | 150 |
153 void Loopback() { | 151 void Loopback() { |
154 FakeNetworkPipe::Config pipe_config; | 152 FakeNetworkPipe::Config pipe_config; |
155 pipe_config.loss_percent = flags::LossPercent(); | 153 pipe_config.loss_percent = flags::LossPercent(); |
156 pipe_config.link_capacity_kbps = flags::LinkCapacityKbps(); | 154 pipe_config.link_capacity_kbps = flags::LinkCapacityKbps(); |
157 pipe_config.queue_length_packets = flags::QueueSize(); | 155 pipe_config.queue_length_packets = flags::QueueSize(); |
158 pipe_config.queue_delay_ms = flags::AvgPropagationDelayMs(); | 156 pipe_config.queue_delay_ms = flags::AvgPropagationDelayMs(); |
159 pipe_config.delay_standard_deviation_ms = flags::StdPropagationDelayMs(); | 157 pipe_config.delay_standard_deviation_ms = flags::StdPropagationDelayMs(); |
160 | 158 |
161 Call::Config::BitrateConfig call_bitrate_config; | 159 Call::Config::BitrateConfig call_bitrate_config; |
162 call_bitrate_config.min_bitrate_bps = flags::MinBitrateKbps() * 1000; | 160 call_bitrate_config.min_bitrate_bps = flags::MinBitrateKbps() * 1000; |
163 call_bitrate_config.start_bitrate_bps = flags::StartBitrateKbps() * 1000; | 161 call_bitrate_config.start_bitrate_bps = flags::StartBitrateKbps() * 1000; |
164 call_bitrate_config.max_bitrate_bps = flags::MaxBitrateKbps() * 1000; | 162 call_bitrate_config.max_bitrate_bps = flags::MaxBitrateKbps() * 1000; |
165 | 163 |
166 VideoQualityTest::Params params{ | 164 VideoQualityTest::Params params{ |
167 {flags::Width(), flags::Height(), flags::Fps(), | 165 { |
168 flags::MinBitrateKbps() * 1000, flags::TargetBitrateKbps() * 1000, | 166 flags::Width(), |
169 flags::MaxBitrateKbps() * 1000, flags::Codec(), | 167 flags::Height(), |
170 flags::NumTemporalLayers(), flags::MinTransmitBitrateKbps() * 1000, | 168 flags::Fps(), |
171 call_bitrate_config, flags::TLDiscardThreshold(), | 169 flags::MinBitrateKbps() * 1000, |
172 flags::FLAGS_send_side_bwe}, | 170 flags::TargetBitrateKbps() * 1000, |
| 171 flags::MaxBitrateKbps() * 1000, |
| 172 flags::Codec(), |
| 173 flags::NumTemporalLayers(), |
| 174 flags::MinTransmitBitrateKbps() * 1000, |
| 175 call_bitrate_config, |
| 176 flags::TLDiscardThreshold() |
| 177 }, |
173 {}, // Video specific. | 178 {}, // Video specific. |
174 {true, flags::SlideChangeInterval(), flags::ScrollDuration()}, | 179 {true, flags::SlideChangeInterval(), flags::ScrollDuration()}, |
175 {"screenshare", 0.0, 0.0, flags::DurationSecs(), flags::OutputFilename()}, | 180 {"screenshare", 0.0, 0.0, flags::DurationSecs(), flags::OutputFilename()}, |
176 pipe_config, | 181 pipe_config, |
177 flags::FLAGS_logs}; | 182 flags::FLAGS_logs}; |
178 | 183 |
179 VideoQualityTest test; | 184 VideoQualityTest test; |
180 if (flags::OutputFilename().empty()) | 185 if (flags::OutputFilename().empty()) |
181 test.RunWithVideoRenderer(params); | 186 test.RunWithVideoRenderer(params); |
182 else | 187 else |
183 test.RunWithAnalyzer(params); | 188 test.RunWithAnalyzer(params); |
184 } | 189 } |
185 } // namespace webrtc | 190 } // namespace webrtc |
186 | 191 |
187 int main(int argc, char* argv[]) { | 192 int main(int argc, char* argv[]) { |
188 ::testing::InitGoogleTest(&argc, argv); | 193 ::testing::InitGoogleTest(&argc, argv); |
189 google::ParseCommandLineFlags(&argc, &argv, true); | 194 google::ParseCommandLineFlags(&argc, &argv, true); |
190 webrtc::test::InitFieldTrialsFromString( | 195 webrtc::test::InitFieldTrialsFromString( |
191 webrtc::flags::FLAGS_force_fieldtrials); | 196 webrtc::flags::FLAGS_force_fieldtrials); |
192 webrtc::test::RunTest(webrtc::Loopback); | 197 webrtc::test::RunTest(webrtc::Loopback); |
193 return 0; | 198 return 0; |
194 } | 199 } |
OLD | NEW |