| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 void FecControllerRplrBased::UpdateNetworkMetrics( | 64 void FecControllerRplrBased::UpdateNetworkMetrics( |
| 65 const NetworkMetrics& network_metrics) { | 65 const NetworkMetrics& network_metrics) { |
| 66 if (network_metrics.uplink_bandwidth_bps) | 66 if (network_metrics.uplink_bandwidth_bps) |
| 67 uplink_bandwidth_bps_ = network_metrics.uplink_bandwidth_bps; | 67 uplink_bandwidth_bps_ = network_metrics.uplink_bandwidth_bps; |
| 68 if (network_metrics.uplink_recoverable_packet_loss_fraction) { | 68 if (network_metrics.uplink_recoverable_packet_loss_fraction) { |
| 69 uplink_recoverable_packet_loss_ = | 69 uplink_recoverable_packet_loss_ = |
| 70 network_metrics.uplink_recoverable_packet_loss_fraction; | 70 network_metrics.uplink_recoverable_packet_loss_fraction; |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 void FecControllerRplrBased::MakeDecision( | 74 void FecControllerRplrBased::MakeDecision(AudioEncoderRuntimeConfig* config) { |
| 75 AudioNetworkAdaptor::EncoderRuntimeConfig* config) { | |
| 76 RTC_DCHECK(!config->enable_fec); | 75 RTC_DCHECK(!config->enable_fec); |
| 77 RTC_DCHECK(!config->uplink_packet_loss_fraction); | 76 RTC_DCHECK(!config->uplink_packet_loss_fraction); |
| 78 | 77 |
| 79 fec_enabled_ = fec_enabled_ ? !FecDisablingDecision() : FecEnablingDecision(); | 78 fec_enabled_ = fec_enabled_ ? !FecDisablingDecision() : FecEnablingDecision(); |
| 80 | 79 |
| 81 config->enable_fec = rtc::Optional<bool>(fec_enabled_); | 80 config->enable_fec = rtc::Optional<bool>(fec_enabled_); |
| 82 config->uplink_packet_loss_fraction = rtc::Optional<float>( | 81 config->uplink_packet_loss_fraction = rtc::Optional<float>( |
| 83 uplink_recoverable_packet_loss_ ? *uplink_recoverable_packet_loss_ : 0.0); | 82 uplink_recoverable_packet_loss_ ? *uplink_recoverable_packet_loss_ : 0.0); |
| 84 } | 83 } |
| 85 | 84 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 return false; | 128 return false; |
| 130 } else { | 129 } else { |
| 131 return *uplink_recoverable_packet_loss_ <= | 130 return *uplink_recoverable_packet_loss_ <= |
| 132 GetPacketLossThreshold(*uplink_bandwidth_bps_, | 131 GetPacketLossThreshold(*uplink_bandwidth_bps_, |
| 133 config_.fec_disabling_threshold, | 132 config_.fec_disabling_threshold, |
| 134 fec_disabling_threshold_info_); | 133 fec_disabling_threshold_info_); |
| 135 } | 134 } |
| 136 } | 135 } |
| 137 | 136 |
| 138 } // namespace webrtc | 137 } // namespace webrtc |
| OLD | NEW |