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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // Required by RemoteBitrateEstimator but does nothing. | 50 // Required by RemoteBitrateEstimator but does nothing. |
51 void RemoveStream(uint32_t ssrc) override; | 51 void RemoveStream(uint32_t ssrc) override; |
52 void IncomingPacket(int64_t arrival_time_ms, | 52 void IncomingPacket(int64_t arrival_time_ms, |
53 size_t payload_size, | 53 size_t payload_size, |
54 const RTPHeader& header) override { | 54 const RTPHeader& header) override { |
55 RTC_NOTREACHED(); | 55 RTC_NOTREACHED(); |
56 } | 56 } |
57 | 57 |
58 private: | 58 private: |
59 void IncomingPacketInfo(const PacketInfo& info); | 59 void IncomingPacketInfo(const PacketInfo& info); |
| 60 // Updates the current remote rate estimate and returns true if a valid |
| 61 // estimate exists. |
| 62 bool UpdateEstimate(int64_t packet_arrival_time_ms, |
| 63 int64_t now_ms, |
| 64 uint32_t* target_bitrate_bps) |
| 65 EXCLUSIVE_LOCKS_REQUIRED(crit_); |
60 | 66 |
61 rtc::ThreadChecker network_thread_; | 67 rtc::ThreadChecker network_thread_; |
62 Clock* const clock_; | 68 Clock* const clock_; |
63 RemoteBitrateObserver* const observer_; | 69 RemoteBitrateObserver* const observer_; |
64 std::unique_ptr<InterArrival> inter_arrival_; | 70 std::unique_ptr<InterArrival> inter_arrival_; |
65 std::unique_ptr<OveruseEstimator> estimator_; | 71 std::unique_ptr<OveruseEstimator> estimator_; |
66 OveruseDetector detector_; | 72 OveruseDetector detector_; |
67 RateStatistics incoming_bitrate_; | 73 RateStatistics incoming_bitrate_; |
68 int64_t first_packet_time_ms_; | |
69 int64_t last_update_ms_; | 74 int64_t last_update_ms_; |
70 int64_t last_seen_packet_ms_; | 75 int64_t last_seen_packet_ms_; |
71 bool uma_recorded_; | 76 bool uma_recorded_; |
72 | 77 |
73 rtc::CriticalSection crit_; | 78 rtc::CriticalSection crit_; |
74 AimdRateControl remote_rate_ GUARDED_BY(&crit_); | 79 AimdRateControl remote_rate_ GUARDED_BY(&crit_); |
75 ProbeBitrateEstimator probe_bitrate_estimator_ GUARDED_BY(&crit_); | 80 ProbeBitrateEstimator probe_bitrate_estimator_ GUARDED_BY(&crit_); |
76 | 81 |
77 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(DelayBasedBwe); | 82 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(DelayBasedBwe); |
78 }; | 83 }; |
79 | 84 |
80 } // namespace webrtc | 85 } // namespace webrtc |
81 | 86 |
82 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ | 87 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_DELAY_BASED_BWE_H_ |
OLD | NEW |