diff --git a/webrtc/modules/video_coding/main/interface/video_coding.h b/webrtc/modules/video_coding/main/interface/video_coding.h index c4bb744cd..2b3c94bff 100644 --- a/webrtc/modules/video_coding/main/interface/video_coding.h +++ b/webrtc/modules/video_coding/main/interface/video_coding.h @@ -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 diff --git a/webrtc/modules/video_coding/main/source/video_coding_impl.cc b/webrtc/modules/video_coding/main/source/video_coding_impl.cc index 098c4fb44..922ecb433 100644 --- a/webrtc/modules/video_coding/main/source/video_coding_impl.cc +++ b/webrtc/modules/video_coding/main/source/video_coding_impl.cc @@ -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(); } diff --git a/webrtc/modules/video_coding/main/source/video_coding_impl.h b/webrtc/modules/video_coding/main/source/video_coding_impl.h index a7a6e4fc3..0605ae307 100644 --- a/webrtc/modules/video_coding/main/source/video_coding_impl.h +++ b/webrtc/modules/video_coding/main/source/video_coding_impl.h @@ -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(); diff --git a/webrtc/modules/video_coding/main/source/video_sender.cc b/webrtc/modules/video_coding/main/source/video_sender.cc index 26e31e0c6..d7ed3cf12 100644 --- a/webrtc/modules/video_coding/main/source/video_sender.cc +++ b/webrtc/modules/video_coding/main/source/video_sender.cc @@ -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