Split the NACK list into multiple RTCPs if it's too big.

TEST=rtp_rtcp_unittests
BUG=1434

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3609 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
stefan@webrtc.org
2013-03-05 09:02:06 +00:00
parent a856db26a6
commit a27107004d
5 changed files with 119 additions and 41 deletions

View File

@ -1324,7 +1324,7 @@ RTCPSender::BuildNACK(WebRtc_UWord8* rtcpbuffer,
// add the list
int i = 0;
int numOfNackFields = 0;
while(nackSize > i && numOfNackFields < 253)
while (nackSize > i && numOfNackFields < kRtcpMaxNackFields)
{
WebRtc_UWord16 nack = nackList[i];
// put dow our sequence number

View File

@ -22,6 +22,7 @@ enum { NACK_BYTECOUNT_SIZE = 60}; // size of our NACK history
// A sanity for the NACK list parsing at the send-side.
enum { kSendSideNackListSizeSanity = 20000 };
enum { kDefaultMaxReorderingThreshold = 50 }; // In sequence numbers.
enum { kRtcpMaxNackFields = 253 };
enum { RTCP_INTERVAL_VIDEO_MS = 1000 };
enum { RTCP_INTERVAL_AUDIO_MS = 5000 };

View File

@ -118,7 +118,7 @@ ModuleRtpRtcpImpl::ModuleRtpRtcpImpl(const Configuration& configuration)
dead_or_alive_timeout_ms_(0),
dead_or_alive_last_timer_(0),
nack_method_(kNackOff),
nack_last_time_sent_(0),
nack_last_time_sent_full_(0),
nack_last_seq_number_sent_(0),
simulcast_(false),
key_frame_req_method_(kKeyFrameReqFirRtp),
@ -1528,10 +1528,10 @@ WebRtc_Word32 ModuleRtpRtcpImpl::SendNACK(const WebRtc_UWord16* nack_list,
WebRtc_UWord16 nackLength = size;
WebRtc_UWord16 start_id = 0;
if (nack_last_time_sent_ < time_limit) {
if (nack_last_time_sent_full_ < time_limit) {
// Send list. Set the timer to make sure we only send a full NACK list once
// within every time_limit.
nack_last_time_sent_ = now;
nack_last_time_sent_full_ = now;
} else {
// Only send if extended list.
if (nack_last_seq_number_sent_ == nack_list[size - 1]) {
@ -1549,7 +1549,12 @@ WebRtc_Word32 ModuleRtpRtcpImpl::SendNACK(const WebRtc_UWord16* nack_list,
nackLength = size - start_id;
}
}
nack_last_seq_number_sent_ = nack_list[size - 1];
// Our RTCP NACK implementation is limited to kRtcpMaxNackFields sequence
// numbers per RTCP packet.
if (nackLength > kRtcpMaxNackFields) {
nackLength = kRtcpMaxNackFields;
}
nack_last_seq_number_sent_ = nack_list[start_id + nackLength - 1];
switch (nack_method_) {
case kNackRtcp:

View File

@ -504,7 +504,7 @@ class ModuleRtpRtcpImpl : public RtpRtcp {
WebRtc_Word64 dead_or_alive_last_timer_;
// Send side
NACKMethod nack_method_;
WebRtc_UWord32 nack_last_time_sent_;
WebRtc_UWord32 nack_last_time_sent_full_;
WebRtc_UWord16 nack_last_seq_number_sent_;
bool simulcast_;