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 |
142 DEFINE_string( | 144 DEFINE_string( |
143 force_fieldtrials, | 145 force_fieldtrials, |
144 "", | 146 "", |
145 "Field trials control experimental feature code which can be forced. " | 147 "Field trials control experimental feature code which can be forced. " |
146 "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enable/" | 148 "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enable/" |
147 " will assign the group Enable to field trial WebRTC-FooFeature. Multiple " | 149 " will assign the group Enable to field trial WebRTC-FooFeature. Multiple " |
148 "trials are separated by \"/\""); | 150 "trials are separated by \"/\""); |
149 } // namespace flags | 151 } // namespace flags |
150 | 152 |
151 void Loopback() { | 153 void Loopback() { |
152 FakeNetworkPipe::Config pipe_config; | 154 FakeNetworkPipe::Config pipe_config; |
153 pipe_config.loss_percent = flags::LossPercent(); | 155 pipe_config.loss_percent = flags::LossPercent(); |
154 pipe_config.link_capacity_kbps = flags::LinkCapacityKbps(); | 156 pipe_config.link_capacity_kbps = flags::LinkCapacityKbps(); |
155 pipe_config.queue_length_packets = flags::QueueSize(); | 157 pipe_config.queue_length_packets = flags::QueueSize(); |
156 pipe_config.queue_delay_ms = flags::AvgPropagationDelayMs(); | 158 pipe_config.queue_delay_ms = flags::AvgPropagationDelayMs(); |
157 pipe_config.delay_standard_deviation_ms = flags::StdPropagationDelayMs(); | 159 pipe_config.delay_standard_deviation_ms = flags::StdPropagationDelayMs(); |
158 | 160 |
159 Call::Config::BitrateConfig call_bitrate_config; | 161 Call::Config::BitrateConfig call_bitrate_config; |
160 call_bitrate_config.min_bitrate_bps = flags::MinBitrateKbps() * 1000; | 162 call_bitrate_config.min_bitrate_bps = flags::MinBitrateKbps() * 1000; |
161 call_bitrate_config.start_bitrate_bps = flags::StartBitrateKbps() * 1000; | 163 call_bitrate_config.start_bitrate_bps = flags::StartBitrateKbps() * 1000; |
162 call_bitrate_config.max_bitrate_bps = flags::MaxBitrateKbps() * 1000; | 164 call_bitrate_config.max_bitrate_bps = flags::MaxBitrateKbps() * 1000; |
163 | 165 |
164 VideoQualityTest::Params params{ | 166 VideoQualityTest::Params params{ |
165 { | 167 {flags::Width(), flags::Height(), flags::Fps(), |
166 flags::Width(), | 168 flags::MinBitrateKbps() * 1000, flags::TargetBitrateKbps() * 1000, |
167 flags::Height(), | 169 flags::MaxBitrateKbps() * 1000, flags::Codec(), |
168 flags::Fps(), | 170 flags::NumTemporalLayers(), flags::MinTransmitBitrateKbps() * 1000, |
169 flags::MinBitrateKbps() * 1000, | 171 call_bitrate_config, flags::TLDiscardThreshold(), |
170 flags::TargetBitrateKbps() * 1000, | 172 flags::FLAGS_send_side_bwe}, |
171 flags::MaxBitrateKbps() * 1000, | |
172 flags::Codec(), | |
173 flags::NumTemporalLayers(), | |
174 flags::MinTransmitBitrateKbps() * 1000, | |
175 call_bitrate_config, | |
176 flags::TLDiscardThreshold() | |
177 }, | |
178 {}, // Video specific. | 173 {}, // Video specific. |
179 {true, flags::SlideChangeInterval(), flags::ScrollDuration()}, | 174 {true, flags::SlideChangeInterval(), flags::ScrollDuration()}, |
180 {"screenshare", 0.0, 0.0, flags::DurationSecs(), flags::OutputFilename()}, | 175 {"screenshare", 0.0, 0.0, flags::DurationSecs(), flags::OutputFilename()}, |
181 pipe_config, | 176 pipe_config, |
182 flags::FLAGS_logs}; | 177 flags::FLAGS_logs}; |
183 | 178 |
184 VideoQualityTest test; | 179 VideoQualityTest test; |
185 if (flags::OutputFilename().empty()) | 180 if (flags::OutputFilename().empty()) |
186 test.RunWithVideoRenderer(params); | 181 test.RunWithVideoRenderer(params); |
187 else | 182 else |
188 test.RunWithAnalyzer(params); | 183 test.RunWithAnalyzer(params); |
189 } | 184 } |
190 } // namespace webrtc | 185 } // namespace webrtc |
191 | 186 |
192 int main(int argc, char* argv[]) { | 187 int main(int argc, char* argv[]) { |
193 ::testing::InitGoogleTest(&argc, argv); | 188 ::testing::InitGoogleTest(&argc, argv); |
194 google::ParseCommandLineFlags(&argc, &argv, true); | 189 google::ParseCommandLineFlags(&argc, &argv, true); |
195 webrtc::test::InitFieldTrialsFromString( | 190 webrtc::test::InitFieldTrialsFromString( |
196 webrtc::flags::FLAGS_force_fieldtrials); | 191 webrtc::flags::FLAGS_force_fieldtrials); |
197 webrtc::test::RunTest(webrtc::Loopback); | 192 webrtc::test::RunTest(webrtc::Loopback); |
198 return 0; | 193 return 0; |
199 } | 194 } |
OLD | NEW |