From 581c9438ca5052c10c8cad81327055d3ca772649 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 15 May 2021 14:40:31 -0500 Subject: [PATCH] Add network latency to stats overlay --- app/streaming/video/ffmpeg.cpp | 12 ++++++++++++ moonlight-common-c/moonlight-common-c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/streaming/video/ffmpeg.cpp b/app/streaming/video/ffmpeg.cpp index 05efbd50..abbb9de5 100644 --- a/app/streaming/video/ffmpeg.cpp +++ b/app/streaming/video/ffmpeg.cpp @@ -482,15 +482,27 @@ void FFmpegVideoDecoder::stringifyVideoStats(VIDEO_STATS& stats, char* output) } if (stats.renderedFrames != 0) { + uint32_t rtt, variance; + char rttString[32]; + + if (LiGetEstimatedRttInfo(&rtt, &variance)) { + sprintf(rttString, "%u ms (variance: %u ms)", rtt, variance); + } + else { + sprintf(rttString, "N/A"); + } + offset += sprintf(&output[offset], "Frames dropped by your network connection: %.2f%%\n" "Frames dropped due to network jitter: %.2f%%\n" + "Average network latency: %s\n" "Average receive time: %.2f ms\n" "Average decoding time: %.2f ms\n" "Average frame queue delay: %.2f ms\n" "Average rendering time (including monitor V-sync latency): %.2f ms\n", (float)stats.networkDroppedFrames / stats.totalFrames * 100, (float)stats.pacerDroppedFrames / stats.decodedFrames * 100, + rttString, (float)stats.totalReassemblyTime / stats.receivedFrames, (float)stats.totalDecodeTime / stats.decodedFrames, (float)stats.totalPacerTime / stats.renderedFrames, diff --git a/moonlight-common-c/moonlight-common-c b/moonlight-common-c/moonlight-common-c index ccaca624..edf18387 160000 --- a/moonlight-common-c/moonlight-common-c +++ b/moonlight-common-c/moonlight-common-c @@ -1 +1 @@ -Subproject commit ccaca624f37e9d00ceae7eee1596b40af92bdc4c +Subproject commit edf183870897ce9e74a83595ccef238f2c03e5b8