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 18 matching lines...) Expand all Loading... |
29 // | 29 // |
30 // packet-loss ^ | | | 30 // packet-loss ^ | | |
31 // | | | FEC | 31 // | | | FEC |
32 // | \ \ ON | 32 // | \ \ ON |
33 // | FEC \ \_______ fec_enabling_threshold | 33 // | FEC \ \_______ fec_enabling_threshold |
34 // | OFF \_________ fec_disabling_threshold | 34 // | OFF \_________ fec_disabling_threshold |
35 // |-----------------> bandwidth | 35 // |-----------------> bandwidth |
36 Config(bool initial_fec_enabled, | 36 Config(bool initial_fec_enabled, |
37 const ThresholdCurve& fec_enabling_threshold, | 37 const ThresholdCurve& fec_enabling_threshold, |
38 const ThresholdCurve& fec_disabling_threshold, | 38 const ThresholdCurve& fec_disabling_threshold, |
39 int time_constant_ms, | 39 int time_constant_ms); |
40 const Clock* clock); | |
41 bool initial_fec_enabled; | 40 bool initial_fec_enabled; |
42 ThresholdCurve fec_enabling_threshold; | 41 ThresholdCurve fec_enabling_threshold; |
43 ThresholdCurve fec_disabling_threshold; | 42 ThresholdCurve fec_disabling_threshold; |
44 int time_constant_ms; | 43 int time_constant_ms; |
45 const Clock* clock; | |
46 }; | 44 }; |
47 | 45 |
48 // Dependency injection for testing. | 46 // Dependency injection for testing. |
49 FecControllerPlrBased(const Config& config, | 47 FecControllerPlrBased(const Config& config, |
50 std::unique_ptr<SmoothingFilter> smoothing_filter); | 48 std::unique_ptr<SmoothingFilter> smoothing_filter); |
51 | 49 |
52 explicit FecControllerPlrBased(const Config& config); | 50 explicit FecControllerPlrBased(const Config& config); |
53 | 51 |
54 ~FecControllerPlrBased() override; | 52 ~FecControllerPlrBased() override; |
55 | 53 |
56 void UpdateNetworkMetrics(const NetworkMetrics& network_metrics) override; | 54 void UpdateNetworkMetrics(const NetworkMetrics& network_metrics) override; |
57 | 55 |
58 void MakeDecision(AudioEncoderRuntimeConfig* config) override; | 56 void MakeDecision(AudioEncoderRuntimeConfig* config) override; |
59 | 57 |
60 private: | 58 private: |
61 bool FecEnablingDecision(const rtc::Optional<float>& packet_loss) const; | 59 bool FecEnablingDecision(const rtc::Optional<float>& packet_loss) const; |
62 bool FecDisablingDecision(const rtc::Optional<float>& packet_loss) const; | 60 bool FecDisablingDecision(const rtc::Optional<float>& packet_loss) const; |
63 | 61 |
64 const Config config_; | 62 const Config config_; |
65 bool fec_enabled_; | 63 bool fec_enabled_; |
66 rtc::Optional<int> uplink_bandwidth_bps_; | 64 rtc::Optional<int> uplink_bandwidth_bps_; |
67 const std::unique_ptr<SmoothingFilter> packet_loss_smoother_; | 65 const std::unique_ptr<SmoothingFilter> packet_loss_smoother_; |
68 | 66 |
69 RTC_DISALLOW_COPY_AND_ASSIGN(FecControllerPlrBased); | 67 RTC_DISALLOW_COPY_AND_ASSIGN(FecControllerPlrBased); |
70 }; | 68 }; |
71 | 69 |
72 } // namespace webrtc | 70 } // namespace webrtc |
73 | 71 |
74 #endif // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_FEC_CONTROLLER_PLR_
BASED_H_ | 72 #endif // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_FEC_CONTROLLER_PLR_
BASED_H_ |
OLD | NEW |