Revert of Remove SendPacer from ViEEncoder (patchset #13 id:240001 of https://codereview.webrtc.org/1917793002/ )
Reason for revert:
Fails in the waterfall here:
https://build.chromium.org/p/client.webrtc/builders/Win32%20Debug/builds/7832/steps/rtc_media_unittests/logs/stdio
Original issue's description:
> Remove SendPacer from ViEEncoder
>
> This CL moves the logic where the ViEEncoder pause if the pacer is full to the BitrateController. If the queue is full, the controller reports a bitrate of zero to Call (and BitrateAllocator)
>
> BUG=webrtc:5687
>
> Committed: https://crrev.com/857c5ccdb56e4c94196f7c6227abd5993c95abe2
> Cr-Commit-Position: refs/heads/master@{#12620}
TBR=stefan@webrtc.org,mflodman@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5687
Review-Url: https://codereview.webrtc.org/1947853002
Cr-Commit-Position: refs/heads/master@{#12621}
diff --git a/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc b/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc
index 09652d8..3c0d37c 100644
--- a/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc
+++ b/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc
@@ -83,10 +83,6 @@
return new BitrateControllerImpl(clock, observer);
}
-BitrateController* BitrateController::CreateBitrateController(Clock* clock) {
- return new BitrateControllerImpl(clock, nullptr);
-}
-
BitrateControllerImpl::BitrateControllerImpl(Clock* clock,
BitrateObserver* observer)
: clock_(clock),
@@ -98,8 +94,8 @@
last_fraction_loss_(0),
last_rtt_ms_(0),
last_reserved_bitrate_bps_(0) {
- // This calls the observer_ if set, which means that the observer provided by
- // the user must be ready to accept a bitrate update when it constructs the
+ // This calls the observer_, which means that the observer provided by the
+ // user must be ready to accept a bitrate update when it constructs the
// controller. We do this to avoid having to keep synchronized initial values
// in both the controller and the allocator.
MaybeTriggerOnNetworkChanged();
@@ -203,15 +199,11 @@
}
void BitrateControllerImpl::MaybeTriggerOnNetworkChanged() {
- if (!observer_)
- return;
-
- uint32_t bitrate_bps;
+ uint32_t bitrate;
uint8_t fraction_loss;
int64_t rtt;
-
- if (GetNetworkParameters(&bitrate_bps, &fraction_loss, &rtt))
- observer_->OnNetworkChanged(bitrate_bps, fraction_loss, rtt);
+ if (GetNetworkParameters(&bitrate, &fraction_loss, &rtt))
+ observer_->OnNetworkChanged(bitrate, fraction_loss, rtt);
}
bool BitrateControllerImpl::GetNetworkParameters(uint32_t* bitrate,