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

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

Issue 2924603002: Added implementation of four functions in the BBR congestion controller. (Closed)
Patch Set: Updated according to review. Created 3 years, 6 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 */
(...skipping 12 matching lines...) Expand all
23 #include "webrtc/modules/remote_bitrate_estimator/test/bwe.h" 23 #include "webrtc/modules/remote_bitrate_estimator/test/bwe.h"
24 24
25 namespace webrtc { 25 namespace webrtc {
26 namespace testing { 26 namespace testing {
27 namespace bwe { 27 namespace bwe {
28 class MaxBandwidthFilter; 28 class MaxBandwidthFilter;
29 class MinRttFilter; 29 class MinRttFilter;
30 class CongestionWindow; 30 class CongestionWindow;
31 class BbrBweSender : public BweSender { 31 class BbrBweSender : public BweSender {
32 public: 32 public:
33 BbrBweSender(); 33 explicit BbrBweSender(Clock* clock);
34 virtual ~BbrBweSender(); 34 virtual ~BbrBweSender();
35 enum Mode { 35 enum Mode {
36 // Startup phase. 36 // Startup phase.
37 STARTUP, 37 STARTUP,
38 // Queue draining phase, which where created during startup. 38 // Queue draining phase, which where created during startup.
39 DRAIN, 39 DRAIN,
40 // Cruising, probing new bandwidth. 40 // Cruising, probing new bandwidth.
41 PROBE_BW, 41 PROBE_BW,
42 // Temporarily limiting congestion window size in order to measure 42 // Temporarily limiting congestion window size in order to measure
43 // minimum RTT. 43 // minimum RTT.
(...skipping 15 matching lines...) Expand all
59 59
60 private: 60 private:
61 void EnterStartup(); 61 void EnterStartup();
62 bool UpdateBandwidthAndMinRtt(); 62 bool UpdateBandwidthAndMinRtt();
63 void TryExitingStartup(); 63 void TryExitingStartup();
64 void TryExitingDrain(int64_t now); 64 void TryExitingDrain(int64_t now);
65 void EnterProbeBw(int64_t now); 65 void EnterProbeBw(int64_t now);
66 void EnterProbeRtt(int64_t now); 66 void EnterProbeRtt(int64_t now);
67 void TryExitingProbeRtt(int64_t now); 67 void TryExitingProbeRtt(int64_t now);
68 void TryUpdatingCyclePhase(int64_t now); 68 void TryUpdatingCyclePhase(int64_t now);
69 void TryEnteringOrExitingProbeRtt(int64_t now);
70 Clock* const clock_;
71 Mode mode_;
72 std::unique_ptr<MaxBandwidthFilter> max_bandwidth_filter_;
73 uint64_t rt_count_;
terelius 2017/06/07 08:11:22 round_trip_count_ ?
gnish1 2017/06/07 09:25:56 Should be round_count,updated.
74 uint64_t last_packet_sent_;
75 uint64_t round_trip_end_;
76 float pacing_gain_;
77 float congestion_window_gain_;
78 bool full_bandwidth_reached_;
terelius 2017/06/07 08:11:22 I don't understand what this variable represents.
gnish1 2017/06/07 09:25:56 Done.
69 }; 79 };
70 80
71 class BbrBweReceiver : public BweReceiver { 81 class BbrBweReceiver : public BweReceiver {
72 public: 82 public:
73 explicit BbrBweReceiver(int flow_id); 83 explicit BbrBweReceiver(int flow_id);
74 virtual ~BbrBweReceiver(); 84 virtual ~BbrBweReceiver();
75 void ReceivePacket(int64_t arrival_time_ms, 85 void ReceivePacket(int64_t arrival_time_ms,
76 const MediaPacket& media_packet) override; 86 const MediaPacket& media_packet) override;
77 FeedbackPacket* GetFeedback(int64_t now_ms) override; 87 FeedbackPacket* GetFeedback(int64_t now_ms) override;
78 88
79 private: 89 private:
80 SimulatedClock clock_; 90 SimulatedClock clock_;
81 std::vector<std::pair<uint64_t, int64_t>> packet_feedbacks_; 91 std::vector<std::pair<uint64_t, int64_t>> packet_feedbacks_;
82 }; 92 };
83 } // namespace bwe 93 } // namespace bwe
84 } // namespace testing 94 } // namespace testing
85 } // namespace webrtc 95 } // namespace webrtc
86 96
87 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_BBR_H_ 97 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_BBR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698