Support REMB in combination with send-side BWE.

BUG=webrtc:4173

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

Cr-Commit-Position: refs/heads/master@{#11322}
This commit is contained in:
stefan
2016-01-20 07:13:58 -08:00
committed by Commit bot
parent a5dec16b42
commit 32f81542c2
12 changed files with 206 additions and 24 deletions

View File

@ -27,11 +27,11 @@ const int64_t kBaseTimestampScaleFactor =
const int64_t kBaseTimestampRangeSizeUs = kBaseTimestampScaleFactor * (1 << 24);
TransportFeedbackAdapter::TransportFeedbackAdapter(
RtcpBandwidthObserver* bandwidth_observer,
BitrateController* bitrate_controller,
Clock* clock,
ProcessThread* process_thread)
: send_time_history_(clock, kSendTimeHistoryWindowMs),
rtcp_bandwidth_observer_(bandwidth_observer),
bitrate_controller_(bitrate_controller),
process_thread_(process_thread),
clock_(clock),
current_offset_ms_(kNoTimestamp),
@ -124,7 +124,7 @@ void TransportFeedbackAdapter::OnTransportFeedback(
void TransportFeedbackAdapter::OnReceiveBitrateChanged(
const std::vector<unsigned int>& ssrcs,
unsigned int bitrate) {
rtcp_bandwidth_observer_->OnReceivedEstimatedBitrate(bitrate);
bitrate_controller_->UpdateDelayBasedEstimate(bitrate);
}
void TransportFeedbackAdapter::OnRttUpdate(int64_t avg_rtt_ms,

View File

@ -15,7 +15,7 @@
#include "webrtc/base/criticalsection.h"
#include "webrtc/base/thread_annotations.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "webrtc/modules/bitrate_controller/include/bitrate_controller.h"
#include "webrtc/modules/include/module_common_types.h"
#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
#include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h"
@ -28,7 +28,7 @@ class TransportFeedbackAdapter : public TransportFeedbackObserver,
public CallStatsObserver,
public RemoteBitrateObserver {
public:
TransportFeedbackAdapter(RtcpBandwidthObserver* bandwidth_observer,
TransportFeedbackAdapter(BitrateController* bitrate_controller,
Clock* clock,
ProcessThread* process_thread);
virtual ~TransportFeedbackAdapter();
@ -54,7 +54,7 @@ class TransportFeedbackAdapter : public TransportFeedbackObserver,
rtc::CriticalSection lock_;
SendTimeHistory send_time_history_ GUARDED_BY(&lock_);
rtc::scoped_ptr<RtcpBandwidthObserver> rtcp_bandwidth_observer_;
BitrateController* bitrate_controller_;
rtc::scoped_ptr<RemoteBitrateEstimator> bitrate_estimator_;
ProcessThread* const process_thread_;
Clock* const clock_;

View File

@ -16,6 +16,7 @@
#include "webrtc/base/checks.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/bitrate_controller/include/mock/mock_bitrate_controller.h"
#include "webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitrate_estimator.h"
#include "webrtc/modules/remote_bitrate_estimator/transport_feedback_adapter.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
@ -34,13 +35,14 @@ class TransportFeedbackAdapterTest : public ::testing::Test {
TransportFeedbackAdapterTest()
: clock_(0),
bitrate_estimator_(nullptr),
bitrate_controller_(this),
receiver_estimated_bitrate_(0) {}
virtual ~TransportFeedbackAdapterTest() {}
virtual void SetUp() {
adapter_.reset(new TransportFeedbackAdapter(
new RtcpBandwidthObserverAdapter(this), &clock_, &process_thread_));
adapter_.reset(new TransportFeedbackAdapter(&bitrate_controller_, &clock_,
&process_thread_));
bitrate_estimator_ = new MockRemoteBitrateEstimator();
EXPECT_CALL(process_thread_, RegisterModule(bitrate_estimator_)).Times(1);
@ -55,19 +57,15 @@ class TransportFeedbackAdapterTest : public ::testing::Test {
protected:
// Proxy class used since TransportFeedbackAdapter will own the instance
// passed at construction.
class RtcpBandwidthObserverAdapter : public RtcpBandwidthObserver {
class MockBitrateControllerAdapter : public MockBitrateController {
public:
explicit RtcpBandwidthObserverAdapter(TransportFeedbackAdapterTest* owner)
: owner_(owner) {}
explicit MockBitrateControllerAdapter(TransportFeedbackAdapterTest* owner)
: MockBitrateController(), owner_(owner) {}
void OnReceivedEstimatedBitrate(uint32_t bitrate) override {
owner_->receiver_estimated_bitrate_ = bitrate;
}
~MockBitrateControllerAdapter() override {}
void OnReceivedRtcpReceiverReport(const ReportBlockList& report_blocks,
int64_t rtt,
int64_t now_ms) override {
RTC_NOTREACHED();
void UpdateDelayBasedEstimate(uint32_t bitrate_bps) override {
owner_->receiver_estimated_bitrate_ = bitrate_bps;
}
TransportFeedbackAdapterTest* const owner_;
@ -113,6 +111,7 @@ class TransportFeedbackAdapterTest : public ::testing::Test {
SimulatedClock clock_;
MockProcessThread process_thread_;
MockRemoteBitrateEstimator* bitrate_estimator_;
MockBitrateControllerAdapter bitrate_controller_;
rtc::scoped_ptr<TransportFeedbackAdapter> adapter_;
uint32_t receiver_estimated_bitrate_;