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

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: Removed all extra #include-s. 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 */
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 <climits> 15 #include <climits>
philipel 2017/06/08 14:12:34 Looks like more unused #includes :)
gnish1 2017/06/08 15:10:30 Done.
16 #include <map> 16 #include <map>
17 #include <vector>
17 #include <memory> 18 #include <memory>
18 #include <utility> 19 #include <utility>
19 #include <vector>
20 20
21 #include "webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h"
22 #include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h"
23 #include "webrtc/modules/remote_bitrate_estimator/test/bwe.h" 21 #include "webrtc/modules/remote_bitrate_estimator/test/bwe.h"
24 22
25 namespace webrtc { 23 namespace webrtc {
26 namespace testing { 24 namespace testing {
27 namespace bwe { 25 namespace bwe {
28 class MaxBandwidthFilter; 26 class MaxBandwidthFilter;
29 class MinRttFilter; 27 class MinRttFilter;
30 class CongestionWindow; 28 class CongestionWindow;
31 class BbrBweSender : public BweSender { 29 class BbrBweSender : public BweSender {
32 public: 30 public:
33 BbrBweSender(); 31 explicit BbrBweSender(Clock* clock);
34 virtual ~BbrBweSender(); 32 virtual ~BbrBweSender();
35 enum Mode { 33 enum Mode {
36 // Startup phase. 34 // Startup phase.
37 STARTUP, 35 STARTUP,
38 // Queue draining phase, which where created during startup. 36 // Queue draining phase, which where created during startup.
39 DRAIN, 37 DRAIN,
40 // Cruising, probing new bandwidth. 38 // Cruising, probing new bandwidth.
41 PROBE_BW, 39 PROBE_BW,
42 // Temporarily limiting congestion window size in order to measure 40 // Temporarily limiting congestion window size in order to measure
43 // minimum RTT. 41 // minimum RTT.
(...skipping 13 matching lines...) Expand all
57 int64_t TimeUntilNextProcess() override; 55 int64_t TimeUntilNextProcess() override;
58 void Process() override; 56 void Process() override;
59 57
60 private: 58 private:
61 void EnterStartup(); 59 void EnterStartup();
62 bool UpdateBandwidthAndMinRtt(); 60 bool UpdateBandwidthAndMinRtt();
63 void TryExitingStartup(); 61 void TryExitingStartup();
64 void TryExitingDrain(int64_t now); 62 void TryExitingDrain(int64_t now);
65 void EnterProbeBw(int64_t now); 63 void EnterProbeBw(int64_t now);
66 void EnterProbeRtt(int64_t now); 64 void EnterProbeRtt(int64_t now);
65 void TryUpdatingCyclePhase(int64_t now);
66 void TryEnteringProbeRtt(int64_t now);
67 void TryExitingProbeRtt(int64_t now); 67 void TryExitingProbeRtt(int64_t now);
68 void TryUpdatingCyclePhase(int64_t now); 68 Clock* const clock_;
69 Mode mode_;
70 std::unique_ptr<MaxBandwidthFilter> max_bandwidth_filter_;
71 uint64_t round_count_;
72 uint64_t last_packet_sent_;
73 uint64_t round_trip_end_;
74 float pacing_gain_;
75 float congestion_window_gain_;
76
77 // If optimal bandwidth has been discovered and reached, (for example after
78 // Startup mode) set this variable to true.
79 bool full_bandwidth_reached_;
69 }; 80 };
70 81
71 class BbrBweReceiver : public BweReceiver { 82 class BbrBweReceiver : public BweReceiver {
72 public: 83 public:
73 explicit BbrBweReceiver(int flow_id); 84 explicit BbrBweReceiver(int flow_id);
74 virtual ~BbrBweReceiver(); 85 virtual ~BbrBweReceiver();
75 void ReceivePacket(int64_t arrival_time_ms, 86 void ReceivePacket(int64_t arrival_time_ms,
76 const MediaPacket& media_packet) override; 87 const MediaPacket& media_packet) override;
77 FeedbackPacket* GetFeedback(int64_t now_ms) override; 88 FeedbackPacket* GetFeedback(int64_t now_ms) override;
78 89
79 private: 90 private:
80 SimulatedClock clock_; 91 SimulatedClock clock_;
81 std::vector<std::pair<uint64_t, int64_t>> packet_feedbacks_; 92 std::vector<std::pair<uint64_t, int64_t>> packet_feedbacks_;
82 }; 93 };
83 } // namespace bwe 94 } // namespace bwe
84 } // namespace testing 95 } // namespace testing
85 } // namespace webrtc 96 } // namespace webrtc
86 97
87 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_BBR_H_ 98 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_BBR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698