blob: fc10fc3926bfdbd7bcc99ed306415c4c39b70a15 [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>
Jonas Olsson5b2eda42019-06-11 14:29:40 +020012
Yves Gerey3e707812018-11-28 16:47:49 +010013#include <memory>
14#include <string>
15#include <vector>
sprang@webrtc.org131bea82015-02-18 12:46:06 +000016
Yves Gerey3e707812018-11-28 16:47:49 +010017#include "absl/memory/memory.h"
18#include "absl/types/optional.h"
19#include "api/bitrate_constraints.h"
20#include "api/test/simulated_network.h"
21#include "api/test/video_quality_test_fixture.h"
22#include "api/video_codecs/video_codec.h"
23#include "rtc_base/checks.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020024#include "rtc_base/flags.h"
Mirko Bonadei45a4c412018-07-31 15:07:28 +020025#include "rtc_base/logging.h"
Steve Anton10542f22019-01-11 09:11:00 -080026#include "rtc_base/string_encode.h"
Mirko Bonadei17f48782018-09-28 08:51:10 +020027#include "system_wrappers/include/field_trial.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020028#include "test/field_trial.h"
29#include "test/gtest.h"
30#include "test/run_test.h"
31#include "video/video_quality_test.h"
sprang@webrtc.org131bea82015-02-18 12:46:06 +000032
33namespace webrtc {
34namespace flags {
35
sprangce4aef12015-11-02 07:23:20 -080036// Flags common with video loopback, with different default values.
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020037WEBRTC_DEFINE_int(width, 1850, "Video width (crops source).");
sprang@webrtc.org131bea82015-02-18 12:46:06 +000038size_t Width() {
kjellander12fa8f42017-05-17 11:19:58 -070039 return static_cast<size_t>(FLAG_width);
sprang@webrtc.org131bea82015-02-18 12:46:06 +000040}
sprangd6358952015-07-29 07:58:13 -070041
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020042WEBRTC_DEFINE_int(height, 1110, "Video height (crops source).");
sprang@webrtc.org131bea82015-02-18 12:46:06 +000043size_t Height() {
kjellander12fa8f42017-05-17 11:19:58 -070044 return static_cast<size_t>(FLAG_height);
sprang@webrtc.org131bea82015-02-18 12:46:06 +000045}
46
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020047WEBRTC_DEFINE_int(fps, 5, "Frames per second.");
sprang@webrtc.org131bea82015-02-18 12:46:06 +000048int Fps() {
kjellander12fa8f42017-05-17 11:19:58 -070049 return static_cast<int>(FLAG_fps);
sprang@webrtc.org131bea82015-02-18 12:46:06 +000050}
51
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020052WEBRTC_DEFINE_int(min_bitrate, 50, "Call and stream min bitrate in kbps.");
ivica5d6a06c2015-09-17 05:30:24 -070053int MinBitrateKbps() {
kjellander12fa8f42017-05-17 11:19:58 -070054 return static_cast<int>(FLAG_min_bitrate);
sprang@webrtc.org131bea82015-02-18 12:46:06 +000055}
56
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020057WEBRTC_DEFINE_int(start_bitrate, 300, "Call start bitrate in kbps.");
ivica5d6a06c2015-09-17 05:30:24 -070058int StartBitrateKbps() {
kjellander12fa8f42017-05-17 11:19:58 -070059 return static_cast<int>(FLAG_start_bitrate);
sprang@webrtc.org131bea82015-02-18 12:46:06 +000060}
61
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020062WEBRTC_DEFINE_int(target_bitrate, 200, "Stream target bitrate in kbps.");
ivica5d6a06c2015-09-17 05:30:24 -070063int TargetBitrateKbps() {
kjellander12fa8f42017-05-17 11:19:58 -070064 return static_cast<int>(FLAG_target_bitrate);
ivica5d6a06c2015-09-17 05:30:24 -070065}
66
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020067WEBRTC_DEFINE_int(max_bitrate, 1000, "Call and stream max bitrate in kbps.");
ivica5d6a06c2015-09-17 05:30:24 -070068int MaxBitrateKbps() {
kjellander12fa8f42017-05-17 11:19:58 -070069 return static_cast<int>(FLAG_max_bitrate);
sprang@webrtc.org131bea82015-02-18 12:46:06 +000070}
71
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020072WEBRTC_DEFINE_int(num_temporal_layers, 2, "Number of temporal layers to use.");
sprangce4aef12015-11-02 07:23:20 -080073int NumTemporalLayers() {
kjellander12fa8f42017-05-17 11:19:58 -070074 return static_cast<int>(FLAG_num_temporal_layers);
ivica87f83a92015-10-08 05:13:32 -070075}
76
sprangce4aef12015-11-02 07:23:20 -080077// Flags common with video loopback, with equal default values.
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020078WEBRTC_DEFINE_string(codec, "VP8", "Video codec to use.");
sprang7a975f72015-10-12 06:33:21 -070079std::string Codec() {
kjellander12fa8f42017-05-17 11:19:58 -070080 return static_cast<std::string>(FLAG_codec);
ivica87f83a92015-10-08 05:13:32 -070081}
82
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020083WEBRTC_DEFINE_string(rtc_event_log_name,
84 "",
85 "Filename for rtc event log. Two files "
86 "with \"_send\" and \"_recv\" suffixes will be created.");
ilnik98436952017-07-13 00:47:03 -070087std::string RtcEventLogName() {
88 return static_cast<std::string>(FLAG_rtc_event_log_name);
89}
90
Mirko Bonadei2dfa9982018-10-18 11:35:32 +020091WEBRTC_DEFINE_string(rtp_dump_name,
92 "",
93 "Filename for dumped received RTP stream.");
ilnik98436952017-07-13 00:47:03 -070094std::string RtpDumpName() {
95 return static_cast<std::string>(FLAG_rtp_dump_name);
96}
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() {
kjellander12fa8f42017-05-17 11:19:58 -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() {
kjellander12fa8f42017-05-17 11:19:58 -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() {
kjellander12fa8f42017-05-17 11:19:58 -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() {
kjellander12fa8f42017-05-17 11:19:58 -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() {
kjellander12fa8f42017-05-17 11:19:58 -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(link_capacity,
132 0,
133 "Capacity (kbps) of the fake link. 0 means infinite.");
ivica5d6a06c2015-09-17 05:30:24 -0700134int LinkCapacityKbps() {
kjellander12fa8f42017-05-17 11:19:58 -0700135 return static_cast<int>(FLAG_link_capacity);
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000136}
137
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200138WEBRTC_DEFINE_int(queue_size,
139 0,
140 "Size of the bottleneck link queue in packets.");
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000141int QueueSize() {
kjellander12fa8f42017-05-17 11:19:58 -0700142 return static_cast<int>(FLAG_queue_size);
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000143}
144
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200145WEBRTC_DEFINE_int(avg_propagation_delay_ms,
146 0,
147 "Average link propagation delay in ms.");
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000148int AvgPropagationDelayMs() {
kjellander12fa8f42017-05-17 11:19:58 -0700149 return static_cast<int>(FLAG_avg_propagation_delay_ms);
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000150}
151
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200152WEBRTC_DEFINE_int(std_propagation_delay_ms,
153 0,
154 "Link propagation delay standard deviation in ms.");
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000155int StdPropagationDelayMs() {
kjellander12fa8f42017-05-17 11:19:58 -0700156 return static_cast<int>(FLAG_std_propagation_delay_ms);
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000157}
158
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200159WEBRTC_DEFINE_int(num_streams, 0, "Number of streams to show or analyze.");
sprang1168fd42017-06-21 09:00:17 -0700160int NumStreams() {
161 return static_cast<int>(FLAG_num_streams);
162}
163
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200164WEBRTC_DEFINE_int(selected_stream,
165 0,
166 "ID of the stream to show or analyze. "
167 "Set to the number of streams to show them all.");
sprangce4aef12015-11-02 07:23:20 -0800168int SelectedStream() {
kjellander12fa8f42017-05-17 11:19:58 -0700169 return static_cast<int>(FLAG_selected_stream);
sprangce4aef12015-11-02 07:23:20 -0800170}
171
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200172WEBRTC_DEFINE_int(num_spatial_layers, 1, "Number of spatial layers to use.");
sprangce4aef12015-11-02 07:23:20 -0800173int NumSpatialLayers() {
kjellander12fa8f42017-05-17 11:19:58 -0700174 return static_cast<int>(FLAG_num_spatial_layers);
sprangce4aef12015-11-02 07:23:20 -0800175}
176
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200177WEBRTC_DEFINE_int(
178 inter_layer_pred,
179 0,
180 "Inter-layer prediction mode. "
181 "0 - enabled, 1 - disabled, 2 - enabled only for key pictures.");
Sergey Silkin57027362018-05-15 09:12:05 +0200182InterLayerPredMode InterLayerPred() {
183 if (FLAG_inter_layer_pred == 0) {
184 return InterLayerPredMode::kOn;
185 } else if (FLAG_inter_layer_pred == 1) {
186 return InterLayerPredMode::kOff;
187 } else {
188 RTC_DCHECK_EQ(FLAG_inter_layer_pred, 2);
189 return InterLayerPredMode::kOnKeyPic;
190 }
191}
192
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200193WEBRTC_DEFINE_int(selected_sl,
194 -1,
195 "Spatial layer to show or analyze. -1 to disable filtering.");
sprangce4aef12015-11-02 07:23:20 -0800196int SelectedSL() {
kjellander12fa8f42017-05-17 11:19:58 -0700197 return static_cast<int>(FLAG_selected_sl);
sprangce4aef12015-11-02 07:23:20 -0800198}
199
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200200WEBRTC_DEFINE_string(
201 stream0,
202 "",
203 "Comma separated values describing VideoStream for stream #0.");
sprangce4aef12015-11-02 07:23:20 -0800204std::string Stream0() {
kjellander12fa8f42017-05-17 11:19:58 -0700205 return static_cast<std::string>(FLAG_stream0);
sprangce4aef12015-11-02 07:23:20 -0800206}
207
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200208WEBRTC_DEFINE_string(
209 stream1,
210 "",
211 "Comma separated values describing VideoStream for stream #1.");
sprangce4aef12015-11-02 07:23:20 -0800212std::string Stream1() {
kjellander12fa8f42017-05-17 11:19:58 -0700213 return static_cast<std::string>(FLAG_stream1);
sprangce4aef12015-11-02 07:23:20 -0800214}
215
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200216WEBRTC_DEFINE_string(
217 sl0,
218 "",
219 "Comma separated values describing SpatialLayer for layer #0.");
sprangce4aef12015-11-02 07:23:20 -0800220std::string SL0() {
kjellander12fa8f42017-05-17 11:19:58 -0700221 return static_cast<std::string>(FLAG_sl0);
sprangce4aef12015-11-02 07:23:20 -0800222}
223
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200224WEBRTC_DEFINE_string(
225 sl1,
226 "",
227 "Comma separated values describing SpatialLayer for layer #1.");
sprangce4aef12015-11-02 07:23:20 -0800228std::string SL1() {
kjellander12fa8f42017-05-17 11:19:58 -0700229 return static_cast<std::string>(FLAG_sl1);
sprangce4aef12015-11-02 07:23:20 -0800230}
231
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200232WEBRTC_DEFINE_string(
233 encoded_frame_path,
234 "",
235 "The base path for encoded frame logs. Created files will have "
236 "the form <encoded_frame_path>.<n>.(recv|send.<m>).ivf");
palmkviste75f2042016-09-28 06:19:48 -0700237std::string EncodedFramePath() {
kjellander12fa8f42017-05-17 11:19:58 -0700238 return static_cast<std::string>(FLAG_encoded_frame_path);
palmkviste75f2042016-09-28 06:19:48 -0700239}
240
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200241WEBRTC_DEFINE_bool(logs, false, "print logs to stderr");
ivica87f83a92015-10-08 05:13:32 -0700242
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200243WEBRTC_DEFINE_bool(send_side_bwe, true, "Use send-side bandwidth estimation");
Erik Språng6b8d3552015-09-24 15:06:57 +0200244
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200245WEBRTC_DEFINE_bool(generic_descriptor,
246 false,
247 "Use the generic frame descriptor.");
philipel569397f2018-09-26 12:25:31 +0200248
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200249WEBRTC_DEFINE_bool(allow_reordering, false, "Allow packet reordering to occur");
philipela2c55232016-01-26 08:41:53 -0800250
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200251WEBRTC_DEFINE_string(
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000252 force_fieldtrials,
253 "",
254 "Field trials control experimental feature code which can be forced. "
255 "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enable/"
256 " will assign the group Enable to field trial WebRTC-FooFeature. Multiple "
257 "trials are separated by \"/\"");
sprangce4aef12015-11-02 07:23:20 -0800258
259// Screenshare-specific flags.
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200260WEBRTC_DEFINE_int(min_transmit_bitrate,
261 400,
262 "Min transmit bitrate incl. padding.");
sprangce4aef12015-11-02 07:23:20 -0800263int MinTransmitBitrateKbps() {
kjellander12fa8f42017-05-17 11:19:58 -0700264 return FLAG_min_transmit_bitrate;
sprangce4aef12015-11-02 07:23:20 -0800265}
266
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200267WEBRTC_DEFINE_bool(
Yves Gerey665174f2018-06-19 15:03:05 +0200268 generate_slides,
269 false,
270 "Whether to use randomly generated slides or read them from files.");
erikvarga579de6f2017-08-29 09:12:57 -0700271bool GenerateSlides() {
272 return static_cast<int>(FLAG_generate_slides);
273}
274
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200275WEBRTC_DEFINE_int(slide_change_interval,
276 10,
277 "Interval (in seconds) between simulated slide changes.");
sprangce4aef12015-11-02 07:23:20 -0800278int SlideChangeInterval() {
kjellander12fa8f42017-05-17 11:19:58 -0700279 return static_cast<int>(FLAG_slide_change_interval);
sprangce4aef12015-11-02 07:23:20 -0800280}
281
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200282WEBRTC_DEFINE_int(
sprangce4aef12015-11-02 07:23:20 -0800283 scroll_duration,
284 0,
285 "Duration (in seconds) during which a slide will be scrolled into place.");
286int ScrollDuration() {
kjellander12fa8f42017-05-17 11:19:58 -0700287 return static_cast<int>(FLAG_scroll_duration);
sprangce4aef12015-11-02 07:23:20 -0800288}
289
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200290WEBRTC_DEFINE_string(
291 slides,
292 "",
293 "Comma-separated list of *.yuv files to display as slides.");
ilnik8d8185c2017-04-12 04:52:55 -0700294std::vector<std::string> Slides() {
295 std::vector<std::string> slides;
kjellander12fa8f42017-05-17 11:19:58 -0700296 std::string slides_list = FLAG_slides;
ilnik8d8185c2017-04-12 04:52:55 -0700297 rtc::tokenize(slides_list, ',', &slides);
298 return slides;
299}
300
Mirko Bonadei2dfa9982018-10-18 11:35:32 +0200301WEBRTC_DEFINE_bool(help, false, "prints this message");
kjellander12fa8f42017-05-17 11:19:58 -0700302
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000303} // namespace flags
304
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000305void Loopback() {
Artem Titov75e36472018-10-08 12:28:56 +0200306 BuiltInNetworkBehaviorConfig pipe_config;
ivica5d6a06c2015-09-17 05:30:24 -0700307 pipe_config.loss_percent = flags::LossPercent();
308 pipe_config.link_capacity_kbps = flags::LinkCapacityKbps();
309 pipe_config.queue_length_packets = flags::QueueSize();
310 pipe_config.queue_delay_ms = flags::AvgPropagationDelayMs();
311 pipe_config.delay_standard_deviation_ms = flags::StdPropagationDelayMs();
kjellander12fa8f42017-05-17 11:19:58 -0700312 pipe_config.allow_reordering = flags::FLAG_allow_reordering;
ivica5d6a06c2015-09-17 05:30:24 -0700313
Sebastian Janssonfc8d26b2018-02-21 09:52:06 +0100314 BitrateConstraints call_bitrate_config;
ivica5d6a06c2015-09-17 05:30:24 -0700315 call_bitrate_config.min_bitrate_bps = flags::MinBitrateKbps() * 1000;
316 call_bitrate_config.start_bitrate_bps = flags::StartBitrateKbps() * 1000;
Erik Språng28bb3912018-07-11 16:06:55 +0200317 call_bitrate_config.max_bitrate_bps = -1; // Don't cap bandwidth estimate.
ivica5d6a06c2015-09-17 05:30:24 -0700318
minyue73208662016-08-18 06:28:55 -0700319 VideoQualityTest::Params params;
philipel569397f2018-09-26 12:25:31 +0200320 params.call = {flags::FLAG_send_side_bwe, flags::FLAG_generic_descriptor,
321 call_bitrate_config};
Ilya Nikolaevskiy255d1cd2017-12-21 18:02:59 +0100322 params.video[0] = {true,
323 flags::Width(),
324 flags::Height(),
325 flags::Fps(),
326 flags::MinBitrateKbps() * 1000,
327 flags::TargetBitrateKbps() * 1000,
328 flags::MaxBitrateKbps() * 1000,
329 false,
330 flags::Codec(),
331 flags::NumTemporalLayers(),
332 flags::SelectedTL(),
333 flags::MinTransmitBitrateKbps() * 1000,
334 false, // ULPFEC disabled.
335 false, // FlexFEC disabled.
Niels Möller6aa415e2018-06-07 11:14:13 +0200336 false, // Automatic scaling disabled.
Ilya Nikolaevskiy1f0a84a2019-02-05 14:35:33 +0100337 "",
338 0, // capture_device_index.
Ilya Nikolaevskiy85fc3252019-02-11 10:41:50 +0100339 SdpVideoFormat::Parameters()};
Ilya Nikolaevskiy255d1cd2017-12-21 18:02:59 +0100340 params.screenshare[0] = {true, flags::GenerateSlides(),
341 flags::SlideChangeInterval(),
342 flags::ScrollDuration(), flags::Slides()};
Yves Gerey665174f2018-06-19 15:03:05 +0200343 params.analyzer = {"screenshare",
344 0.0,
345 0.0,
346 flags::DurationSecs(),
347 flags::OutputFilename(),
348 flags::GraphTitle()};
Artem Titovf18b3522018-08-28 16:54:24 +0200349 params.config = pipe_config;
Mirko Bonadei45a4c412018-07-31 15:07:28 +0200350 params.logging = {flags::RtcEventLogName(), flags::RtpDumpName(),
351 flags::EncodedFramePath()};
ivica5d6a06c2015-09-17 05:30:24 -0700352
sprang1168fd42017-06-21 09:00:17 -0700353 if (flags::NumStreams() > 1 && flags::Stream0().empty() &&
354 flags::Stream1().empty()) {
Ilya Nikolaevskiy255d1cd2017-12-21 18:02:59 +0100355 params.ss[0].infer_streams = true;
sprang1168fd42017-06-21 09:00:17 -0700356 }
357
sprangce4aef12015-11-02 07:23:20 -0800358 std::vector<std::string> stream_descriptors;
359 stream_descriptors.push_back(flags::Stream0());
360 stream_descriptors.push_back(flags::Stream1());
361 std::vector<std::string> SL_descriptors;
362 SL_descriptors.push_back(flags::SL0());
363 SL_descriptors.push_back(flags::SL1());
364 VideoQualityTest::FillScalabilitySettings(
Ilya Nikolaevskiy255d1cd2017-12-21 18:02:59 +0100365 &params, 0, stream_descriptors, flags::NumStreams(),
366 flags::SelectedStream(), flags::NumSpatialLayers(), flags::SelectedSL(),
Sergey Silkin57027362018-05-15 09:12:05 +0200367 flags::InterLayerPred(), SL_descriptors);
sprangce4aef12015-11-02 07:23:20 -0800368
Karl Wiberg918f50c2018-07-05 11:40:33 +0200369 auto fixture = absl::make_unique<VideoQualityTest>(nullptr);
sprangce4aef12015-11-02 07:23:20 -0800370 if (flags::DurationSecs()) {
Patrik Höglundb6b29e02018-06-21 16:58:01 +0200371 fixture->RunWithAnalyzer(params);
sprangce4aef12015-11-02 07:23:20 -0800372 } else {
Patrik Höglundb6b29e02018-06-21 16:58:01 +0200373 fixture->RunWithRenderers(params);
sprangce4aef12015-11-02 07:23:20 -0800374 }
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000375}
376} // namespace webrtc
377
378int main(int argc, char* argv[]) {
379 ::testing::InitGoogleTest(&argc, argv);
kjellander12fa8f42017-05-17 11:19:58 -0700380 rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, true);
381 if (webrtc::flags::FLAG_help) {
382 rtc::FlagList::Print(nullptr, false);
383 return 0;
384 }
385
Mirko Bonadei45a4c412018-07-31 15:07:28 +0200386 rtc::LogMessage::SetLogToStderr(webrtc::flags::FLAG_logs);
387
Bjorn Tereliusedab3012018-01-31 17:23:40 +0100388 // InitFieldTrialsFromString stores the char*, so the char array must outlive
389 // the application.
390 webrtc::field_trial::InitFieldTrialsFromString(
391 webrtc::flags::FLAG_force_fieldtrials);
sprang89c4a7e2017-06-30 13:27:40 -0700392
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000393 webrtc::test::RunTest(webrtc::Loopback);
394 return 0;
395}