Revert "Revert of Remove SendPacer from ViEEncoder (patchset #13 id:240001 of https://codereview.webrtc.org/1917793002/ )"

This reverts commit 825eb58d59940a4c3c9837595c4b3b07059c93ca.

This Relands the cl reviewed in https://codereview.webrtc.org/1917793002/

patchset #1 is a pure reland.
patchset #2 fix an overflow in BitrateProber that caused WebRtcVideoChannel2BaseTest.TwoStreamsSendAndReceive to fail.

Original cl 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)

R=stefan@webrtc.org
TBR=mflodman@webrtc.org

BUG=webrtc:5687

Review URL: https://codereview.webrtc.org/1947873002 .

Cr-Commit-Position: refs/heads/master@{#12630}
This commit is contained in:
Per
2016-05-04 17:12:51 +02:00
parent b49ac78c71
commit 28a44564c9
31 changed files with 577 additions and 366 deletions

View File

@ -28,6 +28,8 @@ namespace webrtc {
class BitrateControllerImpl : public BitrateController {
public:
// TODO(perkj): BitrateObserver has been deprecated and is not used in WebRTC.
// |observer| is left for project that is not yet updated.
BitrateControllerImpl(Clock* clock, BitrateObserver* observer);
virtual ~BitrateControllerImpl() {}
@ -50,6 +52,11 @@ class BitrateControllerImpl : public BitrateController {
void SetEventLog(RtcEventLog* event_log) override;
// Returns true if the parameters have changed since the last call.
bool GetNetworkParameters(uint32_t* bitrate,
uint8_t* fraction_loss,
int64_t* rtt) override;
int64_t TimeUntilNextProcess() override;
void Process() override;
@ -64,20 +71,16 @@ class BitrateControllerImpl : public BitrateController {
int number_of_packets,
int64_t now_ms);
// Deprecated
void MaybeTriggerOnNetworkChanged();
// Returns true if the parameters have changed since the last call.
bool GetNetworkParameters(uint32_t* bitrate,
uint8_t* fraction_loss,
int64_t* rtt);
void OnNetworkChanged(uint32_t bitrate,
uint8_t fraction_loss, // 0 - 255.
int64_t rtt) EXCLUSIVE_LOCKS_REQUIRED(critsect_);
// Used by process thread.
Clock* clock_;
BitrateObserver* observer_;
Clock* const clock_;
BitrateObserver* const observer_;
int64_t last_bitrate_update_ms_;
rtc::CriticalSection critsect_;