blob: 8aba18d56276d679c30ee7b4ad7fa93a797b00db [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"
Tommi6b117a52019-08-20 09:58:56 +020026#include "rtc_base/time_utils.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020027#include "test/encoder_settings.h"
Per Kjellander914351d2019-02-15 10:54:55 +010028#include "test/field_trial.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020029#include "test/gtest.h"
30#include "test/testsupport/perf_test.h"
pbos@webrtc.org744fbc72013-09-10 09:26:25 +000031
Mirko Bonadei2ab97f62019-07-18 13:44:12 +020032ABSL_FLAG(std::string,
33 ramp_dump_name,
34 "",
35 "Filename for dumped received RTP stream.");
36
pbos@webrtc.org744fbc72013-09-10 09:26:25 +000037namespace webrtc {
pbos@webrtc.org29023282013-09-11 10:14:56 +000038namespace {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +000039
Stefan Holmer723dff12015-10-05 14:59:41 +020040static const int64_t kPollIntervalMs = 20;
philipel5ef2bc12017-02-21 07:28:31 -080041static const int kExpectedHighVideoBitrateBps = 80000;
stefandb752f92016-12-05 08:23:40 -080042static const int kExpectedHighAudioBitrateBps = 30000;
43static const int kLowBandwidthLimitBps = 20000;
Sebastian Jansson12fb1702018-02-23 11:34:18 +010044// Set target detected bitrate to slightly larger than the target bitrate to
45// avoid flakiness.
46static const int kLowBitrateMarginBps = 2000;
pbos@webrtc.org29023282013-09-11 10:14:56 +000047
stefanff483612015-12-21 03:14:00 -080048std::vector<uint32_t> GenerateSsrcs(size_t num_streams, uint32_t ssrc_offset) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +000049 std::vector<uint32_t> ssrcs;
50 for (size_t i = 0; i != num_streams; ++i)
51 ssrcs.push_back(static_cast<uint32_t>(ssrc_offset + i));
52 return ssrcs;
53}
mflodman@webrtc.orgeb16b812014-06-16 08:57:39 +000054} // namespace
henrik.lundin@webrtc.org845862f2014-03-06 07:19:28 +000055
stefanff483612015-12-21 03:14:00 -080056RampUpTester::RampUpTester(size_t num_video_streams,
57 size_t num_audio_streams,
philipel5ef2bc12017-02-21 07:28:31 -080058 size_t num_flexfec_streams,
stefan4fbd1452015-09-28 03:57:14 -070059 unsigned int start_bitrate_bps,
stefan5a2c5062017-01-27 06:43:18 -080060 int64_t min_run_time_ms,
stefan4fbd1452015-09-28 03:57:14 -070061 const std::string& extension_type,
62 bool rtx,
stefan5a2c5062017-01-27 06:43:18 -080063 bool red,
Tommi5e005f42019-08-05 15:29:14 +020064 bool report_perf_stats,
65 test::SingleThreadedTaskQueueForTesting* task_queue)
stefan4fbd1452015-09-28 03:57:14 -070066 : EndToEndTest(test::CallTest::kLongTimeoutMs),
stefan4fbd1452015-09-28 03:57:14 -070067 clock_(Clock::GetRealTimeClock()),
stefanff483612015-12-21 03:14:00 -080068 num_video_streams_(num_video_streams),
69 num_audio_streams_(num_audio_streams),
philipel5ef2bc12017-02-21 07:28:31 -080070 num_flexfec_streams_(num_flexfec_streams),
stefan4fbd1452015-09-28 03:57:14 -070071 rtx_(rtx),
72 red_(red),
stefan45b5fe52017-03-09 06:27:02 -080073 report_perf_stats_(report_perf_stats),
mflodman86cc6ff2016-07-26 04:44:06 -070074 sender_call_(nullptr),
stefan4fbd1452015-09-28 03:57:14 -070075 send_stream_(nullptr),
sprang4847ae62017-06-27 07:06:52 -070076 send_transport_(nullptr),
Artem Titov631cafa2018-08-21 21:01:00 +020077 send_simulated_network_(nullptr),
stefan4fbd1452015-09-28 03:57:14 -070078 start_bitrate_bps_(start_bitrate_bps),
stefan5a2c5062017-01-27 06:43:18 -080079 min_run_time_ms_(min_run_time_ms),
stefan@webrtc.org3d7da882014-07-08 13:59:46 +000080 expected_bitrate_bps_(0),
Erik Språngf3a7c9d2015-10-05 14:03:22 +020081 test_start_ms_(-1),
stefan4fbd1452015-09-28 03:57:14 -070082 ramp_up_finished_ms_(-1),
83 extension_type_(extension_type),
stefanff483612015-12-21 03:14:00 -080084 video_ssrcs_(GenerateSsrcs(num_video_streams_, 100)),
85 video_rtx_ssrcs_(GenerateSsrcs(num_video_streams_, 200)),
86 audio_ssrcs_(GenerateSsrcs(num_audio_streams_, 300)),
Tommi5e005f42019-08-05 15:29:14 +020087 task_queue_(task_queue) {
philipel5ef2bc12017-02-21 07:28:31 -080088 if (red_)
89 EXPECT_EQ(0u, num_flexfec_streams_);
Stefan Holmerff2a6352016-01-14 10:00:21 +010090 EXPECT_LE(num_audio_streams_, 1u);
stefan4fbd1452015-09-28 03:57:14 -070091}
92
Tommi5e005f42019-08-05 15:29:14 +020093RampUpTester::~RampUpTester() {
94 // Special case for WebRTC-QuickPerfTest/Enabled/
95 task_queue_->SendTask([this]() {
96 if (pending_task_ !=
97 static_cast<test::SingleThreadedTaskQueueForTesting::TaskId>(-1)) {
98 task_queue_->CancelTask(pending_task_);
99 pending_task_ = -1;
100 }
101 });
102}
stefan4fbd1452015-09-28 03:57:14 -0700103
Niels Möllerde8e6e62018-11-13 15:10:33 +0100104void RampUpTester::ModifySenderBitrateConfig(
105 BitrateConstraints* bitrate_config) {
stefan4fbd1452015-09-28 03:57:14 -0700106 if (start_bitrate_bps_ != 0) {
Niels Möllerde8e6e62018-11-13 15:10:33 +0100107 bitrate_config->start_bitrate_bps = start_bitrate_bps_;
stefan4fbd1452015-09-28 03:57:14 -0700108 }
Niels Möllerde8e6e62018-11-13 15:10:33 +0100109 bitrate_config->min_bitrate_bps = 10000;
stefan4fbd1452015-09-28 03:57:14 -0700110}
111
stefanff483612015-12-21 03:14:00 -0800112void RampUpTester::OnVideoStreamsCreated(
stefan4fbd1452015-09-28 03:57:14 -0700113 VideoSendStream* send_stream,
114 const std::vector<VideoReceiveStream*>& receive_streams) {
115 send_stream_ = send_stream;
116}
117
eladalon413ee9a2017-08-22 04:02:52 -0700118test::PacketTransport* RampUpTester::CreateSendTransport(
119 test::SingleThreadedTaskQueueForTesting* task_queue,
120 Call* sender_call) {
Artem Titov631cafa2018-08-21 21:01:00 +0200121 auto network = absl::make_unique<SimulatedNetwork>(forward_transport_config_);
122 send_simulated_network_ = network.get();
minyue20c84cc2017-04-10 16:57:57 -0700123 send_transport_ = new test::PacketTransport(
eladalon413ee9a2017-08-22 04:02:52 -0700124 task_queue, sender_call, this, test::PacketTransport::kSender,
Artem Titov4e199e92018-08-20 13:30:39 +0200125 test::CallTest::payload_type_map_,
Artem Titov631cafa2018-08-21 21:01:00 +0200126 absl::make_unique<FakeNetworkPipe>(Clock::GetRealTimeClock(),
127 std::move(network)));
stefane74eef12016-01-08 06:47:13 -0800128 return send_transport_;
stefanf116bd02015-10-27 08:29:42 -0700129}
130
Stefan Holmerd20e6512016-01-12 15:51:22 +0100131size_t RampUpTester::GetNumVideoStreams() const {
132 return num_video_streams_;
133}
134
Stefan Holmerff2a6352016-01-14 10:00:21 +0100135size_t RampUpTester::GetNumAudioStreams() const {
136 return num_audio_streams_;
137}
138
philipel5ef2bc12017-02-21 07:28:31 -0800139size_t RampUpTester::GetNumFlexfecStreams() const {
140 return num_flexfec_streams_;
141}
142
perkjfa10b552016-10-02 23:45:26 -0700143class RampUpTester::VideoStreamFactory
144 : public VideoEncoderConfig::VideoStreamFactoryInterface {
145 public:
146 VideoStreamFactory() {}
147
148 private:
149 std::vector<VideoStream> CreateEncoderStreams(
150 int width,
151 int height,
152 const VideoEncoderConfig& encoder_config) override {
153 std::vector<VideoStream> streams =
154 test::CreateVideoStreams(width, height, encoder_config);
155 if (encoder_config.number_of_streams == 1) {
156 streams[0].target_bitrate_bps = streams[0].max_bitrate_bps = 2000000;
157 }
158 return streams;
159 }
160};
161
stefanff483612015-12-21 03:14:00 -0800162void RampUpTester::ModifyVideoConfigs(
stefan4fbd1452015-09-28 03:57:14 -0700163 VideoSendStream::Config* send_config,
164 std::vector<VideoReceiveStream::Config>* receive_configs,
165 VideoEncoderConfig* encoder_config) {
166 send_config->suspend_below_min_bitrate = true;
perkjfa10b552016-10-02 23:45:26 -0700167 encoder_config->number_of_streams = num_video_streams_;
168 encoder_config->max_bitrate_bps = 2000000;
169 encoder_config->video_stream_factory =
170 new rtc::RefCountedObject<RampUpTester::VideoStreamFactory>();
stefanff483612015-12-21 03:14:00 -0800171 if (num_video_streams_ == 1) {
stefan4fbd1452015-09-28 03:57:14 -0700172 // For single stream rampup until 1mbps
173 expected_bitrate_bps_ = kSingleStreamTargetBps;
174 } else {
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200175 // To ensure simulcast rate allocation.
176 send_config->rtp.payload_name = "VP8";
177 encoder_config->codec_type = kVideoCodecVP8;
perkjfa10b552016-10-02 23:45:26 -0700178 std::vector<VideoStream> streams = test::CreateVideoStreams(
179 test::CallTest::kDefaultWidth, test::CallTest::kDefaultHeight,
180 *encoder_config);
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200181 // For multi stream rampup until all streams are being sent. That means
182 // enough bitrate to send all the target streams plus the min bitrate of
183 // the last one.
perkjfa10b552016-10-02 23:45:26 -0700184 expected_bitrate_bps_ = streams.back().min_bitrate_bps;
185 for (size_t i = 0; i < streams.size() - 1; ++i) {
186 expected_bitrate_bps_ += streams[i].target_bitrate_bps;
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000187 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000188 }
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000189
stefan4fbd1452015-09-28 03:57:14 -0700190 send_config->rtp.extensions.clear();
191
192 bool remb;
stefan43edf0f2015-11-20 18:05:48 -0800193 bool transport_cc;
isheriff6f8d6862016-05-26 11:24:55 -0700194 if (extension_type_ == RtpExtension::kAbsSendTimeUri) {
stefan4fbd1452015-09-28 03:57:14 -0700195 remb = true;
stefan43edf0f2015-11-20 18:05:48 -0800196 transport_cc = false;
stefan4fbd1452015-09-28 03:57:14 -0700197 send_config->rtp.extensions.push_back(
198 RtpExtension(extension_type_.c_str(), kAbsSendTimeExtensionId));
isheriff6f8d6862016-05-26 11:24:55 -0700199 } else if (extension_type_ == RtpExtension::kTransportSequenceNumberUri) {
stefan4fbd1452015-09-28 03:57:14 -0700200 remb = false;
stefan43edf0f2015-11-20 18:05:48 -0800201 transport_cc = true;
stefan4fbd1452015-09-28 03:57:14 -0700202 send_config->rtp.extensions.push_back(RtpExtension(
203 extension_type_.c_str(), kTransportSequenceNumberExtensionId));
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000204 } else {
stefan4fbd1452015-09-28 03:57:14 -0700205 remb = true;
stefan43edf0f2015-11-20 18:05:48 -0800206 transport_cc = false;
stefan4fbd1452015-09-28 03:57:14 -0700207 send_config->rtp.extensions.push_back(RtpExtension(
208 extension_type_.c_str(), kTransmissionTimeOffsetExtensionId));
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000209 }
stefan4fbd1452015-09-28 03:57:14 -0700210
211 send_config->rtp.nack.rtp_history_ms = test::CallTest::kNackRtpHistoryMs;
stefanff483612015-12-21 03:14:00 -0800212 send_config->rtp.ssrcs = video_ssrcs_;
stefan4fbd1452015-09-28 03:57:14 -0700213 if (rtx_) {
214 send_config->rtp.rtx.payload_type = test::CallTest::kSendRtxPayloadType;
stefanff483612015-12-21 03:14:00 -0800215 send_config->rtp.rtx.ssrcs = video_rtx_ssrcs_;
stefan4fbd1452015-09-28 03:57:14 -0700216 }
217 if (red_) {
brandtrb5f2c3f2016-10-04 23:28:39 -0700218 send_config->rtp.ulpfec.ulpfec_payload_type =
stefan4fbd1452015-09-28 03:57:14 -0700219 test::CallTest::kUlpfecPayloadType;
brandtrb5f2c3f2016-10-04 23:28:39 -0700220 send_config->rtp.ulpfec.red_payload_type = test::CallTest::kRedPayloadType;
brandtrfbfb5362016-11-17 04:18:37 -0800221 if (rtx_) {
222 send_config->rtp.ulpfec.red_rtx_payload_type =
223 test::CallTest::kRtxRedPayloadType;
224 }
stefan4fbd1452015-09-28 03:57:14 -0700225 }
226
227 size_t i = 0;
228 for (VideoReceiveStream::Config& recv_config : *receive_configs) {
229 recv_config.rtp.remb = remb;
stefan43edf0f2015-11-20 18:05:48 -0800230 recv_config.rtp.transport_cc = transport_cc;
stefan4fbd1452015-09-28 03:57:14 -0700231 recv_config.rtp.extensions = send_config->rtp.extensions;
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200232 recv_config.decoders.reserve(1);
233 recv_config.decoders[0].payload_type = send_config->rtp.payload_type;
Niels Möllercb7e1d22018-09-11 15:56:04 +0200234 recv_config.decoders[0].video_format =
235 SdpVideoFormat(send_config->rtp.payload_name);
stefan4fbd1452015-09-28 03:57:14 -0700236
stefanff483612015-12-21 03:14:00 -0800237 recv_config.rtp.remote_ssrc = video_ssrcs_[i];
stefan4fbd1452015-09-28 03:57:14 -0700238 recv_config.rtp.nack.rtp_history_ms = send_config->rtp.nack.rtp_history_ms;
239
240 if (red_) {
nisse3b3622f2017-09-26 02:49:21 -0700241 recv_config.rtp.red_payload_type =
brandtrb5f2c3f2016-10-04 23:28:39 -0700242 send_config->rtp.ulpfec.red_payload_type;
nisse3b3622f2017-09-26 02:49:21 -0700243 recv_config.rtp.ulpfec_payload_type =
brandtrb5f2c3f2016-10-04 23:28:39 -0700244 send_config->rtp.ulpfec.ulpfec_payload_type;
brandtrfbfb5362016-11-17 04:18:37 -0800245 if (rtx_) {
nisseca5706d2017-09-11 02:32:16 -0700246 recv_config.rtp.rtx_associated_payload_types
247 [send_config->rtp.ulpfec.red_rtx_payload_type] =
248 send_config->rtp.ulpfec.red_payload_type;
brandtrfbfb5362016-11-17 04:18:37 -0800249 }
stefan4fbd1452015-09-28 03:57:14 -0700250 }
251
252 if (rtx_) {
brandtr14742122017-01-27 04:53:07 -0800253 recv_config.rtp.rtx_ssrc = video_rtx_ssrcs_[i];
254 recv_config.rtp
nisse26e3abb2017-08-25 04:44:25 -0700255 .rtx_associated_payload_types[send_config->rtp.rtx.payload_type] =
Niels Möller259a4972018-04-05 15:36:51 +0200256 send_config->rtp.payload_type;
stefan4fbd1452015-09-28 03:57:14 -0700257 }
258 ++i;
259 }
philipel5ef2bc12017-02-21 07:28:31 -0800260
261 RTC_DCHECK_LE(num_flexfec_streams_, 1);
262 if (num_flexfec_streams_ == 1) {
263 send_config->rtp.flexfec.payload_type = test::CallTest::kFlexfecPayloadType;
264 send_config->rtp.flexfec.ssrc = test::CallTest::kFlexfecSendSsrc;
265 send_config->rtp.flexfec.protected_media_ssrcs = {video_ssrcs_[0]};
266 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000267}
268
Stefan Holmerff2a6352016-01-14 10:00:21 +0100269void RampUpTester::ModifyAudioConfigs(
270 AudioSendStream::Config* send_config,
271 std::vector<AudioReceiveStream::Config>* receive_configs) {
272 if (num_audio_streams_ == 0)
273 return;
274
isheriff6f8d6862016-05-26 11:24:55 -0700275 EXPECT_NE(RtpExtension::kTimestampOffsetUri, extension_type_)
Stefan Holmerff2a6352016-01-14 10:00:21 +0100276 << "Audio BWE not supported with toffset.";
philipel5ef2bc12017-02-21 07:28:31 -0800277 EXPECT_NE(RtpExtension::kAbsSendTimeUri, extension_type_)
278 << "Audio BWE not supported with abs-send-time.";
Stefan Holmerff2a6352016-01-14 10:00:21 +0100279
280 send_config->rtp.ssrc = audio_ssrcs_[0];
281 send_config->rtp.extensions.clear();
282
minyue10cbb462016-11-07 09:29:22 -0800283 send_config->min_bitrate_bps = 6000;
284 send_config->max_bitrate_bps = 60000;
mflodman86cc6ff2016-07-26 04:44:06 -0700285
Stefan Holmerff2a6352016-01-14 10:00:21 +0100286 bool transport_cc = false;
philipel5ef2bc12017-02-21 07:28:31 -0800287 if (extension_type_ == RtpExtension::kTransportSequenceNumberUri) {
Stefan Holmerff2a6352016-01-14 10:00:21 +0100288 transport_cc = true;
289 send_config->rtp.extensions.push_back(RtpExtension(
290 extension_type_.c_str(), kTransportSequenceNumberExtensionId));
291 }
292
293 for (AudioReceiveStream::Config& recv_config : *receive_configs) {
Stefan Holmerff2a6352016-01-14 10:00:21 +0100294 recv_config.rtp.transport_cc = transport_cc;
295 recv_config.rtp.extensions = send_config->rtp.extensions;
296 recv_config.rtp.remote_ssrc = send_config->rtp.ssrc;
297 }
298}
299
philipel5ef2bc12017-02-21 07:28:31 -0800300void RampUpTester::ModifyFlexfecConfigs(
301 std::vector<FlexfecReceiveStream::Config>* receive_configs) {
302 if (num_flexfec_streams_ == 0)
303 return;
304 RTC_DCHECK_EQ(1, num_flexfec_streams_);
305 (*receive_configs)[0].payload_type = test::CallTest::kFlexfecPayloadType;
306 (*receive_configs)[0].remote_ssrc = test::CallTest::kFlexfecSendSsrc;
307 (*receive_configs)[0].protected_media_ssrcs = {video_ssrcs_[0]};
308 (*receive_configs)[0].local_ssrc = video_ssrcs_[0];
309 if (extension_type_ == RtpExtension::kAbsSendTimeUri) {
310 (*receive_configs)[0].transport_cc = false;
311 (*receive_configs)[0].rtp_header_extensions.push_back(
312 RtpExtension(extension_type_.c_str(), kAbsSendTimeExtensionId));
313 } else if (extension_type_ == RtpExtension::kTransportSequenceNumberUri) {
314 (*receive_configs)[0].transport_cc = true;
315 (*receive_configs)[0].rtp_header_extensions.push_back(RtpExtension(
316 extension_type_.c_str(), kTransportSequenceNumberExtensionId));
317 }
318}
319
stefan4fbd1452015-09-28 03:57:14 -0700320void RampUpTester::OnCallsCreated(Call* sender_call, Call* receiver_call) {
Tommi5e005f42019-08-05 15:29:14 +0200321 RTC_DCHECK(sender_call);
stefan4fbd1452015-09-28 03:57:14 -0700322 sender_call_ = sender_call;
Tommi5e005f42019-08-05 15:29:14 +0200323 pending_task_ = task_queue_->PostTask([this]() { PollStats(); });
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000324}
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000325
tommi0f8b4032017-02-22 11:22:05 -0800326void RampUpTester::PollStats() {
Tommi6b117a52019-08-20 09:58:56 +0200327 RTC_DCHECK_RUN_ON(task_queue_);
328
329 EnsurePollTimeSet();
330
Tommi5e005f42019-08-05 15:29:14 +0200331 pending_task_ = -1;
332 Call::Stats stats = sender_call_->GetStats();
333 EXPECT_GE(expected_bitrate_bps_, 0);
stefan4fbd1452015-09-28 03:57:14 -0700334
Tommi5e005f42019-08-05 15:29:14 +0200335 if (stats.send_bandwidth_bps >= expected_bitrate_bps_ &&
336 (min_run_time_ms_ == -1 ||
337 clock_->TimeInMilliseconds() - test_start_ms_ >= min_run_time_ms_)) {
338 ramp_up_finished_ms_ = clock_->TimeInMilliseconds();
339 observation_complete_.Set();
340 } else {
341 pending_task_ = task_queue_->PostDelayedTask([this]() { PollStats(); },
Tommi6b117a52019-08-20 09:58:56 +0200342 GetIntervalForNextPoll());
Tommi5e005f42019-08-05 15:29:14 +0200343 }
Erik Språng468e62a2015-07-06 10:50:47 +0200344}
345
stefan4fbd1452015-09-28 03:57:14 -0700346void RampUpTester::ReportResult(const std::string& measurement,
347 size_t value,
348 const std::string& units) const {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000349 webrtc::test::PrintResult(
350 measurement, "",
stefanff483612015-12-21 03:14:00 -0800351 ::testing::UnitTest::GetInstance()->current_test_info()->name(), value,
352 units, false);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000353}
354
stefan092508a2015-09-29 02:26:42 -0700355void RampUpTester::AccumulateStats(const VideoSendStream::StreamStats& stream,
356 size_t* total_packets_sent,
357 size_t* total_sent,
358 size_t* padding_sent,
359 size_t* media_sent) const {
stefan4fbd1452015-09-28 03:57:14 -0700360 *total_packets_sent += stream.rtp_stats.transmitted.packets +
361 stream.rtp_stats.retransmitted.packets +
362 stream.rtp_stats.fec.packets;
363 *total_sent += stream.rtp_stats.transmitted.TotalBytes() +
364 stream.rtp_stats.retransmitted.TotalBytes() +
365 stream.rtp_stats.fec.TotalBytes();
366 *padding_sent += stream.rtp_stats.transmitted.padding_bytes +
367 stream.rtp_stats.retransmitted.padding_bytes +
368 stream.rtp_stats.fec.padding_bytes;
369 *media_sent += stream.rtp_stats.MediaPayloadBytes();
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000370}
371
stefan4fbd1452015-09-28 03:57:14 -0700372void RampUpTester::TriggerTestDone() {
Erik Språngf3a7c9d2015-10-05 14:03:22 +0200373 RTC_DCHECK_GE(test_start_ms_, 0);
374
Stefan Holmerff2a6352016-01-14 10:00:21 +0100375 // TODO(holmer): Add audio send stats here too when those APIs are available.
mflodman86cc6ff2016-07-26 04:44:06 -0700376 if (!send_stream_)
377 return;
378
Tommi5e005f42019-08-05 15:29:14 +0200379 // Stop polling stats.
380 // Corner case for field_trials=WebRTC-QuickPerfTest/Enabled/
381 task_queue_->SendTask([this]() {
382 if (pending_task_ !=
383 static_cast<test::SingleThreadedTaskQueueForTesting::TaskId>(-1)) {
384 task_queue_->CancelTask(pending_task_);
385 pending_task_ = -1;
386 }
387 });
388
stefan4fbd1452015-09-28 03:57:14 -0700389 VideoSendStream::Stats send_stats = send_stream_->GetStats();
Tommi5e005f42019-08-05 15:29:14 +0200390 send_stream_ = nullptr; // To avoid dereferencing a bad pointer.
stefan4fbd1452015-09-28 03:57:14 -0700391
392 size_t total_packets_sent = 0;
393 size_t total_sent = 0;
394 size_t padding_sent = 0;
395 size_t media_sent = 0;
stefanff483612015-12-21 03:14:00 -0800396 for (uint32_t ssrc : video_ssrcs_) {
stefan092508a2015-09-29 02:26:42 -0700397 AccumulateStats(send_stats.substreams[ssrc], &total_packets_sent,
398 &total_sent, &padding_sent, &media_sent);
stefan4fbd1452015-09-28 03:57:14 -0700399 }
400
401 size_t rtx_total_packets_sent = 0;
402 size_t rtx_total_sent = 0;
403 size_t rtx_padding_sent = 0;
404 size_t rtx_media_sent = 0;
stefanff483612015-12-21 03:14:00 -0800405 for (uint32_t rtx_ssrc : video_rtx_ssrcs_) {
stefan092508a2015-09-29 02:26:42 -0700406 AccumulateStats(send_stats.substreams[rtx_ssrc], &rtx_total_packets_sent,
407 &rtx_total_sent, &rtx_padding_sent, &rtx_media_sent);
stefan4fbd1452015-09-28 03:57:14 -0700408 }
409
stefan5a2c5062017-01-27 06:43:18 -0800410 if (report_perf_stats_) {
stefan5a2c5062017-01-27 06:43:18 -0800411 ReportResult("ramp-up-media-sent", media_sent, "bytes");
412 ReportResult("ramp-up-padding-sent", padding_sent, "bytes");
stefan5a2c5062017-01-27 06:43:18 -0800413 ReportResult("ramp-up-rtx-media-sent", rtx_media_sent, "bytes");
414 ReportResult("ramp-up-rtx-padding-sent", rtx_padding_sent, "bytes");
415 if (ramp_up_finished_ms_ >= 0) {
416 ReportResult("ramp-up-time", ramp_up_finished_ms_ - test_start_ms_,
417 "milliseconds");
418 }
419 ReportResult("ramp-up-average-network-latency",
420 send_transport_->GetAverageDelayMs(), "milliseconds");
stefan4fbd1452015-09-28 03:57:14 -0700421 }
422}
423
424void RampUpTester::PerformTest() {
Erik Språngf3a7c9d2015-10-05 14:03:22 +0200425 test_start_ms_ = clock_->TimeInMilliseconds();
Peter Boström5811a392015-12-10 13:02:50 +0100426 EXPECT_TRUE(Wait()) << "Timed out while waiting for ramp-up to complete.";
stefan4fbd1452015-09-28 03:57:14 -0700427 TriggerTestDone();
428}
429
Tommi6b117a52019-08-20 09:58:56 +0200430void RampUpTester::EnsurePollTimeSet() {
431 RTC_DCHECK_RUN_ON(task_queue_);
432 if (!next_scheduled_poll_time_ms_)
433 next_scheduled_poll_time_ms_ = rtc::TimeMillis();
434}
435
436int64_t RampUpTester::GetIntervalForNextPoll() {
437 RTC_DCHECK_RUN_ON(task_queue_);
438 RTC_DCHECK_NE(next_scheduled_poll_time_ms_, 0)
439 << "No call to EnsurePollTimeSet()";
440 auto now = rtc::TimeMillis();
441 next_scheduled_poll_time_ms_ += kPollIntervalMs;
442 auto interval = next_scheduled_poll_time_ms_ - now;
443 return interval > 0 ? interval : 0;
444}
445
Tommi5e005f42019-08-05 15:29:14 +0200446RampUpDownUpTester::RampUpDownUpTester(
447 size_t num_video_streams,
448 size_t num_audio_streams,
449 size_t num_flexfec_streams,
450 unsigned int start_bitrate_bps,
451 const std::string& extension_type,
452 bool rtx,
453 bool red,
454 const std::vector<int>& loss_rates,
455 bool report_perf_stats,
456 test::SingleThreadedTaskQueueForTesting* task_queue)
Stefan Holmerff2a6352016-01-14 10:00:21 +0100457 : RampUpTester(num_video_streams,
458 num_audio_streams,
philipel5ef2bc12017-02-21 07:28:31 -0800459 num_flexfec_streams,
Stefan Holmerff2a6352016-01-14 10:00:21 +0100460 start_bitrate_bps,
stefan5a2c5062017-01-27 06:43:18 -0800461 0,
Stefan Holmerff2a6352016-01-14 10:00:21 +0100462 extension_type,
463 rtx,
stefan5a2c5062017-01-27 06:43:18 -0800464 red,
Tommi5e005f42019-08-05 15:29:14 +0200465 report_perf_stats,
466 task_queue),
stefan76d9c9c2017-04-01 06:51:09 -0700467 link_rates_({4 * GetExpectedHighBitrate() / (3 * 1000),
468 kLowBandwidthLimitBps / 1000,
469 4 * GetExpectedHighBitrate() / (3 * 1000), 0}),
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000470 test_state_(kFirstRampup),
philipel5ef2bc12017-02-21 07:28:31 -0800471 next_state_(kTransitionToNextState),
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000472 state_start_ms_(clock_->TimeInMilliseconds()),
stefan4fbd1452015-09-28 03:57:14 -0700473 interval_start_ms_(clock_->TimeInMilliseconds()),
philipel5ef2bc12017-02-21 07:28:31 -0800474 sent_bytes_(0),
475 loss_rates_(loss_rates) {
476 forward_transport_config_.link_capacity_kbps = link_rates_[test_state_];
477 forward_transport_config_.queue_delay_ms = 100;
478 forward_transport_config_.loss_percent = loss_rates_[test_state_];
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000479}
480
stefan4fbd1452015-09-28 03:57:14 -0700481RampUpDownUpTester::~RampUpDownUpTester() {}
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000482
tommi0f8b4032017-02-22 11:22:05 -0800483void RampUpDownUpTester::PollStats() {
Tommi6b117a52019-08-20 09:58:56 +0200484 EnsurePollTimeSet();
485
Tommi5e005f42019-08-05 15:29:14 +0200486 pending_task_ = -1;
487 bool last_round = (test_state_ == kTestEnd);
488
489 int transmit_bitrate_bps = 0;
490 bool suspended = false;
491 if (num_video_streams_ > 0 && send_stream_) {
492 webrtc::VideoSendStream::Stats stats = send_stream_->GetStats();
493 for (const auto& it : stats.substreams) {
494 transmit_bitrate_bps += it.second.total_bitrate_bps;
Alex Narest78609d52017-10-20 10:37:47 +0200495 }
Tommi5e005f42019-08-05 15:29:14 +0200496 suspended = stats.suspended;
497 }
498 if (num_audio_streams_ > 0 && sender_call_) {
499 // An audio send stream doesn't have bitrate stats, so the call send BW is
500 // currently used instead.
501 transmit_bitrate_bps = sender_call_->GetStats().send_bandwidth_bps;
502 }
503
504 EvolveTestState(transmit_bitrate_bps, suspended);
505
506 if (!last_round) {
507 pending_task_ = task_queue_->PostDelayedTask([this]() { PollStats(); },
Tommi6b117a52019-08-20 09:58:56 +0200508 GetIntervalForNextPoll());
Tommi5e005f42019-08-05 15:29:14 +0200509 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000510}
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000511
Niels Möllerde8e6e62018-11-13 15:10:33 +0100512void RampUpDownUpTester::ModifyReceiverBitrateConfig(
513 BitrateConstraints* bitrate_config) {
514 bitrate_config->min_bitrate_bps = 10000;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000515}
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000516
stefan4fbd1452015-09-28 03:57:14 -0700517std::string RampUpDownUpTester::GetModifierString() const {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000518 std::string str("_");
stefanff483612015-12-21 03:14:00 -0800519 if (num_video_streams_ > 0) {
Jonas Olsson0a713b62018-04-04 15:49:32 +0200520 str += rtc::ToString(num_video_streams_);
stefanff483612015-12-21 03:14:00 -0800521 str += "stream";
522 str += (num_video_streams_ > 1 ? "s" : "");
523 str += "_";
524 }
525 if (num_audio_streams_ > 0) {
Jonas Olsson0a713b62018-04-04 15:49:32 +0200526 str += rtc::ToString(num_audio_streams_);
stefanff483612015-12-21 03:14:00 -0800527 str += "stream";
528 str += (num_audio_streams_ > 1 ? "s" : "");
529 str += "_";
530 }
stefan4fbd1452015-09-28 03:57:14 -0700531 str += (rtx_ ? "" : "no");
Edward Lemurdd3987f2018-01-04 19:44:54 +0100532 str += "rtx_";
533 str += (red_ ? "" : "no");
534 str += "red";
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000535 return str;
536}
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000537
stefandb752f92016-12-05 08:23:40 -0800538int RampUpDownUpTester::GetExpectedHighBitrate() const {
stefan38d8b3c2017-01-09 04:19:24 -0800539 int expected_bitrate_bps = 0;
540 if (num_audio_streams_ > 0)
541 expected_bitrate_bps += kExpectedHighAudioBitrateBps;
542 if (num_video_streams_ > 0)
543 expected_bitrate_bps += kExpectedHighVideoBitrateBps;
544 return expected_bitrate_bps;
545}
546
philipel5ef2bc12017-02-21 07:28:31 -0800547size_t RampUpDownUpTester::GetFecBytes() const {
548 size_t flex_fec_bytes = 0;
549 if (num_flexfec_streams_ > 0) {
550 webrtc::VideoSendStream::Stats stats = send_stream_->GetStats();
551 for (const auto& kv : stats.substreams)
552 flex_fec_bytes += kv.second.rtp_stats.fec.TotalBytes();
553 }
554 return flex_fec_bytes;
555}
556
557bool RampUpDownUpTester::ExpectingFec() const {
558 return num_flexfec_streams_ > 0 && forward_transport_config_.loss_percent > 0;
559}
560
stefan4fbd1452015-09-28 03:57:14 -0700561void RampUpDownUpTester::EvolveTestState(int bitrate_bps, bool suspended) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000562 int64_t now = clock_->TimeInMilliseconds();
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000563 switch (test_state_) {
philipel5ef2bc12017-02-21 07:28:31 -0800564 case kFirstRampup:
stefan4fbd1452015-09-28 03:57:14 -0700565 EXPECT_FALSE(suspended);
stefandb752f92016-12-05 08:23:40 -0800566 if (bitrate_bps >= GetExpectedHighBitrate()) {
stefan45b5fe52017-03-09 06:27:02 -0800567 if (report_perf_stats_) {
568 webrtc::test::PrintResult("ramp_up_down_up", GetModifierString(),
569 "first_rampup", now - state_start_ms_, "ms",
570 false);
571 }
philipel5ef2bc12017-02-21 07:28:31 -0800572 // Apply loss during the transition between states if FEC is enabled.
573 forward_transport_config_.loss_percent = loss_rates_[test_state_];
574 test_state_ = kTransitionToNextState;
575 next_state_ = kLowRate;
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000576 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000577 break;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000578 case kLowRate: {
mflodman86cc6ff2016-07-26 04:44:06 -0700579 // Audio streams are never suspended.
580 bool check_suspend_state = num_video_streams_ > 0;
Sebastian Jansson12fb1702018-02-23 11:34:18 +0100581 if (bitrate_bps < kLowBandwidthLimitBps + kLowBitrateMarginBps &&
mflodman86cc6ff2016-07-26 04:44:06 -0700582 suspended == check_suspend_state) {
stefan45b5fe52017-03-09 06:27:02 -0800583 if (report_perf_stats_) {
584 webrtc::test::PrintResult("ramp_up_down_up", GetModifierString(),
585 "rampdown", now - state_start_ms_, "ms",
586 false);
587 }
philipel5ef2bc12017-02-21 07:28:31 -0800588 // Apply loss during the transition between states if FEC is enabled.
589 forward_transport_config_.loss_percent = loss_rates_[test_state_];
590 test_state_ = kTransitionToNextState;
591 next_state_ = kSecondRampup;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000592 }
593 break;
594 }
philipel5ef2bc12017-02-21 07:28:31 -0800595 case kSecondRampup:
stefandb752f92016-12-05 08:23:40 -0800596 if (bitrate_bps >= GetExpectedHighBitrate() && !suspended) {
stefan45b5fe52017-03-09 06:27:02 -0800597 if (report_perf_stats_) {
598 webrtc::test::PrintResult("ramp_up_down_up", GetModifierString(),
599 "second_rampup", now - state_start_ms_,
600 "ms", false);
601 ReportResult("ramp-up-down-up-average-network-latency",
602 send_transport_->GetAverageDelayMs(), "milliseconds");
603 }
philipel5ef2bc12017-02-21 07:28:31 -0800604 // Apply loss during the transition between states if FEC is enabled.
605 forward_transport_config_.loss_percent = loss_rates_[test_state_];
606 test_state_ = kTransitionToNextState;
607 next_state_ = kTestEnd;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000608 }
609 break;
philipel5ef2bc12017-02-21 07:28:31 -0800610 case kTestEnd:
611 observation_complete_.Set();
612 break;
613 case kTransitionToNextState:
614 if (!ExpectingFec() || GetFecBytes() > 0) {
615 test_state_ = next_state_;
616 forward_transport_config_.link_capacity_kbps = link_rates_[test_state_];
617 // No loss while ramping up and down as it may affect the BWE
618 // negatively, making the test flaky.
619 forward_transport_config_.loss_percent = 0;
620 state_start_ms_ = now;
621 interval_start_ms_ = now;
622 sent_bytes_ = 0;
Artem Titov631cafa2018-08-21 21:01:00 +0200623 send_simulated_network_->SetConfig(forward_transport_config_);
philipel5ef2bc12017-02-21 07:28:31 -0800624 }
625 break;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000626 }
627}
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +0000628
stefan4fbd1452015-09-28 03:57:14 -0700629class RampUpTest : public test::CallTest {
Erik Språng6b8d3552015-09-24 15:06:57 +0200630 public:
Danil Chapovalov304ea5f2019-04-11 15:18:18 +0200631 RampUpTest()
632 : task_queue_factory_(CreateDefaultTaskQueueFactory()),
633 rtc_event_log_factory_(task_queue_factory_.get()) {
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200634 std::string dump_name(absl::GetFlag(FLAGS_ramp_dump_name));
Sebastian Janssonf5e767d2018-10-15 13:24:31 +0200635 if (!dump_name.empty()) {
Danil Chapovalov304ea5f2019-04-11 15:18:18 +0200636 send_event_log_ = rtc_event_log_factory_.CreateRtcEventLog(
637 RtcEventLog::EncodingType::Legacy);
638 recv_event_log_ = rtc_event_log_factory_.CreateRtcEventLog(
639 RtcEventLog::EncodingType::Legacy);
Sebastian Janssonf5e767d2018-10-15 13:24:31 +0200640 bool event_log_started =
641 send_event_log_->StartLogging(
642 absl::make_unique<RtcEventLogOutputFile>(
643 dump_name + ".send.rtc.dat", RtcEventLog::kUnlimitedOutput),
644 RtcEventLog::kImmediateOutput) &&
645 recv_event_log_->StartLogging(
646 absl::make_unique<RtcEventLogOutputFile>(
647 dump_name + ".recv.rtc.dat", RtcEventLog::kUnlimitedOutput),
648 RtcEventLog::kImmediateOutput);
649 RTC_DCHECK(event_log_started);
650 }
651 }
Danil Chapovalov304ea5f2019-04-11 15:18:18 +0200652
653 private:
654 const std::unique_ptr<TaskQueueFactory> task_queue_factory_;
655 RtcEventLogFactory rtc_event_log_factory_;
Erik Språng6b8d3552015-09-24 15:06:57 +0200656};
657
Stefan Holmerff2a6352016-01-14 10:00:21 +0100658static const uint32_t kStartBitrateBps = 60000;
659
stefan38d8b3c2017-01-09 04:19:24 -0800660TEST_F(RampUpTest, UpDownUpAbsSendTimeSimulcastRedRtx) {
philipel5ef2bc12017-02-21 07:28:31 -0800661 std::vector<int> loss_rates = {0, 0, 0, 0};
662 RampUpDownUpTester test(3, 0, 0, kStartBitrateBps,
stefan45b5fe52017-03-09 06:27:02 -0800663 RtpExtension::kAbsSendTimeUri, true, true, loss_rates,
Tommi5e005f42019-08-05 15:29:14 +0200664 true, &task_queue_);
stefane74eef12016-01-08 06:47:13 -0800665 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800666}
Stefan Holmerff2a6352016-01-14 10:00:21 +0100667
Taylor Brandstetterba6b5032018-02-16 09:59:56 -0800668// TODO(bugs.webrtc.org/8878)
669#if defined(WEBRTC_MAC)
670#define MAYBE_UpDownUpTransportSequenceNumberRtx \
671 DISABLED_UpDownUpTransportSequenceNumberRtx
672#else
673#define MAYBE_UpDownUpTransportSequenceNumberRtx \
674 UpDownUpTransportSequenceNumberRtx
675#endif
676TEST_F(RampUpTest, MAYBE_UpDownUpTransportSequenceNumberRtx) {
philipel5ef2bc12017-02-21 07:28:31 -0800677 std::vector<int> loss_rates = {0, 0, 0, 0};
678 RampUpDownUpTester test(3, 0, 0, kStartBitrateBps,
isheriff6f8d6862016-05-26 11:24:55 -0700679 RtpExtension::kTransportSequenceNumberUri, true,
Tommi5e005f42019-08-05 15:29:14 +0200680 false, loss_rates, true, &task_queue_);
philipel5ef2bc12017-02-21 07:28:31 -0800681 RunBaseTest(&test);
682}
683
stefan45b5fe52017-03-09 06:27:02 -0800684// TODO(holmer): Tests which don't report perf stats should be moved to a
685// different executable since they per definition are not perf tests.
Taylor Brandstetter05d98222017-10-10 12:12:53 -0700686// This test is disabled because it crashes on Linux, and is flaky on other
687// platforms. See: crbug.com/webrtc/7919
688TEST_F(RampUpTest, DISABLED_UpDownUpTransportSequenceNumberPacketLoss) {
philipel5ef2bc12017-02-21 07:28:31 -0800689 std::vector<int> loss_rates = {20, 0, 0, 0};
690 RampUpDownUpTester test(1, 0, 1, kStartBitrateBps,
691 RtpExtension::kTransportSequenceNumberUri, true,
Tommi5e005f42019-08-05 15:29:14 +0200692 false, loss_rates, false, &task_queue_);
Stefan Holmerff2a6352016-01-14 10:00:21 +0100693 RunBaseTest(&test);
694}
695
Taylor Brandstetterab86e7f2018-02-12 15:16:02 -0800696// TODO(bugs.webrtc.org/8878)
697#if defined(WEBRTC_MAC)
698#define MAYBE_UpDownUpAudioVideoTransportSequenceNumberRtx \
699 DISABLED_UpDownUpAudioVideoTransportSequenceNumberRtx
700#else
701#define MAYBE_UpDownUpAudioVideoTransportSequenceNumberRtx \
702 UpDownUpAudioVideoTransportSequenceNumberRtx
703#endif
704TEST_F(RampUpTest, MAYBE_UpDownUpAudioVideoTransportSequenceNumberRtx) {
Per Kjellander914351d2019-02-15 10:54:55 +0100705 test::ScopedFieldTrials field_trials("WebRTC-Audio-SendSideBwe/Enabled/");
philipel5ef2bc12017-02-21 07:28:31 -0800706 std::vector<int> loss_rates = {0, 0, 0, 0};
707 RampUpDownUpTester test(3, 1, 0, kStartBitrateBps,
isheriff6f8d6862016-05-26 11:24:55 -0700708 RtpExtension::kTransportSequenceNumberUri, true,
Tommi5e005f42019-08-05 15:29:14 +0200709 false, loss_rates, false, &task_queue_);
Stefan Holmerff2a6352016-01-14 10:00:21 +0100710 RunBaseTest(&test);
711}
712
stefan38d8b3c2017-01-09 04:19:24 -0800713TEST_F(RampUpTest, UpDownUpAudioTransportSequenceNumberRtx) {
Per Kjellander914351d2019-02-15 10:54:55 +0100714 test::ScopedFieldTrials field_trials("WebRTC-Audio-SendSideBwe/Enabled/");
philipel5ef2bc12017-02-21 07:28:31 -0800715 std::vector<int> loss_rates = {0, 0, 0, 0};
716 RampUpDownUpTester test(0, 1, 0, kStartBitrateBps,
mflodman86cc6ff2016-07-26 04:44:06 -0700717 RtpExtension::kTransportSequenceNumberUri, true,
Tommi5e005f42019-08-05 15:29:14 +0200718 false, loss_rates, false, &task_queue_);
mflodman86cc6ff2016-07-26 04:44:06 -0700719 RunBaseTest(&test);
720}
721
stefan38d8b3c2017-01-09 04:19:24 -0800722TEST_F(RampUpTest, TOffsetSimulcastRedRtx) {
philipel5ef2bc12017-02-21 07:28:31 -0800723 RampUpTester test(3, 0, 0, 0, 0, RtpExtension::kTimestampOffsetUri, true,
Tommi5e005f42019-08-05 15:29:14 +0200724 true, true, &task_queue_);
stefan38d8b3c2017-01-09 04:19:24 -0800725 RunBaseTest(&test);
726}
727
728TEST_F(RampUpTest, AbsSendTime) {
philipel5ef2bc12017-02-21 07:28:31 -0800729 RampUpTester test(1, 0, 0, 0, 0, RtpExtension::kAbsSendTimeUri, false, false,
Tommi5e005f42019-08-05 15:29:14 +0200730 false, &task_queue_);
stefane74eef12016-01-08 06:47:13 -0800731 RunBaseTest(&test);
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000732}
733
stefan38d8b3c2017-01-09 04:19:24 -0800734TEST_F(RampUpTest, AbsSendTimeSimulcastRedRtx) {
philipel5ef2bc12017-02-21 07:28:31 -0800735 RampUpTester test(3, 0, 0, 0, 0, RtpExtension::kAbsSendTimeUri, true, true,
Tommi5e005f42019-08-05 15:29:14 +0200736 true, &task_queue_);
stefane74eef12016-01-08 06:47:13 -0800737 RunBaseTest(&test);
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000738}
739
stefan38d8b3c2017-01-09 04:19:24 -0800740TEST_F(RampUpTest, TransportSequenceNumber) {
philipel5ef2bc12017-02-21 07:28:31 -0800741 RampUpTester test(1, 0, 0, 0, 0, RtpExtension::kTransportSequenceNumberUri,
Tommi5e005f42019-08-05 15:29:14 +0200742 false, false, false, &task_queue_);
stefane74eef12016-01-08 06:47:13 -0800743 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200744}
745
746TEST_F(RampUpTest, TransportSequenceNumberSimulcast) {
philipel5ef2bc12017-02-21 07:28:31 -0800747 RampUpTester test(3, 0, 0, 0, 0, RtpExtension::kTransportSequenceNumberUri,
Tommi5e005f42019-08-05 15:29:14 +0200748 false, false, false, &task_queue_);
stefane74eef12016-01-08 06:47:13 -0800749 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200750}
751
stefan38d8b3c2017-01-09 04:19:24 -0800752TEST_F(RampUpTest, TransportSequenceNumberSimulcastRedRtx) {
philipel5ef2bc12017-02-21 07:28:31 -0800753 RampUpTester test(3, 0, 0, 0, 0, RtpExtension::kTransportSequenceNumberUri,
Tommi5e005f42019-08-05 15:29:14 +0200754 true, true, true, &task_queue_);
stefan5a2c5062017-01-27 06:43:18 -0800755 RunBaseTest(&test);
756}
757
Niels Möllercd2e1052018-11-08 10:23:13 +0100758TEST_F(RampUpTest, AudioTransportSequenceNumber) {
philipel5ef2bc12017-02-21 07:28:31 -0800759 RampUpTester test(0, 1, 0, 300000, 10000,
stefan5a2c5062017-01-27 06:43:18 -0800760 RtpExtension::kTransportSequenceNumberUri, false, false,
Tommi5e005f42019-08-05 15:29:14 +0200761 false, &task_queue_);
stefane74eef12016-01-08 06:47:13 -0800762 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200763}
pbos@webrtc.org744fbc72013-09-10 09:26:25 +0000764} // namespace webrtc