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

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

Issue 2643133003: Instantly pass network changes to controllers in audio network adaptor. (Closed)
Patch Set: new solution Created 3 years, 11 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_unittest.cc
diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_unittest.cc b/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_unittest.cc
index 823763f091985c3fda5128ef1d8dcd89a45fabdc..8f3e9d7a97eb7eb05564317d95761ffd6a5989e4 100644
--- a/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_unittest.cc
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_unittest.cc
@@ -76,20 +76,23 @@ void CheckDecision(FecControllerStates* states,
const rtc::Optional<int>& uplink_bandwidth_bps,
const rtc::Optional<float>& uplink_packet_loss,
bool expected_enable_fec) {
- Controller::NetworkMetrics metrics;
- metrics.uplink_bandwidth_bps = uplink_bandwidth_bps;
- metrics.uplink_packet_loss_fraction = uplink_packet_loss;
-
+ if (uplink_bandwidth_bps) {
+ Controller::NetworkMetrics network_metrics;
+ network_metrics.uplink_bandwidth_bps = uplink_bandwidth_bps;
+ states->controller->UpdateNetworkMetrics(network_metrics);
+ }
if (uplink_packet_loss) {
- // Check that smoothing filter is updated.
+ Controller::NetworkMetrics network_metrics;
+ network_metrics.uplink_packet_loss_fraction = uplink_packet_loss;
EXPECT_CALL(*states->packet_loss_smoothed, AddSample(*uplink_packet_loss));
+ states->controller->UpdateNetworkMetrics(network_metrics);
}
EXPECT_CALL(*states->packet_loss_smoothed, GetAverage())
.WillRepeatedly(Return(uplink_packet_loss));
AudioNetworkAdaptor::EncoderRuntimeConfig config;
- states->controller->MakeDecision(metrics, &config);
+ states->controller->MakeDecision(&config);
EXPECT_EQ(rtc::Optional<bool>(expected_enable_fec), config.enable_fec);
// Check that |config.uplink_packet_loss_fraction| is properly filled.

Powered by Google App Engine
This is Rietveld 408576698