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

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

Issue 2688613003: Introduce ThresholdCurve (avoids code duplication between PLR/RPLR-based FecController) (Closed)
Patch Set: . 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/fec_controller_plr_based_unittest.cc
diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_plr_based_unittest.cc b/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_plr_based_unittest.cc
index 34f16c82729129061715d0f2280420517bf20f0d..f55a443107310110406d394a6fde27f1e896f349 100644
--- a/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_plr_based_unittest.cc
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_plr_based_unittest.cc
@@ -56,14 +56,13 @@ FecControllerPlrBasedTestStates CreateFecControllerPlrBased(
std::unique_ptr<MockSmoothingFilter> mock_smoothing_filter(
new NiceMock<MockSmoothingFilter>());
states.packet_loss_smoother = mock_smoothing_filter.get();
- using Threshold = FecControllerPlrBased::Config::Threshold;
states.controller.reset(new FecControllerPlrBased(
FecControllerPlrBased::Config(
initial_fec_enabled,
- Threshold(kEnablingBandwidthLow, kEnablingPacketLossAtLowBw,
- kEnablingBandwidthHigh, kEnablingPacketLossAtHighBw),
- Threshold(kDisablingBandwidthLow, kDisablingPacketLossAtLowBw,
- kDisablingBandwidthHigh, kDisablingPacketLossAtHighBw),
+ ThresholdCurve(kEnablingBandwidthLow, kEnablingPacketLossAtLowBw,
+ kEnablingBandwidthHigh, kEnablingPacketLossAtHighBw),
+ ThresholdCurve(kDisablingBandwidthLow, kDisablingPacketLossAtLowBw,
+ kDisablingBandwidthHigh, kDisablingPacketLossAtHighBw),
0, nullptr),
std::move(mock_smoothing_filter)));
return states;
@@ -313,14 +312,13 @@ TEST(FecControllerPlrBasedTest, CheckBehaviorOnSpecialCurves) {
std::unique_ptr<MockSmoothingFilter> mock_smoothing_filter(
new NiceMock<MockSmoothingFilter>());
states.packet_loss_smoother = mock_smoothing_filter.get();
- using Threshold = FecControllerPlrBased::Config::Threshold;
states.controller.reset(new FecControllerPlrBased(
FecControllerPlrBased::Config(
true,
- Threshold(kEnablingBandwidthLow, kEnablingPacketLossAtLowBw,
- kEnablingBandwidthHigh, kEnablingPacketLossAtHighBw),
- Threshold(kDisablingBandwidthLow, kDisablingPacketLossAtLowBw,
- kDisablingBandwidthHigh, kDisablingPacketLossAtHighBw),
+ ThresholdCurve(kEnablingBandwidthLow, kEnablingPacketLossAtLowBw,
+ kEnablingBandwidthHigh, kEnablingPacketLossAtHighBw),
+ ThresholdCurve(kDisablingBandwidthLow, kDisablingPacketLossAtLowBw,
+ kDisablingBandwidthHigh, kDisablingPacketLossAtHighBw),
0, nullptr),
std::move(mock_smoothing_filter)));
@@ -353,15 +351,16 @@ TEST(FecControllerPlrBasedDeathTest, InvalidConfig) {
std::unique_ptr<MockSmoothingFilter> mock_smoothing_filter(
new NiceMock<MockSmoothingFilter>());
states.packet_loss_smoother = mock_smoothing_filter.get();
- using Threshold = FecControllerPlrBased::Config::Threshold;
EXPECT_DEATH(
states.controller.reset(new FecControllerPlrBased(
FecControllerPlrBased::Config(
true,
- Threshold(kDisablingBandwidthLow - 1, kEnablingPacketLossAtLowBw,
- kEnablingBandwidthHigh, kEnablingPacketLossAtHighBw),
- Threshold(kDisablingBandwidthLow, kDisablingPacketLossAtLowBw,
- kDisablingBandwidthHigh, kDisablingPacketLossAtHighBw),
+ ThresholdCurve(kDisablingBandwidthLow - 1,
+ kEnablingPacketLossAtLowBw, kEnablingBandwidthHigh,
+ kEnablingPacketLossAtHighBw),
+ ThresholdCurve(
+ kDisablingBandwidthLow, kDisablingPacketLossAtLowBw,
+ kDisablingBandwidthHigh, kDisablingPacketLossAtHighBw),
0, nullptr),
std::move(mock_smoothing_filter))),
"Check failed");

Powered by Google App Engine
This is Rietveld 408576698