OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 |
11 * RTCP module. It will aggregate the results and run one bandwidth estimation | 11 * RTCP module. It will aggregate the results and run one bandwidth estimation |
12 * and push the result to the encoder via VideoEncoderCallback. | 12 * and push the result to the encoder via VideoEncoderCallback. |
13 */ | 13 */ |
14 | 14 |
15 #ifndef WEBRTC_MODULES_BITRATE_CONTROLLER_BITRATE_CONTROLLER_IMPL_H_ | 15 #ifndef WEBRTC_MODULES_BITRATE_CONTROLLER_BITRATE_CONTROLLER_IMPL_H_ |
16 #define WEBRTC_MODULES_BITRATE_CONTROLLER_BITRATE_CONTROLLER_IMPL_H_ | 16 #define WEBRTC_MODULES_BITRATE_CONTROLLER_BITRATE_CONTROLLER_IMPL_H_ |
17 | 17 |
18 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" | 18 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" |
19 | 19 |
20 #include <list> | 20 #include <list> |
21 #include <utility> | 21 #include <utility> |
| 22 #include <vector> |
22 | 23 |
23 #include "webrtc/base/constructormagic.h" | 24 #include "webrtc/base/constructormagic.h" |
24 #include "webrtc/base/criticalsection.h" | 25 #include "webrtc/base/criticalsection.h" |
25 #include "webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.h" | 26 #include "webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.h" |
26 | 27 |
27 namespace webrtc { | 28 namespace webrtc { |
28 | 29 |
29 class BitrateControllerImpl : public BitrateController { | 30 class BitrateControllerImpl : public BitrateController { |
30 public: | 31 public: |
31 // TODO(perkj): BitrateObserver has been deprecated and is not used in WebRTC. | 32 // TODO(perkj): BitrateObserver has been deprecated and is not used in WebRTC. |
(...skipping 13 matching lines...) Expand all Loading... |
45 void SetMinMaxBitrate(int min_bitrate_bps, int max_bitrate_bps) override; | 46 void SetMinMaxBitrate(int min_bitrate_bps, int max_bitrate_bps) override; |
46 | 47 |
47 void SetBitrates(int start_bitrate_bps, | 48 void SetBitrates(int start_bitrate_bps, |
48 int min_bitrate_bps, | 49 int min_bitrate_bps, |
49 int max_bitrate_bps) override; | 50 int max_bitrate_bps) override; |
50 | 51 |
51 void ResetBitrates(int bitrate_bps, | 52 void ResetBitrates(int bitrate_bps, |
52 int min_bitrate_bps, | 53 int min_bitrate_bps, |
53 int max_bitrate_bps) override; | 54 int max_bitrate_bps) override; |
54 | 55 |
55 void UpdateDelayBasedEstimate(uint32_t bitrate_bps) override; | |
56 | 56 |
57 void SetReservedBitrate(uint32_t reserved_bitrate_bps) override; | 57 void SetReservedBitrate(uint32_t reserved_bitrate_bps) override; |
58 | 58 |
59 // Returns true if the parameters have changed since the last call. | 59 // Returns true if the parameters have changed since the last call. |
60 bool GetNetworkParameters(uint32_t* bitrate, | 60 bool GetNetworkParameters(uint32_t* bitrate, |
61 uint8_t* fraction_loss, | 61 uint8_t* fraction_loss, |
62 int64_t* rtt) override; | 62 int64_t* rtt) override; |
63 | 63 |
64 void UpdateProbeBitrate(uint32_t bitrate_bps) override; | 64 // RemoteBitrateObserver overrides. |
| 65 void OnReceiveBitrateChanged(const std::vector<uint32_t>& ssrcs, |
| 66 uint32_t bitrate_bps) override; |
| 67 void OnProbeBitrate(uint32_t bitrate_bps) override; |
65 | 68 |
66 int64_t TimeUntilNextProcess() override; | 69 int64_t TimeUntilNextProcess() override; |
67 void Process() override; | 70 void Process() override; |
68 | 71 |
69 private: | 72 private: |
70 class RtcpBandwidthObserverImpl; | 73 class RtcpBandwidthObserverImpl; |
71 | 74 |
72 // Called by BitrateObserver's direct from the RTCP module. | 75 // Called by BitrateObserver's direct from the RTCP module. |
73 void OnReceivedEstimatedBitrate(uint32_t bitrate); | 76 void OnReceiverEstimatedBitrate(uint32_t bitrate); |
74 | 77 |
75 void OnReceivedRtcpReceiverReport(uint8_t fraction_loss, | 78 void OnReceivedRtcpReceiverReport(uint8_t fraction_loss, |
76 int64_t rtt, | 79 int64_t rtt, |
77 int number_of_packets, | 80 int number_of_packets, |
78 int64_t now_ms); | 81 int64_t now_ms); |
79 | 82 |
80 // Deprecated | 83 // Deprecated |
81 void MaybeTriggerOnNetworkChanged(); | 84 void MaybeTriggerOnNetworkChanged(); |
82 | 85 |
83 void OnNetworkChanged(uint32_t bitrate, | 86 void OnNetworkChanged(uint32_t bitrate, |
(...skipping 12 matching lines...) Expand all Loading... |
96 | 99 |
97 uint32_t last_bitrate_bps_ GUARDED_BY(critsect_); | 100 uint32_t last_bitrate_bps_ GUARDED_BY(critsect_); |
98 uint8_t last_fraction_loss_ GUARDED_BY(critsect_); | 101 uint8_t last_fraction_loss_ GUARDED_BY(critsect_); |
99 int64_t last_rtt_ms_ GUARDED_BY(critsect_); | 102 int64_t last_rtt_ms_ GUARDED_BY(critsect_); |
100 uint32_t last_reserved_bitrate_bps_ GUARDED_BY(critsect_); | 103 uint32_t last_reserved_bitrate_bps_ GUARDED_BY(critsect_); |
101 | 104 |
102 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(BitrateControllerImpl); | 105 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(BitrateControllerImpl); |
103 }; | 106 }; |
104 } // namespace webrtc | 107 } // namespace webrtc |
105 #endif // WEBRTC_MODULES_BITRATE_CONTROLLER_BITRATE_CONTROLLER_IMPL_H_ | 108 #endif // WEBRTC_MODULES_BITRATE_CONTROLLER_BITRATE_CONTROLLER_IMPL_H_ |
OLD | NEW |