Index: webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc |
diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc b/webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc |
index 6f3bda261a49c28b6d7f98f833bee19c2254eeb4..ad951e601a9f78650b1d8fb0304c75dcd3b55e60 100644 |
--- a/webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc |
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc |
@@ -18,6 +18,7 @@ |
#include "webrtc/modules/audio_coding/audio_network_adaptor/channel_controller.h" |
#include "webrtc/modules/audio_coding/audio_network_adaptor/dtx_controller.h" |
#include "webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_plr_based.h" |
+#include "webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_rplr_based.h" |
#include "webrtc/modules/audio_coding/audio_network_adaptor/frame_length_controller.h" |
#include "webrtc/system_wrappers/include/clock.h" |
@@ -73,6 +74,45 @@ std::unique_ptr<FecControllerPlrBased> CreateFecControllerPlrBased( |
config.time_constant_ms(), clock))); |
} |
+std::unique_ptr<FecControllerRplrBased> CreateFecControllerRplrBased( |
+ const audio_network_adaptor::config::FecControllerRplrBased& config, |
+ bool initial_fec_enabled, |
+ const Clock* clock) { |
+ RTC_CHECK(config.has_fec_enabling_threshold()); |
+ RTC_CHECK(config.has_fec_disabling_threshold()); |
+ RTC_CHECK(config.has_time_constant_ms()); |
+ |
+ auto& fec_enabling_threshold = config.fec_enabling_threshold(); |
+ RTC_CHECK(fec_enabling_threshold.has_low_bandwidth_bps()); |
+ RTC_CHECK(fec_enabling_threshold.has_low_bandwidth_recoverable_packet_loss()); |
+ RTC_CHECK(fec_enabling_threshold.has_high_bandwidth_bps()); |
+ RTC_CHECK( |
+ fec_enabling_threshold.has_high_bandwidth_recoverable_packet_loss()); |
+ |
+ auto& fec_disabling_threshold = config.fec_disabling_threshold(); |
+ RTC_CHECK(fec_disabling_threshold.has_low_bandwidth_bps()); |
+ RTC_CHECK( |
+ fec_disabling_threshold.has_low_bandwidth_recoverable_packet_loss()); |
+ RTC_CHECK(fec_disabling_threshold.has_high_bandwidth_bps()); |
+ RTC_CHECK( |
+ fec_disabling_threshold.has_high_bandwidth_recoverable_packet_loss()); |
+ |
+ return std::unique_ptr<FecControllerRplrBased>( |
+ new FecControllerRplrBased(FecControllerRplrBased::Config( |
+ initial_fec_enabled, |
+ FecControllerRplrBased::Config::Threshold( |
+ fec_enabling_threshold.low_bandwidth_bps(), |
+ fec_enabling_threshold.low_bandwidth_recoverable_packet_loss(), |
+ fec_enabling_threshold.high_bandwidth_bps(), |
+ fec_enabling_threshold.high_bandwidth_recoverable_packet_loss()), |
+ FecControllerRplrBased::Config::Threshold( |
+ fec_disabling_threshold.low_bandwidth_bps(), |
+ fec_disabling_threshold.low_bandwidth_recoverable_packet_loss(), |
+ fec_disabling_threshold.high_bandwidth_bps(), |
+ fec_disabling_threshold.high_bandwidth_recoverable_packet_loss()), |
+ config.time_constant_ms(), clock))); |
+} |
+ |
std::unique_ptr<FrameLengthController> CreateFrameLengthController( |
const audio_network_adaptor::config::FrameLengthController& config, |
rtc::ArrayView<const int> encoder_frame_lengths_ms, |
@@ -183,6 +223,11 @@ std::unique_ptr<ControllerManager> ControllerManagerImpl::Create( |
controller = CreateFecControllerPlrBased( |
controller_config.fec_controller(), initial_fec_enabled, clock); |
break; |
+ case audio_network_adaptor::config::Controller::kFecControllerRplrBased: |
+ controller = CreateFecControllerRplrBased( |
+ controller_config.fec_controller_rplr_based(), initial_fec_enabled, |
+ clock); |
+ break; |
case audio_network_adaptor::config::Controller::kFrameLengthController: |
controller = CreateFrameLengthController( |
controller_config.frame_length_controller(), |