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>
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "call/call.h"
|
|
|
|
|
#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-10 13:02:50 +01:00
|
|
|
Callback() : done_(false, false) {}
|
2014-07-07 08:50:48 +00:00
|
|
|
|
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
|
|
|
}
|
|
|
|
|
if (expected_log_lines_.size() <= 0) {
|
|
|
|
|
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]() {
|
|
|
|
|
Call::Config config(event_log_.get());
|
|
|
|
|
receiver_call_.reset(Call::Create(config));
|
|
|
|
|
sender_call_.reset(Call::Create(config));
|
|
|
|
|
|
|
|
|
|
send_transport_.reset(new test::DirectTransport(
|
|
|
|
|
&task_queue_, sender_call_.get(), payload_type_map_));
|
|
|
|
|
send_transport_->SetReceiver(receiver_call_->Receiver());
|
|
|
|
|
receive_transport_.reset(new test::DirectTransport(
|
|
|
|
|
&task_queue_, receiver_call_.get(), payload_type_map_));
|
|
|
|
|
receive_transport_->SetReceiver(sender_call_->Receiver());
|
|
|
|
|
|
|
|
|
|
video_send_config_ = VideoSendStream::Config(send_transport_.get());
|
|
|
|
|
video_send_config_.rtp.ssrcs.push_back(kVideoSendSsrcs[0]);
|
|
|
|
|
// Encoders will be set separately per stream.
|
|
|
|
|
video_send_config_.encoder_settings.encoder = nullptr;
|
|
|
|
|
video_send_config_.encoder_settings.payload_name = "FAKE";
|
|
|
|
|
video_send_config_.encoder_settings.payload_type =
|
|
|
|
|
kFakeVideoSendPayloadType;
|
|
|
|
|
test::FillEncoderConfiguration(1, &video_encoder_config_);
|
|
|
|
|
|
|
|
|
|
receive_config_ = VideoReceiveStream::Config(receive_transport_.get());
|
|
|
|
|
// receive_config_.decoders will be set by every stream separately.
|
|
|
|
|
receive_config_.rtp.remote_ssrc = video_send_config_.rtp.ssrcs[0];
|
|
|
|
|
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]() {
|
|
|
|
|
std::for_each(streams_.begin(), streams_.end(),
|
|
|
|
|
std::mem_fun(&Stream::StopSending));
|
2013-12-16 12:24:44 +00:00
|
|
|
|
2017-08-22 04:02:52 -07:00
|
|
|
while (!streams_.empty()) {
|
|
|
|
|
delete streams_.back();
|
|
|
|
|
streams_.pop_back();
|
|
|
|
|
}
|
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
|
|
|
|
2017-08-22 04:02:52 -07:00
|
|
|
receiver_call_.reset();
|
|
|
|
|
sender_call_.reset();
|
|
|
|
|
});
|
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_(),
|
|
|
|
|
fake_encoder_(Clock::GetRealTimeClock()),
|
|
|
|
|
fake_decoder_() {
|
2015-12-21 03:14:00 -08:00
|
|
|
test_->video_send_config_.rtp.ssrcs[0]++;
|
|
|
|
|
test_->video_send_config_.encoder_settings.encoder = &fake_encoder_;
|
2014-06-06 10:49:19 +00:00
|
|
|
send_stream_ = test_->sender_call_->CreateVideoSendStream(
|
2016-09-01 01:17:40 -07:00
|
|
|
test_->video_send_config_.Copy(),
|
|
|
|
|
test_->video_encoder_config_.Copy());
|
2016-11-28 15:21:39 -08:00
|
|
|
RTC_DCHECK_EQ(1, test_->video_encoder_config_.number_of_streams);
|
2014-09-19 12:30:25 +00:00
|
|
|
frame_generator_capturer_.reset(test::FrameGeneratorCapturer::Create(
|
2016-10-02 23:45:26 -07:00
|
|
|
kDefaultWidth, kDefaultHeight, kDefaultFramerate,
|
2014-09-19 12:30:25 +00:00
|
|
|
Clock::GetRealTimeClock()));
|
2016-11-01 11:45:46 -07:00
|
|
|
send_stream_->SetSource(
|
|
|
|
|
frame_generator_capturer_.get(),
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
VideoSendStream::DegradationPreference::kMaintainFramerate);
|
2014-04-24 11:13:21 +00:00
|
|
|
send_stream_->Start();
|
2013-12-16 12:24:44 +00:00
|
|
|
frame_generator_capturer_->Start();
|
|
|
|
|
|
2016-11-08 03:44:54 -08:00
|
|
|
VideoReceiveStream::Decoder decoder;
|
|
|
|
|
decoder.decoder = &fake_decoder_;
|
|
|
|
|
decoder.payload_type =
|
|
|
|
|
test_->video_send_config_.encoder_settings.payload_type;
|
|
|
|
|
decoder.payload_name =
|
|
|
|
|
test_->video_send_config_.encoder_settings.payload_name;
|
|
|
|
|
test_->receive_config_.decoders.clear();
|
|
|
|
|
test_->receive_config_.decoders.push_back(decoder);
|
|
|
|
|
test_->receive_config_.rtp.remote_ssrc =
|
|
|
|
|
test_->video_send_config_.rtp.ssrcs[0];
|
|
|
|
|
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_) {
|
|
|
|
|
frame_generator_capturer_->Stop();
|
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_;
|
2013-12-16 12:24:44 +00:00
|
|
|
test::FakeEncoder fake_encoder_;
|
|
|
|
|
test::FakeDecoder fake_decoder_;
|
|
|
|
|
};
|
|
|
|
|
|
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_;
|
|
|
|
|
std::unique_ptr<Call> sender_call_;
|
|
|
|
|
std::unique_ptr<Call> receiver_call_;
|
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]() {
|
|
|
|
|
video_send_config_.rtp.extensions.push_back(
|
|
|
|
|
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]() {
|
|
|
|
|
video_send_config_.rtp.extensions.push_back(
|
|
|
|
|
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]() {
|
|
|
|
|
video_send_config_.rtp.extensions.push_back(
|
|
|
|
|
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]() {
|
|
|
|
|
video_send_config_.rtp.extensions[0] =
|
|
|
|
|
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]() {
|
|
|
|
|
video_send_config_.rtp.extensions.push_back(
|
|
|
|
|
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]() {
|
|
|
|
|
video_send_config_.rtp.extensions[0] =
|
|
|
|
|
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]() {
|
|
|
|
|
video_send_config_.rtp.extensions[0] =
|
|
|
|
|
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
|