Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Unified Diff: webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc

Issue 2684773002: Experiment-driven configuration of PLR/RPLR-based FecController (Closed)
Patch Set: Remove Clock from RplrBasedFecController Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..3e4aa2b5414624b7227f358418fbc151295b1dcd 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,43 @@ 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) {
+ RTC_CHECK(config.has_fec_enabling_threshold());
+ RTC_CHECK(config.has_fec_disabling_threshold());
+
+ 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()))));
+}
+
std::unique_ptr<FrameLengthController> CreateFrameLengthController(
const audio_network_adaptor::config::FrameLengthController& config,
rtc::ArrayView<const int> encoder_frame_lengths_ms,
@@ -183,6 +221,10 @@ 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);
+ break;
case audio_network_adaptor::config::Controller::kFrameLengthController:
controller = CreateFrameLengthController(
controller_config.frame_length_controller(),

Powered by Google App Engine
This is Rietveld 408576698