blob: ec014206bd0289909e97afe7c302e7efa5283900 [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),
stefan@webrtc.org3d7da882014-07-08 13:59:46 +000058 test_start_ms_(clock_->TimeInMilliseconds()),
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 poller_thread_->Start();
72}
73
74RampUpTester::~RampUpTester() {
75 event_.Set();
76 poller_thread_->Stop();
77}
78
79Call::Config RampUpTester::GetSenderCallConfig() {
80 Call::Config call_config;
81 if (start_bitrate_bps_ != 0) {
82 call_config.bitrate_config.start_bitrate_bps = start_bitrate_bps_;
83 }
84 call_config.bitrate_config.min_bitrate_bps = 10000;
85 return call_config;
86}
87
88void RampUpTester::OnStreamsCreated(
89 VideoSendStream* send_stream,
90 const std::vector<VideoReceiveStream*>& receive_streams) {
91 send_stream_ = send_stream;
92}
93
94size_t RampUpTester::GetNumStreams() const {
95 return num_streams_;
96}
97
98void RampUpTester::ModifyConfigs(
99 VideoSendStream::Config* send_config,
100 std::vector<VideoReceiveStream::Config>* receive_configs,
101 VideoEncoderConfig* encoder_config) {
102 send_config->suspend_below_min_bitrate = true;
103
104 if (num_streams_ == 1) {
105 encoder_config->streams[0].target_bitrate_bps =
106 encoder_config->streams[0].max_bitrate_bps = 2000000;
107 // For single stream rampup until 1mbps
108 expected_bitrate_bps_ = kSingleStreamTargetBps;
109 } else {
110 // For multi stream rampup until all streams are being sent. That means
111 // enough birate to send all the target streams plus the min bitrate of
112 // the last one.
113 expected_bitrate_bps_ = encoder_config->streams.back().min_bitrate_bps;
114 for (size_t i = 0; i < encoder_config->streams.size() - 1; ++i) {
115 expected_bitrate_bps_ += encoder_config->streams[i].target_bitrate_bps;
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000116 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000117 }
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000118
stefan4fbd1452015-09-28 03:57:14 -0700119 send_config->rtp.extensions.clear();
120
121 bool remb;
122 if (extension_type_ == RtpExtension::kAbsSendTime) {
123 remb = true;
124 send_config->rtp.extensions.push_back(
125 RtpExtension(extension_type_.c_str(), kAbsSendTimeExtensionId));
126 } else if (extension_type_ == RtpExtension::kTransportSequenceNumber) {
127 remb = false;
128 send_config->rtp.extensions.push_back(RtpExtension(
129 extension_type_.c_str(), kTransportSequenceNumberExtensionId));
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000130 } else {
stefan4fbd1452015-09-28 03:57:14 -0700131 remb = true;
132 send_config->rtp.extensions.push_back(RtpExtension(
133 extension_type_.c_str(), kTransmissionTimeOffsetExtensionId));
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000134 }
stefan4fbd1452015-09-28 03:57:14 -0700135
136 send_config->rtp.nack.rtp_history_ms = test::CallTest::kNackRtpHistoryMs;
137 send_config->rtp.ssrcs = ssrcs_;
138 if (rtx_) {
139 send_config->rtp.rtx.payload_type = test::CallTest::kSendRtxPayloadType;
140 send_config->rtp.rtx.ssrcs = rtx_ssrcs_;
141 }
142 if (red_) {
143 send_config->rtp.fec.ulpfec_payload_type =
144 test::CallTest::kUlpfecPayloadType;
145 send_config->rtp.fec.red_payload_type = test::CallTest::kRedPayloadType;
146 }
147
148 size_t i = 0;
149 for (VideoReceiveStream::Config& recv_config : *receive_configs) {
150 recv_config.rtp.remb = remb;
151 recv_config.rtp.extensions = send_config->rtp.extensions;
152
153 recv_config.rtp.remote_ssrc = ssrcs_[i];
154 recv_config.rtp.nack.rtp_history_ms = send_config->rtp.nack.rtp_history_ms;
155
156 if (red_) {
157 recv_config.rtp.fec.red_payload_type =
158 send_config->rtp.fec.red_payload_type;
159 recv_config.rtp.fec.ulpfec_payload_type =
160 send_config->rtp.fec.ulpfec_payload_type;
161 }
162
163 if (rtx_) {
164 recv_config.rtp.rtx[send_config->encoder_settings.payload_type].ssrc =
165 rtx_ssrcs_[i];
166 recv_config.rtp.rtx[send_config->encoder_settings.payload_type]
167 .payload_type = send_config->rtp.rtx.payload_type;
168 }
169 ++i;
170 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000171}
172
stefan4fbd1452015-09-28 03:57:14 -0700173void RampUpTester::OnCallsCreated(Call* sender_call, Call* receiver_call) {
174 sender_call_ = sender_call;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000175}
176
stefan4fbd1452015-09-28 03:57:14 -0700177bool RampUpTester::BitrateStatsPollingThread(void* obj) {
178 return static_cast<RampUpTester*>(obj)->PollStats();
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000179}
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000180
stefan4fbd1452015-09-28 03:57:14 -0700181bool RampUpTester::PollStats() {
182 if (sender_call_) {
183 Call::Stats stats = sender_call_->GetStats();
184
185 RTC_DCHECK_GT(expected_bitrate_bps_, 0);
186 if (!start_bitrate_verified_ && start_bitrate_bps_ != 0) {
187 // For tests with an explicitly set start bitrate, verify the first
188 // bitrate estimate is close to the start bitrate and lower than the
189 // test target bitrate. This is to verify a call respects the configured
190 // start bitrate, but due to the BWE implementation we can't guarantee the
191 // first estimate really is as high as the start bitrate.
192 EXPECT_GT(stats.send_bandwidth_bps, 0.9 * start_bitrate_bps_);
193 start_bitrate_verified_ = true;
194 }
195 if (stats.send_bandwidth_bps >= expected_bitrate_bps_) {
196 ramp_up_finished_ms_ = clock_->TimeInMilliseconds();
197 observation_complete_->Set();
198 }
199 }
200
201 return !event_.Wait(kPollIntervalMs);
Erik Språng468e62a2015-07-06 10:50:47 +0200202}
203
stefan4fbd1452015-09-28 03:57:14 -0700204void RampUpTester::ReportResult(const std::string& measurement,
205 size_t value,
206 const std::string& units) const {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000207 webrtc::test::PrintResult(
208 measurement, "",
209 ::testing::UnitTest::GetInstance()->current_test_info()->name(),
210 value, units, false);
211}
212
stefan4fbd1452015-09-28 03:57:14 -0700213void RampUpTester::GetStats(const VideoSendStream::StreamStats& stream,
214 size_t* total_packets_sent,
215 size_t* total_sent,
216 size_t* padding_sent,
217 size_t* media_sent) const {
218 *total_packets_sent += stream.rtp_stats.transmitted.packets +
219 stream.rtp_stats.retransmitted.packets +
220 stream.rtp_stats.fec.packets;
221 *total_sent += stream.rtp_stats.transmitted.TotalBytes() +
222 stream.rtp_stats.retransmitted.TotalBytes() +
223 stream.rtp_stats.fec.TotalBytes();
224 *padding_sent += stream.rtp_stats.transmitted.padding_bytes +
225 stream.rtp_stats.retransmitted.padding_bytes +
226 stream.rtp_stats.fec.padding_bytes;
227 *media_sent += stream.rtp_stats.MediaPayloadBytes();
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000228}
229
stefan4fbd1452015-09-28 03:57:14 -0700230void RampUpTester::TriggerTestDone() {
231 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_) {
238 GetStats(send_stats.substreams[ssrc], &total_packets_sent, &total_sent,
239 &padding_sent, &media_sent);
240 }
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_) {
247 GetStats(send_stats.substreams[rtx_ssrc], &total_packets_sent, &total_sent,
248 &padding_sent, &media_sent);
249 }
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() {
267 if (Wait() != kEventSignaled) {
268 printf("Timed out while waiting for ramp-up to complete.");
269 return;
270 }
271 TriggerTestDone();
272}
273
274RampUpDownUpTester::RampUpDownUpTester(size_t num_streams,
275 unsigned int start_bitrate_bps,
276 const std::string& extension_type,
277 bool rtx,
278 bool red)
279 : RampUpTester(num_streams, start_bitrate_bps, extension_type, rtx, red),
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000280 test_state_(kFirstRampup),
281 state_start_ms_(clock_->TimeInMilliseconds()),
stefan4fbd1452015-09-28 03:57:14 -0700282 interval_start_ms_(clock_->TimeInMilliseconds()),
283 sent_bytes_(0) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000284 forward_transport_config_.link_capacity_kbps =
285 kHighBandwidthLimitBps / 1000;
stefan4fbd1452015-09-28 03:57:14 -0700286 send_transport_.SetConfig(forward_transport_config_);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000287}
288
stefan4fbd1452015-09-28 03:57:14 -0700289RampUpDownUpTester::~RampUpDownUpTester() {}
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000290
stefan4fbd1452015-09-28 03:57:14 -0700291bool RampUpDownUpTester::PollStats() {
292 if (send_stream_) {
293 webrtc::VideoSendStream::Stats stats = send_stream_->GetStats();
294 int transmit_bitrate_bps = 0;
295 for (auto it : stats.substreams) {
296 transmit_bitrate_bps += it.second.total_bitrate_bps;
mflodman@webrtc.orgeb16b812014-06-16 08:57:39 +0000297 }
stefan4fbd1452015-09-28 03:57:14 -0700298
299 EvolveTestState(transmit_bitrate_bps, stats.suspended);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000300 }
stefan4fbd1452015-09-28 03:57:14 -0700301
302 return !event_.Wait(kPollIntervalMs);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000303}
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000304
stefan4fbd1452015-09-28 03:57:14 -0700305Call::Config RampUpDownUpTester::GetReceiverCallConfig() {
306 Call::Config config;
307 config.bitrate_config.min_bitrate_bps = 10000;
308 return config;
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000309}
stefan@webrtc.org7e9315b2013-12-04 10:24:26 +0000310
stefan4fbd1452015-09-28 03:57:14 -0700311std::string RampUpDownUpTester::GetModifierString() const {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000312 std::string str("_");
313 char temp_str[5];
stefan4fbd1452015-09-28 03:57:14 -0700314 sprintf(temp_str, "%i", static_cast<int>(num_streams_));
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000315 str += std::string(temp_str);
316 str += "stream";
stefan4fbd1452015-09-28 03:57:14 -0700317 str += (num_streams_ > 1 ? "s" : "");
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000318 str += "_";
stefan4fbd1452015-09-28 03:57:14 -0700319 str += (rtx_ ? "" : "no");
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000320 str += "rtx";
321 return str;
322}
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000323
stefan4fbd1452015-09-28 03:57:14 -0700324void RampUpDownUpTester::EvolveTestState(int bitrate_bps, bool suspended) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000325 int64_t now = clock_->TimeInMilliseconds();
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000326 switch (test_state_) {
327 case kFirstRampup: {
stefan4fbd1452015-09-28 03:57:14 -0700328 EXPECT_FALSE(suspended);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000329 if (bitrate_bps > kExpectedHighBitrateBps) {
330 // The first ramp-up has reached the target bitrate. Change the
331 // channel limit, and move to the next test state.
332 forward_transport_config_.link_capacity_kbps =
333 kLowBandwidthLimitBps / 1000;
stefan4fbd1452015-09-28 03:57:14 -0700334 send_transport_.SetConfig(forward_transport_config_);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000335 test_state_ = kLowRate;
336 webrtc::test::PrintResult("ramp_up_down_up",
337 GetModifierString(),
338 "first_rampup",
339 now - state_start_ms_,
340 "ms",
341 false);
342 state_start_ms_ = now;
343 interval_start_ms_ = now;
344 sent_bytes_ = 0;
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000345 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000346 break;
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +0000347 }
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000348 case kLowRate: {
stefan4fbd1452015-09-28 03:57:14 -0700349 if (bitrate_bps < kExpectedLowBitrateBps && suspended) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000350 // The ramp-down was successful. Change the channel limit back to a
351 // high value, and move to the next test state.
352 forward_transport_config_.link_capacity_kbps =
353 kHighBandwidthLimitBps / 1000;
stefan4fbd1452015-09-28 03:57:14 -0700354 send_transport_.SetConfig(forward_transport_config_);
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000355 test_state_ = kSecondRampup;
356 webrtc::test::PrintResult("ramp_up_down_up",
357 GetModifierString(),
358 "rampdown",
359 now - state_start_ms_,
360 "ms",
361 false);
362 state_start_ms_ = now;
363 interval_start_ms_ = now;
364 sent_bytes_ = 0;
365 }
366 break;
367 }
368 case kSecondRampup: {
stefan4fbd1452015-09-28 03:57:14 -0700369 if (bitrate_bps > kExpectedHighBitrateBps && !suspended) {
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000370 webrtc::test::PrintResult("ramp_up_down_up",
371 GetModifierString(),
372 "second_rampup",
373 now - state_start_ms_,
374 "ms",
375 false);
stefan4fbd1452015-09-28 03:57:14 -0700376 observation_complete_->Set();
stefan@webrtc.org3d7da882014-07-08 13:59:46 +0000377 }
378 break;
379 }
380 }
381}
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +0000382
stefan4fbd1452015-09-28 03:57:14 -0700383class RampUpTest : public test::CallTest {
Erik Språng6b8d3552015-09-24 15:06:57 +0200384 public:
stefan4fbd1452015-09-28 03:57:14 -0700385 RampUpTest() {}
Erik Språng6b8d3552015-09-24 15:06:57 +0200386
stefan4fbd1452015-09-28 03:57:14 -0700387 virtual ~RampUpTest() {
388 EXPECT_EQ(nullptr, send_stream_);
389 EXPECT_TRUE(receive_streams_.empty());
Erik Språng6b8d3552015-09-24 15:06:57 +0200390 }
Erik Språng6b8d3552015-09-24 15:06:57 +0200391};
392
stefan@webrtc.orgcb254aa2014-06-12 15:12:25 +0000393TEST_F(RampUpTest, SingleStream) {
stefan4fbd1452015-09-28 03:57:14 -0700394 RampUpTester test(1, 0, RtpExtension::kTOffset, false, false);
395 RunBaseTest(&test);
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000396}
pbos@webrtc.org744fbc72013-09-10 09:26:25 +0000397
stefan@webrtc.orgcb254aa2014-06-12 15:12:25 +0000398TEST_F(RampUpTest, Simulcast) {
stefan4fbd1452015-09-28 03:57:14 -0700399 RampUpTester test(3, 0, RtpExtension::kTOffset, false, false);
400 RunBaseTest(&test);
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000401}
402
stefan@webrtc.orgcb254aa2014-06-12 15:12:25 +0000403TEST_F(RampUpTest, SimulcastWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700404 RampUpTester test(3, 0, RtpExtension::kTOffset, true, false);
405 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800406}
407
408TEST_F(RampUpTest, SimulcastByRedWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700409 RampUpTester test(3, 0, RtpExtension::kTOffset, true, true);
410 RunBaseTest(&test);
mflodman@webrtc.orgeb16b812014-06-16 08:57:39 +0000411}
412
413TEST_F(RampUpTest, SingleStreamWithHighStartBitrate) {
stefan4fbd1452015-09-28 03:57:14 -0700414 RampUpTester test(1, 0.9 * kSingleStreamTargetBps, RtpExtension::kTOffset,
415 false, false);
416 RunBaseTest(&test);
andresp@webrtc.orgc1480792014-03-20 03:23:55 +0000417}
pbos@webrtc.org744fbc72013-09-10 09:26:25 +0000418
Shao Changbine62202f2015-04-21 20:24:50 +0800419TEST_F(RampUpTest, UpDownUpOneStream) {
stefan4fbd1452015-09-28 03:57:14 -0700420 RampUpDownUpTester test(1, 60000, RtpExtension::kAbsSendTime, false, false);
421 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800422}
henrik.lundin@webrtc.org845862f2014-03-06 07:19:28 +0000423
Shao Changbine62202f2015-04-21 20:24:50 +0800424TEST_F(RampUpTest, UpDownUpThreeStreams) {
stefan4fbd1452015-09-28 03:57:14 -0700425 RampUpDownUpTester test(3, 60000, RtpExtension::kAbsSendTime, false, false);
426 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800427}
henrik.lundin@webrtc.org998cb8f2014-03-06 09:12:00 +0000428
Shao Changbine62202f2015-04-21 20:24:50 +0800429TEST_F(RampUpTest, UpDownUpOneStreamRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700430 RampUpDownUpTester test(1, 60000, RtpExtension::kAbsSendTime, true, false);
431 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800432}
henrik.lundin@webrtc.org998cb8f2014-03-06 09:12:00 +0000433
Shao Changbine62202f2015-04-21 20:24:50 +0800434TEST_F(RampUpTest, UpDownUpThreeStreamsRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700435 RampUpDownUpTester test(3, 60000, RtpExtension::kAbsSendTime, true, false);
436 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800437}
438
439TEST_F(RampUpTest, UpDownUpOneStreamByRedRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700440 RampUpDownUpTester test(1, 60000, RtpExtension::kAbsSendTime, true, true);
441 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800442}
443
444TEST_F(RampUpTest, UpDownUpThreeStreamsByRedRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700445 RampUpDownUpTester test(3, 60000, RtpExtension::kAbsSendTime, true, true);
446 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800447}
henrik.lundin@webrtc.org845862f2014-03-06 07:19:28 +0000448
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000449TEST_F(RampUpTest, AbsSendTimeSingleStream) {
stefan4fbd1452015-09-28 03:57:14 -0700450 RampUpTester test(1, 0, RtpExtension::kAbsSendTime, false, false);
451 RunBaseTest(&test);
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000452}
453
454TEST_F(RampUpTest, AbsSendTimeSimulcast) {
stefan4fbd1452015-09-28 03:57:14 -0700455 RampUpTester test(3, 0, RtpExtension::kAbsSendTime, false, false);
456 RunBaseTest(&test);
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000457}
458
459TEST_F(RampUpTest, AbsSendTimeSimulcastWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700460 RampUpTester test(3, 0, RtpExtension::kAbsSendTime, true, false);
461 RunBaseTest(&test);
Shao Changbine62202f2015-04-21 20:24:50 +0800462}
463
464TEST_F(RampUpTest, AbsSendTimeSimulcastByRedWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700465 RampUpTester test(3, 0, RtpExtension::kAbsSendTime, true, true);
466 RunBaseTest(&test);
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000467}
468
469TEST_F(RampUpTest, AbsSendTimeSingleStreamWithHighStartBitrate) {
stefan4fbd1452015-09-28 03:57:14 -0700470 RampUpTester test(1, 0.9 * kSingleStreamTargetBps, RtpExtension::kAbsSendTime,
471 false, false);
472 RunBaseTest(&test);
pbos@webrtc.org85bd53e2014-12-10 10:36:20 +0000473}
Erik Språng6b8d3552015-09-24 15:06:57 +0200474
475TEST_F(RampUpTest, TransportSequenceNumberSingleStream) {
stefan4fbd1452015-09-28 03:57:14 -0700476 RampUpTester test(1, 0, RtpExtension::kTransportSequenceNumber, false, false);
477 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200478}
479
480TEST_F(RampUpTest, TransportSequenceNumberSimulcast) {
stefan4fbd1452015-09-28 03:57:14 -0700481 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, false, false);
482 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200483}
484
485TEST_F(RampUpTest, TransportSequenceNumberSimulcastWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700486 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, true, false);
487 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200488}
489
490TEST_F(RampUpTest, TransportSequenceNumberSimulcastByRedWithRtx) {
stefan4fbd1452015-09-28 03:57:14 -0700491 RampUpTester test(3, 0, RtpExtension::kTransportSequenceNumber, true, true);
492 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200493}
494
495TEST_F(RampUpTest, TransportSequenceNumberSingleStreamWithHighStartBitrate) {
stefan4fbd1452015-09-28 03:57:14 -0700496 RampUpTester test(1, 0.9 * kSingleStreamTargetBps,
497 RtpExtension::kTransportSequenceNumber, false, false);
498 RunBaseTest(&test);
Erik Språng6b8d3552015-09-24 15:06:57 +0200499}
pbos@webrtc.org744fbc72013-09-10 09:26:25 +0000500} // namespace webrtc