Removes the API for setting RX VAD since the RX vad should always be on anyways.
Review URL: http://webrtc-codereview.appspot.com/264001 git-svn-id: http://webrtc.googlecode.com/svn/trunk@897 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
5ae9f5ed6c
commit
e2a34f8275
@ -799,34 +799,6 @@ class AudioCodingModule: public Module {
|
|||||||
// Generate comfort noise when receiving DTX packets
|
// Generate comfort noise when receiving DTX packets
|
||||||
//
|
//
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
// WebRtc_Word16 SetReceiveVADStatus()
|
|
||||||
// configure VAD status i.e. on/off on the incoming stream
|
|
||||||
// Running VAD on decoded audio is desired in some applications, e.g.
|
|
||||||
// conferencing.
|
|
||||||
//
|
|
||||||
// Input:
|
|
||||||
// -enable : true to enable VAD on incoming stream, and false
|
|
||||||
// to disable.
|
|
||||||
//
|
|
||||||
// Return value:
|
|
||||||
// -1 if failed to enable/disable VAD,
|
|
||||||
// 0 if succeded to enable/disable VAD.
|
|
||||||
//
|
|
||||||
virtual WebRtc_Word16 SetReceiveVADStatus(const bool enable) = 0;
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
// bool ReceiveVADStatus()
|
|
||||||
// Call this API to get whether VAD is enabled on incoming stream or not.
|
|
||||||
// Running VAD on decoded audio is desired in some applications, e.g.
|
|
||||||
// conferencing.
|
|
||||||
//
|
|
||||||
// Return value:
|
|
||||||
// true if VAD is enabled on the incoming stream,
|
|
||||||
// false if VAD is disabled on the incoming stream.
|
|
||||||
//
|
|
||||||
virtual bool ReceiveVADStatus() const = 0;
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// WebRtc_Word16 SetReceiveVADMode()
|
// WebRtc_Word16 SetReceiveVADMode()
|
||||||
// Configure VAD aggressiveness on the incoming stream.
|
// Configure VAD aggressiveness on the incoming stream.
|
||||||
|
@ -142,6 +142,10 @@ ACMNetEQ::Init()
|
|||||||
}
|
}
|
||||||
_isInitialized[idx] = true;
|
_isInitialized[idx] = true;
|
||||||
}
|
}
|
||||||
|
if (EnableVAD() == -1)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -919,20 +923,14 @@ ACMNetEQ::RTPPack(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
ACMNetEQ::VADStatus() const
|
|
||||||
{
|
|
||||||
CriticalSectionScoped lock(*_netEqCritSect);
|
|
||||||
return _vadStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
WebRtc_Word16
|
WebRtc_Word16
|
||||||
ACMNetEQ::SetVADStatus(
|
ACMNetEQ::EnableVAD()
|
||||||
const bool status)
|
|
||||||
{
|
{
|
||||||
CriticalSectionScoped lock(*_netEqCritSect);
|
CriticalSectionScoped lock(*_netEqCritSect);
|
||||||
|
if (_vadStatus)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
for(WebRtc_Word16 idx = 0; idx < _numSlaves + 1; idx++)
|
for(WebRtc_Word16 idx = 0; idx < _numSlaves + 1; idx++)
|
||||||
{
|
{
|
||||||
if(!_isInitialized[idx])
|
if(!_isInitialized[idx])
|
||||||
@ -941,42 +939,16 @@ ACMNetEQ::SetVADStatus(
|
|||||||
"SetVADStatus: NetEq is not initialized.");
|
"SetVADStatus: NetEq is not initialized.");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if(_vadStatus && !status)
|
// VAD was off and we have to turn it on
|
||||||
|
if(EnableVADByIdxSafe(idx) < 0)
|
||||||
{
|
{
|
||||||
// We have been using VAD but we want to stop using it calling the
|
return -1;
|
||||||
// following function with NULL as VAD instance switches off the
|
|
||||||
// post-decode VAD
|
|
||||||
if(WebRtcNetEQ_SetVADInstance(_inst[idx], NULL,
|
|
||||||
(WebRtcNetEQ_VADInitFunction) WebRtcVad_Init,
|
|
||||||
(WebRtcNetEQ_VADSetmodeFunction) WebRtcVad_set_mode,
|
|
||||||
(WebRtcNetEQ_VADFunction) WebRtcVad_Process) < 0)
|
|
||||||
{
|
|
||||||
LogError("setVADinstance", idx);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
// Free VAD Memory
|
|
||||||
if(_ptrVADInst[idx] != NULL)
|
|
||||||
{
|
|
||||||
WebRtcVad_Free(_ptrVADInst[idx]);
|
|
||||||
_ptrVADInst[idx] = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set previous VAD status to UNKNOWN
|
|
||||||
_previousAudioActivity = AudioFrame::kVadUnknown;
|
|
||||||
}
|
}
|
||||||
else if(!_vadStatus && status)
|
|
||||||
{
|
|
||||||
// VAD was off and we have to turn it on
|
|
||||||
if(EnableVADByIdxSafe(idx) < 0)
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set previous VAD status to PASSIVE
|
// Set previous VAD status to PASSIVE
|
||||||
_previousAudioActivity = AudioFrame::kVadPassive;
|
_previousAudioActivity = AudioFrame::kVadPassive;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_vadStatus = status;
|
_vadStatus = true;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -249,28 +249,6 @@ public:
|
|||||||
//
|
//
|
||||||
WebRtc_Word32 ResetJitterStatistics() const;
|
WebRtc_Word32 ResetJitterStatistics() const;
|
||||||
|
|
||||||
//
|
|
||||||
// VADStatus()
|
|
||||||
// Get the current VAD status.
|
|
||||||
//
|
|
||||||
// Return value : True if VAD is enabled.
|
|
||||||
// False if VAD is disabled.
|
|
||||||
//
|
|
||||||
bool VADStatus() const;
|
|
||||||
|
|
||||||
//
|
|
||||||
// SetVADStatus()
|
|
||||||
// Enable/disable VAD.
|
|
||||||
//
|
|
||||||
// Input:
|
|
||||||
// - enable : Enable if true, disable if false.
|
|
||||||
//
|
|
||||||
// Return value : 0 if ok.
|
|
||||||
// -1 if an error occurred.
|
|
||||||
//
|
|
||||||
WebRtc_Word16 SetVADStatus(
|
|
||||||
const bool status);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// VADMode()
|
// VADMode()
|
||||||
// Get the current VAD Mode.
|
// Get the current VAD Mode.
|
||||||
@ -408,6 +386,14 @@ private:
|
|||||||
WebRtc_Word16 InitByIdxSafe(
|
WebRtc_Word16 InitByIdxSafe(
|
||||||
const WebRtc_Word16 idx);
|
const WebRtc_Word16 idx);
|
||||||
|
|
||||||
|
// EnableVAD()
|
||||||
|
// Enable VAD.
|
||||||
|
//
|
||||||
|
// Return value : 0 if ok.
|
||||||
|
// -1 if an error occurred.
|
||||||
|
//
|
||||||
|
WebRtc_Word16 EnableVAD();
|
||||||
|
|
||||||
WebRtc_Word16 EnableVADByIdxSafe(
|
WebRtc_Word16 EnableVADByIdxSafe(
|
||||||
const WebRtc_Word16 idx);
|
const WebRtc_Word16 idx);
|
||||||
|
|
||||||
|
@ -2094,26 +2094,6 @@ AudioCodingModuleImpl::PlayoutData10Ms(
|
|||||||
// Generate comfort noise when receiving DTX packets
|
// Generate comfort noise when receiving DTX packets
|
||||||
//
|
//
|
||||||
|
|
||||||
// Get VAD status on the incoming stream
|
|
||||||
bool
|
|
||||||
AudioCodingModuleImpl::ReceiveVADStatus() const
|
|
||||||
{
|
|
||||||
WEBRTC_TRACE(webrtc::kTraceModuleCall, webrtc::kTraceAudioCoding, _id,
|
|
||||||
"ReceiveVADStatus()");
|
|
||||||
return _netEq.VADStatus();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// configure VAD status i.e on/off on the incoming stream
|
|
||||||
WebRtc_Word16
|
|
||||||
AudioCodingModuleImpl::SetReceiveVADStatus(
|
|
||||||
const bool enable)
|
|
||||||
{
|
|
||||||
WEBRTC_TRACE(webrtc::kTraceModuleCall, webrtc::kTraceAudioCoding, _id,
|
|
||||||
"SetReceiveVADStatus()");
|
|
||||||
return _netEq.SetVADStatus(enable);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get VAD aggressiveness on the incoming stream
|
// Get VAD aggressiveness on the incoming stream
|
||||||
ACMVADMode
|
ACMVADMode
|
||||||
AudioCodingModuleImpl::ReceiveVADMode() const
|
AudioCodingModuleImpl::ReceiveVADMode() const
|
||||||
|
@ -152,13 +152,6 @@ public:
|
|||||||
WebRtc_Word32 RegisterVADCallback(
|
WebRtc_Word32 RegisterVADCallback(
|
||||||
ACMVADCallback* vadCallback);
|
ACMVADCallback* vadCallback);
|
||||||
|
|
||||||
// Get VAD status on the incoming stream
|
|
||||||
bool ReceiveVADStatus() const;
|
|
||||||
|
|
||||||
// configure VAD status i.e on/off on the incoming stream
|
|
||||||
WebRtc_Word16 SetReceiveVADStatus(
|
|
||||||
const bool enable);
|
|
||||||
|
|
||||||
// Get VAD aggressiveness on the incoming stream
|
// Get VAD aggressiveness on the incoming stream
|
||||||
ACMVADMode ReceiveVADMode() const;
|
ACMVADMode ReceiveVADMode() const;
|
||||||
|
|
||||||
|
@ -1401,8 +1401,6 @@ Channel::Init()
|
|||||||
// out-of-band Dtmf tones are played out by default
|
// out-of-band Dtmf tones are played out by default
|
||||||
(_audioCodingModule.SetDtmfPlayoutStatus(true) == -1) ||
|
(_audioCodingModule.SetDtmfPlayoutStatus(true) == -1) ||
|
||||||
#endif
|
#endif
|
||||||
// Enable RX VAD by default (improves output mixing).
|
|
||||||
(_audioCodingModule.SetReceiveVADStatus(true) == -1) ||
|
|
||||||
(_audioCodingModule.InitializeSender() == -1))
|
(_audioCodingModule.InitializeSender() == -1))
|
||||||
{
|
{
|
||||||
_engineStatisticsPtr->SetLastError(
|
_engineStatisticsPtr->SetLastError(
|
||||||
@ -4720,16 +4718,6 @@ Channel::RegisterRxVadObserver(VoERxVadCallback &observer)
|
|||||||
"RegisterRxVadObserver() observer already enabled");
|
"RegisterRxVadObserver() observer already enabled");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (!_audioCodingModule.ReceiveVADStatus())
|
|
||||||
{
|
|
||||||
if (_audioCodingModule.SetReceiveVADStatus(true) == -1)
|
|
||||||
{
|
|
||||||
_engineStatisticsPtr->SetLastError(
|
|
||||||
VE_AUDIO_CODING_MODULE_ERROR, kTraceError,
|
|
||||||
"RegisterRxVadObserver() failed to enable RX VAD");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_rxVadObserverPtr = &observer;
|
_rxVadObserverPtr = &observer;
|
||||||
_RxVadDetection = true;
|
_RxVadDetection = true;
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user