Chromium Code Reviews| 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 31eff216890882ecc0b2496914d45b312a5cd831..99466d3ac5bf0dc7ee35829e40c7594856e86ea4 100644 |
| --- a/webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc |
| +++ b/webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc |
| @@ -81,12 +81,28 @@ std::unique_ptr<FrameLengthController> CreateFrameLengthController( |
| RTC_CHECK(config.has_fl_20ms_to_60ms_bandwidth_bps()); |
| RTC_CHECK(config.has_fl_60ms_to_20ms_bandwidth_bps()); |
| + std::map<FrameLengthController::Config::FrameLengthChange, int> |
| + fl_changing_bandwidths_bps; |
| + fl_changing_bandwidths_bps.insert( |
| + std::make_pair(FrameLengthController::Config::FrameLengthChange(20, 60), |
| + config.fl_20ms_to_60ms_bandwidth_bps())); |
| + fl_changing_bandwidths_bps.insert( |
| + std::make_pair(FrameLengthController::Config::FrameLengthChange(60, 20), |
| + config.fl_60ms_to_20ms_bandwidth_bps())); |
|
kwiberg-webrtc
2017/02/02 12:34:02
I think you can replace line 84-91 with something
michaelt
2017/02/02 13:04:34
Cool
kwiberg-webrtc
2017/02/02 13:18:40
Nice. I suspect it's a bit more efficient, but mai
|
| + if (config.has_fl_60ms_to_120ms_bandwidth_bps() && |
| + config.has_fl_120ms_to_60ms_bandwidth_bps()) { |
| + fl_changing_bandwidths_bps.insert(std::make_pair( |
| + FrameLengthController::Config::FrameLengthChange(60, 120), |
| + config.fl_60ms_to_120ms_bandwidth_bps())); |
| + fl_changing_bandwidths_bps.insert(std::make_pair( |
| + FrameLengthController::Config::FrameLengthChange(120, 60), |
| + config.fl_120ms_to_60ms_bandwidth_bps())); |
| + } |
| + |
| FrameLengthController::Config ctor_config( |
| std::vector<int>(), initial_frame_length_ms, |
| config.fl_increasing_packet_loss_fraction(), |
| - config.fl_decreasing_packet_loss_fraction(), |
| - config.fl_20ms_to_60ms_bandwidth_bps(), |
| - config.fl_60ms_to_20ms_bandwidth_bps()); |
| + config.fl_decreasing_packet_loss_fraction(), fl_changing_bandwidths_bps); |
|
kwiberg-webrtc
2017/02/02 12:34:02
If you std::move fl_changing_bandwidths_bps here a
michaelt
2017/02/02 13:04:34
Done.
|
| for (auto frame_length : encoder_frame_lengths_ms) |
| ctor_config.encoder_frame_lengths_ms.push_back(frame_length); |