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

Side by Side Diff: webrtc/modules/congestion_controller/congestion_controller.cc

Issue 2111813002: Revert of Move RtcEventLog object from inside VoiceEngine to Call. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 5 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) 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 uint32_t packets_since_absolute_send_time_; 146 uint32_t packets_since_absolute_send_time_;
147 int min_bitrate_bps_; 147 int min_bitrate_bps_;
148 148
149 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WrappingBitrateEstimator); 149 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WrappingBitrateEstimator);
150 }; 150 };
151 151
152 } // namespace 152 } // namespace
153 153
154 CongestionController::CongestionController( 154 CongestionController::CongestionController(
155 Clock* clock, 155 Clock* clock,
156 Observer* observer, 156 BitrateObserver* bitrate_observer,
157 RemoteBitrateObserver* remote_bitrate_observer, 157 RemoteBitrateObserver* remote_bitrate_observer)
158 RtcEventLog* event_log)
159 : clock_(clock), 158 : clock_(clock),
160 observer_(observer), 159 observer_(nullptr),
161 packet_router_(new PacketRouter()), 160 packet_router_(new PacketRouter()),
162 pacer_(new PacedSender(clock_, packet_router_.get())), 161 pacer_(new PacedSender(clock_, packet_router_.get())),
163 remote_bitrate_estimator_( 162 remote_bitrate_estimator_(
164 new WrappingBitrateEstimator(remote_bitrate_observer, clock_)), 163 new WrappingBitrateEstimator(remote_bitrate_observer, clock_)),
165 bitrate_controller_( 164 bitrate_controller_(
166 BitrateController::CreateBitrateController(clock_, event_log)), 165 BitrateController::CreateBitrateController(clock_, bitrate_observer)),
167 remote_estimator_proxy_(clock_, packet_router_.get()), 166 remote_estimator_proxy_(clock_, packet_router_.get()),
168 transport_feedback_adapter_(bitrate_controller_.get(), clock_), 167 transport_feedback_adapter_(bitrate_controller_.get(), clock_),
169 min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps), 168 min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps),
170 last_reported_bitrate_bps_(0), 169 last_reported_bitrate_bps_(0),
171 last_reported_fraction_loss_(0), 170 last_reported_fraction_loss_(0),
172 last_reported_rtt_(0), 171 last_reported_rtt_(0),
173 network_state_(kNetworkUp) { 172 network_state_(kNetworkUp) {
174 Init(); 173 Init();
175 } 174 }
176 175
177 CongestionController::CongestionController( 176 CongestionController::CongestionController(
178 Clock* clock, 177 Clock* clock,
179 Observer* observer, 178 Observer* observer,
179 RemoteBitrateObserver* remote_bitrate_observer)
180 : clock_(clock),
181 observer_(observer),
182 packet_router_(new PacketRouter()),
183 pacer_(new PacedSender(clock_, packet_router_.get())),
184 remote_bitrate_estimator_(
185 new WrappingBitrateEstimator(remote_bitrate_observer, clock_)),
186 bitrate_controller_(BitrateController::CreateBitrateController(clock_)),
187 remote_estimator_proxy_(clock_, packet_router_.get()),
188 transport_feedback_adapter_(bitrate_controller_.get(), clock_),
189 min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps),
190 last_reported_bitrate_bps_(0),
191 last_reported_fraction_loss_(0),
192 last_reported_rtt_(0),
193 network_state_(kNetworkUp) {
194 Init();
195 }
196
197 CongestionController::CongestionController(
198 Clock* clock,
199 Observer* observer,
180 RemoteBitrateObserver* remote_bitrate_observer, 200 RemoteBitrateObserver* remote_bitrate_observer,
181 RtcEventLog* event_log,
182 std::unique_ptr<PacketRouter> packet_router, 201 std::unique_ptr<PacketRouter> packet_router,
183 std::unique_ptr<PacedSender> pacer) 202 std::unique_ptr<PacedSender> pacer)
184 : clock_(clock), 203 : clock_(clock),
185 observer_(observer), 204 observer_(observer),
186 packet_router_(std::move(packet_router)), 205 packet_router_(std::move(packet_router)),
187 pacer_(std::move(pacer)), 206 pacer_(std::move(pacer)),
188 remote_bitrate_estimator_( 207 remote_bitrate_estimator_(
189 new WrappingBitrateEstimator(remote_bitrate_observer, clock_)), 208 new WrappingBitrateEstimator(remote_bitrate_observer, clock_)),
190 // Constructed last as this object calls the provided callback on 209 // Constructed last as this object calls the provided callback on
191 // construction. 210 // construction.
192 bitrate_controller_( 211 bitrate_controller_(BitrateController::CreateBitrateController(clock_)),
193 BitrateController::CreateBitrateController(clock_, event_log)),
194 remote_estimator_proxy_(clock_, packet_router_.get()), 212 remote_estimator_proxy_(clock_, packet_router_.get()),
195 transport_feedback_adapter_(bitrate_controller_.get(), clock_), 213 transport_feedback_adapter_(bitrate_controller_.get(), clock_),
196 min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps), 214 min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps),
197 last_reported_bitrate_bps_(0), 215 last_reported_bitrate_bps_(0),
198 last_reported_fraction_loss_(0), 216 last_reported_fraction_loss_(0),
199 last_reported_rtt_(0), 217 last_reported_rtt_(0),
200 network_state_(kNetworkUp) { 218 network_state_(kNetworkUp) {
201 Init(); 219 Init();
202 } 220 }
203 221
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 bool CongestionController::IsSendQueueFull() const { 367 bool CongestionController::IsSendQueueFull() const {
350 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; 368 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs;
351 } 369 }
352 370
353 bool CongestionController::IsNetworkDown() const { 371 bool CongestionController::IsNetworkDown() const {
354 rtc::CritScope cs(&critsect_); 372 rtc::CritScope cs(&critsect_);
355 return network_state_ == kNetworkDown; 373 return network_state_ == kNetworkDown;
356 } 374 }
357 375
358 } // namespace webrtc 376 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/congestion_controller/DEPS ('k') | webrtc/modules/congestion_controller/congestion_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698