| 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/common_types.h" | 17 #include "webrtc/common_types.h" |
| 18 #include "webrtc/modules/congestion_controller/transport_feedback_adapter.h" | 18 #include "webrtc/modules/congestion_controller/transport_feedback_adapter.h" |
| 19 #include "webrtc/modules/include/module.h" | 19 #include "webrtc/modules/include/module.h" |
| 20 #include "webrtc/modules/include/module_common_types.h" | 20 #include "webrtc/modules/include/module_common_types.h" |
| 21 #include "webrtc/modules/pacing/packet_router.h" | 21 #include "webrtc/modules/pacing/packet_router.h" |
| 22 #include "webrtc/modules/pacing/paced_sender.h" | 22 #include "webrtc/modules/pacing/paced_sender.h" |
| 23 #include "webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h" | 23 #include "webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h" |
| 24 | 24 |
| 25 namespace rtc { | 25 namespace rtc { |
| 26 struct NetworkRoute; |
| 26 struct SentPacket; | 27 struct SentPacket; |
| 27 } | 28 } |
| 28 | 29 |
| 29 namespace webrtc { | 30 namespace webrtc { |
| 30 | 31 |
| 31 class BitrateController; | 32 class BitrateController; |
| 32 class Clock; | 33 class Clock; |
| 33 class ProbeController; | 34 class ProbeController; |
| 34 class ProcessThread; | 35 class ProcessThread; |
| 35 class RateLimiter; | 36 class RateLimiter; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 59 RemoteBitrateObserver* remote_bitrate_observer, | 60 RemoteBitrateObserver* remote_bitrate_observer, |
| 60 RtcEventLog* event_log); | 61 RtcEventLog* event_log); |
| 61 CongestionController(Clock* clock, | 62 CongestionController(Clock* clock, |
| 62 Observer* observer, | 63 Observer* observer, |
| 63 RemoteBitrateObserver* remote_bitrate_observer, | 64 RemoteBitrateObserver* remote_bitrate_observer, |
| 64 RtcEventLog* event_log, | 65 RtcEventLog* event_log, |
| 65 std::unique_ptr<PacketRouter> packet_router, | 66 std::unique_ptr<PacketRouter> packet_router, |
| 66 std::unique_ptr<PacedSender> pacer); | 67 std::unique_ptr<PacedSender> pacer); |
| 67 virtual ~CongestionController(); | 68 virtual ~CongestionController(); |
| 68 | 69 |
| 69 virtual void SetBweBitrates(int min_bitrate_bps, | 70 virtual void SetBweBitrates(int start_bitrate_bps, |
| 70 int start_bitrate_bps, | 71 int min_bitrate_bps, |
| 71 int max_bitrate_bps); | 72 int max_bitrate_bps); |
| 72 // Resets both the BWE state and the bitrate estimator. Note the first | 73 virtual void OnNetworkRouteChanged(const rtc::NetworkRoute& route); |
| 73 // argument is the bitrate_bps. | |
| 74 virtual void ResetBweAndBitrates(int bitrate_bps, | |
| 75 int min_bitrate_bps, | |
| 76 int max_bitrate_bps); | |
| 77 virtual void SignalNetworkState(NetworkState state); | |
| 78 virtual BitrateController* GetBitrateController() const; | 74 virtual BitrateController* GetBitrateController() const; |
| 79 virtual RemoteBitrateEstimator* GetRemoteBitrateEstimator( | 75 virtual RemoteBitrateEstimator* GetRemoteBitrateEstimator(bool send_side_bwe); |
| 80 bool send_side_bwe); | |
| 81 virtual int64_t GetPacerQueuingDelayMs() const; | 76 virtual int64_t GetPacerQueuingDelayMs() const; |
| 82 virtual PacedSender* pacer() { return pacer_.get(); } | 77 virtual PacedSender* pacer() { return pacer_.get(); } |
| 83 virtual PacketRouter* packet_router() { return packet_router_.get(); } | 78 virtual PacketRouter* packet_router() { return packet_router_.get(); } |
| 84 virtual TransportFeedbackObserver* GetTransportFeedbackObserver(); | 79 virtual TransportFeedbackObserver* GetTransportFeedbackObserver(); |
| 85 RateLimiter* GetRetransmissionRateLimiter(); | 80 RateLimiter* GetRetransmissionRateLimiter(); |
| 86 | 81 |
| 87 // SetAllocatedSendBitrateLimits sets bitrates limits imposed by send codec | 82 // SetAllocatedSendBitrateLimits sets bitrates limits imposed by send codec |
| 88 // settings. | 83 // settings. |
| 89 // |min_send_bitrate_bps| is the total minimum send bitrate required by all | 84 // |min_send_bitrate_bps| is the total minimum send bitrate required by all |
| 90 // sending streams. This is the minimum bitrate the PacedSender will use. | 85 // sending streams. This is the minimum bitrate the PacedSender will use. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 118 Clock* const clock_; | 113 Clock* const clock_; |
| 119 Observer* const observer_; | 114 Observer* const observer_; |
| 120 const std::unique_ptr<PacketRouter> packet_router_; | 115 const std::unique_ptr<PacketRouter> packet_router_; |
| 121 const std::unique_ptr<PacedSender> pacer_; | 116 const std::unique_ptr<PacedSender> pacer_; |
| 122 const std::unique_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; | 117 const std::unique_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; |
| 123 const std::unique_ptr<BitrateController> bitrate_controller_; | 118 const std::unique_ptr<BitrateController> bitrate_controller_; |
| 124 const std::unique_ptr<ProbeController> probe_controller_; | 119 const std::unique_ptr<ProbeController> probe_controller_; |
| 125 const std::unique_ptr<RateLimiter> retransmission_rate_limiter_; | 120 const std::unique_ptr<RateLimiter> retransmission_rate_limiter_; |
| 126 RemoteEstimatorProxy remote_estimator_proxy_; | 121 RemoteEstimatorProxy remote_estimator_proxy_; |
| 127 TransportFeedbackAdapter transport_feedback_adapter_; | 122 TransportFeedbackAdapter transport_feedback_adapter_; |
| 123 int start_bitrate_bps_; |
| 128 int min_bitrate_bps_; | 124 int min_bitrate_bps_; |
| 129 int max_bitrate_bps_; | 125 int max_bitrate_bps_; |
| 130 rtc::CriticalSection critsect_; | 126 rtc::CriticalSection critsect_; |
| 131 uint32_t last_reported_bitrate_bps_ GUARDED_BY(critsect_); | 127 uint32_t last_reported_bitrate_bps_ GUARDED_BY(critsect_); |
| 132 uint8_t last_reported_fraction_loss_ GUARDED_BY(critsect_); | 128 uint8_t last_reported_fraction_loss_ GUARDED_BY(critsect_); |
| 133 int64_t last_reported_rtt_ GUARDED_BY(critsect_); | 129 int64_t last_reported_rtt_ GUARDED_BY(critsect_); |
| 134 NetworkState network_state_ GUARDED_BY(critsect_); | 130 NetworkState network_state_ GUARDED_BY(critsect_); |
| 135 | 131 |
| 136 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CongestionController); | 132 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CongestionController); |
| 137 }; | 133 }; |
| 138 | 134 |
| 139 } // namespace webrtc | 135 } // namespace webrtc |
| 140 | 136 |
| 141 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_ | 137 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_ |
| OLD | NEW |