OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | |
3 * | |
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 | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 * | |
10 */ | |
11 | |
12 #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_BBR_H_ | |
13 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_BBR_H_ | |
14 | |
15 #include <climits> | |
16 #include <map> | |
17 #include <memory> | |
18 #include <vector> | |
19 #include <utility> | |
philipel
2017/05/29 09:38:50
Please add an empty line between 19 and 20.
gnish2
2017/05/29 11:04:26
Done.
| |
20 #include "webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h" | |
21 #include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h" | |
22 #include "webrtc/modules/remote_bitrate_estimator/test/bwe.h" | |
23 #include "webrtc/modules/remote_bitrate_estimator/test/estimators/stats.h" | |
24 | |
25 namespace webrtc { | |
26 namespace testing { | |
27 namespace bwe { | |
philipel
2017/05/29 09:38:50
newline 27-28
gnish2
2017/05/29 11:04:26
Done.
| |
28 class BbrBweSender : public BweSender { | |
29 public: | |
30 BbrBweSender(int kbps, BitrateObserver* observer, Clock* clock); | |
31 virtual ~BbrBweSender(); | |
32 | |
33 enum Mode { | |
34 // Startup phase. | |
35 STARTUP, | |
36 // Queue draining phase,which where created during startup. | |
37 DRAIN, | |
38 // Cruising. | |
39 PROBE_BW, | |
40 // Temporarily decreasing throughtput in order to measure | |
41 // minimum RTT. | |
42 PROBE_RTT | |
43 }; | |
44 | |
45 enum RecoveryState { | |
philipel
2017/05/29 09:38:50
If this is not used yet, remove it.
gnish2
2017/05/29 11:04:26
Done.
| |
46 // Do not limit number of packets sent. | |
47 NOT_IN_RECOVERY, | |
48 // Send one packet for each packet acknowledged. | |
49 CONSERVATION, | |
50 // Allow sending extra packet for each packet acknowledged | |
51 GROWTH | |
52 }; | |
53 | |
54 void OnPacketsSent(const Packets& packets) override; | |
55 void EnterStartup(); | |
56 void EnterDrain(const FeedbackPacket& feedback); | |
57 void EnterCruise(const FeedbackPacket& feedback); | |
58 void EnterDecreasingThroughput(const FeedbackPacket& feedback); | |
59 bool UpdateBandwidthAndMinRtt( | |
60 int64_t now, | |
61 const std::vector<std::pair<uint64_t, int64_t> >& feedback_vector, | |
philipel
2017/05/29 09:38:50
"> >" to ">>"
gnish2
2017/05/29 11:04:26
Done.
| |
62 int64_t bytes_acked); | |
63 void TryExitingStartup(); | |
64 void TryExitingDrain(int64_t now); | |
65 void EnterProbeBw(int64_t now); | |
66 void EnterProbeRtt(int64_t now); | |
67 void TryExitingProbeRtt(int64_t now); | |
68 void TryUpdatingCyclePhase(int64_t now); | |
69 int GetPacketSize(const uint64_t sequence_number); | |
70 int GetFeedbackIntervalMs() const override; | |
71 void GiveFeedback(const FeedbackPacket& feedback) override; | |
72 | |
73 int64_t TimeUntilNextProcess() override; | |
74 void Process() override; | |
75 | |
76 private: | |
77 Clock* const clock_; | |
78 BitrateObserver* const observer_; | |
79 int64_t last_feedback_ms_ = 0; | |
80 std::map<uint16_t, int64_t> send_time_; | |
81 Mode mode_; | |
82 Data* stats_; | |
83 uint64_t round_trip_end_; | |
84 int64_t rt_count_; | |
85 int64_t last_packet_sent_; | |
86 }; | |
philipel
2017/05/29 09:38:50
newline :)
gnish2
2017/05/29 11:04:26
Done.
| |
87 class BbrBweReceiver : public BweReceiver { | |
88 public: | |
89 explicit BbrBweReceiver(int flow_id); | |
90 virtual ~BbrBweReceiver(); | |
91 void ReceivePacket(int64_t arrival_time_ms, | |
92 const MediaPacket& media_packet) override; | |
93 FeedbackPacket* GetFeedback(int64_t now_ms) override; | |
94 static const int64_t kReceivingRateTimeWindowMs; | |
95 int64_t last_feedback_ms_; | |
96 | |
97 private: | |
98 SimulatedClock clock_; | |
99 std::vector<std::pair<uint64_t, int64_t> > packet_feedbacks_; | |
100 }; | |
101 } // namespace bwe | |
102 } // namespace testing | |
103 } // namespace webrtc | |
104 | |
105 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_BBR_H_ | |
OLD | NEW |