mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-02-16 02:20:55 +00:00
Introduce full range color option
This commit is contained in:
@@ -344,7 +344,12 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
}
|
||||
|
||||
public int getPreferredColorRange() {
|
||||
return MoonBridge.COLOR_RANGE_LIMITED;
|
||||
if (prefs.fullRange) {
|
||||
return MoonBridge.COLOR_RANGE_FULL;
|
||||
}
|
||||
else {
|
||||
return MoonBridge.COLOR_RANGE_LIMITED;
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyVideoForeground() {
|
||||
|
||||
@@ -48,6 +48,7 @@ public class PreferenceConfiguration {
|
||||
private static final String ABSOLUTE_MOUSE_MODE_PREF_STRING = "checkbox_absolute_mouse_mode";
|
||||
private static final String ENABLE_AUDIO_FX_PREF_STRING = "checkbox_enable_audiofx";
|
||||
private static final String REDUCE_REFRESH_RATE_PREF_STRING = "checkbox_reduce_refresh_rate";
|
||||
private static final String FULL_RANGE_PREF_STRING = "checkbox_full_range";
|
||||
|
||||
static final String DEFAULT_RESOLUTION = "1280x720";
|
||||
static final String DEFAULT_FPS = "60";
|
||||
@@ -80,6 +81,7 @@ public class PreferenceConfiguration {
|
||||
private static final boolean DEFAULT_ABSOLUTE_MOUSE_MODE = false;
|
||||
private static final boolean DEFAULT_ENABLE_AUDIO_FX = false;
|
||||
private static final boolean DEFAULT_REDUCE_REFRESH_RATE = false;
|
||||
private static final boolean DEFAULT_FULL_RANGE = false;
|
||||
|
||||
public static final int FORCE_H265_ON = -1;
|
||||
public static final int AUTOSELECT_H265 = 0;
|
||||
@@ -124,6 +126,7 @@ public class PreferenceConfiguration {
|
||||
public boolean absoluteMouseMode;
|
||||
public boolean enableAudioFx;
|
||||
public boolean reduceRefreshRate;
|
||||
public boolean fullRange;
|
||||
|
||||
public static boolean isNativeResolution(int width, int height) {
|
||||
// It's not a native resolution if it matches an existing resolution option
|
||||
@@ -348,6 +351,7 @@ public class PreferenceConfiguration {
|
||||
.remove(VIDEO_FORMAT_PREF_STRING)
|
||||
.remove(ENABLE_HDR_PREF_STRING)
|
||||
.remove(UNLOCK_FPS_STRING)
|
||||
.remove(FULL_RANGE_PREF_STRING)
|
||||
.apply();
|
||||
}
|
||||
|
||||
@@ -505,6 +509,7 @@ public class PreferenceConfiguration {
|
||||
config.absoluteMouseMode = prefs.getBoolean(ABSOLUTE_MOUSE_MODE_PREF_STRING, DEFAULT_ABSOLUTE_MOUSE_MODE);
|
||||
config.enableAudioFx = prefs.getBoolean(ENABLE_AUDIO_FX_PREF_STRING, DEFAULT_ENABLE_AUDIO_FX);
|
||||
config.reduceRefreshRate = prefs.getBoolean(REDUCE_REFRESH_RATE_PREF_STRING, DEFAULT_REDUCE_REFRESH_RATE);
|
||||
config.fullRange = prefs.getBoolean(FULL_RANGE_PREF_STRING, DEFAULT_FULL_RANGE);
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
@@ -229,6 +229,8 @@
|
||||
<string name="summary_video_format">HEVC lowers video bandwidth requirements but requires a newer device</string>
|
||||
<string name="title_enable_hdr">Enable HDR (Experimental)</string>
|
||||
<string name="summary_enable_hdr">Stream HDR when the game and PC GPU support it. HDR requires a GTX 1000 series GPU or later.</string>
|
||||
<string name="title_full_range">Use full (0–255) color range</string>
|
||||
<string name="summary_full_range">This may cause video issues or crashes if your device or display doesn\'t properly handle full range content.</string>
|
||||
<string name="title_enable_perf_overlay">Show performance stats while streaming</string>
|
||||
<string name="summary_enable_perf_overlay">Display real-time stream performance information while streaming</string>
|
||||
<string name="title_enable_post_stream_toast">Show latency message after streaming</string>
|
||||
|
||||
@@ -211,6 +211,11 @@
|
||||
android:title="@string/title_enable_hdr"
|
||||
android:summary="@string/summary_enable_hdr"
|
||||
android:defaultValue="false" />
|
||||
<CheckBoxPreference
|
||||
android:key="checkbox_full_range"
|
||||
android:title="@string/title_full_range"
|
||||
android:summary="@string/summary_full_range"
|
||||
android:defaultValue="false" />
|
||||
<CheckBoxPreference
|
||||
android:key="checkbox_enable_perf_overlay"
|
||||
android:title="@string/title_enable_perf_overlay"
|
||||
|
||||
Reference in New Issue
Block a user