blob: 6459c3b30ecf5868f9b9567b92d0e968c9cbcf2d [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
11#include "testing/gtest/include/gtest/gtest.h"
pbos@webrtc.org2b4ce3a2015-03-23 13:12:24 +000012#include "webrtc/base/checks.h"
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +000013#include "webrtc/base/common.h"
Erik Språng6b8d3552015-09-24 15:06:57 +020014#include "webrtc/base/event.h"
15#include "webrtc/modules/pacing/include/packet_router.h"
Erik Språng468e62a2015-07-06 10:50:47 +020016#include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h"
17#include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h"
Erik Språng6b8d3552015-09-24 15:06:57 +020018#include "webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h"
pbos@webrtc.org744fbc72013-09-10 09:26:25 +000019#include "webrtc/modules/rtp_rtcp/interface/receive_statistics.h"
20#include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h"
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +000021#include "webrtc/modules/rtp_rtcp/interface/rtp_payload_registry.h"
pbos@webrtc.org744fbc72013-09-10 09:26:25 +000022#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h"
23#include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
24#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
Erik Språng6b8d3552015-09-24 15:06:57 +020025#include "webrtc/system_wrappers/interface/thread_wrapper.h"
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +000026#include "webrtc/test/testsupport/perf_test.h"
stefan@webrtc.org3d7da882014-07-08 13:59:46 +000027#include "webrtc/video/rampup_tests.h"
pbos@webrtc.org744fbc72013-09-10 09:26:25 +000028
29namespace webrtc {
pbos@webrtc.org29023282013-09-11 10:14:56 +000030namespace {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +000031
stefan4fbd1452015-09-28 03:57:14 -070032static const int64_t kPollIntervalMs = 250;
pbos@webrtc.org29023282013-09-11 10:14:56 +000033
stefan@webrtc.org3d7da882014-07-08 13:59:46 +000034std::vector<uint32_t> GenerateSsrcs(size_t num_streams,
35 uint32_t ssrc_offset) {
36 std::vector<uint32_t> ssrcs;
37 for (size_t i = 0; i != num_streams; ++i)
38 ssrcs.push_back(static_cast<uint32_t>(ssrc_offset + i));
39 return ssrcs;
40}
mflodman@webrtc.orgeb16b812014-06-16 08:57:39 +000041} // namespace
henrik.lundin@webrtc.org845862f2014-03-06 07:19:28 +000042
stefan4fbd1452015-09-28 03:57:14 -070043RampUpTester::RampUpTester(size_t num_streams,
44 unsigned int start_bitrate_bps,
45 const std::string& extension_type,
46 bool rtx,
47 bool red)
48 : EndToEndTest(test::CallTest::kLongTimeoutMs),
49 event_(false, false),
50 clock_(Clock::GetRealTimeClock()),
51 num_streams_(num_streams),
52 rtx_(rtx),
53 red_(red),
54 send_stream_(nullptr),
55 start_bitrate_bps_(start_bitrate_bps),
56 start_bitrate_verified_(false),
stefan@webrtc.org3d7da882014-07-08 13:59:46 +000057 expected_bitrate_bps_(0),
Erik Språngf3a7c9d2015-10-05 14:03:22 +020058 test_start_ms_(-1),
stefan4fbd1452015-09-28 03:57:14 -070059 ramp_up_finished_ms_(-1),
60 extension_type_(extension_type),
61 ssrcs_(GenerateSsrcs(num_streams, 100)),
62 rtx_ssrcs_(GenerateSsrcs(num_streams, 200)),
63 poller_thread_(ThreadWrapper::CreateThread(&BitrateStatsPollingThread,
64 this,
65 "BitrateStatsPollingThread")),
66 sender_call_(nullptr) {
67 if (rtx_) {
68 for (size_t i = 0; i < ssrcs_.size(); ++i)
69 rtx_ssrc_map_[rtx_ssrcs_[i]] = ssrcs_[i];
stefan@webrtc.org3d7da882014-07-08 13:59:46 +000070 }
stefan4fbd1452015-09-28 03:57:14 -070071}
72
73RampUpTester::~RampUpTester() {
74 event_.Set();
stefan4fbd1452015-09-28 03:57:14 -070075}
76
77Call::Config RampUpTester::GetSenderCallConfig() {
78 Call::Config call_config;
79 if (start_bitrate_bps_ != 0) {
80 call_config.bitrate_config.start_bitrate_bps = start_bitrate_bps_;
81 }
82 call_config.bitrate_config.min_bitrate_bps = 10000;
83 return call_config;
84}
85
86void RampUpTester::OnStreamsCreated(
87 VideoSendStream* send_stream,
88 const std::vector<VideoReceiveStream*>& receive_streams) {
89 send_stream_ = send_stream;
90}
91
92size_t RampUpTester::GetNumStreams() const {
93 return num_streams_;
94}
95
96void RampUpTester::ModifyConfigs(
97 VideoSendStream::Config* send_config,
98 std::vector<VideoReceiveStream::Config>* receive_configs,
99 VideoEncoderConfig* encoder_config) {
100 send_config->suspend_below_min_bitrate = true;
101
102 if (num_streams_ == 1) {
103 encoder_config->streams[0].target_bitrate_bps =
104 encoder_config->streams[0].max_bitrate_bps = 2000000;
105 // For single stream rampup until 1mbps
106 expected_bitrate_bps_ = kSingleStreamTargetBps;
107 } else {
108 // For multi stream rampup until all streams are being sent. That means
109 // enough birate to send all the target streams plus the min bitrate of
110 // the last one.
111 expected_bitrate_bps_ = encoder_config->streams.back().min_bitrate_bps;
112 for (size_t i = 0; i < encoder_config->streams.size() - 1; ++i) {
113 expected_bitrate_bps_ += encoder_config->streams[i].target_bitrate_bps;
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000114 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000115 }
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000116
stefan4fbd1452015-09-28 03:57:14 -0700117 send_config->rtp.extensions.clear();
118
119 bool remb;
120 if (extension_type_ == RtpExtension::kAbsSendTime) {
121 remb = true;
122 send_config->rtp.extensions.push_back(
123 RtpExtension(extension_type_.c_str(), kAbsSendTimeExtensionId));
124 } else if (extension_type_ == RtpExtension::kTransportSequenceNumber) {
125 remb = false;
126 send_config->rtp.extensions.push_back(RtpExtension(
127 extension_type_.c_str(), kTransportSequenceNumberExtensionId));
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000128 } else {
stefan4fbd1452015-09-28 03:57:14 -0700129 remb = true;
130 send_config->rtp.extensions.push_back(RtpExtension(
131 extension_type_.c_str(), kTransmissionTimeOffsetExtensionId));
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000132 }
stefan4fbd1452015-09-28 03:57:14 -0700133
134 send_config->rtp.nack.rtp_history_ms = test::CallTest::kNackRtpHistoryMs;
135 send_config->rtp.ssrcs = ssrcs_;
136 if (rtx_) {
137 send_config->rtp.rtx.payload_type = test::CallTest::kSendRtxPayloadType;
138 send_config->rtp.rtx.ssrcs = rtx_ssrcs_;
139 }
140 if (red_) {
141 send_config->rtp.fec.ulpfec_payload_type =
142 test::CallTest::kUlpfecPayloadType;
143 send_config->rtp.fec.red_payload_type = test::CallTest::kRedPayloadType;
144 }
145
146 size_t i = 0;
147 for (VideoReceiveStream::Config& recv_config : *receive_configs) {
148 recv_config.rtp.remb = remb;
149 recv_config.rtp.extensions = send_config->rtp.extensions;
150
151 recv_config.rtp.remote_ssrc = ssrcs_[i];
152 recv_config.rtp.nack.rtp_history_ms = send_config->rtp.nack.rtp_history_ms;
153
154 if (red_) {
155 recv_config.rtp.fec.red_payload_type =
156 send_config->rtp.fec.red_payload_type;
157 recv_config.rtp.fec.ulpfec_payload_type =
158 send_config->rtp.fec.ulpfec_payload_type;
159 }
160
161 if (rtx_) {
162 recv_config.rtp.rtx[send_config->encoder_settings.payload_type].ssrc =
163 rtx_ssrcs_[i];
164 recv_config.rtp.rtx[send_config->encoder_settings.payload_type]
165 .payload_type = send_config->rtp.rtx.payload_type;
166 }
167 ++i;
168 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000169}
170
stefan4fbd1452015-09-28 03:57:14 -0700171void RampUpTester::OnCallsCreated(Call* sender_call, Call* receiver_call) {
172 sender_call_ = sender_call;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000173}
174
stefan4fbd1452015-09-28 03:57:14 -0700175bool RampUpTester::BitrateStatsPollingThread(void* obj) {
176 return static_cast<RampUpTester*>(obj)->PollStats();
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000177}
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000178
stefan4fbd1452015-09-28 03:57:14 -0700179bool RampUpTester::PollStats() {
180 if (sender_call_) {
181 Call::Stats stats = sender_call_->GetStats();
182
183 RTC_DCHECK_GT(expected_bitrate_bps_, 0);
184 if (!start_bitrate_verified_ && start_bitrate_bps_ != 0) {
185 // For tests with an explicitly set start bitrate, verify the first
186 // bitrate estimate is close to the start bitrate and lower than the
187 // test target bitrate. This is to verify a call respects the configured
188 // start bitrate, but due to the BWE implementation we can't guarantee the
189 // first estimate really is as high as the start bitrate.
190 EXPECT_GT(stats.send_bandwidth_bps, 0.9 * start_bitrate_bps_);
191 start_bitrate_verified_ = true;
192 }
193 if (stats.send_bandwidth_bps >= expected_bitrate_bps_) {
194 ramp_up_finished_ms_ = clock_->TimeInMilliseconds();
195 observation_complete_->Set();
196 }
197 }
198
199 return !event_.Wait(kPollIntervalMs);
Erik Språng468e62a2015-07-06 10:50:47 +0200200}
201
stefan4fbd1452015-09-28 03:57:14 -0700202void RampUpTester::ReportResult(const std::string& measurement,
203 size_t value,
204 const std::string& units) const {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000205 webrtc::test::PrintResult(
206 measurement, "",
207 ::testing::UnitTest::GetInstance()->current_test_info()->name(),
208 value, units, false);
209}
210
stefan092508a2015-09-29 02:26:42 -0700211void RampUpTester::AccumulateStats(const VideoSendStream::StreamStats& stream,
212 size_t* total_packets_sent,
213 size_t* total_sent,
214 size_t* padding_sent,
215 size_t* media_sent) const {
stefan4fbd1452015-09-28 03:57:14 -0700216 *total_packets_sent += stream.rtp_stats.transmitted.packets +
217 stream.rtp_stats.retransmitted.packets +
218 stream.rtp_stats.fec.packets;
219 *total_sent += stream.rtp_stats.transmitted.TotalBytes() +
220 stream.rtp_stats.retransmitted.TotalBytes() +
221 stream.rtp_stats.fec.TotalBytes();
222 *padding_sent += stream.rtp_stats.transmitted.padding_bytes +
223 stream.rtp_stats.retransmitted.padding_bytes +
224 stream.rtp_stats.fec.padding_bytes;
225 *media_sent += stream.rtp_stats.MediaPayloadBytes();
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000226}
227
stefan4fbd1452015-09-28 03:57:14 -0700228void RampUpTester::TriggerTestDone() {
Erik Språngf3a7c9d2015-10-05 14:03:22 +0200229 RTC_DCHECK_GE(test_start_ms_, 0);
230
stefan4fbd1452015-09-28 03:57:14 -0700231 VideoSendStream::Stats send_stats = send_stream_->GetStats();
232
233 size_t total_packets_sent = 0;
234 size_t total_sent = 0;
235 size_t padding_sent = 0;
236 size_t media_sent = 0;
237 for (uint32_t ssrc : ssrcs_) {
stefan092508a2015-09-29 02:26:42 -0700238 AccumulateStats(send_stats.substreams[ssrc], &total_packets_sent,
239 &total_sent, &padding_sent, &media_sent);
stefan4fbd1452015-09-28 03:57:14 -0700240 }
241
242 size_t rtx_total_packets_sent = 0;
243 size_t rtx_total_sent = 0;
244 size_t rtx_padding_sent = 0;
245 size_t rtx_media_sent = 0;
246 for (uint32_t rtx_ssrc : rtx_ssrcs_) {
stefan092508a2015-09-29 02:26:42 -0700247 AccumulateStats(send_stats.substreams[rtx_ssrc], &rtx_total_packets_sent,
248 &rtx_total_sent, &rtx_padding_sent, &rtx_media_sent);
stefan4fbd1452015-09-28 03:57:14 -0700249 }
250
251 ReportResult("ramp-up-total-packets-sent", total_packets_sent, "packets");
252 ReportResult("ramp-up-total-sent", total_sent, "bytes");
253 ReportResult("ramp-up-media-sent", media_sent, "bytes");
254 ReportResult("ramp-up-padding-sent", padding_sent, "bytes");
255 ReportResult("ramp-up-rtx-total-packets-sent", rtx_total_packets_sent,
256 "packets");
257 ReportResult("ramp-up-rtx-total-sent", rtx_total_sent, "bytes");
258 ReportResult("ramp-up-rtx-media-sent", rtx_media_sent, "bytes");
259 ReportResult("ramp-up-rtx-padding-sent", rtx_padding_sent, "bytes");
260 if (ramp_up_finished_ms_ >= 0) {
261 ReportResult("ramp-up-time", ramp_up_finished_ms_ - test_start_ms_,
262 "milliseconds");
263 }
264}
265
266void RampUpTester::PerformTest() {
Erik Språngf3a7c9d2015-10-05 14:03:22 +0200267 test_start_ms_ = clock_->TimeInMilliseconds();
spranga050e982015-10-02 06:51:48 -0700268 poller_thread_->Start();
stefan4fbd1452015-09-28 03:57:14 -0700269 if (Wait() != kEventSignaled) {
270 printf("Timed out while waiting for ramp-up to complete.");
271 return;
272 }
273 TriggerTestDone();
spranga050e982015-10-02 06:51:48 -0700274 poller_thread_->Stop();
stefan4fbd1452015-09-28 03:57:14 -0700275}
276
277RampUpDownUpTester::RampUpDownUpTester(size_t num_streams,
278 unsigned int start_bitrate_bps,
279 const std::string& extension_type,
280 bool rtx,
281 bool red)
282 : RampUpTester(num_streams, start_bitrate_bps, extension_type, rtx, red),
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000283 test_state_(kFirstRampup),
284 state_start_ms_(clock_->TimeInMilliseconds()),
stefan4fbd1452015-09-28 03:57:14 -0700285 interval_start_ms_(clock_->TimeInMilliseconds()),
286 sent_bytes_(0) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000287 forward_transport_config_.link_capacity_kbps =
288 kHighBandwidthLimitBps / 1000;
stefan4fbd1452015-09-28 03:57:14 -0700289 send_transport_.SetConfig(forward_transport_config_);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000290}
291
stefan4fbd1452015-09-28 03:57:14 -0700292RampUpDownUpTester::~RampUpDownUpTester() {}
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000293
stefan4fbd1452015-09-28 03:57:14 -0700294bool RampUpDownUpTester::PollStats() {
295 if (send_stream_) {
296 webrtc::VideoSendStream::Stats stats = send_stream_->GetStats();
297 int transmit_bitrate_bps = 0;
298 for (auto it : stats.substreams) {
299 transmit_bitrate_bps += it.second.total_bitrate_bps;
mflodman@webrtc.orgeb16b812014-06-16 08:57:39 +0000300 }
stefan4fbd1452015-09-28 03:57:14 -0700301
302 EvolveTestState(transmit_bitrate_bps, stats.suspended);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000303 }
stefan4fbd1452015-09-28 03:57:14 -0700304
305 return !event_.Wait(kPollIntervalMs);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000306}
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000307
stefan4fbd1452015-09-28 03:57:14 -0700308Call::Config RampUpDownUpTester::GetReceiverCallConfig() {
309 Call::Config config;
310 config.bitrate_config.min_bitrate_bps = 10000;
311 return config;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000312}
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000313
stefan4fbd1452015-09-28 03:57:14 -0700314std::string RampUpDownUpTester::GetModifierString() const {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000315 std::string str("_");
316 char temp_str[5];
stefan4fbd1452015-09-28 03:57:14 -0700317 sprintf(temp_str, "%i", static_cast<int>(num_streams_));
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000318 str += std::string(temp_str);
319 str += "stream";
stefan4fbd1452015-09-28 03:57:14 -0700320 str += (num_streams_ > 1 ? "s" : "");
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000321 str += "_";
stefan4fbd1452015-09-28 03:57:14 -0700322 str += (rtx_ ? "" : "no");
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000323 str += "rtx";
324 return str;
325}
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000326
stefan4fbd1452015-09-28 03:57:14 -0700327void RampUpDownUpTester::EvolveTestState(int bitrate_bps, bool suspended) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000328 int64_t now = clock_->TimeInMilliseconds();
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000329 switch (test_state_) {
330 case kFirstRampup: {
stefan4fbd1452015-09-28 03:57:14 -0700331 EXPECT_FALSE(suspended);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000332 if (bitrate_bps > kExpectedHighBitrateBps) {
333 // The first ramp-up has reached the target bitrate. Change the
334 // channel limit, and move to the next test state.
335 forward_transport_config_.link_capacity_kbps =
336 kLowBandwidthLimitBps / 1000;
stefan4fbd1452015-09-28 03:57:14 -0700337 send_transport_.SetConfig(forward_transport_config_);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000338 test_state_ = kLowRate;
339 webrtc::test::PrintResult("ramp_up_down_up",
340 GetModifierString(),
341 "first_rampup",
342 now - state_start_ms_,
343 "ms",
344 false);
345 state_start_ms_ = now;
346 interval_start_ms_ = now;
347 sent_bytes_ = 0;
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000348 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000349 break;
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +0000350 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000351 case kLowRate: {
stefan4fbd1452015-09-28 03:57:14 -0700352 if (bitrate_bps < kExpectedLowBitrateBps && suspended) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000353 // The ramp-down was successful. Change the channel limit back to a
354 // high value, and move to the next test state.
355 forward_transport_config_.link_capacity_kbps =
356 kHighBandwidthLimitBps / 1000;
stefan4fbd1452015-09-28 03:57:14 -0700357 send_transport_.SetConfig(forward_transport_config_);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000358 test_state_ = kSecondRampup;
359 webrtc::test::PrintResult("ramp_up_down_up",
360 GetModifierString(),
361 "rampdown",
362 now - state_start_ms_,
363 "ms",
364 false);
365 state_start_ms_ = now;
366 interval_start_ms_ = now;
367 sent_bytes_ = 0;
368 }
369 break;
370 }
371 case kSecondRampup: {
stefan4fbd1452015-09-28 03:57:14 -0700372 if (bitrate_bps > kExpectedHighBitrateBps && !suspended) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000373 webrtc::test::PrintResult("ramp_up_down_up",
374 GetModifierString(),
375 "second_rampup",
376 now - state_start_ms_,
377 "ms",
378 false);
stefan4fbd1452015-09-28 03:57:14 -0700379 observation_complete_->Set();
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000380 }
381 break;
382 }
383 }
384}
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +0000385
stefan4fbd1452015-09-28 03:57:14 -0700386class RampUpTest : public test::CallTest {
Erik Språng6b8d3552015-09-24 15:06:57 +0200387 public:
stefan4fbd1452015-09-28 03:57:14 -0700388 RampUpTest() {}
Erik Språng6b8d3552015-09-24 15:06:57 +0200389
stefan4fbd1452015-09-28 03:57:14 -0700390 virtual ~RampUpTest() {
391 EXPECT_EQ(nullptr, send_stream_);
392 EXPECT_TRUE(receive_streams_.empty());
Erik Språng6b8d3552015-09-24 15:06:57 +0200393 }
Erik Språng6b8d3552015-09-24 15:06:57 +0200394};
395
stefan@webrtc.orgcb254aa2014-06-12 15:12:25 +0000396TEST_F(RampUpTest, SingleStream) {
stefan4fbd1452015-09-28 03:57:14 -0700397 RampUpTester test(1, 0, RtpExtension::kTOffset, false, false);
398 RunBaseTest(&test);
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000399}
pbos@webrtc.org744fbc72013-09-10 09:26:25 +0000400
stefan@webrtc.orgcb254aa2014-06-12 15:12:25 +0000401TEST_F(RampUpTest, Simulcast) {
stefan4fbd1452015-09-28 03:57:14 -0700402 RampUpTester test(3, 0, RtpExtension::kTOffset, false, false);
403 RunBaseTest(&test);
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000404}
405
stefan@webrtc.orgcb254aa2014-06-12 15:12:25 +0000406TEST_F(RampUpTest, SimulcastWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700407 RampUpTester test(3, 0, RtpExtension::kTOffset, true, false);
408 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800409}
410
411TEST_F(RampUpTest, SimulcastByRedWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700412 RampUpTester test(3, 0, RtpExtension::kTOffset, true, true);
413 RunBaseTest(&test);
mflodman@webrtc.orgeb16b812014-06-16 08:57:39 +0000414}
415
416TEST_F(RampUpTest, SingleStreamWithHighStartBitrate) {
stefan4fbd1452015-09-28 03:57:14 -0700417 RampUpTester test(1, 0.9 * kSingleStreamTargetBps, RtpExtension::kTOffset,
418 false, false);
419 RunBaseTest(&test);
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000420}
pbos@webrtc.org744fbc72013-09-10 09:26:25 +0000421
Shao Changbine62202f2015-04-21 20:24:50 +0800422TEST_F(RampUpTest, UpDownUpOneStream) {
stefan4fbd1452015-09-28 03:57:14 -0700423 RampUpDownUpTester test(1, 60000, RtpExtension::kAbsSendTime, false, false);
424 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800425}
henrik.lundin@webrtc.org845862f2014-03-06 07:19:28 +0000426
Shao Changbine62202f2015-04-21 20:24:50 +0800427TEST_F(RampUpTest, UpDownUpThreeStreams) {
stefan4fbd1452015-09-28 03:57:14 -0700428 RampUpDownUpTester test(3, 60000, RtpExtension::kAbsSendTime, false, false);
429 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800430}
henrik.lundin@webrtc.org998cb8f2014-03-06 09:12:00 +0000431
Shao Changbine62202f2015-04-21 20:24:50 +0800432TEST_F(RampUpTest, UpDownUpOneStreamRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700433 RampUpDownUpTester test(1, 60000, RtpExtension::kAbsSendTime, true, false);
434 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800435}
henrik.lundin@webrtc.org998cb8f2014-03-06 09:12:00 +0000436
Shao Changbine62202f2015-04-21 20:24:50 +0800437TEST_F(RampUpTest, UpDownUpThreeStreamsRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700438 RampUpDownUpTester test(3, 60000, RtpExtension::kAbsSendTime, true, false);
439 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800440}
441
442TEST_F(RampUpTest, UpDownUpOneStreamByRedRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700443 RampUpDownUpTester test(1, 60000, RtpExtension::kAbsSendTime, true, true);
444 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800445}
446
447TEST_F(RampUpTest, UpDownUpThreeStreamsByRedRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700448 RampUpDownUpTester test(3, 60000, RtpExtension::kAbsSendTime, true, true);
449 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800450}
henrik.lundin@webrtc.org845862f2014-03-06 07:19:28 +0000451
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000452TEST_F(RampUpTest, AbsSendTimeSingleStream) {
stefan4fbd1452015-09-28 03:57:14 -0700453 RampUpTester test(1, 0, RtpExtension::kAbsSendTime, false, false);
454 RunBaseTest(&test);
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000455}
456
457TEST_F(RampUpTest, AbsSendTimeSimulcast) {
stefan4fbd1452015-09-28 03:57:14 -0700458 RampUpTester test(3, 0, RtpExtension::kAbsSendTime, false, false);
459 RunBaseTest(&test);
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000460}
461
462TEST_F(RampUpTest, AbsSendTimeSimulcastWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700463 RampUpTester test(3, 0, RtpExtension::kAbsSendTime, true, false);
464 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800465}
466
467TEST_F(RampUpTest, AbsSendTimeSimulcastByRedWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700468 RampUpTester test(3, 0, RtpExtension::kAbsSendTime, true, true);
469 RunBaseTest(&test);
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000470}
471
472TEST_F(RampUpTest, AbsSendTimeSingleStreamWithHighStartBitrate) {
stefan4fbd1452015-09-28 03:57:14 -0700473 RampUpTester test(1, 0.9 * kSingleStreamTargetBps, RtpExtension::kAbsSendTime,
474 false, false);
475 RunBaseTest(&test);
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000476}
Erik Språng6b8d3552015-09-24 15:06:57 +0200477
478TEST_F(RampUpTest, TransportSequenceNumberSingleStream) {
stefan4fbd1452015-09-28 03:57:14 -0700479 RampUpTester test(1, 0, RtpExtension::kTransportSequenceNumber, false, false);
480 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200481}
482
483TEST_F(RampUpTest, TransportSequenceNumberSimulcast) {
stefan4fbd1452015-09-28 03:57:14 -0700484 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, false, false);
485 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200486}
487
488TEST_F(RampUpTest, TransportSequenceNumberSimulcastWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700489 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, true, false);
490 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200491}
492
493TEST_F(RampUpTest, TransportSequenceNumberSimulcastByRedWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700494 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, true, true);
495 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200496}
497
498TEST_F(RampUpTest, TransportSequenceNumberSingleStreamWithHighStartBitrate) {
stefan4fbd1452015-09-28 03:57:14 -0700499 RampUpTester test(1, 0.9 * kSingleStreamTargetBps,
500 RtpExtension::kTransportSequenceNumber, false, false);
501 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200502}
pbos@webrtc.org744fbc72013-09-10 09:26:25 +0000503} // namespace webrtc