| 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 |
| 11 #ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ | 11 #ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ |
| 12 #define WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ | 12 #define WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ |
| 13 | 13 |
| 14 #include <memory> | 14 #include <memory> |
| 15 #include <utility> | 15 #include <utility> |
| 16 #include <vector> | 16 #include <vector> |
| 17 | 17 |
| 18 #include "webrtc/base/checks.h" | 18 #include "webrtc/base/checks.h" |
| 19 #include "webrtc/base/constructormagic.h" | 19 #include "webrtc/base/constructormagic.h" |
| 20 #include "webrtc/base/rate_statistics.h" | 20 #include "webrtc/base/rate_statistics.h" |
| 21 #include "webrtc/base/thread_checker.h" | 21 #include "webrtc/base/thread_checker.h" |
| 22 #include "webrtc/modules/congestion_controller/probe_bitrate_estimator.h" | 22 #include "webrtc/modules/congestion_controller/probe_bitrate_estimator.h" |
| 23 #include "webrtc/modules/congestion_controller/probing_interval_estimator.h" |
| 23 #include "webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h" | 24 #include "webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h" |
| 24 #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" |
| 25 #include "webrtc/modules/remote_bitrate_estimator/inter_arrival.h" | 26 #include "webrtc/modules/remote_bitrate_estimator/inter_arrival.h" |
| 26 #include "webrtc/modules/remote_bitrate_estimator/overuse_detector.h" | 27 #include "webrtc/modules/remote_bitrate_estimator/overuse_detector.h" |
| 27 #include "webrtc/modules/remote_bitrate_estimator/overuse_estimator.h" | 28 #include "webrtc/modules/remote_bitrate_estimator/overuse_estimator.h" |
| 28 | 29 |
| 29 namespace webrtc { | 30 namespace webrtc { |
| 30 | 31 |
| 31 class DelayBasedBwe { | 32 class DelayBasedBwe { |
| 32 public: | 33 public: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 43 | 44 |
| 44 explicit DelayBasedBwe(Clock* clock); | 45 explicit DelayBasedBwe(Clock* clock); |
| 45 virtual ~DelayBasedBwe() {} | 46 virtual ~DelayBasedBwe() {} |
| 46 | 47 |
| 47 Result IncomingPacketFeedbackVector( | 48 Result IncomingPacketFeedbackVector( |
| 48 const std::vector<PacketInfo>& packet_feedback_vector); | 49 const std::vector<PacketInfo>& packet_feedback_vector); |
| 49 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms); | 50 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms); |
| 50 bool LatestEstimate(std::vector<uint32_t>* ssrcs, | 51 bool LatestEstimate(std::vector<uint32_t>* ssrcs, |
| 51 uint32_t* bitrate_bps) const; | 52 uint32_t* bitrate_bps) const; |
| 52 void SetMinBitrate(int min_bitrate_bps); | 53 void SetMinBitrate(int min_bitrate_bps); |
| 54 int GetProbingIntervalMs() const; |
| 53 | 55 |
| 54 private: | 56 private: |
| 55 // Computes a bayesian estimate of the throughput given acks containing | 57 // Computes a bayesian estimate of the throughput given acks containing |
| 56 // the arrival time and payload size. Samples which are far from the current | 58 // the arrival time and payload size. Samples which are far from the current |
| 57 // estimate or are based on few packets are given a smaller weight, as they | 59 // estimate or are based on few packets are given a smaller weight, as they |
| 58 // are considered to be more likely to have been caused by, e.g., delay spikes | 60 // are considered to be more likely to have been caused by, e.g., delay spikes |
| 59 // unrelated to congestion. | 61 // unrelated to congestion. |
| 60 class BitrateEstimator { | 62 class BitrateEstimator { |
| 61 public: | 63 public: |
| 62 BitrateEstimator(); | 64 BitrateEstimator(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 86 Clock* const clock_; | 88 Clock* const clock_; |
| 87 std::unique_ptr<InterArrival> inter_arrival_; | 89 std::unique_ptr<InterArrival> inter_arrival_; |
| 88 std::unique_ptr<OveruseEstimator> estimator_; | 90 std::unique_ptr<OveruseEstimator> estimator_; |
| 89 OveruseDetector detector_; | 91 OveruseDetector detector_; |
| 90 BitrateEstimator receiver_incoming_bitrate_; | 92 BitrateEstimator receiver_incoming_bitrate_; |
| 91 int64_t last_update_ms_; | 93 int64_t last_update_ms_; |
| 92 int64_t last_seen_packet_ms_; | 94 int64_t last_seen_packet_ms_; |
| 93 bool uma_recorded_; | 95 bool uma_recorded_; |
| 94 AimdRateControl rate_control_; | 96 AimdRateControl rate_control_; |
| 95 ProbeBitrateEstimator probe_bitrate_estimator_; | 97 ProbeBitrateEstimator probe_bitrate_estimator_; |
| 98 ProbingIntervalEstimator probing_interval_estimator_; |
| 96 | 99 |
| 97 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(DelayBasedBwe); | 100 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(DelayBasedBwe); |
| 98 }; | 101 }; |
| 99 | 102 |
| 100 } // namespace webrtc | 103 } // namespace webrtc |
| 101 | 104 |
| 102 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ | 105 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ |
| OLD | NEW |