Wire up Nack for Voe

R=henrika@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4184 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pwestin@webrtc.org 2013-06-05 15:33:20 +00:00
parent 7f1b0ae888
commit db24995680
3 changed files with 25 additions and 1 deletions

View File

@ -4230,6 +4230,19 @@ Channel::GetFECStatus(bool& enabled, int& redPayloadtype)
return 0;
}
void Channel::SetNACKStatus(bool enable, int maxNumberOfPackets) {
// None of these functions can fail.
_rtpRtcpModule->SetStorePacketsStatus(enable, maxNumberOfPackets);
_rtpRtcpModule->SetNACKStatus(enable ? kNackRtcp : kNackOff,
maxNumberOfPackets);
}
// Called by the ACM when it's missing one or more packets.
int Channel::ResendPackets(const uint16_t* sequence_numbers,
int length) {
return _rtpRtcpModule->SendNACK(sequence_numbers, length);
}
int
Channel::StartRTPDump(const char fileNameUTF8[1024],
RTPDirections direction)

View File

@ -278,6 +278,8 @@ public:
int GetRTPStatistics(CallStatistics& stats);
int SetFECStatus(bool enable, int redPayloadtype);
int GetFECStatus(bool& enabled, int& redPayloadtype);
void SetNACKStatus(bool enable, int maxNumberOfPackets);
int ResendPackets(const uint16_t* sequence_numbers, int length);
int StartRTPDump(const char fileNameUTF8[1024], RTPDirections direction);
int StopRTPDump(RTPDirections direction);
bool RTPDumpIsActive(RTPDirections direction);

View File

@ -576,7 +576,16 @@ int VoERTP_RTCPImpl::SetNACKStatus(int channel,
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
"SetNACKStatus(channel=%d, enable=%d, maxNoPackets=%d)",
channel, enable, maxNoPackets);
// Dummy for now
voe::ScopedChannel sc(_shared->channel_manager(), channel);
voe::Channel* channelPtr = sc.ChannelPtr();
if (channelPtr == NULL)
{
_shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
"SetNACKStatus() failed to locate channel");
return -1;
}
channelPtr->SetNACKStatus(enable, maxNoPackets);
return 0;
}