blob: 4cdddb94e5285850d93d93b098ec813d72b0e363 [file] [log] [blame]
sprang@webrtc.org131bea82015-02-18 12:46:06 +00001/*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#include <stdio.h>
12
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020013#include "rtc_base/flags.h"
Mirko Bonadei45a4c412018-07-31 15:07:28 +020014#include "rtc_base/logging.h"
Mirko Bonadei17f48782018-09-28 08:51:10 +020015#include "system_wrappers/include/field_trial.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020016#include "test/field_trial.h"
17#include "test/gtest.h"
18#include "test/run_test.h"
19#include "video/video_quality_test.h"
sprang@webrtc.org131bea82015-02-18 12:46:06 +000020
21namespace webrtc {
sprang@webrtc.org131bea82015-02-18 12:46:06 +000022namespace flags {
23
sprangce4aef12015-11-02 07:23:20 -080024// Flags common with screenshare loopback, with different default values.
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020025WEBRTC_DEFINE_int(width, 640, "Video width.");
sprang@webrtc.org131bea82015-02-18 12:46:06 +000026size_t Width() {
sprang1168fd42017-06-21 09:00:17 -070027 return static_cast<size_t>(FLAG_width);
sprang@webrtc.org131bea82015-02-18 12:46:06 +000028}
29
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020030WEBRTC_DEFINE_int(height, 480, "Video height.");
sprang@webrtc.org131bea82015-02-18 12:46:06 +000031size_t Height() {
sprang1168fd42017-06-21 09:00:17 -070032 return static_cast<size_t>(FLAG_height);
sprang@webrtc.org131bea82015-02-18 12:46:06 +000033}
34
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020035WEBRTC_DEFINE_int(fps, 30, "Frames per second.");
sprang@webrtc.org131bea82015-02-18 12:46:06 +000036int Fps() {
sprang1168fd42017-06-21 09:00:17 -070037 return static_cast<int>(FLAG_fps);
sprang@webrtc.org131bea82015-02-18 12:46:06 +000038}
39
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020040WEBRTC_DEFINE_int(capture_device_index, 0, "Capture device to select");
Tarun Chawla8e857d12017-05-31 19:20:57 +053041size_t GetCaptureDevice() {
sprang1168fd42017-06-21 09:00:17 -070042 return static_cast<size_t>(FLAG_capture_device_index);
Tarun Chawla8e857d12017-05-31 19:20:57 +053043}
44
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020045WEBRTC_DEFINE_int(min_bitrate, 50, "Call and stream min bitrate in kbps.");
ivica5d6a06c2015-09-17 05:30:24 -070046int MinBitrateKbps() {
sprang1168fd42017-06-21 09:00:17 -070047 return static_cast<int>(FLAG_min_bitrate);
sprang@webrtc.org131bea82015-02-18 12:46:06 +000048}
49
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020050WEBRTC_DEFINE_int(start_bitrate, 300, "Call start bitrate in kbps.");
ivica5d6a06c2015-09-17 05:30:24 -070051int StartBitrateKbps() {
sprang1168fd42017-06-21 09:00:17 -070052 return static_cast<int>(FLAG_start_bitrate);
sprang@webrtc.org131bea82015-02-18 12:46:06 +000053}
54
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020055WEBRTC_DEFINE_int(target_bitrate, 800, "Stream target bitrate in kbps.");
ivica5d6a06c2015-09-17 05:30:24 -070056int TargetBitrateKbps() {
sprang1168fd42017-06-21 09:00:17 -070057 return static_cast<int>(FLAG_target_bitrate);
sprang@webrtc.org131bea82015-02-18 12:46:06 +000058}
59
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020060WEBRTC_DEFINE_int(max_bitrate, 800, "Call and stream max bitrate in kbps.");
ivica5d6a06c2015-09-17 05:30:24 -070061int MaxBitrateKbps() {
sprang1168fd42017-06-21 09:00:17 -070062 return static_cast<int>(FLAG_max_bitrate);
ivica5d6a06c2015-09-17 05:30:24 -070063}
sprang@webrtc.org131bea82015-02-18 12:46:06 +000064
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020065WEBRTC_DEFINE_bool(suspend_below_min_bitrate,
66 false,
67 "Suspends video below the configured min bitrate.");
mflodman48a4beb2016-07-01 13:03:59 +020068
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020069WEBRTC_DEFINE_int(num_temporal_layers,
70 1,
71 "Number of temporal layers. Set to 1-4 to override.");
sprangce4aef12015-11-02 07:23:20 -080072int NumTemporalLayers() {
sprang1168fd42017-06-21 09:00:17 -070073 return static_cast<int>(FLAG_num_temporal_layers);
sprangce4aef12015-11-02 07:23:20 -080074}
75
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020076WEBRTC_DEFINE_int(
77 inter_layer_pred,
78 2,
79 "Inter-layer prediction mode. "
80 "0 - enabled, 1 - disabled, 2 - enabled only for key pictures.");
Sergey Silkin57027362018-05-15 09:12:05 +020081InterLayerPredMode InterLayerPred() {
82 if (FLAG_inter_layer_pred == 0) {
83 return InterLayerPredMode::kOn;
84 } else if (FLAG_inter_layer_pred == 1) {
85 return InterLayerPredMode::kOff;
86 } else {
87 RTC_DCHECK_EQ(FLAG_inter_layer_pred, 2);
88 return InterLayerPredMode::kOnKeyPic;
89 }
90}
91
sprangce4aef12015-11-02 07:23:20 -080092// Flags common with screenshare loopback, with equal default values.
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020093WEBRTC_DEFINE_string(codec, "VP8", "Video codec to use.");
sprang@webrtc.org131bea82015-02-18 12:46:06 +000094std::string Codec() {
sprang1168fd42017-06-21 09:00:17 -070095 return static_cast<std::string>(FLAG_codec);
sprang@webrtc.org131bea82015-02-18 12:46:06 +000096}
97
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020098WEBRTC_DEFINE_int(
99 selected_tl,
100 -1,
101 "Temporal layer to show or analyze. -1 to disable filtering.");
sprangce4aef12015-11-02 07:23:20 -0800102int SelectedTL() {
sprang1168fd42017-06-21 09:00:17 -0700103 return static_cast<int>(FLAG_selected_tl);
sprangce4aef12015-11-02 07:23:20 -0800104}
105
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200106WEBRTC_DEFINE_int(
sprangce4aef12015-11-02 07:23:20 -0800107 duration,
108 0,
109 "Duration of the test in seconds. If 0, rendered will be shown instead.");
110int DurationSecs() {
sprang1168fd42017-06-21 09:00:17 -0700111 return static_cast<int>(FLAG_duration);
sprangce4aef12015-11-02 07:23:20 -0800112}
113
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200114WEBRTC_DEFINE_string(output_filename, "", "Target graph data filename.");
sprangce4aef12015-11-02 07:23:20 -0800115std::string OutputFilename() {
sprang1168fd42017-06-21 09:00:17 -0700116 return static_cast<std::string>(FLAG_output_filename);
sprangce4aef12015-11-02 07:23:20 -0800117}
118
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200119WEBRTC_DEFINE_string(graph_title,
120 "",
121 "If empty, title will be generated automatically.");
sprangce4aef12015-11-02 07:23:20 -0800122std::string GraphTitle() {
sprang1168fd42017-06-21 09:00:17 -0700123 return static_cast<std::string>(FLAG_graph_title);
sprangce4aef12015-11-02 07:23:20 -0800124}
125
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200126WEBRTC_DEFINE_int(loss_percent, 0, "Percentage of packets randomly lost.");
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000127int LossPercent() {
sprang1168fd42017-06-21 09:00:17 -0700128 return static_cast<int>(FLAG_loss_percent);
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000129}
130
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200131WEBRTC_DEFINE_int(avg_burst_loss_length,
132 -1,
133 "Average burst length of lost packets.");
philipel536378b2016-05-31 03:20:23 -0700134int AvgBurstLossLength() {
sprang1168fd42017-06-21 09:00:17 -0700135 return static_cast<int>(FLAG_avg_burst_loss_length);
philipel536378b2016-05-31 03:20:23 -0700136}
137
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200138WEBRTC_DEFINE_int(link_capacity,
139 0,
140 "Capacity (kbps) of the fake link. 0 means infinite.");
ivica5d6a06c2015-09-17 05:30:24 -0700141int LinkCapacityKbps() {
sprang1168fd42017-06-21 09:00:17 -0700142 return static_cast<int>(FLAG_link_capacity);
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000143}
144
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200145WEBRTC_DEFINE_int(queue_size,
146 0,
147 "Size of the bottleneck link queue in packets.");
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000148int QueueSize() {
sprang1168fd42017-06-21 09:00:17 -0700149 return static_cast<int>(FLAG_queue_size);
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000150}
151
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200152WEBRTC_DEFINE_int(avg_propagation_delay_ms,
153 0,
154 "Average link propagation delay in ms.");
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000155int AvgPropagationDelayMs() {
sprang1168fd42017-06-21 09:00:17 -0700156 return static_cast<int>(FLAG_avg_propagation_delay_ms);
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000157}
158
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200159WEBRTC_DEFINE_string(rtc_event_log_name,
160 "",
161 "Filename for rtc event log. Two files "
162 "with \"_send\" and \"_recv\" suffixes will be created.");
ilnik98436952017-07-13 00:47:03 -0700163std::string RtcEventLogName() {
164 return static_cast<std::string>(FLAG_rtc_event_log_name);
165}
166
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200167WEBRTC_DEFINE_string(rtp_dump_name,
168 "",
169 "Filename for dumped received RTP stream.");
ilnik98436952017-07-13 00:47:03 -0700170std::string RtpDumpName() {
171 return static_cast<std::string>(FLAG_rtp_dump_name);
172}
173
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200174WEBRTC_DEFINE_int(std_propagation_delay_ms,
175 0,
176 "Link propagation delay standard deviation in ms.");
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000177int StdPropagationDelayMs() {
sprang1168fd42017-06-21 09:00:17 -0700178 return static_cast<int>(FLAG_std_propagation_delay_ms);
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000179}
180
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200181WEBRTC_DEFINE_int(num_streams, 0, "Number of streams to show or analyze.");
sprang1168fd42017-06-21 09:00:17 -0700182int NumStreams() {
183 return static_cast<int>(FLAG_num_streams);
184}
185
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200186WEBRTC_DEFINE_int(selected_stream,
187 0,
188 "ID of the stream to show or analyze. "
189 "Set to the number of streams to show them all.");
sprangce4aef12015-11-02 07:23:20 -0800190int SelectedStream() {
sprang1168fd42017-06-21 09:00:17 -0700191 return static_cast<int>(FLAG_selected_stream);
sprangce4aef12015-11-02 07:23:20 -0800192}
193
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200194WEBRTC_DEFINE_int(num_spatial_layers, 1, "Number of spatial layers to use.");
sprangce4aef12015-11-02 07:23:20 -0800195int NumSpatialLayers() {
sprang1168fd42017-06-21 09:00:17 -0700196 return static_cast<int>(FLAG_num_spatial_layers);
sprangce4aef12015-11-02 07:23:20 -0800197}
198
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200199WEBRTC_DEFINE_int(selected_sl,
200 -1,
201 "Spatial layer to show or analyze. -1 to disable filtering.");
sprangce4aef12015-11-02 07:23:20 -0800202int SelectedSL() {
sprang1168fd42017-06-21 09:00:17 -0700203 return static_cast<int>(FLAG_selected_sl);
sprangce4aef12015-11-02 07:23:20 -0800204}
205
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200206WEBRTC_DEFINE_string(
207 stream0,
208 "",
209 "Comma separated values describing VideoStream for stream #0.");
sprangce4aef12015-11-02 07:23:20 -0800210std::string Stream0() {
sprang1168fd42017-06-21 09:00:17 -0700211 return static_cast<std::string>(FLAG_stream0);
sprangce4aef12015-11-02 07:23:20 -0800212}
213
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200214WEBRTC_DEFINE_string(
215 stream1,
216 "",
217 "Comma separated values describing VideoStream for stream #1.");
sprangce4aef12015-11-02 07:23:20 -0800218std::string Stream1() {
sprang1168fd42017-06-21 09:00:17 -0700219 return static_cast<std::string>(FLAG_stream1);
sprangce4aef12015-11-02 07:23:20 -0800220}
221
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200222WEBRTC_DEFINE_string(
223 sl0,
224 "",
225 "Comma separated values describing SpatialLayer for layer #0.");
sprangce4aef12015-11-02 07:23:20 -0800226std::string SL0() {
sprang1168fd42017-06-21 09:00:17 -0700227 return static_cast<std::string>(FLAG_sl0);
sprangce4aef12015-11-02 07:23:20 -0800228}
229
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200230WEBRTC_DEFINE_string(
231 sl1,
232 "",
233 "Comma separated values describing SpatialLayer for layer #1.");
sprangce4aef12015-11-02 07:23:20 -0800234std::string SL1() {
sprang1168fd42017-06-21 09:00:17 -0700235 return static_cast<std::string>(FLAG_sl1);
sprangce4aef12015-11-02 07:23:20 -0800236}
237
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200238WEBRTC_DEFINE_string(
239 encoded_frame_path,
240 "",
241 "The base path for encoded frame logs. Created files will have "
242 "the form <encoded_frame_path>.<n>.(recv|send.<m>).ivf");
palmkviste75f2042016-09-28 06:19:48 -0700243std::string EncodedFramePath() {
sprang1168fd42017-06-21 09:00:17 -0700244 return static_cast<std::string>(FLAG_encoded_frame_path);
palmkviste75f2042016-09-28 06:19:48 -0700245}
246
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200247WEBRTC_DEFINE_bool(logs, false, "print logs to stderr");
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000248
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200249WEBRTC_DEFINE_bool(send_side_bwe, true, "Use send-side bandwidth estimation");
sprangce4aef12015-11-02 07:23:20 -0800250
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200251WEBRTC_DEFINE_bool(generic_descriptor,
252 false,
253 "Use the generic frame descriptor.");
philipel569397f2018-09-26 12:25:31 +0200254
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200255WEBRTC_DEFINE_bool(allow_reordering, false, "Allow packet reordering to occur");
philipela2c55232016-01-26 08:41:53 -0800256
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200257WEBRTC_DEFINE_bool(use_ulpfec,
258 false,
259 "Use RED+ULPFEC forward error correction.");
brandtra62f5822016-11-17 00:21:13 -0800260
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200261WEBRTC_DEFINE_bool(use_flexfec, false, "Use FlexFEC forward error correction.");
philipel274c1dc2016-05-04 06:21:01 -0700262
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200263WEBRTC_DEFINE_bool(audio, false, "Add audio stream");
minyue73208662016-08-18 06:28:55 -0700264
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200265WEBRTC_DEFINE_bool(
266 use_real_adm,
267 false,
268 "Use real ADM instead of fake (no effect if audio is false)");
henrika255750b2018-08-27 16:13:37 +0200269
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200270WEBRTC_DEFINE_bool(audio_video_sync,
271 false,
272 "Sync audio and video stream (no effect if"
273 " audio is false)");
minyue73208662016-08-18 06:28:55 -0700274
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200275WEBRTC_DEFINE_bool(audio_dtx,
276 false,
277 "Enable audio DTX (no effect if audio is false)");
minyue4c8b9422017-03-21 04:11:43 -0700278
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200279WEBRTC_DEFINE_bool(video, true, "Add video stream");
minyuea27172d2016-11-01 05:59:29 -0700280
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200281WEBRTC_DEFINE_string(
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000282 force_fieldtrials,
283 "",
284 "Field trials control experimental feature code which can be forced. "
Elad Alon1e3ed162018-10-15 17:50:37 +0200285 "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enabled/"
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000286 " will assign the group Enable to field trial WebRTC-FooFeature. Multiple "
287 "trials are separated by \"/\"");
pbos9874ee02015-06-22 04:44:26 -0700288
sprangce4aef12015-11-02 07:23:20 -0800289// Video-specific flags.
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200290WEBRTC_DEFINE_string(
291 clip,
292 "",
293 "Name of the clip to show. If empty, using chroma generator.");
ivica5d6a06c2015-09-17 05:30:24 -0700294std::string Clip() {
sprang1168fd42017-06-21 09:00:17 -0700295 return static_cast<std::string>(FLAG_clip);
ivica5d6a06c2015-09-17 05:30:24 -0700296}
297
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200298WEBRTC_DEFINE_bool(help, false, "prints this message");
sprang1168fd42017-06-21 09:00:17 -0700299
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000300} // namespace flags
301
302void Loopback() {
Artem Titov75e36472018-10-08 12:28:56 +0200303 BuiltInNetworkBehaviorConfig pipe_config;
ivica5d6a06c2015-09-17 05:30:24 -0700304 pipe_config.loss_percent = flags::LossPercent();
philipel536378b2016-05-31 03:20:23 -0700305 pipe_config.avg_burst_loss_length = flags::AvgBurstLossLength();
ivica5d6a06c2015-09-17 05:30:24 -0700306 pipe_config.link_capacity_kbps = flags::LinkCapacityKbps();
307 pipe_config.queue_length_packets = flags::QueueSize();
308 pipe_config.queue_delay_ms = flags::AvgPropagationDelayMs();
309 pipe_config.delay_standard_deviation_ms = flags::StdPropagationDelayMs();
sprang1168fd42017-06-21 09:00:17 -0700310 pipe_config.allow_reordering = flags::FLAG_allow_reordering;
ivica5d6a06c2015-09-17 05:30:24 -0700311
Sebastian Janssonfc8d26b2018-02-21 09:52:06 +0100312 BitrateConstraints call_bitrate_config;
ivica5d6a06c2015-09-17 05:30:24 -0700313 call_bitrate_config.min_bitrate_bps = flags::MinBitrateKbps() * 1000;
314 call_bitrate_config.start_bitrate_bps = flags::StartBitrateKbps() * 1000;
Erik Språng28bb3912018-07-11 16:06:55 +0200315 call_bitrate_config.max_bitrate_bps = -1; // Don't cap bandwidth estimate.
ivica5d6a06c2015-09-17 05:30:24 -0700316
minyue73208662016-08-18 06:28:55 -0700317 VideoQualityTest::Params params;
philipel569397f2018-09-26 12:25:31 +0200318 params.call = {flags::FLAG_send_side_bwe, flags::FLAG_generic_descriptor,
319 call_bitrate_config, 0};
Ilya Nikolaevskiy255d1cd2017-12-21 18:02:59 +0100320 params.video[0] = {flags::FLAG_video,
321 flags::Width(),
322 flags::Height(),
323 flags::Fps(),
324 flags::MinBitrateKbps() * 1000,
325 flags::TargetBitrateKbps() * 1000,
326 flags::MaxBitrateKbps() * 1000,
327 flags::FLAG_suspend_below_min_bitrate,
328 flags::Codec(),
329 flags::NumTemporalLayers(),
330 flags::SelectedTL(),
331 0, // No min transmit bitrate.
332 flags::FLAG_use_ulpfec,
333 flags::FLAG_use_flexfec,
Niels Möller6aa415e2018-06-07 11:14:13 +0200334 false,
Ilya Nikolaevskiy255d1cd2017-12-21 18:02:59 +0100335 flags::Clip(),
336 flags::GetCaptureDevice()};
sprang1168fd42017-06-21 09:00:17 -0700337 params.audio = {flags::FLAG_audio, flags::FLAG_audio_video_sync,
henrika255750b2018-08-27 16:13:37 +0200338 flags::FLAG_audio_dtx, flags::FLAG_use_real_adm};
Mirko Bonadei45a4c412018-07-31 15:07:28 +0200339 params.logging = {flags::FLAG_rtc_event_log_name, flags::FLAG_rtp_dump_name,
340 flags::FLAG_encoded_frame_path};
Ilya Nikolaevskiy255d1cd2017-12-21 18:02:59 +0100341 params.screenshare[0].enabled = false;
Yves Gerey665174f2018-06-19 15:03:05 +0200342 params.analyzer = {"video",
343 0.0,
344 0.0,
345 flags::DurationSecs(),
346 flags::OutputFilename(),
347 flags::GraphTitle()};
Artem Titovf18b3522018-08-28 16:54:24 +0200348 params.config = pipe_config;
sprang1168fd42017-06-21 09:00:17 -0700349
350 if (flags::NumStreams() > 1 && flags::Stream0().empty() &&
351 flags::Stream1().empty()) {
Ilya Nikolaevskiy255d1cd2017-12-21 18:02:59 +0100352 params.ss[0].infer_streams = true;
sprang1168fd42017-06-21 09:00:17 -0700353 }
ivica5d6a06c2015-09-17 05:30:24 -0700354
sprangce4aef12015-11-02 07:23:20 -0800355 std::vector<std::string> stream_descriptors;
356 stream_descriptors.push_back(flags::Stream0());
357 stream_descriptors.push_back(flags::Stream1());
358 std::vector<std::string> SL_descriptors;
359 SL_descriptors.push_back(flags::SL0());
360 SL_descriptors.push_back(flags::SL1());
361 VideoQualityTest::FillScalabilitySettings(
Ilya Nikolaevskiy255d1cd2017-12-21 18:02:59 +0100362 &params, 0, stream_descriptors, flags::NumStreams(),
363 flags::SelectedStream(), flags::NumSpatialLayers(), flags::SelectedSL(),
Sergey Silkin57027362018-05-15 09:12:05 +0200364 flags::InterLayerPred(), SL_descriptors);
sprangce4aef12015-11-02 07:23:20 -0800365
Karl Wiberg918f50c2018-07-05 11:40:33 +0200366 auto fixture = absl::make_unique<VideoQualityTest>(nullptr);
sprangce4aef12015-11-02 07:23:20 -0800367 if (flags::DurationSecs()) {
Patrik Höglundb6b29e02018-06-21 16:58:01 +0200368 fixture->RunWithAnalyzer(params);
sprangce4aef12015-11-02 07:23:20 -0800369 } else {
Patrik Höglundb6b29e02018-06-21 16:58:01 +0200370 fixture->RunWithRenderers(params);
sprangce4aef12015-11-02 07:23:20 -0800371 }
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000372}
373} // namespace webrtc
374
375int main(int argc, char* argv[]) {
376 ::testing::InitGoogleTest(&argc, argv);
sprang1168fd42017-06-21 09:00:17 -0700377 rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, true);
378 if (webrtc::flags::FLAG_help) {
379 rtc::FlagList::Print(nullptr, false);
380 return 0;
381 }
382
Mirko Bonadei45a4c412018-07-31 15:07:28 +0200383 rtc::LogMessage::SetLogToStderr(webrtc::flags::FLAG_logs);
384
Bjorn Tereliusedab3012018-01-31 17:23:40 +0100385 webrtc::test::ValidateFieldTrialsStringOrDie(
386 webrtc::flags::FLAG_force_fieldtrials);
387 // InitFieldTrialsFromString stores the char*, so the char array must outlive
388 // the application.
389 webrtc::field_trial::InitFieldTrialsFromString(
390 webrtc::flags::FLAG_force_fieldtrials);
sprang89c4a7e2017-06-30 13:27:40 -0700391
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000392 webrtc::test::RunTest(webrtc::Loopback);
393 return 0;
394}