Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 1 | /* |
| 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 Titov | d57628f | 2019-03-22 12:34:25 +0100 | [diff] [blame] | 10 | #ifndef API_TEST_PEERCONNECTION_QUALITY_TEST_FIXTURE_H_ |
| 11 | #define API_TEST_PEERCONNECTION_QUALITY_TEST_FIXTURE_H_ |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 12 | |
Artem Titov | f65a89b | 2019-05-07 11:56:44 +0200 | [diff] [blame] | 13 | #include <map> |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 14 | #include <memory> |
| 15 | #include <string> |
Artem Titov | 7581ff7 | 2019-05-15 15:45:33 +0200 | [diff] [blame] | 16 | #include <utility> |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 17 | #include <vector> |
| 18 | |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 19 | #include "absl/memory/memory.h" |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 20 | #include "api/async_resolver_factory.h" |
| 21 | #include "api/call/call_factory_interface.h" |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 22 | #include "api/fec_controller.h" |
Artem Titov | 741daaf | 2019-03-21 14:37:36 +0100 | [diff] [blame] | 23 | #include "api/function_view.h" |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 24 | #include "api/media_transport_interface.h" |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 25 | #include "api/peer_connection_interface.h" |
Artem Titov | d57628f | 2019-03-22 12:34:25 +0100 | [diff] [blame] | 26 | #include "api/test/audio_quality_analyzer_interface.h" |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 27 | #include "api/test/simulated_network.h" |
Artem Titov | d57628f | 2019-03-22 12:34:25 +0100 | [diff] [blame] | 28 | #include "api/test/video_quality_analyzer_interface.h" |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 29 | #include "api/transport/network_control.h" |
Artem Titov | ebd9770 | 2019-01-09 17:55:36 +0100 | [diff] [blame] | 30 | #include "api/units/time_delta.h" |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 31 | #include "api/video_codecs/video_decoder_factory.h" |
| 32 | #include "api/video_codecs/video_encoder.h" |
| 33 | #include "api/video_codecs/video_encoder_factory.h" |
| 34 | #include "logging/rtc_event_log/rtc_event_log_factory_interface.h" |
Artem Titov | f65a89b | 2019-05-07 11:56:44 +0200 | [diff] [blame] | 35 | #include "media/base/media_constants.h" |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 36 | #include "rtc_base/network.h" |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 37 | #include "rtc_base/rtc_certificate_generator.h" |
| 38 | #include "rtc_base/ssl_certificate.h" |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 39 | #include "rtc_base/thread.h" |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 40 | |
| 41 | namespace webrtc { |
Artem Titov | 0b44314 | 2019-03-20 11:11:08 +0100 | [diff] [blame] | 42 | namespace webrtc_pc_e2e { |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 43 | |
Artem Titov | 7581ff7 | 2019-05-15 15:45:33 +0200 | [diff] [blame] | 44 | constexpr size_t kDefaultSlidesWidth = 1850; |
| 45 | constexpr size_t kDefaultSlidesHeight = 1110; |
| 46 | |
Artem Titov | d57628f | 2019-03-22 12:34:25 +0100 | [diff] [blame] | 47 | // API is in development. Can be changed/removed without notice. |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 48 | class PeerConnectionE2EQualityTestFixture { |
| 49 | public: |
Artem Titov | 7581ff7 | 2019-05-15 15:45:33 +0200 | [diff] [blame] | 50 | // Contains parameters for screen share scrolling. |
| 51 | // |
| 52 | // If scrolling is enabled, then it will be done by putting sliding window |
| 53 | // on source video and moving this window from top left corner to the |
| 54 | // bottom right corner of the picture. |
| 55 | // |
| 56 | // In such case source dimensions must be greater or equal to the sliding |
| 57 | // window dimensions. So |source_width| and |source_height| are the dimensions |
| 58 | // of the source frame, while |VideoConfig::width| and |VideoConfig::height| |
| 59 | // are the dimensions of the sliding window. |
| 60 | // |
| 61 | // Because |source_width| and |source_height| are dimensions of the source |
| 62 | // frame, they have to be width and height of videos from |
| 63 | // |ScreenShareConfig::slides_yuv_file_names|. |
| 64 | // |
| 65 | // Because scrolling have to be done on single slide it also requires, that |
| 66 | // |duration| must be less or equal to |
| 67 | // |ScreenShareConfig::slide_change_interval|. |
| 68 | struct ScrollingParams { |
| 69 | ScrollingParams(TimeDelta duration, |
| 70 | size_t source_width, |
| 71 | size_t source_height) |
| 72 | : duration(duration), |
| 73 | source_width(source_width), |
| 74 | source_height(source_height) { |
| 75 | RTC_CHECK_GT(duration.ms(), 0); |
| 76 | } |
| 77 | |
| 78 | // Duration of scrolling. |
| 79 | TimeDelta duration; |
| 80 | // Width of source slides video. |
| 81 | size_t source_width; |
| 82 | // Height of source slides video. |
| 83 | size_t source_height; |
| 84 | }; |
| 85 | |
Artem Titov | ebd9770 | 2019-01-09 17:55:36 +0100 | [diff] [blame] | 86 | // Contains screen share video stream properties. |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 87 | struct ScreenShareConfig { |
Artem Titov | 7581ff7 | 2019-05-15 15:45:33 +0200 | [diff] [blame] | 88 | explicit ScreenShareConfig(TimeDelta slide_change_interval) |
| 89 | : slide_change_interval(slide_change_interval) { |
| 90 | RTC_CHECK_GT(slide_change_interval.ms(), 0); |
| 91 | } |
| 92 | |
Artem Titov | ebd9770 | 2019-01-09 17:55:36 +0100 | [diff] [blame] | 93 | // Shows how long one slide should be presented on the screen during |
| 94 | // slide generation. |
| 95 | TimeDelta slide_change_interval; |
Artem Titov | 7581ff7 | 2019-05-15 15:45:33 +0200 | [diff] [blame] | 96 | // If true, slides will be generated programmatically. No scrolling params |
| 97 | // will be applied in such case. |
| 98 | bool generate_slides = false; |
| 99 | // If present scrolling will be applied. Please read extra requirement on |
| 100 | // |slides_yuv_file_names| for scrolling. |
| 101 | absl::optional<ScrollingParams> scrolling_params; |
| 102 | // Contains list of yuv files with slides. |
| 103 | // |
| 104 | // If empty, default set of slides will be used. In such case |
| 105 | // |VideoConfig::width| must be equal to |kDefaultSlidesWidth| and |
| 106 | // |VideoConfig::height| must be equal to |kDefaultSlidesHeight| or if |
| 107 | // |scrolling_params| are specified, then |ScrollingParams::source_width| |
| 108 | // must be equal to |kDefaultSlidesWidth| and |
| 109 | // |ScrollingParams::source_height| must be equal to |kDefaultSlidesHeight|. |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 110 | std::vector<std::string> slides_yuv_file_names; |
| 111 | }; |
| 112 | |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 113 | enum VideoGeneratorType { kDefault, kI420A, kI010 }; |
| 114 | |
Artem Titov | ebd9770 | 2019-01-09 17:55:36 +0100 | [diff] [blame] | 115 | // Contains properties of single video stream. |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 116 | struct VideoConfig { |
Artem Titov | c58c01d | 2019-02-28 13:19:12 +0100 | [diff] [blame] | 117 | VideoConfig(size_t width, size_t height, int32_t fps) |
| 118 | : width(width), height(height), fps(fps) {} |
| 119 | |
Artem Titov | 7581ff7 | 2019-05-15 15:45:33 +0200 | [diff] [blame] | 120 | // Video stream width. |
Artem Titov | c58c01d | 2019-02-28 13:19:12 +0100 | [diff] [blame] | 121 | const size_t width; |
Artem Titov | 7581ff7 | 2019-05-15 15:45:33 +0200 | [diff] [blame] | 122 | // Video stream height. |
Artem Titov | c58c01d | 2019-02-28 13:19:12 +0100 | [diff] [blame] | 123 | const size_t height; |
| 124 | const int32_t fps; |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 125 | // Have to be unique among all specified configs for all peers in the call. |
Artem Titov | 3481db2 | 2019-02-28 13:13:15 +0100 | [diff] [blame] | 126 | // Will be auto generated if omitted. |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 127 | absl::optional<std::string> stream_label; |
Artem Titov | 9a7e721 | 2019-02-28 16:34:17 +0100 | [diff] [blame] | 128 | // Only 1 from |generator|, |input_file_name| and |screen_share_config| can |
| 129 | // be specified. If none of them are specified, then |generator| will be set |
| 130 | // to VideoGeneratorType::kDefault. |
| 131 | // If specified generator of this type will be used to produce input video. |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 132 | absl::optional<VideoGeneratorType> generator; |
| 133 | // If specified this file will be used as input. Input video will be played |
| 134 | // in a circle. |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 135 | absl::optional<std::string> input_file_name; |
| 136 | // If specified screen share video stream will be created as input. |
| 137 | absl::optional<ScreenShareConfig> screen_share_config; |
Artem Titov | 32232e9 | 2019-02-20 21:13:14 +0100 | [diff] [blame] | 138 | // Specifies spatial index of the video stream to analyze. |
| 139 | // There are 3 cases: |
| 140 | // 1. |target_spatial_index| omitted: in such case it will be assumed that |
| 141 | // video stream has not spatial layers and simulcast streams. |
| 142 | // 2. |target_spatial_index| presented and simulcast encoder is used: |
| 143 | // in such case |target_spatial_index| will specify the index of |
Artem Titov | 3481db2 | 2019-02-28 13:13:15 +0100 | [diff] [blame] | 144 | // simulcast stream, that should be analyzed. Other streams will be |
Artem Titov | 32232e9 | 2019-02-20 21:13:14 +0100 | [diff] [blame] | 145 | // dropped. |
| 146 | // 3. |target_spatial_index| presented and SVP encoder is used: |
| 147 | // in such case |target_spatial_index| will specify the top interesting |
| 148 | // spatial layer and all layers bellow, including target one will be |
| 149 | // processed. All layers above target one will be dropped. |
| 150 | absl::optional<int> target_spatial_index; |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 151 | // If specified the input stream will be also copied to specified file. |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 152 | // It is actually one of the test's output file, which contains copy of what |
| 153 | // was captured during the test for this video stream on sender side. |
| 154 | // It is useful when generator is used as input. |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 155 | absl::optional<std::string> input_dump_file_name; |
| 156 | // If specified this file will be used as output on the receiver side for |
| 157 | // this stream. If multiple streams will be produced by input stream, |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 158 | // output files will be appended with indexes. The produced files contains |
| 159 | // what was rendered for this video stream on receiver side. |
| 160 | absl::optional<std::string> output_dump_file_name; |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 161 | }; |
| 162 | |
Artem Titov | ebd9770 | 2019-01-09 17:55:36 +0100 | [diff] [blame] | 163 | // Contains properties for audio in the call. |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 164 | struct AudioConfig { |
| 165 | enum Mode { |
| 166 | kGenerated, |
| 167 | kFile, |
| 168 | }; |
Artem Titov | 3481db2 | 2019-02-28 13:13:15 +0100 | [diff] [blame] | 169 | // Have to be unique among all specified configs for all peers in the call. |
| 170 | // Will be auto generated if omitted. |
| 171 | absl::optional<std::string> stream_label; |
Artem Titov | 9a7e721 | 2019-02-28 16:34:17 +0100 | [diff] [blame] | 172 | Mode mode = kGenerated; |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 173 | // Have to be specified only if mode = kFile |
| 174 | absl::optional<std::string> input_file_name; |
| 175 | // If specified the input stream will be also copied to specified file. |
| 176 | absl::optional<std::string> input_dump_file_name; |
| 177 | // If specified the output stream will be copied to specified file. |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 178 | absl::optional<std::string> output_dump_file_name; |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 179 | // Audio options to use. |
| 180 | cricket::AudioOptions audio_options; |
| 181 | }; |
| 182 | |
Artem Titov | d09bc55 | 2019-03-20 11:18:58 +0100 | [diff] [blame] | 183 | // This class is used to fully configure one peer inside the call. |
| 184 | class PeerConfigurer { |
| 185 | public: |
| 186 | virtual ~PeerConfigurer() = default; |
| 187 | |
| 188 | // The parameters of the following 7 methods will be passed to the |
| 189 | // PeerConnectionFactoryInterface implementation that will be created for |
| 190 | // this peer. |
| 191 | virtual PeerConfigurer* SetCallFactory( |
| 192 | std::unique_ptr<CallFactoryInterface> call_factory) = 0; |
| 193 | virtual PeerConfigurer* SetEventLogFactory( |
| 194 | std::unique_ptr<RtcEventLogFactoryInterface> event_log_factory) = 0; |
| 195 | virtual PeerConfigurer* SetFecControllerFactory( |
| 196 | std::unique_ptr<FecControllerFactoryInterface> |
| 197 | fec_controller_factory) = 0; |
| 198 | virtual PeerConfigurer* SetNetworkControllerFactory( |
| 199 | std::unique_ptr<NetworkControllerFactoryInterface> |
| 200 | network_controller_factory) = 0; |
| 201 | virtual PeerConfigurer* SetMediaTransportFactory( |
| 202 | std::unique_ptr<MediaTransportFactory> media_transport_factory) = 0; |
| 203 | virtual PeerConfigurer* SetVideoEncoderFactory( |
| 204 | std::unique_ptr<VideoEncoderFactory> video_encoder_factory) = 0; |
| 205 | virtual PeerConfigurer* SetVideoDecoderFactory( |
| 206 | std::unique_ptr<VideoDecoderFactory> video_decoder_factory) = 0; |
| 207 | |
| 208 | // The parameters of the following 3 methods will be passed to the |
| 209 | // PeerConnectionInterface implementation that will be created for this |
| 210 | // peer. |
| 211 | virtual PeerConfigurer* SetAsyncResolverFactory( |
| 212 | std::unique_ptr<webrtc::AsyncResolverFactory> |
| 213 | async_resolver_factory) = 0; |
| 214 | virtual PeerConfigurer* SetRTCCertificateGenerator( |
| 215 | std::unique_ptr<rtc::RTCCertificateGeneratorInterface> |
| 216 | cert_generator) = 0; |
| 217 | virtual PeerConfigurer* SetSSLCertificateVerifier( |
| 218 | std::unique_ptr<rtc::SSLCertificateVerifier> tls_cert_verifier) = 0; |
| 219 | |
| 220 | // Add new video stream to the call that will be sent from this peer. |
| 221 | virtual PeerConfigurer* AddVideoConfig(VideoConfig config) = 0; |
| 222 | // Set the audio stream for the call from this peer. If this method won't |
| 223 | // be invoked, this peer will send no audio. |
| 224 | virtual PeerConfigurer* SetAudioConfig(AudioConfig config) = 0; |
| 225 | // If is set, an RTCEventLog will be saved in that location and it will be |
| 226 | // available for further analysis. |
| 227 | virtual PeerConfigurer* SetRtcEventLogPath(std::string path) = 0; |
Artem Titov | 70f80e5 | 2019-04-12 13:13:39 +0200 | [diff] [blame] | 228 | // If is set, an AEC dump will be saved in that location and it will be |
| 229 | // available for further analysis. |
| 230 | virtual PeerConfigurer* SetAecDumpPath(std::string path) = 0; |
Artem Titov | d09bc55 | 2019-03-20 11:18:58 +0100 | [diff] [blame] | 231 | virtual PeerConfigurer* SetRTCConfiguration( |
| 232 | PeerConnectionInterface::RTCConfiguration configuration) = 0; |
| 233 | }; |
| 234 | |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 235 | // Contains parameters, that describe how long framework should run quality |
| 236 | // test. |
| 237 | struct RunParams { |
Artem Titov | ade945d | 2019-04-02 18:31:48 +0200 | [diff] [blame] | 238 | explicit RunParams(TimeDelta run_duration) : run_duration(run_duration) {} |
| 239 | |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 240 | // Specifies how long the test should be run. This time shows how long |
| 241 | // the media should flow after connection was established and before |
| 242 | // it will be shut downed. |
| 243 | TimeDelta run_duration; |
Artem Titov | ade945d | 2019-04-02 18:31:48 +0200 | [diff] [blame] | 244 | |
Artem Titov | f65a89b | 2019-05-07 11:56:44 +0200 | [diff] [blame] | 245 | // Next two fields are used to specify concrete video codec, that should be |
| 246 | // used in the test. Video code will be negotiated in SDP during offer/ |
| 247 | // answer exchange. |
| 248 | // Video codec name. You can find valid names in |
| 249 | // media/base/media_constants.h |
| 250 | std::string video_codec_name = cricket::kVp8CodecName; |
| 251 | // Map of parameters, that have to be specified on SDP codec. Each parameter |
| 252 | // is described by key and value. Codec parameters will match the specified |
| 253 | // map if and only if for each key from |video_codec_required_params| there |
| 254 | // will be a parameter with name equal to this key and parameter value will |
| 255 | // be equal to the value from |video_codec_required_params| for this key. |
| 256 | // If empty then only name will be used to match the codec. |
| 257 | std::map<std::string, std::string> video_codec_required_params; |
| 258 | bool use_ulp_fec = false; |
| 259 | bool use_flex_fec = false; |
Artem Titov | ade945d | 2019-04-02 18:31:48 +0200 | [diff] [blame] | 260 | // Specifies how much video encoder target bitrate should be different than |
| 261 | // target bitrate, provided by WebRTC stack. Must be greater then 0. Can be |
| 262 | // used to emulate overshooting of video encoders. This multiplier will |
| 263 | // be applied for all video encoder on both sides for all layers. Bitrate |
| 264 | // estimated by WebRTC stack will be multiplied on this multiplier and then |
Erik Språng | 16cb8f5 | 2019-04-12 13:59:09 +0200 | [diff] [blame] | 265 | // provided into VideoEncoder::SetRates(...). |
Artem Titov | ade945d | 2019-04-02 18:31:48 +0200 | [diff] [blame] | 266 | double video_encoder_bitrate_multiplier = 1.0; |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 267 | }; |
| 268 | |
Artem Titov | 1845922 | 2019-04-24 11:09:35 +0200 | [diff] [blame] | 269 | // Represent an entity that will report quality metrics after test. |
| 270 | class QualityMetricsReporter { |
| 271 | public: |
| 272 | virtual ~QualityMetricsReporter() = default; |
| 273 | |
| 274 | // Invoked by framework after peer connection factory and peer connection |
| 275 | // itself will be created but before offer/answer exchange will be started. |
| 276 | virtual void Start(absl::string_view test_case_name) = 0; |
| 277 | |
| 278 | // Invoked by framework after call is ended and peer connection factory and |
| 279 | // peer connection are destroyed. |
| 280 | virtual void StopAndReportResults() = 0; |
| 281 | }; |
| 282 | |
Artem Titov | d09bc55 | 2019-03-20 11:18:58 +0100 | [diff] [blame] | 283 | virtual ~PeerConnectionE2EQualityTestFixture() = default; |
| 284 | |
Artem Titov | ba82e00 | 2019-03-15 15:57:53 +0100 | [diff] [blame] | 285 | // Add activity that will be executed on the best effort at least after |
| 286 | // |target_time_since_start| after call will be set up (after offer/answer |
| 287 | // exchange, ICE gathering will be done and ICE candidates will passed to |
| 288 | // remote side). |func| param is amount of time spent from the call set up. |
| 289 | virtual void ExecuteAt(TimeDelta target_time_since_start, |
| 290 | std::function<void(TimeDelta)> func) = 0; |
| 291 | // Add activity that will be executed every |interval| with first execution |
| 292 | // on the best effort at least after |initial_delay_since_start| after call |
| 293 | // will be set up (after all participants will be connected). |func| param is |
| 294 | // amount of time spent from the call set up. |
| 295 | virtual void ExecuteEvery(TimeDelta initial_delay_since_start, |
| 296 | TimeDelta interval, |
| 297 | std::function<void(TimeDelta)> func) = 0; |
| 298 | |
Artem Titov | 1845922 | 2019-04-24 11:09:35 +0200 | [diff] [blame] | 299 | // Add stats reporter entity to observe the test. |
| 300 | virtual void AddQualityMetricsReporter( |
| 301 | std::unique_ptr<QualityMetricsReporter> quality_metrics_reporter) = 0; |
| 302 | |
Artem Titov | d09bc55 | 2019-03-20 11:18:58 +0100 | [diff] [blame] | 303 | // Add a new peer to the call and return an object through which caller |
| 304 | // can configure peer's behavior. |
| 305 | // |network_thread| will be used as network thread for peer's peer connection |
| 306 | // |network_manager| will be used to provide network interfaces for peer's |
| 307 | // peer connection. |
| 308 | // |configurer| function will be used to configure peer in the call. |
| 309 | virtual void AddPeer(rtc::Thread* network_thread, |
| 310 | rtc::NetworkManager* network_manager, |
| 311 | rtc::FunctionView<void(PeerConfigurer*)> configurer) = 0; |
| 312 | virtual void Run(RunParams run_params) = 0; |
Artem Titov | b93c4e6 | 2019-05-02 10:52:07 +0200 | [diff] [blame] | 313 | |
| 314 | // Returns real test duration - the time of test execution measured during |
| 315 | // test. Client must call this method only after test is finished (after |
| 316 | // Run(...) method returned). Test execution time is time from end of call |
| 317 | // setup (offer/answer, ICE candidates exchange done and ICE connected) to |
| 318 | // start of call tear down (PeerConnection closed). |
| 319 | virtual TimeDelta GetRealTestDuration() const = 0; |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 320 | }; |
| 321 | |
Artem Titov | 0b44314 | 2019-03-20 11:11:08 +0100 | [diff] [blame] | 322 | } // namespace webrtc_pc_e2e |
Artem Titov | b6c6201 | 2019-01-08 14:58:23 +0100 | [diff] [blame] | 323 | } // namespace webrtc |
| 324 | |
Artem Titov | d57628f | 2019-03-22 12:34:25 +0100 | [diff] [blame] | 325 | #endif // API_TEST_PEERCONNECTION_QUALITY_TEST_FIXTURE_H_ |