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 |
11 #include "webrtc/modules/congestion_controller/include/congestion_controller.h" | 11 #include "webrtc/modules/congestion_controller/include/congestion_controller.h" |
12 | 12 |
13 #include <algorithm> | 13 #include <algorithm> |
| 14 #include <memory> |
14 #include <vector> | 15 #include <vector> |
15 | 16 |
16 #include "webrtc/base/checks.h" | 17 #include "webrtc/base/checks.h" |
17 #include "webrtc/base/logging.h" | 18 #include "webrtc/base/logging.h" |
18 #include "webrtc/base/socket.h" | 19 #include "webrtc/base/socket.h" |
19 #include "webrtc/base/thread_annotations.h" | 20 #include "webrtc/base/thread_annotations.h" |
20 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" | 21 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" |
21 #include "webrtc/modules/pacing/paced_sender.h" | 22 #include "webrtc/modules/pacing/paced_sender.h" |
22 #include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h" | 23 #include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h" |
23 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_s
end_time.h" | 24 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_s
end_time.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 if (using_absolute_send_time_) { | 117 if (using_absolute_send_time_) { |
117 rbe_.reset(new RemoteBitrateEstimatorAbsSendTime(observer_, clock_)); | 118 rbe_.reset(new RemoteBitrateEstimatorAbsSendTime(observer_, clock_)); |
118 } else { | 119 } else { |
119 rbe_.reset(new RemoteBitrateEstimatorSingleStream(observer_, clock_)); | 120 rbe_.reset(new RemoteBitrateEstimatorSingleStream(observer_, clock_)); |
120 } | 121 } |
121 rbe_->SetMinBitrate(min_bitrate_bps_); | 122 rbe_->SetMinBitrate(min_bitrate_bps_); |
122 } | 123 } |
123 | 124 |
124 RemoteBitrateObserver* observer_; | 125 RemoteBitrateObserver* observer_; |
125 Clock* const clock_; | 126 Clock* const clock_; |
126 rtc::scoped_ptr<CriticalSectionWrapper> crit_sect_; | 127 std::unique_ptr<CriticalSectionWrapper> crit_sect_; |
127 rtc::scoped_ptr<RemoteBitrateEstimator> rbe_; | 128 std::unique_ptr<RemoteBitrateEstimator> rbe_; |
128 bool using_absolute_send_time_; | 129 bool using_absolute_send_time_; |
129 uint32_t packets_since_absolute_send_time_; | 130 uint32_t packets_since_absolute_send_time_; |
130 int min_bitrate_bps_; | 131 int min_bitrate_bps_; |
131 | 132 |
132 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WrappingBitrateEstimator); | 133 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WrappingBitrateEstimator); |
133 }; | 134 }; |
134 | 135 |
135 } // namespace | 136 } // namespace |
136 | 137 |
137 CongestionController::CongestionController( | 138 CongestionController::CongestionController( |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 return std::min(bitrate_controller_->TimeUntilNextProcess(), | 239 return std::min(bitrate_controller_->TimeUntilNextProcess(), |
239 remote_bitrate_estimator_->TimeUntilNextProcess()); | 240 remote_bitrate_estimator_->TimeUntilNextProcess()); |
240 } | 241 } |
241 | 242 |
242 void CongestionController::Process() { | 243 void CongestionController::Process() { |
243 bitrate_controller_->Process(); | 244 bitrate_controller_->Process(); |
244 remote_bitrate_estimator_->Process(); | 245 remote_bitrate_estimator_->Process(); |
245 } | 246 } |
246 | 247 |
247 } // namespace webrtc | 248 } // namespace webrtc |
OLD | NEW |