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 | 10 |
11 #ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_ | 11 #ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_ |
12 #define WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_ | 12 #define WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 | 15 |
16 #include "webrtc/base/constructormagic.h" | 16 #include "webrtc/base/constructormagic.h" |
| 17 #include "webrtc/base/deprecation.h" |
17 #include "webrtc/common_types.h" | 18 #include "webrtc/common_types.h" |
18 #include "webrtc/modules/congestion_controller/transport_feedback_adapter.h" | 19 #include "webrtc/modules/congestion_controller/transport_feedback_adapter.h" |
19 #include "webrtc/modules/include/module.h" | 20 #include "webrtc/modules/include/module.h" |
20 #include "webrtc/modules/include/module_common_types.h" | 21 #include "webrtc/modules/include/module_common_types.h" |
21 #include "webrtc/modules/pacing/packet_router.h" | 22 #include "webrtc/modules/pacing/packet_router.h" |
22 #include "webrtc/modules/pacing/paced_sender.h" | 23 #include "webrtc/modules/pacing/paced_sender.h" |
23 #include "webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h" | 24 #include "webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h" |
24 | 25 |
25 namespace rtc { | 26 namespace rtc { |
26 struct SentPacket; | 27 struct SentPacket; |
(...skipping 12 matching lines...) Expand all Loading... |
39 | 40 |
40 class CongestionController : public CallStatsObserver, public Module { | 41 class CongestionController : public CallStatsObserver, public Module { |
41 public: | 42 public: |
42 // Observer class for bitrate changes announced due to change in bandwidth | 43 // Observer class for bitrate changes announced due to change in bandwidth |
43 // estimate or due to that the send pacer is full. Fraction loss and rtt is | 44 // estimate or due to that the send pacer is full. Fraction loss and rtt is |
44 // also part of this callback to allow the observer to optimize its settings | 45 // also part of this callback to allow the observer to optimize its settings |
45 // for different types of network environments. The bitrate does not include | 46 // for different types of network environments. The bitrate does not include |
46 // packet headers and is measured in bits per second. | 47 // packet headers and is measured in bits per second. |
47 class Observer { | 48 class Observer { |
48 public: | 49 public: |
| 50 // This is to be deprecated. Please use the one below instead. |
| 51 RTC_DEPRECATED virtual void OnNetworkChanged(uint32_t bitrate_bps, |
| 52 uint8_t fraction_loss, |
| 53 int64_t rtt_ms) {} |
| 54 |
| 55 // TODO(minyue): make this method pure virtual when all uses of the old API |
| 56 // have been updated. |
49 virtual void OnNetworkChanged(uint32_t bitrate_bps, | 57 virtual void OnNetworkChanged(uint32_t bitrate_bps, |
50 uint8_t fraction_loss, // 0 - 255. | 58 uint8_t fraction_loss, // 0 - 255. |
51 int64_t rtt_ms) = 0; | 59 int64_t rtt_ms, |
| 60 int64_t probing_interval_ms) {} |
52 | 61 |
53 protected: | 62 protected: |
54 virtual ~Observer() {} | 63 virtual ~Observer() {} |
55 }; | 64 }; |
56 CongestionController(Clock* clock, | 65 CongestionController(Clock* clock, |
57 Observer* observer, | 66 Observer* observer, |
58 RemoteBitrateObserver* remote_bitrate_observer, | 67 RemoteBitrateObserver* remote_bitrate_observer, |
59 RtcEventLog* event_log, | 68 RtcEventLog* event_log, |
60 PacketRouter* packet_router); | 69 PacketRouter* packet_router); |
61 // TODO(nisse): Deprecated. Will create and own a PacketRouter. | 70 // TODO(nisse): Deprecated. Will create and own a PacketRouter. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 uint8_t last_reported_fraction_loss_ GUARDED_BY(critsect_); | 150 uint8_t last_reported_fraction_loss_ GUARDED_BY(critsect_); |
142 int64_t last_reported_rtt_ GUARDED_BY(critsect_); | 151 int64_t last_reported_rtt_ GUARDED_BY(critsect_); |
143 NetworkState network_state_ GUARDED_BY(critsect_); | 152 NetworkState network_state_ GUARDED_BY(critsect_); |
144 | 153 |
145 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CongestionController); | 154 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CongestionController); |
146 }; | 155 }; |
147 | 156 |
148 } // namespace webrtc | 157 } // namespace webrtc |
149 | 158 |
150 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_ | 159 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_ |
OLD | NEW |