2013-12-16 12:24:44 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
#include <functional>
|
|
|
|
|
#include <list>
|
2016-03-12 06:10:44 -08:00
|
|
|
#include <memory>
|
2013-12-16 12:24:44 +00:00
|
|
|
#include <string>
|
|
|
|
|
|
2019-01-07 10:21:47 -08:00
|
|
|
#include "absl/memory/memory.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "call/call.h"
|
2018-08-20 13:27:45 +02:00
|
|
|
#include "call/fake_network_pipe.h"
|
|
|
|
|
#include "call/simulated_network.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "rtc_base/checks.h"
|
|
|
|
|
#include "rtc_base/event.h"
|
|
|
|
|
#include "rtc_base/logging.h"
|
|
|
|
|
#include "rtc_base/thread_annotations.h"
|
|
|
|
|
#include "test/call_test.h"
|
|
|
|
|
#include "test/direct_transport.h"
|
|
|
|
|
#include "test/encoder_settings.h"
|
|
|
|
|
#include "test/fake_decoder.h"
|
|
|
|
|
#include "test/fake_encoder.h"
|
|
|
|
|
#include "test/frame_generator_capturer.h"
|
|
|
|
|
#include "test/gtest.h"
|
2013-12-16 12:24:44 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
2014-07-07 08:50:48 +00:00
|
|
|
namespace {
|
2015-04-29 15:24:01 +02:00
|
|
|
// Note: If you consider to re-use this class, think twice and instead consider
|
2015-12-04 16:13:05 +01:00
|
|
|
// writing tests that don't depend on the logging system.
|
|
|
|
|
class LogObserver {
|
2014-07-07 08:50:48 +00:00
|
|
|
public:
|
2015-12-04 16:13:05 +01:00
|
|
|
LogObserver() { rtc::LogMessage::AddLogToStream(&callback_, rtc::LS_INFO); }
|
2014-07-07 08:50:48 +00:00
|
|
|
|
2015-12-04 16:13:05 +01:00
|
|
|
~LogObserver() { rtc::LogMessage::RemoveLogToStream(&callback_); }
|
2014-07-07 08:50:48 +00:00
|
|
|
|
|
|
|
|
void PushExpectedLogLine(const std::string& expected_log_line) {
|
|
|
|
|
callback_.PushExpectedLogLine(expected_log_line);
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-10 13:02:50 +01:00
|
|
|
bool Wait() { return callback_.Wait(); }
|
2014-07-07 08:50:48 +00:00
|
|
|
|
|
|
|
|
private:
|
2015-12-04 16:13:05 +01:00
|
|
|
class Callback : public rtc::LogSink {
|
2014-07-07 08:50:48 +00:00
|
|
|
public:
|
2015-12-04 16:13:05 +01:00
|
|
|
void OnLogMessage(const std::string& message) override {
|
2015-05-01 13:00:41 +02:00
|
|
|
rtc::CritScope lock(&crit_sect_);
|
2015-12-04 16:13:05 +01:00
|
|
|
// Ignore log lines that are due to missing AST extensions, these are
|
|
|
|
|
// logged when we switch back from AST to TOF until the wrapping bitrate
|
|
|
|
|
// estimator gives up on using AST.
|
|
|
|
|
if (message.find("BitrateEstimator") != std::string::npos &&
|
|
|
|
|
message.find("packet is missing") == std::string::npos) {
|
|
|
|
|
received_log_lines_.push_back(message);
|
2014-07-07 08:50:48 +00:00
|
|
|
}
|
2015-12-04 16:13:05 +01:00
|
|
|
|
2014-07-07 08:50:48 +00:00
|
|
|
int num_popped = 0;
|
|
|
|
|
while (!received_log_lines_.empty() && !expected_log_lines_.empty()) {
|
|
|
|
|
std::string a = received_log_lines_.front();
|
|
|
|
|
std::string b = expected_log_lines_.front();
|
|
|
|
|
received_log_lines_.pop_front();
|
|
|
|
|
expected_log_lines_.pop_front();
|
|
|
|
|
num_popped++;
|
2015-12-04 16:13:05 +01:00
|
|
|
EXPECT_TRUE(a.find(b) != std::string::npos) << a << " != " << b;
|
2014-07-07 08:50:48 +00:00
|
|
|
}
|
2019-03-13 18:03:29 -07:00
|
|
|
if (expected_log_lines_.empty()) {
|
2014-07-07 08:50:48 +00:00
|
|
|
if (num_popped > 0) {
|
2015-12-10 13:02:50 +01:00
|
|
|
done_.Set();
|
2014-07-07 08:50:48 +00:00
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-10 13:02:50 +01:00
|
|
|
bool Wait() { return done_.Wait(test::CallTest::kDefaultTimeoutMs); }
|
2014-07-07 08:50:48 +00:00
|
|
|
|
|
|
|
|
void PushExpectedLogLine(const std::string& expected_log_line) {
|
2015-05-01 13:00:41 +02:00
|
|
|
rtc::CritScope lock(&crit_sect_);
|
2014-07-07 08:50:48 +00:00
|
|
|
expected_log_lines_.push_back(expected_log_line);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
typedef std::list<std::string> Strings;
|
2015-05-01 13:00:41 +02:00
|
|
|
rtc::CriticalSection crit_sect_;
|
2017-09-09 04:17:22 -07:00
|
|
|
Strings received_log_lines_ RTC_GUARDED_BY(crit_sect_);
|
|
|
|
|
Strings expected_log_lines_ RTC_GUARDED_BY(crit_sect_);
|
2015-12-10 13:02:50 +01:00
|
|
|
rtc::Event done_;
|
2014-07-07 08:50:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Callback callback_;
|
|
|
|
|
};
|
|
|
|
|
} // namespace
|
2013-12-16 12:24:44 +00:00
|
|
|
|
|
|
|
|
static const int kTOFExtensionId = 4;
|
|
|
|
|
static const int kASTExtensionId = 5;
|
|
|
|
|
|
2014-06-27 08:47:52 +00:00
|
|
|
class BitrateEstimatorTest : public test::CallTest {
|
2013-12-16 12:24:44 +00:00
|
|
|
public:
|
2016-11-08 03:44:54 -08:00
|
|
|
BitrateEstimatorTest() : receive_config_(nullptr) {}
|
2013-12-16 12:24:44 +00:00
|
|
|
|
2015-11-03 10:15:49 +01:00
|
|
|
virtual ~BitrateEstimatorTest() { EXPECT_TRUE(streams_.empty()); }
|
2013-12-16 12:24:44 +00:00
|
|
|
|
|
|
|
|
virtual void SetUp() {
|
2017-08-22 04:02:52 -07:00
|
|
|
task_queue_.SendTask([this]() {
|
2018-07-13 10:43:20 +02:00
|
|
|
CreateCalls();
|
2017-08-22 04:02:52 -07:00
|
|
|
|
|
|
|
|
send_transport_.reset(new test::DirectTransport(
|
2018-08-20 13:27:45 +02:00
|
|
|
&task_queue_,
|
|
|
|
|
absl::make_unique<FakeNetworkPipe>(
|
|
|
|
|
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
|
2018-10-08 12:28:56 +02:00
|
|
|
BuiltInNetworkBehaviorConfig())),
|
2018-08-20 13:27:45 +02:00
|
|
|
sender_call_.get(), payload_type_map_));
|
2017-08-22 04:02:52 -07:00
|
|
|
send_transport_->SetReceiver(receiver_call_->Receiver());
|
|
|
|
|
receive_transport_.reset(new test::DirectTransport(
|
2018-08-20 13:27:45 +02:00
|
|
|
&task_queue_,
|
|
|
|
|
absl::make_unique<FakeNetworkPipe>(
|
|
|
|
|
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
|
2018-10-08 12:28:56 +02:00
|
|
|
BuiltInNetworkBehaviorConfig())),
|
2018-08-20 13:27:45 +02:00
|
|
|
receiver_call_.get(), payload_type_map_));
|
2017-08-22 04:02:52 -07:00
|
|
|
receive_transport_->SetReceiver(sender_call_->Receiver());
|
|
|
|
|
|
2018-07-13 09:49:00 +02:00
|
|
|
VideoSendStream::Config video_send_config(send_transport_.get());
|
|
|
|
|
video_send_config.rtp.ssrcs.push_back(kVideoSendSsrcs[0]);
|
|
|
|
|
video_send_config.encoder_settings.encoder_factory =
|
2018-04-19 09:04:13 +02:00
|
|
|
&fake_encoder_factory_;
|
2018-11-08 10:02:56 -08:00
|
|
|
video_send_config.encoder_settings.bitrate_allocator_factory =
|
|
|
|
|
bitrate_allocator_factory_.get();
|
2018-07-13 09:49:00 +02:00
|
|
|
video_send_config.rtp.payload_name = "FAKE";
|
|
|
|
|
video_send_config.rtp.payload_type = kFakeVideoSendPayloadType;
|
|
|
|
|
SetVideoSendConfig(video_send_config);
|
|
|
|
|
VideoEncoderConfig video_encoder_config;
|
|
|
|
|
test::FillEncoderConfiguration(kVideoCodecVP8, 1, &video_encoder_config);
|
|
|
|
|
SetVideoEncoderConfig(video_encoder_config);
|
2017-08-22 04:02:52 -07:00
|
|
|
|
|
|
|
|
receive_config_ = VideoReceiveStream::Config(receive_transport_.get());
|
|
|
|
|
// receive_config_.decoders will be set by every stream separately.
|
2018-07-13 09:49:00 +02:00
|
|
|
receive_config_.rtp.remote_ssrc = GetVideoSendConfig()->rtp.ssrcs[0];
|
2017-08-22 04:02:52 -07:00
|
|
|
receive_config_.rtp.local_ssrc = kReceiverLocalVideoSsrc;
|
|
|
|
|
receive_config_.rtp.remb = true;
|
|
|
|
|
receive_config_.rtp.extensions.push_back(
|
|
|
|
|
RtpExtension(RtpExtension::kTimestampOffsetUri, kTOFExtensionId));
|
|
|
|
|
receive_config_.rtp.extensions.push_back(
|
|
|
|
|
RtpExtension(RtpExtension::kAbsSendTimeUri, kASTExtensionId));
|
|
|
|
|
});
|
2013-12-16 12:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual void TearDown() {
|
2017-08-22 04:02:52 -07:00
|
|
|
task_queue_.SendTask([this]() {
|
2018-05-17 22:01:13 +09:00
|
|
|
for (auto* stream : streams_) {
|
|
|
|
|
stream->StopSending();
|
|
|
|
|
delete stream;
|
2017-08-22 04:02:52 -07:00
|
|
|
}
|
2018-05-17 22:01:13 +09:00
|
|
|
streams_.clear();
|
2013-12-16 12:24:44 +00:00
|
|
|
|
2017-08-22 04:02:52 -07:00
|
|
|
send_transport_.reset();
|
|
|
|
|
receive_transport_.reset();
|
2013-12-16 12:24:44 +00:00
|
|
|
|
2018-07-13 10:43:20 +02:00
|
|
|
DestroyCalls();
|
2017-08-22 04:02:52 -07:00
|
|
|
});
|
2013-12-16 12:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
friend class Stream;
|
|
|
|
|
|
|
|
|
|
class Stream {
|
|
|
|
|
public:
|
2016-11-08 03:44:54 -08:00
|
|
|
explicit Stream(BitrateEstimatorTest* test)
|
2013-12-16 12:24:44 +00:00
|
|
|
: test_(test),
|
|
|
|
|
is_sending_receiving_(false),
|
2015-03-23 13:12:24 +00:00
|
|
|
send_stream_(nullptr),
|
2013-12-16 12:24:44 +00:00
|
|
|
frame_generator_capturer_(),
|
2018-09-28 09:07:24 +02:00
|
|
|
decoder_factory_(
|
|
|
|
|
[]() { return absl::make_unique<test::FakeDecoder>(); }) {
|
2018-07-13 09:49:00 +02:00
|
|
|
test_->GetVideoSendConfig()->rtp.ssrcs[0]++;
|
2014-06-06 10:49:19 +00:00
|
|
|
send_stream_ = test_->sender_call_->CreateVideoSendStream(
|
2018-07-13 09:49:00 +02:00
|
|
|
test_->GetVideoSendConfig()->Copy(),
|
|
|
|
|
test_->GetVideoEncoderConfig()->Copy());
|
|
|
|
|
RTC_DCHECK_EQ(1, test_->GetVideoEncoderConfig()->number_of_streams);
|
2019-04-18 15:39:53 +02:00
|
|
|
frame_generator_capturer_ =
|
|
|
|
|
absl::make_unique<test::FrameGeneratorCapturer>(
|
|
|
|
|
test->clock_,
|
|
|
|
|
test::FrameGenerator::CreateSquareGenerator(
|
|
|
|
|
kDefaultWidth, kDefaultHeight, absl::nullopt, absl::nullopt),
|
|
|
|
|
kDefaultFramerate, *test->task_queue_factory_);
|
|
|
|
|
frame_generator_capturer_->Init();
|
2018-05-16 14:20:41 -07:00
|
|
|
send_stream_->SetSource(frame_generator_capturer_.get(),
|
|
|
|
|
DegradationPreference::MAINTAIN_FRAMERATE);
|
2014-04-24 11:13:21 +00:00
|
|
|
send_stream_->Start();
|
2013-12-16 12:24:44 +00:00
|
|
|
|
2016-11-08 03:44:54 -08:00
|
|
|
VideoReceiveStream::Decoder decoder;
|
2018-09-28 09:07:24 +02:00
|
|
|
decoder.decoder_factory = &decoder_factory_;
|
2018-07-13 09:49:00 +02:00
|
|
|
decoder.payload_type = test_->GetVideoSendConfig()->rtp.payload_type;
|
2018-09-11 15:56:04 +02:00
|
|
|
decoder.video_format =
|
|
|
|
|
SdpVideoFormat(test_->GetVideoSendConfig()->rtp.payload_name);
|
2016-11-08 03:44:54 -08:00
|
|
|
test_->receive_config_.decoders.clear();
|
|
|
|
|
test_->receive_config_.decoders.push_back(decoder);
|
|
|
|
|
test_->receive_config_.rtp.remote_ssrc =
|
2018-07-13 09:49:00 +02:00
|
|
|
test_->GetVideoSendConfig()->rtp.ssrcs[0];
|
2016-11-08 03:44:54 -08:00
|
|
|
test_->receive_config_.rtp.local_ssrc++;
|
|
|
|
|
test_->receive_config_.renderer = &test->fake_renderer_;
|
|
|
|
|
video_receive_stream_ = test_->receiver_call_->CreateVideoReceiveStream(
|
|
|
|
|
test_->receive_config_.Copy());
|
|
|
|
|
video_receive_stream_->Start();
|
2013-12-16 12:24:44 +00:00
|
|
|
is_sending_receiving_ = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
~Stream() {
|
2015-04-29 15:24:01 +02:00
|
|
|
EXPECT_FALSE(is_sending_receiving_);
|
2016-09-15 09:19:20 -07:00
|
|
|
test_->sender_call_->DestroyVideoSendStream(send_stream_);
|
2016-09-16 07:53:41 -07:00
|
|
|
frame_generator_capturer_.reset(nullptr);
|
2015-03-23 13:12:24 +00:00
|
|
|
send_stream_ = nullptr;
|
2015-04-29 15:24:01 +02:00
|
|
|
if (video_receive_stream_) {
|
|
|
|
|
test_->receiver_call_->DestroyVideoReceiveStream(video_receive_stream_);
|
|
|
|
|
video_receive_stream_ = nullptr;
|
|
|
|
|
}
|
2013-12-16 12:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StopSending() {
|
|
|
|
|
if (is_sending_receiving_) {
|
2014-04-24 11:13:21 +00:00
|
|
|
send_stream_->Stop();
|
2015-04-29 15:24:01 +02:00
|
|
|
if (video_receive_stream_) {
|
|
|
|
|
video_receive_stream_->Stop();
|
|
|
|
|
}
|
2013-12-16 12:24:44 +00:00
|
|
|
is_sending_receiving_ = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
BitrateEstimatorTest* test_;
|
|
|
|
|
bool is_sending_receiving_;
|
|
|
|
|
VideoSendStream* send_stream_;
|
2015-04-29 15:24:01 +02:00
|
|
|
VideoReceiveStream* video_receive_stream_;
|
2016-03-12 06:10:44 -08:00
|
|
|
std::unique_ptr<test::FrameGeneratorCapturer> frame_generator_capturer_;
|
2018-09-28 09:07:24 +02:00
|
|
|
|
|
|
|
|
test::FunctionVideoDecoderFactory decoder_factory_;
|
2013-12-16 12:24:44 +00:00
|
|
|
};
|
|
|
|
|
|
2015-12-04 16:13:05 +01:00
|
|
|
LogObserver receiver_log_;
|
2016-03-12 06:10:44 -08:00
|
|
|
std::unique_ptr<test::DirectTransport> send_transport_;
|
|
|
|
|
std::unique_ptr<test::DirectTransport> receive_transport_;
|
2013-12-16 12:24:44 +00:00
|
|
|
VideoReceiveStream::Config receive_config_;
|
|
|
|
|
std::vector<Stream*> streams_;
|
|
|
|
|
};
|
|
|
|
|
|
2015-07-06 10:50:47 +02:00
|
|
|
static const char* kAbsSendTimeLog =
|
|
|
|
|
"RemoteBitrateEstimatorAbsSendTime: Instantiating.";
|
|
|
|
|
static const char* kSingleStreamLog =
|
|
|
|
|
"RemoteBitrateEstimatorSingleStream: Instantiating.";
|
|
|
|
|
|
2015-04-29 15:24:01 +02:00
|
|
|
TEST_F(BitrateEstimatorTest, InstantiatesTOFPerDefaultForVideo) {
|
2017-08-22 04:02:52 -07:00
|
|
|
task_queue_.SendTask([this]() {
|
2018-07-13 09:49:00 +02:00
|
|
|
GetVideoSendConfig()->rtp.extensions.push_back(
|
2017-08-22 04:02:52 -07:00
|
|
|
RtpExtension(RtpExtension::kTimestampOffsetUri, kTOFExtensionId));
|
|
|
|
|
receiver_log_.PushExpectedLogLine(kSingleStreamLog);
|
|
|
|
|
receiver_log_.PushExpectedLogLine(kSingleStreamLog);
|
|
|
|
|
streams_.push_back(new Stream(this));
|
|
|
|
|
});
|
2015-12-10 13:02:50 +01:00
|
|
|
EXPECT_TRUE(receiver_log_.Wait());
|
2013-12-16 12:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
2015-04-29 15:24:01 +02:00
|
|
|
TEST_F(BitrateEstimatorTest, ImmediatelySwitchToASTForVideo) {
|
2017-08-22 04:02:52 -07:00
|
|
|
task_queue_.SendTask([this]() {
|
2018-07-13 09:49:00 +02:00
|
|
|
GetVideoSendConfig()->rtp.extensions.push_back(
|
2017-08-22 04:02:52 -07:00
|
|
|
RtpExtension(RtpExtension::kAbsSendTimeUri, kASTExtensionId));
|
|
|
|
|
receiver_log_.PushExpectedLogLine(kSingleStreamLog);
|
|
|
|
|
receiver_log_.PushExpectedLogLine(kSingleStreamLog);
|
|
|
|
|
receiver_log_.PushExpectedLogLine("Switching to absolute send time RBE.");
|
|
|
|
|
receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
|
|
|
|
|
streams_.push_back(new Stream(this));
|
|
|
|
|
});
|
2015-12-10 13:02:50 +01:00
|
|
|
EXPECT_TRUE(receiver_log_.Wait());
|
2015-04-29 15:24:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(BitrateEstimatorTest, SwitchesToASTForVideo) {
|
2017-08-22 04:02:52 -07:00
|
|
|
task_queue_.SendTask([this]() {
|
2018-07-13 09:49:00 +02:00
|
|
|
GetVideoSendConfig()->rtp.extensions.push_back(
|
2017-08-22 04:02:52 -07:00
|
|
|
RtpExtension(RtpExtension::kTimestampOffsetUri, kTOFExtensionId));
|
|
|
|
|
receiver_log_.PushExpectedLogLine(kSingleStreamLog);
|
|
|
|
|
receiver_log_.PushExpectedLogLine(kSingleStreamLog);
|
|
|
|
|
streams_.push_back(new Stream(this));
|
|
|
|
|
});
|
2015-12-10 13:02:50 +01:00
|
|
|
EXPECT_TRUE(receiver_log_.Wait());
|
2013-12-16 12:24:44 +00:00
|
|
|
|
2017-08-22 04:02:52 -07:00
|
|
|
task_queue_.SendTask([this]() {
|
2018-07-13 09:49:00 +02:00
|
|
|
GetVideoSendConfig()->rtp.extensions[0] =
|
2017-08-22 04:02:52 -07:00
|
|
|
RtpExtension(RtpExtension::kAbsSendTimeUri, kASTExtensionId);
|
|
|
|
|
receiver_log_.PushExpectedLogLine("Switching to absolute send time RBE.");
|
|
|
|
|
receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
|
|
|
|
|
streams_.push_back(new Stream(this));
|
|
|
|
|
});
|
2015-12-10 13:02:50 +01:00
|
|
|
EXPECT_TRUE(receiver_log_.Wait());
|
2013-12-16 12:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
2016-04-22 10:52:40 -07:00
|
|
|
// This test is flaky. See webrtc:5790.
|
|
|
|
|
TEST_F(BitrateEstimatorTest, DISABLED_SwitchesToASTThenBackToTOFForVideo) {
|
2017-08-22 04:02:52 -07:00
|
|
|
task_queue_.SendTask([this]() {
|
2018-07-13 09:49:00 +02:00
|
|
|
GetVideoSendConfig()->rtp.extensions.push_back(
|
2017-08-22 04:02:52 -07:00
|
|
|
RtpExtension(RtpExtension::kTimestampOffsetUri, kTOFExtensionId));
|
|
|
|
|
receiver_log_.PushExpectedLogLine(kSingleStreamLog);
|
|
|
|
|
receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
|
|
|
|
|
receiver_log_.PushExpectedLogLine(kSingleStreamLog);
|
|
|
|
|
streams_.push_back(new Stream(this));
|
|
|
|
|
});
|
2015-12-10 13:02:50 +01:00
|
|
|
EXPECT_TRUE(receiver_log_.Wait());
|
2013-12-16 12:24:44 +00:00
|
|
|
|
2017-08-22 04:02:52 -07:00
|
|
|
task_queue_.SendTask([this]() {
|
2018-07-13 09:49:00 +02:00
|
|
|
GetVideoSendConfig()->rtp.extensions[0] =
|
2017-08-22 04:02:52 -07:00
|
|
|
RtpExtension(RtpExtension::kAbsSendTimeUri, kASTExtensionId);
|
|
|
|
|
receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
|
|
|
|
|
receiver_log_.PushExpectedLogLine("Switching to absolute send time RBE.");
|
|
|
|
|
streams_.push_back(new Stream(this));
|
|
|
|
|
});
|
2015-12-10 13:02:50 +01:00
|
|
|
EXPECT_TRUE(receiver_log_.Wait());
|
2013-12-16 12:24:44 +00:00
|
|
|
|
2017-08-22 04:02:52 -07:00
|
|
|
task_queue_.SendTask([this]() {
|
2018-07-13 09:49:00 +02:00
|
|
|
GetVideoSendConfig()->rtp.extensions[0] =
|
2017-08-22 04:02:52 -07:00
|
|
|
RtpExtension(RtpExtension::kTimestampOffsetUri, kTOFExtensionId);
|
|
|
|
|
receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
|
|
|
|
|
receiver_log_.PushExpectedLogLine(
|
|
|
|
|
"WrappingBitrateEstimator: Switching to transmission time offset RBE.");
|
|
|
|
|
streams_.push_back(new Stream(this));
|
|
|
|
|
streams_[0]->StopSending();
|
|
|
|
|
streams_[1]->StopSending();
|
|
|
|
|
});
|
2015-12-10 13:02:50 +01:00
|
|
|
EXPECT_TRUE(receiver_log_.Wait());
|
2013-12-16 12:24:44 +00:00
|
|
|
}
|
|
|
|
|
} // namespace webrtc
|