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 12 matching lines...) Expand all Loading... |
23 float high_bandwidth_packet_loss) | 23 float high_bandwidth_packet_loss) |
24 : low_bandwidth_bps(low_bandwidth_bps), | 24 : low_bandwidth_bps(low_bandwidth_bps), |
25 low_bandwidth_packet_loss(low_bandwidth_packet_loss), | 25 low_bandwidth_packet_loss(low_bandwidth_packet_loss), |
26 high_bandwidth_bps(high_bandwidth_bps), | 26 high_bandwidth_bps(high_bandwidth_bps), |
27 high_bandwidth_packet_loss(high_bandwidth_packet_loss) {} | 27 high_bandwidth_packet_loss(high_bandwidth_packet_loss) {} |
28 | 28 |
29 FecController::Config::Config(bool initial_fec_enabled, | 29 FecController::Config::Config(bool initial_fec_enabled, |
30 const Threshold& fec_enabling_threshold, | 30 const Threshold& fec_enabling_threshold, |
31 const Threshold& fec_disabling_threshold, | 31 const Threshold& fec_disabling_threshold, |
32 int time_constant_ms, | 32 int time_constant_ms, |
33 Clock* clock) | 33 const Clock* clock) |
34 : initial_fec_enabled(initial_fec_enabled), | 34 : initial_fec_enabled(initial_fec_enabled), |
35 fec_enabling_threshold(fec_enabling_threshold), | 35 fec_enabling_threshold(fec_enabling_threshold), |
36 fec_disabling_threshold(fec_disabling_threshold), | 36 fec_disabling_threshold(fec_disabling_threshold), |
37 time_constant_ms(time_constant_ms), | 37 time_constant_ms(time_constant_ms), |
38 clock(clock) {} | 38 clock(clock) {} |
39 | 39 |
40 FecController::FecController(const Config& config) | 40 FecController::FecController(const Config& config) |
41 : config_(config), | 41 : config_(config), |
42 fec_enabled_(config.initial_fec_enabled), | 42 fec_enabled_(config.initial_fec_enabled), |
43 packet_loss_smoothed_( | 43 packet_loss_smoothed_( |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 auto packet_loss = packet_loss_smoothed_->GetAverage(); | 127 auto packet_loss = packet_loss_smoothed_->GetAverage(); |
128 if (!packet_loss) | 128 if (!packet_loss) |
129 return false; | 129 return false; |
130 | 130 |
131 return *packet_loss <= GetPacketLossThreshold(*metrics.uplink_bandwidth_bps, | 131 return *packet_loss <= GetPacketLossThreshold(*metrics.uplink_bandwidth_bps, |
132 config_.fec_disabling_threshold, | 132 config_.fec_disabling_threshold, |
133 fec_disabling_threshold_info_); | 133 fec_disabling_threshold_info_); |
134 } | 134 } |
135 | 135 |
136 } // namespace webrtc | 136 } // namespace webrtc |
OLD | NEW |