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:
@ -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() {
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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(¤t_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 {
|
||||
|
||||
Reference in New Issue
Block a user