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

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/test/estimators/bbr.h

Issue 2982233002: Added implementations for entering/exiting STARTUP, DRAIN, PROBE_BW, PROBE_RTT modes, also updated M (Closed)
Patch Set: Added comments to variables. Created 3 years, 4 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) 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2017 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 11
12 #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_BBR_H_ 12 #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_BBR_H_
13 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_BBR_H_ 13 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_BBR_H_
14 14
15 #include <map> 15 #include <map>
16 #include <memory> 16 #include <memory>
17 #include <vector> 17 #include <vector>
18 18
19 #include "webrtc/modules/remote_bitrate_estimator/test/bwe.h" 19 #include "webrtc/modules/remote_bitrate_estimator/test/bwe.h"
20 #include "webrtc/rtc_base/optional.h"
20 21
21 namespace webrtc { 22 namespace webrtc {
22 namespace testing { 23 namespace testing {
23 namespace bwe { 24 namespace bwe {
24 class MaxBandwidthFilter; 25 class MaxBandwidthFilter;
25 class MinRttFilter; 26 class MinRttFilter;
26 class CongestionWindow; 27 class CongestionWindow;
27 class BbrBweSender : public BweSender { 28 class BbrBweSender : public BweSender {
28 public: 29 public:
29 explicit BbrBweSender(Clock* clock); 30 explicit BbrBweSender(Clock* clock);
(...skipping 22 matching lines...) Expand all
52 void GiveFeedback(const FeedbackPacket& feedback) override; 53 void GiveFeedback(const FeedbackPacket& feedback) override;
53 int64_t TimeUntilNextProcess() override; 54 int64_t TimeUntilNextProcess() override;
54 void Process() override; 55 void Process() override;
55 56
56 private: 57 private:
57 void EnterStartup(); 58 void EnterStartup();
58 bool UpdateBandwidthAndMinRtt(); 59 bool UpdateBandwidthAndMinRtt();
59 void TryExitingStartup(); 60 void TryExitingStartup();
60 void TryExitingDrain(int64_t now_ms); 61 void TryExitingDrain(int64_t now_ms);
61 void EnterProbeBw(int64_t now_ms); 62 void EnterProbeBw(int64_t now_ms);
62 void EnterProbeRtt(int64_t now_ms);
63 void TryUpdatingCyclePhase(int64_t now_ms); 63 void TryUpdatingCyclePhase(int64_t now_ms);
64 void TryEnteringProbeRtt(int64_t now_ms); 64 void TryEnteringProbeRtt(int64_t now_ms, bool min_rtt_expired);
65 void TryExitingProbeRtt(int64_t now_ms); 65 void TryExitingProbeRtt(int64_t now_ms, int64_t round);
66 size_t TargetCongestionWindow(float gain);
66 Clock* const clock_; 67 Clock* const clock_;
67 Mode mode_; 68 Mode mode_;
68 std::unique_ptr<MaxBandwidthFilter> max_bandwidth_filter_; 69 std::unique_ptr<MaxBandwidthFilter> max_bandwidth_filter_;
70 std::unique_ptr<MinRttFilter> min_rtt_filter_;
71 std::unique_ptr<CongestionWindow> congestion_window_;
69 uint64_t round_count_; 72 uint64_t round_count_;
70 uint64_t last_packet_sent_; 73 uint64_t last_packet_sent_;
71 uint64_t round_trip_end_; 74 uint64_t round_trip_end_;
72 float pacing_gain_; 75 float pacing_gain_;
73 float congestion_window_gain_; 76 float congestion_window_gain_;
74 77
75 // If optimal bandwidth has been discovered and reached, (for example after 78 // If optimal bandwidth has been discovered and reached, (for example after
76 // Startup mode) set this variable to true. 79 // Startup mode) set this variable to true.
77 bool full_bandwidth_reached_; 80 bool full_bandwidth_reached_;
81
82 // Entering time for PROBE_BW mode's cycle phase.
83 int64_t cycle_start_time_ms_;
84
85 // Index number of the currently used gain value in PROBE_BW mode, from 0 to
86 // kGainCycleLength - 1.
87 int64_t cycle_index_;
88
89 // Data inflight prior to the moment when last feedback was received.
90 size_t prior_in_flight_;
91
92 // Time we entered PROBE_RTT mode.
93 int64_t probe_rtt_start_time_ms_;
94
95 // First moment of time when data inflight decreased below
96 // kMinimumCongestionWindow in PROBE_RTT mode.
97 rtc::Optional<int64_t> minimum_congestion_window_start_time_ms_;
98
99 // First round when data inflight decreased below kMinimumCongestionWindow in
100 // PROBE_RTT mode.
101 int64_t minimum_congestion_window_start_round_;
78 }; 102 };
79 103
80 class BbrBweReceiver : public BweReceiver { 104 class BbrBweReceiver : public BweReceiver {
81 public: 105 public:
82 explicit BbrBweReceiver(int flow_id); 106 explicit BbrBweReceiver(int flow_id);
83 virtual ~BbrBweReceiver(); 107 virtual ~BbrBweReceiver();
84 void ReceivePacket(int64_t arrival_time_ms, 108 void ReceivePacket(int64_t arrival_time_ms,
85 const MediaPacket& media_packet) override; 109 const MediaPacket& media_packet) override;
86 FeedbackPacket* GetFeedback(int64_t now_ms) override; 110 FeedbackPacket* GetFeedback(int64_t now_ms) override;
87 111
88 private: 112 private:
89 SimulatedClock clock_; 113 SimulatedClock clock_;
90 }; 114 };
91 } // namespace bwe 115 } // namespace bwe
92 } // namespace testing 116 } // namespace testing
93 } // namespace webrtc 117 } // namespace webrtc
94 118
95 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_BBR_H_ 119 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_BBR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698