Add ability to pass factory for RtpTransportControllerSend to PeerConnectionFactoryDependencies.
This way we can have custom implementation of RtpTransportControllerSendInterface and pass it properly to Call.
Call relies on RtpTransportControllerSendInterface already so this is natural way to customize RTP related classes.
If there is custom factory present in dependencies it will be used, otherwise default factory will be used.
Intention behind this change is to have ability to have custom QoS with custom parameters.
Bug: webrtc:12778
Change-Id: I5b88957025621ef4bcd63eaa98c218ad213da9c8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217769
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@nvidia.com>
Cr-Commit-Position: refs/heads/master@{#34181}
diff --git a/api/BUILD.gn b/api/BUILD.gn
index 6a04f4f..e1c45e2 100644
--- a/api/BUILD.gn
+++ b/api/BUILD.gn
@@ -29,7 +29,10 @@
rtc_source_set("callfactory_api") {
visibility = [ "*" ]
sources = [ "call/call_factory_interface.h" ]
- deps = [ "../rtc_base/system:rtc_export" ]
+ deps = [
+ "../call:rtp_interfaces",
+ "../rtc_base/system:rtc_export",
+ ]
}
if (!build_with_chromium) {
@@ -172,6 +175,7 @@
":rtp_transceiver_direction",
":scoped_refptr",
":sequence_checker",
+ "../call:rtp_interfaces",
"../rtc_base:network_constants",
"adaptation:resource_adaptation_api",
"audio:audio_mixer_api",
@@ -1053,6 +1057,7 @@
":time_controller",
"../call",
"../call:call_interfaces",
+ "../call:rtp_interfaces",
"../test/time_controller",
]
}
diff --git a/api/DEPS b/api/DEPS
index afec84d..bfa989f 100644
--- a/api/DEPS
+++ b/api/DEPS
@@ -42,6 +42,11 @@
specific_include_rules = {
# Some internal headers are allowed even in API headers:
+
+ "call_factory_interface\.h": [
+ "+call/rtp_transport_controller_send_factory_interface.h",
+ ],
+
".*\.h": [
"+rtc_base/checks.h",
"+rtc_base/system/rtc_export.h",
@@ -126,6 +131,7 @@
],
"peer_connection_interface\.h": [
+ "+call/rtp_transport_controller_send_factory_interface.h",
"+media/base/media_config.h",
"+media/base/media_engine.h",
"+p2p/base/port.h",
diff --git a/api/peer_connection_interface.h b/api/peer_connection_interface.h
index e815f19..ad3f70c 100644
--- a/api/peer_connection_interface.h
+++ b/api/peer_connection_interface.h
@@ -118,6 +118,7 @@
#include "api/transport/webrtc_key_value_config.h"
#include "api/turn_customizer.h"
#include "api/video/video_bitrate_allocator_factory.h"
+#include "call/rtp_transport_controller_send_factory_interface.h"
#include "media/base/media_config.h"
#include "media/base/media_engine.h"
// TODO(bugs.webrtc.org/7447): We plan to provide a way to let applications
@@ -1402,6 +1403,8 @@
std::unique_ptr<NetEqFactory> neteq_factory;
std::unique_ptr<SctpTransportFactoryInterface> sctp_factory;
std::unique_ptr<WebRtcKeyValueConfig> trials;
+ std::unique_ptr<RtpTransportControllerSendFactoryInterface>
+ transport_controller_send_factory;
};
// PeerConnectionFactoryInterface is the factory interface used for creating
diff --git a/api/test/create_time_controller.cc b/api/test/create_time_controller.cc
index a2c0cb7..f7faeaa 100644
--- a/api/test/create_time_controller.cc
+++ b/api/test/create_time_controller.cc
@@ -13,6 +13,8 @@
#include <memory>
#include "call/call.h"
+#include "call/rtp_transport_config.h"
+#include "call/rtp_transport_controller_send_factory_interface.h"
#include "test/time_controller/external_time_controller.h"
#include "test/time_controller/simulated_time_controller.h"
@@ -40,8 +42,13 @@
time_controller_->CreateProcessThread("CallModules"),
[this]() { module_thread_ = nullptr; });
}
+
+ RtpTransportConfig transportConfig = config.ExtractTransportConfig();
+
return Call::Create(config, time_controller_->GetClock(), module_thread_,
- time_controller_->CreateProcessThread("Pacer"));
+ config.rtp_transport_controller_send_factory->Create(
+ transportConfig, time_controller_->GetClock(),
+ time_controller_->CreateProcessThread("Pacer")));
}
private: