blob: 0377126821b527dfc20681bbc26bb41158dda616 [file] [log] [blame]
pbos@webrtc.org744fbc72013-09-10 09:26:25 +00001/*
2 * Copyright (c) 2013 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 */
pbos@webrtc.org744fbc72013-09-10 09:26:25 +000010
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#include "call/rampup_tests.h"
stefanff483612015-12-21 03:14:00 -080012
Danil Chapovalov304ea5f2019-04-11 15:18:18 +020013#include <memory>
14
Mirko Bonadei2ab97f62019-07-18 13:44:12 +020015#include "absl/flags/flag.h"
Danil Chapovalov4ba04b72019-06-26 15:49:47 +020016#include "api/rtc_event_log/rtc_event_log_factory.h"
Niels Möllerd8b9ed72019-05-08 13:53:51 +020017#include "api/rtc_event_log_output_file.h"
Danil Chapovalov304ea5f2019-04-11 15:18:18 +020018#include "api/task_queue/default_task_queue_factory.h"
Danil Chapovalov44db4362019-09-30 04:16:28 +020019#include "api/task_queue/task_queue_base.h"
Danil Chapovalov304ea5f2019-04-11 15:18:18 +020020#include "api/task_queue/task_queue_factory.h"
Artem Titov4e199e92018-08-20 13:30:39 +020021#include "call/fake_network_pipe.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020022#include "rtc_base/checks.h"
23#include "rtc_base/logging.h"
24#include "rtc_base/platform_thread.h"
Steve Anton10542f22019-01-11 09:11:00 -080025#include "rtc_base/string_encode.h"
Danil Chapovalov82a3f0a2019-10-21 09:24:27 +020026#include "rtc_base/task_queue_for_test.h"
Tommi6b117a52019-08-20 09:58:56 +020027#include "rtc_base/time_utils.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020028#include "test/encoder_settings.h"
Per Kjellander914351d2019-02-15 10:54:55 +010029#include "test/field_trial.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020030#include "test/gtest.h"
31#include "test/testsupport/perf_test.h"
pbos@webrtc.org744fbc72013-09-10 09:26:25 +000032
Mirko Bonadei2ab97f62019-07-18 13:44:12 +020033ABSL_FLAG(std::string,
34 ramp_dump_name,
35 "",
36 "Filename for dumped received RTP stream.");
37
pbos@webrtc.org744fbc72013-09-10 09:26:25 +000038namespace webrtc {
pbos@webrtc.org29023282013-09-11 10:14:56 +000039namespace {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +000040
Danil Chapovalov9f5ae7b2019-10-21 11:08:13 +020041constexpr TimeDelta kPollInterval = TimeDelta::Millis<20>();
philipel5ef2bc12017-02-21 07:28:31 -080042static const int kExpectedHighVideoBitrateBps = 80000;
stefandb752f92016-12-05 08:23:40 -080043static const int kExpectedHighAudioBitrateBps = 30000;
44static const int kLowBandwidthLimitBps = 20000;
Sebastian Jansson12fb1702018-02-23 11:34:18 +010045// Set target detected bitrate to slightly larger than the target bitrate to
46// avoid flakiness.
47static const int kLowBitrateMarginBps = 2000;
pbos@webrtc.org29023282013-09-11 10:14:56 +000048
stefanff483612015-12-21 03:14:00 -080049std::vector<uint32_t> GenerateSsrcs(size_t num_streams, uint32_t ssrc_offset) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +000050 std::vector<uint32_t> ssrcs;
51 for (size_t i = 0; i != num_streams; ++i)
52 ssrcs.push_back(static_cast<uint32_t>(ssrc_offset + i));
53 return ssrcs;
54}
mflodman@webrtc.orgeb16b812014-06-16 08:57:39 +000055} // namespace
henrik.lundin@webrtc.org845862f2014-03-06 07:19:28 +000056
Danil Chapovalov9f5ae7b2019-10-21 11:08:13 +020057RampUpTester::RampUpTester(size_t num_video_streams,
58 size_t num_audio_streams,
59 size_t num_flexfec_streams,
60 unsigned int start_bitrate_bps,
61 int64_t min_run_time_ms,
62 const std::string& extension_type,
63 bool rtx,
64 bool red,
65 bool report_perf_stats,
66 TaskQueueBase* task_queue)
stefan4fbd1452015-09-28 03:57:14 -070067 : EndToEndTest(test::CallTest::kLongTimeoutMs),
stefan4fbd1452015-09-28 03:57:14 -070068 clock_(Clock::GetRealTimeClock()),
stefanff483612015-12-21 03:14:00 -080069 num_video_streams_(num_video_streams),
70 num_audio_streams_(num_audio_streams),
philipel5ef2bc12017-02-21 07:28:31 -080071 num_flexfec_streams_(num_flexfec_streams),
stefan4fbd1452015-09-28 03:57:14 -070072 rtx_(rtx),
73 red_(red),
stefan45b5fe52017-03-09 06:27:02 -080074 report_perf_stats_(report_perf_stats),
mflodman86cc6ff2016-07-26 04:44:06 -070075 sender_call_(nullptr),
stefan4fbd1452015-09-28 03:57:14 -070076 send_stream_(nullptr),
sprang4847ae62017-06-27 07:06:52 -070077 send_transport_(nullptr),
Artem Titov631cafa2018-08-21 21:01:00 +020078 send_simulated_network_(nullptr),
stefan4fbd1452015-09-28 03:57:14 -070079 start_bitrate_bps_(start_bitrate_bps),
stefan5a2c5062017-01-27 06:43:18 -080080 min_run_time_ms_(min_run_time_ms),
stefan@webrtc.org3d7da882014-07-08 13:59:46 +000081 expected_bitrate_bps_(0),
Erik Språngf3a7c9d2015-10-05 14:03:22 +020082 test_start_ms_(-1),
stefan4fbd1452015-09-28 03:57:14 -070083 ramp_up_finished_ms_(-1),
84 extension_type_(extension_type),
stefanff483612015-12-21 03:14:00 -080085 video_ssrcs_(GenerateSsrcs(num_video_streams_, 100)),
86 video_rtx_ssrcs_(GenerateSsrcs(num_video_streams_, 200)),
87 audio_ssrcs_(GenerateSsrcs(num_audio_streams_, 300)),
Tommi5e005f42019-08-05 15:29:14 +020088 task_queue_(task_queue) {
philipel5ef2bc12017-02-21 07:28:31 -080089 if (red_)
90 EXPECT_EQ(0u, num_flexfec_streams_);
Stefan Holmerff2a6352016-01-14 10:00:21 +010091 EXPECT_LE(num_audio_streams_, 1u);
stefan4fbd1452015-09-28 03:57:14 -070092}
93
Danil Chapovalov577c5802019-10-31 12:33:17 +010094RampUpTester::~RampUpTester() = default;
stefan4fbd1452015-09-28 03:57:14 -070095
Niels Möllerde8e6e62018-11-13 15:10:33 +010096void RampUpTester::ModifySenderBitrateConfig(
97 BitrateConstraints* bitrate_config) {
stefan4fbd1452015-09-28 03:57:14 -070098 if (start_bitrate_bps_ != 0) {
Niels Möllerde8e6e62018-11-13 15:10:33 +010099 bitrate_config->start_bitrate_bps = start_bitrate_bps_;
stefan4fbd1452015-09-28 03:57:14 -0700100 }
Niels Möllerde8e6e62018-11-13 15:10:33 +0100101 bitrate_config->min_bitrate_bps = 10000;
stefan4fbd1452015-09-28 03:57:14 -0700102}
103
stefanff483612015-12-21 03:14:00 -0800104void RampUpTester::OnVideoStreamsCreated(
stefan4fbd1452015-09-28 03:57:14 -0700105 VideoSendStream* send_stream,
106 const std::vector<VideoReceiveStream*>& receive_streams) {
107 send_stream_ = send_stream;
108}
109
Danil Chapovalov44db4362019-09-30 04:16:28 +0200110std::unique_ptr<test::PacketTransport> RampUpTester::CreateSendTransport(
111 TaskQueueBase* task_queue,
eladalon413ee9a2017-08-22 04:02:52 -0700112 Call* sender_call) {
Mirko Bonadei317a1f02019-09-17 17:06:18 +0200113 auto network = std::make_unique<SimulatedNetwork>(forward_transport_config_);
Artem Titov631cafa2018-08-21 21:01:00 +0200114 send_simulated_network_ = network.get();
Danil Chapovalov44db4362019-09-30 04:16:28 +0200115 auto send_transport = std::make_unique<test::PacketTransport>(
eladalon413ee9a2017-08-22 04:02:52 -0700116 task_queue, sender_call, this, test::PacketTransport::kSender,
Artem Titov4e199e92018-08-20 13:30:39 +0200117 test::CallTest::payload_type_map_,
Mirko Bonadei317a1f02019-09-17 17:06:18 +0200118 std::make_unique<FakeNetworkPipe>(Clock::GetRealTimeClock(),
119 std::move(network)));
Danil Chapovalov44db4362019-09-30 04:16:28 +0200120 send_transport_ = send_transport.get();
121 return send_transport;
stefanf116bd02015-10-27 08:29:42 -0700122}
123
Stefan Holmerd20e6512016-01-12 15:51:22 +0100124size_t RampUpTester::GetNumVideoStreams() const {
125 return num_video_streams_;
126}
127
Stefan Holmerff2a6352016-01-14 10:00:21 +0100128size_t RampUpTester::GetNumAudioStreams() const {
129 return num_audio_streams_;
130}
131
philipel5ef2bc12017-02-21 07:28:31 -0800132size_t RampUpTester::GetNumFlexfecStreams() const {
133 return num_flexfec_streams_;
134}
135
perkjfa10b552016-10-02 23:45:26 -0700136class RampUpTester::VideoStreamFactory
137 : public VideoEncoderConfig::VideoStreamFactoryInterface {
138 public:
139 VideoStreamFactory() {}
140
141 private:
142 std::vector<VideoStream> CreateEncoderStreams(
143 int width,
144 int height,
145 const VideoEncoderConfig& encoder_config) override {
146 std::vector<VideoStream> streams =
147 test::CreateVideoStreams(width, height, encoder_config);
148 if (encoder_config.number_of_streams == 1) {
149 streams[0].target_bitrate_bps = streams[0].max_bitrate_bps = 2000000;
150 }
151 return streams;
152 }
153};
154
stefanff483612015-12-21 03:14:00 -0800155void RampUpTester::ModifyVideoConfigs(
stefan4fbd1452015-09-28 03:57:14 -0700156 VideoSendStream::Config* send_config,
157 std::vector<VideoReceiveStream::Config>* receive_configs,
158 VideoEncoderConfig* encoder_config) {
159 send_config->suspend_below_min_bitrate = true;
perkjfa10b552016-10-02 23:45:26 -0700160 encoder_config->number_of_streams = num_video_streams_;
161 encoder_config->max_bitrate_bps = 2000000;
162 encoder_config->video_stream_factory =
163 new rtc::RefCountedObject<RampUpTester::VideoStreamFactory>();
stefanff483612015-12-21 03:14:00 -0800164 if (num_video_streams_ == 1) {
stefan4fbd1452015-09-28 03:57:14 -0700165 // For single stream rampup until 1mbps
166 expected_bitrate_bps_ = kSingleStreamTargetBps;
167 } else {
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200168 // To ensure simulcast rate allocation.
169 send_config->rtp.payload_name = "VP8";
170 encoder_config->codec_type = kVideoCodecVP8;
perkjfa10b552016-10-02 23:45:26 -0700171 std::vector<VideoStream> streams = test::CreateVideoStreams(
172 test::CallTest::kDefaultWidth, test::CallTest::kDefaultHeight,
173 *encoder_config);
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200174 // For multi stream rampup until all streams are being sent. That means
175 // enough bitrate to send all the target streams plus the min bitrate of
176 // the last one.
perkjfa10b552016-10-02 23:45:26 -0700177 expected_bitrate_bps_ = streams.back().min_bitrate_bps;
178 for (size_t i = 0; i < streams.size() - 1; ++i) {
179 expected_bitrate_bps_ += streams[i].target_bitrate_bps;
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000180 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000181 }
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000182
stefan4fbd1452015-09-28 03:57:14 -0700183 send_config->rtp.extensions.clear();
184
185 bool remb;
stefan43edf0f2015-11-20 18:05:48 -0800186 bool transport_cc;
isheriff6f8d6862016-05-26 11:24:55 -0700187 if (extension_type_ == RtpExtension::kAbsSendTimeUri) {
stefan4fbd1452015-09-28 03:57:14 -0700188 remb = true;
stefan43edf0f2015-11-20 18:05:48 -0800189 transport_cc = false;
stefan4fbd1452015-09-28 03:57:14 -0700190 send_config->rtp.extensions.push_back(
191 RtpExtension(extension_type_.c_str(), kAbsSendTimeExtensionId));
isheriff6f8d6862016-05-26 11:24:55 -0700192 } else if (extension_type_ == RtpExtension::kTransportSequenceNumberUri) {
stefan4fbd1452015-09-28 03:57:14 -0700193 remb = false;
stefan43edf0f2015-11-20 18:05:48 -0800194 transport_cc = true;
stefan4fbd1452015-09-28 03:57:14 -0700195 send_config->rtp.extensions.push_back(RtpExtension(
196 extension_type_.c_str(), kTransportSequenceNumberExtensionId));
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000197 } else {
stefan4fbd1452015-09-28 03:57:14 -0700198 remb = true;
stefan43edf0f2015-11-20 18:05:48 -0800199 transport_cc = false;
stefan4fbd1452015-09-28 03:57:14 -0700200 send_config->rtp.extensions.push_back(RtpExtension(
201 extension_type_.c_str(), kTransmissionTimeOffsetExtensionId));
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000202 }
stefan4fbd1452015-09-28 03:57:14 -0700203
204 send_config->rtp.nack.rtp_history_ms = test::CallTest::kNackRtpHistoryMs;
stefanff483612015-12-21 03:14:00 -0800205 send_config->rtp.ssrcs = video_ssrcs_;
stefan4fbd1452015-09-28 03:57:14 -0700206 if (rtx_) {
207 send_config->rtp.rtx.payload_type = test::CallTest::kSendRtxPayloadType;
stefanff483612015-12-21 03:14:00 -0800208 send_config->rtp.rtx.ssrcs = video_rtx_ssrcs_;
stefan4fbd1452015-09-28 03:57:14 -0700209 }
210 if (red_) {
brandtrb5f2c3f2016-10-04 23:28:39 -0700211 send_config->rtp.ulpfec.ulpfec_payload_type =
stefan4fbd1452015-09-28 03:57:14 -0700212 test::CallTest::kUlpfecPayloadType;
brandtrb5f2c3f2016-10-04 23:28:39 -0700213 send_config->rtp.ulpfec.red_payload_type = test::CallTest::kRedPayloadType;
brandtrfbfb5362016-11-17 04:18:37 -0800214 if (rtx_) {
215 send_config->rtp.ulpfec.red_rtx_payload_type =
216 test::CallTest::kRtxRedPayloadType;
217 }
stefan4fbd1452015-09-28 03:57:14 -0700218 }
219
220 size_t i = 0;
221 for (VideoReceiveStream::Config& recv_config : *receive_configs) {
stefan43edf0f2015-11-20 18:05:48 -0800222 recv_config.rtp.transport_cc = transport_cc;
stefan4fbd1452015-09-28 03:57:14 -0700223 recv_config.rtp.extensions = send_config->rtp.extensions;
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200224 recv_config.decoders.reserve(1);
225 recv_config.decoders[0].payload_type = send_config->rtp.payload_type;
Niels Möllercb7e1d22018-09-11 15:56:04 +0200226 recv_config.decoders[0].video_format =
227 SdpVideoFormat(send_config->rtp.payload_name);
stefan4fbd1452015-09-28 03:57:14 -0700228
stefanff483612015-12-21 03:14:00 -0800229 recv_config.rtp.remote_ssrc = video_ssrcs_[i];
stefan4fbd1452015-09-28 03:57:14 -0700230 recv_config.rtp.nack.rtp_history_ms = send_config->rtp.nack.rtp_history_ms;
231
232 if (red_) {
nisse3b3622f2017-09-26 02:49:21 -0700233 recv_config.rtp.red_payload_type =
brandtrb5f2c3f2016-10-04 23:28:39 -0700234 send_config->rtp.ulpfec.red_payload_type;
nisse3b3622f2017-09-26 02:49:21 -0700235 recv_config.rtp.ulpfec_payload_type =
brandtrb5f2c3f2016-10-04 23:28:39 -0700236 send_config->rtp.ulpfec.ulpfec_payload_type;
brandtrfbfb5362016-11-17 04:18:37 -0800237 if (rtx_) {
nisseca5706d2017-09-11 02:32:16 -0700238 recv_config.rtp.rtx_associated_payload_types
239 [send_config->rtp.ulpfec.red_rtx_payload_type] =
240 send_config->rtp.ulpfec.red_payload_type;
brandtrfbfb5362016-11-17 04:18:37 -0800241 }
stefan4fbd1452015-09-28 03:57:14 -0700242 }
243
244 if (rtx_) {
brandtr14742122017-01-27 04:53:07 -0800245 recv_config.rtp.rtx_ssrc = video_rtx_ssrcs_[i];
246 recv_config.rtp
nisse26e3abb2017-08-25 04:44:25 -0700247 .rtx_associated_payload_types[send_config->rtp.rtx.payload_type] =
Niels Möller259a4972018-04-05 15:36:51 +0200248 send_config->rtp.payload_type;
stefan4fbd1452015-09-28 03:57:14 -0700249 }
250 ++i;
251 }
philipel5ef2bc12017-02-21 07:28:31 -0800252
253 RTC_DCHECK_LE(num_flexfec_streams_, 1);
254 if (num_flexfec_streams_ == 1) {
255 send_config->rtp.flexfec.payload_type = test::CallTest::kFlexfecPayloadType;
256 send_config->rtp.flexfec.ssrc = test::CallTest::kFlexfecSendSsrc;
257 send_config->rtp.flexfec.protected_media_ssrcs = {video_ssrcs_[0]};
258 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000259}
260
Stefan Holmerff2a6352016-01-14 10:00:21 +0100261void RampUpTester::ModifyAudioConfigs(
262 AudioSendStream::Config* send_config,
263 std::vector<AudioReceiveStream::Config>* receive_configs) {
264 if (num_audio_streams_ == 0)
265 return;
266
isheriff6f8d6862016-05-26 11:24:55 -0700267 EXPECT_NE(RtpExtension::kTimestampOffsetUri, extension_type_)
Stefan Holmerff2a6352016-01-14 10:00:21 +0100268 << "Audio BWE not supported with toffset.";
philipel5ef2bc12017-02-21 07:28:31 -0800269 EXPECT_NE(RtpExtension::kAbsSendTimeUri, extension_type_)
270 << "Audio BWE not supported with abs-send-time.";
Stefan Holmerff2a6352016-01-14 10:00:21 +0100271
272 send_config->rtp.ssrc = audio_ssrcs_[0];
273 send_config->rtp.extensions.clear();
274
minyue10cbb462016-11-07 09:29:22 -0800275 send_config->min_bitrate_bps = 6000;
276 send_config->max_bitrate_bps = 60000;
mflodman86cc6ff2016-07-26 04:44:06 -0700277
Stefan Holmerff2a6352016-01-14 10:00:21 +0100278 bool transport_cc = false;
philipel5ef2bc12017-02-21 07:28:31 -0800279 if (extension_type_ == RtpExtension::kTransportSequenceNumberUri) {
Stefan Holmerff2a6352016-01-14 10:00:21 +0100280 transport_cc = true;
281 send_config->rtp.extensions.push_back(RtpExtension(
282 extension_type_.c_str(), kTransportSequenceNumberExtensionId));
283 }
284
285 for (AudioReceiveStream::Config& recv_config : *receive_configs) {
Stefan Holmerff2a6352016-01-14 10:00:21 +0100286 recv_config.rtp.transport_cc = transport_cc;
287 recv_config.rtp.extensions = send_config->rtp.extensions;
288 recv_config.rtp.remote_ssrc = send_config->rtp.ssrc;
289 }
290}
291
philipel5ef2bc12017-02-21 07:28:31 -0800292void RampUpTester::ModifyFlexfecConfigs(
293 std::vector<FlexfecReceiveStream::Config>* receive_configs) {
294 if (num_flexfec_streams_ == 0)
295 return;
296 RTC_DCHECK_EQ(1, num_flexfec_streams_);
297 (*receive_configs)[0].payload_type = test::CallTest::kFlexfecPayloadType;
298 (*receive_configs)[0].remote_ssrc = test::CallTest::kFlexfecSendSsrc;
299 (*receive_configs)[0].protected_media_ssrcs = {video_ssrcs_[0]};
300 (*receive_configs)[0].local_ssrc = video_ssrcs_[0];
301 if (extension_type_ == RtpExtension::kAbsSendTimeUri) {
302 (*receive_configs)[0].transport_cc = false;
303 (*receive_configs)[0].rtp_header_extensions.push_back(
304 RtpExtension(extension_type_.c_str(), kAbsSendTimeExtensionId));
305 } else if (extension_type_ == RtpExtension::kTransportSequenceNumberUri) {
306 (*receive_configs)[0].transport_cc = true;
307 (*receive_configs)[0].rtp_header_extensions.push_back(RtpExtension(
308 extension_type_.c_str(), kTransportSequenceNumberExtensionId));
309 }
310}
311
stefan4fbd1452015-09-28 03:57:14 -0700312void RampUpTester::OnCallsCreated(Call* sender_call, Call* receiver_call) {
Tommi5e005f42019-08-05 15:29:14 +0200313 RTC_DCHECK(sender_call);
stefan4fbd1452015-09-28 03:57:14 -0700314 sender_call_ = sender_call;
Danil Chapovalov9f5ae7b2019-10-21 11:08:13 +0200315 pending_task_ = RepeatingTaskHandle::Start(task_queue_, [this] {
316 PollStats();
317 return kPollInterval;
318 });
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000319}
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000320
tommi0f8b4032017-02-22 11:22:05 -0800321void RampUpTester::PollStats() {
Tommi6b117a52019-08-20 09:58:56 +0200322 RTC_DCHECK_RUN_ON(task_queue_);
323
Tommi5e005f42019-08-05 15:29:14 +0200324 Call::Stats stats = sender_call_->GetStats();
325 EXPECT_GE(expected_bitrate_bps_, 0);
stefan4fbd1452015-09-28 03:57:14 -0700326
Tommi5e005f42019-08-05 15:29:14 +0200327 if (stats.send_bandwidth_bps >= expected_bitrate_bps_ &&
328 (min_run_time_ms_ == -1 ||
329 clock_->TimeInMilliseconds() - test_start_ms_ >= min_run_time_ms_)) {
330 ramp_up_finished_ms_ = clock_->TimeInMilliseconds();
331 observation_complete_.Set();
Danil Chapovalov9f5ae7b2019-10-21 11:08:13 +0200332 pending_task_.Stop();
Tommi5e005f42019-08-05 15:29:14 +0200333 }
Erik Språng468e62a2015-07-06 10:50:47 +0200334}
335
stefan4fbd1452015-09-28 03:57:14 -0700336void RampUpTester::ReportResult(const std::string& measurement,
337 size_t value,
338 const std::string& units) const {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000339 webrtc::test::PrintResult(
340 measurement, "",
stefanff483612015-12-21 03:14:00 -0800341 ::testing::UnitTest::GetInstance()->current_test_info()->name(), value,
342 units, false);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000343}
344
stefan092508a2015-09-29 02:26:42 -0700345void RampUpTester::AccumulateStats(const VideoSendStream::StreamStats& stream,
346 size_t* total_packets_sent,
347 size_t* total_sent,
348 size_t* padding_sent,
349 size_t* media_sent) const {
stefan4fbd1452015-09-28 03:57:14 -0700350 *total_packets_sent += stream.rtp_stats.transmitted.packets +
351 stream.rtp_stats.retransmitted.packets +
352 stream.rtp_stats.fec.packets;
353 *total_sent += stream.rtp_stats.transmitted.TotalBytes() +
354 stream.rtp_stats.retransmitted.TotalBytes() +
355 stream.rtp_stats.fec.TotalBytes();
356 *padding_sent += stream.rtp_stats.transmitted.padding_bytes +
357 stream.rtp_stats.retransmitted.padding_bytes +
358 stream.rtp_stats.fec.padding_bytes;
359 *media_sent += stream.rtp_stats.MediaPayloadBytes();
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000360}
361
stefan4fbd1452015-09-28 03:57:14 -0700362void RampUpTester::TriggerTestDone() {
Erik Språngf3a7c9d2015-10-05 14:03:22 +0200363 RTC_DCHECK_GE(test_start_ms_, 0);
364
Stefan Holmerff2a6352016-01-14 10:00:21 +0100365 // TODO(holmer): Add audio send stats here too when those APIs are available.
mflodman86cc6ff2016-07-26 04:44:06 -0700366 if (!send_stream_)
367 return;
368
Tommi5e005f42019-08-05 15:29:14 +0200369 // Stop polling stats.
370 // Corner case for field_trials=WebRTC-QuickPerfTest/Enabled/
Danil Chapovalov9f5ae7b2019-10-21 11:08:13 +0200371 SendTask(RTC_FROM_HERE, task_queue_, [this] { pending_task_.Stop(); });
Tommi5e005f42019-08-05 15:29:14 +0200372
stefan4fbd1452015-09-28 03:57:14 -0700373 VideoSendStream::Stats send_stats = send_stream_->GetStats();
Tommi5e005f42019-08-05 15:29:14 +0200374 send_stream_ = nullptr; // To avoid dereferencing a bad pointer.
stefan4fbd1452015-09-28 03:57:14 -0700375
376 size_t total_packets_sent = 0;
377 size_t total_sent = 0;
378 size_t padding_sent = 0;
379 size_t media_sent = 0;
stefanff483612015-12-21 03:14:00 -0800380 for (uint32_t ssrc : video_ssrcs_) {
stefan092508a2015-09-29 02:26:42 -0700381 AccumulateStats(send_stats.substreams[ssrc], &total_packets_sent,
382 &total_sent, &padding_sent, &media_sent);
stefan4fbd1452015-09-28 03:57:14 -0700383 }
384
385 size_t rtx_total_packets_sent = 0;
386 size_t rtx_total_sent = 0;
387 size_t rtx_padding_sent = 0;
388 size_t rtx_media_sent = 0;
stefanff483612015-12-21 03:14:00 -0800389 for (uint32_t rtx_ssrc : video_rtx_ssrcs_) {
stefan092508a2015-09-29 02:26:42 -0700390 AccumulateStats(send_stats.substreams[rtx_ssrc], &rtx_total_packets_sent,
391 &rtx_total_sent, &rtx_padding_sent, &rtx_media_sent);
stefan4fbd1452015-09-28 03:57:14 -0700392 }
393
stefan5a2c5062017-01-27 06:43:18 -0800394 if (report_perf_stats_) {
stefan5a2c5062017-01-27 06:43:18 -0800395 ReportResult("ramp-up-media-sent", media_sent, "bytes");
396 ReportResult("ramp-up-padding-sent", padding_sent, "bytes");
stefan5a2c5062017-01-27 06:43:18 -0800397 ReportResult("ramp-up-rtx-media-sent", rtx_media_sent, "bytes");
398 ReportResult("ramp-up-rtx-padding-sent", rtx_padding_sent, "bytes");
399 if (ramp_up_finished_ms_ >= 0) {
400 ReportResult("ramp-up-time", ramp_up_finished_ms_ - test_start_ms_,
401 "milliseconds");
402 }
403 ReportResult("ramp-up-average-network-latency",
404 send_transport_->GetAverageDelayMs(), "milliseconds");
stefan4fbd1452015-09-28 03:57:14 -0700405 }
406}
407
408void RampUpTester::PerformTest() {
Erik Språngf3a7c9d2015-10-05 14:03:22 +0200409 test_start_ms_ = clock_->TimeInMilliseconds();
Peter Boström5811a392015-12-10 13:02:50 +0100410 EXPECT_TRUE(Wait()) << "Timed out while waiting for ramp-up to complete.";
stefan4fbd1452015-09-28 03:57:14 -0700411 TriggerTestDone();
412}
413
Danil Chapovalov9f5ae7b2019-10-21 11:08:13 +0200414RampUpDownUpTester::RampUpDownUpTester(size_t num_video_streams,
415 size_t num_audio_streams,
416 size_t num_flexfec_streams,
417 unsigned int start_bitrate_bps,
418 const std::string& extension_type,
419 bool rtx,
420 bool red,
421 const std::vector<int>& loss_rates,
422 bool report_perf_stats,
423 TaskQueueBase* task_queue)
Stefan Holmerff2a6352016-01-14 10:00:21 +0100424 : RampUpTester(num_video_streams,
425 num_audio_streams,
philipel5ef2bc12017-02-21 07:28:31 -0800426 num_flexfec_streams,
Stefan Holmerff2a6352016-01-14 10:00:21 +0100427 start_bitrate_bps,
stefan5a2c5062017-01-27 06:43:18 -0800428 0,
Stefan Holmerff2a6352016-01-14 10:00:21 +0100429 extension_type,
430 rtx,
stefan5a2c5062017-01-27 06:43:18 -0800431 red,
Tommi5e005f42019-08-05 15:29:14 +0200432 report_perf_stats,
433 task_queue),
stefan76d9c9c2017-04-01 06:51:09 -0700434 link_rates_({4 * GetExpectedHighBitrate() / (3 * 1000),
435 kLowBandwidthLimitBps / 1000,
436 4 * GetExpectedHighBitrate() / (3 * 1000), 0}),
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000437 test_state_(kFirstRampup),
philipel5ef2bc12017-02-21 07:28:31 -0800438 next_state_(kTransitionToNextState),
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000439 state_start_ms_(clock_->TimeInMilliseconds()),
stefan4fbd1452015-09-28 03:57:14 -0700440 interval_start_ms_(clock_->TimeInMilliseconds()),
philipel5ef2bc12017-02-21 07:28:31 -0800441 sent_bytes_(0),
442 loss_rates_(loss_rates) {
443 forward_transport_config_.link_capacity_kbps = link_rates_[test_state_];
444 forward_transport_config_.queue_delay_ms = 100;
445 forward_transport_config_.loss_percent = loss_rates_[test_state_];
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000446}
447
stefan4fbd1452015-09-28 03:57:14 -0700448RampUpDownUpTester::~RampUpDownUpTester() {}
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000449
tommi0f8b4032017-02-22 11:22:05 -0800450void RampUpDownUpTester::PollStats() {
Danil Chapovalov9f5ae7b2019-10-21 11:08:13 +0200451 if (test_state_ == kTestEnd) {
452 pending_task_.Stop();
453 }
Tommi5e005f42019-08-05 15:29:14 +0200454
455 int transmit_bitrate_bps = 0;
456 bool suspended = false;
457 if (num_video_streams_ > 0 && send_stream_) {
458 webrtc::VideoSendStream::Stats stats = send_stream_->GetStats();
459 for (const auto& it : stats.substreams) {
460 transmit_bitrate_bps += it.second.total_bitrate_bps;
Alex Narest78609d52017-10-20 10:37:47 +0200461 }
Tommi5e005f42019-08-05 15:29:14 +0200462 suspended = stats.suspended;
463 }
464 if (num_audio_streams_ > 0 && sender_call_) {
465 // An audio send stream doesn't have bitrate stats, so the call send BW is
466 // currently used instead.
467 transmit_bitrate_bps = sender_call_->GetStats().send_bandwidth_bps;
468 }
469
470 EvolveTestState(transmit_bitrate_bps, suspended);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000471}
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000472
Niels Möllerde8e6e62018-11-13 15:10:33 +0100473void RampUpDownUpTester::ModifyReceiverBitrateConfig(
474 BitrateConstraints* bitrate_config) {
475 bitrate_config->min_bitrate_bps = 10000;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000476}
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000477
stefan4fbd1452015-09-28 03:57:14 -0700478std::string RampUpDownUpTester::GetModifierString() const {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000479 std::string str("_");
stefanff483612015-12-21 03:14:00 -0800480 if (num_video_streams_ > 0) {
Jonas Olsson0a713b62018-04-04 15:49:32 +0200481 str += rtc::ToString(num_video_streams_);
stefanff483612015-12-21 03:14:00 -0800482 str += "stream";
483 str += (num_video_streams_ > 1 ? "s" : "");
484 str += "_";
485 }
486 if (num_audio_streams_ > 0) {
Jonas Olsson0a713b62018-04-04 15:49:32 +0200487 str += rtc::ToString(num_audio_streams_);
stefanff483612015-12-21 03:14:00 -0800488 str += "stream";
489 str += (num_audio_streams_ > 1 ? "s" : "");
490 str += "_";
491 }
stefan4fbd1452015-09-28 03:57:14 -0700492 str += (rtx_ ? "" : "no");
Edward Lemurdd3987f2018-01-04 19:44:54 +0100493 str += "rtx_";
494 str += (red_ ? "" : "no");
495 str += "red";
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000496 return str;
497}
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000498
stefandb752f92016-12-05 08:23:40 -0800499int RampUpDownUpTester::GetExpectedHighBitrate() const {
stefan38d8b3c2017-01-09 04:19:24 -0800500 int expected_bitrate_bps = 0;
501 if (num_audio_streams_ > 0)
502 expected_bitrate_bps += kExpectedHighAudioBitrateBps;
503 if (num_video_streams_ > 0)
504 expected_bitrate_bps += kExpectedHighVideoBitrateBps;
505 return expected_bitrate_bps;
506}
507
philipel5ef2bc12017-02-21 07:28:31 -0800508size_t RampUpDownUpTester::GetFecBytes() const {
509 size_t flex_fec_bytes = 0;
510 if (num_flexfec_streams_ > 0) {
511 webrtc::VideoSendStream::Stats stats = send_stream_->GetStats();
512 for (const auto& kv : stats.substreams)
513 flex_fec_bytes += kv.second.rtp_stats.fec.TotalBytes();
514 }
515 return flex_fec_bytes;
516}
517
518bool RampUpDownUpTester::ExpectingFec() const {
519 return num_flexfec_streams_ > 0 && forward_transport_config_.loss_percent > 0;
520}
521
stefan4fbd1452015-09-28 03:57:14 -0700522void RampUpDownUpTester::EvolveTestState(int bitrate_bps, bool suspended) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000523 int64_t now = clock_->TimeInMilliseconds();
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000524 switch (test_state_) {
philipel5ef2bc12017-02-21 07:28:31 -0800525 case kFirstRampup:
stefan4fbd1452015-09-28 03:57:14 -0700526 EXPECT_FALSE(suspended);
stefandb752f92016-12-05 08:23:40 -0800527 if (bitrate_bps >= GetExpectedHighBitrate()) {
stefan45b5fe52017-03-09 06:27:02 -0800528 if (report_perf_stats_) {
529 webrtc::test::PrintResult("ramp_up_down_up", GetModifierString(),
530 "first_rampup", now - state_start_ms_, "ms",
531 false);
532 }
philipel5ef2bc12017-02-21 07:28:31 -0800533 // Apply loss during the transition between states if FEC is enabled.
534 forward_transport_config_.loss_percent = loss_rates_[test_state_];
535 test_state_ = kTransitionToNextState;
536 next_state_ = kLowRate;
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000537 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000538 break;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000539 case kLowRate: {
mflodman86cc6ff2016-07-26 04:44:06 -0700540 // Audio streams are never suspended.
541 bool check_suspend_state = num_video_streams_ > 0;
Sebastian Jansson12fb1702018-02-23 11:34:18 +0100542 if (bitrate_bps < kLowBandwidthLimitBps + kLowBitrateMarginBps &&
mflodman86cc6ff2016-07-26 04:44:06 -0700543 suspended == check_suspend_state) {
stefan45b5fe52017-03-09 06:27:02 -0800544 if (report_perf_stats_) {
545 webrtc::test::PrintResult("ramp_up_down_up", GetModifierString(),
546 "rampdown", now - state_start_ms_, "ms",
547 false);
548 }
philipel5ef2bc12017-02-21 07:28:31 -0800549 // Apply loss during the transition between states if FEC is enabled.
550 forward_transport_config_.loss_percent = loss_rates_[test_state_];
551 test_state_ = kTransitionToNextState;
552 next_state_ = kSecondRampup;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000553 }
554 break;
555 }
philipel5ef2bc12017-02-21 07:28:31 -0800556 case kSecondRampup:
stefandb752f92016-12-05 08:23:40 -0800557 if (bitrate_bps >= GetExpectedHighBitrate() && !suspended) {
stefan45b5fe52017-03-09 06:27:02 -0800558 if (report_perf_stats_) {
559 webrtc::test::PrintResult("ramp_up_down_up", GetModifierString(),
560 "second_rampup", now - state_start_ms_,
561 "ms", false);
562 ReportResult("ramp-up-down-up-average-network-latency",
563 send_transport_->GetAverageDelayMs(), "milliseconds");
564 }
philipel5ef2bc12017-02-21 07:28:31 -0800565 // Apply loss during the transition between states if FEC is enabled.
566 forward_transport_config_.loss_percent = loss_rates_[test_state_];
567 test_state_ = kTransitionToNextState;
568 next_state_ = kTestEnd;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000569 }
570 break;
philipel5ef2bc12017-02-21 07:28:31 -0800571 case kTestEnd:
572 observation_complete_.Set();
573 break;
574 case kTransitionToNextState:
575 if (!ExpectingFec() || GetFecBytes() > 0) {
576 test_state_ = next_state_;
577 forward_transport_config_.link_capacity_kbps = link_rates_[test_state_];
578 // No loss while ramping up and down as it may affect the BWE
579 // negatively, making the test flaky.
580 forward_transport_config_.loss_percent = 0;
581 state_start_ms_ = now;
582 interval_start_ms_ = now;
583 sent_bytes_ = 0;
Artem Titov631cafa2018-08-21 21:01:00 +0200584 send_simulated_network_->SetConfig(forward_transport_config_);
philipel5ef2bc12017-02-21 07:28:31 -0800585 }
586 break;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000587 }
588}
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +0000589
stefan4fbd1452015-09-28 03:57:14 -0700590class RampUpTest : public test::CallTest {
Erik Språng6b8d3552015-09-24 15:06:57 +0200591 public:
Danil Chapovalov304ea5f2019-04-11 15:18:18 +0200592 RampUpTest()
593 : task_queue_factory_(CreateDefaultTaskQueueFactory()),
594 rtc_event_log_factory_(task_queue_factory_.get()) {
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200595 std::string dump_name(absl::GetFlag(FLAGS_ramp_dump_name));
Sebastian Janssonf5e767d2018-10-15 13:24:31 +0200596 if (!dump_name.empty()) {
Danil Chapovalov304ea5f2019-04-11 15:18:18 +0200597 send_event_log_ = rtc_event_log_factory_.CreateRtcEventLog(
598 RtcEventLog::EncodingType::Legacy);
599 recv_event_log_ = rtc_event_log_factory_.CreateRtcEventLog(
600 RtcEventLog::EncodingType::Legacy);
Sebastian Janssonf5e767d2018-10-15 13:24:31 +0200601 bool event_log_started =
602 send_event_log_->StartLogging(
Mirko Bonadei317a1f02019-09-17 17:06:18 +0200603 std::make_unique<RtcEventLogOutputFile>(
Sebastian Janssonf5e767d2018-10-15 13:24:31 +0200604 dump_name + ".send.rtc.dat", RtcEventLog::kUnlimitedOutput),
605 RtcEventLog::kImmediateOutput) &&
606 recv_event_log_->StartLogging(
Mirko Bonadei317a1f02019-09-17 17:06:18 +0200607 std::make_unique<RtcEventLogOutputFile>(
Sebastian Janssonf5e767d2018-10-15 13:24:31 +0200608 dump_name + ".recv.rtc.dat", RtcEventLog::kUnlimitedOutput),
609 RtcEventLog::kImmediateOutput);
610 RTC_DCHECK(event_log_started);
611 }
612 }
Danil Chapovalov304ea5f2019-04-11 15:18:18 +0200613
614 private:
615 const std::unique_ptr<TaskQueueFactory> task_queue_factory_;
616 RtcEventLogFactory rtc_event_log_factory_;
Erik Språng6b8d3552015-09-24 15:06:57 +0200617};
618
Stefan Holmerff2a6352016-01-14 10:00:21 +0100619static const uint32_t kStartBitrateBps = 60000;
620
stefan38d8b3c2017-01-09 04:19:24 -0800621TEST_F(RampUpTest, UpDownUpAbsSendTimeSimulcastRedRtx) {
philipel5ef2bc12017-02-21 07:28:31 -0800622 std::vector<int> loss_rates = {0, 0, 0, 0};
623 RampUpDownUpTester test(3, 0, 0, kStartBitrateBps,
stefan45b5fe52017-03-09 06:27:02 -0800624 RtpExtension::kAbsSendTimeUri, true, true, loss_rates,
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200625 true, task_queue());
stefane74eef12016-01-08 06:47:13 -0800626 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800627}
Stefan Holmerff2a6352016-01-14 10:00:21 +0100628
Taylor Brandstetterba6b5032018-02-16 09:59:56 -0800629// TODO(bugs.webrtc.org/8878)
630#if defined(WEBRTC_MAC)
631#define MAYBE_UpDownUpTransportSequenceNumberRtx \
632 DISABLED_UpDownUpTransportSequenceNumberRtx
633#else
634#define MAYBE_UpDownUpTransportSequenceNumberRtx \
635 UpDownUpTransportSequenceNumberRtx
636#endif
637TEST_F(RampUpTest, MAYBE_UpDownUpTransportSequenceNumberRtx) {
philipel5ef2bc12017-02-21 07:28:31 -0800638 std::vector<int> loss_rates = {0, 0, 0, 0};
639 RampUpDownUpTester test(3, 0, 0, kStartBitrateBps,
isheriff6f8d6862016-05-26 11:24:55 -0700640 RtpExtension::kTransportSequenceNumberUri, true,
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200641 false, loss_rates, true, task_queue());
philipel5ef2bc12017-02-21 07:28:31 -0800642 RunBaseTest(&test);
643}
644
stefan45b5fe52017-03-09 06:27:02 -0800645// TODO(holmer): Tests which don't report perf stats should be moved to a
646// different executable since they per definition are not perf tests.
Taylor Brandstetter05d98222017-10-10 12:12:53 -0700647// This test is disabled because it crashes on Linux, and is flaky on other
648// platforms. See: crbug.com/webrtc/7919
649TEST_F(RampUpTest, DISABLED_UpDownUpTransportSequenceNumberPacketLoss) {
philipel5ef2bc12017-02-21 07:28:31 -0800650 std::vector<int> loss_rates = {20, 0, 0, 0};
651 RampUpDownUpTester test(1, 0, 1, kStartBitrateBps,
652 RtpExtension::kTransportSequenceNumberUri, true,
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200653 false, loss_rates, false, task_queue());
Stefan Holmerff2a6352016-01-14 10:00:21 +0100654 RunBaseTest(&test);
655}
656
Taylor Brandstetterab86e7f2018-02-12 15:16:02 -0800657// TODO(bugs.webrtc.org/8878)
658#if defined(WEBRTC_MAC)
659#define MAYBE_UpDownUpAudioVideoTransportSequenceNumberRtx \
660 DISABLED_UpDownUpAudioVideoTransportSequenceNumberRtx
661#else
662#define MAYBE_UpDownUpAudioVideoTransportSequenceNumberRtx \
663 UpDownUpAudioVideoTransportSequenceNumberRtx
664#endif
665TEST_F(RampUpTest, MAYBE_UpDownUpAudioVideoTransportSequenceNumberRtx) {
Per Kjellander914351d2019-02-15 10:54:55 +0100666 test::ScopedFieldTrials field_trials("WebRTC-Audio-SendSideBwe/Enabled/");
philipel5ef2bc12017-02-21 07:28:31 -0800667 std::vector<int> loss_rates = {0, 0, 0, 0};
668 RampUpDownUpTester test(3, 1, 0, kStartBitrateBps,
isheriff6f8d6862016-05-26 11:24:55 -0700669 RtpExtension::kTransportSequenceNumberUri, true,
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200670 false, loss_rates, false, task_queue());
Stefan Holmerff2a6352016-01-14 10:00:21 +0100671 RunBaseTest(&test);
672}
673
stefan38d8b3c2017-01-09 04:19:24 -0800674TEST_F(RampUpTest, UpDownUpAudioTransportSequenceNumberRtx) {
Per Kjellander914351d2019-02-15 10:54:55 +0100675 test::ScopedFieldTrials field_trials("WebRTC-Audio-SendSideBwe/Enabled/");
philipel5ef2bc12017-02-21 07:28:31 -0800676 std::vector<int> loss_rates = {0, 0, 0, 0};
677 RampUpDownUpTester test(0, 1, 0, kStartBitrateBps,
mflodman86cc6ff2016-07-26 04:44:06 -0700678 RtpExtension::kTransportSequenceNumberUri, true,
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200679 false, loss_rates, false, task_queue());
mflodman86cc6ff2016-07-26 04:44:06 -0700680 RunBaseTest(&test);
681}
682
stefan38d8b3c2017-01-09 04:19:24 -0800683TEST_F(RampUpTest, TOffsetSimulcastRedRtx) {
philipel5ef2bc12017-02-21 07:28:31 -0800684 RampUpTester test(3, 0, 0, 0, 0, RtpExtension::kTimestampOffsetUri, true,
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200685 true, true, task_queue());
stefan38d8b3c2017-01-09 04:19:24 -0800686 RunBaseTest(&test);
687}
688
689TEST_F(RampUpTest, AbsSendTime) {
philipel5ef2bc12017-02-21 07:28:31 -0800690 RampUpTester test(1, 0, 0, 0, 0, RtpExtension::kAbsSendTimeUri, false, false,
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200691 false, task_queue());
stefane74eef12016-01-08 06:47:13 -0800692 RunBaseTest(&test);
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000693}
694
stefan38d8b3c2017-01-09 04:19:24 -0800695TEST_F(RampUpTest, AbsSendTimeSimulcastRedRtx) {
philipel5ef2bc12017-02-21 07:28:31 -0800696 RampUpTester test(3, 0, 0, 0, 0, RtpExtension::kAbsSendTimeUri, true, true,
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200697 true, task_queue());
stefane74eef12016-01-08 06:47:13 -0800698 RunBaseTest(&test);
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000699}
700
stefan38d8b3c2017-01-09 04:19:24 -0800701TEST_F(RampUpTest, TransportSequenceNumber) {
philipel5ef2bc12017-02-21 07:28:31 -0800702 RampUpTester test(1, 0, 0, 0, 0, RtpExtension::kTransportSequenceNumberUri,
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200703 false, false, false, task_queue());
stefane74eef12016-01-08 06:47:13 -0800704 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200705}
706
707TEST_F(RampUpTest, TransportSequenceNumberSimulcast) {
philipel5ef2bc12017-02-21 07:28:31 -0800708 RampUpTester test(3, 0, 0, 0, 0, RtpExtension::kTransportSequenceNumberUri,
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200709 false, false, false, task_queue());
stefane74eef12016-01-08 06:47:13 -0800710 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200711}
712
stefan38d8b3c2017-01-09 04:19:24 -0800713TEST_F(RampUpTest, TransportSequenceNumberSimulcastRedRtx) {
philipel5ef2bc12017-02-21 07:28:31 -0800714 RampUpTester test(3, 0, 0, 0, 0, RtpExtension::kTransportSequenceNumberUri,
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200715 true, true, true, task_queue());
stefan5a2c5062017-01-27 06:43:18 -0800716 RunBaseTest(&test);
717}
718
Niels Möllercd2e1052018-11-08 10:23:13 +0100719TEST_F(RampUpTest, AudioTransportSequenceNumber) {
philipel5ef2bc12017-02-21 07:28:31 -0800720 RampUpTester test(0, 1, 0, 300000, 10000,
stefan5a2c5062017-01-27 06:43:18 -0800721 RtpExtension::kTransportSequenceNumberUri, false, false,
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200722 false, task_queue());
stefane74eef12016-01-08 06:47:13 -0800723 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200724}
pbos@webrtc.org744fbc72013-09-10 09:26:25 +0000725} // namespace webrtc