Removing the threshold from the auto-mute APIs

The threshold is now set equal to the minimum bitrate of the
encoder. The test is also changed to have the REMB values
depend on the minimum bitrate from the encoder.

BUG=2436
R=pbos@webrtc.org, stefan@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5040 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrik.lundin@webrtc.org
2013-10-28 10:16:14 +00:00
parent fe5d36b6fe
commit 1a3a6e5340
12 changed files with 59 additions and 42 deletions

View File

@ -197,8 +197,8 @@ 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 EnableAutoMuting() {
return sender_->EnableAutoMuting();
}
virtual void DisableAutoMuting() {

View File

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

View File

@ -10,6 +10,8 @@
#include "webrtc/common_types.h"
#include <algorithm> // std::max
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/video_coding/codecs/interface/video_codec_interface.h"
#include "webrtc/modules/video_coding/main/source/encoded_frame.h"
@ -420,14 +422,28 @@ int VideoSender::StopDebugRecording() {
return VCM_OK;
}
void VideoSender::EnableAutoMuting(int threshold_bps, int window_bps) {
void VideoSender::EnableAutoMuting() {
CriticalSectionScoped cs(_sendCritSect);
return _mediaOpt.EnableAutoMuting(threshold_bps, window_bps);
VideoCodec current_send_codec;
if (SendCodec(&current_send_codec) != 0) {
assert(false); // Must set a send codec before enabling auto-mute.
return;
}
int threshold_bps;
if (current_send_codec.numberOfSimulcastStreams == 0) {
threshold_bps = current_send_codec.minBitrate * 1000;
} else {
threshold_bps = current_send_codec.simulcastStream[0].minBitrate * 1000;
}
// Set the hysteresis window to be at 10% of the threshold, but at least
// 10 kbps.
int window_bps = std::max(threshold_bps / 10, 10000);
_mediaOpt.EnableAutoMuting(threshold_bps, window_bps);
}
void VideoSender::DisableAutoMuting() {
CriticalSectionScoped cs(_sendCritSect);
return _mediaOpt.DisableAutoMuting();
_mediaOpt.DisableAutoMuting();
}
bool VideoSender::VideoMuted() const {