OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 Loading... |
25 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat
or.h" | 25 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat
or.h" |
26 #include "webrtc/modules/remote_bitrate_estimator/inter_arrival.h" | 26 #include "webrtc/modules/remote_bitrate_estimator/inter_arrival.h" |
27 #include "webrtc/modules/remote_bitrate_estimator/overuse_detector.h" | 27 #include "webrtc/modules/remote_bitrate_estimator/overuse_detector.h" |
28 #include "webrtc/modules/remote_bitrate_estimator/overuse_estimator.h" | 28 #include "webrtc/modules/remote_bitrate_estimator/overuse_estimator.h" |
29 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | 29 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
30 | 30 |
31 namespace webrtc { | 31 namespace webrtc { |
32 | 32 |
33 class DelayBasedBwe : public RemoteBitrateEstimator { | 33 class DelayBasedBwe : public RemoteBitrateEstimator { |
34 public: | 34 public: |
35 explicit DelayBasedBwe(RemoteBitrateObserver* observer); | 35 DelayBasedBwe(RemoteBitrateObserver* observer, Clock* clock); |
36 virtual ~DelayBasedBwe() {} | 36 virtual ~DelayBasedBwe() {} |
37 | 37 |
38 void IncomingPacketFeedbackVector( | 38 void IncomingPacketFeedbackVector( |
39 const std::vector<PacketInfo>& packet_feedback_vector) override; | 39 const std::vector<PacketInfo>& packet_feedback_vector) override; |
40 | 40 |
41 void IncomingPacket(int64_t arrival_time_ms, | 41 void IncomingPacket(int64_t arrival_time_ms, |
42 size_t payload_size, | 42 size_t payload_size, |
43 const RTPHeader& header) override; | 43 const RTPHeader& header) override { |
44 | 44 RTC_NOTREACHED(); |
45 void IncomingPacket(int64_t arrival_time_ms, | 45 } |
46 size_t payload_size, | |
47 const RTPHeader& header, | |
48 int probe_cluster_id); | |
49 | 46 |
50 // This class relies on Process() being called periodically (at least once | 47 // This class relies on Process() being called periodically (at least once |
51 // every other second) for streams to be timed out properly. Therefore it | 48 // every other second) for streams to be timed out properly. Therefore it |
52 // shouldn't be detached from the ProcessThread except if it's about to be | 49 // shouldn't be detached from the ProcessThread except if it's about to be |
53 // deleted. | 50 // deleted. |
54 void Process() override; | 51 void Process() override; |
55 int64_t TimeUntilNextProcess() override; | 52 int64_t TimeUntilNextProcess() override; |
56 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; | 53 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; |
57 void RemoveStream(uint32_t ssrc) override; | 54 void RemoveStream(uint32_t ssrc) override; |
58 bool LatestEstimate(std::vector<uint32_t>* ssrcs, | 55 bool LatestEstimate(std::vector<uint32_t>* ssrcs, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 116 |
120 // Returns true if a probe which changed the estimate was detected. | 117 // Returns true if a probe which changed the estimate was detected. |
121 ProbeResult ProcessClusters(int64_t now_ms) EXCLUSIVE_LOCKS_REQUIRED(&crit_); | 118 ProbeResult ProcessClusters(int64_t now_ms) EXCLUSIVE_LOCKS_REQUIRED(&crit_); |
122 | 119 |
123 bool IsBitrateImproving(int probe_bitrate_bps) const | 120 bool IsBitrateImproving(int probe_bitrate_bps) const |
124 EXCLUSIVE_LOCKS_REQUIRED(&crit_); | 121 EXCLUSIVE_LOCKS_REQUIRED(&crit_); |
125 | 122 |
126 void TimeoutStreams(int64_t now_ms) EXCLUSIVE_LOCKS_REQUIRED(&crit_); | 123 void TimeoutStreams(int64_t now_ms) EXCLUSIVE_LOCKS_REQUIRED(&crit_); |
127 | 124 |
128 rtc::ThreadChecker network_thread_; | 125 rtc::ThreadChecker network_thread_; |
| 126 Clock* const clock_; |
129 RemoteBitrateObserver* const observer_; | 127 RemoteBitrateObserver* const observer_; |
130 std::unique_ptr<InterArrival> inter_arrival_; | 128 std::unique_ptr<InterArrival> inter_arrival_; |
131 std::unique_ptr<OveruseEstimator> estimator_; | 129 std::unique_ptr<OveruseEstimator> estimator_; |
132 OveruseDetector detector_; | 130 OveruseDetector detector_; |
133 RateStatistics incoming_bitrate_; | 131 RateStatistics incoming_bitrate_; |
134 std::vector<int> recent_propagation_delta_ms_; | |
135 std::vector<int64_t> recent_update_time_ms_; | |
136 std::list<Probe> probes_; | 132 std::list<Probe> probes_; |
137 size_t total_probes_received_; | 133 size_t total_probes_received_; |
138 int64_t first_packet_time_ms_; | 134 int64_t first_packet_time_ms_; |
139 int64_t last_update_ms_; | 135 int64_t last_update_ms_; |
140 | 136 |
141 rtc::CriticalSection crit_; | 137 rtc::CriticalSection crit_; |
142 Ssrcs ssrcs_ GUARDED_BY(&crit_); | 138 Ssrcs ssrcs_ GUARDED_BY(&crit_); |
143 AimdRateControl remote_rate_ GUARDED_BY(&crit_); | 139 AimdRateControl remote_rate_ GUARDED_BY(&crit_); |
144 | 140 |
145 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(DelayBasedBwe); | 141 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(DelayBasedBwe); |
146 }; | 142 }; |
147 | 143 |
148 } // namespace webrtc | 144 } // namespace webrtc |
149 | 145 |
150 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ | 146 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ |
OLD | NEW |