blob: 8f689e715269580f72075ce2aaf0c0465f041b51 [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"
Steve Anton40d55332019-01-07 10:21:47 -080016#include "absl/memory/memory.h"
Danil Chapovalov4ba04b72019-06-26 15:49:47 +020017#include "api/rtc_event_log/rtc_event_log_factory.h"
Niels Möllerd8b9ed72019-05-08 13:53:51 +020018#include "api/rtc_event_log_output_file.h"
Danil Chapovalov304ea5f2019-04-11 15:18:18 +020019#include "api/task_queue/default_task_queue_factory.h"
20#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"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020026#include "test/encoder_settings.h"
Per Kjellander914351d2019-02-15 10:54:55 +010027#include "test/field_trial.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020028#include "test/gtest.h"
29#include "test/testsupport/perf_test.h"
pbos@webrtc.org744fbc72013-09-10 09:26:25 +000030
Mirko Bonadei2ab97f62019-07-18 13:44:12 +020031ABSL_FLAG(std::string,
32 ramp_dump_name,
33 "",
34 "Filename for dumped received RTP stream.");
35
pbos@webrtc.org744fbc72013-09-10 09:26:25 +000036namespace webrtc {
pbos@webrtc.org29023282013-09-11 10:14:56 +000037namespace {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +000038
Stefan Holmer723dff12015-10-05 14:59:41 +020039static const int64_t kPollIntervalMs = 20;
philipel5ef2bc12017-02-21 07:28:31 -080040static const int kExpectedHighVideoBitrateBps = 80000;
stefandb752f92016-12-05 08:23:40 -080041static const int kExpectedHighAudioBitrateBps = 30000;
42static const int kLowBandwidthLimitBps = 20000;
Sebastian Jansson12fb1702018-02-23 11:34:18 +010043// Set target detected bitrate to slightly larger than the target bitrate to
44// avoid flakiness.
45static const int kLowBitrateMarginBps = 2000;
pbos@webrtc.org29023282013-09-11 10:14:56 +000046
stefanff483612015-12-21 03:14:00 -080047std::vector<uint32_t> GenerateSsrcs(size_t num_streams, uint32_t ssrc_offset) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +000048 std::vector<uint32_t> ssrcs;
49 for (size_t i = 0; i != num_streams; ++i)
50 ssrcs.push_back(static_cast<uint32_t>(ssrc_offset + i));
51 return ssrcs;
52}
mflodman@webrtc.orgeb16b812014-06-16 08:57:39 +000053} // namespace
henrik.lundin@webrtc.org845862f2014-03-06 07:19:28 +000054
stefanff483612015-12-21 03:14:00 -080055RampUpTester::RampUpTester(size_t num_video_streams,
56 size_t num_audio_streams,
philipel5ef2bc12017-02-21 07:28:31 -080057 size_t num_flexfec_streams,
stefan4fbd1452015-09-28 03:57:14 -070058 unsigned int start_bitrate_bps,
stefan5a2c5062017-01-27 06:43:18 -080059 int64_t min_run_time_ms,
stefan4fbd1452015-09-28 03:57:14 -070060 const std::string& extension_type,
61 bool rtx,
stefan5a2c5062017-01-27 06:43:18 -080062 bool red,
Tommi5e005f42019-08-05 15:29:14 +020063 bool report_perf_stats,
64 test::SingleThreadedTaskQueueForTesting* task_queue)
stefan4fbd1452015-09-28 03:57:14 -070065 : EndToEndTest(test::CallTest::kLongTimeoutMs),
stefan4fbd1452015-09-28 03:57:14 -070066 clock_(Clock::GetRealTimeClock()),
stefanff483612015-12-21 03:14:00 -080067 num_video_streams_(num_video_streams),
68 num_audio_streams_(num_audio_streams),
philipel5ef2bc12017-02-21 07:28:31 -080069 num_flexfec_streams_(num_flexfec_streams),
stefan4fbd1452015-09-28 03:57:14 -070070 rtx_(rtx),
71 red_(red),
stefan45b5fe52017-03-09 06:27:02 -080072 report_perf_stats_(report_perf_stats),
mflodman86cc6ff2016-07-26 04:44:06 -070073 sender_call_(nullptr),
stefan4fbd1452015-09-28 03:57:14 -070074 send_stream_(nullptr),
sprang4847ae62017-06-27 07:06:52 -070075 send_transport_(nullptr),
Artem Titov631cafa2018-08-21 21:01:00 +020076 send_simulated_network_(nullptr),
stefan4fbd1452015-09-28 03:57:14 -070077 start_bitrate_bps_(start_bitrate_bps),
stefan5a2c5062017-01-27 06:43:18 -080078 min_run_time_ms_(min_run_time_ms),
stefan@webrtc.org3d7da882014-07-08 13:59:46 +000079 expected_bitrate_bps_(0),
Erik Språngf3a7c9d2015-10-05 14:03:22 +020080 test_start_ms_(-1),
stefan4fbd1452015-09-28 03:57:14 -070081 ramp_up_finished_ms_(-1),
82 extension_type_(extension_type),
stefanff483612015-12-21 03:14:00 -080083 video_ssrcs_(GenerateSsrcs(num_video_streams_, 100)),
84 video_rtx_ssrcs_(GenerateSsrcs(num_video_streams_, 200)),
85 audio_ssrcs_(GenerateSsrcs(num_audio_streams_, 300)),
Tommi5e005f42019-08-05 15:29:14 +020086 task_queue_(task_queue) {
philipel5ef2bc12017-02-21 07:28:31 -080087 if (red_)
88 EXPECT_EQ(0u, num_flexfec_streams_);
Stefan Holmerff2a6352016-01-14 10:00:21 +010089 EXPECT_LE(num_audio_streams_, 1u);
stefan4fbd1452015-09-28 03:57:14 -070090}
91
Tommi5e005f42019-08-05 15:29:14 +020092RampUpTester::~RampUpTester() {
93 // Special case for WebRTC-QuickPerfTest/Enabled/
94 task_queue_->SendTask([this]() {
95 if (pending_task_ !=
96 static_cast<test::SingleThreadedTaskQueueForTesting::TaskId>(-1)) {
97 task_queue_->CancelTask(pending_task_);
98 pending_task_ = -1;
99 }
100 });
101}
stefan4fbd1452015-09-28 03:57:14 -0700102
Niels Möllerde8e6e62018-11-13 15:10:33 +0100103void RampUpTester::ModifySenderBitrateConfig(
104 BitrateConstraints* bitrate_config) {
stefan4fbd1452015-09-28 03:57:14 -0700105 if (start_bitrate_bps_ != 0) {
Niels Möllerde8e6e62018-11-13 15:10:33 +0100106 bitrate_config->start_bitrate_bps = start_bitrate_bps_;
stefan4fbd1452015-09-28 03:57:14 -0700107 }
Niels Möllerde8e6e62018-11-13 15:10:33 +0100108 bitrate_config->min_bitrate_bps = 10000;
stefan4fbd1452015-09-28 03:57:14 -0700109}
110
stefanff483612015-12-21 03:14:00 -0800111void RampUpTester::OnVideoStreamsCreated(
stefan4fbd1452015-09-28 03:57:14 -0700112 VideoSendStream* send_stream,
113 const std::vector<VideoReceiveStream*>& receive_streams) {
114 send_stream_ = send_stream;
115}
116
eladalon413ee9a2017-08-22 04:02:52 -0700117test::PacketTransport* RampUpTester::CreateSendTransport(
118 test::SingleThreadedTaskQueueForTesting* task_queue,
119 Call* sender_call) {
Artem Titov631cafa2018-08-21 21:01:00 +0200120 auto network = absl::make_unique<SimulatedNetwork>(forward_transport_config_);
121 send_simulated_network_ = network.get();
minyue20c84cc2017-04-10 16:57:57 -0700122 send_transport_ = new test::PacketTransport(
eladalon413ee9a2017-08-22 04:02:52 -0700123 task_queue, sender_call, this, test::PacketTransport::kSender,
Artem Titov4e199e92018-08-20 13:30:39 +0200124 test::CallTest::payload_type_map_,
Artem Titov631cafa2018-08-21 21:01:00 +0200125 absl::make_unique<FakeNetworkPipe>(Clock::GetRealTimeClock(),
126 std::move(network)));
stefane74eef12016-01-08 06:47:13 -0800127 return send_transport_;
stefanf116bd02015-10-27 08:29:42 -0700128}
129
Stefan Holmerd20e6512016-01-12 15:51:22 +0100130size_t RampUpTester::GetNumVideoStreams() const {
131 return num_video_streams_;
132}
133
Stefan Holmerff2a6352016-01-14 10:00:21 +0100134size_t RampUpTester::GetNumAudioStreams() const {
135 return num_audio_streams_;
136}
137
philipel5ef2bc12017-02-21 07:28:31 -0800138size_t RampUpTester::GetNumFlexfecStreams() const {
139 return num_flexfec_streams_;
140}
141
perkjfa10b552016-10-02 23:45:26 -0700142class RampUpTester::VideoStreamFactory
143 : public VideoEncoderConfig::VideoStreamFactoryInterface {
144 public:
145 VideoStreamFactory() {}
146
147 private:
148 std::vector<VideoStream> CreateEncoderStreams(
149 int width,
150 int height,
151 const VideoEncoderConfig& encoder_config) override {
152 std::vector<VideoStream> streams =
153 test::CreateVideoStreams(width, height, encoder_config);
154 if (encoder_config.number_of_streams == 1) {
155 streams[0].target_bitrate_bps = streams[0].max_bitrate_bps = 2000000;
156 }
157 return streams;
158 }
159};
160
stefanff483612015-12-21 03:14:00 -0800161void RampUpTester::ModifyVideoConfigs(
stefan4fbd1452015-09-28 03:57:14 -0700162 VideoSendStream::Config* send_config,
163 std::vector<VideoReceiveStream::Config>* receive_configs,
164 VideoEncoderConfig* encoder_config) {
165 send_config->suspend_below_min_bitrate = true;
perkjfa10b552016-10-02 23:45:26 -0700166 encoder_config->number_of_streams = num_video_streams_;
167 encoder_config->max_bitrate_bps = 2000000;
168 encoder_config->video_stream_factory =
169 new rtc::RefCountedObject<RampUpTester::VideoStreamFactory>();
stefanff483612015-12-21 03:14:00 -0800170 if (num_video_streams_ == 1) {
stefan4fbd1452015-09-28 03:57:14 -0700171 // For single stream rampup until 1mbps
172 expected_bitrate_bps_ = kSingleStreamTargetBps;
173 } else {
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200174 // To ensure simulcast rate allocation.
175 send_config->rtp.payload_name = "VP8";
176 encoder_config->codec_type = kVideoCodecVP8;
perkjfa10b552016-10-02 23:45:26 -0700177 std::vector<VideoStream> streams = test::CreateVideoStreams(
178 test::CallTest::kDefaultWidth, test::CallTest::kDefaultHeight,
179 *encoder_config);
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200180 // For multi stream rampup until all streams are being sent. That means
181 // enough bitrate to send all the target streams plus the min bitrate of
182 // the last one.
perkjfa10b552016-10-02 23:45:26 -0700183 expected_bitrate_bps_ = streams.back().min_bitrate_bps;
184 for (size_t i = 0; i < streams.size() - 1; ++i) {
185 expected_bitrate_bps_ += streams[i].target_bitrate_bps;
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000186 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000187 }
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000188
stefan4fbd1452015-09-28 03:57:14 -0700189 send_config->rtp.extensions.clear();
190
191 bool remb;
stefan43edf0f2015-11-20 18:05:48 -0800192 bool transport_cc;
isheriff6f8d6862016-05-26 11:24:55 -0700193 if (extension_type_ == RtpExtension::kAbsSendTimeUri) {
stefan4fbd1452015-09-28 03:57:14 -0700194 remb = true;
stefan43edf0f2015-11-20 18:05:48 -0800195 transport_cc = false;
stefan4fbd1452015-09-28 03:57:14 -0700196 send_config->rtp.extensions.push_back(
197 RtpExtension(extension_type_.c_str(), kAbsSendTimeExtensionId));
isheriff6f8d6862016-05-26 11:24:55 -0700198 } else if (extension_type_ == RtpExtension::kTransportSequenceNumberUri) {
stefan4fbd1452015-09-28 03:57:14 -0700199 remb = false;
stefan43edf0f2015-11-20 18:05:48 -0800200 transport_cc = true;
stefan4fbd1452015-09-28 03:57:14 -0700201 send_config->rtp.extensions.push_back(RtpExtension(
202 extension_type_.c_str(), kTransportSequenceNumberExtensionId));
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000203 } else {
stefan4fbd1452015-09-28 03:57:14 -0700204 remb = true;
stefan43edf0f2015-11-20 18:05:48 -0800205 transport_cc = false;
stefan4fbd1452015-09-28 03:57:14 -0700206 send_config->rtp.extensions.push_back(RtpExtension(
207 extension_type_.c_str(), kTransmissionTimeOffsetExtensionId));
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000208 }
stefan4fbd1452015-09-28 03:57:14 -0700209
210 send_config->rtp.nack.rtp_history_ms = test::CallTest::kNackRtpHistoryMs;
stefanff483612015-12-21 03:14:00 -0800211 send_config->rtp.ssrcs = video_ssrcs_;
stefan4fbd1452015-09-28 03:57:14 -0700212 if (rtx_) {
213 send_config->rtp.rtx.payload_type = test::CallTest::kSendRtxPayloadType;
stefanff483612015-12-21 03:14:00 -0800214 send_config->rtp.rtx.ssrcs = video_rtx_ssrcs_;
stefan4fbd1452015-09-28 03:57:14 -0700215 }
216 if (red_) {
brandtrb5f2c3f2016-10-04 23:28:39 -0700217 send_config->rtp.ulpfec.ulpfec_payload_type =
stefan4fbd1452015-09-28 03:57:14 -0700218 test::CallTest::kUlpfecPayloadType;
brandtrb5f2c3f2016-10-04 23:28:39 -0700219 send_config->rtp.ulpfec.red_payload_type = test::CallTest::kRedPayloadType;
brandtrfbfb5362016-11-17 04:18:37 -0800220 if (rtx_) {
221 send_config->rtp.ulpfec.red_rtx_payload_type =
222 test::CallTest::kRtxRedPayloadType;
223 }
stefan4fbd1452015-09-28 03:57:14 -0700224 }
225
226 size_t i = 0;
227 for (VideoReceiveStream::Config& recv_config : *receive_configs) {
228 recv_config.rtp.remb = remb;
stefan43edf0f2015-11-20 18:05:48 -0800229 recv_config.rtp.transport_cc = transport_cc;
stefan4fbd1452015-09-28 03:57:14 -0700230 recv_config.rtp.extensions = send_config->rtp.extensions;
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200231 recv_config.decoders.reserve(1);
232 recv_config.decoders[0].payload_type = send_config->rtp.payload_type;
Niels Möllercb7e1d22018-09-11 15:56:04 +0200233 recv_config.decoders[0].video_format =
234 SdpVideoFormat(send_config->rtp.payload_name);
stefan4fbd1452015-09-28 03:57:14 -0700235
stefanff483612015-12-21 03:14:00 -0800236 recv_config.rtp.remote_ssrc = video_ssrcs_[i];
stefan4fbd1452015-09-28 03:57:14 -0700237 recv_config.rtp.nack.rtp_history_ms = send_config->rtp.nack.rtp_history_ms;
238
239 if (red_) {
nisse3b3622f2017-09-26 02:49:21 -0700240 recv_config.rtp.red_payload_type =
brandtrb5f2c3f2016-10-04 23:28:39 -0700241 send_config->rtp.ulpfec.red_payload_type;
nisse3b3622f2017-09-26 02:49:21 -0700242 recv_config.rtp.ulpfec_payload_type =
brandtrb5f2c3f2016-10-04 23:28:39 -0700243 send_config->rtp.ulpfec.ulpfec_payload_type;
brandtrfbfb5362016-11-17 04:18:37 -0800244 if (rtx_) {
nisseca5706d2017-09-11 02:32:16 -0700245 recv_config.rtp.rtx_associated_payload_types
246 [send_config->rtp.ulpfec.red_rtx_payload_type] =
247 send_config->rtp.ulpfec.red_payload_type;
brandtrfbfb5362016-11-17 04:18:37 -0800248 }
stefan4fbd1452015-09-28 03:57:14 -0700249 }
250
251 if (rtx_) {
brandtr14742122017-01-27 04:53:07 -0800252 recv_config.rtp.rtx_ssrc = video_rtx_ssrcs_[i];
253 recv_config.rtp
nisse26e3abb2017-08-25 04:44:25 -0700254 .rtx_associated_payload_types[send_config->rtp.rtx.payload_type] =
Niels Möller259a4972018-04-05 15:36:51 +0200255 send_config->rtp.payload_type;
stefan4fbd1452015-09-28 03:57:14 -0700256 }
257 ++i;
258 }
philipel5ef2bc12017-02-21 07:28:31 -0800259
260 RTC_DCHECK_LE(num_flexfec_streams_, 1);
261 if (num_flexfec_streams_ == 1) {
262 send_config->rtp.flexfec.payload_type = test::CallTest::kFlexfecPayloadType;
263 send_config->rtp.flexfec.ssrc = test::CallTest::kFlexfecSendSsrc;
264 send_config->rtp.flexfec.protected_media_ssrcs = {video_ssrcs_[0]};
265 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000266}
267
Stefan Holmerff2a6352016-01-14 10:00:21 +0100268void RampUpTester::ModifyAudioConfigs(
269 AudioSendStream::Config* send_config,
270 std::vector<AudioReceiveStream::Config>* receive_configs) {
271 if (num_audio_streams_ == 0)
272 return;
273
isheriff6f8d6862016-05-26 11:24:55 -0700274 EXPECT_NE(RtpExtension::kTimestampOffsetUri, extension_type_)
Stefan Holmerff2a6352016-01-14 10:00:21 +0100275 << "Audio BWE not supported with toffset.";
philipel5ef2bc12017-02-21 07:28:31 -0800276 EXPECT_NE(RtpExtension::kAbsSendTimeUri, extension_type_)
277 << "Audio BWE not supported with abs-send-time.";
Stefan Holmerff2a6352016-01-14 10:00:21 +0100278
279 send_config->rtp.ssrc = audio_ssrcs_[0];
280 send_config->rtp.extensions.clear();
281
minyue10cbb462016-11-07 09:29:22 -0800282 send_config->min_bitrate_bps = 6000;
283 send_config->max_bitrate_bps = 60000;
mflodman86cc6ff2016-07-26 04:44:06 -0700284
Stefan Holmerff2a6352016-01-14 10:00:21 +0100285 bool transport_cc = false;
philipel5ef2bc12017-02-21 07:28:31 -0800286 if (extension_type_ == RtpExtension::kTransportSequenceNumberUri) {
Stefan Holmerff2a6352016-01-14 10:00:21 +0100287 transport_cc = true;
288 send_config->rtp.extensions.push_back(RtpExtension(
289 extension_type_.c_str(), kTransportSequenceNumberExtensionId));
290 }
291
292 for (AudioReceiveStream::Config& recv_config : *receive_configs) {
Stefan Holmerff2a6352016-01-14 10:00:21 +0100293 recv_config.rtp.transport_cc = transport_cc;
294 recv_config.rtp.extensions = send_config->rtp.extensions;
295 recv_config.rtp.remote_ssrc = send_config->rtp.ssrc;
296 }
297}
298
philipel5ef2bc12017-02-21 07:28:31 -0800299void RampUpTester::ModifyFlexfecConfigs(
300 std::vector<FlexfecReceiveStream::Config>* receive_configs) {
301 if (num_flexfec_streams_ == 0)
302 return;
303 RTC_DCHECK_EQ(1, num_flexfec_streams_);
304 (*receive_configs)[0].payload_type = test::CallTest::kFlexfecPayloadType;
305 (*receive_configs)[0].remote_ssrc = test::CallTest::kFlexfecSendSsrc;
306 (*receive_configs)[0].protected_media_ssrcs = {video_ssrcs_[0]};
307 (*receive_configs)[0].local_ssrc = video_ssrcs_[0];
308 if (extension_type_ == RtpExtension::kAbsSendTimeUri) {
309 (*receive_configs)[0].transport_cc = false;
310 (*receive_configs)[0].rtp_header_extensions.push_back(
311 RtpExtension(extension_type_.c_str(), kAbsSendTimeExtensionId));
312 } else if (extension_type_ == RtpExtension::kTransportSequenceNumberUri) {
313 (*receive_configs)[0].transport_cc = true;
314 (*receive_configs)[0].rtp_header_extensions.push_back(RtpExtension(
315 extension_type_.c_str(), kTransportSequenceNumberExtensionId));
316 }
317}
318
stefan4fbd1452015-09-28 03:57:14 -0700319void RampUpTester::OnCallsCreated(Call* sender_call, Call* receiver_call) {
Tommi5e005f42019-08-05 15:29:14 +0200320 RTC_DCHECK(sender_call);
stefan4fbd1452015-09-28 03:57:14 -0700321 sender_call_ = sender_call;
Tommi5e005f42019-08-05 15:29:14 +0200322 pending_task_ = task_queue_->PostTask([this]() { PollStats(); });
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000323}
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000324
tommi0f8b4032017-02-22 11:22:05 -0800325void RampUpTester::PollStats() {
Tommi5e005f42019-08-05 15:29:14 +0200326 pending_task_ = -1;
327 Call::Stats stats = sender_call_->GetStats();
328 EXPECT_GE(expected_bitrate_bps_, 0);
stefan4fbd1452015-09-28 03:57:14 -0700329
Tommi5e005f42019-08-05 15:29:14 +0200330 if (stats.send_bandwidth_bps >= expected_bitrate_bps_ &&
331 (min_run_time_ms_ == -1 ||
332 clock_->TimeInMilliseconds() - test_start_ms_ >= min_run_time_ms_)) {
333 ramp_up_finished_ms_ = clock_->TimeInMilliseconds();
334 observation_complete_.Set();
335 } else {
336 pending_task_ = task_queue_->PostDelayedTask([this]() { PollStats(); },
337 kPollIntervalMs);
338 }
Erik Språng468e62a2015-07-06 10:50:47 +0200339}
340
stefan4fbd1452015-09-28 03:57:14 -0700341void RampUpTester::ReportResult(const std::string& measurement,
342 size_t value,
343 const std::string& units) const {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000344 webrtc::test::PrintResult(
345 measurement, "",
stefanff483612015-12-21 03:14:00 -0800346 ::testing::UnitTest::GetInstance()->current_test_info()->name(), value,
347 units, false);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000348}
349
stefan092508a2015-09-29 02:26:42 -0700350void RampUpTester::AccumulateStats(const VideoSendStream::StreamStats& stream,
351 size_t* total_packets_sent,
352 size_t* total_sent,
353 size_t* padding_sent,
354 size_t* media_sent) const {
stefan4fbd1452015-09-28 03:57:14 -0700355 *total_packets_sent += stream.rtp_stats.transmitted.packets +
356 stream.rtp_stats.retransmitted.packets +
357 stream.rtp_stats.fec.packets;
358 *total_sent += stream.rtp_stats.transmitted.TotalBytes() +
359 stream.rtp_stats.retransmitted.TotalBytes() +
360 stream.rtp_stats.fec.TotalBytes();
361 *padding_sent += stream.rtp_stats.transmitted.padding_bytes +
362 stream.rtp_stats.retransmitted.padding_bytes +
363 stream.rtp_stats.fec.padding_bytes;
364 *media_sent += stream.rtp_stats.MediaPayloadBytes();
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000365}
366
stefan4fbd1452015-09-28 03:57:14 -0700367void RampUpTester::TriggerTestDone() {
Erik Språngf3a7c9d2015-10-05 14:03:22 +0200368 RTC_DCHECK_GE(test_start_ms_, 0);
369
Stefan Holmerff2a6352016-01-14 10:00:21 +0100370 // TODO(holmer): Add audio send stats here too when those APIs are available.
mflodman86cc6ff2016-07-26 04:44:06 -0700371 if (!send_stream_)
372 return;
373
Tommi5e005f42019-08-05 15:29:14 +0200374 // Stop polling stats.
375 // Corner case for field_trials=WebRTC-QuickPerfTest/Enabled/
376 task_queue_->SendTask([this]() {
377 if (pending_task_ !=
378 static_cast<test::SingleThreadedTaskQueueForTesting::TaskId>(-1)) {
379 task_queue_->CancelTask(pending_task_);
380 pending_task_ = -1;
381 }
382 });
383
stefan4fbd1452015-09-28 03:57:14 -0700384 VideoSendStream::Stats send_stats = send_stream_->GetStats();
Tommi5e005f42019-08-05 15:29:14 +0200385 send_stream_ = nullptr; // To avoid dereferencing a bad pointer.
stefan4fbd1452015-09-28 03:57:14 -0700386
387 size_t total_packets_sent = 0;
388 size_t total_sent = 0;
389 size_t padding_sent = 0;
390 size_t media_sent = 0;
stefanff483612015-12-21 03:14:00 -0800391 for (uint32_t ssrc : video_ssrcs_) {
stefan092508a2015-09-29 02:26:42 -0700392 AccumulateStats(send_stats.substreams[ssrc], &total_packets_sent,
393 &total_sent, &padding_sent, &media_sent);
stefan4fbd1452015-09-28 03:57:14 -0700394 }
395
396 size_t rtx_total_packets_sent = 0;
397 size_t rtx_total_sent = 0;
398 size_t rtx_padding_sent = 0;
399 size_t rtx_media_sent = 0;
stefanff483612015-12-21 03:14:00 -0800400 for (uint32_t rtx_ssrc : video_rtx_ssrcs_) {
stefan092508a2015-09-29 02:26:42 -0700401 AccumulateStats(send_stats.substreams[rtx_ssrc], &rtx_total_packets_sent,
402 &rtx_total_sent, &rtx_padding_sent, &rtx_media_sent);
stefan4fbd1452015-09-28 03:57:14 -0700403 }
404
stefan5a2c5062017-01-27 06:43:18 -0800405 if (report_perf_stats_) {
stefan5a2c5062017-01-27 06:43:18 -0800406 ReportResult("ramp-up-media-sent", media_sent, "bytes");
407 ReportResult("ramp-up-padding-sent", padding_sent, "bytes");
stefan5a2c5062017-01-27 06:43:18 -0800408 ReportResult("ramp-up-rtx-media-sent", rtx_media_sent, "bytes");
409 ReportResult("ramp-up-rtx-padding-sent", rtx_padding_sent, "bytes");
410 if (ramp_up_finished_ms_ >= 0) {
411 ReportResult("ramp-up-time", ramp_up_finished_ms_ - test_start_ms_,
412 "milliseconds");
413 }
414 ReportResult("ramp-up-average-network-latency",
415 send_transport_->GetAverageDelayMs(), "milliseconds");
stefan4fbd1452015-09-28 03:57:14 -0700416 }
417}
418
419void RampUpTester::PerformTest() {
Erik Språngf3a7c9d2015-10-05 14:03:22 +0200420 test_start_ms_ = clock_->TimeInMilliseconds();
Peter Boström5811a392015-12-10 13:02:50 +0100421 EXPECT_TRUE(Wait()) << "Timed out while waiting for ramp-up to complete.";
stefan4fbd1452015-09-28 03:57:14 -0700422 TriggerTestDone();
423}
424
Tommi5e005f42019-08-05 15:29:14 +0200425RampUpDownUpTester::RampUpDownUpTester(
426 size_t num_video_streams,
427 size_t num_audio_streams,
428 size_t num_flexfec_streams,
429 unsigned int start_bitrate_bps,
430 const std::string& extension_type,
431 bool rtx,
432 bool red,
433 const std::vector<int>& loss_rates,
434 bool report_perf_stats,
435 test::SingleThreadedTaskQueueForTesting* task_queue)
Stefan Holmerff2a6352016-01-14 10:00:21 +0100436 : RampUpTester(num_video_streams,
437 num_audio_streams,
philipel5ef2bc12017-02-21 07:28:31 -0800438 num_flexfec_streams,
Stefan Holmerff2a6352016-01-14 10:00:21 +0100439 start_bitrate_bps,
stefan5a2c5062017-01-27 06:43:18 -0800440 0,
Stefan Holmerff2a6352016-01-14 10:00:21 +0100441 extension_type,
442 rtx,
stefan5a2c5062017-01-27 06:43:18 -0800443 red,
Tommi5e005f42019-08-05 15:29:14 +0200444 report_perf_stats,
445 task_queue),
stefan76d9c9c2017-04-01 06:51:09 -0700446 link_rates_({4 * GetExpectedHighBitrate() / (3 * 1000),
447 kLowBandwidthLimitBps / 1000,
448 4 * GetExpectedHighBitrate() / (3 * 1000), 0}),
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000449 test_state_(kFirstRampup),
philipel5ef2bc12017-02-21 07:28:31 -0800450 next_state_(kTransitionToNextState),
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000451 state_start_ms_(clock_->TimeInMilliseconds()),
stefan4fbd1452015-09-28 03:57:14 -0700452 interval_start_ms_(clock_->TimeInMilliseconds()),
philipel5ef2bc12017-02-21 07:28:31 -0800453 sent_bytes_(0),
454 loss_rates_(loss_rates) {
455 forward_transport_config_.link_capacity_kbps = link_rates_[test_state_];
456 forward_transport_config_.queue_delay_ms = 100;
457 forward_transport_config_.loss_percent = loss_rates_[test_state_];
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000458}
459
stefan4fbd1452015-09-28 03:57:14 -0700460RampUpDownUpTester::~RampUpDownUpTester() {}
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000461
tommi0f8b4032017-02-22 11:22:05 -0800462void RampUpDownUpTester::PollStats() {
Tommi5e005f42019-08-05 15:29:14 +0200463 pending_task_ = -1;
464 bool last_round = (test_state_ == kTestEnd);
465
466 int transmit_bitrate_bps = 0;
467 bool suspended = false;
468 if (num_video_streams_ > 0 && send_stream_) {
469 webrtc::VideoSendStream::Stats stats = send_stream_->GetStats();
470 for (const auto& it : stats.substreams) {
471 transmit_bitrate_bps += it.second.total_bitrate_bps;
Alex Narest78609d52017-10-20 10:37:47 +0200472 }
Tommi5e005f42019-08-05 15:29:14 +0200473 suspended = stats.suspended;
474 }
475 if (num_audio_streams_ > 0 && sender_call_) {
476 // An audio send stream doesn't have bitrate stats, so the call send BW is
477 // currently used instead.
478 transmit_bitrate_bps = sender_call_->GetStats().send_bandwidth_bps;
479 }
480
481 EvolveTestState(transmit_bitrate_bps, suspended);
482
483 if (!last_round) {
484 pending_task_ = task_queue_->PostDelayedTask([this]() { PollStats(); },
485 kPollIntervalMs);
486 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000487}
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000488
Niels Möllerde8e6e62018-11-13 15:10:33 +0100489void RampUpDownUpTester::ModifyReceiverBitrateConfig(
490 BitrateConstraints* bitrate_config) {
491 bitrate_config->min_bitrate_bps = 10000;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000492}
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000493
stefan4fbd1452015-09-28 03:57:14 -0700494std::string RampUpDownUpTester::GetModifierString() const {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000495 std::string str("_");
stefanff483612015-12-21 03:14:00 -0800496 if (num_video_streams_ > 0) {
Jonas Olsson0a713b62018-04-04 15:49:32 +0200497 str += rtc::ToString(num_video_streams_);
stefanff483612015-12-21 03:14:00 -0800498 str += "stream";
499 str += (num_video_streams_ > 1 ? "s" : "");
500 str += "_";
501 }
502 if (num_audio_streams_ > 0) {
Jonas Olsson0a713b62018-04-04 15:49:32 +0200503 str += rtc::ToString(num_audio_streams_);
stefanff483612015-12-21 03:14:00 -0800504 str += "stream";
505 str += (num_audio_streams_ > 1 ? "s" : "");
506 str += "_";
507 }
stefan4fbd1452015-09-28 03:57:14 -0700508 str += (rtx_ ? "" : "no");
Edward Lemurdd3987f2018-01-04 19:44:54 +0100509 str += "rtx_";
510 str += (red_ ? "" : "no");
511 str += "red";
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000512 return str;
513}
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000514
stefandb752f92016-12-05 08:23:40 -0800515int RampUpDownUpTester::GetExpectedHighBitrate() const {
stefan38d8b3c2017-01-09 04:19:24 -0800516 int expected_bitrate_bps = 0;
517 if (num_audio_streams_ > 0)
518 expected_bitrate_bps += kExpectedHighAudioBitrateBps;
519 if (num_video_streams_ > 0)
520 expected_bitrate_bps += kExpectedHighVideoBitrateBps;
521 return expected_bitrate_bps;
522}
523
philipel5ef2bc12017-02-21 07:28:31 -0800524size_t RampUpDownUpTester::GetFecBytes() const {
525 size_t flex_fec_bytes = 0;
526 if (num_flexfec_streams_ > 0) {
527 webrtc::VideoSendStream::Stats stats = send_stream_->GetStats();
528 for (const auto& kv : stats.substreams)
529 flex_fec_bytes += kv.second.rtp_stats.fec.TotalBytes();
530 }
531 return flex_fec_bytes;
532}
533
534bool RampUpDownUpTester::ExpectingFec() const {
535 return num_flexfec_streams_ > 0 && forward_transport_config_.loss_percent > 0;
536}
537
stefan4fbd1452015-09-28 03:57:14 -0700538void RampUpDownUpTester::EvolveTestState(int bitrate_bps, bool suspended) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000539 int64_t now = clock_->TimeInMilliseconds();
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000540 switch (test_state_) {
philipel5ef2bc12017-02-21 07:28:31 -0800541 case kFirstRampup:
stefan4fbd1452015-09-28 03:57:14 -0700542 EXPECT_FALSE(suspended);
stefandb752f92016-12-05 08:23:40 -0800543 if (bitrate_bps >= GetExpectedHighBitrate()) {
stefan45b5fe52017-03-09 06:27:02 -0800544 if (report_perf_stats_) {
545 webrtc::test::PrintResult("ramp_up_down_up", GetModifierString(),
546 "first_rampup", 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_ = kLowRate;
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000553 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000554 break;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000555 case kLowRate: {
mflodman86cc6ff2016-07-26 04:44:06 -0700556 // Audio streams are never suspended.
557 bool check_suspend_state = num_video_streams_ > 0;
Sebastian Jansson12fb1702018-02-23 11:34:18 +0100558 if (bitrate_bps < kLowBandwidthLimitBps + kLowBitrateMarginBps &&
mflodman86cc6ff2016-07-26 04:44:06 -0700559 suspended == check_suspend_state) {
stefan45b5fe52017-03-09 06:27:02 -0800560 if (report_perf_stats_) {
561 webrtc::test::PrintResult("ramp_up_down_up", GetModifierString(),
562 "rampdown", now - state_start_ms_, "ms",
563 false);
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_ = kSecondRampup;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000569 }
570 break;
571 }
philipel5ef2bc12017-02-21 07:28:31 -0800572 case kSecondRampup:
stefandb752f92016-12-05 08:23:40 -0800573 if (bitrate_bps >= GetExpectedHighBitrate() && !suspended) {
stefan45b5fe52017-03-09 06:27:02 -0800574 if (report_perf_stats_) {
575 webrtc::test::PrintResult("ramp_up_down_up", GetModifierString(),
576 "second_rampup", now - state_start_ms_,
577 "ms", false);
578 ReportResult("ramp-up-down-up-average-network-latency",
579 send_transport_->GetAverageDelayMs(), "milliseconds");
580 }
philipel5ef2bc12017-02-21 07:28:31 -0800581 // Apply loss during the transition between states if FEC is enabled.
582 forward_transport_config_.loss_percent = loss_rates_[test_state_];
583 test_state_ = kTransitionToNextState;
584 next_state_ = kTestEnd;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000585 }
586 break;
philipel5ef2bc12017-02-21 07:28:31 -0800587 case kTestEnd:
588 observation_complete_.Set();
589 break;
590 case kTransitionToNextState:
591 if (!ExpectingFec() || GetFecBytes() > 0) {
592 test_state_ = next_state_;
593 forward_transport_config_.link_capacity_kbps = link_rates_[test_state_];
594 // No loss while ramping up and down as it may affect the BWE
595 // negatively, making the test flaky.
596 forward_transport_config_.loss_percent = 0;
597 state_start_ms_ = now;
598 interval_start_ms_ = now;
599 sent_bytes_ = 0;
Artem Titov631cafa2018-08-21 21:01:00 +0200600 send_simulated_network_->SetConfig(forward_transport_config_);
philipel5ef2bc12017-02-21 07:28:31 -0800601 }
602 break;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000603 }
604}
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +0000605
stefan4fbd1452015-09-28 03:57:14 -0700606class RampUpTest : public test::CallTest {
Erik Språng6b8d3552015-09-24 15:06:57 +0200607 public:
Danil Chapovalov304ea5f2019-04-11 15:18:18 +0200608 RampUpTest()
609 : task_queue_factory_(CreateDefaultTaskQueueFactory()),
610 rtc_event_log_factory_(task_queue_factory_.get()) {
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200611 std::string dump_name(absl::GetFlag(FLAGS_ramp_dump_name));
Sebastian Janssonf5e767d2018-10-15 13:24:31 +0200612 if (!dump_name.empty()) {
Danil Chapovalov304ea5f2019-04-11 15:18:18 +0200613 send_event_log_ = rtc_event_log_factory_.CreateRtcEventLog(
614 RtcEventLog::EncodingType::Legacy);
615 recv_event_log_ = rtc_event_log_factory_.CreateRtcEventLog(
616 RtcEventLog::EncodingType::Legacy);
Sebastian Janssonf5e767d2018-10-15 13:24:31 +0200617 bool event_log_started =
618 send_event_log_->StartLogging(
619 absl::make_unique<RtcEventLogOutputFile>(
620 dump_name + ".send.rtc.dat", RtcEventLog::kUnlimitedOutput),
621 RtcEventLog::kImmediateOutput) &&
622 recv_event_log_->StartLogging(
623 absl::make_unique<RtcEventLogOutputFile>(
624 dump_name + ".recv.rtc.dat", RtcEventLog::kUnlimitedOutput),
625 RtcEventLog::kImmediateOutput);
626 RTC_DCHECK(event_log_started);
627 }
628 }
Danil Chapovalov304ea5f2019-04-11 15:18:18 +0200629
630 private:
631 const std::unique_ptr<TaskQueueFactory> task_queue_factory_;
632 RtcEventLogFactory rtc_event_log_factory_;
Erik Språng6b8d3552015-09-24 15:06:57 +0200633};
634
Stefan Holmerff2a6352016-01-14 10:00:21 +0100635static const uint32_t kStartBitrateBps = 60000;
636
stefan38d8b3c2017-01-09 04:19:24 -0800637TEST_F(RampUpTest, UpDownUpAbsSendTimeSimulcastRedRtx) {
philipel5ef2bc12017-02-21 07:28:31 -0800638 std::vector<int> loss_rates = {0, 0, 0, 0};
639 RampUpDownUpTester test(3, 0, 0, kStartBitrateBps,
stefan45b5fe52017-03-09 06:27:02 -0800640 RtpExtension::kAbsSendTimeUri, true, true, loss_rates,
Tommi5e005f42019-08-05 15:29:14 +0200641 true, &task_queue_);
stefane74eef12016-01-08 06:47:13 -0800642 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800643}
Stefan Holmerff2a6352016-01-14 10:00:21 +0100644
Taylor Brandstetterba6b5032018-02-16 09:59:56 -0800645// TODO(bugs.webrtc.org/8878)
646#if defined(WEBRTC_MAC)
647#define MAYBE_UpDownUpTransportSequenceNumberRtx \
648 DISABLED_UpDownUpTransportSequenceNumberRtx
649#else
650#define MAYBE_UpDownUpTransportSequenceNumberRtx \
651 UpDownUpTransportSequenceNumberRtx
652#endif
653TEST_F(RampUpTest, MAYBE_UpDownUpTransportSequenceNumberRtx) {
philipel5ef2bc12017-02-21 07:28:31 -0800654 std::vector<int> loss_rates = {0, 0, 0, 0};
655 RampUpDownUpTester test(3, 0, 0, kStartBitrateBps,
isheriff6f8d6862016-05-26 11:24:55 -0700656 RtpExtension::kTransportSequenceNumberUri, true,
Tommi5e005f42019-08-05 15:29:14 +0200657 false, loss_rates, true, &task_queue_);
philipel5ef2bc12017-02-21 07:28:31 -0800658 RunBaseTest(&test);
659}
660
stefan45b5fe52017-03-09 06:27:02 -0800661// TODO(holmer): Tests which don't report perf stats should be moved to a
662// different executable since they per definition are not perf tests.
Taylor Brandstetter05d98222017-10-10 12:12:53 -0700663// This test is disabled because it crashes on Linux, and is flaky on other
664// platforms. See: crbug.com/webrtc/7919
665TEST_F(RampUpTest, DISABLED_UpDownUpTransportSequenceNumberPacketLoss) {
philipel5ef2bc12017-02-21 07:28:31 -0800666 std::vector<int> loss_rates = {20, 0, 0, 0};
667 RampUpDownUpTester test(1, 0, 1, kStartBitrateBps,
668 RtpExtension::kTransportSequenceNumberUri, true,
Tommi5e005f42019-08-05 15:29:14 +0200669 false, loss_rates, false, &task_queue_);
Stefan Holmerff2a6352016-01-14 10:00:21 +0100670 RunBaseTest(&test);
671}
672
Taylor Brandstetterab86e7f2018-02-12 15:16:02 -0800673// TODO(bugs.webrtc.org/8878)
674#if defined(WEBRTC_MAC)
675#define MAYBE_UpDownUpAudioVideoTransportSequenceNumberRtx \
676 DISABLED_UpDownUpAudioVideoTransportSequenceNumberRtx
677#else
678#define MAYBE_UpDownUpAudioVideoTransportSequenceNumberRtx \
679 UpDownUpAudioVideoTransportSequenceNumberRtx
680#endif
681TEST_F(RampUpTest, MAYBE_UpDownUpAudioVideoTransportSequenceNumberRtx) {
Per Kjellander914351d2019-02-15 10:54:55 +0100682 test::ScopedFieldTrials field_trials("WebRTC-Audio-SendSideBwe/Enabled/");
philipel5ef2bc12017-02-21 07:28:31 -0800683 std::vector<int> loss_rates = {0, 0, 0, 0};
684 RampUpDownUpTester test(3, 1, 0, kStartBitrateBps,
isheriff6f8d6862016-05-26 11:24:55 -0700685 RtpExtension::kTransportSequenceNumberUri, true,
Tommi5e005f42019-08-05 15:29:14 +0200686 false, loss_rates, false, &task_queue_);
Stefan Holmerff2a6352016-01-14 10:00:21 +0100687 RunBaseTest(&test);
688}
689
stefan38d8b3c2017-01-09 04:19:24 -0800690TEST_F(RampUpTest, UpDownUpAudioTransportSequenceNumberRtx) {
Per Kjellander914351d2019-02-15 10:54:55 +0100691 test::ScopedFieldTrials field_trials("WebRTC-Audio-SendSideBwe/Enabled/");
philipel5ef2bc12017-02-21 07:28:31 -0800692 std::vector<int> loss_rates = {0, 0, 0, 0};
693 RampUpDownUpTester test(0, 1, 0, kStartBitrateBps,
mflodman86cc6ff2016-07-26 04:44:06 -0700694 RtpExtension::kTransportSequenceNumberUri, true,
Tommi5e005f42019-08-05 15:29:14 +0200695 false, loss_rates, false, &task_queue_);
mflodman86cc6ff2016-07-26 04:44:06 -0700696 RunBaseTest(&test);
697}
698
stefan38d8b3c2017-01-09 04:19:24 -0800699TEST_F(RampUpTest, TOffsetSimulcastRedRtx) {
philipel5ef2bc12017-02-21 07:28:31 -0800700 RampUpTester test(3, 0, 0, 0, 0, RtpExtension::kTimestampOffsetUri, true,
Tommi5e005f42019-08-05 15:29:14 +0200701 true, true, &task_queue_);
stefan38d8b3c2017-01-09 04:19:24 -0800702 RunBaseTest(&test);
703}
704
705TEST_F(RampUpTest, AbsSendTime) {
philipel5ef2bc12017-02-21 07:28:31 -0800706 RampUpTester test(1, 0, 0, 0, 0, RtpExtension::kAbsSendTimeUri, false, false,
Tommi5e005f42019-08-05 15:29:14 +0200707 false, &task_queue_);
stefane74eef12016-01-08 06:47:13 -0800708 RunBaseTest(&test);
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000709}
710
stefan38d8b3c2017-01-09 04:19:24 -0800711TEST_F(RampUpTest, AbsSendTimeSimulcastRedRtx) {
philipel5ef2bc12017-02-21 07:28:31 -0800712 RampUpTester test(3, 0, 0, 0, 0, RtpExtension::kAbsSendTimeUri, true, true,
Tommi5e005f42019-08-05 15:29:14 +0200713 true, &task_queue_);
stefane74eef12016-01-08 06:47:13 -0800714 RunBaseTest(&test);
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000715}
716
stefan38d8b3c2017-01-09 04:19:24 -0800717TEST_F(RampUpTest, TransportSequenceNumber) {
philipel5ef2bc12017-02-21 07:28:31 -0800718 RampUpTester test(1, 0, 0, 0, 0, RtpExtension::kTransportSequenceNumberUri,
Tommi5e005f42019-08-05 15:29:14 +0200719 false, false, false, &task_queue_);
stefane74eef12016-01-08 06:47:13 -0800720 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200721}
722
723TEST_F(RampUpTest, TransportSequenceNumberSimulcast) {
philipel5ef2bc12017-02-21 07:28:31 -0800724 RampUpTester test(3, 0, 0, 0, 0, RtpExtension::kTransportSequenceNumberUri,
Tommi5e005f42019-08-05 15:29:14 +0200725 false, false, false, &task_queue_);
stefane74eef12016-01-08 06:47:13 -0800726 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200727}
728
stefan38d8b3c2017-01-09 04:19:24 -0800729TEST_F(RampUpTest, TransportSequenceNumberSimulcastRedRtx) {
philipel5ef2bc12017-02-21 07:28:31 -0800730 RampUpTester test(3, 0, 0, 0, 0, RtpExtension::kTransportSequenceNumberUri,
Tommi5e005f42019-08-05 15:29:14 +0200731 true, true, true, &task_queue_);
stefan5a2c5062017-01-27 06:43:18 -0800732 RunBaseTest(&test);
733}
734
Niels Möllercd2e1052018-11-08 10:23:13 +0100735TEST_F(RampUpTest, AudioTransportSequenceNumber) {
philipel5ef2bc12017-02-21 07:28:31 -0800736 RampUpTester test(0, 1, 0, 300000, 10000,
stefan5a2c5062017-01-27 06:43:18 -0800737 RtpExtension::kTransportSequenceNumberUri, false, false,
Tommi5e005f42019-08-05 15:29:14 +0200738 false, &task_queue_);
stefane74eef12016-01-08 06:47:13 -0800739 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200740}
pbos@webrtc.org744fbc72013-09-10 09:26:25 +0000741} // namespace webrtc