jitter_buffer updates:
1. Determining continuity based on pictureId and not seq. numbers when available. 2. Hybrid bug fix: Don't set to decodable when the nack list is empty. Review URL: http://webrtc-codereview.appspot.com/255001 git-svn-id: http://webrtc.googlecode.com/svn/trunk@878 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
7232ad78b2
commit
e203de7ba2
@ -614,26 +614,33 @@ VCMJitterBuffer::FindOldestCompleteContinuousFrame()
|
||||
|
||||
// we have a complete frame
|
||||
// check if it's continuous, otherwise we are missing a full frame
|
||||
// Use seqNum not timestamp since a full frame might be lost
|
||||
if (_lastDecodedSeqNum != -1 && !_waitingForKeyFrame)
|
||||
{
|
||||
// it's not enough that we have complete frame we need the layers to
|
||||
// be continuous too
|
||||
currentLow = oldestFrame->GetLowSeqNum();
|
||||
|
||||
WebRtc_UWord16 lastDecodedSeqNum = (WebRtc_UWord16)_lastDecodedSeqNum;
|
||||
|
||||
// We could have received the first packet of the last frame before a
|
||||
// long period if drop, that case is handled by GetNackList
|
||||
if (((WebRtc_UWord16)(lastDecodedSeqNum + 1)) != currentLow)
|
||||
{
|
||||
// Wait since we want a complete continuous frame
|
||||
return NULL;
|
||||
}
|
||||
// Use pictureId if available. Otherwise use seqNum and not timestamps, as
|
||||
// a complete frame might be lost
|
||||
// First determine if we are waiting for a key frame.
|
||||
if (_waitingForKeyFrame && oldestFrame->FrameType() != kVideoFrameKey) {
|
||||
return NULL;
|
||||
}
|
||||
else if (oldestFrame->FrameType() != kVideoFrameKey)
|
||||
{
|
||||
// Is this the first frame to be decoded?
|
||||
// Otherwise, verify continuity - use PictureId when available.
|
||||
if (_lastDecodedSeqNum == -1) {
|
||||
return oldestFrameItem;
|
||||
} else if (oldestFrame->PictureId() == kNoPictureId) {
|
||||
// It's not enough that we have a complete frame we need the layers to
|
||||
// be continuous too.
|
||||
currentLow = oldestFrame->GetLowSeqNum();
|
||||
WebRtc_UWord16 lastDecodedSeqNum = (WebRtc_UWord16)_lastDecodedSeqNum;
|
||||
|
||||
// We could have received the first packet of the last frame before a
|
||||
// long period if drop, that case is handled by GetNackList
|
||||
if (((WebRtc_UWord16)(lastDecodedSeqNum + 1)) != currentLow) {
|
||||
// Wait since we want a complete continuous frame
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else if (!ContinuousPictureId(oldestFrame->PictureId())) {
|
||||
// We don't have a continuous frame
|
||||
return NULL;
|
||||
}
|
||||
return oldestFrameItem;
|
||||
}
|
||||
@ -1460,10 +1467,11 @@ VCMJitterBuffer::CreateNackList(WebRtc_UWord16& nackSize, bool& listExtended)
|
||||
{
|
||||
// build external rttScore based on RTT value
|
||||
float rttScore = 1.0f;
|
||||
int ret =
|
||||
_frameBuffers[i]->ZeroOutSeqNumHybrid(_NACKSeqNumInternal,
|
||||
numberOfSeqNum,
|
||||
rttScore);
|
||||
if (_frameBuffers[i]->IsRetransmitted() == false)
|
||||
if (_frameBuffers[i]->IsRetransmitted() == false && ret != -1)
|
||||
{
|
||||
// If no retransmission required,set the state to decodable
|
||||
// meaning that we will not wait for NACK.
|
||||
|
@ -491,7 +491,7 @@ WebRtc_Word32
|
||||
VCMSessionInfo::ZeroOutSeqNum(WebRtc_Word32* list,
|
||||
WebRtc_Word32 numberOfSeqNum)
|
||||
{
|
||||
if ((NULL == list) || (numberOfSeqNum < 1))
|
||||
if (NULL == list || numberOfSeqNum < 1)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
@ -539,15 +539,10 @@ VCMSessionInfo::ZeroOutSeqNumHybrid(WebRtc_Word32* list,
|
||||
WebRtc_Word32 numberOfSeqNum,
|
||||
float rttScore)
|
||||
{
|
||||
if ((NULL == list) || (numberOfSeqNum < 1))
|
||||
if (NULL == list || numberOfSeqNum < 1)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (_lowSeqNum == -1)
|
||||
{
|
||||
// no media packets in this frame
|
||||
return 0;
|
||||
}
|
||||
|
||||
WebRtc_Word32 index = 0;
|
||||
// Find end point (index of entry that equals _lowSeqNum)
|
||||
|
Loading…
Reference in New Issue
Block a user