mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-18 18:42:46 +00:00
Use the unmodified FPS value when sending the launch request
This commit is contained in:
parent
dcb7be3acd
commit
3011a5bad7
@ -438,6 +438,7 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
|
|
||||||
StreamConfiguration config = new StreamConfiguration.Builder()
|
StreamConfiguration config = new StreamConfiguration.Builder()
|
||||||
.setResolution(prefConfig.width, prefConfig.height)
|
.setResolution(prefConfig.width, prefConfig.height)
|
||||||
|
.setLaunchRefreshRate(prefConfig.fps)
|
||||||
.setRefreshRate(chosenFrameRate)
|
.setRefreshRate(chosenFrameRate)
|
||||||
.setApp(new NvApp(appName != null ? appName : "app", appId, willStreamHdr))
|
.setApp(new NvApp(appName != null ? appName : "app", appId, willStreamHdr))
|
||||||
.setBitrate(prefConfig.bitrate)
|
.setBitrate(prefConfig.bitrate)
|
||||||
|
@ -17,7 +17,6 @@ public class ConnectionContext {
|
|||||||
public String serverGfeVersion;
|
public String serverGfeVersion;
|
||||||
|
|
||||||
public int negotiatedWidth, negotiatedHeight;
|
public int negotiatedWidth, negotiatedHeight;
|
||||||
public int negotiatedFps;
|
|
||||||
public boolean negotiatedHdr;
|
public boolean negotiatedHdr;
|
||||||
|
|
||||||
public int videoCapabilities;
|
public int videoCapabilities;
|
||||||
|
@ -121,13 +121,11 @@ public class NvConnection {
|
|||||||
// Lower resolution to 1080p
|
// Lower resolution to 1080p
|
||||||
context.negotiatedWidth = 1920;
|
context.negotiatedWidth = 1920;
|
||||||
context.negotiatedHeight = 1080;
|
context.negotiatedHeight = 1080;
|
||||||
context.negotiatedFps = context.streamConfig.getRefreshRate();
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Take what the client wanted
|
// Take what the client wanted
|
||||||
context.negotiatedWidth = context.streamConfig.getWidth();
|
context.negotiatedWidth = context.streamConfig.getWidth();
|
||||||
context.negotiatedHeight = context.streamConfig.getHeight();
|
context.negotiatedHeight = context.streamConfig.getHeight();
|
||||||
context.negotiatedFps = context.streamConfig.getRefreshRate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -263,7 +261,7 @@ public class NvConnection {
|
|||||||
int ret = MoonBridge.startConnection(context.serverAddress,
|
int ret = MoonBridge.startConnection(context.serverAddress,
|
||||||
context.serverAppVersion, context.serverGfeVersion,
|
context.serverAppVersion, context.serverGfeVersion,
|
||||||
context.negotiatedWidth, context.negotiatedHeight,
|
context.negotiatedWidth, context.negotiatedHeight,
|
||||||
context.negotiatedFps, context.streamConfig.getBitrate(),
|
context.streamConfig.getRefreshRate(), context.streamConfig.getBitrate(),
|
||||||
context.streamConfig.getMaxPacketSize(),
|
context.streamConfig.getMaxPacketSize(),
|
||||||
context.streamConfig.getRemote(), context.streamConfig.getAudioConfiguration(),
|
context.streamConfig.getRemote(), context.streamConfig.getAudioConfiguration(),
|
||||||
context.streamConfig.getHevcSupported(),
|
context.streamConfig.getHevcSupported(),
|
||||||
|
@ -19,6 +19,7 @@ public class StreamConfiguration {
|
|||||||
private NvApp app;
|
private NvApp app;
|
||||||
private int width, height;
|
private int width, height;
|
||||||
private int refreshRate;
|
private int refreshRate;
|
||||||
|
private int launchRefreshRate;
|
||||||
private int clientRefreshRateX100;
|
private int clientRefreshRateX100;
|
||||||
private int bitrate;
|
private int bitrate;
|
||||||
private boolean sops;
|
private boolean sops;
|
||||||
@ -58,6 +59,11 @@ public class StreamConfiguration {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public StreamConfiguration.Builder setLaunchRefreshRate(int refreshRate) {
|
||||||
|
config.launchRefreshRate = refreshRate;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public StreamConfiguration.Builder setBitrate(int bitrate) {
|
public StreamConfiguration.Builder setBitrate(int bitrate) {
|
||||||
config.bitrate = bitrate;
|
config.bitrate = bitrate;
|
||||||
return this;
|
return this;
|
||||||
@ -147,6 +153,7 @@ public class StreamConfiguration {
|
|||||||
this.width = 1280;
|
this.width = 1280;
|
||||||
this.height = 720;
|
this.height = 720;
|
||||||
this.refreshRate = 60;
|
this.refreshRate = 60;
|
||||||
|
this.launchRefreshRate = 60;
|
||||||
this.bitrate = 10000;
|
this.bitrate = 10000;
|
||||||
this.maxPacketSize = 1024;
|
this.maxPacketSize = 1024;
|
||||||
this.remote = STREAM_CFG_AUTO;
|
this.remote = STREAM_CFG_AUTO;
|
||||||
@ -171,6 +178,10 @@ public class StreamConfiguration {
|
|||||||
return refreshRate;
|
return refreshRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getLaunchRefreshRate() {
|
||||||
|
return launchRefreshRate;
|
||||||
|
}
|
||||||
|
|
||||||
public int getBitrate() {
|
public int getBitrate() {
|
||||||
return bitrate;
|
return bitrate;
|
||||||
}
|
}
|
||||||
|
@ -624,7 +624,7 @@ public class NvHTTP {
|
|||||||
// Using an FPS value over 60 causes SOPS to default to 720p60,
|
// Using an FPS value over 60 causes SOPS to default to 720p60,
|
||||||
// so force it to 60 when starting. This won't impact our ability
|
// so force it to 60 when starting. This won't impact our ability
|
||||||
// to get > 60 FPS while actually streaming though.
|
// to get > 60 FPS while actually streaming though.
|
||||||
int fps = context.negotiatedFps > 60 ? 60 : context.negotiatedFps;
|
int fps = context.streamConfig.getLaunchRefreshRate() > 60 ? 60 : context.streamConfig.getLaunchRefreshRate();
|
||||||
|
|
||||||
// Using an unsupported resolution (not 720p, 1080p, or 4K) causes
|
// Using an unsupported resolution (not 720p, 1080p, or 4K) causes
|
||||||
// GFE to force SOPS to 720p60. This is fine for < 720p resolutions like
|
// GFE to force SOPS to 720p60. This is fine for < 720p resolutions like
|
||||||
|
Loading…
x
Reference in New Issue
Block a user