diff --git a/src/video_engine/include/vie_rtp_rtcp.h b/src/video_engine/include/vie_rtp_rtcp.h index bbaeae33b..f3a87667f 100644 --- a/src/video_engine/include/vie_rtp_rtcp.h +++ b/src/video_engine/include/vie_rtp_rtcp.h @@ -256,6 +256,16 @@ class WEBRTC_DLLEXPORT ViERTP_RTCP { const int video_channel, unsigned int* estimated_bandwidth) const = 0; + // This function sets various options for the bandwidth estimator + // code. The options are applied to new channels only. For a given + // channel, the options that are active at the time when the channel + // is created are immutable for that channel. See + // http://tools.ietf.org/html/draft-alvestrand-rtcweb-congestion-02 + // (or later, updated documentation) and common_types.h to get a + // feel for what the options do. + virtual int SetOverUseDetectorOptions( + const OverUseDetectorOptions& options) const = 0; + // This function enables capturing of RTP packets to a binary file on a // specific channel and for a given direction. The file can later be // replayed using e.g. RTP Tools rtpplay since the binary file format is diff --git a/src/video_engine/vie_rtp_rtcp_impl.cc b/src/video_engine/vie_rtp_rtcp_impl.cc index 5554734f1..2e009ffe4 100644 --- a/src/video_engine/vie_rtp_rtcp_impl.cc +++ b/src/video_engine/vie_rtp_rtcp_impl.cc @@ -761,6 +761,22 @@ int ViERTP_RTCPImpl::GetEstimatedReceiveBandwidth( static_cast(estimated_bandwidth)); } +int ViERTP_RTCPImpl::SetOverUseDetectorOptions( + const OverUseDetectorOptions& options) const { + if (!shared_data_->Initialized()) { + shared_data_->SetLastError(kViENotInitialized); + WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()), + "%s - ViE instance %d not initialized", __FUNCTION__, + shared_data_->instance_id()); + return -1; + } + // Lock the channel manager to avoid creating a channel with + // "undefined" bwe settings (atomic copy). + ViEChannelManagerScoped cs(*(shared_data_->channel_manager())); + shared_data_->SetOverUseDetectorOptions(options); + return 0; +} + int ViERTP_RTCPImpl::StartRTPDump(const int video_channel, const char file_nameUTF8[1024], RTPDirections direction) { diff --git a/src/video_engine/vie_rtp_rtcp_impl.h b/src/video_engine/vie_rtp_rtcp_impl.h index 89d4c8d18..1d96e084c 100644 --- a/src/video_engine/vie_rtp_rtcp_impl.h +++ b/src/video_engine/vie_rtp_rtcp_impl.h @@ -95,6 +95,8 @@ class ViERTP_RTCPImpl virtual int GetEstimatedReceiveBandwidth( const int video_channel, unsigned int* estimated_bandwidth) const; + virtual int SetOverUseDetectorOptions( + const OverUseDetectorOptions& options) const; virtual int StartRTPDump(const int video_channel, const char file_nameUTF8[1024], RTPDirections direction); diff --git a/src/video_engine/vie_shared_data.cc b/src/video_engine/vie_shared_data.cc index a39557892..b92714488 100644 --- a/src/video_engine/vie_shared_data.cc +++ b/src/video_engine/vie_shared_data.cc @@ -75,6 +75,11 @@ int ViESharedData::LastErrorInternal() const { return error; } +void ViESharedData::SetOverUseDetectorOptions( + const OverUseDetectorOptions& options) { + over_use_detector_options_ = options; +} + int ViESharedData::NumberOfCores() const { return number_cores_; } diff --git a/src/video_engine/vie_shared_data.h b/src/video_engine/vie_shared_data.h index 6621e4bb6..062e5c50a 100644 --- a/src/video_engine/vie_shared_data.h +++ b/src/video_engine/vie_shared_data.h @@ -34,7 +34,7 @@ class ViESharedData { int SetUnInitialized(); void SetLastError(const int error) const; int LastErrorInternal() const; - + void SetOverUseDetectorOptions(const OverUseDetectorOptions& options); int NumberOfCores() const; int instance_id() { return instance_id_;}