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}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
40f1a06ca7
commit
504fc192d0
@ -29,7 +29,10 @@ rtc_source_set("call_api") {
|
|||||||
rtc_source_set("callfactory_api") {
|
rtc_source_set("callfactory_api") {
|
||||||
visibility = [ "*" ]
|
visibility = [ "*" ]
|
||||||
sources = [ "call/call_factory_interface.h" ]
|
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) {
|
if (!build_with_chromium) {
|
||||||
@ -172,6 +175,7 @@ rtc_library("libjingle_peerconnection_api") {
|
|||||||
":rtp_transceiver_direction",
|
":rtp_transceiver_direction",
|
||||||
":scoped_refptr",
|
":scoped_refptr",
|
||||||
":sequence_checker",
|
":sequence_checker",
|
||||||
|
"../call:rtp_interfaces",
|
||||||
"../rtc_base:network_constants",
|
"../rtc_base:network_constants",
|
||||||
"adaptation:resource_adaptation_api",
|
"adaptation:resource_adaptation_api",
|
||||||
"audio:audio_mixer_api",
|
"audio:audio_mixer_api",
|
||||||
@ -1053,6 +1057,7 @@ if (rtc_include_tests) {
|
|||||||
":time_controller",
|
":time_controller",
|
||||||
"../call",
|
"../call",
|
||||||
"../call:call_interfaces",
|
"../call:call_interfaces",
|
||||||
|
"../call:rtp_interfaces",
|
||||||
"../test/time_controller",
|
"../test/time_controller",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
6
api/DEPS
6
api/DEPS
@ -42,6 +42,11 @@ include_rules = [
|
|||||||
|
|
||||||
specific_include_rules = {
|
specific_include_rules = {
|
||||||
# Some internal headers are allowed even in API headers:
|
# Some internal headers are allowed even in API headers:
|
||||||
|
|
||||||
|
"call_factory_interface\.h": [
|
||||||
|
"+call/rtp_transport_controller_send_factory_interface.h",
|
||||||
|
],
|
||||||
|
|
||||||
".*\.h": [
|
".*\.h": [
|
||||||
"+rtc_base/checks.h",
|
"+rtc_base/checks.h",
|
||||||
"+rtc_base/system/rtc_export.h",
|
"+rtc_base/system/rtc_export.h",
|
||||||
@ -126,6 +131,7 @@ specific_include_rules = {
|
|||||||
],
|
],
|
||||||
|
|
||||||
"peer_connection_interface\.h": [
|
"peer_connection_interface\.h": [
|
||||||
|
"+call/rtp_transport_controller_send_factory_interface.h",
|
||||||
"+media/base/media_config.h",
|
"+media/base/media_config.h",
|
||||||
"+media/base/media_engine.h",
|
"+media/base/media_engine.h",
|
||||||
"+p2p/base/port.h",
|
"+p2p/base/port.h",
|
||||||
|
@ -118,6 +118,7 @@
|
|||||||
#include "api/transport/webrtc_key_value_config.h"
|
#include "api/transport/webrtc_key_value_config.h"
|
||||||
#include "api/turn_customizer.h"
|
#include "api/turn_customizer.h"
|
||||||
#include "api/video/video_bitrate_allocator_factory.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_config.h"
|
||||||
#include "media/base/media_engine.h"
|
#include "media/base/media_engine.h"
|
||||||
// TODO(bugs.webrtc.org/7447): We plan to provide a way to let applications
|
// TODO(bugs.webrtc.org/7447): We plan to provide a way to let applications
|
||||||
@ -1402,6 +1403,8 @@ struct RTC_EXPORT PeerConnectionFactoryDependencies final {
|
|||||||
std::unique_ptr<NetEqFactory> neteq_factory;
|
std::unique_ptr<NetEqFactory> neteq_factory;
|
||||||
std::unique_ptr<SctpTransportFactoryInterface> sctp_factory;
|
std::unique_ptr<SctpTransportFactoryInterface> sctp_factory;
|
||||||
std::unique_ptr<WebRtcKeyValueConfig> trials;
|
std::unique_ptr<WebRtcKeyValueConfig> trials;
|
||||||
|
std::unique_ptr<RtpTransportControllerSendFactoryInterface>
|
||||||
|
transport_controller_send_factory;
|
||||||
};
|
};
|
||||||
|
|
||||||
// PeerConnectionFactoryInterface is the factory interface used for creating
|
// PeerConnectionFactoryInterface is the factory interface used for creating
|
||||||
|
@ -13,6 +13,8 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "call/call.h"
|
#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/external_time_controller.h"
|
||||||
#include "test/time_controller/simulated_time_controller.h"
|
#include "test/time_controller/simulated_time_controller.h"
|
||||||
|
|
||||||
@ -40,8 +42,13 @@ std::unique_ptr<CallFactoryInterface> CreateTimeControllerBasedCallFactory(
|
|||||||
time_controller_->CreateProcessThread("CallModules"),
|
time_controller_->CreateProcessThread("CallModules"),
|
||||||
[this]() { module_thread_ = nullptr; });
|
[this]() { module_thread_ = nullptr; });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RtpTransportConfig transportConfig = config.ExtractTransportConfig();
|
||||||
|
|
||||||
return Call::Create(config, time_controller_->GetClock(), module_thread_,
|
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:
|
private:
|
||||||
|
@ -98,22 +98,29 @@ rtc_library("rtp_interfaces") {
|
|||||||
"rtp_config.h",
|
"rtp_config.h",
|
||||||
"rtp_packet_sink_interface.h",
|
"rtp_packet_sink_interface.h",
|
||||||
"rtp_stream_receiver_controller_interface.h",
|
"rtp_stream_receiver_controller_interface.h",
|
||||||
|
"rtp_transport_config.h",
|
||||||
|
"rtp_transport_controller_send_factory_interface.h",
|
||||||
"rtp_transport_controller_send_interface.h",
|
"rtp_transport_controller_send_interface.h",
|
||||||
]
|
]
|
||||||
deps = [
|
deps = [
|
||||||
"../api:array_view",
|
"../api:array_view",
|
||||||
"../api:fec_controller_api",
|
"../api:fec_controller_api",
|
||||||
"../api:frame_transformer_interface",
|
"../api:frame_transformer_interface",
|
||||||
|
"../api:network_state_predictor_api",
|
||||||
"../api:rtp_headers",
|
"../api:rtp_headers",
|
||||||
"../api:rtp_parameters",
|
"../api:rtp_parameters",
|
||||||
"../api/crypto:options",
|
"../api/crypto:options",
|
||||||
"../api/rtc_event_log",
|
"../api/rtc_event_log",
|
||||||
"../api/transport:bitrate_settings",
|
"../api/transport:bitrate_settings",
|
||||||
|
"../api/transport:network_control",
|
||||||
|
"../api/transport:webrtc_key_value_config",
|
||||||
"../api/units:timestamp",
|
"../api/units:timestamp",
|
||||||
"../common_video:frame_counts",
|
"../common_video:frame_counts",
|
||||||
"../modules/rtp_rtcp:rtp_rtcp_format",
|
"../modules/rtp_rtcp:rtp_rtcp_format",
|
||||||
|
"../modules/utility",
|
||||||
"../rtc_base:checks",
|
"../rtc_base:checks",
|
||||||
"../rtc_base:rtc_base_approved",
|
"../rtc_base:rtc_base_approved",
|
||||||
|
"../rtc_base:rtc_task_queue",
|
||||||
]
|
]
|
||||||
absl_deps = [
|
absl_deps = [
|
||||||
"//third_party/abseil-cpp/absl/algorithm:container",
|
"//third_party/abseil-cpp/absl/algorithm:container",
|
||||||
@ -150,6 +157,7 @@ rtc_library("rtp_sender") {
|
|||||||
"rtp_payload_params.h",
|
"rtp_payload_params.h",
|
||||||
"rtp_transport_controller_send.cc",
|
"rtp_transport_controller_send.cc",
|
||||||
"rtp_transport_controller_send.h",
|
"rtp_transport_controller_send.h",
|
||||||
|
"rtp_transport_controller_send_factory.h",
|
||||||
"rtp_video_sender.cc",
|
"rtp_video_sender.cc",
|
||||||
"rtp_video_sender.h",
|
"rtp_video_sender.h",
|
||||||
"rtp_video_sender_interface.h",
|
"rtp_video_sender_interface.h",
|
||||||
|
27
call/call.cc
27
call/call.cc
@ -33,6 +33,7 @@
|
|||||||
#include "call/receive_time_calculator.h"
|
#include "call/receive_time_calculator.h"
|
||||||
#include "call/rtp_stream_receiver_controller.h"
|
#include "call/rtp_stream_receiver_controller.h"
|
||||||
#include "call/rtp_transport_controller_send.h"
|
#include "call/rtp_transport_controller_send.h"
|
||||||
|
#include "call/rtp_transport_controller_send_factory.h"
|
||||||
#include "call/version.h"
|
#include "call/version.h"
|
||||||
#include "logging/rtc_event_log/events/rtc_event_audio_receive_stream_config.h"
|
#include "logging/rtc_event_log/events/rtc_event_audio_receive_stream_config.h"
|
||||||
#include "logging/rtc_event_log/events/rtc_event_rtcp_packet_incoming.h"
|
#include "logging/rtc_event_log/events/rtc_event_rtcp_packet_incoming.h"
|
||||||
@ -519,11 +520,6 @@ Call* Call::Create(const Call::Config& config) {
|
|||||||
rtc::scoped_refptr<SharedModuleThread> call_thread =
|
rtc::scoped_refptr<SharedModuleThread> call_thread =
|
||||||
SharedModuleThread::Create(ProcessThread::Create("ModuleProcessThread"),
|
SharedModuleThread::Create(ProcessThread::Create("ModuleProcessThread"),
|
||||||
nullptr);
|
nullptr);
|
||||||
return Create(config, std::move(call_thread));
|
|
||||||
}
|
|
||||||
|
|
||||||
Call* Call::Create(const Call::Config& config,
|
|
||||||
rtc::scoped_refptr<SharedModuleThread> call_thread) {
|
|
||||||
return Create(config, Clock::GetRealTimeClock(), std::move(call_thread),
|
return Create(config, Clock::GetRealTimeClock(), std::move(call_thread),
|
||||||
ProcessThread::Create("PacerThread"));
|
ProcessThread::Create("PacerThread"));
|
||||||
}
|
}
|
||||||
@ -533,15 +529,28 @@ Call* Call::Create(const Call::Config& config,
|
|||||||
rtc::scoped_refptr<SharedModuleThread> call_thread,
|
rtc::scoped_refptr<SharedModuleThread> call_thread,
|
||||||
std::unique_ptr<ProcessThread> pacer_thread) {
|
std::unique_ptr<ProcessThread> pacer_thread) {
|
||||||
RTC_DCHECK(config.task_queue_factory);
|
RTC_DCHECK(config.task_queue_factory);
|
||||||
|
|
||||||
|
RtpTransportControllerSendFactory transport_controller_factory_;
|
||||||
|
|
||||||
|
RtpTransportConfig transportConfig = config.ExtractTransportConfig();
|
||||||
|
|
||||||
return new internal::Call(
|
return new internal::Call(
|
||||||
clock, config,
|
clock, config,
|
||||||
std::make_unique<RtpTransportControllerSend>(
|
transport_controller_factory_.Create(transportConfig, clock,
|
||||||
clock, config.event_log, config.network_state_predictor_factory,
|
std::move(pacer_thread)),
|
||||||
config.network_controller_factory, config.bitrate_config,
|
|
||||||
std::move(pacer_thread), config.task_queue_factory, config.trials),
|
|
||||||
std::move(call_thread), config.task_queue_factory);
|
std::move(call_thread), config.task_queue_factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Call* Call::Create(const Call::Config& config,
|
||||||
|
Clock* clock,
|
||||||
|
rtc::scoped_refptr<SharedModuleThread> call_thread,
|
||||||
|
std::unique_ptr<RtpTransportControllerSendInterface>
|
||||||
|
transportControllerSend) {
|
||||||
|
RTC_DCHECK(config.task_queue_factory);
|
||||||
|
return new internal::Call(clock, config, std::move(transportControllerSend),
|
||||||
|
std::move(call_thread), config.task_queue_factory);
|
||||||
|
}
|
||||||
|
|
||||||
class SharedModuleThread::Impl {
|
class SharedModuleThread::Impl {
|
||||||
public:
|
public:
|
||||||
Impl(std::unique_ptr<ProcessThread> process_thread,
|
Impl(std::unique_ptr<ProcessThread> process_thread,
|
||||||
|
@ -83,12 +83,15 @@ class Call {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static Call* Create(const Call::Config& config);
|
static Call* Create(const Call::Config& config);
|
||||||
static Call* Create(const Call::Config& config,
|
|
||||||
rtc::scoped_refptr<SharedModuleThread> call_thread);
|
|
||||||
static Call* Create(const Call::Config& config,
|
static Call* Create(const Call::Config& config,
|
||||||
Clock* clock,
|
Clock* clock,
|
||||||
rtc::scoped_refptr<SharedModuleThread> call_thread,
|
rtc::scoped_refptr<SharedModuleThread> call_thread,
|
||||||
std::unique_ptr<ProcessThread> pacer_thread);
|
std::unique_ptr<ProcessThread> pacer_thread);
|
||||||
|
static Call* Create(const Call::Config& config,
|
||||||
|
Clock* clock,
|
||||||
|
rtc::scoped_refptr<SharedModuleThread> call_thread,
|
||||||
|
std::unique_ptr<RtpTransportControllerSendInterface>
|
||||||
|
transportControllerSend);
|
||||||
|
|
||||||
virtual AudioSendStream* CreateAudioSendStream(
|
virtual AudioSendStream* CreateAudioSendStream(
|
||||||
const AudioSendStream::Config& config) = 0;
|
const AudioSendStream::Config& config) = 0;
|
||||||
|
@ -22,6 +22,19 @@ CallConfig::CallConfig(RtcEventLog* event_log,
|
|||||||
|
|
||||||
CallConfig::CallConfig(const CallConfig& config) = default;
|
CallConfig::CallConfig(const CallConfig& config) = default;
|
||||||
|
|
||||||
|
RtpTransportConfig CallConfig::ExtractTransportConfig() const {
|
||||||
|
RtpTransportConfig transportConfig;
|
||||||
|
transportConfig.bitrate_config = bitrate_config;
|
||||||
|
transportConfig.event_log = event_log;
|
||||||
|
transportConfig.network_controller_factory = network_controller_factory;
|
||||||
|
transportConfig.network_state_predictor_factory =
|
||||||
|
network_state_predictor_factory;
|
||||||
|
transportConfig.task_queue_factory = task_queue_factory;
|
||||||
|
transportConfig.trials = trials;
|
||||||
|
|
||||||
|
return transportConfig;
|
||||||
|
}
|
||||||
|
|
||||||
CallConfig::~CallConfig() = default;
|
CallConfig::~CallConfig() = default;
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
#include "api/transport/network_control.h"
|
#include "api/transport/network_control.h"
|
||||||
#include "api/transport/webrtc_key_value_config.h"
|
#include "api/transport/webrtc_key_value_config.h"
|
||||||
#include "call/audio_state.h"
|
#include "call/audio_state.h"
|
||||||
|
#include "call/rtp_transport_config.h"
|
||||||
|
#include "call/rtp_transport_controller_send_factory_interface.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
@ -32,6 +34,7 @@ struct CallConfig {
|
|||||||
explicit CallConfig(RtcEventLog* event_log,
|
explicit CallConfig(RtcEventLog* event_log,
|
||||||
TaskQueueBase* network_task_queue = nullptr);
|
TaskQueueBase* network_task_queue = nullptr);
|
||||||
CallConfig(const CallConfig&);
|
CallConfig(const CallConfig&);
|
||||||
|
RtpTransportConfig ExtractTransportConfig() const;
|
||||||
~CallConfig();
|
~CallConfig();
|
||||||
|
|
||||||
// Bitrate config used until valid bitrate estimates are calculated. Also
|
// Bitrate config used until valid bitrate estimates are calculated. Also
|
||||||
@ -69,6 +72,9 @@ struct CallConfig {
|
|||||||
const WebRtcKeyValueConfig* trials = nullptr;
|
const WebRtcKeyValueConfig* trials = nullptr;
|
||||||
|
|
||||||
TaskQueueBase* const network_task_queue_ = nullptr;
|
TaskQueueBase* const network_task_queue_ = nullptr;
|
||||||
|
// RtpTransportControllerSend to use for this call.
|
||||||
|
RtpTransportControllerSendFactoryInterface*
|
||||||
|
rtp_transport_controller_send_factory = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
@ -14,11 +14,13 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "absl/types/optional.h"
|
#include "absl/types/optional.h"
|
||||||
#include "api/test/simulated_network.h"
|
#include "api/test/simulated_network.h"
|
||||||
#include "call/call.h"
|
#include "call/call.h"
|
||||||
#include "call/degraded_call.h"
|
#include "call/degraded_call.h"
|
||||||
|
#include "call/rtp_transport_config.h"
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
#include "system_wrappers/include/field_trial.h"
|
#include "system_wrappers/include/field_trial.h"
|
||||||
|
|
||||||
@ -81,10 +83,19 @@ Call* CallFactory::CreateCall(const Call::Config& config) {
|
|||||||
absl::optional<webrtc::BuiltInNetworkBehaviorConfig>
|
absl::optional<webrtc::BuiltInNetworkBehaviorConfig>
|
||||||
receive_degradation_config = ParseDegradationConfig(false);
|
receive_degradation_config = ParseDegradationConfig(false);
|
||||||
|
|
||||||
|
RtpTransportConfig transportConfig = config.ExtractTransportConfig();
|
||||||
|
|
||||||
if (send_degradation_config || receive_degradation_config) {
|
if (send_degradation_config || receive_degradation_config) {
|
||||||
return new DegradedCall(std::unique_ptr<Call>(Call::Create(config)),
|
return new DegradedCall(
|
||||||
send_degradation_config, receive_degradation_config,
|
std::unique_ptr<Call>(Call::Create(
|
||||||
config.task_queue_factory);
|
config, Clock::GetRealTimeClock(),
|
||||||
|
SharedModuleThread::Create(
|
||||||
|
ProcessThread::Create("ModuleProcessThread"), nullptr),
|
||||||
|
config.rtp_transport_controller_send_factory->Create(
|
||||||
|
transportConfig, Clock::GetRealTimeClock(),
|
||||||
|
ProcessThread::Create("PacerThread")))),
|
||||||
|
send_degradation_config, receive_degradation_config,
|
||||||
|
config.task_queue_factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!module_thread_) {
|
if (!module_thread_) {
|
||||||
@ -95,7 +106,10 @@ Call* CallFactory::CreateCall(const Call::Config& config) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return Call::Create(config, module_thread_);
|
return Call::Create(config, Clock::GetRealTimeClock(), module_thread_,
|
||||||
|
config.rtp_transport_controller_send_factory->Create(
|
||||||
|
transportConfig, Clock::GetRealTimeClock(),
|
||||||
|
ProcessThread::Create("PacerThread")));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<CallFactoryInterface> CreateCallFactory() {
|
std::unique_ptr<CallFactoryInterface> CreateCallFactory() {
|
||||||
|
51
call/rtp_transport_config.h
Normal file
51
call/rtp_transport_config.h
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2021 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef CALL_RTP_TRANSPORT_CONFIG_H_
|
||||||
|
#define CALL_RTP_TRANSPORT_CONFIG_H_
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include "api/network_state_predictor.h"
|
||||||
|
#include "api/rtc_event_log/rtc_event_log.h"
|
||||||
|
#include "api/transport/bitrate_settings.h"
|
||||||
|
#include "api/transport/network_control.h"
|
||||||
|
#include "api/transport/webrtc_key_value_config.h"
|
||||||
|
#include "modules/utility/include/process_thread.h"
|
||||||
|
#include "rtc_base/task_queue.h"
|
||||||
|
|
||||||
|
namespace webrtc {
|
||||||
|
|
||||||
|
struct RtpTransportConfig {
|
||||||
|
// Bitrate config used until valid bitrate estimates are calculated. Also
|
||||||
|
// used to cap total bitrate used. This comes from the remote connection.
|
||||||
|
BitrateConstraints bitrate_config;
|
||||||
|
|
||||||
|
// RtcEventLog to use for this call. Required.
|
||||||
|
// Use webrtc::RtcEventLog::CreateNull() for a null implementation.
|
||||||
|
RtcEventLog* event_log = nullptr;
|
||||||
|
|
||||||
|
// Task Queue Factory to be used in this call. Required.
|
||||||
|
TaskQueueFactory* task_queue_factory = nullptr;
|
||||||
|
|
||||||
|
// NetworkStatePredictor to use for this call.
|
||||||
|
NetworkStatePredictorFactoryInterface* network_state_predictor_factory =
|
||||||
|
nullptr;
|
||||||
|
|
||||||
|
// Network controller factory to use for this call.
|
||||||
|
NetworkControllerFactoryInterface* network_controller_factory = nullptr;
|
||||||
|
|
||||||
|
// Key-value mapping of internal configurations to apply,
|
||||||
|
// e.g. field trials.
|
||||||
|
const WebRtcKeyValueConfig* trials = nullptr;
|
||||||
|
};
|
||||||
|
} // namespace webrtc
|
||||||
|
|
||||||
|
#endif // CALL_RTP_TRANSPORT_CONFIG_H_
|
37
call/rtp_transport_controller_send_factory.h
Normal file
37
call/rtp_transport_controller_send_factory.h
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2021 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef CALL_RTP_TRANSPORT_CONTROLLER_SEND_FACTORY_H_
|
||||||
|
#define CALL_RTP_TRANSPORT_CONTROLLER_SEND_FACTORY_H_
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
#include "call/rtp_transport_controller_send.h"
|
||||||
|
#include "call/rtp_transport_controller_send_factory_interface.h"
|
||||||
|
|
||||||
|
namespace webrtc {
|
||||||
|
class RtpTransportControllerSendFactory
|
||||||
|
: public RtpTransportControllerSendFactoryInterface {
|
||||||
|
public:
|
||||||
|
std::unique_ptr<RtpTransportControllerSendInterface> Create(
|
||||||
|
const RtpTransportConfig& config,
|
||||||
|
Clock* clock,
|
||||||
|
std::unique_ptr<ProcessThread> process_thread) override {
|
||||||
|
return std::make_unique<RtpTransportControllerSend>(
|
||||||
|
clock, config.event_log, config.network_state_predictor_factory,
|
||||||
|
config.network_controller_factory, config.bitrate_config,
|
||||||
|
std::move(process_thread), config.task_queue_factory, config.trials);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~RtpTransportControllerSendFactory() {}
|
||||||
|
};
|
||||||
|
} // namespace webrtc
|
||||||
|
#endif // CALL_RTP_TRANSPORT_CONTROLLER_SEND_FACTORY_H_
|
32
call/rtp_transport_controller_send_factory_interface.h
Normal file
32
call/rtp_transport_controller_send_factory_interface.h
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2021 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.
|
||||||
|
*/
|
||||||
|
#ifndef CALL_RTP_TRANSPORT_CONTROLLER_SEND_FACTORY_INTERFACE_H_
|
||||||
|
#define CALL_RTP_TRANSPORT_CONTROLLER_SEND_FACTORY_INTERFACE_H_
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include "call/rtp_transport_config.h"
|
||||||
|
#include "call/rtp_transport_controller_send_interface.h"
|
||||||
|
#include "modules/utility/include/process_thread.h"
|
||||||
|
|
||||||
|
namespace webrtc {
|
||||||
|
// A factory used for dependency injection on the send side of the transport
|
||||||
|
// controller.
|
||||||
|
class RtpTransportControllerSendFactoryInterface {
|
||||||
|
public:
|
||||||
|
virtual std::unique_ptr<RtpTransportControllerSendInterface> Create(
|
||||||
|
const RtpTransportConfig& config,
|
||||||
|
Clock* clock,
|
||||||
|
std::unique_ptr<ProcessThread> process_thread) = 0;
|
||||||
|
|
||||||
|
virtual ~RtpTransportControllerSendFactoryInterface() {}
|
||||||
|
};
|
||||||
|
} // namespace webrtc
|
||||||
|
#endif // CALL_RTP_TRANSPORT_CONTROLLER_SEND_FACTORY_INTERFACE_H_
|
@ -301,6 +301,8 @@ rtc_library("peerconnection") {
|
|||||||
"../api/video:video_rtp_headers",
|
"../api/video:video_rtp_headers",
|
||||||
"../api/video_codecs:video_codecs_api",
|
"../api/video_codecs:video_codecs_api",
|
||||||
"../call:call_interfaces",
|
"../call:call_interfaces",
|
||||||
|
"../call:rtp_interfaces",
|
||||||
|
"../call:rtp_sender",
|
||||||
"../common_video",
|
"../common_video",
|
||||||
"../logging:ice_log",
|
"../logging:ice_log",
|
||||||
"../media:rtc_data_sctp_transport_internal",
|
"../media:rtc_data_sctp_transport_internal",
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "api/transport/bitrate_settings.h"
|
#include "api/transport/bitrate_settings.h"
|
||||||
#include "api/units/data_rate.h"
|
#include "api/units/data_rate.h"
|
||||||
#include "call/audio_state.h"
|
#include "call/audio_state.h"
|
||||||
|
#include "call/rtp_transport_controller_send_factory.h"
|
||||||
#include "media/base/media_engine.h"
|
#include "media/base/media_engine.h"
|
||||||
#include "p2p/base/basic_async_resolver_factory.h"
|
#include "p2p/base/basic_async_resolver_factory.h"
|
||||||
#include "p2p/base/basic_packet_socket_factory.h"
|
#include "p2p/base/basic_packet_socket_factory.h"
|
||||||
@ -100,7 +101,11 @@ PeerConnectionFactory::PeerConnectionFactory(
|
|||||||
std::move(dependencies->network_state_predictor_factory)),
|
std::move(dependencies->network_state_predictor_factory)),
|
||||||
injected_network_controller_factory_(
|
injected_network_controller_factory_(
|
||||||
std::move(dependencies->network_controller_factory)),
|
std::move(dependencies->network_controller_factory)),
|
||||||
neteq_factory_(std::move(dependencies->neteq_factory)) {}
|
neteq_factory_(std::move(dependencies->neteq_factory)),
|
||||||
|
transport_controller_send_factory_(
|
||||||
|
(dependencies->transport_controller_send_factory)
|
||||||
|
? std::move(dependencies->transport_controller_send_factory)
|
||||||
|
: std::make_unique<RtpTransportControllerSendFactory>()) {}
|
||||||
|
|
||||||
PeerConnectionFactory::PeerConnectionFactory(
|
PeerConnectionFactory::PeerConnectionFactory(
|
||||||
PeerConnectionFactoryDependencies dependencies)
|
PeerConnectionFactoryDependencies dependencies)
|
||||||
@ -334,7 +339,8 @@ std::unique_ptr<Call> PeerConnectionFactory::CreateCall_w(
|
|||||||
}
|
}
|
||||||
|
|
||||||
call_config.trials = &trials();
|
call_config.trials = &trials();
|
||||||
|
call_config.rtp_transport_controller_send_factory =
|
||||||
|
transport_controller_send_factory_.get();
|
||||||
return std::unique_ptr<Call>(
|
return std::unique_ptr<Call>(
|
||||||
context_->call_factory()->CreateCall(call_config));
|
context_->call_factory()->CreateCall(call_config));
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -36,6 +37,7 @@
|
|||||||
#include "api/transport/sctp_transport_factory_interface.h"
|
#include "api/transport/sctp_transport_factory_interface.h"
|
||||||
#include "api/transport/webrtc_key_value_config.h"
|
#include "api/transport/webrtc_key_value_config.h"
|
||||||
#include "call/call.h"
|
#include "call/call.h"
|
||||||
|
#include "call/rtp_transport_controller_send_factory_interface.h"
|
||||||
#include "p2p/base/port_allocator.h"
|
#include "p2p/base/port_allocator.h"
|
||||||
#include "pc/channel_manager.h"
|
#include "pc/channel_manager.h"
|
||||||
#include "pc/connection_context.h"
|
#include "pc/connection_context.h"
|
||||||
@ -148,6 +150,8 @@ class PeerConnectionFactory : public PeerConnectionFactoryInterface {
|
|||||||
std::unique_ptr<NetworkControllerFactoryInterface>
|
std::unique_ptr<NetworkControllerFactoryInterface>
|
||||||
injected_network_controller_factory_;
|
injected_network_controller_factory_;
|
||||||
std::unique_ptr<NetEqFactory> neteq_factory_;
|
std::unique_ptr<NetEqFactory> neteq_factory_;
|
||||||
|
const std::unique_ptr<RtpTransportControllerSendFactoryInterface>
|
||||||
|
transport_controller_send_factory_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
Reference in New Issue
Block a user