blob: 239e472f6e99f6bb8e6fe42224b1d80422aed3c9 [file] [log] [blame]
sprang@webrtc.org131bea82015-02-18 12:46:061/*
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 12:29:4012
Yves Gerey3e707812018-11-28 15:47:4913#include <memory>
14#include <string>
15#include <vector>
sprang@webrtc.org131bea82015-02-18 12:46:0616
Mirko Bonadei2ab97f62019-07-18 11:44:1217#include "absl/flags/flag.h"
18#include "absl/flags/parse.h"
Yves Gerey3e707812018-11-28 15:47:4919#include "absl/types/optional.h"
Yves Gerey3e707812018-11-28 15:47:4920#include "api/test/simulated_network.h"
21#include "api/test/video_quality_test_fixture.h"
Mirko Bonadei738bfa72019-09-17 12:47:3822#include "api/transport/bitrate_settings.h"
Yves Gerey3e707812018-11-28 15:47:4923#include "api/video_codecs/video_codec.h"
24#include "rtc_base/checks.h"
Mirko Bonadei45a4c412018-07-31 13:07:2825#include "rtc_base/logging.h"
Steve Anton10542f22019-01-11 17:11:0026#include "rtc_base/string_encode.h"
Mirko Bonadei17f48782018-09-28 06:51:1027#include "system_wrappers/include/field_trial.h"
Mirko Bonadei92ea95e2017-09-15 04:47:3128#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:0632
Mirko Bonadei2ab97f62019-07-18 11:44:1233using ::webrtc::BitrateConstraints;
34using ::webrtc::BuiltInNetworkBehaviorConfig;
35using ::webrtc::InterLayerPredMode;
36using ::webrtc::SdpVideoFormat;
37using ::webrtc::VideoQualityTest;
sprang@webrtc.org131bea82015-02-18 12:46:0638
sprangce4aef12015-11-02 15:23:2039// Flags common with video loopback, with different default values.
Mirko Bonadei2ab97f62019-07-18 11:44:1240ABSL_FLAG(int, width, 1850, "Video width (crops source).");
sprang@webrtc.org131bea82015-02-18 12:46:0641size_t Width() {
Mirko Bonadei2ab97f62019-07-18 11:44:1242 return static_cast<size_t>(absl::GetFlag(FLAGS_width));
sprang@webrtc.org131bea82015-02-18 12:46:0643}
sprangd6358952015-07-29 14:58:1344
Mirko Bonadei2ab97f62019-07-18 11:44:1245ABSL_FLAG(int, height, 1110, "Video height (crops source).");
sprang@webrtc.org131bea82015-02-18 12:46:0646size_t Height() {
Mirko Bonadei2ab97f62019-07-18 11:44:1247 return static_cast<size_t>(absl::GetFlag(FLAGS_height));
sprang@webrtc.org131bea82015-02-18 12:46:0648}
49
Mirko Bonadei2ab97f62019-07-18 11:44:1250ABSL_FLAG(int, fps, 5, "Frames per second.");
sprang@webrtc.org131bea82015-02-18 12:46:0651int Fps() {
Mirko Bonadei2ab97f62019-07-18 11:44:1252 return absl::GetFlag(FLAGS_fps);
sprang@webrtc.org131bea82015-02-18 12:46:0653}
54
Mirko Bonadei2ab97f62019-07-18 11:44:1255ABSL_FLAG(int, min_bitrate, 50, "Call and stream min bitrate in kbps.");
ivica5d6a06c2015-09-17 12:30:2456int MinBitrateKbps() {
Mirko Bonadei2ab97f62019-07-18 11:44:1257 return absl::GetFlag(FLAGS_min_bitrate);
sprang@webrtc.org131bea82015-02-18 12:46:0658}
59
Mirko Bonadei2ab97f62019-07-18 11:44:1260ABSL_FLAG(int, start_bitrate, 300, "Call start bitrate in kbps.");
ivica5d6a06c2015-09-17 12:30:2461int StartBitrateKbps() {
Mirko Bonadei2ab97f62019-07-18 11:44:1262 return absl::GetFlag(FLAGS_start_bitrate);
sprang@webrtc.org131bea82015-02-18 12:46:0663}
64
Mirko Bonadei2ab97f62019-07-18 11:44:1265ABSL_FLAG(int, target_bitrate, 200, "Stream target bitrate in kbps.");
ivica5d6a06c2015-09-17 12:30:2466int TargetBitrateKbps() {
Mirko Bonadei2ab97f62019-07-18 11:44:1267 return absl::GetFlag(FLAGS_target_bitrate);
ivica5d6a06c2015-09-17 12:30:2468}
69
Mirko Bonadei2ab97f62019-07-18 11:44:1270ABSL_FLAG(int, max_bitrate, 1000, "Call and stream max bitrate in kbps.");
ivica5d6a06c2015-09-17 12:30:2471int MaxBitrateKbps() {
Mirko Bonadei2ab97f62019-07-18 11:44:1272 return absl::GetFlag(FLAGS_max_bitrate);
sprang@webrtc.org131bea82015-02-18 12:46:0673}
74
Mirko Bonadei2ab97f62019-07-18 11:44:1275ABSL_FLAG(int, num_temporal_layers, 2, "Number of temporal layers to use.");
sprangce4aef12015-11-02 15:23:2076int NumTemporalLayers() {
Mirko Bonadei2ab97f62019-07-18 11:44:1277 return absl::GetFlag(FLAGS_num_temporal_layers);
ivica87f83a92015-10-08 12:13:3278}
79
sprangce4aef12015-11-02 15:23:2080// Flags common with video loopback, with equal default values.
Mirko Bonadei2ab97f62019-07-18 11:44:1281ABSL_FLAG(std::string, codec, "VP8", "Video codec to use.");
sprang7a975f72015-10-12 13:33:2182std::string Codec() {
Mirko Bonadei2ab97f62019-07-18 11:44:1283 return absl::GetFlag(FLAGS_codec);
ivica87f83a92015-10-08 12:13:3284}
85
Mirko Bonadei2ab97f62019-07-18 11:44:1286ABSL_FLAG(std::string,
87 rtc_event_log_name,
88 "",
89 "Filename for rtc event log. Two files "
90 "with \"_send\" and \"_recv\" suffixes will be created.");
ilnik98436952017-07-13 07:47:0391std::string RtcEventLogName() {
Mirko Bonadei2ab97f62019-07-18 11:44:1292 return absl::GetFlag(FLAGS_rtc_event_log_name);
ilnik98436952017-07-13 07:47:0393}
94
Mirko Bonadei2ab97f62019-07-18 11:44:1295ABSL_FLAG(std::string,
96 rtp_dump_name,
97 "",
98 "Filename for dumped received RTP stream.");
ilnik98436952017-07-13 07:47:0399std::string RtpDumpName() {
Mirko Bonadei2ab97f62019-07-18 11:44:12100 return absl::GetFlag(FLAGS_rtp_dump_name);
ilnik98436952017-07-13 07:47:03101}
102
Mirko Bonadei2ab97f62019-07-18 11:44:12103ABSL_FLAG(int,
104 selected_tl,
105 -1,
106 "Temporal layer to show or analyze. -1 to disable filtering.");
sprangce4aef12015-11-02 15:23:20107int SelectedTL() {
Mirko Bonadei2ab97f62019-07-18 11:44:12108 return absl::GetFlag(FLAGS_selected_tl);
sprangce4aef12015-11-02 15:23:20109}
110
Mirko Bonadei2ab97f62019-07-18 11:44:12111ABSL_FLAG(
112 int,
sprangce4aef12015-11-02 15:23:20113 duration,
114 0,
115 "Duration of the test in seconds. If 0, rendered will be shown instead.");
116int DurationSecs() {
Mirko Bonadei2ab97f62019-07-18 11:44:12117 return absl::GetFlag(FLAGS_duration);
sprangce4aef12015-11-02 15:23:20118}
119
Mirko Bonadei2ab97f62019-07-18 11:44:12120ABSL_FLAG(std::string, output_filename, "", "Target graph data filename.");
sprangce4aef12015-11-02 15:23:20121std::string OutputFilename() {
Mirko Bonadei2ab97f62019-07-18 11:44:12122 return absl::GetFlag(FLAGS_output_filename);
sprangce4aef12015-11-02 15:23:20123}
124
Mirko Bonadei2ab97f62019-07-18 11:44:12125ABSL_FLAG(std::string,
126 graph_title,
127 "",
128 "If empty, title will be generated automatically.");
sprangce4aef12015-11-02 15:23:20129std::string GraphTitle() {
Mirko Bonadei2ab97f62019-07-18 11:44:12130 return absl::GetFlag(FLAGS_graph_title);
sprangce4aef12015-11-02 15:23:20131}
132
Mirko Bonadei2ab97f62019-07-18 11:44:12133ABSL_FLAG(int, loss_percent, 0, "Percentage of packets randomly lost.");
sprang@webrtc.org131bea82015-02-18 12:46:06134int LossPercent() {
Mirko Bonadei2ab97f62019-07-18 11:44:12135 return absl::GetFlag(FLAGS_loss_percent);
sprang@webrtc.org131bea82015-02-18 12:46:06136}
137
Mirko Bonadei2ab97f62019-07-18 11:44:12138ABSL_FLAG(int,
139 link_capacity,
140 0,
141 "Capacity (kbps) of the fake link. 0 means infinite.");
ivica5d6a06c2015-09-17 12:30:24142int LinkCapacityKbps() {
Mirko Bonadei2ab97f62019-07-18 11:44:12143 return absl::GetFlag(FLAGS_link_capacity);
sprang@webrtc.org131bea82015-02-18 12:46:06144}
145
Mirko Bonadei2ab97f62019-07-18 11:44:12146ABSL_FLAG(int, queue_size, 0, "Size of the bottleneck link queue in packets.");
sprang@webrtc.org131bea82015-02-18 12:46:06147int QueueSize() {
Mirko Bonadei2ab97f62019-07-18 11:44:12148 return absl::GetFlag(FLAGS_queue_size);
sprang@webrtc.org131bea82015-02-18 12:46:06149}
150
Mirko Bonadei2ab97f62019-07-18 11:44:12151ABSL_FLAG(int,
152 avg_propagation_delay_ms,
153 0,
154 "Average link propagation delay in ms.");
sprang@webrtc.org131bea82015-02-18 12:46:06155int AvgPropagationDelayMs() {
Mirko Bonadei2ab97f62019-07-18 11:44:12156 return absl::GetFlag(FLAGS_avg_propagation_delay_ms);
sprang@webrtc.org131bea82015-02-18 12:46:06157}
158
Mirko Bonadei2ab97f62019-07-18 11:44:12159ABSL_FLAG(int,
160 std_propagation_delay_ms,
161 0,
162 "Link propagation delay standard deviation in ms.");
sprang@webrtc.org131bea82015-02-18 12:46:06163int StdPropagationDelayMs() {
Mirko Bonadei2ab97f62019-07-18 11:44:12164 return absl::GetFlag(FLAGS_std_propagation_delay_ms);
sprang@webrtc.org131bea82015-02-18 12:46:06165}
166
Mirko Bonadei2ab97f62019-07-18 11:44:12167ABSL_FLAG(int, num_streams, 0, "Number of streams to show or analyze.");
sprang1168fd42017-06-21 16:00:17168int NumStreams() {
Mirko Bonadei2ab97f62019-07-18 11:44:12169 return absl::GetFlag(FLAGS_num_streams);
sprang1168fd42017-06-21 16:00:17170}
171
Mirko Bonadei2ab97f62019-07-18 11:44:12172ABSL_FLAG(int,
173 selected_stream,
174 0,
175 "ID of the stream to show or analyze. "
176 "Set to the number of streams to show them all.");
sprangce4aef12015-11-02 15:23:20177int SelectedStream() {
Mirko Bonadei2ab97f62019-07-18 11:44:12178 return absl::GetFlag(FLAGS_selected_stream);
sprangce4aef12015-11-02 15:23:20179}
180
Mirko Bonadei2ab97f62019-07-18 11:44:12181ABSL_FLAG(int, num_spatial_layers, 1, "Number of spatial layers to use.");
sprangce4aef12015-11-02 15:23:20182int NumSpatialLayers() {
Mirko Bonadei2ab97f62019-07-18 11:44:12183 return absl::GetFlag(FLAGS_num_spatial_layers);
sprangce4aef12015-11-02 15:23:20184}
185
Mirko Bonadei2ab97f62019-07-18 11:44:12186ABSL_FLAG(int,
187 inter_layer_pred,
188 0,
189 "Inter-layer prediction mode. "
190 "0 - enabled, 1 - disabled, 2 - enabled only for key pictures.");
Sergey Silkin57027362018-05-15 07:12:05191InterLayerPredMode InterLayerPred() {
Mirko Bonadei2ab97f62019-07-18 11:44:12192 if (absl::GetFlag(FLAGS_inter_layer_pred) == 0) {
193 return webrtc::InterLayerPredMode::kOn;
194 } else if (absl::GetFlag(FLAGS_inter_layer_pred) == 1) {
195 return webrtc::InterLayerPredMode::kOff;
Sergey Silkin57027362018-05-15 07:12:05196 } else {
Mirko Bonadei2ab97f62019-07-18 11:44:12197 RTC_DCHECK_EQ(absl::GetFlag(FLAGS_inter_layer_pred), 2);
198 return webrtc::InterLayerPredMode::kOnKeyPic;
Sergey Silkin57027362018-05-15 07:12:05199 }
200}
201
Mirko Bonadei2ab97f62019-07-18 11:44:12202ABSL_FLAG(int,
203 selected_sl,
204 -1,
205 "Spatial layer to show or analyze. -1 to disable filtering.");
sprangce4aef12015-11-02 15:23:20206int SelectedSL() {
Mirko Bonadei2ab97f62019-07-18 11:44:12207 return absl::GetFlag(FLAGS_selected_sl);
sprangce4aef12015-11-02 15:23:20208}
209
Mirko Bonadei2ab97f62019-07-18 11:44:12210ABSL_FLAG(std::string,
211 stream0,
212 "",
213 "Comma separated values describing VideoStream for stream #0.");
sprangce4aef12015-11-02 15:23:20214std::string Stream0() {
Mirko Bonadei2ab97f62019-07-18 11:44:12215 return absl::GetFlag(FLAGS_stream0);
sprangce4aef12015-11-02 15:23:20216}
217
Mirko Bonadei2ab97f62019-07-18 11:44:12218ABSL_FLAG(std::string,
219 stream1,
220 "",
221 "Comma separated values describing VideoStream for stream #1.");
sprangce4aef12015-11-02 15:23:20222std::string Stream1() {
Mirko Bonadei2ab97f62019-07-18 11:44:12223 return absl::GetFlag(FLAGS_stream1);
sprangce4aef12015-11-02 15:23:20224}
225
Mirko Bonadei2ab97f62019-07-18 11:44:12226ABSL_FLAG(std::string,
227 sl0,
228 "",
229 "Comma separated values describing SpatialLayer for layer #0.");
sprangce4aef12015-11-02 15:23:20230std::string SL0() {
Mirko Bonadei2ab97f62019-07-18 11:44:12231 return absl::GetFlag(FLAGS_sl0);
sprangce4aef12015-11-02 15:23:20232}
233
Mirko Bonadei2ab97f62019-07-18 11:44:12234ABSL_FLAG(std::string,
235 sl1,
236 "",
237 "Comma separated values describing SpatialLayer for layer #1.");
sprangce4aef12015-11-02 15:23:20238std::string SL1() {
Mirko Bonadei2ab97f62019-07-18 11:44:12239 return absl::GetFlag(FLAGS_sl1);
sprangce4aef12015-11-02 15:23:20240}
241
Mirko Bonadei2ab97f62019-07-18 11:44:12242ABSL_FLAG(std::string,
243 encoded_frame_path,
244 "",
245 "The base path for encoded frame logs. Created files will have "
246 "the form <encoded_frame_path>.<n>.(recv|send.<m>).ivf");
palmkviste75f2042016-09-28 13:19:48247std::string EncodedFramePath() {
Mirko Bonadei2ab97f62019-07-18 11:44:12248 return absl::GetFlag(FLAGS_encoded_frame_path);
palmkviste75f2042016-09-28 13:19:48249}
250
Mirko Bonadei2ab97f62019-07-18 11:44:12251ABSL_FLAG(bool, logs, false, "print logs to stderr");
ivica87f83a92015-10-08 12:13:32252
Mirko Bonadei2ab97f62019-07-18 11:44:12253ABSL_FLAG(bool, send_side_bwe, true, "Use send-side bandwidth estimation");
Erik Språng6b8d3552015-09-24 13:06:57254
Mirko Bonadei2ab97f62019-07-18 11:44:12255ABSL_FLAG(bool, generic_descriptor, false, "Use the generic frame descriptor.");
philipel569397f2018-09-26 10:25:31256
Mirko Bonadei2ab97f62019-07-18 11:44:12257ABSL_FLAG(bool, allow_reordering, false, "Allow packet reordering to occur");
philipela2c55232016-01-26 16:41:53258
Mirko Bonadei2ab97f62019-07-18 11:44:12259ABSL_FLAG(
260 std::string,
sprang@webrtc.org131bea82015-02-18 12:46:06261 force_fieldtrials,
262 "",
263 "Field trials control experimental feature code which can be forced. "
264 "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enable/"
265 " will assign the group Enable to field trial WebRTC-FooFeature. Multiple "
266 "trials are separated by \"/\"");
sprangce4aef12015-11-02 15:23:20267
268// Screenshare-specific flags.
Mirko Bonadei2ab97f62019-07-18 11:44:12269ABSL_FLAG(int,
270 min_transmit_bitrate,
271 400,
272 "Min transmit bitrate incl. padding.");
sprangce4aef12015-11-02 15:23:20273int MinTransmitBitrateKbps() {
Mirko Bonadei2ab97f62019-07-18 11:44:12274 return absl::GetFlag(FLAGS_min_transmit_bitrate);
sprangce4aef12015-11-02 15:23:20275}
276
Mirko Bonadei2ab97f62019-07-18 11:44:12277ABSL_FLAG(bool,
278 generate_slides,
279 false,
280 "Whether to use randomly generated slides or read them from files.");
erikvarga579de6f2017-08-29 16:12:57281bool GenerateSlides() {
Mirko Bonadei2ab97f62019-07-18 11:44:12282 return absl::GetFlag(FLAGS_generate_slides);
erikvarga579de6f2017-08-29 16:12:57283}
284
Mirko Bonadei2ab97f62019-07-18 11:44:12285ABSL_FLAG(int,
286 slide_change_interval,
287 10,
288 "Interval (in seconds) between simulated slide changes.");
sprangce4aef12015-11-02 15:23:20289int SlideChangeInterval() {
Mirko Bonadei2ab97f62019-07-18 11:44:12290 return absl::GetFlag(FLAGS_slide_change_interval);
sprangce4aef12015-11-02 15:23:20291}
292
Mirko Bonadei2ab97f62019-07-18 11:44:12293ABSL_FLAG(
294 int,
sprangce4aef12015-11-02 15:23:20295 scroll_duration,
296 0,
297 "Duration (in seconds) during which a slide will be scrolled into place.");
298int ScrollDuration() {
Mirko Bonadei2ab97f62019-07-18 11:44:12299 return absl::GetFlag(FLAGS_scroll_duration);
sprangce4aef12015-11-02 15:23:20300}
301
Mirko Bonadei2ab97f62019-07-18 11:44:12302ABSL_FLAG(std::string,
303 slides,
304 "",
305 "Comma-separated list of *.yuv files to display as slides.");
ilnik8d8185c2017-04-12 11:52:55306std::vector<std::string> Slides() {
307 std::vector<std::string> slides;
Mirko Bonadei2ab97f62019-07-18 11:44:12308 std::string slides_list = absl::GetFlag(FLAGS_slides);
ilnik8d8185c2017-04-12 11:52:55309 rtc::tokenize(slides_list, ',', &slides);
310 return slides;
311}
312
sprang@webrtc.org131bea82015-02-18 12:46:06313void Loopback() {
Artem Titov75e36472018-10-08 10:28:56314 BuiltInNetworkBehaviorConfig pipe_config;
Mirko Bonadei2ab97f62019-07-18 11:44:12315 pipe_config.loss_percent = LossPercent();
316 pipe_config.link_capacity_kbps = LinkCapacityKbps();
317 pipe_config.queue_length_packets = QueueSize();
318 pipe_config.queue_delay_ms = AvgPropagationDelayMs();
319 pipe_config.delay_standard_deviation_ms = StdPropagationDelayMs();
320 pipe_config.allow_reordering = absl::GetFlag(FLAGS_allow_reordering);
ivica5d6a06c2015-09-17 12:30:24321
Sebastian Janssonfc8d26b2018-02-21 08:52:06322 BitrateConstraints call_bitrate_config;
Mirko Bonadei2ab97f62019-07-18 11:44:12323 call_bitrate_config.min_bitrate_bps = MinBitrateKbps() * 1000;
324 call_bitrate_config.start_bitrate_bps = StartBitrateKbps() * 1000;
Erik Språng28bb3912018-07-11 14:06:55325 call_bitrate_config.max_bitrate_bps = -1; // Don't cap bandwidth estimate.
ivica5d6a06c2015-09-17 12:30:24326
minyue73208662016-08-18 13:28:55327 VideoQualityTest::Params params;
Danil Chapovalov059f4f72020-07-07 12:16:47328 params.call.send_side_bwe = absl::GetFlag(FLAGS_send_side_bwe);
329 params.call.generic_descriptor = absl::GetFlag(FLAGS_generic_descriptor);
330 params.call.call_bitrate_config = call_bitrate_config;
331 params.video[0].enabled = true;
332 params.video[0].width = Width();
333 params.video[0].height = Height();
334 params.video[0].fps = Fps();
335 params.video[0].min_bitrate_bps = MinBitrateKbps() * 1000;
336 params.video[0].target_bitrate_bps = TargetBitrateKbps() * 1000;
337 params.video[0].max_bitrate_bps = MaxBitrateKbps() * 1000;
338 params.video[0].codec = Codec();
339 params.video[0].num_temporal_layers = NumTemporalLayers();
340 params.video[0].selected_tl = SelectedTL();
341 params.video[0].min_transmit_bps = MinTransmitBitrateKbps() * 1000;
342 params.screenshare[0].enabled = true;
343 params.screenshare[0].generate_slides = GenerateSlides();
344 params.screenshare[0].slide_change_interval = SlideChangeInterval();
345 params.screenshare[0].scroll_duration = ScrollDuration();
346 params.screenshare[0].slides = Slides();
Artem Titovf18b3522018-08-28 14:54:24347 params.config = pipe_config;
Danil Chapovalov059f4f72020-07-07 12:16:47348 params.logging.rtc_event_log_name = RtcEventLogName();
349 params.logging.rtp_dump_name = RtpDumpName();
350 params.logging.encoded_frame_base_path = EncodedFramePath();
ivica5d6a06c2015-09-17 12:30:24351
Mirko Bonadei2ab97f62019-07-18 11:44:12352 if (NumStreams() > 1 && Stream0().empty() && Stream1().empty()) {
Ilya Nikolaevskiy255d1cd2017-12-21 17:02:59353 params.ss[0].infer_streams = true;
sprang1168fd42017-06-21 16:00:17354 }
355
sprangce4aef12015-11-02 15:23:20356 std::vector<std::string> stream_descriptors;
Mirko Bonadei2ab97f62019-07-18 11:44:12357 stream_descriptors.push_back(Stream0());
358 stream_descriptors.push_back(Stream1());
sprangce4aef12015-11-02 15:23:20359 std::vector<std::string> SL_descriptors;
Mirko Bonadei2ab97f62019-07-18 11:44:12360 SL_descriptors.push_back(SL0());
361 SL_descriptors.push_back(SL1());
sprangce4aef12015-11-02 15:23:20362 VideoQualityTest::FillScalabilitySettings(
Mirko Bonadei2ab97f62019-07-18 11:44:12363 &params, 0, stream_descriptors, NumStreams(), SelectedStream(),
364 NumSpatialLayers(), SelectedSL(), InterLayerPred(), SL_descriptors);
sprangce4aef12015-11-02 15:23:20365
Mirko Bonadei317a1f02019-09-17 15:06:18366 auto fixture = std::make_unique<VideoQualityTest>(nullptr);
Mirko Bonadei2ab97f62019-07-18 11:44:12367 if (DurationSecs()) {
Patrik Höglundb6b29e02018-06-21 14:58:01368 fixture->RunWithAnalyzer(params);
sprangce4aef12015-11-02 15:23:20369 } else {
Patrik Höglundb6b29e02018-06-21 14:58:01370 fixture->RunWithRenderers(params);
sprangce4aef12015-11-02 15:23:20371 }
sprang@webrtc.org131bea82015-02-18 12:46:06372}
sprang@webrtc.org131bea82015-02-18 12:46:06373
374int main(int argc, char* argv[]) {
375 ::testing::InitGoogleTest(&argc, argv);
Mirko Bonadei2ab97f62019-07-18 11:44:12376 absl::ParseCommandLine(argc, argv);
kjellander12fa8f42017-05-17 18:19:58377
Mirko Bonadei2ab97f62019-07-18 11:44:12378 rtc::LogMessage::SetLogToStderr(absl::GetFlag(FLAGS_logs));
Mirko Bonadei45a4c412018-07-31 13:07:28379
Bjorn Tereliusedab3012018-01-31 16:23:40380 // InitFieldTrialsFromString stores the char*, so the char array must outlive
381 // the application.
Mirko Bonadei2ab97f62019-07-18 11:44:12382 const std::string field_trials = absl::GetFlag(FLAGS_force_fieldtrials);
383 webrtc::field_trial::InitFieldTrialsFromString(field_trials.c_str());
sprang89c4a7e2017-06-30 20:27:40384
Mirko Bonadei2ab97f62019-07-18 11:44:12385 webrtc::test::RunTest(Loopback);
sprang@webrtc.org131bea82015-02-18 12:46:06386 return 0;
387}