blob: 5080c63aec676ac34a2036d7e54049cfb0405d97 [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>
Yves Gerey3e707812018-11-28 15:47:4912#include <memory>
13#include <string>
14#include <vector>
sprang@webrtc.org131bea82015-02-18 12:46:0615
Yves Gerey3e707812018-11-28 15:47:4916#include "absl/memory/memory.h"
17#include "absl/types/optional.h"
18#include "api/bitrate_constraints.h"
19#include "api/test/simulated_network.h"
20#include "api/test/video_quality_test_fixture.h"
21#include "api/video_codecs/video_codec.h"
22#include "rtc_base/checks.h"
Mirko Bonadei92ea95e2017-09-15 04:47:3123#include "rtc_base/flags.h"
Mirko Bonadei45a4c412018-07-31 13:07:2824#include "rtc_base/logging.h"
Mirko Bonadei17f48782018-09-28 06:51:1025#include "system_wrappers/include/field_trial.h"
Mirko Bonadei92ea95e2017-09-15 04:47:3126#include "test/field_trial.h"
27#include "test/gtest.h"
28#include "test/run_test.h"
29#include "video/video_quality_test.h"
sprang@webrtc.org131bea82015-02-18 12:46:0630
31namespace webrtc {
sprang@webrtc.org131bea82015-02-18 12:46:0632namespace flags {
33
sprangce4aef12015-11-02 15:23:2034// Flags common with screenshare loopback, with different default values.
Mirko Bonadei2dfa9982018-10-18 09:35:3235WEBRTC_DEFINE_int(width, 640, "Video width.");
sprang@webrtc.org131bea82015-02-18 12:46:0636size_t Width() {
sprang1168fd42017-06-21 16:00:1737 return static_cast<size_t>(FLAG_width);
sprang@webrtc.org131bea82015-02-18 12:46:0638}
39
Mirko Bonadei2dfa9982018-10-18 09:35:3240WEBRTC_DEFINE_int(height, 480, "Video height.");
sprang@webrtc.org131bea82015-02-18 12:46:0641size_t Height() {
sprang1168fd42017-06-21 16:00:1742 return static_cast<size_t>(FLAG_height);
sprang@webrtc.org131bea82015-02-18 12:46:0643}
44
Mirko Bonadei2dfa9982018-10-18 09:35:3245WEBRTC_DEFINE_int(fps, 30, "Frames per second.");
sprang@webrtc.org131bea82015-02-18 12:46:0646int Fps() {
sprang1168fd42017-06-21 16:00:1747 return static_cast<int>(FLAG_fps);
sprang@webrtc.org131bea82015-02-18 12:46:0648}
49
Mirko Bonadei2dfa9982018-10-18 09:35:3250WEBRTC_DEFINE_int(capture_device_index, 0, "Capture device to select");
Tarun Chawla8e857d12017-05-31 13:50:5751size_t GetCaptureDevice() {
sprang1168fd42017-06-21 16:00:1752 return static_cast<size_t>(FLAG_capture_device_index);
Tarun Chawla8e857d12017-05-31 13:50:5753}
54
Mirko Bonadei2dfa9982018-10-18 09:35:3255WEBRTC_DEFINE_int(min_bitrate, 50, "Call and stream min bitrate in kbps.");
ivica5d6a06c2015-09-17 12:30:2456int MinBitrateKbps() {
sprang1168fd42017-06-21 16:00:1757 return static_cast<int>(FLAG_min_bitrate);
sprang@webrtc.org131bea82015-02-18 12:46:0658}
59
Mirko Bonadei2dfa9982018-10-18 09:35:3260WEBRTC_DEFINE_int(start_bitrate, 300, "Call start bitrate in kbps.");
ivica5d6a06c2015-09-17 12:30:2461int StartBitrateKbps() {
sprang1168fd42017-06-21 16:00:1762 return static_cast<int>(FLAG_start_bitrate);
sprang@webrtc.org131bea82015-02-18 12:46:0663}
64
Mirko Bonadei2dfa9982018-10-18 09:35:3265WEBRTC_DEFINE_int(target_bitrate, 800, "Stream target bitrate in kbps.");
ivica5d6a06c2015-09-17 12:30:2466int TargetBitrateKbps() {
sprang1168fd42017-06-21 16:00:1767 return static_cast<int>(FLAG_target_bitrate);
sprang@webrtc.org131bea82015-02-18 12:46:0668}
69
Mirko Bonadei2dfa9982018-10-18 09:35:3270WEBRTC_DEFINE_int(max_bitrate, 800, "Call and stream max bitrate in kbps.");
ivica5d6a06c2015-09-17 12:30:2471int MaxBitrateKbps() {
sprang1168fd42017-06-21 16:00:1772 return static_cast<int>(FLAG_max_bitrate);
ivica5d6a06c2015-09-17 12:30:2473}
sprang@webrtc.org131bea82015-02-18 12:46:0674
Mirko Bonadei2dfa9982018-10-18 09:35:3275WEBRTC_DEFINE_bool(suspend_below_min_bitrate,
76 false,
77 "Suspends video below the configured min bitrate.");
mflodman48a4beb2016-07-01 11:03:5978
Mirko Bonadei2dfa9982018-10-18 09:35:3279WEBRTC_DEFINE_int(num_temporal_layers,
80 1,
81 "Number of temporal layers. Set to 1-4 to override.");
sprangce4aef12015-11-02 15:23:2082int NumTemporalLayers() {
sprang1168fd42017-06-21 16:00:1783 return static_cast<int>(FLAG_num_temporal_layers);
sprangce4aef12015-11-02 15:23:2084}
85
Mirko Bonadei2dfa9982018-10-18 09:35:3286WEBRTC_DEFINE_int(
87 inter_layer_pred,
88 2,
89 "Inter-layer prediction mode. "
90 "0 - enabled, 1 - disabled, 2 - enabled only for key pictures.");
Sergey Silkin57027362018-05-15 07:12:0591InterLayerPredMode InterLayerPred() {
92 if (FLAG_inter_layer_pred == 0) {
93 return InterLayerPredMode::kOn;
94 } else if (FLAG_inter_layer_pred == 1) {
95 return InterLayerPredMode::kOff;
96 } else {
97 RTC_DCHECK_EQ(FLAG_inter_layer_pred, 2);
98 return InterLayerPredMode::kOnKeyPic;
99 }
100}
101
sprangce4aef12015-11-02 15:23:20102// Flags common with screenshare loopback, with equal default values.
Mirko Bonadei2dfa9982018-10-18 09:35:32103WEBRTC_DEFINE_string(codec, "VP8", "Video codec to use.");
sprang@webrtc.org131bea82015-02-18 12:46:06104std::string Codec() {
sprang1168fd42017-06-21 16:00:17105 return static_cast<std::string>(FLAG_codec);
sprang@webrtc.org131bea82015-02-18 12:46:06106}
107
Mirko Bonadei2dfa9982018-10-18 09:35:32108WEBRTC_DEFINE_int(
109 selected_tl,
110 -1,
111 "Temporal layer to show or analyze. -1 to disable filtering.");
sprangce4aef12015-11-02 15:23:20112int SelectedTL() {
sprang1168fd42017-06-21 16:00:17113 return static_cast<int>(FLAG_selected_tl);
sprangce4aef12015-11-02 15:23:20114}
115
Mirko Bonadei2dfa9982018-10-18 09:35:32116WEBRTC_DEFINE_int(
sprangce4aef12015-11-02 15:23:20117 duration,
118 0,
119 "Duration of the test in seconds. If 0, rendered will be shown instead.");
120int DurationSecs() {
sprang1168fd42017-06-21 16:00:17121 return static_cast<int>(FLAG_duration);
sprangce4aef12015-11-02 15:23:20122}
123
Mirko Bonadei2dfa9982018-10-18 09:35:32124WEBRTC_DEFINE_string(output_filename, "", "Target graph data filename.");
sprangce4aef12015-11-02 15:23:20125std::string OutputFilename() {
sprang1168fd42017-06-21 16:00:17126 return static_cast<std::string>(FLAG_output_filename);
sprangce4aef12015-11-02 15:23:20127}
128
Mirko Bonadei2dfa9982018-10-18 09:35:32129WEBRTC_DEFINE_string(graph_title,
130 "",
131 "If empty, title will be generated automatically.");
sprangce4aef12015-11-02 15:23:20132std::string GraphTitle() {
sprang1168fd42017-06-21 16:00:17133 return static_cast<std::string>(FLAG_graph_title);
sprangce4aef12015-11-02 15:23:20134}
135
Mirko Bonadei2dfa9982018-10-18 09:35:32136WEBRTC_DEFINE_int(loss_percent, 0, "Percentage of packets randomly lost.");
sprang@webrtc.org131bea82015-02-18 12:46:06137int LossPercent() {
sprang1168fd42017-06-21 16:00:17138 return static_cast<int>(FLAG_loss_percent);
sprang@webrtc.org131bea82015-02-18 12:46:06139}
140
Mirko Bonadei2dfa9982018-10-18 09:35:32141WEBRTC_DEFINE_int(avg_burst_loss_length,
142 -1,
143 "Average burst length of lost packets.");
philipel536378b2016-05-31 10:20:23144int AvgBurstLossLength() {
sprang1168fd42017-06-21 16:00:17145 return static_cast<int>(FLAG_avg_burst_loss_length);
philipel536378b2016-05-31 10:20:23146}
147
Mirko Bonadei2dfa9982018-10-18 09:35:32148WEBRTC_DEFINE_int(link_capacity,
149 0,
150 "Capacity (kbps) of the fake link. 0 means infinite.");
ivica5d6a06c2015-09-17 12:30:24151int LinkCapacityKbps() {
sprang1168fd42017-06-21 16:00:17152 return static_cast<int>(FLAG_link_capacity);
sprang@webrtc.org131bea82015-02-18 12:46:06153}
154
Mirko Bonadei2dfa9982018-10-18 09:35:32155WEBRTC_DEFINE_int(queue_size,
156 0,
157 "Size of the bottleneck link queue in packets.");
sprang@webrtc.org131bea82015-02-18 12:46:06158int QueueSize() {
sprang1168fd42017-06-21 16:00:17159 return static_cast<int>(FLAG_queue_size);
sprang@webrtc.org131bea82015-02-18 12:46:06160}
161
Mirko Bonadei2dfa9982018-10-18 09:35:32162WEBRTC_DEFINE_int(avg_propagation_delay_ms,
163 0,
164 "Average link propagation delay in ms.");
sprang@webrtc.org131bea82015-02-18 12:46:06165int AvgPropagationDelayMs() {
sprang1168fd42017-06-21 16:00:17166 return static_cast<int>(FLAG_avg_propagation_delay_ms);
sprang@webrtc.org131bea82015-02-18 12:46:06167}
168
Mirko Bonadei2dfa9982018-10-18 09:35:32169WEBRTC_DEFINE_string(rtc_event_log_name,
170 "",
171 "Filename for rtc event log. Two files "
172 "with \"_send\" and \"_recv\" suffixes will be created.");
ilnik98436952017-07-13 07:47:03173std::string RtcEventLogName() {
174 return static_cast<std::string>(FLAG_rtc_event_log_name);
175}
176
Mirko Bonadei2dfa9982018-10-18 09:35:32177WEBRTC_DEFINE_string(rtp_dump_name,
178 "",
179 "Filename for dumped received RTP stream.");
ilnik98436952017-07-13 07:47:03180std::string RtpDumpName() {
181 return static_cast<std::string>(FLAG_rtp_dump_name);
182}
183
Mirko Bonadei2dfa9982018-10-18 09:35:32184WEBRTC_DEFINE_int(std_propagation_delay_ms,
185 0,
186 "Link propagation delay standard deviation in ms.");
sprang@webrtc.org131bea82015-02-18 12:46:06187int StdPropagationDelayMs() {
sprang1168fd42017-06-21 16:00:17188 return static_cast<int>(FLAG_std_propagation_delay_ms);
sprang@webrtc.org131bea82015-02-18 12:46:06189}
190
Mirko Bonadei2dfa9982018-10-18 09:35:32191WEBRTC_DEFINE_int(num_streams, 0, "Number of streams to show or analyze.");
sprang1168fd42017-06-21 16:00:17192int NumStreams() {
193 return static_cast<int>(FLAG_num_streams);
194}
195
Mirko Bonadei2dfa9982018-10-18 09:35:32196WEBRTC_DEFINE_int(selected_stream,
197 0,
198 "ID of the stream to show or analyze. "
199 "Set to the number of streams to show them all.");
sprangce4aef12015-11-02 15:23:20200int SelectedStream() {
sprang1168fd42017-06-21 16:00:17201 return static_cast<int>(FLAG_selected_stream);
sprangce4aef12015-11-02 15:23:20202}
203
Mirko Bonadei2dfa9982018-10-18 09:35:32204WEBRTC_DEFINE_int(num_spatial_layers, 1, "Number of spatial layers to use.");
sprangce4aef12015-11-02 15:23:20205int NumSpatialLayers() {
sprang1168fd42017-06-21 16:00:17206 return static_cast<int>(FLAG_num_spatial_layers);
sprangce4aef12015-11-02 15:23:20207}
208
Mirko Bonadei2dfa9982018-10-18 09:35:32209WEBRTC_DEFINE_int(selected_sl,
210 -1,
211 "Spatial layer to show or analyze. -1 to disable filtering.");
sprangce4aef12015-11-02 15:23:20212int SelectedSL() {
sprang1168fd42017-06-21 16:00:17213 return static_cast<int>(FLAG_selected_sl);
sprangce4aef12015-11-02 15:23:20214}
215
Mirko Bonadei2dfa9982018-10-18 09:35:32216WEBRTC_DEFINE_string(
217 stream0,
218 "",
219 "Comma separated values describing VideoStream for stream #0.");
sprangce4aef12015-11-02 15:23:20220std::string Stream0() {
sprang1168fd42017-06-21 16:00:17221 return static_cast<std::string>(FLAG_stream0);
sprangce4aef12015-11-02 15:23:20222}
223
Mirko Bonadei2dfa9982018-10-18 09:35:32224WEBRTC_DEFINE_string(
225 stream1,
226 "",
227 "Comma separated values describing VideoStream for stream #1.");
sprangce4aef12015-11-02 15:23:20228std::string Stream1() {
sprang1168fd42017-06-21 16:00:17229 return static_cast<std::string>(FLAG_stream1);
sprangce4aef12015-11-02 15:23:20230}
231
Mirko Bonadei2dfa9982018-10-18 09:35:32232WEBRTC_DEFINE_string(
233 sl0,
234 "",
235 "Comma separated values describing SpatialLayer for layer #0.");
sprangce4aef12015-11-02 15:23:20236std::string SL0() {
sprang1168fd42017-06-21 16:00:17237 return static_cast<std::string>(FLAG_sl0);
sprangce4aef12015-11-02 15:23:20238}
239
Mirko Bonadei2dfa9982018-10-18 09:35:32240WEBRTC_DEFINE_string(
241 sl1,
242 "",
243 "Comma separated values describing SpatialLayer for layer #1.");
sprangce4aef12015-11-02 15:23:20244std::string SL1() {
sprang1168fd42017-06-21 16:00:17245 return static_cast<std::string>(FLAG_sl1);
sprangce4aef12015-11-02 15:23:20246}
247
Mirko Bonadei2dfa9982018-10-18 09:35:32248WEBRTC_DEFINE_string(
249 encoded_frame_path,
250 "",
251 "The base path for encoded frame logs. Created files will have "
252 "the form <encoded_frame_path>.<n>.(recv|send.<m>).ivf");
palmkviste75f2042016-09-28 13:19:48253std::string EncodedFramePath() {
sprang1168fd42017-06-21 16:00:17254 return static_cast<std::string>(FLAG_encoded_frame_path);
palmkviste75f2042016-09-28 13:19:48255}
256
Mirko Bonadei2dfa9982018-10-18 09:35:32257WEBRTC_DEFINE_bool(logs, false, "print logs to stderr");
sprang@webrtc.org131bea82015-02-18 12:46:06258
Mirko Bonadei2dfa9982018-10-18 09:35:32259WEBRTC_DEFINE_bool(send_side_bwe, true, "Use send-side bandwidth estimation");
sprangce4aef12015-11-02 15:23:20260
Mirko Bonadei2dfa9982018-10-18 09:35:32261WEBRTC_DEFINE_bool(generic_descriptor,
262 false,
263 "Use the generic frame descriptor.");
philipel569397f2018-09-26 10:25:31264
Mirko Bonadei2dfa9982018-10-18 09:35:32265WEBRTC_DEFINE_bool(allow_reordering, false, "Allow packet reordering to occur");
philipela2c55232016-01-26 16:41:53266
Mirko Bonadei2dfa9982018-10-18 09:35:32267WEBRTC_DEFINE_bool(use_ulpfec,
268 false,
269 "Use RED+ULPFEC forward error correction.");
brandtra62f5822016-11-17 08:21:13270
Mirko Bonadei2dfa9982018-10-18 09:35:32271WEBRTC_DEFINE_bool(use_flexfec, false, "Use FlexFEC forward error correction.");
philipel274c1dc2016-05-04 13:21:01272
Mirko Bonadei2dfa9982018-10-18 09:35:32273WEBRTC_DEFINE_bool(audio, false, "Add audio stream");
minyue73208662016-08-18 13:28:55274
Mirko Bonadei2dfa9982018-10-18 09:35:32275WEBRTC_DEFINE_bool(
276 use_real_adm,
277 false,
278 "Use real ADM instead of fake (no effect if audio is false)");
henrika255750b2018-08-27 14:13:37279
Mirko Bonadei2dfa9982018-10-18 09:35:32280WEBRTC_DEFINE_bool(audio_video_sync,
281 false,
282 "Sync audio and video stream (no effect if"
283 " audio is false)");
minyue73208662016-08-18 13:28:55284
Mirko Bonadei2dfa9982018-10-18 09:35:32285WEBRTC_DEFINE_bool(audio_dtx,
286 false,
287 "Enable audio DTX (no effect if audio is false)");
minyue4c8b9422017-03-21 11:11:43288
Mirko Bonadei2dfa9982018-10-18 09:35:32289WEBRTC_DEFINE_bool(video, true, "Add video stream");
minyuea27172d2016-11-01 12:59:29290
Mirko Bonadei2dfa9982018-10-18 09:35:32291WEBRTC_DEFINE_string(
sprang@webrtc.org131bea82015-02-18 12:46:06292 force_fieldtrials,
293 "",
294 "Field trials control experimental feature code which can be forced. "
Elad Alon1e3ed162018-10-15 15:50:37295 "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enabled/"
sprang@webrtc.org131bea82015-02-18 12:46:06296 " will assign the group Enable to field trial WebRTC-FooFeature. Multiple "
297 "trials are separated by \"/\"");
pbos9874ee02015-06-22 11:44:26298
sprangce4aef12015-11-02 15:23:20299// Video-specific flags.
Mirko Bonadei2dfa9982018-10-18 09:35:32300WEBRTC_DEFINE_string(
301 clip,
302 "",
303 "Name of the clip to show. If empty, using chroma generator.");
ivica5d6a06c2015-09-17 12:30:24304std::string Clip() {
sprang1168fd42017-06-21 16:00:17305 return static_cast<std::string>(FLAG_clip);
ivica5d6a06c2015-09-17 12:30:24306}
307
Mirko Bonadei2dfa9982018-10-18 09:35:32308WEBRTC_DEFINE_bool(help, false, "prints this message");
sprang1168fd42017-06-21 16:00:17309
sprang@webrtc.org131bea82015-02-18 12:46:06310} // namespace flags
311
312void Loopback() {
Artem Titov75e36472018-10-08 10:28:56313 BuiltInNetworkBehaviorConfig pipe_config;
ivica5d6a06c2015-09-17 12:30:24314 pipe_config.loss_percent = flags::LossPercent();
philipel536378b2016-05-31 10:20:23315 pipe_config.avg_burst_loss_length = flags::AvgBurstLossLength();
ivica5d6a06c2015-09-17 12:30:24316 pipe_config.link_capacity_kbps = flags::LinkCapacityKbps();
317 pipe_config.queue_length_packets = flags::QueueSize();
318 pipe_config.queue_delay_ms = flags::AvgPropagationDelayMs();
319 pipe_config.delay_standard_deviation_ms = flags::StdPropagationDelayMs();
sprang1168fd42017-06-21 16:00:17320 pipe_config.allow_reordering = flags::FLAG_allow_reordering;
ivica5d6a06c2015-09-17 12:30:24321
Sebastian Janssonfc8d26b2018-02-21 08:52:06322 BitrateConstraints call_bitrate_config;
ivica5d6a06c2015-09-17 12:30:24323 call_bitrate_config.min_bitrate_bps = flags::MinBitrateKbps() * 1000;
324 call_bitrate_config.start_bitrate_bps = flags::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;
philipel569397f2018-09-26 10:25:31328 params.call = {flags::FLAG_send_side_bwe, flags::FLAG_generic_descriptor,
329 call_bitrate_config, 0};
Ilya Nikolaevskiy255d1cd2017-12-21 17:02:59330 params.video[0] = {flags::FLAG_video,
331 flags::Width(),
332 flags::Height(),
333 flags::Fps(),
334 flags::MinBitrateKbps() * 1000,
335 flags::TargetBitrateKbps() * 1000,
336 flags::MaxBitrateKbps() * 1000,
337 flags::FLAG_suspend_below_min_bitrate,
338 flags::Codec(),
339 flags::NumTemporalLayers(),
340 flags::SelectedTL(),
341 0, // No min transmit bitrate.
342 flags::FLAG_use_ulpfec,
343 flags::FLAG_use_flexfec,
Niels Möller6aa415e2018-06-07 09:14:13344 false,
Ilya Nikolaevskiy255d1cd2017-12-21 17:02:59345 flags::Clip(),
346 flags::GetCaptureDevice()};
sprang1168fd42017-06-21 16:00:17347 params.audio = {flags::FLAG_audio, flags::FLAG_audio_video_sync,
henrika255750b2018-08-27 14:13:37348 flags::FLAG_audio_dtx, flags::FLAG_use_real_adm};
Mirko Bonadei45a4c412018-07-31 13:07:28349 params.logging = {flags::FLAG_rtc_event_log_name, flags::FLAG_rtp_dump_name,
350 flags::FLAG_encoded_frame_path};
Ilya Nikolaevskiy255d1cd2017-12-21 17:02:59351 params.screenshare[0].enabled = false;
Yves Gerey665174f2018-06-19 13:03:05352 params.analyzer = {"video",
353 0.0,
354 0.0,
355 flags::DurationSecs(),
356 flags::OutputFilename(),
357 flags::GraphTitle()};
Artem Titovf18b3522018-08-28 14:54:24358 params.config = pipe_config;
sprang1168fd42017-06-21 16:00:17359
360 if (flags::NumStreams() > 1 && flags::Stream0().empty() &&
361 flags::Stream1().empty()) {
Ilya Nikolaevskiy255d1cd2017-12-21 17:02:59362 params.ss[0].infer_streams = true;
sprang1168fd42017-06-21 16:00:17363 }
ivica5d6a06c2015-09-17 12:30:24364
sprangce4aef12015-11-02 15:23:20365 std::vector<std::string> stream_descriptors;
366 stream_descriptors.push_back(flags::Stream0());
367 stream_descriptors.push_back(flags::Stream1());
368 std::vector<std::string> SL_descriptors;
369 SL_descriptors.push_back(flags::SL0());
370 SL_descriptors.push_back(flags::SL1());
371 VideoQualityTest::FillScalabilitySettings(
Ilya Nikolaevskiy255d1cd2017-12-21 17:02:59372 &params, 0, stream_descriptors, flags::NumStreams(),
373 flags::SelectedStream(), flags::NumSpatialLayers(), flags::SelectedSL(),
Sergey Silkin57027362018-05-15 07:12:05374 flags::InterLayerPred(), SL_descriptors);
sprangce4aef12015-11-02 15:23:20375
Karl Wiberg918f50c2018-07-05 09:40:33376 auto fixture = absl::make_unique<VideoQualityTest>(nullptr);
sprangce4aef12015-11-02 15:23:20377 if (flags::DurationSecs()) {
Patrik Höglundb6b29e02018-06-21 14:58:01378 fixture->RunWithAnalyzer(params);
sprangce4aef12015-11-02 15:23:20379 } else {
Patrik Höglundb6b29e02018-06-21 14:58:01380 fixture->RunWithRenderers(params);
sprangce4aef12015-11-02 15:23:20381 }
sprang@webrtc.org131bea82015-02-18 12:46:06382}
383} // namespace webrtc
384
385int main(int argc, char* argv[]) {
386 ::testing::InitGoogleTest(&argc, argv);
sprang1168fd42017-06-21 16:00:17387 rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, true);
388 if (webrtc::flags::FLAG_help) {
389 rtc::FlagList::Print(nullptr, false);
390 return 0;
391 }
392
Mirko Bonadei45a4c412018-07-31 13:07:28393 rtc::LogMessage::SetLogToStderr(webrtc::flags::FLAG_logs);
394
Bjorn Tereliusedab3012018-01-31 16:23:40395 webrtc::test::ValidateFieldTrialsStringOrDie(
396 webrtc::flags::FLAG_force_fieldtrials);
397 // InitFieldTrialsFromString stores the char*, so the char array must outlive
398 // the application.
399 webrtc::field_trial::InitFieldTrialsFromString(
400 webrtc::flags::FLAG_force_fieldtrials);
sprang89c4a7e2017-06-30 20:27:40401
sprang@webrtc.org131bea82015-02-18 12:46:06402 webrtc::test::RunTest(webrtc::Loopback);
403 return 0;
404}