OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 22 matching lines...) Expand all Loading... |
33 | 33 |
34 class NadaBweReceiver : public BweReceiver { | 34 class NadaBweReceiver : public BweReceiver { |
35 public: | 35 public: |
36 explicit NadaBweReceiver(int flow_id); | 36 explicit NadaBweReceiver(int flow_id); |
37 virtual ~NadaBweReceiver(); | 37 virtual ~NadaBweReceiver(); |
38 | 38 |
39 void ReceivePacket(int64_t arrival_time_ms, | 39 void ReceivePacket(int64_t arrival_time_ms, |
40 const MediaPacket& media_packet) override; | 40 const MediaPacket& media_packet) override; |
41 FeedbackPacket* GetFeedback(int64_t now_ms) override; | 41 FeedbackPacket* GetFeedback(int64_t now_ms) override; |
42 | 42 |
43 size_t RecentReceivingRate(); | |
44 static int64_t MedianFilter(int64_t* v, int size); | 43 static int64_t MedianFilter(int64_t* v, int size); |
45 static int64_t ExponentialSmoothingFilter(int64_t new_value, | 44 static int64_t ExponentialSmoothingFilter(int64_t new_value, |
46 int64_t last_smoothed_value, | 45 int64_t last_smoothed_value, |
47 float alpha); | 46 float alpha); |
48 | 47 |
49 static const int64_t kReceivingRateTimeWindowMs = 500; | 48 static const int64_t kReceivingRateTimeWindowMs = 500; |
50 | 49 |
51 private: | 50 private: |
52 SimulatedClock clock_; | 51 SimulatedClock clock_; |
53 int64_t last_feedback_ms_; | 52 int64_t last_feedback_ms_; |
(...skipping 28 matching lines...) Expand all Loading... |
82 double smoothing_factor); | 81 double smoothing_factor); |
83 | 82 |
84 int bitrate_kbps() const { return bitrate_kbps_; } | 83 int bitrate_kbps() const { return bitrate_kbps_; } |
85 void set_bitrate_kbps(int bitrate_kbps) { bitrate_kbps_ = bitrate_kbps; } | 84 void set_bitrate_kbps(int bitrate_kbps) { bitrate_kbps_ = bitrate_kbps; } |
86 bool original_operating_mode() const { return original_operating_mode_; } | 85 bool original_operating_mode() const { return original_operating_mode_; } |
87 void set_original_operating_mode(bool original_operating_mode) { | 86 void set_original_operating_mode(bool original_operating_mode) { |
88 original_operating_mode_ = original_operating_mode; | 87 original_operating_mode_ = original_operating_mode; |
89 } | 88 } |
90 int64_t NowMs() const { return clock_->TimeInMilliseconds(); } | 89 int64_t NowMs() const { return clock_->TimeInMilliseconds(); } |
91 | 90 |
92 static const int kMinRefRateKbps = 150; // Referred as R_min. | |
93 static const int kMaxRefRateKbps = 1500; // Referred as R_max. | |
94 | |
95 private: | 91 private: |
96 Clock* const clock_; | 92 Clock* const clock_; |
97 BitrateObserver* const observer_; | 93 BitrateObserver* const observer_; |
98 // Used as an upper bound for calling AcceleratedRampDown. | 94 // Used as an upper bound for calling AcceleratedRampDown. |
99 const float kMaxCongestionSignalMs = 40.0f + kMinRefRateKbps / 15; | 95 const float kMaxCongestionSignalMs = 40.0f + kMinBitrateKbps / 15; |
100 // Referred as R_min, default initialization for bitrate R_n. | 96 // Referred as R_min, default initialization for bitrate R_n. |
101 int bitrate_kbps_; // Referred as "Reference Rate" = R_n. | |
102 int64_t last_feedback_ms_ = 0; | 97 int64_t last_feedback_ms_ = 0; |
103 // Referred as delta_0, initialized as an upper bound. | 98 // Referred as delta_0, initialized as an upper bound. |
104 int64_t min_feedback_delay_ms_ = 200; | 99 int64_t min_feedback_delay_ms_ = 200; |
105 // Referred as RTT_0, initialized as an upper bound. | 100 // Referred as RTT_0, initialized as an upper bound. |
106 int64_t min_round_trip_time_ms_ = 100; | 101 int64_t min_round_trip_time_ms_ = 100; |
107 bool original_operating_mode_; | 102 bool original_operating_mode_; |
108 | 103 |
109 DISALLOW_IMPLICIT_CONSTRUCTORS(NadaBweSender); | 104 DISALLOW_IMPLICIT_CONSTRUCTORS(NadaBweSender); |
110 }; | 105 }; |
111 | 106 |
112 } // namespace bwe | 107 } // namespace bwe |
113 } // namespace testing | 108 } // namespace testing |
114 } // namespace webrtc | 109 } // namespace webrtc |
115 | 110 |
116 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_NADA_H_ | 111 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_NADA_H_ |
OLD | NEW |