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 18 matching lines...) Expand all Loading... |
29 | 29 |
30 namespace webrtc { | 30 namespace webrtc { |
31 | 31 |
32 class RtcEventLog; | 32 class RtcEventLog; |
33 | 33 |
34 class DelayBasedBwe { | 34 class DelayBasedBwe { |
35 public: | 35 public: |
36 static const int64_t kStreamTimeOutMs = 2000; | 36 static const int64_t kStreamTimeOutMs = 2000; |
37 | 37 |
38 struct Result { | 38 struct Result { |
39 Result() : updated(false), probe(false), target_bitrate_bps(0) {} | 39 Result(); |
40 Result(bool probe, uint32_t target_bitrate_bps) | 40 Result(bool probe, uint32_t target_bitrate_bps); |
41 : updated(true), probe(probe), target_bitrate_bps(target_bitrate_bps) {} | 41 ~Result(); |
42 bool updated; | 42 bool updated; |
43 bool probe; | 43 bool probe; |
44 uint32_t target_bitrate_bps; | 44 uint32_t target_bitrate_bps; |
| 45 bool recovered_from_overuse; |
45 }; | 46 }; |
46 | 47 |
47 DelayBasedBwe(RtcEventLog* event_log, const Clock* clock); | 48 DelayBasedBwe(RtcEventLog* event_log, const Clock* clock); |
48 virtual ~DelayBasedBwe(); | 49 virtual ~DelayBasedBwe(); |
49 | 50 |
50 Result IncomingPacketFeedbackVector( | 51 Result IncomingPacketFeedbackVector( |
51 const std::vector<PacketFeedback>& packet_feedback_vector, | 52 const std::vector<PacketFeedback>& packet_feedback_vector, |
52 rtc::Optional<uint32_t> acked_bitrate_bps); | 53 rtc::Optional<uint32_t> acked_bitrate_bps); |
53 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms); | 54 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms); |
54 bool LatestEstimate(std::vector<uint32_t>* ssrcs, | 55 bool LatestEstimate(std::vector<uint32_t>* ssrcs, |
55 uint32_t* bitrate_bps) const; | 56 uint32_t* bitrate_bps) const; |
56 void SetStartBitrate(int start_bitrate_bps); | 57 void SetStartBitrate(int start_bitrate_bps); |
57 void SetMinBitrate(int min_bitrate_bps); | 58 void SetMinBitrate(int min_bitrate_bps); |
58 int64_t GetExpectedBwePeriodMs() const; | 59 int64_t GetExpectedBwePeriodMs() const; |
59 | 60 |
60 private: | 61 private: |
61 void IncomingPacketFeedback(const PacketFeedback& packet_feedback); | 62 void IncomingPacketFeedback(const PacketFeedback& packet_feedback); |
62 Result OnLongFeedbackDelay(int64_t arrival_time_ms); | 63 Result OnLongFeedbackDelay(int64_t arrival_time_ms); |
63 | |
64 Result MaybeUpdateEstimate(bool overusing, | 64 Result MaybeUpdateEstimate(bool overusing, |
65 rtc::Optional<uint32_t> acked_bitrate_bps); | 65 rtc::Optional<uint32_t> acked_bitrate_bps, |
| 66 bool request_probe); |
66 // Updates the current remote rate estimate and returns true if a valid | 67 // Updates the current remote rate estimate and returns true if a valid |
67 // estimate exists. | 68 // estimate exists. |
68 bool UpdateEstimate(int64_t now_ms, | 69 bool UpdateEstimate(int64_t now_ms, |
69 rtc::Optional<uint32_t> acked_bitrate_bps, | 70 rtc::Optional<uint32_t> acked_bitrate_bps, |
70 bool overusing, | 71 bool overusing, |
71 uint32_t* target_bitrate_bps); | 72 uint32_t* target_bitrate_bps); |
72 | 73 |
73 rtc::RaceChecker network_race_; | 74 rtc::RaceChecker network_race_; |
74 RtcEventLog* const event_log_; | 75 RtcEventLog* const event_log_; |
75 const Clock* const clock_; | 76 const Clock* const clock_; |
(...skipping 11 matching lines...) Expand all Loading... |
87 uint32_t last_logged_bitrate_; | 88 uint32_t last_logged_bitrate_; |
88 BandwidthUsage last_logged_state_; | 89 BandwidthUsage last_logged_state_; |
89 bool in_sparse_update_experiment_; | 90 bool in_sparse_update_experiment_; |
90 | 91 |
91 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(DelayBasedBwe); | 92 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(DelayBasedBwe); |
92 }; | 93 }; |
93 | 94 |
94 } // namespace webrtc | 95 } // namespace webrtc |
95 | 96 |
96 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ | 97 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ |
OLD | NEW |