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

Unified Diff: webrtc/modules/bitrate_controller/bitrate_controller_impl.cc

Issue 1932683002: Remove ViEEncoder::SetNetworkStatus (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@move_pacer
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/bitrate_controller/bitrate_controller_impl.cc
diff --git a/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc b/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc
index f270f17670b06ee4cf089a49a1fb46c0c8fbf7c6..d36281af453f8cb944eb7dae359e9d644261735a 100644
--- a/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc
+++ b/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc
@@ -99,7 +99,7 @@ BitrateControllerImpl::BitrateControllerImpl(Clock* clock,
last_fraction_loss_(0),
last_rtt_ms_(0),
last_reserved_bitrate_bps_(0),
- send_queue_full_(false) {
+ send_queue_ready_(true) {
RTC_DCHECK(observer_);
RTC_DCHECK(pacer_);
// This calls the observer_, which means that the observer provided by the
@@ -204,12 +204,11 @@ void BitrateControllerImpl::MaybeTriggerOnNetworkChanged() {
if (network_changed) {
pacer_->SetNetWorkEstimateTargetBitrate(bitrate_bps);
}
- bool send_queue_full =
- pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs;
+ bool send_queue_ready = pacer_->CanSendMorePackets();
- bitrate_bps = send_queue_full ? 0 : bitrate_bps;
- if (UpdateSendQueueStatus(send_queue_full) ||
- (network_changed && !send_queue_full)) {
+ bitrate_bps = send_queue_ready ? bitrate_bps : 0;
+ if (UpdateSendQueueStatus(send_queue_ready) ||
+ (network_changed && send_queue_ready)) {
observer_->OnNetworkChanged(bitrate_bps, fraction_loss, rtt);
return;
}
@@ -240,13 +239,14 @@ bool BitrateControllerImpl::GetNetworkParameters(uint32_t* bitrate,
return new_bitrate;
}
-bool BitrateControllerImpl::UpdateSendQueueStatus(bool is_full) {
+bool BitrateControllerImpl::UpdateSendQueueStatus(bool is_ready) {
rtc::CritScope cs(&critsect_);
- bool changed = is_full != send_queue_full_;
- send_queue_full_ = is_full;
+ bool changed = is_ready != send_queue_ready_;
+ send_queue_ready_ = is_ready;
if (changed) {
LOG(LS_INFO) << "Send queue status changed state. "
- << " Queue is " << (changed ? "full" : "not full.");
+ << " Queue is "
+ << (send_queue_ready_ ? "ready." : " not ready.");
}
return changed;
}

Powered by Google App Engine
This is Rietveld 408576698