blob: d0ce8a11dd2916892fc9b5a8a9f46c1838a7ba0d [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
Stefan Holmer723dff12015-10-05 14:59:41 +020032static const int64_t kPollIntervalMs = 20;
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
stefanf116bd02015-10-27 08:29:42 -070092void RampUpTester::OnTransportsCreated(
93 test::PacketTransport* send_transport,
94 test::PacketTransport* receive_transport) {
95 send_transport_ = send_transport;
96 send_transport_->SetConfig(forward_transport_config_);
97}
98
stefan4fbd1452015-09-28 03:57:14 -070099size_t RampUpTester::GetNumStreams() const {
100 return num_streams_;
101}
102
103void RampUpTester::ModifyConfigs(
104 VideoSendStream::Config* send_config,
105 std::vector<VideoReceiveStream::Config>* receive_configs,
106 VideoEncoderConfig* encoder_config) {
107 send_config->suspend_below_min_bitrate = true;
108
109 if (num_streams_ == 1) {
110 encoder_config->streams[0].target_bitrate_bps =
111 encoder_config->streams[0].max_bitrate_bps = 2000000;
112 // For single stream rampup until 1mbps
113 expected_bitrate_bps_ = kSingleStreamTargetBps;
114 } else {
115 // For multi stream rampup until all streams are being sent. That means
116 // enough birate to send all the target streams plus the min bitrate of
117 // the last one.
118 expected_bitrate_bps_ = encoder_config->streams.back().min_bitrate_bps;
119 for (size_t i = 0; i < encoder_config->streams.size() - 1; ++i) {
120 expected_bitrate_bps_ += encoder_config->streams[i].target_bitrate_bps;
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000121 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000122 }
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000123
stefan4fbd1452015-09-28 03:57:14 -0700124 send_config->rtp.extensions.clear();
125
126 bool remb;
127 if (extension_type_ == RtpExtension::kAbsSendTime) {
128 remb = true;
129 send_config->rtp.extensions.push_back(
130 RtpExtension(extension_type_.c_str(), kAbsSendTimeExtensionId));
131 } else if (extension_type_ == RtpExtension::kTransportSequenceNumber) {
132 remb = false;
133 send_config->rtp.extensions.push_back(RtpExtension(
134 extension_type_.c_str(), kTransportSequenceNumberExtensionId));
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000135 } else {
stefan4fbd1452015-09-28 03:57:14 -0700136 remb = true;
137 send_config->rtp.extensions.push_back(RtpExtension(
138 extension_type_.c_str(), kTransmissionTimeOffsetExtensionId));
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000139 }
stefan4fbd1452015-09-28 03:57:14 -0700140
141 send_config->rtp.nack.rtp_history_ms = test::CallTest::kNackRtpHistoryMs;
142 send_config->rtp.ssrcs = ssrcs_;
143 if (rtx_) {
144 send_config->rtp.rtx.payload_type = test::CallTest::kSendRtxPayloadType;
145 send_config->rtp.rtx.ssrcs = rtx_ssrcs_;
146 }
147 if (red_) {
148 send_config->rtp.fec.ulpfec_payload_type =
149 test::CallTest::kUlpfecPayloadType;
150 send_config->rtp.fec.red_payload_type = test::CallTest::kRedPayloadType;
151 }
152
153 size_t i = 0;
154 for (VideoReceiveStream::Config& recv_config : *receive_configs) {
155 recv_config.rtp.remb = remb;
156 recv_config.rtp.extensions = send_config->rtp.extensions;
157
158 recv_config.rtp.remote_ssrc = ssrcs_[i];
159 recv_config.rtp.nack.rtp_history_ms = send_config->rtp.nack.rtp_history_ms;
160
161 if (red_) {
162 recv_config.rtp.fec.red_payload_type =
163 send_config->rtp.fec.red_payload_type;
164 recv_config.rtp.fec.ulpfec_payload_type =
165 send_config->rtp.fec.ulpfec_payload_type;
166 }
167
168 if (rtx_) {
169 recv_config.rtp.rtx[send_config->encoder_settings.payload_type].ssrc =
170 rtx_ssrcs_[i];
171 recv_config.rtp.rtx[send_config->encoder_settings.payload_type]
172 .payload_type = send_config->rtp.rtx.payload_type;
173 }
174 ++i;
175 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000176}
177
stefan4fbd1452015-09-28 03:57:14 -0700178void RampUpTester::OnCallsCreated(Call* sender_call, Call* receiver_call) {
179 sender_call_ = sender_call;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000180}
181
stefan4fbd1452015-09-28 03:57:14 -0700182bool RampUpTester::BitrateStatsPollingThread(void* obj) {
183 return static_cast<RampUpTester*>(obj)->PollStats();
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000184}
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000185
stefan4fbd1452015-09-28 03:57:14 -0700186bool RampUpTester::PollStats() {
187 if (sender_call_) {
188 Call::Stats stats = sender_call_->GetStats();
189
190 RTC_DCHECK_GT(expected_bitrate_bps_, 0);
191 if (!start_bitrate_verified_ && start_bitrate_bps_ != 0) {
192 // For tests with an explicitly set start bitrate, verify the first
193 // bitrate estimate is close to the start bitrate and lower than the
194 // test target bitrate. This is to verify a call respects the configured
195 // start bitrate, but due to the BWE implementation we can't guarantee the
196 // first estimate really is as high as the start bitrate.
197 EXPECT_GT(stats.send_bandwidth_bps, 0.9 * start_bitrate_bps_);
198 start_bitrate_verified_ = true;
199 }
200 if (stats.send_bandwidth_bps >= expected_bitrate_bps_) {
201 ramp_up_finished_ms_ = clock_->TimeInMilliseconds();
202 observation_complete_->Set();
203 }
204 }
205
206 return !event_.Wait(kPollIntervalMs);
Erik Språng468e62a2015-07-06 10:50:47 +0200207}
208
stefan4fbd1452015-09-28 03:57:14 -0700209void RampUpTester::ReportResult(const std::string& measurement,
210 size_t value,
211 const std::string& units) const {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000212 webrtc::test::PrintResult(
213 measurement, "",
214 ::testing::UnitTest::GetInstance()->current_test_info()->name(),
215 value, units, false);
216}
217
stefan092508a2015-09-29 02:26:42 -0700218void RampUpTester::AccumulateStats(const VideoSendStream::StreamStats& stream,
219 size_t* total_packets_sent,
220 size_t* total_sent,
221 size_t* padding_sent,
222 size_t* media_sent) const {
stefan4fbd1452015-09-28 03:57:14 -0700223 *total_packets_sent += stream.rtp_stats.transmitted.packets +
224 stream.rtp_stats.retransmitted.packets +
225 stream.rtp_stats.fec.packets;
226 *total_sent += stream.rtp_stats.transmitted.TotalBytes() +
227 stream.rtp_stats.retransmitted.TotalBytes() +
228 stream.rtp_stats.fec.TotalBytes();
229 *padding_sent += stream.rtp_stats.transmitted.padding_bytes +
230 stream.rtp_stats.retransmitted.padding_bytes +
231 stream.rtp_stats.fec.padding_bytes;
232 *media_sent += stream.rtp_stats.MediaPayloadBytes();
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000233}
234
stefan4fbd1452015-09-28 03:57:14 -0700235void RampUpTester::TriggerTestDone() {
Erik Språngf3a7c9d2015-10-05 14:03:22 +0200236 RTC_DCHECK_GE(test_start_ms_, 0);
237
stefan4fbd1452015-09-28 03:57:14 -0700238 VideoSendStream::Stats send_stats = send_stream_->GetStats();
239
240 size_t total_packets_sent = 0;
241 size_t total_sent = 0;
242 size_t padding_sent = 0;
243 size_t media_sent = 0;
244 for (uint32_t ssrc : ssrcs_) {
stefan092508a2015-09-29 02:26:42 -0700245 AccumulateStats(send_stats.substreams[ssrc], &total_packets_sent,
246 &total_sent, &padding_sent, &media_sent);
stefan4fbd1452015-09-28 03:57:14 -0700247 }
248
249 size_t rtx_total_packets_sent = 0;
250 size_t rtx_total_sent = 0;
251 size_t rtx_padding_sent = 0;
252 size_t rtx_media_sent = 0;
253 for (uint32_t rtx_ssrc : rtx_ssrcs_) {
stefan092508a2015-09-29 02:26:42 -0700254 AccumulateStats(send_stats.substreams[rtx_ssrc], &rtx_total_packets_sent,
255 &rtx_total_sent, &rtx_padding_sent, &rtx_media_sent);
stefan4fbd1452015-09-28 03:57:14 -0700256 }
257
258 ReportResult("ramp-up-total-packets-sent", total_packets_sent, "packets");
259 ReportResult("ramp-up-total-sent", total_sent, "bytes");
260 ReportResult("ramp-up-media-sent", media_sent, "bytes");
261 ReportResult("ramp-up-padding-sent", padding_sent, "bytes");
262 ReportResult("ramp-up-rtx-total-packets-sent", rtx_total_packets_sent,
263 "packets");
264 ReportResult("ramp-up-rtx-total-sent", rtx_total_sent, "bytes");
265 ReportResult("ramp-up-rtx-media-sent", rtx_media_sent, "bytes");
266 ReportResult("ramp-up-rtx-padding-sent", rtx_padding_sent, "bytes");
267 if (ramp_up_finished_ms_ >= 0) {
268 ReportResult("ramp-up-time", ramp_up_finished_ms_ - test_start_ms_,
269 "milliseconds");
270 }
271}
272
273void RampUpTester::PerformTest() {
Erik Språngf3a7c9d2015-10-05 14:03:22 +0200274 test_start_ms_ = clock_->TimeInMilliseconds();
spranga050e982015-10-02 06:51:48 -0700275 poller_thread_->Start();
stefan4fbd1452015-09-28 03:57:14 -0700276 if (Wait() != kEventSignaled) {
277 printf("Timed out while waiting for ramp-up to complete.");
278 return;
279 }
280 TriggerTestDone();
spranga050e982015-10-02 06:51:48 -0700281 poller_thread_->Stop();
stefan4fbd1452015-09-28 03:57:14 -0700282}
283
284RampUpDownUpTester::RampUpDownUpTester(size_t num_streams,
285 unsigned int start_bitrate_bps,
286 const std::string& extension_type,
287 bool rtx,
288 bool red)
289 : RampUpTester(num_streams, start_bitrate_bps, extension_type, rtx, red),
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000290 test_state_(kFirstRampup),
291 state_start_ms_(clock_->TimeInMilliseconds()),
stefan4fbd1452015-09-28 03:57:14 -0700292 interval_start_ms_(clock_->TimeInMilliseconds()),
293 sent_bytes_(0) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000294 forward_transport_config_.link_capacity_kbps =
295 kHighBandwidthLimitBps / 1000;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000296}
297
stefan4fbd1452015-09-28 03:57:14 -0700298RampUpDownUpTester::~RampUpDownUpTester() {}
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000299
stefan4fbd1452015-09-28 03:57:14 -0700300bool RampUpDownUpTester::PollStats() {
301 if (send_stream_) {
302 webrtc::VideoSendStream::Stats stats = send_stream_->GetStats();
303 int transmit_bitrate_bps = 0;
304 for (auto it : stats.substreams) {
305 transmit_bitrate_bps += it.second.total_bitrate_bps;
mflodman@webrtc.orgeb16b812014-06-16 08:57:39 +0000306 }
stefan4fbd1452015-09-28 03:57:14 -0700307
308 EvolveTestState(transmit_bitrate_bps, stats.suspended);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000309 }
stefan4fbd1452015-09-28 03:57:14 -0700310
311 return !event_.Wait(kPollIntervalMs);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000312}
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000313
stefan4fbd1452015-09-28 03:57:14 -0700314Call::Config RampUpDownUpTester::GetReceiverCallConfig() {
315 Call::Config config;
316 config.bitrate_config.min_bitrate_bps = 10000;
317 return config;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000318}
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000319
stefan4fbd1452015-09-28 03:57:14 -0700320std::string RampUpDownUpTester::GetModifierString() const {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000321 std::string str("_");
322 char temp_str[5];
stefan4fbd1452015-09-28 03:57:14 -0700323 sprintf(temp_str, "%i", static_cast<int>(num_streams_));
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000324 str += std::string(temp_str);
325 str += "stream";
stefan4fbd1452015-09-28 03:57:14 -0700326 str += (num_streams_ > 1 ? "s" : "");
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000327 str += "_";
stefan4fbd1452015-09-28 03:57:14 -0700328 str += (rtx_ ? "" : "no");
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000329 str += "rtx";
330 return str;
331}
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000332
stefan4fbd1452015-09-28 03:57:14 -0700333void RampUpDownUpTester::EvolveTestState(int bitrate_bps, bool suspended) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000334 int64_t now = clock_->TimeInMilliseconds();
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000335 switch (test_state_) {
336 case kFirstRampup: {
stefan4fbd1452015-09-28 03:57:14 -0700337 EXPECT_FALSE(suspended);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000338 if (bitrate_bps > kExpectedHighBitrateBps) {
339 // The first ramp-up has reached the target bitrate. Change the
340 // channel limit, and move to the next test state.
341 forward_transport_config_.link_capacity_kbps =
342 kLowBandwidthLimitBps / 1000;
stefanf116bd02015-10-27 08:29:42 -0700343 send_transport_->SetConfig(forward_transport_config_);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000344 test_state_ = kLowRate;
345 webrtc::test::PrintResult("ramp_up_down_up",
346 GetModifierString(),
347 "first_rampup",
348 now - state_start_ms_,
349 "ms",
350 false);
351 state_start_ms_ = now;
352 interval_start_ms_ = now;
353 sent_bytes_ = 0;
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000354 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000355 break;
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +0000356 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000357 case kLowRate: {
stefan4fbd1452015-09-28 03:57:14 -0700358 if (bitrate_bps < kExpectedLowBitrateBps && suspended) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000359 // The ramp-down was successful. Change the channel limit back to a
360 // high value, and move to the next test state.
361 forward_transport_config_.link_capacity_kbps =
362 kHighBandwidthLimitBps / 1000;
stefanf116bd02015-10-27 08:29:42 -0700363 send_transport_->SetConfig(forward_transport_config_);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000364 test_state_ = kSecondRampup;
365 webrtc::test::PrintResult("ramp_up_down_up",
366 GetModifierString(),
367 "rampdown",
368 now - state_start_ms_,
369 "ms",
370 false);
371 state_start_ms_ = now;
372 interval_start_ms_ = now;
373 sent_bytes_ = 0;
374 }
375 break;
376 }
377 case kSecondRampup: {
stefan4fbd1452015-09-28 03:57:14 -0700378 if (bitrate_bps > kExpectedHighBitrateBps && !suspended) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000379 webrtc::test::PrintResult("ramp_up_down_up",
380 GetModifierString(),
381 "second_rampup",
382 now - state_start_ms_,
383 "ms",
384 false);
stefan4fbd1452015-09-28 03:57:14 -0700385 observation_complete_->Set();
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000386 }
387 break;
388 }
389 }
390}
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +0000391
stefan4fbd1452015-09-28 03:57:14 -0700392class RampUpTest : public test::CallTest {
Erik Språng6b8d3552015-09-24 15:06:57 +0200393 public:
stefan4fbd1452015-09-28 03:57:14 -0700394 RampUpTest() {}
Erik Språng6b8d3552015-09-24 15:06:57 +0200395
stefan4fbd1452015-09-28 03:57:14 -0700396 virtual ~RampUpTest() {
397 EXPECT_EQ(nullptr, send_stream_);
398 EXPECT_TRUE(receive_streams_.empty());
Erik Språng6b8d3552015-09-24 15:06:57 +0200399 }
Erik Språng6b8d3552015-09-24 15:06:57 +0200400};
401
stefan@webrtc.orgcb254aa2014-06-12 15:12:25 +0000402TEST_F(RampUpTest, SingleStream) {
stefan4fbd1452015-09-28 03:57:14 -0700403 RampUpTester test(1, 0, RtpExtension::kTOffset, false, false);
stefanf116bd02015-10-27 08:29:42 -0700404 RunBaseTest(&test, FakeNetworkPipe::Config());
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000405}
pbos@webrtc.org744fbc72013-09-10 09:26:25 +0000406
stefan@webrtc.orgcb254aa2014-06-12 15:12:25 +0000407TEST_F(RampUpTest, Simulcast) {
stefan4fbd1452015-09-28 03:57:14 -0700408 RampUpTester test(3, 0, RtpExtension::kTOffset, false, false);
stefanf116bd02015-10-27 08:29:42 -0700409 RunBaseTest(&test, FakeNetworkPipe::Config());
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000410}
411
stefan@webrtc.orgcb254aa2014-06-12 15:12:25 +0000412TEST_F(RampUpTest, SimulcastWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700413 RampUpTester test(3, 0, RtpExtension::kTOffset, true, false);
stefanf116bd02015-10-27 08:29:42 -0700414 RunBaseTest(&test, FakeNetworkPipe::Config());
Shao Changbine62202f2015-04-21 20:24:50 +0800415}
416
417TEST_F(RampUpTest, SimulcastByRedWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700418 RampUpTester test(3, 0, RtpExtension::kTOffset, true, true);
stefanf116bd02015-10-27 08:29:42 -0700419 RunBaseTest(&test, FakeNetworkPipe::Config());
mflodman@webrtc.orgeb16b812014-06-16 08:57:39 +0000420}
421
422TEST_F(RampUpTest, SingleStreamWithHighStartBitrate) {
stefan4fbd1452015-09-28 03:57:14 -0700423 RampUpTester test(1, 0.9 * kSingleStreamTargetBps, RtpExtension::kTOffset,
424 false, false);
stefanf116bd02015-10-27 08:29:42 -0700425 RunBaseTest(&test, FakeNetworkPipe::Config());
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000426}
pbos@webrtc.org744fbc72013-09-10 09:26:25 +0000427
Shao Changbine62202f2015-04-21 20:24:50 +0800428TEST_F(RampUpTest, UpDownUpOneStream) {
stefan4fbd1452015-09-28 03:57:14 -0700429 RampUpDownUpTester test(1, 60000, RtpExtension::kAbsSendTime, false, false);
stefanf116bd02015-10-27 08:29:42 -0700430 RunBaseTest(&test, FakeNetworkPipe::Config());
Shao Changbine62202f2015-04-21 20:24:50 +0800431}
henrik.lundin@webrtc.org845862f2014-03-06 07:19:28 +0000432
Shao Changbine62202f2015-04-21 20:24:50 +0800433TEST_F(RampUpTest, UpDownUpThreeStreams) {
stefan4fbd1452015-09-28 03:57:14 -0700434 RampUpDownUpTester test(3, 60000, RtpExtension::kAbsSendTime, false, false);
stefanf116bd02015-10-27 08:29:42 -0700435 RunBaseTest(&test, FakeNetworkPipe::Config());
Shao Changbine62202f2015-04-21 20:24:50 +0800436}
henrik.lundin@webrtc.org998cb8f2014-03-06 09:12:00 +0000437
Shao Changbine62202f2015-04-21 20:24:50 +0800438TEST_F(RampUpTest, UpDownUpOneStreamRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700439 RampUpDownUpTester test(1, 60000, RtpExtension::kAbsSendTime, true, false);
stefanf116bd02015-10-27 08:29:42 -0700440 RunBaseTest(&test, FakeNetworkPipe::Config());
Shao Changbine62202f2015-04-21 20:24:50 +0800441}
henrik.lundin@webrtc.org998cb8f2014-03-06 09:12:00 +0000442
Shao Changbine62202f2015-04-21 20:24:50 +0800443TEST_F(RampUpTest, UpDownUpThreeStreamsRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700444 RampUpDownUpTester test(3, 60000, RtpExtension::kAbsSendTime, true, false);
stefanf116bd02015-10-27 08:29:42 -0700445 RunBaseTest(&test, FakeNetworkPipe::Config());
Shao Changbine62202f2015-04-21 20:24:50 +0800446}
447
448TEST_F(RampUpTest, UpDownUpOneStreamByRedRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700449 RampUpDownUpTester test(1, 60000, RtpExtension::kAbsSendTime, true, true);
stefanf116bd02015-10-27 08:29:42 -0700450 RunBaseTest(&test, FakeNetworkPipe::Config());
Shao Changbine62202f2015-04-21 20:24:50 +0800451}
452
453TEST_F(RampUpTest, UpDownUpThreeStreamsByRedRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700454 RampUpDownUpTester test(3, 60000, RtpExtension::kAbsSendTime, true, true);
stefanf116bd02015-10-27 08:29:42 -0700455 RunBaseTest(&test, FakeNetworkPipe::Config());
Shao Changbine62202f2015-04-21 20:24:50 +0800456}
henrik.lundin@webrtc.org845862f2014-03-06 07:19:28 +0000457
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000458TEST_F(RampUpTest, AbsSendTimeSingleStream) {
stefan4fbd1452015-09-28 03:57:14 -0700459 RampUpTester test(1, 0, RtpExtension::kAbsSendTime, false, false);
stefanf116bd02015-10-27 08:29:42 -0700460 RunBaseTest(&test, FakeNetworkPipe::Config());
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000461}
462
463TEST_F(RampUpTest, AbsSendTimeSimulcast) {
stefan4fbd1452015-09-28 03:57:14 -0700464 RampUpTester test(3, 0, RtpExtension::kAbsSendTime, false, false);
stefanf116bd02015-10-27 08:29:42 -0700465 RunBaseTest(&test, FakeNetworkPipe::Config());
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000466}
467
468TEST_F(RampUpTest, AbsSendTimeSimulcastWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700469 RampUpTester test(3, 0, RtpExtension::kAbsSendTime, true, false);
stefanf116bd02015-10-27 08:29:42 -0700470 RunBaseTest(&test, FakeNetworkPipe::Config());
Shao Changbine62202f2015-04-21 20:24:50 +0800471}
472
473TEST_F(RampUpTest, AbsSendTimeSimulcastByRedWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700474 RampUpTester test(3, 0, RtpExtension::kAbsSendTime, true, true);
stefanf116bd02015-10-27 08:29:42 -0700475 RunBaseTest(&test, FakeNetworkPipe::Config());
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000476}
477
478TEST_F(RampUpTest, AbsSendTimeSingleStreamWithHighStartBitrate) {
stefan4fbd1452015-09-28 03:57:14 -0700479 RampUpTester test(1, 0.9 * kSingleStreamTargetBps, RtpExtension::kAbsSendTime,
480 false, false);
stefanf116bd02015-10-27 08:29:42 -0700481 RunBaseTest(&test, FakeNetworkPipe::Config());
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000482}
Erik Språng6b8d3552015-09-24 15:06:57 +0200483
484TEST_F(RampUpTest, TransportSequenceNumberSingleStream) {
stefan4fbd1452015-09-28 03:57:14 -0700485 RampUpTester test(1, 0, RtpExtension::kTransportSequenceNumber, false, false);
stefanf116bd02015-10-27 08:29:42 -0700486 RunBaseTest(&test, FakeNetworkPipe::Config());
Erik Språng6b8d3552015-09-24 15:06:57 +0200487}
488
489TEST_F(RampUpTest, TransportSequenceNumberSimulcast) {
stefan4fbd1452015-09-28 03:57:14 -0700490 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, false, false);
stefanf116bd02015-10-27 08:29:42 -0700491 RunBaseTest(&test, FakeNetworkPipe::Config());
Erik Språng6b8d3552015-09-24 15:06:57 +0200492}
493
494TEST_F(RampUpTest, TransportSequenceNumberSimulcastWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700495 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, true, false);
stefanf116bd02015-10-27 08:29:42 -0700496 RunBaseTest(&test, FakeNetworkPipe::Config());
Erik Språng6b8d3552015-09-24 15:06:57 +0200497}
498
499TEST_F(RampUpTest, TransportSequenceNumberSimulcastByRedWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700500 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, true, true);
stefanf116bd02015-10-27 08:29:42 -0700501 RunBaseTest(&test, FakeNetworkPipe::Config());
Erik Språng6b8d3552015-09-24 15:06:57 +0200502}
503
504TEST_F(RampUpTest, TransportSequenceNumberSingleStreamWithHighStartBitrate) {
stefan4fbd1452015-09-28 03:57:14 -0700505 RampUpTester test(1, 0.9 * kSingleStreamTargetBps,
506 RtpExtension::kTransportSequenceNumber, false, false);
stefanf116bd02015-10-27 08:29:42 -0700507 RunBaseTest(&test, FakeNetworkPipe::Config());
Erik Språng6b8d3552015-09-24 15:06:57 +0200508}
pbos@webrtc.org744fbc72013-09-10 09:26:25 +0000509} // namespace webrtc