Pass RTSP session URL to moonlight-common-c for dynamic ports

This commit is contained in:
Cameron Gutman
2021-07-02 17:41:07 -05:00
parent 06f6134538
commit 6cedb9019c
6 changed files with 25 additions and 4 deletions

View File

@@ -15,6 +15,9 @@ public class ConnectionContext {
// This is the version quad from the appversion tag of /serverinfo
public String serverAppVersion;
public String serverGfeVersion;
// This is the sessionUrl0 tag from /resume and /launch
public String rtspSessionUrl;
public int negotiatedWidth, negotiatedHeight;
public boolean negotiatedHdr;

View File

@@ -275,7 +275,7 @@ public class NvConnection {
synchronized (MoonBridge.class) {
MoonBridge.setupBridge(videoDecoderRenderer, audioRenderer, connectionListener);
int ret = MoonBridge.startConnection(context.serverAddress,
context.serverAppVersion, context.serverGfeVersion,
context.serverAppVersion, context.serverGfeVersion, context.rtspSessionUrl,
context.negotiatedWidth, context.negotiatedHeight,
context.streamConfig.getRefreshRate(), context.streamConfig.getBitrate(),
context.streamConfig.getMaxPacketSize(),

View File

@@ -680,7 +680,13 @@ public class NvHTTP {
(context.streamConfig.getAttachedGamepadMask() != 0 ? "&gcmap=" + context.streamConfig.getAttachedGamepadMask() : ""),
false);
String gameSession = getXmlString(xmlStr, "gamesession");
return gameSession != null && !gameSession.equals("0");
if (gameSession != null && !gameSession.equals("0")) {
context.rtspSessionUrl = getXmlString(xmlStr, "sessionUrl0");
return true;
}
else {
return false;
}
}
public boolean resumeApp(ConnectionContext context) throws IOException, XmlPullParserException {
@@ -690,7 +696,13 @@ public class NvHTTP {
"&surroundAudioInfo=" + context.streamConfig.getAudioConfiguration().getSurroundAudioInfo(),
false);
String resume = getXmlString(xmlStr, "resume");
return Integer.parseInt(resume) != 0;
if (Integer.parseInt(resume) != 0) {
context.rtspSessionUrl = getXmlString(xmlStr, "sessionUrl0");
return true;
}
else {
return false;
}
}
public boolean quitApp() throws IOException, XmlPullParserException {

View File

@@ -253,6 +253,7 @@ public class MoonBridge {
}
public static native int startConnection(String address, String appVersion, String gfeVersion,
String rtspSessionUrl,
int width, int height, int fps,
int bitrate, int packetSize, int streamingRemotely,
int audioConfiguration, boolean supportsHevc,