Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 } | 73 } |
| 74 | 74 |
| 75 std::unique_ptr<FrameLengthController> CreateFrameLengthController( | 75 std::unique_ptr<FrameLengthController> CreateFrameLengthController( |
| 76 const audio_network_adaptor::config::FrameLengthController& config, | 76 const audio_network_adaptor::config::FrameLengthController& config, |
| 77 rtc::ArrayView<const int> encoder_frame_lengths_ms, | 77 rtc::ArrayView<const int> encoder_frame_lengths_ms, |
| 78 int initial_frame_length_ms) { | 78 int initial_frame_length_ms) { |
| 79 RTC_CHECK(config.has_fl_increasing_packet_loss_fraction()); | 79 RTC_CHECK(config.has_fl_increasing_packet_loss_fraction()); |
| 80 RTC_CHECK(config.has_fl_decreasing_packet_loss_fraction()); | 80 RTC_CHECK(config.has_fl_decreasing_packet_loss_fraction()); |
| 81 RTC_CHECK(config.has_fl_20ms_to_60ms_bandwidth_bps()); | 81 RTC_CHECK(config.has_fl_20ms_to_60ms_bandwidth_bps()); |
| 82 RTC_CHECK(config.has_fl_60ms_to_20ms_bandwidth_bps()); | 82 RTC_CHECK(config.has_fl_60ms_to_20ms_bandwidth_bps()); |
| 83 RTC_CHECK(config.has_fl_60ms_to_120ms_bandwidth_bps()); | |
|
minyue-webrtc
2017/02/02 08:31:10
this must be carefully treated for backward-compat
michaelt
2017/02/02 10:29:57
Impl. as discussed offline.
| |
| 84 RTC_CHECK(config.has_fl_120ms_to_60ms_bandwidth_bps()); | |
| 83 | 85 |
| 84 FrameLengthController::Config ctor_config( | 86 FrameLengthController::Config ctor_config( |
| 85 std::vector<int>(), initial_frame_length_ms, | 87 std::vector<int>(), initial_frame_length_ms, |
| 86 config.fl_increasing_packet_loss_fraction(), | 88 config.fl_increasing_packet_loss_fraction(), |
| 87 config.fl_decreasing_packet_loss_fraction(), | 89 config.fl_decreasing_packet_loss_fraction(), |
| 88 config.fl_20ms_to_60ms_bandwidth_bps(), | 90 config.fl_20ms_to_60ms_bandwidth_bps(), |
| 89 config.fl_60ms_to_20ms_bandwidth_bps()); | 91 config.fl_60ms_to_20ms_bandwidth_bps(), |
| 92 config.fl_60ms_to_120ms_bandwidth_bps(), | |
| 93 config.fl_120ms_to_60ms_bandwidth_bps()); | |
| 90 | 94 |
| 91 for (auto frame_length : encoder_frame_lengths_ms) | 95 for (auto frame_length : encoder_frame_lengths_ms) |
| 92 ctor_config.encoder_frame_lengths_ms.push_back(frame_length); | 96 ctor_config.encoder_frame_lengths_ms.push_back(frame_length); |
| 93 | 97 |
| 94 return std::unique_ptr<FrameLengthController>( | 98 return std::unique_ptr<FrameLengthController>( |
| 95 new FrameLengthController(ctor_config)); | 99 new FrameLengthController(ctor_config)); |
| 96 } | 100 } |
| 97 | 101 |
| 98 std::unique_ptr<ChannelController> CreateChannelController( | 102 std::unique_ptr<ChannelController> CreateChannelController( |
| 99 const audio_network_adaptor::config::ChannelController& config, | 103 const audio_network_adaptor::config::ChannelController& config, |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 325 NormalizeUplinkBandwidth(scoring_point.uplink_bandwidth_bps) - | 329 NormalizeUplinkBandwidth(scoring_point.uplink_bandwidth_bps) - |
| 326 NormalizeUplinkBandwidth(uplink_bandwidth_bps); | 330 NormalizeUplinkBandwidth(uplink_bandwidth_bps); |
| 327 float diff_normalized_packet_loss = | 331 float diff_normalized_packet_loss = |
| 328 NormalizePacketLossFraction(scoring_point.uplink_packet_loss_fraction) - | 332 NormalizePacketLossFraction(scoring_point.uplink_packet_loss_fraction) - |
| 329 NormalizePacketLossFraction(uplink_packet_loss_fraction); | 333 NormalizePacketLossFraction(uplink_packet_loss_fraction); |
| 330 return std::pow(diff_normalized_bitrate_bps, 2) + | 334 return std::pow(diff_normalized_bitrate_bps, 2) + |
| 331 std::pow(diff_normalized_packet_loss, 2); | 335 std::pow(diff_normalized_packet_loss, 2); |
| 332 } | 336 } |
| 333 | 337 |
| 334 } // namespace webrtc | 338 } // namespace webrtc |
| OLD | NEW |