OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 * Usage: this class will register multiple RtcpBitrateObserver's one at each | 10 * Usage: this class will register multiple RtcpBitrateObserver's one at each |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" | 24 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" |
25 | 25 |
26 namespace webrtc { | 26 namespace webrtc { |
27 | 27 |
28 class BitrateObserver; | 28 class BitrateObserver; |
29 | 29 |
30 class BitrateAllocator { | 30 class BitrateAllocator { |
31 public: | 31 public: |
32 BitrateAllocator(); | 32 BitrateAllocator(); |
33 | 33 |
34 void OnNetworkChanged(uint32_t target_bitrate, | 34 // Allocate target_bitrate across the registered BitrateObservers. |
35 uint8_t fraction_loss, | 35 // Returns actual bitrate allocated (might be higher than target_bitrate if |
36 int64_t rtt); | 36 // for instance EnforceMinBitrate() is enabled. |
| 37 uint32_t OnNetworkChanged(uint32_t target_bitrate, |
| 38 uint8_t fraction_loss, |
| 39 int64_t rtt); |
37 | 40 |
38 // Set the start and max send bitrate used by the bandwidth management. | 41 // Set the start and max send bitrate used by the bandwidth management. |
39 // | 42 // |
40 // |observer| updates bitrates if already in use. | 43 // |observer| updates bitrates if already in use. |
41 // |min_bitrate_bps| = 0 equals no min bitrate. | 44 // |min_bitrate_bps| = 0 equals no min bitrate. |
42 // |max_bitrate_bps| = 0 equals no max bitrate. | 45 // |max_bitrate_bps| = 0 equals no max bitrate. |
43 // Returns bitrate allocated for the bitrate observer. | 46 // Returns bitrate allocated for the bitrate observer. |
44 int AddBitrateObserver(BitrateObserver* observer, | 47 int AddBitrateObserver(BitrateObserver* observer, |
45 uint32_t min_bitrate_bps, | 48 uint32_t min_bitrate_bps, |
46 uint32_t max_bitrate_bps); | 49 uint32_t max_bitrate_bps); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Stored in a list to keep track of the insertion order. | 93 // Stored in a list to keep track of the insertion order. |
91 BitrateObserverConfList bitrate_observers_ GUARDED_BY(crit_sect_); | 94 BitrateObserverConfList bitrate_observers_ GUARDED_BY(crit_sect_); |
92 bool bitrate_observers_modified_ GUARDED_BY(crit_sect_); | 95 bool bitrate_observers_modified_ GUARDED_BY(crit_sect_); |
93 bool enforce_min_bitrate_ GUARDED_BY(crit_sect_); | 96 bool enforce_min_bitrate_ GUARDED_BY(crit_sect_); |
94 uint32_t last_bitrate_bps_ GUARDED_BY(crit_sect_); | 97 uint32_t last_bitrate_bps_ GUARDED_BY(crit_sect_); |
95 uint8_t last_fraction_loss_ GUARDED_BY(crit_sect_); | 98 uint8_t last_fraction_loss_ GUARDED_BY(crit_sect_); |
96 int64_t last_rtt_ GUARDED_BY(crit_sect_); | 99 int64_t last_rtt_ GUARDED_BY(crit_sect_); |
97 }; | 100 }; |
98 } // namespace webrtc | 101 } // namespace webrtc |
99 #endif // WEBRTC_MODULES_BITRATE_CONTROLLER_INCLUDE_BITRATE_ALLOCATOR_H_ | 102 #endif // WEBRTC_MODULES_BITRATE_CONTROLLER_INCLUDE_BITRATE_ALLOCATOR_H_ |
OLD | NEW |