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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 return static_cast<int>(FLAG_avg_propagation_delay_ms); | 120 return static_cast<int>(FLAG_avg_propagation_delay_ms); |
121 } | 121 } |
122 | 122 |
123 DEFINE_int(std_propagation_delay_ms, | 123 DEFINE_int(std_propagation_delay_ms, |
124 0, | 124 0, |
125 "Link propagation delay standard deviation in ms."); | 125 "Link propagation delay standard deviation in ms."); |
126 int StdPropagationDelayMs() { | 126 int StdPropagationDelayMs() { |
127 return static_cast<int>(FLAG_std_propagation_delay_ms); | 127 return static_cast<int>(FLAG_std_propagation_delay_ms); |
128 } | 128 } |
129 | 129 |
130 DEFINE_int(selected_stream, 0, "ID of the stream to show or analyze."); | 130 DEFINE_int(num_streams, 0, "Number of streams to show or analyze."); |
| 131 int NumStreams() { |
| 132 return static_cast<int>(FLAG_num_streams); |
| 133 } |
| 134 |
| 135 DEFINE_int(selected_stream, |
| 136 0, |
| 137 "ID of the stream to show or analyze. " |
| 138 "Set to the number of streams to show them all."); |
131 int SelectedStream() { | 139 int SelectedStream() { |
132 return static_cast<int>(FLAG_selected_stream); | 140 return static_cast<int>(FLAG_selected_stream); |
133 } | 141 } |
134 | 142 |
135 DEFINE_int(num_spatial_layers, 1, "Number of spatial layers to use."); | 143 DEFINE_int(num_spatial_layers, 1, "Number of spatial layers to use."); |
136 int NumSpatialLayers() { | 144 int NumSpatialLayers() { |
137 return static_cast<int>(FLAG_num_spatial_layers); | 145 return static_cast<int>(FLAG_num_spatial_layers); |
138 } | 146 } |
139 | 147 |
140 DEFINE_int(selected_sl, | 148 DEFINE_int(selected_sl, |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 false, // FlexFEC disabled. | 269 false, // FlexFEC disabled. |
262 flags::EncodedFramePath(), | 270 flags::EncodedFramePath(), |
263 ""}; | 271 ""}; |
264 params.screenshare = {true, flags::SlideChangeInterval(), | 272 params.screenshare = {true, flags::SlideChangeInterval(), |
265 flags::ScrollDuration(), flags::Slides()}; | 273 flags::ScrollDuration(), flags::Slides()}; |
266 params.analyzer = {"screenshare", 0.0, 0.0, flags::DurationSecs(), | 274 params.analyzer = {"screenshare", 0.0, 0.0, flags::DurationSecs(), |
267 flags::OutputFilename(), flags::GraphTitle()}; | 275 flags::OutputFilename(), flags::GraphTitle()}; |
268 params.pipe = pipe_config; | 276 params.pipe = pipe_config; |
269 params.logs = flags::FLAG_logs; | 277 params.logs = flags::FLAG_logs; |
270 | 278 |
| 279 if (flags::NumStreams() > 1 && flags::Stream0().empty() && |
| 280 flags::Stream1().empty()) { |
| 281 params.ss.infer_streams = true; |
| 282 } |
| 283 |
271 std::vector<std::string> stream_descriptors; | 284 std::vector<std::string> stream_descriptors; |
272 stream_descriptors.push_back(flags::Stream0()); | 285 stream_descriptors.push_back(flags::Stream0()); |
273 stream_descriptors.push_back(flags::Stream1()); | 286 stream_descriptors.push_back(flags::Stream1()); |
274 std::vector<std::string> SL_descriptors; | 287 std::vector<std::string> SL_descriptors; |
275 SL_descriptors.push_back(flags::SL0()); | 288 SL_descriptors.push_back(flags::SL0()); |
276 SL_descriptors.push_back(flags::SL1()); | 289 SL_descriptors.push_back(flags::SL1()); |
277 VideoQualityTest::FillScalabilitySettings( | 290 VideoQualityTest::FillScalabilitySettings( |
278 ¶ms, stream_descriptors, flags::SelectedStream(), | 291 ¶ms, stream_descriptors, flags::NumStreams(), flags::SelectedStream(), |
279 flags::NumSpatialLayers(), flags::SelectedSL(), SL_descriptors); | 292 flags::NumSpatialLayers(), flags::SelectedSL(), SL_descriptors); |
280 | 293 |
281 VideoQualityTest test; | 294 VideoQualityTest test; |
282 if (flags::DurationSecs()) { | 295 if (flags::DurationSecs()) { |
283 test.RunWithAnalyzer(params); | 296 test.RunWithAnalyzer(params); |
284 } else { | 297 } else { |
285 test.RunWithRenderers(params); | 298 test.RunWithRenderers(params); |
286 } | 299 } |
287 } | 300 } |
288 } // namespace webrtc | 301 } // namespace webrtc |
289 | 302 |
290 int main(int argc, char* argv[]) { | 303 int main(int argc, char* argv[]) { |
291 ::testing::InitGoogleTest(&argc, argv); | 304 ::testing::InitGoogleTest(&argc, argv); |
292 rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, true); | 305 rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, true); |
293 if (webrtc::flags::FLAG_help) { | 306 if (webrtc::flags::FLAG_help) { |
294 rtc::FlagList::Print(nullptr, false); | 307 rtc::FlagList::Print(nullptr, false); |
295 return 0; | 308 return 0; |
296 } | 309 } |
297 | 310 |
298 webrtc::test::InitFieldTrialsFromString( | 311 // InitFieldTrialsFromString needs a reference to an std::string instance, |
299 webrtc::flags::FLAG_force_fieldtrials); | 312 // with a scope that outlives the test. |
| 313 std::string field_trials = webrtc::flags::FLAG_force_fieldtrials; |
| 314 webrtc::test::InitFieldTrialsFromString(field_trials); |
300 webrtc::test::RunTest(webrtc::Loopback); | 315 webrtc::test::RunTest(webrtc::Loopback); |
301 return 0; | 316 return 0; |
302 } | 317 } |
OLD | NEW |