Chromium Code Reviews| 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 |
| 11 #include <stdio.h> | 11 #include <stdio.h> |
| 12 | 12 |
| 13 #include "gflags/gflags.h" | 13 #include "gflags/gflags.h" |
| 14 #include "webrtc/base/stringencode.h" | |
| 14 #include "webrtc/test/field_trial.h" | 15 #include "webrtc/test/field_trial.h" |
| 15 #include "webrtc/test/gtest.h" | 16 #include "webrtc/test/gtest.h" |
| 16 #include "webrtc/test/run_test.h" | 17 #include "webrtc/test/run_test.h" |
| 17 #include "webrtc/video/video_quality_test.h" | 18 #include "webrtc/video/video_quality_test.h" |
| 18 | 19 |
| 19 namespace webrtc { | 20 namespace webrtc { |
| 20 namespace flags { | 21 namespace flags { |
| 21 | 22 |
| 22 // Flags common with video loopback, with different default values. | 23 // Flags common with video loopback, with different default values. |
| 23 DEFINE_int32(width, 1850, "Video width (crops source)."); | 24 DEFINE_int32(width, 1850, "Video width (crops source)."); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 } | 208 } |
| 208 | 209 |
| 209 DEFINE_int32( | 210 DEFINE_int32( |
| 210 scroll_duration, | 211 scroll_duration, |
| 211 0, | 212 0, |
| 212 "Duration (in seconds) during which a slide will be scrolled into place."); | 213 "Duration (in seconds) during which a slide will be scrolled into place."); |
| 213 int ScrollDuration() { | 214 int ScrollDuration() { |
| 214 return static_cast<int>(FLAGS_scroll_duration); | 215 return static_cast<int>(FLAGS_scroll_duration); |
| 215 } | 216 } |
| 216 | 217 |
| 218 DEFINE_string(slides, | |
| 219 "", | |
| 220 "Comma-separated list of *.yuv files to display as slides."); | |
| 221 std::vector<std::string> Slides() { | |
| 222 std::vector<std::string> slides; | |
| 223 std::string slides_list = FLAGS_slides; | |
| 224 rtc::tokenize(slides_list, ',', &slides); | |
|
tommi
2017/04/12 11:30:39
nice!
| |
| 225 return slides; | |
| 226 } | |
| 227 | |
| 217 } // namespace flags | 228 } // namespace flags |
| 218 | 229 |
| 219 void Loopback() { | 230 void Loopback() { |
| 220 FakeNetworkPipe::Config pipe_config; | 231 FakeNetworkPipe::Config pipe_config; |
| 221 pipe_config.loss_percent = flags::LossPercent(); | 232 pipe_config.loss_percent = flags::LossPercent(); |
| 222 pipe_config.link_capacity_kbps = flags::LinkCapacityKbps(); | 233 pipe_config.link_capacity_kbps = flags::LinkCapacityKbps(); |
| 223 pipe_config.queue_length_packets = flags::QueueSize(); | 234 pipe_config.queue_length_packets = flags::QueueSize(); |
| 224 pipe_config.queue_delay_ms = flags::AvgPropagationDelayMs(); | 235 pipe_config.queue_delay_ms = flags::AvgPropagationDelayMs(); |
| 225 pipe_config.delay_standard_deviation_ms = flags::StdPropagationDelayMs(); | 236 pipe_config.delay_standard_deviation_ms = flags::StdPropagationDelayMs(); |
| 226 pipe_config.allow_reordering = flags::FLAGS_allow_reordering; | 237 pipe_config.allow_reordering = flags::FLAGS_allow_reordering; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 242 false, | 253 false, |
| 243 flags::Codec(), | 254 flags::Codec(), |
| 244 flags::NumTemporalLayers(), | 255 flags::NumTemporalLayers(), |
| 245 flags::SelectedTL(), | 256 flags::SelectedTL(), |
| 246 flags::MinTransmitBitrateKbps() * 1000, | 257 flags::MinTransmitBitrateKbps() * 1000, |
| 247 false, // ULPFEC disabled. | 258 false, // ULPFEC disabled. |
| 248 false, // FlexFEC disabled. | 259 false, // FlexFEC disabled. |
| 249 flags::EncodedFramePath(), | 260 flags::EncodedFramePath(), |
| 250 ""}; | 261 ""}; |
| 251 params.screenshare = {true, flags::SlideChangeInterval(), | 262 params.screenshare = {true, flags::SlideChangeInterval(), |
| 252 flags::ScrollDuration()}; | 263 flags::ScrollDuration(), flags::Slides()}; |
| 253 params.analyzer = {"screenshare", 0.0, 0.0, flags::DurationSecs(), | 264 params.analyzer = {"screenshare", 0.0, 0.0, flags::DurationSecs(), |
| 254 flags::OutputFilename(), flags::GraphTitle()}; | 265 flags::OutputFilename(), flags::GraphTitle()}; |
| 255 params.pipe = pipe_config; | 266 params.pipe = pipe_config; |
| 256 params.logs = flags::FLAGS_logs; | 267 params.logs = flags::FLAGS_logs; |
| 257 | 268 |
| 258 std::vector<std::string> stream_descriptors; | 269 std::vector<std::string> stream_descriptors; |
| 259 stream_descriptors.push_back(flags::Stream0()); | 270 stream_descriptors.push_back(flags::Stream0()); |
| 260 stream_descriptors.push_back(flags::Stream1()); | 271 stream_descriptors.push_back(flags::Stream1()); |
| 261 std::vector<std::string> SL_descriptors; | 272 std::vector<std::string> SL_descriptors; |
| 262 SL_descriptors.push_back(flags::SL0()); | 273 SL_descriptors.push_back(flags::SL0()); |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 275 } // namespace webrtc | 286 } // namespace webrtc |
| 276 | 287 |
| 277 int main(int argc, char* argv[]) { | 288 int main(int argc, char* argv[]) { |
| 278 ::testing::InitGoogleTest(&argc, argv); | 289 ::testing::InitGoogleTest(&argc, argv); |
| 279 google::ParseCommandLineFlags(&argc, &argv, true); | 290 google::ParseCommandLineFlags(&argc, &argv, true); |
| 280 webrtc::test::InitFieldTrialsFromString( | 291 webrtc::test::InitFieldTrialsFromString( |
| 281 webrtc::flags::FLAGS_force_fieldtrials); | 292 webrtc::flags::FLAGS_force_fieldtrials); |
| 282 webrtc::test::RunTest(webrtc::Loopback); | 293 webrtc::test::RunTest(webrtc::Loopback); |
| 283 return 0; | 294 return 0; |
| 284 } | 295 } |
| OLD | NEW |