This CL is to adding feedback of packet loss rate to encoder in voice engine. A direct reason for doing it is to make use of Opus FEC, which can adapt itself to changes in the packet loss rate.

This CL is going to be combined with another CL in ACM, which is to be landed.

TEST=passed_try_bots
BUG=
R=stefan@webrtc.org, xians@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6262 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
minyue@webrtc.org
2014-05-28 09:52:06 +00:00
parent aca5939dfc
commit c1a40a7b68
15 changed files with 196 additions and 47 deletions

View File

@ -295,6 +295,41 @@ int VoECodecImpl::SetSendCNPayloadType(int channel, int type,
return channelPtr->SetSendCNPayloadType(type, frequency);
}
int VoECodecImpl::SetFECStatus(int channel, bool enable) {
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
"SetCodecFECStatus(channel=%d, enable=%d)", channel, enable);
if (!_shared->statistics().Initialized()) {
_shared->SetLastError(VE_NOT_INITED, kTraceError);
return -1;
}
voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
voe::Channel* channelPtr = ch.channel();
if (channelPtr == NULL) {
_shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
"SetCodecFECStatus() failed to locate channel");
return -1;
}
return channelPtr->SetCodecFECStatus(enable);
}
int VoECodecImpl::GetFECStatus(int channel, bool& enabled) {
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
"GetCodecFECStatus(channel=%d)", channel);
if (!_shared->statistics().Initialized()) {
_shared->SetLastError(VE_NOT_INITED, kTraceError);
return -1;
}
voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
voe::Channel* channelPtr = ch.channel();
if (channelPtr == NULL) {
_shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
"GetFECStatus() failed to locate channel");
return -1;
}
enabled = channelPtr->GetCodecFECStatus();
return 0;
}
int VoECodecImpl::SetVADStatus(int channel, bool enable, VadModes mode,
bool disableDTX)
{