mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-17 17:05:50 +00:00
Improve debugging for A/V data loss and recovery
This commit is contained in:
parent
5a71a4c092
commit
2228e4812d
@ -163,7 +163,7 @@ static void decodeInputData(PQUEUED_AUDIO_PACKET packet) {
|
|||||||
|
|
||||||
PRTP_PACKET rtp = (PRTP_PACKET)&packet->data[0];
|
PRTP_PACKET rtp = (PRTP_PACKET)&packet->data[0];
|
||||||
if (lastSeq != 0 && (unsigned short)(lastSeq + 1) != rtp->sequenceNumber) {
|
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;
|
lastSeq = rtp->sequenceNumber;
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
// trigger the call to completeFecBlock(). Missing or OOO
|
// trigger the call to completeFecBlock(). Missing or OOO
|
||||||
// packets will do the job.
|
// packets will do the job.
|
||||||
#define FEC_VALIDATION_MODE
|
#define FEC_VALIDATION_MODE
|
||||||
|
#define FEC_VERBOSE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void RtpaInitializeQueue(PRTP_AUDIO_QUEUE queue) {
|
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);
|
blockSize = length - sizeof(RTP_PACKET) - sizeof(AUDIO_FEC_HEADER);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Limelog("Invalid RTP audio payload type: %u\n", packet->packetType);
|
||||||
LC_ASSERT(false);
|
LC_ASSERT(false);
|
||||||
return NULL;
|
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
|
#ifdef FEC_VALIDATION_MODE
|
||||||
// Check the RTP header values
|
// Check the RTP header values
|
||||||
LC_ASSERT(block->dataPackets[dropIndex]->header == droppedRtpPacket->header);
|
LC_ASSERT(block->dataPackets[dropIndex]->header == droppedRtpPacket->header);
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
// and recovered packet checks vs the original input. It
|
// and recovered packet checks vs the original input. It
|
||||||
// is on by default for debug builds.
|
// is on by default for debug builds.
|
||||||
#define FEC_VALIDATION_MODE
|
#define FEC_VALIDATION_MODE
|
||||||
|
#define FEC_VERBOSE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void RtpvInitializeQueue(PRTP_VIDEO_QUEUE queue) {
|
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.
|
// If this fails, something is probably wrong with our FEC state.
|
||||||
LC_ASSERT(ret == 0);
|
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:
|
cleanup_packets:
|
||||||
for (i = 0; i < totalPackets; i++) {
|
for (i = 0; i < totalPackets; i++) {
|
||||||
if (marks[i]) {
|
if (marks[i]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user