diff --git a/app/src/main/java/com/limelight/Game.java b/app/src/main/java/com/limelight/Game.java
index 3dac0f35..345e0b9a 100644
--- a/app/src/main/java/com/limelight/Game.java
+++ b/app/src/main/java/com/limelight/Game.java
@@ -865,34 +865,36 @@ public class Game extends Activity implements SurfaceHolder.Callback,
displayedFailureDialog = true;
stopConnection();
- int averageEndToEndLat = decoderRenderer.getAverageEndToEndLatency();
- int averageDecoderLat = decoderRenderer.getAverageDecoderLatency();
- String message = null;
- if (averageEndToEndLat > 0) {
- message = getResources().getString(R.string.conn_client_latency)+" "+averageEndToEndLat+" ms";
- if (averageDecoderLat > 0) {
- message += " ("+getResources().getString(R.string.conn_client_latency_hw)+" "+averageDecoderLat+" ms)";
+ if (prefConfig.enableLatencyToast) {
+ int averageEndToEndLat = decoderRenderer.getAverageEndToEndLatency();
+ int averageDecoderLat = decoderRenderer.getAverageDecoderLatency();
+ String message = null;
+ if (averageEndToEndLat > 0) {
+ message = getResources().getString(R.string.conn_client_latency)+" "+averageEndToEndLat+" ms";
+ if (averageDecoderLat > 0) {
+ message += " ("+getResources().getString(R.string.conn_client_latency_hw)+" "+averageDecoderLat+" ms)";
+ }
+ }
+ else if (averageDecoderLat > 0) {
+ message = getResources().getString(R.string.conn_hardware_latency)+" "+averageDecoderLat+" ms";
}
- }
- else if (averageDecoderLat > 0) {
- message = getResources().getString(R.string.conn_hardware_latency)+" "+averageDecoderLat+" ms";
- }
- // Add the video codec to the post-stream toast
- if (message != null) {
- if (videoFormat == MoonBridge.VIDEO_FORMAT_H265_MAIN10) {
- message += " [H.265 HDR]";
+ // Add the video codec to the post-stream toast
+ if (message != null) {
+ if (videoFormat == MoonBridge.VIDEO_FORMAT_H265_MAIN10) {
+ message += " [H.265 HDR]";
+ }
+ else if (videoFormat == MoonBridge.VIDEO_FORMAT_H265) {
+ message += " [H.265]";
+ }
+ else if (videoFormat == MoonBridge.VIDEO_FORMAT_H264) {
+ message += " [H.264]";
+ }
}
- else if (videoFormat == MoonBridge.VIDEO_FORMAT_H265) {
- message += " [H.265]";
- }
- else if (videoFormat == MoonBridge.VIDEO_FORMAT_H264) {
- message += " [H.264]";
- }
- }
- if (message != null) {
- Toast.makeText(this, message, Toast.LENGTH_LONG).show();
+ if (message != null) {
+ Toast.makeText(this, message, Toast.LENGTH_LONG).show();
+ }
}
// Clear the tombstone count if we terminated normally
diff --git a/app/src/main/java/com/limelight/preferences/PreferenceConfiguration.java b/app/src/main/java/com/limelight/preferences/PreferenceConfiguration.java
index 06f6777d..d9aca3c5 100644
--- a/app/src/main/java/com/limelight/preferences/PreferenceConfiguration.java
+++ b/app/src/main/java/com/limelight/preferences/PreferenceConfiguration.java
@@ -43,6 +43,7 @@ public class PreferenceConfiguration {
private static final String VIBRATE_FALLBACK_PREF_STRING = "checkbox_vibrate_fallback";
private static final String FLIP_FACE_BUTTONS_PREF_STRING = "checkbox_flip_face_buttons";
private static final String TOUCHSCREEN_TRACKPAD_PREF_STRING = "checkbox_touchscreen_trackpad";
+ private static final String LATENCY_TOAST_PREF_STRING = "checkbox_enable_post_stream_toast";
static final String DEFAULT_RESOLUTION = "1280x720";
static final String DEFAULT_FPS = "60";
@@ -72,6 +73,7 @@ public class PreferenceConfiguration {
private static final boolean DEFAULT_FLIP_FACE_BUTTONS = false;
private static final boolean DEFAULT_TOUCHSCREEN_TRACKPAD = true;
private static final String DEFAULT_AUDIO_CONFIG = "2"; // Stereo
+ private static final boolean DEFAULT_LATENCY_TOAST = false;
public static final int FORCE_H265_ON = -1;
public static final int AUTOSELECT_H265 = 0;
@@ -98,6 +100,7 @@ public class PreferenceConfiguration {
public boolean enableHdr;
public boolean enablePip;
public boolean enablePerfOverlay;
+ public boolean enableLatencyToast;
public boolean bindAllUsb;
public boolean mouseEmulation;
public boolean mouseNavButtons;
@@ -385,6 +388,7 @@ public class PreferenceConfiguration {
config.vibrateFallbackToDevice = prefs.getBoolean(VIBRATE_FALLBACK_PREF_STRING, DEFAULT_VIBRATE_FALLBACK);
config.flipFaceButtons = prefs.getBoolean(FLIP_FACE_BUTTONS_PREF_STRING, DEFAULT_FLIP_FACE_BUTTONS);
config.touchscreenTrackpad = prefs.getBoolean(TOUCHSCREEN_TRACKPAD_PREF_STRING, DEFAULT_TOUCHSCREEN_TRACKPAD);
+ config.enableLatencyToast = prefs.getBoolean(LATENCY_TOAST_PREF_STRING, DEFAULT_LATENCY_TOAST);
return config;
}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 2097aab8..ad2fa444 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -197,7 +197,9 @@
H.265 lowers video bandwidth requirements but requires a newer device
Enable HDR (Experimental)
Stream HDR when the game and PC GPU support it. HDR requires a GTX 1000 series GPU or later.
- Show performance stats
+ Show performance stats while streaming
Display real-time stream performance information while streaming
+ Show latency message after streaming
+ Display a latency information message after the stream ends
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
index 0e18d725..2e26ea09 100644
--- a/app/src/main/res/xml/preferences.xml
+++ b/app/src/main/res/xml/preferences.xml
@@ -201,5 +201,10 @@
android:title="@string/title_enable_perf_overlay"
android:summary="@string/summary_enable_perf_overlay"
android:defaultValue="false"/>
+