blob: b5c4d8e5cc41418350fa8bf7505831f7006212c3 [file] [log] [blame]
pbos@webrtc.org5ab75672013-12-16 12:24:44 +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 */
10#include <functional>
11#include <list>
kwibergb25345e2016-03-12 06:10:44 -080012#include <memory>
pbos@webrtc.org5ab75672013-12-16 12:24:44 +000013#include <string>
14
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020015#include "call/call.h"
Artem Titovdd2eebe2018-08-20 13:27:45 +020016#include "call/fake_network_pipe.h"
17#include "call/simulated_network.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020018#include "rtc_base/checks.h"
19#include "rtc_base/event.h"
20#include "rtc_base/logging.h"
Danil Chapovalov82a3f0a2019-10-21 09:24:27 +020021#include "rtc_base/task_queue_for_test.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020022#include "rtc_base/thread_annotations.h"
23#include "test/call_test.h"
24#include "test/direct_transport.h"
25#include "test/encoder_settings.h"
26#include "test/fake_decoder.h"
27#include "test/fake_encoder.h"
28#include "test/frame_generator_capturer.h"
29#include "test/gtest.h"
pbos@webrtc.org5ab75672013-12-16 12:24:44 +000030
31namespace webrtc {
andresp@webrtc.orgb941fe82014-07-07 08:50:48 +000032namespace {
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020033// Note: If you consider to re-use this class, think twice and instead consider
Peter Boström7c704b82015-12-04 16:13:05 +010034// writing tests that don't depend on the logging system.
35class LogObserver {
andresp@webrtc.orgb941fe82014-07-07 08:50:48 +000036 public:
Peter Boström7c704b82015-12-04 16:13:05 +010037 LogObserver() { rtc::LogMessage::AddLogToStream(&callback_, rtc::LS_INFO); }
andresp@webrtc.orgb941fe82014-07-07 08:50:48 +000038
Peter Boström7c704b82015-12-04 16:13:05 +010039 ~LogObserver() { rtc::LogMessage::RemoveLogToStream(&callback_); }
andresp@webrtc.orgb941fe82014-07-07 08:50:48 +000040
41 void PushExpectedLogLine(const std::string& expected_log_line) {
42 callback_.PushExpectedLogLine(expected_log_line);
43 }
44
Peter Boström5811a392015-12-10 13:02:50 +010045 bool Wait() { return callback_.Wait(); }
andresp@webrtc.orgb941fe82014-07-07 08:50:48 +000046
47 private:
Peter Boström7c704b82015-12-04 16:13:05 +010048 class Callback : public rtc::LogSink {
andresp@webrtc.orgb941fe82014-07-07 08:50:48 +000049 public:
Peter Boström7c704b82015-12-04 16:13:05 +010050 void OnLogMessage(const std::string& message) override {
Peter Boströmf2f82832015-05-01 13:00:41 +020051 rtc::CritScope lock(&crit_sect_);
Peter Boström7c704b82015-12-04 16:13:05 +010052 // Ignore log lines that are due to missing AST extensions, these are
53 // logged when we switch back from AST to TOF until the wrapping bitrate
54 // estimator gives up on using AST.
55 if (message.find("BitrateEstimator") != std::string::npos &&
56 message.find("packet is missing") == std::string::npos) {
57 received_log_lines_.push_back(message);
andresp@webrtc.orgb941fe82014-07-07 08:50:48 +000058 }
Peter Boström7c704b82015-12-04 16:13:05 +010059
andresp@webrtc.orgb941fe82014-07-07 08:50:48 +000060 int num_popped = 0;
61 while (!received_log_lines_.empty() && !expected_log_lines_.empty()) {
62 std::string a = received_log_lines_.front();
63 std::string b = expected_log_lines_.front();
64 received_log_lines_.pop_front();
65 expected_log_lines_.pop_front();
66 num_popped++;
Peter Boström7c704b82015-12-04 16:13:05 +010067 EXPECT_TRUE(a.find(b) != std::string::npos) << a << " != " << b;
andresp@webrtc.orgb941fe82014-07-07 08:50:48 +000068 }
Benjamin Wright41f9f2c2019-03-13 18:03:29 -070069 if (expected_log_lines_.empty()) {
andresp@webrtc.orgb941fe82014-07-07 08:50:48 +000070 if (num_popped > 0) {
Peter Boström5811a392015-12-10 13:02:50 +010071 done_.Set();
andresp@webrtc.orgb941fe82014-07-07 08:50:48 +000072 }
73 return;
74 }
75 }
76
Peter Boström5811a392015-12-10 13:02:50 +010077 bool Wait() { return done_.Wait(test::CallTest::kDefaultTimeoutMs); }
andresp@webrtc.orgb941fe82014-07-07 08:50:48 +000078
79 void PushExpectedLogLine(const std::string& expected_log_line) {
Peter Boströmf2f82832015-05-01 13:00:41 +020080 rtc::CritScope lock(&crit_sect_);
andresp@webrtc.orgb941fe82014-07-07 08:50:48 +000081 expected_log_lines_.push_back(expected_log_line);
82 }
83
84 private:
85 typedef std::list<std::string> Strings;
Peter Boströmf2f82832015-05-01 13:00:41 +020086 rtc::CriticalSection crit_sect_;
danilchapa37de392017-09-09 04:17:22 -070087 Strings received_log_lines_ RTC_GUARDED_BY(crit_sect_);
88 Strings expected_log_lines_ RTC_GUARDED_BY(crit_sect_);
Peter Boström5811a392015-12-10 13:02:50 +010089 rtc::Event done_;
andresp@webrtc.orgb941fe82014-07-07 08:50:48 +000090 };
91
92 Callback callback_;
93};
94} // namespace
pbos@webrtc.org5ab75672013-12-16 12:24:44 +000095
96static const int kTOFExtensionId = 4;
97static const int kASTExtensionId = 5;
98
pbos@webrtc.org994d0b72014-06-27 08:47:52 +000099class BitrateEstimatorTest : public test::CallTest {
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000100 public:
aleloi5d78e8d2016-11-08 03:44:54 -0800101 BitrateEstimatorTest() : receive_config_(nullptr) {}
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000102
Fredrik Solenberg0ccae132015-11-03 10:15:49 +0100103 virtual ~BitrateEstimatorTest() { EXPECT_TRUE(streams_.empty()); }
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000104
105 virtual void SetUp() {
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200106 SendTask(RTC_FROM_HERE, task_queue(), [this]() {
Sebastian Jansson8e6602f2018-07-13 10:43:20 +0200107 CreateCalls();
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000108
eladalon413ee9a2017-08-22 04:02:52 -0700109 send_transport_.reset(new test::DirectTransport(
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200110 task_queue(),
Mirko Bonadei317a1f02019-09-17 17:06:18 +0200111 std::make_unique<FakeNetworkPipe>(
112 Clock::GetRealTimeClock(), std::make_unique<SimulatedNetwork>(
Artem Titov75e36472018-10-08 12:28:56 +0200113 BuiltInNetworkBehaviorConfig())),
Artem Titovdd2eebe2018-08-20 13:27:45 +0200114 sender_call_.get(), payload_type_map_));
eladalon413ee9a2017-08-22 04:02:52 -0700115 send_transport_->SetReceiver(receiver_call_->Receiver());
116 receive_transport_.reset(new test::DirectTransport(
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200117 task_queue(),
Mirko Bonadei317a1f02019-09-17 17:06:18 +0200118 std::make_unique<FakeNetworkPipe>(
119 Clock::GetRealTimeClock(), std::make_unique<SimulatedNetwork>(
Artem Titov75e36472018-10-08 12:28:56 +0200120 BuiltInNetworkBehaviorConfig())),
Artem Titovdd2eebe2018-08-20 13:27:45 +0200121 receiver_call_.get(), payload_type_map_));
eladalon413ee9a2017-08-22 04:02:52 -0700122 receive_transport_->SetReceiver(sender_call_->Receiver());
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000123
Sebastian Janssonf33905d2018-07-13 09:49:00 +0200124 VideoSendStream::Config video_send_config(send_transport_.get());
125 video_send_config.rtp.ssrcs.push_back(kVideoSendSsrcs[0]);
126 video_send_config.encoder_settings.encoder_factory =
Niels Möller4db138e2018-04-19 09:04:13 +0200127 &fake_encoder_factory_;
Jiawei Ouc2ebe212018-11-08 10:02:56 -0800128 video_send_config.encoder_settings.bitrate_allocator_factory =
129 bitrate_allocator_factory_.get();
Sebastian Janssonf33905d2018-07-13 09:49:00 +0200130 video_send_config.rtp.payload_name = "FAKE";
131 video_send_config.rtp.payload_type = kFakeVideoSendPayloadType;
132 SetVideoSendConfig(video_send_config);
133 VideoEncoderConfig video_encoder_config;
134 test::FillEncoderConfiguration(kVideoCodecVP8, 1, &video_encoder_config);
135 SetVideoEncoderConfig(video_encoder_config);
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000136
eladalon413ee9a2017-08-22 04:02:52 -0700137 receive_config_ = VideoReceiveStream::Config(receive_transport_.get());
138 // receive_config_.decoders will be set by every stream separately.
Sebastian Janssonf33905d2018-07-13 09:49:00 +0200139 receive_config_.rtp.remote_ssrc = GetVideoSendConfig()->rtp.ssrcs[0];
eladalon413ee9a2017-08-22 04:02:52 -0700140 receive_config_.rtp.local_ssrc = kReceiverLocalVideoSsrc;
eladalon413ee9a2017-08-22 04:02:52 -0700141 receive_config_.rtp.extensions.push_back(
142 RtpExtension(RtpExtension::kTimestampOffsetUri, kTOFExtensionId));
143 receive_config_.rtp.extensions.push_back(
144 RtpExtension(RtpExtension::kAbsSendTimeUri, kASTExtensionId));
145 });
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000146 }
147
148 virtual void TearDown() {
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200149 SendTask(RTC_FROM_HERE, task_queue(), [this]() {
Yusuke Suzukif8d8d6d2018-05-17 22:01:13 +0900150 for (auto* stream : streams_) {
151 stream->StopSending();
152 delete stream;
eladalon413ee9a2017-08-22 04:02:52 -0700153 }
Yusuke Suzukif8d8d6d2018-05-17 22:01:13 +0900154 streams_.clear();
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000155
eladalon413ee9a2017-08-22 04:02:52 -0700156 send_transport_.reset();
157 receive_transport_.reset();
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000158
Sebastian Jansson8e6602f2018-07-13 10:43:20 +0200159 DestroyCalls();
eladalon413ee9a2017-08-22 04:02:52 -0700160 });
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000161 }
162
163 protected:
164 friend class Stream;
165
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000166 class Stream {
167 public:
aleloi5d78e8d2016-11-08 03:44:54 -0800168 explicit Stream(BitrateEstimatorTest* test)
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000169 : test_(test),
170 is_sending_receiving_(false),
pbos@webrtc.org2b4ce3a2015-03-23 13:12:24 +0000171 send_stream_(nullptr),
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000172 frame_generator_capturer_(),
Niels Möllercbcbc222018-09-28 09:07:24 +0200173 decoder_factory_(
Mirko Bonadei317a1f02019-09-17 17:06:18 +0200174 []() { return std::make_unique<test::FakeDecoder>(); }) {
Sebastian Janssonf33905d2018-07-13 09:49:00 +0200175 test_->GetVideoSendConfig()->rtp.ssrcs[0]++;
pbos@webrtc.org6ae48c62014-06-06 10:49:19 +0000176 send_stream_ = test_->sender_call_->CreateVideoSendStream(
Sebastian Janssonf33905d2018-07-13 09:49:00 +0200177 test_->GetVideoSendConfig()->Copy(),
178 test_->GetVideoEncoderConfig()->Copy());
179 RTC_DCHECK_EQ(1, test_->GetVideoEncoderConfig()->number_of_streams);
Danil Chapovalov81687b32019-04-18 15:39:53 +0200180 frame_generator_capturer_ =
Mirko Bonadei317a1f02019-09-17 17:06:18 +0200181 std::make_unique<test::FrameGeneratorCapturer>(
Danil Chapovalov81687b32019-04-18 15:39:53 +0200182 test->clock_,
183 test::FrameGenerator::CreateSquareGenerator(
184 kDefaultWidth, kDefaultHeight, absl::nullopt, absl::nullopt),
185 kDefaultFramerate, *test->task_queue_factory_);
186 frame_generator_capturer_->Init();
Taylor Brandstetter49fcc102018-05-16 14:20:41 -0700187 send_stream_->SetSource(frame_generator_capturer_.get(),
188 DegradationPreference::MAINTAIN_FRAMERATE);
pbos@webrtc.orga5c8d2c2014-04-24 11:13:21 +0000189 send_stream_->Start();
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000190
aleloi5d78e8d2016-11-08 03:44:54 -0800191 VideoReceiveStream::Decoder decoder;
Niels Möllercbcbc222018-09-28 09:07:24 +0200192 decoder.decoder_factory = &decoder_factory_;
Sebastian Janssonf33905d2018-07-13 09:49:00 +0200193 decoder.payload_type = test_->GetVideoSendConfig()->rtp.payload_type;
Niels Möllercb7e1d22018-09-11 15:56:04 +0200194 decoder.video_format =
195 SdpVideoFormat(test_->GetVideoSendConfig()->rtp.payload_name);
aleloi5d78e8d2016-11-08 03:44:54 -0800196 test_->receive_config_.decoders.clear();
197 test_->receive_config_.decoders.push_back(decoder);
198 test_->receive_config_.rtp.remote_ssrc =
Sebastian Janssonf33905d2018-07-13 09:49:00 +0200199 test_->GetVideoSendConfig()->rtp.ssrcs[0];
aleloi5d78e8d2016-11-08 03:44:54 -0800200 test_->receive_config_.rtp.local_ssrc++;
201 test_->receive_config_.renderer = &test->fake_renderer_;
202 video_receive_stream_ = test_->receiver_call_->CreateVideoReceiveStream(
203 test_->receive_config_.Copy());
204 video_receive_stream_->Start();
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000205 is_sending_receiving_ = true;
206 }
207
208 ~Stream() {
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +0200209 EXPECT_FALSE(is_sending_receiving_);
perkj9fdbda62016-09-15 09:19:20 -0700210 test_->sender_call_->DestroyVideoSendStream(send_stream_);
perkja49cbd32016-09-16 07:53:41 -0700211 frame_generator_capturer_.reset(nullptr);
pbos@webrtc.org2b4ce3a2015-03-23 13:12:24 +0000212 send_stream_ = nullptr;
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +0200213 if (video_receive_stream_) {
214 test_->receiver_call_->DestroyVideoReceiveStream(video_receive_stream_);
215 video_receive_stream_ = nullptr;
216 }
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000217 }
218
219 void StopSending() {
220 if (is_sending_receiving_) {
pbos@webrtc.orga5c8d2c2014-04-24 11:13:21 +0000221 send_stream_->Stop();
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +0200222 if (video_receive_stream_) {
223 video_receive_stream_->Stop();
224 }
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000225 is_sending_receiving_ = false;
226 }
227 }
228
229 private:
230 BitrateEstimatorTest* test_;
231 bool is_sending_receiving_;
232 VideoSendStream* send_stream_;
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +0200233 VideoReceiveStream* video_receive_stream_;
kwibergb25345e2016-03-12 06:10:44 -0800234 std::unique_ptr<test::FrameGeneratorCapturer> frame_generator_capturer_;
Niels Möllercbcbc222018-09-28 09:07:24 +0200235
236 test::FunctionVideoDecoderFactory decoder_factory_;
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000237 };
238
Peter Boström7c704b82015-12-04 16:13:05 +0100239 LogObserver receiver_log_;
kwibergb25345e2016-03-12 06:10:44 -0800240 std::unique_ptr<test::DirectTransport> send_transport_;
241 std::unique_ptr<test::DirectTransport> receive_transport_;
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000242 VideoReceiveStream::Config receive_config_;
243 std::vector<Stream*> streams_;
244};
245
Erik Språng468e62a2015-07-06 10:50:47 +0200246static const char* kAbsSendTimeLog =
247 "RemoteBitrateEstimatorAbsSendTime: Instantiating.";
248static const char* kSingleStreamLog =
249 "RemoteBitrateEstimatorSingleStream: Instantiating.";
250
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +0200251TEST_F(BitrateEstimatorTest, InstantiatesTOFPerDefaultForVideo) {
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200252 SendTask(RTC_FROM_HERE, task_queue(), [this]() {
Sebastian Janssonf33905d2018-07-13 09:49:00 +0200253 GetVideoSendConfig()->rtp.extensions.push_back(
eladalon413ee9a2017-08-22 04:02:52 -0700254 RtpExtension(RtpExtension::kTimestampOffsetUri, kTOFExtensionId));
255 receiver_log_.PushExpectedLogLine(kSingleStreamLog);
256 receiver_log_.PushExpectedLogLine(kSingleStreamLog);
257 streams_.push_back(new Stream(this));
258 });
Peter Boström5811a392015-12-10 13:02:50 +0100259 EXPECT_TRUE(receiver_log_.Wait());
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000260}
261
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +0200262TEST_F(BitrateEstimatorTest, ImmediatelySwitchToASTForVideo) {
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200263 SendTask(RTC_FROM_HERE, task_queue(), [this]() {
Sebastian Janssonf33905d2018-07-13 09:49:00 +0200264 GetVideoSendConfig()->rtp.extensions.push_back(
eladalon413ee9a2017-08-22 04:02:52 -0700265 RtpExtension(RtpExtension::kAbsSendTimeUri, kASTExtensionId));
266 receiver_log_.PushExpectedLogLine(kSingleStreamLog);
267 receiver_log_.PushExpectedLogLine(kSingleStreamLog);
268 receiver_log_.PushExpectedLogLine("Switching to absolute send time RBE.");
269 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
270 streams_.push_back(new Stream(this));
271 });
Peter Boström5811a392015-12-10 13:02:50 +0100272 EXPECT_TRUE(receiver_log_.Wait());
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +0200273}
274
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +0200275TEST_F(BitrateEstimatorTest, SwitchesToASTForVideo) {
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200276 SendTask(RTC_FROM_HERE, task_queue(), [this]() {
Sebastian Janssonf33905d2018-07-13 09:49:00 +0200277 GetVideoSendConfig()->rtp.extensions.push_back(
eladalon413ee9a2017-08-22 04:02:52 -0700278 RtpExtension(RtpExtension::kTimestampOffsetUri, kTOFExtensionId));
279 receiver_log_.PushExpectedLogLine(kSingleStreamLog);
280 receiver_log_.PushExpectedLogLine(kSingleStreamLog);
281 streams_.push_back(new Stream(this));
282 });
Peter Boström5811a392015-12-10 13:02:50 +0100283 EXPECT_TRUE(receiver_log_.Wait());
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000284
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200285 SendTask(RTC_FROM_HERE, task_queue(), [this]() {
Sebastian Janssonf33905d2018-07-13 09:49:00 +0200286 GetVideoSendConfig()->rtp.extensions[0] =
eladalon413ee9a2017-08-22 04:02:52 -0700287 RtpExtension(RtpExtension::kAbsSendTimeUri, kASTExtensionId);
288 receiver_log_.PushExpectedLogLine("Switching to absolute send time RBE.");
289 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
290 streams_.push_back(new Stream(this));
291 });
Peter Boström5811a392015-12-10 13:02:50 +0100292 EXPECT_TRUE(receiver_log_.Wait());
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000293}
294
deadbeef1086ed62016-04-22 10:52:40 -0700295// This test is flaky. See webrtc:5790.
296TEST_F(BitrateEstimatorTest, DISABLED_SwitchesToASTThenBackToTOFForVideo) {
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200297 SendTask(RTC_FROM_HERE, task_queue(), [this]() {
Sebastian Janssonf33905d2018-07-13 09:49:00 +0200298 GetVideoSendConfig()->rtp.extensions.push_back(
eladalon413ee9a2017-08-22 04:02:52 -0700299 RtpExtension(RtpExtension::kTimestampOffsetUri, kTOFExtensionId));
300 receiver_log_.PushExpectedLogLine(kSingleStreamLog);
301 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
302 receiver_log_.PushExpectedLogLine(kSingleStreamLog);
303 streams_.push_back(new Stream(this));
304 });
Peter Boström5811a392015-12-10 13:02:50 +0100305 EXPECT_TRUE(receiver_log_.Wait());
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000306
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200307 SendTask(RTC_FROM_HERE, task_queue(), [this]() {
Sebastian Janssonf33905d2018-07-13 09:49:00 +0200308 GetVideoSendConfig()->rtp.extensions[0] =
eladalon413ee9a2017-08-22 04:02:52 -0700309 RtpExtension(RtpExtension::kAbsSendTimeUri, kASTExtensionId);
310 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
311 receiver_log_.PushExpectedLogLine("Switching to absolute send time RBE.");
312 streams_.push_back(new Stream(this));
313 });
Peter Boström5811a392015-12-10 13:02:50 +0100314 EXPECT_TRUE(receiver_log_.Wait());
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000315
Danil Chapovalovd15a0282019-10-22 10:48:17 +0200316 SendTask(RTC_FROM_HERE, task_queue(), [this]() {
Sebastian Janssonf33905d2018-07-13 09:49:00 +0200317 GetVideoSendConfig()->rtp.extensions[0] =
eladalon413ee9a2017-08-22 04:02:52 -0700318 RtpExtension(RtpExtension::kTimestampOffsetUri, kTOFExtensionId);
319 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
320 receiver_log_.PushExpectedLogLine(
321 "WrappingBitrateEstimator: Switching to transmission time offset RBE.");
322 streams_.push_back(new Stream(this));
323 streams_[0]->StopSending();
324 streams_[1]->StopSending();
325 });
Peter Boström5811a392015-12-10 13:02:50 +0100326 EXPECT_TRUE(receiver_log_.Wait());
pbos@webrtc.org5ab75672013-12-16 12:24:44 +0000327}
328} // namespace webrtc