mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 19:13:03 +00:00
Remove the 4K display check and just check for GFE 3+
This commit is contained in:
parent
68028242b4
commit
efcfcf88db
@ -117,21 +117,13 @@ public class NvConnection {
|
||||
// Check for a supported stream resolution
|
||||
if (context.streamConfig.getHeight() >= 2160 && !h.supports4K(serverInfo)) {
|
||||
// Client wants 4K but the server can't do it
|
||||
context.connListener.displayTransientMessage("Your PC does not have a supported GPU or GFE version for 4K streaming. The stream will be 1080p.");
|
||||
context.connListener.displayTransientMessage("You must update GeForce Experience to stream in 4K. The stream will be 1080p.");
|
||||
|
||||
// Lower resolution to 1080p
|
||||
context.negotiatedWidth = 1920;
|
||||
context.negotiatedHeight = 1080;
|
||||
context.negotiatedFps = context.streamConfig.getRefreshRate();
|
||||
}
|
||||
else if (context.streamConfig.getHeight() >= 2160 && context.streamConfig.getRefreshRate() >= 60 && !h.supports4K60(serverInfo)) {
|
||||
// Client wants 4K 60 FPS but the server can't do it
|
||||
context.connListener.displayTransientMessage("Your GPU does not support 4K 60 FPS streaming. The stream will be 4K 30 FPS.");
|
||||
|
||||
context.negotiatedWidth = context.streamConfig.getWidth();
|
||||
context.negotiatedHeight = context.streamConfig.getHeight();
|
||||
context.negotiatedFps = 30;
|
||||
}
|
||||
else {
|
||||
// Take what the client wanted
|
||||
context.negotiatedWidth = context.streamConfig.getWidth();
|
||||
|
@ -398,53 +398,14 @@ public class NvHTTP {
|
||||
}
|
||||
|
||||
public boolean supports4K(String serverInfo) throws XmlPullParserException, IOException {
|
||||
// serverinfo returns supported resolutions in descending order, so getting the first
|
||||
// height will give us whether we support 4K. If this is not present, we don't support
|
||||
// 4K.
|
||||
String heightStr = getXmlString(serverInfo, "Height");
|
||||
if (heightStr == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Only allow 4K on GFE 3.x
|
||||
String gfeVersionStr = getXmlString(serverInfo, "GfeVersion");
|
||||
if (gfeVersionStr == null || gfeVersionStr.startsWith("2.")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
if (Integer.parseInt(heightStr) >= 2160) {
|
||||
// Found a 4K resolution in the list
|
||||
return true;
|
||||
}
|
||||
} catch (NumberFormatException ignored) {}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean supports4K60(String serverInfo) throws XmlPullParserException, IOException {
|
||||
// If we don't support 4K at all, bail early
|
||||
if (!supports4K(serverInfo)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// serverinfo returns supported resolutions in descending order, so getting the first
|
||||
// refresh rate will give us whether we support 4K60. If this is 30, we don't support
|
||||
// 4K 60 FPS.
|
||||
String fpsStr = getXmlString(serverInfo, "RefreshRate");
|
||||
if (fpsStr == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
if (Integer.parseInt(fpsStr) >= 60) {
|
||||
// 4K supported and 60 FPS is the first entry
|
||||
return true;
|
||||
}
|
||||
} catch (NumberFormatException ignored) {}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getCurrentGame(String serverInfo) throws IOException, XmlPullParserException {
|
||||
// GFE 2.8 started keeping currentgame set to the last game played. As a result, it no longer
|
||||
|
Loading…
x
Reference in New Issue
Block a user