From 40a3cc2ecb8e3debdf4960e4195178829ec13cbf Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 10 Jul 2019 20:55:01 -0700 Subject: [PATCH] Tweak on-screen overlay a bit --- .../binding/video/MediaCodecDecoderRenderer.java | 5 +++-- app/src/main/res/layout/activity_game.xml | 11 +++++++---- app/src/main/res/values/dimens.xml | 3 --- app/src/main/res/values/strings.xml | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/limelight/binding/video/MediaCodecDecoderRenderer.java b/app/src/main/java/com/limelight/binding/video/MediaCodecDecoderRenderer.java index e46f15e7..7bcc8a37 100644 --- a/app/src/main/java/com/limelight/binding/video/MediaCodecDecoderRenderer.java +++ b/app/src/main/java/com/limelight/binding/video/MediaCodecDecoderRenderer.java @@ -622,6 +622,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer { decoder = "(unknown)"; } + float decodeTimeMs = (float)lastTwo.decoderTimeMs / lastTwo.totalFramesReceived; String perfText = context.getString( R.string.perf_overlay_text, initialWidth + "x" + initialHeight, @@ -630,8 +631,8 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer { fps.receivedFps, fps.renderedFps, (float)lastTwo.framesLost / lastTwo.totalFrames * 100, - (float)lastTwo.totalTimeMs / lastTwo.totalFramesReceived, - (float)lastTwo.decoderTimeMs / lastTwo.totalFramesReceived); + ((float)lastTwo.totalTimeMs / lastTwo.totalFramesReceived) - decodeTimeMs, + decodeTimeMs); perfListener.onPerfUpdate(perfText); } diff --git a/app/src/main/res/layout/activity_game.xml b/app/src/main/res/layout/activity_game.xml index 4a67cd70..9bf4bee5 100644 --- a/app/src/main/res/layout/activity_game.xml +++ b/app/src/main/res/layout/activity_game.xml @@ -14,19 +14,22 @@ android:id="@+id/performanceOverlay" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginLeft="3dp" + android:layout_marginLeft="10dp" + android:layout_marginStart="10dp" + android:layout_marginTop="10dp" android:layout_gravity="left" android:textAppearance="?android:attr/textAppearanceSmall" - android:textSize="@dimen/font_size_tiny" android:gravity="left" + android:background="#80000000" android:visibility="gone" /> 16dp 16dp - - 8sp - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 96413b72..7e2eb098 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -86,7 +86,7 @@ Are you sure you want to delete this PC? Slow connection to PC\nReduce your bitrate Poor connection to PC - Video dimensions: %1$s\nDecoder: %2$s\nEstimated host PC frame rate: %3$.2f FPS\nIncoming frame rate from network: %4$.2f FPS\nRendering frame rate: %5$.2f FPS\nFrames dropped by your network connection: %6$.2f%%\nAverage frame time: %7$.2f ms\nAverage decoding time: %8$.2f ms + Video dimensions: %1$s\nDecoder: %2$s\nEstimated host PC frame rate: %3$.2f FPS\nIncoming frame rate from network: %4$.2f FPS\nRendering frame rate: %5$.2f FPS\nFrames dropped by your network connection: %6$.2f%%\nAverage receive time: %7$.2f ms\nAverage decoding time: %8$.2f ms Connecting to PC… @@ -187,6 +187,6 @@ Enable HDR (Experimental) Stream HDR when the game and PC GPU support it. HDR requires a GTX 1000 series GPU or later. Enable performance overlay - Display performance stats overlay + Display an on-screen overlay with real-time performance information while streaming