Improve debugging for A/V data loss and recovery

This commit is contained in:
Cameron Gutman 2021-06-08 20:01:58 -05:00
parent 5a71a4c092
commit 2228e4812d
3 changed files with 20 additions and 1 deletions

View File

@ -163,7 +163,7 @@ static void decodeInputData(PQUEUED_AUDIO_PACKET packet) {
PRTP_PACKET rtp = (PRTP_PACKET)&packet->data[0];
if (lastSeq != 0 && (unsigned short)(lastSeq + 1) != rtp->sequenceNumber) {
Limelog("Received OOS audio data (expected %d, but got %d)\n", lastSeq + 1, rtp->sequenceNumber);
Limelog("Network dropped audio data (expected %d, but received %d)\n", lastSeq + 1, rtp->sequenceNumber);
}
lastSeq = rtp->sequenceNumber;

View File

@ -12,6 +12,7 @@
// trigger the call to completeFecBlock(). Missing or OOO
// packets will do the job.
#define FEC_VALIDATION_MODE
#define FEC_VERBOSE
#endif
void RtpaInitializeQueue(PRTP_AUDIO_QUEUE queue) {
@ -163,6 +164,7 @@ static PRTPA_FEC_BLOCK getFecBlockForRtpPacket(PRTP_AUDIO_QUEUE queue, PRTP_PACK
blockSize = length - sizeof(RTP_PACKET) - sizeof(AUDIO_FEC_HEADER);
}
else {
Limelog("Invalid RTP audio payload type: %u\n", packet->packetType);
LC_ASSERT(false);
return NULL;
}
@ -334,6 +336,14 @@ static bool completeFecBlock(PRTP_AUDIO_QUEUE queue, PRTPA_FEC_BLOCK block) {
}
}
#ifdef FEC_VERBOSE
if (block->dataShardsReceived != RTPA_DATA_SHARDS) {
Limelog("Recovered %d audio data shards from block %d\n",
RTPA_DATA_SHARDS - block->dataShardsReceived,
block->fecHeader.baseSequenceNumber);
}
#endif
#ifdef FEC_VALIDATION_MODE
// Check the RTP header values
LC_ASSERT(block->dataPackets[dropIndex]->header == droppedRtpPacket->header);

View File

@ -6,6 +6,7 @@
// and recovered packet checks vs the original input. It
// is on by default for debug builds.
#define FEC_VALIDATION_MODE
#define FEC_VERBOSE
#endif
void RtpvInitializeQueue(PRTP_VIDEO_QUEUE queue) {
@ -236,6 +237,14 @@ static int reconstructFrame(PRTP_VIDEO_QUEUE queue) {
// If this fails, something is probably wrong with our FEC state.
LC_ASSERT(ret == 0);
#ifdef FEC_VERBOSE
if (queue->bufferDataPackets != queue->receivedBufferDataPackets) {
Limelog("Recovered %d video data shards from frame %d\n",
queue->bufferDataPackets - queue->receivedBufferDataPackets,
queue->currentFrameNumber);
}
#endif
cleanup_packets:
for (i = 0; i < totalPackets; i++) {
if (marks[i]) {