Remove extra depacketizer code handling packet sequencing since RTP FEC queue does that now

This commit is contained in:
Cameron Gutman
2017-06-10 15:52:20 -07:00
parent b83cafe845
commit 4113108f23
+11 -59
View File
@@ -420,54 +420,21 @@ void processRtpPayload(PNV_VIDEO_PACKET videoPacket, int length) {
flags = videoPacket->flags; flags = videoPacket->flags;
firstPacket = isFirstPacket(flags); firstPacket = isFirstPacket(flags);
// Drop duplicates or re-ordered packets
streamPacketIndex = videoPacket->streamPacketIndex; streamPacketIndex = videoPacket->streamPacketIndex;
if (isBeforeSignedInt((short)streamPacketIndex, (short)(lastPacketInStream + 1), 0)) {
return;
}
// Drop packets from a previously completed frame // The packets and frames must be in sequence from the FEC queue
if (isBeforeSignedInt(frameIndex, nextFrameNumber, 0)) { LC_ASSERT(!isBeforeSignedInt((short)streamPacketIndex, (short)(lastPacketInStream + 1), 0));
return; LC_ASSERT(!isBeforeSignedInt(frameIndex, nextFrameNumber, 0));
}
// Notify the listener of the latest frame we've seen from the PC // Notify the listener of the latest frame we've seen from the PC
connectionSawFrame(frameIndex); connectionSawFrame(frameIndex);
// Look for a frame start before receiving a frame end // Verify that we didn't receive an incomplete frame
if (firstPacket && decodingFrame) LC_ASSERT(firstPacket ^ decodingFrame);
{
Limelog("Network dropped end of a frame\n");
nextFrameNumber = frameIndex;
// Unexpected start of next frame before terminating the last
waitingForNextSuccessfulFrame = 1;
dropFrameState();
}
// Look for a non-frame start before a frame start
else if (!firstPacket && !decodingFrame) {
// Check if this looks like a real frame
if (flags == FLAG_CONTAINS_PIC_DATA ||
flags == FLAG_EOF ||
currentPos.length < nominalPacketDataLength)
{
Limelog("Network dropped beginning of a frame\n");
nextFrameNumber = frameIndex + 1;
waitingForNextSuccessfulFrame = 1;
dropFrameState();
decodingFrame = 0;
return;
}
else {
// FEC data
return;
}
}
// Check sequencing of this frame to ensure we didn't // Check sequencing of this frame to ensure we didn't
// miss one in between // miss one in between
else if (firstPacket) { if (firstPacket) {
// Make sure this is the next consecutive frame // Make sure this is the next consecutive frame
if (isBeforeSignedInt(nextFrameNumber, frameIndex, 1)) { if (isBeforeSignedInt(nextFrameNumber, frameIndex, 1)) {
Limelog("Network dropped an entire frame\n"); Limelog("Network dropped an entire frame\n");
@@ -477,32 +444,17 @@ void processRtpPayload(PNV_VIDEO_PACKET videoPacket, int length) {
waitingForNextSuccessfulFrame = 1; waitingForNextSuccessfulFrame = 1;
dropFrameState(); dropFrameState();
} }
else if (nextFrameNumber != frameIndex) { else {
// Duplicate packet or FEC dup LC_ASSERT(nextFrameNumber == frameIndex);
decodingFrame = 0;
return;
} }
// We're now decoding a frame // We're now decoding a frame
decodingFrame = 1; decodingFrame = 1;
} }
// If it's not the first packet of a frame // This must be the first packet in a frame or be contiguous with the last
// we need to drop it if the stream packet index // packet received.
// doesn't match LC_ASSERT(firstPacket || streamPacketIndex == (int)(lastPacketInStream + 1));
if (!firstPacket && decodingFrame) {
if (streamPacketIndex != (int)(lastPacketInStream + 1)) {
Limelog("Network dropped middle of a frame\n");
nextFrameNumber = frameIndex + 1;
waitingForNextSuccessfulFrame = 1;
dropFrameState();
decodingFrame = 0;
return;
}
}
// Notify the server of any packet losses // Notify the server of any packet losses
if (streamPacketIndex != (int)(lastPacketInStream + 1)) { if (streamPacketIndex != (int)(lastPacketInStream + 1)) {