Propagate AutoMuter interface out to VideoCodingModule

BUG=2436
R=stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2311004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4878 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrik.lundin@webrtc.org
2013-09-30 12:16:08 +00:00
parent cc92e000f3
commit 572699d3eb
4 changed files with 43 additions and 0 deletions

View File

@ -579,6 +579,18 @@ public:
// Disables recording of debugging information.
virtual int StopDebugRecording() = 0;
// Enables AutoMuter to turn off video when the rate drops below
// |threshold_bps|, and turns back on when the rate goes back up above
// |threshold_bps| + |window_bps|.
virtual void EnableAutoMuting(int threshold_bps, int window_bps) = 0;
// Disables AutoMuter.
virtual void DisableAutoMuting() = 0;
// Returns true if AutoMuter is engaged and the video has been muted due to
// bandwidth limitations; otherwise false.
virtual bool VideoMuted() const = 0;
};
} // namespace webrtc

View File

@ -197,6 +197,18 @@ class VideoCodingModuleImpl : public VideoCodingModule {
return sender_->StopDebugRecording();
}
virtual void EnableAutoMuting(int threshold_bps, int window_bps) {
return sender_->EnableAutoMuting(threshold_bps, window_bps);
}
virtual void DisableAutoMuting() {
return sender_->DisableAutoMuting();
}
virtual bool VideoMuted() const {
return sender_->VideoMuted();
}
virtual int32_t InitializeReceiver() OVERRIDE {
return receiver_->InitializeReceiver();
}

View File

@ -95,6 +95,10 @@ class VideoSender {
int StartDebugRecording(const char* file_name_utf8);
int StopDebugRecording();
void EnableAutoMuting(int threshold_bps, int window_bps);
void DisableAutoMuting();
bool VideoMuted() const;
int32_t TimeUntilNextProcess();
int32_t Process();

View File

@ -420,5 +420,20 @@ int VideoSender::StopDebugRecording() {
return VCM_OK;
}
void VideoSender::EnableAutoMuting(int threshold_bps, int window_bps) {
CriticalSectionScoped cs(_sendCritSect);
return _mediaOpt.EnableAutoMuting(threshold_bps, window_bps);
}
void VideoSender::DisableAutoMuting() {
CriticalSectionScoped cs(_sendCritSect);
return _mediaOpt.DisableAutoMuting();
}
bool VideoSender::VideoMuted() const {
CriticalSectionScoped cs(_sendCritSect);
return _mediaOpt.video_muted();
}
} // namespace vcm
} // namespace webrtc