Inject network state predictor into video quality test.
Bug: webrtc:10492
Change-Id: Ia2ae5de1019ac4ab89e54e261b1d94a482334ee9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133161
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27681}
diff --git a/api/test/video_quality_test_fixture.h b/api/test/video_quality_test_fixture.h
index 570e406..e563c51 100644
--- a/api/test/video_quality_test_fixture.h
+++ b/api/test/video_quality_test_fixture.h
@@ -19,6 +19,7 @@
#include "api/bitrate_constraints.h"
#include "api/fec_controller.h"
#include "api/media_types.h"
+#include "api/network_state_predictor.h"
#include "api/test/simulated_network.h"
#include "api/video_codecs/video_encoder_config.h"
@@ -120,6 +121,8 @@
std::unique_ptr<NetworkBehaviorInterface> receiver_network;
std::unique_ptr<FecControllerFactoryInterface> fec_controller_factory;
+ std::unique_ptr<NetworkStatePredictorFactoryInterface>
+ network_state_predictor_factory;
};
virtual ~VideoQualityTestFixtureInterface() = default;
diff --git a/test/call_test.cc b/test/call_test.cc
index 8d8a9d3..8c9a62f 100644
--- a/test/call_test.cc
+++ b/test/call_test.cc
@@ -215,7 +215,10 @@
}
void CallTest::CreateSenderCall(const Call::Config& config) {
- sender_call_.reset(Call::Create(config));
+ auto sender_config = config;
+ sender_config.network_state_predictor_factory =
+ network_state_predictor_factory_.get();
+ sender_call_.reset(Call::Create(sender_config));
}
void CallTest::CreateReceiverCall(const Call::Config& config) {
diff --git a/test/call_test.h b/test/call_test.h
index dcdb03b..99f37c52 100644
--- a/test/call_test.h
+++ b/test/call_test.h
@@ -200,6 +200,8 @@
DegradationPreference::MAINTAIN_FRAMERATE;
std::unique_ptr<FecControllerFactoryInterface> fec_controller_factory_;
+ std::unique_ptr<NetworkStatePredictorFactoryInterface>
+ network_state_predictor_factory_;
test::FunctionVideoEncoderFactory fake_encoder_factory_;
int fake_encoder_max_bitrate_ = -1;
diff --git a/video/video_quality_test.cc b/video/video_quality_test.cc
index 10f9699..1b13980 100644
--- a/video/video_quality_test.cc
+++ b/video/video_quality_test.cc
@@ -361,6 +361,8 @@
fec_controller_factory_ =
std::move(injection_components_->fec_controller_factory);
+ network_state_predictor_factory_ =
+ std::move(injection_components_->network_state_predictor_factory);
}
VideoQualityTest::Params::Params()