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

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

Issue 2628563003: Propagate packet pacing information to SenTimeHistory (Closed)
Patch Set: . Created 3 years, 11 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
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/base/deprecation.h"
18 #include "webrtc/common_types.h" 18 #include "webrtc/common_types.h"
19 #include "webrtc/modules/congestion_controller/transport_feedback_adapter.h" 19 #include "webrtc/modules/congestion_controller/transport_feedback_adapter.h"
20 #include "webrtc/modules/include/module.h" 20 #include "webrtc/modules/include/module.h"
21 #include "webrtc/modules/include/module_common_types.h" 21 #include "webrtc/modules/include/module_common_types.h"
22 #include "webrtc/modules/pacing/bitrate_prober.h"
23 #include "webrtc/modules/pacing/paced_sender.h"
22 #include "webrtc/modules/pacing/packet_router.h" 24 #include "webrtc/modules/pacing/packet_router.h"
23 #include "webrtc/modules/pacing/paced_sender.h"
24 #include "webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h" 25 #include "webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h"
25 26
26 namespace rtc { 27 namespace rtc {
27 struct SentPacket; 28 struct SentPacket;
28 } 29 }
29 30
30 namespace webrtc { 31 namespace webrtc {
31 32
32 class BitrateController; 33 class BitrateController;
33 class Clock; 34 class Clock;
34 class ProbeController; 35 class ProbeController;
35 class RateLimiter; 36 class RateLimiter;
36 class RemoteBitrateEstimator; 37 class RemoteBitrateEstimator;
37 class RemoteBitrateObserver; 38 class RemoteBitrateObserver;
38 class RtcEventLog; 39 class RtcEventLog;
39 class TransportFeedbackObserver; 40 class TransportFeedbackObserver;
40 41
41 class CongestionController : public CallStatsObserver, public Module { 42 class CongestionController : public CallStatsObserver,
43 public Module,
44 public ProbeClusterCreatedObserver {
42 public: 45 public:
43 // Observer class for bitrate changes announced due to change in bandwidth 46 // Observer class for bitrate changes announced due to change in bandwidth
44 // estimate or due to that the send pacer is full. Fraction loss and rtt is 47 // estimate or due to that the send pacer is full. Fraction loss and rtt is
45 // also part of this callback to allow the observer to optimize its settings 48 // also part of this callback to allow the observer to optimize its settings
46 // for different types of network environments. The bitrate does not include 49 // for different types of network environments. The bitrate does not include
47 // packet headers and is measured in bits per second. 50 // packet headers and is measured in bits per second.
48 class Observer { 51 class Observer {
49 public: 52 public:
50 virtual void OnNetworkChanged(uint32_t bitrate_bps, 53 virtual void OnNetworkChanged(uint32_t bitrate_bps,
51 uint8_t fraction_loss, // 0 - 255. 54 uint8_t fraction_loss, // 0 - 255.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 110
108 virtual void OnSentPacket(const rtc::SentPacket& sent_packet); 111 virtual void OnSentPacket(const rtc::SentPacket& sent_packet);
109 112
110 // Implements CallStatsObserver. 113 // Implements CallStatsObserver.
111 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; 114 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override;
112 115
113 // Implements Module. 116 // Implements Module.
114 int64_t TimeUntilNextProcess() override; 117 int64_t TimeUntilNextProcess() override;
115 void Process() override; 118 void Process() override;
116 119
120 // Implements ProbeClusterCreatedObserver.
121 void OnProbingClusterCreated(int cluster_id,
122 int min_bytes,
123 int min_probes) override;
124
117 private: 125 private:
118 void MaybeTriggerOnNetworkChanged(); 126 void MaybeTriggerOnNetworkChanged();
119 127
120 bool IsSendQueueFull() const; 128 bool IsSendQueueFull() const;
121 bool IsNetworkDown() const; 129 bool IsNetworkDown() const;
122 bool HasNetworkParametersToReportChanged(uint32_t bitrate_bps, 130 bool HasNetworkParametersToReportChanged(uint32_t bitrate_bps,
123 uint8_t fraction_loss, 131 uint8_t fraction_loss,
124 int64_t rtt); 132 int64_t rtt);
125 Clock* const clock_; 133 Clock* const clock_;
126 Observer* const observer_; 134 Observer* const observer_;
(...skipping 12 matching lines...) Expand all
139 uint8_t last_reported_fraction_loss_ GUARDED_BY(critsect_); 147 uint8_t last_reported_fraction_loss_ GUARDED_BY(critsect_);
140 int64_t last_reported_rtt_ GUARDED_BY(critsect_); 148 int64_t last_reported_rtt_ GUARDED_BY(critsect_);
141 NetworkState network_state_ GUARDED_BY(critsect_); 149 NetworkState network_state_ GUARDED_BY(critsect_);
142 150
143 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CongestionController); 151 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CongestionController);
144 }; 152 };
145 153
146 } // namespace webrtc 154 } // namespace webrtc
147 155
148 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_ 156 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698