blob: d0cdeab9d5540add2a055ecf2b62a84c0778d6ee [file] [log] [blame]
Artem Titovb6c62012019-01-08 14:58:23 +01001/*
2 * Copyright (c) 2018 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 */
Artem Titovd57628f2019-03-22 12:34:25 +010010#ifndef API_TEST_PEERCONNECTION_QUALITY_TEST_FIXTURE_H_
11#define API_TEST_PEERCONNECTION_QUALITY_TEST_FIXTURE_H_
Artem Titovb6c62012019-01-08 14:58:23 +010012
Artem Titovf65a89b2019-05-07 11:56:44 +020013#include <map>
Artem Titovb6c62012019-01-08 14:58:23 +010014#include <memory>
15#include <string>
Artem Titov7581ff72019-05-15 15:45:33 +020016#include <utility>
Artem Titovb6c62012019-01-08 14:58:23 +010017#include <vector>
18
Artem Titova6a273d2019-02-07 16:43:51 +010019#include "absl/memory/memory.h"
Steve Anton10542f22019-01-11 09:11:00 -080020#include "api/async_resolver_factory.h"
21#include "api/call/call_factory_interface.h"
Artem Titovb6c62012019-01-08 14:58:23 +010022#include "api/fec_controller.h"
Artem Titov741daaf2019-03-21 14:37:36 +010023#include "api/function_view.h"
Steve Anton10542f22019-01-11 09:11:00 -080024#include "api/peer_connection_interface.h"
Danil Chapovalov9305d112019-09-04 13:16:09 +020025#include "api/rtc_event_log/rtc_event_log_factory_interface.h"
Danil Chapovalov1a5fc902019-06-10 12:58:03 +020026#include "api/task_queue/task_queue_factory.h"
Artem Titovd57628f2019-03-22 12:34:25 +010027#include "api/test/audio_quality_analyzer_interface.h"
Artem Titovb6c62012019-01-08 14:58:23 +010028#include "api/test/simulated_network.h"
Artem Titova8549212019-08-19 14:38:06 +020029#include "api/test/stats_observer_interface.h"
Artem Titovd57628f2019-03-22 12:34:25 +010030#include "api/test/video_quality_analyzer_interface.h"
Niels Möller65f17ca2019-09-12 13:59:36 +020031#include "api/transport/media/media_transport_interface.h"
Artem Titovb6c62012019-01-08 14:58:23 +010032#include "api/transport/network_control.h"
Artem Titovebd97702019-01-09 17:55:36 +010033#include "api/units/time_delta.h"
Artem Titovb4463ee2019-11-12 17:27:44 +010034#include "api/video/video_source_interface.h"
Artem Titovb6c62012019-01-08 14:58:23 +010035#include "api/video_codecs/video_decoder_factory.h"
36#include "api/video_codecs/video_encoder.h"
37#include "api/video_codecs/video_encoder_factory.h"
Artem Titovf65a89b2019-05-07 11:56:44 +020038#include "media/base/media_constants.h"
Artem Titovb6c62012019-01-08 14:58:23 +010039#include "rtc_base/network.h"
Steve Anton10542f22019-01-11 09:11:00 -080040#include "rtc_base/rtc_certificate_generator.h"
41#include "rtc_base/ssl_certificate.h"
Artem Titovb6c62012019-01-08 14:58:23 +010042#include "rtc_base/thread.h"
Artem Titovb6c62012019-01-08 14:58:23 +010043
44namespace webrtc {
Artem Titov0b443142019-03-20 11:11:08 +010045namespace webrtc_pc_e2e {
Artem Titovb6c62012019-01-08 14:58:23 +010046
Artem Titov7581ff72019-05-15 15:45:33 +020047constexpr size_t kDefaultSlidesWidth = 1850;
48constexpr size_t kDefaultSlidesHeight = 1110;
49
Artem Titovd57628f2019-03-22 12:34:25 +010050// API is in development. Can be changed/removed without notice.
Artem Titovb6c62012019-01-08 14:58:23 +010051class PeerConnectionE2EQualityTestFixture {
52 public:
Artem Titov7581ff72019-05-15 15:45:33 +020053 // Contains parameters for screen share scrolling.
54 //
55 // If scrolling is enabled, then it will be done by putting sliding window
56 // on source video and moving this window from top left corner to the
57 // bottom right corner of the picture.
58 //
59 // In such case source dimensions must be greater or equal to the sliding
60 // window dimensions. So |source_width| and |source_height| are the dimensions
61 // of the source frame, while |VideoConfig::width| and |VideoConfig::height|
62 // are the dimensions of the sliding window.
63 //
64 // Because |source_width| and |source_height| are dimensions of the source
65 // frame, they have to be width and height of videos from
66 // |ScreenShareConfig::slides_yuv_file_names|.
67 //
68 // Because scrolling have to be done on single slide it also requires, that
69 // |duration| must be less or equal to
70 // |ScreenShareConfig::slide_change_interval|.
71 struct ScrollingParams {
72 ScrollingParams(TimeDelta duration,
73 size_t source_width,
74 size_t source_height)
75 : duration(duration),
76 source_width(source_width),
77 source_height(source_height) {
78 RTC_CHECK_GT(duration.ms(), 0);
79 }
80
81 // Duration of scrolling.
82 TimeDelta duration;
83 // Width of source slides video.
84 size_t source_width;
85 // Height of source slides video.
86 size_t source_height;
87 };
88
Artem Titovebd97702019-01-09 17:55:36 +010089 // Contains screen share video stream properties.
Artem Titovb6c62012019-01-08 14:58:23 +010090 struct ScreenShareConfig {
Artem Titov7581ff72019-05-15 15:45:33 +020091 explicit ScreenShareConfig(TimeDelta slide_change_interval)
92 : slide_change_interval(slide_change_interval) {
93 RTC_CHECK_GT(slide_change_interval.ms(), 0);
94 }
95
Artem Titovebd97702019-01-09 17:55:36 +010096 // Shows how long one slide should be presented on the screen during
97 // slide generation.
98 TimeDelta slide_change_interval;
Artem Titov7581ff72019-05-15 15:45:33 +020099 // If true, slides will be generated programmatically. No scrolling params
100 // will be applied in such case.
101 bool generate_slides = false;
102 // If present scrolling will be applied. Please read extra requirement on
103 // |slides_yuv_file_names| for scrolling.
104 absl::optional<ScrollingParams> scrolling_params;
105 // Contains list of yuv files with slides.
106 //
107 // If empty, default set of slides will be used. In such case
108 // |VideoConfig::width| must be equal to |kDefaultSlidesWidth| and
109 // |VideoConfig::height| must be equal to |kDefaultSlidesHeight| or if
110 // |scrolling_params| are specified, then |ScrollingParams::source_width|
111 // must be equal to |kDefaultSlidesWidth| and
112 // |ScrollingParams::source_height| must be equal to |kDefaultSlidesHeight|.
Artem Titovb6c62012019-01-08 14:58:23 +0100113 std::vector<std::string> slides_yuv_file_names;
Artem Titovb3f14872019-09-09 13:48:21 +0200114 // If true will set VideoTrackInterface::ContentHint::kText for current
115 // video track.
116 bool use_text_content_hint = true;
Artem Titovb6c62012019-01-08 14:58:23 +0100117 };
118
Artem Titova6a273d2019-02-07 16:43:51 +0100119 enum VideoGeneratorType { kDefault, kI420A, kI010 };
120
Artem Titovd70d80d2019-07-19 11:00:40 +0200121 // Config for Vp8 simulcast or Vp9 SVC testing.
122 //
123 // SVC support is limited:
124 // During SVC testing there is no SFU, so framework will try to emulate SFU
125 // behavior in regular p2p call. Because of it there are such limitations:
126 // * if |target_spatial_index| is not equal to the highest spatial layer
127 // then no packet/frame drops are allowed.
128 //
129 // If there will be any drops, that will affect requested layer, then
130 // WebRTC SVC implementation will continue decoding only the highest
131 // available layer and won't restore lower layers, so analyzer won't
132 // receive required data which will cause wrong results or test failures.
Artem Titovef3fd9c2019-06-13 16:36:52 +0200133 struct VideoSimulcastConfig {
134 VideoSimulcastConfig(int simulcast_streams_count, int target_spatial_index)
135 : simulcast_streams_count(simulcast_streams_count),
136 target_spatial_index(target_spatial_index) {
137 RTC_CHECK_GT(simulcast_streams_count, 1);
138 RTC_CHECK_GE(target_spatial_index, 0);
139 RTC_CHECK_LT(target_spatial_index, simulcast_streams_count);
140 }
141
142 // Specified amount of simulcast streams/SVC layers, depending on which
143 // encoder is used.
144 int simulcast_streams_count;
145 // Specifies spatial index of the video stream to analyze.
146 // There are 2 cases:
147 // 1. simulcast encoder is used:
148 // in such case |target_spatial_index| will specify the index of
149 // simulcast stream, that should be analyzed. Other streams will be
150 // dropped.
151 // 2. SVC encoder is used:
152 // in such case |target_spatial_index| will specify the top interesting
153 // spatial layer and all layers below, including target one will be
154 // processed. All layers above target one will be dropped.
155 int target_spatial_index;
156 };
157
Artem Titovebd97702019-01-09 17:55:36 +0100158 // Contains properties of single video stream.
Artem Titovb6c62012019-01-08 14:58:23 +0100159 struct VideoConfig {
Artem Titovc58c01d2019-02-28 13:19:12 +0100160 VideoConfig(size_t width, size_t height, int32_t fps)
161 : width(width), height(height), fps(fps) {}
162
Artem Titov7581ff72019-05-15 15:45:33 +0200163 // Video stream width.
Artem Titovc58c01d2019-02-28 13:19:12 +0100164 const size_t width;
Artem Titov7581ff72019-05-15 15:45:33 +0200165 // Video stream height.
Artem Titovc58c01d2019-02-28 13:19:12 +0100166 const size_t height;
167 const int32_t fps;
Artem Titovb6c62012019-01-08 14:58:23 +0100168 // Have to be unique among all specified configs for all peers in the call.
Artem Titov3481db22019-02-28 13:13:15 +0100169 // Will be auto generated if omitted.
Artem Titovb6c62012019-01-08 14:58:23 +0100170 absl::optional<std::string> stream_label;
Artem Titovb4463ee2019-11-12 17:27:44 +0100171 // You can specify one of |generator|, |input_file_name|,
172 // |screen_share_config| and |capturing_device_index|.
173 // If none of them are specified:
174 // * If config is added to the PeerConfigurer without specifying any video
175 // source, then |generator| will be set to VideoGeneratorType::kDefault.
176 // * If config is added with own video source implementation, then that
177 // video source will be used.
178
179 // If specified generator of this type will be used to produce input video.
Artem Titova6a273d2019-02-07 16:43:51 +0100180 absl::optional<VideoGeneratorType> generator;
181 // If specified this file will be used as input. Input video will be played
182 // in a circle.
Artem Titovb6c62012019-01-08 14:58:23 +0100183 absl::optional<std::string> input_file_name;
184 // If specified screen share video stream will be created as input.
185 absl::optional<ScreenShareConfig> screen_share_config;
Artem Titov9afdddf2019-10-10 13:29:03 +0200186 // If specified this capturing device will be used to get input video. The
187 // |capturing_device_index| is the index of required capturing device in OS
188 // provided list of video devices. On Linux and Windows the list will be
189 // obtained via webrtc::VideoCaptureModule::DeviceInfo, on Mac OS via
190 // [RTCCameraVideoCapturer captureDevices].
191 absl::optional<size_t> capturing_device_index;
Artem Titovef3fd9c2019-06-13 16:36:52 +0200192 // If presented video will be transfered in simulcast/SVC mode depending on
193 // which encoder is used.
194 //
Artem Titov46c7a162019-07-29 13:17:14 +0200195 // Simulcast is supported only from 1st added peer. For VP8 simulcast only
196 // without RTX is supported so it will be automatically disabled for all
197 // simulcast tracks. For VP9 simulcast enables VP9 SVC mode and support RTX,
198 // but only on non-lossy networks. See more in documentation to
199 // VideoSimulcastConfig.
Artem Titovef3fd9c2019-06-13 16:36:52 +0200200 absl::optional<VideoSimulcastConfig> simulcast_config;
Artem Titov1e49ab22019-07-30 13:17:25 +0200201 // Count of temporal layers for video stream. This value will be set into
202 // each RtpEncodingParameters of RtpParameters of corresponding
203 // RtpSenderInterface for this video stream.
204 absl::optional<int> temporal_layers_count;
Johannes Kron1162ba22019-09-18 10:28:33 +0200205 // Sets the maxiumum encode bitrate in bps. If this value is not set, the
206 // encoder will be capped at an internal maximum value around 2 Mbps
207 // depending on the resolution. This means that it will never be able to
208 // utilize a high bandwidth link.
209 absl::optional<int> max_encode_bitrate_bps;
210 // Sets the minimum encode bitrate in bps. If this value is not set, the
211 // encoder will use an internal minimum value. Please note that if this
212 // value is set higher than the bandwidth of the link, the encoder will
213 // generate more data than the link can handle regardless of the bandwidth
214 // estimation.
215 absl::optional<int> min_encode_bitrate_bps;
Artem Titovb6c62012019-01-08 14:58:23 +0100216 // If specified the input stream will be also copied to specified file.
Artem Titova6a273d2019-02-07 16:43:51 +0100217 // It is actually one of the test's output file, which contains copy of what
218 // was captured during the test for this video stream on sender side.
219 // It is useful when generator is used as input.
Artem Titovb6c62012019-01-08 14:58:23 +0100220 absl::optional<std::string> input_dump_file_name;
221 // If specified this file will be used as output on the receiver side for
222 // this stream. If multiple streams will be produced by input stream,
Artem Titova6a273d2019-02-07 16:43:51 +0100223 // output files will be appended with indexes. The produced files contains
224 // what was rendered for this video stream on receiver side.
225 absl::optional<std::string> output_dump_file_name;
Artem Titovddef8d12019-09-06 14:31:50 +0200226 // If true will display input and output video on the user's screen.
227 bool show_on_screen = false;
Artem Titovb6c62012019-01-08 14:58:23 +0100228 };
229
Artem Titovebd97702019-01-09 17:55:36 +0100230 // Contains properties for audio in the call.
Artem Titovb6c62012019-01-08 14:58:23 +0100231 struct AudioConfig {
232 enum Mode {
233 kGenerated,
234 kFile,
235 };
Artem Titov3481db22019-02-28 13:13:15 +0100236 // Have to be unique among all specified configs for all peers in the call.
237 // Will be auto generated if omitted.
238 absl::optional<std::string> stream_label;
Artem Titov9a7e7212019-02-28 16:34:17 +0100239 Mode mode = kGenerated;
Artem Titovb6c62012019-01-08 14:58:23 +0100240 // Have to be specified only if mode = kFile
241 absl::optional<std::string> input_file_name;
242 // If specified the input stream will be also copied to specified file.
243 absl::optional<std::string> input_dump_file_name;
244 // If specified the output stream will be copied to specified file.
Artem Titova6a273d2019-02-07 16:43:51 +0100245 absl::optional<std::string> output_dump_file_name;
Artem Titovbc558ce2019-07-08 19:13:21 +0200246
Artem Titovb6c62012019-01-08 14:58:23 +0100247 // Audio options to use.
248 cricket::AudioOptions audio_options;
Artem Titovbc558ce2019-07-08 19:13:21 +0200249 // Sampling frequency of input audio data (from file or generated).
250 int sampling_frequency_in_hz = 48000;
Artem Titovb6c62012019-01-08 14:58:23 +0100251 };
252
Artem Titovd09bc552019-03-20 11:18:58 +0100253 // This class is used to fully configure one peer inside the call.
254 class PeerConfigurer {
255 public:
256 virtual ~PeerConfigurer() = default;
257
Danil Chapovalov1a5fc902019-06-10 12:58:03 +0200258 // The parameters of the following 8 methods will be passed to the
Artem Titovd09bc552019-03-20 11:18:58 +0100259 // PeerConnectionFactoryInterface implementation that will be created for
260 // this peer.
Danil Chapovalov1a5fc902019-06-10 12:58:03 +0200261 virtual PeerConfigurer* SetTaskQueueFactory(
262 std::unique_ptr<TaskQueueFactory> task_queue_factory) = 0;
Artem Titovd09bc552019-03-20 11:18:58 +0100263 virtual PeerConfigurer* SetCallFactory(
264 std::unique_ptr<CallFactoryInterface> call_factory) = 0;
265 virtual PeerConfigurer* SetEventLogFactory(
266 std::unique_ptr<RtcEventLogFactoryInterface> event_log_factory) = 0;
267 virtual PeerConfigurer* SetFecControllerFactory(
268 std::unique_ptr<FecControllerFactoryInterface>
269 fec_controller_factory) = 0;
270 virtual PeerConfigurer* SetNetworkControllerFactory(
271 std::unique_ptr<NetworkControllerFactoryInterface>
272 network_controller_factory) = 0;
273 virtual PeerConfigurer* SetMediaTransportFactory(
274 std::unique_ptr<MediaTransportFactory> media_transport_factory) = 0;
275 virtual PeerConfigurer* SetVideoEncoderFactory(
276 std::unique_ptr<VideoEncoderFactory> video_encoder_factory) = 0;
277 virtual PeerConfigurer* SetVideoDecoderFactory(
278 std::unique_ptr<VideoDecoderFactory> video_decoder_factory) = 0;
279
280 // The parameters of the following 3 methods will be passed to the
281 // PeerConnectionInterface implementation that will be created for this
282 // peer.
283 virtual PeerConfigurer* SetAsyncResolverFactory(
284 std::unique_ptr<webrtc::AsyncResolverFactory>
285 async_resolver_factory) = 0;
286 virtual PeerConfigurer* SetRTCCertificateGenerator(
287 std::unique_ptr<rtc::RTCCertificateGeneratorInterface>
288 cert_generator) = 0;
289 virtual PeerConfigurer* SetSSLCertificateVerifier(
290 std::unique_ptr<rtc::SSLCertificateVerifier> tls_cert_verifier) = 0;
291
292 // Add new video stream to the call that will be sent from this peer.
293 virtual PeerConfigurer* AddVideoConfig(VideoConfig config) = 0;
Artem Titovb4463ee2019-11-12 17:27:44 +0100294 // Add new video stream to the call that will be sent from this peer with
295 // provided own implementation of video frames source.
296 virtual PeerConfigurer* AddVideoConfig(
297 VideoConfig config,
298 std::unique_ptr<rtc::VideoSourceInterface<VideoFrame>> source) = 0;
Artem Titovd09bc552019-03-20 11:18:58 +0100299 // Set the audio stream for the call from this peer. If this method won't
300 // be invoked, this peer will send no audio.
301 virtual PeerConfigurer* SetAudioConfig(AudioConfig config) = 0;
302 // If is set, an RTCEventLog will be saved in that location and it will be
303 // available for further analysis.
304 virtual PeerConfigurer* SetRtcEventLogPath(std::string path) = 0;
Artem Titov70f80e52019-04-12 13:13:39 +0200305 // If is set, an AEC dump will be saved in that location and it will be
306 // available for further analysis.
307 virtual PeerConfigurer* SetAecDumpPath(std::string path) = 0;
Artem Titovd09bc552019-03-20 11:18:58 +0100308 virtual PeerConfigurer* SetRTCConfiguration(
309 PeerConnectionInterface::RTCConfiguration configuration) = 0;
Artem Titov85a9d912019-05-29 14:36:50 +0200310 // Set bitrate parameters on PeerConnection. This constraints will be
311 // applied to all summed RTP streams for this peer.
312 virtual PeerConfigurer* SetBitrateParameters(
313 PeerConnectionInterface::BitrateParameters bitrate_params) = 0;
Artem Titovd09bc552019-03-20 11:18:58 +0100314 };
315
Artem Titov728a0ee2019-08-20 13:36:35 +0200316 // Contains configuration for echo emulator.
317 struct EchoEmulationConfig {
318 // Delay which represents the echo path delay, i.e. how soon rendered signal
319 // should reach capturer.
320 TimeDelta echo_delay = TimeDelta::ms(50);
321 };
322
Artem Titova6a273d2019-02-07 16:43:51 +0100323 // Contains parameters, that describe how long framework should run quality
324 // test.
325 struct RunParams {
Artem Titovade945d2019-04-02 18:31:48 +0200326 explicit RunParams(TimeDelta run_duration) : run_duration(run_duration) {}
327
Artem Titova6a273d2019-02-07 16:43:51 +0100328 // Specifies how long the test should be run. This time shows how long
329 // the media should flow after connection was established and before
330 // it will be shut downed.
331 TimeDelta run_duration;
Artem Titovade945d2019-04-02 18:31:48 +0200332
Artem Titovf65a89b2019-05-07 11:56:44 +0200333 // Next two fields are used to specify concrete video codec, that should be
334 // used in the test. Video code will be negotiated in SDP during offer/
335 // answer exchange.
336 // Video codec name. You can find valid names in
337 // media/base/media_constants.h
338 std::string video_codec_name = cricket::kVp8CodecName;
339 // Map of parameters, that have to be specified on SDP codec. Each parameter
340 // is described by key and value. Codec parameters will match the specified
341 // map if and only if for each key from |video_codec_required_params| there
342 // will be a parameter with name equal to this key and parameter value will
343 // be equal to the value from |video_codec_required_params| for this key.
344 // If empty then only name will be used to match the codec.
345 std::map<std::string, std::string> video_codec_required_params;
346 bool use_ulp_fec = false;
347 bool use_flex_fec = false;
Artem Titovade945d2019-04-02 18:31:48 +0200348 // Specifies how much video encoder target bitrate should be different than
349 // target bitrate, provided by WebRTC stack. Must be greater then 0. Can be
350 // used to emulate overshooting of video encoders. This multiplier will
351 // be applied for all video encoder on both sides for all layers. Bitrate
352 // estimated by WebRTC stack will be multiplied on this multiplier and then
Erik Språng16cb8f52019-04-12 13:59:09 +0200353 // provided into VideoEncoder::SetRates(...).
Artem Titovade945d2019-04-02 18:31:48 +0200354 double video_encoder_bitrate_multiplier = 1.0;
Artem Titov39483c62019-07-19 17:03:52 +0200355 // If true will set conference mode in SDP media section for all video
356 // tracks for all peers.
357 bool use_conference_mode = false;
Artem Titov728a0ee2019-08-20 13:36:35 +0200358 // If specified echo emulation will be done, by mixing the render audio into
359 // the capture signal. In such case input signal will be reduced by half to
360 // avoid saturation or compression in the echo path simulation.
361 absl::optional<EchoEmulationConfig> echo_emulation_config;
Artem Titova6a273d2019-02-07 16:43:51 +0100362 };
363
Artem Titov18459222019-04-24 11:09:35 +0200364 // Represent an entity that will report quality metrics after test.
Artem Titova8549212019-08-19 14:38:06 +0200365 class QualityMetricsReporter : public StatsObserverInterface {
Artem Titov18459222019-04-24 11:09:35 +0200366 public:
367 virtual ~QualityMetricsReporter() = default;
368
369 // Invoked by framework after peer connection factory and peer connection
370 // itself will be created but before offer/answer exchange will be started.
371 virtual void Start(absl::string_view test_case_name) = 0;
372
373 // Invoked by framework after call is ended and peer connection factory and
374 // peer connection are destroyed.
375 virtual void StopAndReportResults() = 0;
376 };
377
Artem Titovd09bc552019-03-20 11:18:58 +0100378 virtual ~PeerConnectionE2EQualityTestFixture() = default;
379
Artem Titovba82e002019-03-15 15:57:53 +0100380 // Add activity that will be executed on the best effort at least after
381 // |target_time_since_start| after call will be set up (after offer/answer
382 // exchange, ICE gathering will be done and ICE candidates will passed to
383 // remote side). |func| param is amount of time spent from the call set up.
384 virtual void ExecuteAt(TimeDelta target_time_since_start,
385 std::function<void(TimeDelta)> func) = 0;
386 // Add activity that will be executed every |interval| with first execution
387 // on the best effort at least after |initial_delay_since_start| after call
388 // will be set up (after all participants will be connected). |func| param is
389 // amount of time spent from the call set up.
390 virtual void ExecuteEvery(TimeDelta initial_delay_since_start,
391 TimeDelta interval,
392 std::function<void(TimeDelta)> func) = 0;
393
Artem Titov18459222019-04-24 11:09:35 +0200394 // Add stats reporter entity to observe the test.
395 virtual void AddQualityMetricsReporter(
396 std::unique_ptr<QualityMetricsReporter> quality_metrics_reporter) = 0;
397
Artem Titovd09bc552019-03-20 11:18:58 +0100398 // Add a new peer to the call and return an object through which caller
399 // can configure peer's behavior.
400 // |network_thread| will be used as network thread for peer's peer connection
401 // |network_manager| will be used to provide network interfaces for peer's
402 // peer connection.
403 // |configurer| function will be used to configure peer in the call.
404 virtual void AddPeer(rtc::Thread* network_thread,
405 rtc::NetworkManager* network_manager,
406 rtc::FunctionView<void(PeerConfigurer*)> configurer) = 0;
407 virtual void Run(RunParams run_params) = 0;
Artem Titovb93c4e62019-05-02 10:52:07 +0200408
409 // Returns real test duration - the time of test execution measured during
410 // test. Client must call this method only after test is finished (after
411 // Run(...) method returned). Test execution time is time from end of call
412 // setup (offer/answer, ICE candidates exchange done and ICE connected) to
413 // start of call tear down (PeerConnection closed).
414 virtual TimeDelta GetRealTestDuration() const = 0;
Artem Titovb6c62012019-01-08 14:58:23 +0100415};
416
Artem Titov0b443142019-03-20 11:11:08 +0100417} // namespace webrtc_pc_e2e
Artem Titovb6c62012019-01-08 14:58:23 +0100418} // namespace webrtc
419
Artem Titovd57628f2019-03-22 12:34:25 +0100420#endif // API_TEST_PEERCONNECTION_QUALITY_TEST_FIXTURE_H_