Add support of overriding network simulation in video quality tests.
Add ability to provide custom implementation of NetworkSimulatedInterface for sender and receiver network in VideoQualityTestFixtureInterface, passing them to the factory method. Also unite this mechanism with FecControllerFactoryInterface injection. Bug: webrtc:9630 Change-Id: I79259113e0fc00d933b73ca299afa836a4cd19d2 Reviewed-on: https://webrtc-review.googlesource.com/96280 Commit-Queue: Artem Titov <titovartem@webrtc.org> Reviewed-by: Patrik Höglund <phoglund@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24476}
This commit is contained in:
@ -26,7 +26,16 @@ CreateVideoQualityTestFixture() {
|
||||
std::unique_ptr<VideoQualityTestFixtureInterface>
|
||||
CreateVideoQualityTestFixture(
|
||||
std::unique_ptr<FecControllerFactoryInterface> fec_controller_factory) {
|
||||
return absl::make_unique<VideoQualityTest>(std::move(fec_controller_factory));
|
||||
auto components = absl::make_unique<
|
||||
VideoQualityTestFixtureInterface::InjectionComponents>();
|
||||
components->fec_controller_factory = std::move(fec_controller_factory);
|
||||
return absl::make_unique<VideoQualityTest>(std::move(components));
|
||||
}
|
||||
|
||||
std::unique_ptr<VideoQualityTestFixtureInterface> CreateVideoQualityTestFixture(
|
||||
std::unique_ptr<VideoQualityTestFixtureInterface::InjectionComponents>
|
||||
components) {
|
||||
return absl::make_unique<VideoQualityTest>(std::move(components));
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -24,6 +24,9 @@ std::unique_ptr<VideoQualityTestFixtureInterface>
|
||||
CreateVideoQualityTestFixture(
|
||||
std::unique_ptr<FecControllerFactoryInterface> fec_controller_factory);
|
||||
|
||||
}
|
||||
std::unique_ptr<VideoQualityTestFixtureInterface> CreateVideoQualityTestFixture(
|
||||
std::unique_ptr<VideoQualityTestFixtureInterface::InjectionComponents>
|
||||
components);
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_CREATE_VIDEO_QUALITY_TEST_FIXTURE_H_
|
||||
|
@ -84,8 +84,10 @@ class VideoQualityTestFixtureInterface {
|
||||
// it is just configuration, that will be passed to default implementation
|
||||
// of simulation layer.
|
||||
DefaultNetworkSimulationConfig pipe;
|
||||
// Config for default simulation implementation. May be nullopt in that
|
||||
// case, a default config will be used.
|
||||
// Config for default simulation implementation. Must be nullopt if
|
||||
// `sender_network` and `receiver_network` in InjectionComponents are
|
||||
// non-null. May be nullopt even if `sender_network` and `receiver_network`
|
||||
// are null; in that case, a default config will be used.
|
||||
absl::optional<DefaultNetworkSimulationConfig> config;
|
||||
struct SS { // Spatial scalability.
|
||||
std::vector<VideoStream> streams; // If empty, one stream is assumed.
|
||||
@ -105,6 +107,21 @@ class VideoQualityTestFixtureInterface {
|
||||
} logging;
|
||||
};
|
||||
|
||||
// Contains objects, that will be injected on different layers of test
|
||||
// framework to override the behavior of system parts.
|
||||
struct InjectionComponents {
|
||||
InjectionComponents();
|
||||
~InjectionComponents();
|
||||
|
||||
// Simulations of sender and receiver networks. They must either both be
|
||||
// null (in which case `config` from Params is used), or both be non-null
|
||||
// (in which case `config` from Params must be nullopt).
|
||||
std::unique_ptr<NetworkSimulationInterface> sender_network;
|
||||
std::unique_ptr<NetworkSimulationInterface> receiver_network;
|
||||
|
||||
std::unique_ptr<FecControllerFactoryInterface> fec_controller_factory;
|
||||
};
|
||||
|
||||
virtual ~VideoQualityTestFixtureInterface() = default;
|
||||
|
||||
virtual void RunWithAnalyzer(const Params& params) = 0;
|
||||
|
Reference in New Issue
Block a user