blob: c9b8e1112234cc3c3e4d25dba2317da1b466835d [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"
Henrik Kjellander0b9e29c2015-11-16 11:12:24 +010015#include "webrtc/modules/pacing/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"
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010019#include "webrtc/modules/rtp_rtcp/include/receive_statistics.h"
20#include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
21#include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h"
22#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h"
pbos@webrtc.org744fbc72013-09-10 09:26:25 +000023#include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
Henrik Kjellander98f53512015-10-28 18:17:40 +010024#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
25#include "webrtc/system_wrappers/include/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;
stefan43edf0f2015-11-20 18:05:48 -0800127 bool transport_cc;
stefan4fbd1452015-09-28 03:57:14 -0700128 if (extension_type_ == RtpExtension::kAbsSendTime) {
129 remb = true;
stefan43edf0f2015-11-20 18:05:48 -0800130 transport_cc = false;
stefan4fbd1452015-09-28 03:57:14 -0700131 send_config->rtp.extensions.push_back(
132 RtpExtension(extension_type_.c_str(), kAbsSendTimeExtensionId));
133 } else if (extension_type_ == RtpExtension::kTransportSequenceNumber) {
134 remb = false;
stefan43edf0f2015-11-20 18:05:48 -0800135 transport_cc = true;
stefan4fbd1452015-09-28 03:57:14 -0700136 send_config->rtp.extensions.push_back(RtpExtension(
137 extension_type_.c_str(), kTransportSequenceNumberExtensionId));
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000138 } else {
stefan4fbd1452015-09-28 03:57:14 -0700139 remb = true;
stefan43edf0f2015-11-20 18:05:48 -0800140 transport_cc = false;
stefan4fbd1452015-09-28 03:57:14 -0700141 send_config->rtp.extensions.push_back(RtpExtension(
142 extension_type_.c_str(), kTransmissionTimeOffsetExtensionId));
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000143 }
stefan4fbd1452015-09-28 03:57:14 -0700144
145 send_config->rtp.nack.rtp_history_ms = test::CallTest::kNackRtpHistoryMs;
146 send_config->rtp.ssrcs = ssrcs_;
147 if (rtx_) {
148 send_config->rtp.rtx.payload_type = test::CallTest::kSendRtxPayloadType;
149 send_config->rtp.rtx.ssrcs = rtx_ssrcs_;
150 }
151 if (red_) {
152 send_config->rtp.fec.ulpfec_payload_type =
153 test::CallTest::kUlpfecPayloadType;
154 send_config->rtp.fec.red_payload_type = test::CallTest::kRedPayloadType;
155 }
156
157 size_t i = 0;
158 for (VideoReceiveStream::Config& recv_config : *receive_configs) {
159 recv_config.rtp.remb = remb;
stefan43edf0f2015-11-20 18:05:48 -0800160 recv_config.rtp.transport_cc = transport_cc;
stefan4fbd1452015-09-28 03:57:14 -0700161 recv_config.rtp.extensions = send_config->rtp.extensions;
162
163 recv_config.rtp.remote_ssrc = ssrcs_[i];
164 recv_config.rtp.nack.rtp_history_ms = send_config->rtp.nack.rtp_history_ms;
165
166 if (red_) {
167 recv_config.rtp.fec.red_payload_type =
168 send_config->rtp.fec.red_payload_type;
169 recv_config.rtp.fec.ulpfec_payload_type =
170 send_config->rtp.fec.ulpfec_payload_type;
171 }
172
173 if (rtx_) {
174 recv_config.rtp.rtx[send_config->encoder_settings.payload_type].ssrc =
175 rtx_ssrcs_[i];
176 recv_config.rtp.rtx[send_config->encoder_settings.payload_type]
177 .payload_type = send_config->rtp.rtx.payload_type;
178 }
179 ++i;
180 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000181}
182
stefan4fbd1452015-09-28 03:57:14 -0700183void RampUpTester::OnCallsCreated(Call* sender_call, Call* receiver_call) {
184 sender_call_ = sender_call;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000185}
186
stefan4fbd1452015-09-28 03:57:14 -0700187bool RampUpTester::BitrateStatsPollingThread(void* obj) {
188 return static_cast<RampUpTester*>(obj)->PollStats();
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000189}
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000190
stefan4fbd1452015-09-28 03:57:14 -0700191bool RampUpTester::PollStats() {
192 if (sender_call_) {
193 Call::Stats stats = sender_call_->GetStats();
194
195 RTC_DCHECK_GT(expected_bitrate_bps_, 0);
196 if (!start_bitrate_verified_ && start_bitrate_bps_ != 0) {
197 // For tests with an explicitly set start bitrate, verify the first
198 // bitrate estimate is close to the start bitrate and lower than the
199 // test target bitrate. This is to verify a call respects the configured
200 // start bitrate, but due to the BWE implementation we can't guarantee the
201 // first estimate really is as high as the start bitrate.
202 EXPECT_GT(stats.send_bandwidth_bps, 0.9 * start_bitrate_bps_);
203 start_bitrate_verified_ = true;
204 }
205 if (stats.send_bandwidth_bps >= expected_bitrate_bps_) {
206 ramp_up_finished_ms_ = clock_->TimeInMilliseconds();
207 observation_complete_->Set();
208 }
209 }
210
211 return !event_.Wait(kPollIntervalMs);
Erik Språng468e62a2015-07-06 10:50:47 +0200212}
213
stefan4fbd1452015-09-28 03:57:14 -0700214void RampUpTester::ReportResult(const std::string& measurement,
215 size_t value,
216 const std::string& units) const {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000217 webrtc::test::PrintResult(
218 measurement, "",
219 ::testing::UnitTest::GetInstance()->current_test_info()->name(),
220 value, units, false);
221}
222
stefan092508a2015-09-29 02:26:42 -0700223void RampUpTester::AccumulateStats(const VideoSendStream::StreamStats& stream,
224 size_t* total_packets_sent,
225 size_t* total_sent,
226 size_t* padding_sent,
227 size_t* media_sent) const {
stefan4fbd1452015-09-28 03:57:14 -0700228 *total_packets_sent += stream.rtp_stats.transmitted.packets +
229 stream.rtp_stats.retransmitted.packets +
230 stream.rtp_stats.fec.packets;
231 *total_sent += stream.rtp_stats.transmitted.TotalBytes() +
232 stream.rtp_stats.retransmitted.TotalBytes() +
233 stream.rtp_stats.fec.TotalBytes();
234 *padding_sent += stream.rtp_stats.transmitted.padding_bytes +
235 stream.rtp_stats.retransmitted.padding_bytes +
236 stream.rtp_stats.fec.padding_bytes;
237 *media_sent += stream.rtp_stats.MediaPayloadBytes();
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000238}
239
stefan4fbd1452015-09-28 03:57:14 -0700240void RampUpTester::TriggerTestDone() {
Erik Språngf3a7c9d2015-10-05 14:03:22 +0200241 RTC_DCHECK_GE(test_start_ms_, 0);
242
stefan4fbd1452015-09-28 03:57:14 -0700243 VideoSendStream::Stats send_stats = send_stream_->GetStats();
244
245 size_t total_packets_sent = 0;
246 size_t total_sent = 0;
247 size_t padding_sent = 0;
248 size_t media_sent = 0;
249 for (uint32_t ssrc : ssrcs_) {
stefan092508a2015-09-29 02:26:42 -0700250 AccumulateStats(send_stats.substreams[ssrc], &total_packets_sent,
251 &total_sent, &padding_sent, &media_sent);
stefan4fbd1452015-09-28 03:57:14 -0700252 }
253
254 size_t rtx_total_packets_sent = 0;
255 size_t rtx_total_sent = 0;
256 size_t rtx_padding_sent = 0;
257 size_t rtx_media_sent = 0;
258 for (uint32_t rtx_ssrc : rtx_ssrcs_) {
stefan092508a2015-09-29 02:26:42 -0700259 AccumulateStats(send_stats.substreams[rtx_ssrc], &rtx_total_packets_sent,
260 &rtx_total_sent, &rtx_padding_sent, &rtx_media_sent);
stefan4fbd1452015-09-28 03:57:14 -0700261 }
262
263 ReportResult("ramp-up-total-packets-sent", total_packets_sent, "packets");
264 ReportResult("ramp-up-total-sent", total_sent, "bytes");
265 ReportResult("ramp-up-media-sent", media_sent, "bytes");
266 ReportResult("ramp-up-padding-sent", padding_sent, "bytes");
267 ReportResult("ramp-up-rtx-total-packets-sent", rtx_total_packets_sent,
268 "packets");
269 ReportResult("ramp-up-rtx-total-sent", rtx_total_sent, "bytes");
270 ReportResult("ramp-up-rtx-media-sent", rtx_media_sent, "bytes");
271 ReportResult("ramp-up-rtx-padding-sent", rtx_padding_sent, "bytes");
272 if (ramp_up_finished_ms_ >= 0) {
273 ReportResult("ramp-up-time", ramp_up_finished_ms_ - test_start_ms_,
274 "milliseconds");
275 }
276}
277
278void RampUpTester::PerformTest() {
Erik Språngf3a7c9d2015-10-05 14:03:22 +0200279 test_start_ms_ = clock_->TimeInMilliseconds();
spranga050e982015-10-02 06:51:48 -0700280 poller_thread_->Start();
Peter Boströmd153a372015-11-10 15:27:12 +0000281 EXPECT_EQ(kEventSignaled, Wait())
282 << "Timed out while waiting for ramp-up to complete.";
stefan4fbd1452015-09-28 03:57:14 -0700283 TriggerTestDone();
spranga050e982015-10-02 06:51:48 -0700284 poller_thread_->Stop();
stefan4fbd1452015-09-28 03:57:14 -0700285}
286
287RampUpDownUpTester::RampUpDownUpTester(size_t num_streams,
288 unsigned int start_bitrate_bps,
289 const std::string& extension_type,
290 bool rtx,
291 bool red)
292 : RampUpTester(num_streams, start_bitrate_bps, extension_type, rtx, red),
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000293 test_state_(kFirstRampup),
294 state_start_ms_(clock_->TimeInMilliseconds()),
stefan4fbd1452015-09-28 03:57:14 -0700295 interval_start_ms_(clock_->TimeInMilliseconds()),
296 sent_bytes_(0) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000297 forward_transport_config_.link_capacity_kbps =
298 kHighBandwidthLimitBps / 1000;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000299}
300
stefan4fbd1452015-09-28 03:57:14 -0700301RampUpDownUpTester::~RampUpDownUpTester() {}
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000302
stefan4fbd1452015-09-28 03:57:14 -0700303bool RampUpDownUpTester::PollStats() {
304 if (send_stream_) {
305 webrtc::VideoSendStream::Stats stats = send_stream_->GetStats();
306 int transmit_bitrate_bps = 0;
307 for (auto it : stats.substreams) {
308 transmit_bitrate_bps += it.second.total_bitrate_bps;
mflodman@webrtc.orgeb16b812014-06-16 08:57:39 +0000309 }
stefan4fbd1452015-09-28 03:57:14 -0700310
311 EvolveTestState(transmit_bitrate_bps, stats.suspended);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000312 }
stefan4fbd1452015-09-28 03:57:14 -0700313
314 return !event_.Wait(kPollIntervalMs);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000315}
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000316
stefan4fbd1452015-09-28 03:57:14 -0700317Call::Config RampUpDownUpTester::GetReceiverCallConfig() {
318 Call::Config config;
319 config.bitrate_config.min_bitrate_bps = 10000;
320 return config;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000321}
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000322
stefan4fbd1452015-09-28 03:57:14 -0700323std::string RampUpDownUpTester::GetModifierString() const {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000324 std::string str("_");
325 char temp_str[5];
stefan4fbd1452015-09-28 03:57:14 -0700326 sprintf(temp_str, "%i", static_cast<int>(num_streams_));
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000327 str += std::string(temp_str);
328 str += "stream";
stefan4fbd1452015-09-28 03:57:14 -0700329 str += (num_streams_ > 1 ? "s" : "");
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000330 str += "_";
stefan4fbd1452015-09-28 03:57:14 -0700331 str += (rtx_ ? "" : "no");
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000332 str += "rtx";
333 return str;
334}
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000335
stefan4fbd1452015-09-28 03:57:14 -0700336void RampUpDownUpTester::EvolveTestState(int bitrate_bps, bool suspended) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000337 int64_t now = clock_->TimeInMilliseconds();
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000338 switch (test_state_) {
339 case kFirstRampup: {
stefan4fbd1452015-09-28 03:57:14 -0700340 EXPECT_FALSE(suspended);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000341 if (bitrate_bps > kExpectedHighBitrateBps) {
342 // The first ramp-up has reached the target bitrate. Change the
343 // channel limit, and move to the next test state.
344 forward_transport_config_.link_capacity_kbps =
345 kLowBandwidthLimitBps / 1000;
stefanf116bd02015-10-27 08:29:42 -0700346 send_transport_->SetConfig(forward_transport_config_);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000347 test_state_ = kLowRate;
348 webrtc::test::PrintResult("ramp_up_down_up",
349 GetModifierString(),
350 "first_rampup",
351 now - state_start_ms_,
352 "ms",
353 false);
354 state_start_ms_ = now;
355 interval_start_ms_ = now;
356 sent_bytes_ = 0;
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000357 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000358 break;
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +0000359 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000360 case kLowRate: {
stefan4fbd1452015-09-28 03:57:14 -0700361 if (bitrate_bps < kExpectedLowBitrateBps && suspended) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000362 // The ramp-down was successful. Change the channel limit back to a
363 // high value, and move to the next test state.
364 forward_transport_config_.link_capacity_kbps =
365 kHighBandwidthLimitBps / 1000;
stefanf116bd02015-10-27 08:29:42 -0700366 send_transport_->SetConfig(forward_transport_config_);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000367 test_state_ = kSecondRampup;
368 webrtc::test::PrintResult("ramp_up_down_up",
369 GetModifierString(),
370 "rampdown",
371 now - state_start_ms_,
372 "ms",
373 false);
374 state_start_ms_ = now;
375 interval_start_ms_ = now;
376 sent_bytes_ = 0;
377 }
378 break;
379 }
380 case kSecondRampup: {
stefan4fbd1452015-09-28 03:57:14 -0700381 if (bitrate_bps > kExpectedHighBitrateBps && !suspended) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000382 webrtc::test::PrintResult("ramp_up_down_up",
383 GetModifierString(),
384 "second_rampup",
385 now - state_start_ms_,
386 "ms",
387 false);
stefan4fbd1452015-09-28 03:57:14 -0700388 observation_complete_->Set();
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000389 }
390 break;
391 }
392 }
393}
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +0000394
stefan4fbd1452015-09-28 03:57:14 -0700395class RampUpTest : public test::CallTest {
Erik Språng6b8d3552015-09-24 15:06:57 +0200396 public:
stefan4fbd1452015-09-28 03:57:14 -0700397 RampUpTest() {}
Erik Språng6b8d3552015-09-24 15:06:57 +0200398
stefan4fbd1452015-09-28 03:57:14 -0700399 virtual ~RampUpTest() {
400 EXPECT_EQ(nullptr, send_stream_);
401 EXPECT_TRUE(receive_streams_.empty());
Erik Språng6b8d3552015-09-24 15:06:57 +0200402 }
Erik Språng6b8d3552015-09-24 15:06:57 +0200403};
404
stefan@webrtc.orgcb254aa2014-06-12 15:12:25 +0000405TEST_F(RampUpTest, SingleStream) {
stefan4fbd1452015-09-28 03:57:14 -0700406 RampUpTester test(1, 0, RtpExtension::kTOffset, false, false);
stefanf116bd02015-10-27 08:29:42 -0700407 RunBaseTest(&test, FakeNetworkPipe::Config());
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000408}
pbos@webrtc.org744fbc72013-09-10 09:26:25 +0000409
stefan@webrtc.orgcb254aa2014-06-12 15:12:25 +0000410TEST_F(RampUpTest, Simulcast) {
stefan4fbd1452015-09-28 03:57:14 -0700411 RampUpTester test(3, 0, RtpExtension::kTOffset, false, false);
stefanf116bd02015-10-27 08:29:42 -0700412 RunBaseTest(&test, FakeNetworkPipe::Config());
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000413}
414
stefan@webrtc.orgcb254aa2014-06-12 15:12:25 +0000415TEST_F(RampUpTest, SimulcastWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700416 RampUpTester test(3, 0, RtpExtension::kTOffset, true, false);
stefanf116bd02015-10-27 08:29:42 -0700417 RunBaseTest(&test, FakeNetworkPipe::Config());
Shao Changbine62202f2015-04-21 20:24:50 +0800418}
419
420TEST_F(RampUpTest, SimulcastByRedWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700421 RampUpTester test(3, 0, RtpExtension::kTOffset, true, true);
stefanf116bd02015-10-27 08:29:42 -0700422 RunBaseTest(&test, FakeNetworkPipe::Config());
mflodman@webrtc.orgeb16b812014-06-16 08:57:39 +0000423}
424
425TEST_F(RampUpTest, SingleStreamWithHighStartBitrate) {
stefan4fbd1452015-09-28 03:57:14 -0700426 RampUpTester test(1, 0.9 * kSingleStreamTargetBps, RtpExtension::kTOffset,
427 false, false);
stefanf116bd02015-10-27 08:29:42 -0700428 RunBaseTest(&test, FakeNetworkPipe::Config());
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000429}
pbos@webrtc.org744fbc72013-09-10 09:26:25 +0000430
Shao Changbine62202f2015-04-21 20:24:50 +0800431TEST_F(RampUpTest, UpDownUpOneStream) {
stefan4fbd1452015-09-28 03:57:14 -0700432 RampUpDownUpTester test(1, 60000, RtpExtension::kAbsSendTime, false, false);
stefanf116bd02015-10-27 08:29:42 -0700433 RunBaseTest(&test, FakeNetworkPipe::Config());
Shao Changbine62202f2015-04-21 20:24:50 +0800434}
henrik.lundin@webrtc.org845862f2014-03-06 07:19:28 +0000435
Shao Changbine62202f2015-04-21 20:24:50 +0800436TEST_F(RampUpTest, UpDownUpThreeStreams) {
stefan4fbd1452015-09-28 03:57:14 -0700437 RampUpDownUpTester test(3, 60000, RtpExtension::kAbsSendTime, false, false);
stefanf116bd02015-10-27 08:29:42 -0700438 RunBaseTest(&test, FakeNetworkPipe::Config());
Shao Changbine62202f2015-04-21 20:24:50 +0800439}
henrik.lundin@webrtc.org998cb8f2014-03-06 09:12:00 +0000440
Shao Changbine62202f2015-04-21 20:24:50 +0800441TEST_F(RampUpTest, UpDownUpOneStreamRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700442 RampUpDownUpTester test(1, 60000, RtpExtension::kAbsSendTime, true, false);
stefanf116bd02015-10-27 08:29:42 -0700443 RunBaseTest(&test, FakeNetworkPipe::Config());
Shao Changbine62202f2015-04-21 20:24:50 +0800444}
henrik.lundin@webrtc.org998cb8f2014-03-06 09:12:00 +0000445
Shao Changbine62202f2015-04-21 20:24:50 +0800446TEST_F(RampUpTest, UpDownUpThreeStreamsRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700447 RampUpDownUpTester test(3, 60000, RtpExtension::kAbsSendTime, true, false);
stefanf116bd02015-10-27 08:29:42 -0700448 RunBaseTest(&test, FakeNetworkPipe::Config());
Shao Changbine62202f2015-04-21 20:24:50 +0800449}
450
451TEST_F(RampUpTest, UpDownUpOneStreamByRedRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700452 RampUpDownUpTester test(1, 60000, RtpExtension::kAbsSendTime, true, true);
stefanf116bd02015-10-27 08:29:42 -0700453 RunBaseTest(&test, FakeNetworkPipe::Config());
Shao Changbine62202f2015-04-21 20:24:50 +0800454}
455
456TEST_F(RampUpTest, UpDownUpThreeStreamsByRedRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700457 RampUpDownUpTester test(3, 60000, RtpExtension::kAbsSendTime, true, true);
stefanf116bd02015-10-27 08:29:42 -0700458 RunBaseTest(&test, FakeNetworkPipe::Config());
Shao Changbine62202f2015-04-21 20:24:50 +0800459}
henrik.lundin@webrtc.org845862f2014-03-06 07:19:28 +0000460
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000461TEST_F(RampUpTest, AbsSendTimeSingleStream) {
stefan4fbd1452015-09-28 03:57:14 -0700462 RampUpTester test(1, 0, RtpExtension::kAbsSendTime, false, false);
stefanf116bd02015-10-27 08:29:42 -0700463 RunBaseTest(&test, FakeNetworkPipe::Config());
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000464}
465
466TEST_F(RampUpTest, AbsSendTimeSimulcast) {
stefan4fbd1452015-09-28 03:57:14 -0700467 RampUpTester test(3, 0, RtpExtension::kAbsSendTime, false, false);
stefanf116bd02015-10-27 08:29:42 -0700468 RunBaseTest(&test, FakeNetworkPipe::Config());
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000469}
470
471TEST_F(RampUpTest, AbsSendTimeSimulcastWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700472 RampUpTester test(3, 0, RtpExtension::kAbsSendTime, true, false);
stefanf116bd02015-10-27 08:29:42 -0700473 RunBaseTest(&test, FakeNetworkPipe::Config());
Shao Changbine62202f2015-04-21 20:24:50 +0800474}
475
476TEST_F(RampUpTest, AbsSendTimeSimulcastByRedWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700477 RampUpTester test(3, 0, RtpExtension::kAbsSendTime, true, true);
stefanf116bd02015-10-27 08:29:42 -0700478 RunBaseTest(&test, FakeNetworkPipe::Config());
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000479}
480
481TEST_F(RampUpTest, AbsSendTimeSingleStreamWithHighStartBitrate) {
stefan4fbd1452015-09-28 03:57:14 -0700482 RampUpTester test(1, 0.9 * kSingleStreamTargetBps, RtpExtension::kAbsSendTime,
483 false, false);
stefanf116bd02015-10-27 08:29:42 -0700484 RunBaseTest(&test, FakeNetworkPipe::Config());
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000485}
Erik Språng6b8d3552015-09-24 15:06:57 +0200486
487TEST_F(RampUpTest, TransportSequenceNumberSingleStream) {
stefan4fbd1452015-09-28 03:57:14 -0700488 RampUpTester test(1, 0, RtpExtension::kTransportSequenceNumber, false, false);
stefanf116bd02015-10-27 08:29:42 -0700489 RunBaseTest(&test, FakeNetworkPipe::Config());
Erik Språng6b8d3552015-09-24 15:06:57 +0200490}
491
492TEST_F(RampUpTest, TransportSequenceNumberSimulcast) {
stefan4fbd1452015-09-28 03:57:14 -0700493 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, false, false);
stefanf116bd02015-10-27 08:29:42 -0700494 RunBaseTest(&test, FakeNetworkPipe::Config());
Erik Språng6b8d3552015-09-24 15:06:57 +0200495}
496
497TEST_F(RampUpTest, TransportSequenceNumberSimulcastWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700498 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, true, false);
stefanf116bd02015-10-27 08:29:42 -0700499 RunBaseTest(&test, FakeNetworkPipe::Config());
Erik Språng6b8d3552015-09-24 15:06:57 +0200500}
501
502TEST_F(RampUpTest, TransportSequenceNumberSimulcastByRedWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700503 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, true, true);
stefanf116bd02015-10-27 08:29:42 -0700504 RunBaseTest(&test, FakeNetworkPipe::Config());
Erik Språng6b8d3552015-09-24 15:06:57 +0200505}
506
507TEST_F(RampUpTest, TransportSequenceNumberSingleStreamWithHighStartBitrate) {
stefan4fbd1452015-09-28 03:57:14 -0700508 RampUpTester test(1, 0.9 * kSingleStreamTargetBps,
509 RtpExtension::kTransportSequenceNumber, false, false);
stefanf116bd02015-10-27 08:29:42 -0700510 RunBaseTest(&test, FakeNetworkPipe::Config());
Erik Språng6b8d3552015-09-24 15:06:57 +0200511}
pbos@webrtc.org744fbc72013-09-10 09:26:25 +0000512} // namespace webrtc