Use the unmodified FPS value when sending the launch request

This commit is contained in:
Cameron Gutman 2020-02-22 01:28:41 -08:00
parent dcb7be3acd
commit 3011a5bad7
5 changed files with 14 additions and 5 deletions

View File

@ -438,6 +438,7 @@ public class Game extends Activity implements SurfaceHolder.Callback,
StreamConfiguration config = new StreamConfiguration.Builder()
.setResolution(prefConfig.width, prefConfig.height)
.setLaunchRefreshRate(prefConfig.fps)
.setRefreshRate(chosenFrameRate)
.setApp(new NvApp(appName != null ? appName : "app", appId, willStreamHdr))
.setBitrate(prefConfig.bitrate)

View File

@ -17,7 +17,6 @@ public class ConnectionContext {
public String serverGfeVersion;
public int negotiatedWidth, negotiatedHeight;
public int negotiatedFps;
public boolean negotiatedHdr;
public int videoCapabilities;

View File

@ -121,13 +121,11 @@ public class NvConnection {
// Lower resolution to 1080p
context.negotiatedWidth = 1920;
context.negotiatedHeight = 1080;
context.negotiatedFps = context.streamConfig.getRefreshRate();
}
else {
// Take what the client wanted
context.negotiatedWidth = context.streamConfig.getWidth();
context.negotiatedHeight = context.streamConfig.getHeight();
context.negotiatedFps = context.streamConfig.getRefreshRate();
}
//
@ -263,7 +261,7 @@ public class NvConnection {
int ret = MoonBridge.startConnection(context.serverAddress,
context.serverAppVersion, context.serverGfeVersion,
context.negotiatedWidth, context.negotiatedHeight,
context.negotiatedFps, context.streamConfig.getBitrate(),
context.streamConfig.getRefreshRate(), context.streamConfig.getBitrate(),
context.streamConfig.getMaxPacketSize(),
context.streamConfig.getRemote(), context.streamConfig.getAudioConfiguration(),
context.streamConfig.getHevcSupported(),

View File

@ -19,6 +19,7 @@ public class StreamConfiguration {
private NvApp app;
private int width, height;
private int refreshRate;
private int launchRefreshRate;
private int clientRefreshRateX100;
private int bitrate;
private boolean sops;
@ -57,6 +58,11 @@ public class StreamConfiguration {
config.refreshRate = refreshRate;
return this;
}
public StreamConfiguration.Builder setLaunchRefreshRate(int refreshRate) {
config.launchRefreshRate = refreshRate;
return this;
}
public StreamConfiguration.Builder setBitrate(int bitrate) {
config.bitrate = bitrate;
@ -147,6 +153,7 @@ public class StreamConfiguration {
this.width = 1280;
this.height = 720;
this.refreshRate = 60;
this.launchRefreshRate = 60;
this.bitrate = 10000;
this.maxPacketSize = 1024;
this.remote = STREAM_CFG_AUTO;
@ -170,6 +177,10 @@ public class StreamConfiguration {
public int getRefreshRate() {
return refreshRate;
}
public int getLaunchRefreshRate() {
return launchRefreshRate;
}
public int getBitrate() {
return bitrate;

View File

@ -624,7 +624,7 @@ public class NvHTTP {
// 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
// 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
// GFE to force SOPS to 720p60. This is fine for < 720p resolutions like