Adds BBR field trial to CallTest.

Bug: webrtc:8415
Change-Id: Ie0db059390fe4e079f1faa90f74f4ef53b192b6f
Reviewed-on: https://webrtc-review.googlesource.com/92383
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24189}
This commit is contained in:
Sebastian Jansson
2018-08-03 13:25:17 +02:00
committed by Commit Bot
parent 3dc427fe34
commit 50eb4c44ad
4 changed files with 20 additions and 2 deletions

View File

@ -570,6 +570,7 @@ rtc_source_set("test_common") {
"../modules/audio_device:mock_audio_device",
"../modules/audio_mixer:audio_mixer_impl",
"../modules/audio_processing",
"../modules/congestion_controller/bbr",
"../modules/rtp_rtcp",
"../modules/rtp_rtcp:mock_rtp_rtcp",
"../modules/rtp_rtcp:rtp_rtcp_format",
@ -583,6 +584,7 @@ rtc_source_set("test_common") {
"../rtc_base:rtc_base_approved",
"../rtc_base:rtc_task_queue",
"../rtc_base:sequenced_task_checker",
"../rtc_base/experiments:congestion_controller_experiment",
"../system_wrappers",
"../system_wrappers:field_trial_api",
"../system_wrappers:runtime_enabled_features_api",

View File

@ -11,6 +11,7 @@ include_rules = [
"+modules/audio_device",
"+modules/audio_mixer",
"+modules/audio_processing",
"+modules/congestion_controller/bbr",
"+modules/rtp_rtcp",
"+modules/video_capture",
"+modules/video_coding",

View File

@ -18,8 +18,10 @@
#include "api/video_codecs/video_encoder_config.h"
#include "call/rtp_transport_controller_send.h"
#include "modules/audio_mixer/audio_mixer_impl.h"
#include "modules/congestion_controller/bbr/bbr_factory.h"
#include "rtc_base/checks.h"
#include "rtc_base/event.h"
#include "rtc_base/experiments/congestion_controller_experiment.h"
#include "test/fake_encoder.h"
#include "test/testsupport/fileutils.h"
@ -37,6 +39,7 @@ CallTest::CallTest()
sender_call_transport_controller_(nullptr),
audio_send_config_(nullptr),
audio_send_stream_(nullptr),
bbr_network_controller_factory_(new BbrNetworkControllerFactory()),
fake_encoder_factory_([this]() {
auto encoder = absl::make_unique<test::FakeEncoder>(clock_);
encoder->SetMaxBitrate(fake_encoder_max_bitrate_);
@ -187,10 +190,20 @@ void CallTest::CreateSenderCall() {
}
void CallTest::CreateSenderCall(const Call::Config& config) {
NetworkControllerFactoryInterface* injected_factory =
config.network_controller_factory;
if (!injected_factory) {
if (CongestionControllerExperiment::BbrControllerEnabled()) {
RTC_LOG(LS_INFO) << "Using BBR network controller factory";
injected_factory = bbr_network_controller_factory_.get();
} else {
RTC_LOG(LS_INFO) << "Using default network controller factory";
}
}
std::unique_ptr<RtpTransportControllerSend> controller_send =
absl::make_unique<RtpTransportControllerSend>(
Clock::GetRealTimeClock(), config.event_log,
config.network_controller_factory, config.bitrate_config);
Clock::GetRealTimeClock(), config.event_log, injected_factory,
config.bitrate_config);
sender_call_transport_controller_ = controller_send.get();
sender_call_.reset(Call::Create(config, std::move(controller_send)));
}

View File

@ -195,6 +195,8 @@ class CallTest : public ::testing::Test {
DegradationPreference::MAINTAIN_FRAMERATE;
std::unique_ptr<FecControllerFactoryInterface> fec_controller_factory_;
std::unique_ptr<NetworkControllerFactoryInterface>
bbr_network_controller_factory_;
test::FunctionVideoEncoderFactory fake_encoder_factory_;
int fake_encoder_max_bitrate_ = -1;