Expose a function for setting bandwidth estimation parameters in ViERTP_RTCP.
Review URL: https://webrtc-codereview.appspot.com/678007 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2591 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -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
|
||||
|
@ -761,6 +761,22 @@ int ViERTP_RTCPImpl::GetEstimatedReceiveBandwidth(
|
||||
static_cast<WebRtc_UWord32*>(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) {
|
||||
|
@ -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);
|
||||
|
@ -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_;
|
||||
}
|
||||
|
@ -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_;}
|
||||
|
Reference in New Issue
Block a user