mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-18 18:42:46 +00:00
Add 480p option
This commit is contained in:
parent
629bf5766d
commit
f0c69d08b8
@ -84,6 +84,9 @@ public class PreferenceConfiguration {
|
|||||||
if (resString.equalsIgnoreCase("360p")) {
|
if (resString.equalsIgnoreCase("360p")) {
|
||||||
return 360;
|
return 360;
|
||||||
}
|
}
|
||||||
|
else if (resString.equalsIgnoreCase("480p")) {
|
||||||
|
return 480;
|
||||||
|
}
|
||||||
else if (resString.equalsIgnoreCase("720p")) {
|
else if (resString.equalsIgnoreCase("720p")) {
|
||||||
return 720;
|
return 720;
|
||||||
}
|
}
|
||||||
@ -103,13 +106,22 @@ public class PreferenceConfiguration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static int getWidthFromResolutionString(String resString) {
|
private static int getWidthFromResolutionString(String resString) {
|
||||||
return (getHeightFromResolutionString(resString) * 16) / 9;
|
int height = getHeightFromResolutionString(resString);
|
||||||
|
if (height == 480) {
|
||||||
|
// This isn't an exact 16:9 resolution
|
||||||
|
return 854;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return (height * 16) / 9;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getResolutionString(int width, int height) {
|
private static String getResolutionString(int width, int height) {
|
||||||
switch (height) {
|
switch (height) {
|
||||||
case 360:
|
case 360:
|
||||||
return "360p";
|
return "360p";
|
||||||
|
case 480:
|
||||||
|
return "480p";
|
||||||
default:
|
default:
|
||||||
case 720:
|
case 720:
|
||||||
return "720p";
|
return "720p";
|
||||||
@ -139,6 +151,9 @@ public class PreferenceConfiguration {
|
|||||||
if (width * height <= 640 * 360) {
|
if (width * height <= 640 * 360) {
|
||||||
return (int)(1000 * (fps / 30.0));
|
return (int)(1000 * (fps / 30.0));
|
||||||
}
|
}
|
||||||
|
else if (width * height <= 854 * 480) {
|
||||||
|
return (int)(1500 * (fps / 30.0));
|
||||||
|
}
|
||||||
// This covers 1280x720 and 1280x800 too
|
// This covers 1280x720 and 1280x800 too
|
||||||
else if (width * height <= 1366 * 768) {
|
else if (width * height <= 1366 * 768) {
|
||||||
return (int)(5000 * (fps / 30.0));
|
return (int)(5000 * (fps / 30.0));
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string-array name="resolution_names">
|
<string-array name="resolution_names">
|
||||||
<item>360p</item>
|
<item>360p</item>
|
||||||
|
<item>480p</item>
|
||||||
<item>720p</item>
|
<item>720p</item>
|
||||||
<item>1080p</item>
|
<item>1080p</item>
|
||||||
<item>1440p</item>
|
<item>1440p</item>
|
||||||
@ -9,6 +10,7 @@
|
|||||||
</string-array>
|
</string-array>
|
||||||
<string-array name="resolution_values" translatable="false">
|
<string-array name="resolution_values" translatable="false">
|
||||||
<item>360p</item>
|
<item>360p</item>
|
||||||
|
<item>480p</item>
|
||||||
<item>720p</item>
|
<item>720p</item>
|
||||||
<item>1080p</item>
|
<item>1080p</item>
|
||||||
<item>1440p</item>
|
<item>1440p</item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user