mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-21 03:52:48 +00:00
Add support for selecting sops on or off
This commit is contained in:
parent
378fbedfa4
commit
9e385215ce
@ -169,7 +169,7 @@ public class NvConnection {
|
|||||||
throws IOException, XmlPullParserException {
|
throws IOException, XmlPullParserException {
|
||||||
// Launch the app since it's not running
|
// Launch the app since it's not running
|
||||||
int gameSessionId = h.launchApp(app.getAppId(), config.getWidth(),
|
int gameSessionId = h.launchApp(app.getAppId(), config.getWidth(),
|
||||||
config.getHeight(), config.getRefreshRate(), riKey);
|
config.getHeight(), config.getRefreshRate(), riKey, config.getSops());
|
||||||
if (gameSessionId == 0) {
|
if (gameSessionId == 0) {
|
||||||
listener.displayMessage("Failed to launch application");
|
listener.displayMessage("Failed to launch application");
|
||||||
return false;
|
return false;
|
||||||
|
@ -6,6 +6,7 @@ public class StreamConfiguration {
|
|||||||
private int refreshRate;
|
private int refreshRate;
|
||||||
private int bitrate;
|
private int bitrate;
|
||||||
private int maxPacketSize;
|
private int maxPacketSize;
|
||||||
|
private boolean sops;
|
||||||
|
|
||||||
public StreamConfiguration(String app, int width, int height, int refreshRate, int bitrate) {
|
public StreamConfiguration(String app, int width, int height, int refreshRate, int bitrate) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
@ -14,15 +15,17 @@ public class StreamConfiguration {
|
|||||||
this.refreshRate = refreshRate;
|
this.refreshRate = refreshRate;
|
||||||
this.bitrate = bitrate;
|
this.bitrate = bitrate;
|
||||||
this.maxPacketSize = 1024;
|
this.maxPacketSize = 1024;
|
||||||
|
this.sops = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public StreamConfiguration(String app, int width, int height, int refreshRate, int bitrate, int maxPacketSize) {
|
public StreamConfiguration(String app, int width, int height, int refreshRate, int bitrate, int maxPacketSize, boolean sops) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.width = width;
|
this.width = width;
|
||||||
this.height = height;
|
this.height = height;
|
||||||
this.refreshRate = refreshRate;
|
this.refreshRate = refreshRate;
|
||||||
this.bitrate = bitrate;
|
this.bitrate = bitrate;
|
||||||
this.maxPacketSize = maxPacketSize;
|
this.maxPacketSize = maxPacketSize;
|
||||||
|
this.sops = sops;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getWidth() {
|
public int getWidth() {
|
||||||
@ -48,4 +51,8 @@ public class StreamConfiguration {
|
|||||||
public String getApp() {
|
public String getApp() {
|
||||||
return app;
|
return app;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getSops() {
|
||||||
|
return sops;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -252,12 +252,13 @@ public class NvHTTP {
|
|||||||
openHttpConnection(baseUrl + "/unpair?uniqueid=" + uniqueId);
|
openHttpConnection(baseUrl + "/unpair?uniqueid=" + uniqueId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int launchApp(int appId, int width, int height, int refreshRate, SecretKey inputKey) throws IOException, XmlPullParserException {
|
public int launchApp(int appId, int width, int height, int refreshRate, SecretKey inputKey, boolean sops) throws IOException, XmlPullParserException {
|
||||||
InputStream in = openHttpConnection(baseUrl +
|
InputStream in = openHttpConnection(baseUrl +
|
||||||
"/launch?uniqueid=" + uniqueId +
|
"/launch?uniqueid=" + uniqueId +
|
||||||
"&appid=" + appId +
|
"&appid=" + appId +
|
||||||
"&mode=" + width + "x" + height + "x" + refreshRate +
|
"&mode=" + width + "x" + height + "x" + refreshRate +
|
||||||
"&additionalStates=1&sops=0&rikey="+cryptoProvider.encodeBase64String(inputKey.getEncoded()));
|
"&additionalStates=1&sops=" + (sops ? 1 : 0) +
|
||||||
|
"&rikey="+cryptoProvider.encodeBase64String(inputKey.getEncoded()));
|
||||||
String gameSession = getXmlString(in, "gamesession");
|
String gameSession = getXmlString(in, "gamesession");
|
||||||
return Integer.parseInt(gameSession);
|
return Integer.parseInt(gameSession);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user