Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: webrtc/modules/congestion_controller/include/congestion_controller.h

Issue 2061423003: Refactor NACK bitrate allocation (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Moved rate limiter and addressed comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
(...skipping 14 matching lines...) Expand all
25 namespace rtc { 25 namespace rtc {
26 struct SentPacket; 26 struct SentPacket;
27 } 27 }
28 28
29 namespace webrtc { 29 namespace webrtc {
30 30
31 class BitrateController; 31 class BitrateController;
32 class BitrateObserver; 32 class BitrateObserver;
33 class Clock; 33 class Clock;
34 class ProcessThread; 34 class ProcessThread;
35 class RateLimiter;
danilchap 2016/06/28 14:26:18 this class is defined inside congestion_controller
sprang_webrtc 2016/07/04 09:33:03 Done.
35 class RemoteBitrateEstimator; 36 class RemoteBitrateEstimator;
36 class RemoteBitrateObserver; 37 class RemoteBitrateObserver;
37 class TransportFeedbackObserver; 38 class TransportFeedbackObserver;
38 39
39 class CongestionController : public CallStatsObserver, public Module { 40 class CongestionController : public CallStatsObserver, public Module {
40 public: 41 public:
41 // Observer class for bitrate changes announced due to change in bandwidth 42 // Observer class for bitrate changes announced due to change in bandwidth
42 // estimate or due to that the send pacer is full. Fraction loss and rtt is 43 // estimate or due to that the send pacer is full. Fraction loss and rtt is
43 // also part of this callback to allow the observer to optimize its settings 44 // also part of this callback to allow the observer to optimize its settings
44 // for different types of network environments. The bitrate does not include 45 // for different types of network environments. The bitrate does not include
(...skipping 26 matching lines...) Expand all
71 int start_bitrate_bps, 72 int start_bitrate_bps,
72 int max_bitrate_bps); 73 int max_bitrate_bps);
73 virtual void SignalNetworkState(NetworkState state); 74 virtual void SignalNetworkState(NetworkState state);
74 virtual BitrateController* GetBitrateController() const; 75 virtual BitrateController* GetBitrateController() const;
75 virtual RemoteBitrateEstimator* GetRemoteBitrateEstimator( 76 virtual RemoteBitrateEstimator* GetRemoteBitrateEstimator(
76 bool send_side_bwe); 77 bool send_side_bwe);
77 virtual int64_t GetPacerQueuingDelayMs() const; 78 virtual int64_t GetPacerQueuingDelayMs() const;
78 virtual PacedSender* pacer() { return pacer_.get(); } 79 virtual PacedSender* pacer() { return pacer_.get(); }
79 virtual PacketRouter* packet_router() { return packet_router_.get(); } 80 virtual PacketRouter* packet_router() { return packet_router_.get(); }
80 virtual TransportFeedbackObserver* GetTransportFeedbackObserver(); 81 virtual TransportFeedbackObserver* GetTransportFeedbackObserver();
82 NackRateLimiter* GetNackRateLimiter();
81 83
82 // SetAllocatedSendBitrateLimits sets bitrates limits imposed by send codec 84 // SetAllocatedSendBitrateLimits sets bitrates limits imposed by send codec
83 // settings. 85 // settings.
84 // |min_send_bitrate_bps| is the total minimum send bitrate required by all 86 // |min_send_bitrate_bps| is the total minimum send bitrate required by all
85 // sending streams. This is the minimum bitrate the PacedSender will use. 87 // sending streams. This is the minimum bitrate the PacedSender will use.
86 // Note that CongestionController::OnNetworkChanged can still be called with 88 // Note that CongestionController::OnNetworkChanged can still be called with
87 // a lower bitrate estimate. 89 // a lower bitrate estimate.
88 // |max_padding_bitrate_bps| is the max bitrate the send streams request for 90 // |max_padding_bitrate_bps| is the max bitrate the send streams request for
89 // padding. This can be higher than the current network estimate and tells 91 // padding. This can be higher than the current network estimate and tells
90 // the PacedSender how much it should max pad unless there is real packets to 92 // the PacedSender how much it should max pad unless there is real packets to
(...skipping 18 matching lines...) Expand all
109 bool IsNetworkDown() const; 111 bool IsNetworkDown() const;
110 bool HasNetworkParametersToReportChanged(uint32_t bitrate_bps, 112 bool HasNetworkParametersToReportChanged(uint32_t bitrate_bps,
111 uint8_t fraction_loss, 113 uint8_t fraction_loss,
112 int64_t rtt); 114 int64_t rtt);
113 Clock* const clock_; 115 Clock* const clock_;
114 Observer* const observer_; 116 Observer* const observer_;
115 const std::unique_ptr<PacketRouter> packet_router_; 117 const std::unique_ptr<PacketRouter> packet_router_;
116 const std::unique_ptr<PacedSender> pacer_; 118 const std::unique_ptr<PacedSender> pacer_;
117 const std::unique_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; 119 const std::unique_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
118 const std::unique_ptr<BitrateController> bitrate_controller_; 120 const std::unique_ptr<BitrateController> bitrate_controller_;
121 const std::unique_ptr<RateLimiter> nack_rate_limiter_;
119 RemoteEstimatorProxy remote_estimator_proxy_; 122 RemoteEstimatorProxy remote_estimator_proxy_;
120 TransportFeedbackAdapter transport_feedback_adapter_; 123 TransportFeedbackAdapter transport_feedback_adapter_;
121 int min_bitrate_bps_; 124 int min_bitrate_bps_;
122 rtc::CriticalSection critsect_; 125 rtc::CriticalSection critsect_;
123 uint32_t last_reported_bitrate_bps_ GUARDED_BY(critsect_); 126 uint32_t last_reported_bitrate_bps_ GUARDED_BY(critsect_);
124 uint8_t last_reported_fraction_loss_ GUARDED_BY(critsect_); 127 uint8_t last_reported_fraction_loss_ GUARDED_BY(critsect_);
125 int64_t last_reported_rtt_ GUARDED_BY(critsect_); 128 int64_t last_reported_rtt_ GUARDED_BY(critsect_);
126 NetworkState network_state_ GUARDED_BY(critsect_); 129 NetworkState network_state_ GUARDED_BY(critsect_);
127 130
128 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CongestionController); 131 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CongestionController);
129 }; 132 };
130 133
131 } // namespace webrtc 134 } // namespace webrtc
132 135
133 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_ 136 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698