OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 using_absolute_send_time_ = false; | 108 using_absolute_send_time_ = false; |
109 PickEstimator(); | 109 PickEstimator(); |
110 } | 110 } |
111 } | 111 } |
112 } | 112 } |
113 } | 113 } |
114 | 114 |
115 // Instantiate RBE for Time Offset or Absolute Send Time extensions. | 115 // Instantiate RBE for Time Offset or Absolute Send Time extensions. |
116 void PickEstimator() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_.get()) { | 116 void PickEstimator() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_.get()) { |
117 if (using_absolute_send_time_) { | 117 if (using_absolute_send_time_) { |
118 rbe_.reset(new RemoteBitrateEstimatorAbsSendTime(observer_, clock_)); | 118 rbe_.reset(new RemoteBitrateEstimatorAbsSendTime(observer_)); |
119 } else { | 119 } else { |
120 rbe_.reset(new RemoteBitrateEstimatorSingleStream(observer_, clock_)); | 120 rbe_.reset(new RemoteBitrateEstimatorSingleStream(observer_, clock_)); |
121 } | 121 } |
122 rbe_->SetMinBitrate(min_bitrate_bps_); | 122 rbe_->SetMinBitrate(min_bitrate_bps_); |
123 } | 123 } |
124 | 124 |
125 RemoteBitrateObserver* observer_; | 125 RemoteBitrateObserver* observer_; |
126 Clock* const clock_; | 126 Clock* const clock_; |
127 std::unique_ptr<CriticalSectionWrapper> crit_sect_; | 127 std::unique_ptr<CriticalSectionWrapper> crit_sect_; |
128 std::unique_ptr<RemoteBitrateEstimator> rbe_; | 128 std::unique_ptr<RemoteBitrateEstimator> rbe_; |
(...skipping 20 matching lines...) Expand all Loading... |
149 remote_bitrate_estimator_( | 149 remote_bitrate_estimator_( |
150 new WrappingBitrateEstimator(remote_bitrate_observer, clock_)), | 150 new WrappingBitrateEstimator(remote_bitrate_observer, clock_)), |
151 // Constructed last as this object calls the provided callback on | 151 // Constructed last as this object calls the provided callback on |
152 // construction. | 152 // construction. |
153 bitrate_controller_( | 153 bitrate_controller_( |
154 BitrateController::CreateBitrateController(clock_, bitrate_observer)), | 154 BitrateController::CreateBitrateController(clock_, bitrate_observer)), |
155 remote_estimator_proxy_(clock_, &packet_router_), | 155 remote_estimator_proxy_(clock_, &packet_router_), |
156 transport_feedback_adapter_(bitrate_controller_.get(), clock_), | 156 transport_feedback_adapter_(bitrate_controller_.get(), clock_), |
157 min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps) { | 157 min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps) { |
158 transport_feedback_adapter_.SetBitrateEstimator( | 158 transport_feedback_adapter_.SetBitrateEstimator( |
159 new RemoteBitrateEstimatorAbsSendTime(&transport_feedback_adapter_, | 159 new RemoteBitrateEstimatorAbsSendTime(&transport_feedback_adapter_)); |
160 clock_)); | |
161 transport_feedback_adapter_.GetBitrateEstimator()->SetMinBitrate( | 160 transport_feedback_adapter_.GetBitrateEstimator()->SetMinBitrate( |
162 min_bitrate_bps_); | 161 min_bitrate_bps_); |
163 } | 162 } |
164 | 163 |
165 CongestionController::~CongestionController() { | 164 CongestionController::~CongestionController() { |
166 } | 165 } |
167 | 166 |
168 | 167 |
169 void CongestionController::SetBweBitrates(int min_bitrate_bps, | 168 void CongestionController::SetBweBitrates(int min_bitrate_bps, |
170 int start_bitrate_bps, | 169 int start_bitrate_bps, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 return std::min(bitrate_controller_->TimeUntilNextProcess(), | 238 return std::min(bitrate_controller_->TimeUntilNextProcess(), |
240 remote_bitrate_estimator_->TimeUntilNextProcess()); | 239 remote_bitrate_estimator_->TimeUntilNextProcess()); |
241 } | 240 } |
242 | 241 |
243 void CongestionController::Process() { | 242 void CongestionController::Process() { |
244 bitrate_controller_->Process(); | 243 bitrate_controller_->Process(); |
245 remote_bitrate_estimator_->Process(); | 244 remote_bitrate_estimator_->Process(); |
246 } | 245 } |
247 | 246 |
248 } // namespace webrtc | 247 } // namespace webrtc |
OLD | NEW |