mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-17 22:23:52 +00:00
Pass RTSP session URL to moonlight-common-c for dynamic ports
This commit is contained in:
@@ -25,6 +25,7 @@
|
|||||||
char _hostString[256];
|
char _hostString[256];
|
||||||
char _appVersionString[32];
|
char _appVersionString[32];
|
||||||
char _gfeVersionString[32];
|
char _gfeVersionString[32];
|
||||||
|
char _rtspSessionUrl[128];
|
||||||
}
|
}
|
||||||
|
|
||||||
static NSLock* initLock;
|
static NSLock* initLock;
|
||||||
@@ -408,6 +409,11 @@ void ClConnectionStatusUpdate(int status)
|
|||||||
[config.gfeVersion cStringUsingEncoding:NSUTF8StringEncoding],
|
[config.gfeVersion cStringUsingEncoding:NSUTF8StringEncoding],
|
||||||
sizeof(_gfeVersionString));
|
sizeof(_gfeVersionString));
|
||||||
}
|
}
|
||||||
|
if (config.rtspSessionUrl != nil) {
|
||||||
|
strncpy(_rtspSessionUrl,
|
||||||
|
[config.rtspSessionUrl cStringUsingEncoding:NSUTF8StringEncoding],
|
||||||
|
sizeof(_rtspSessionUrl));
|
||||||
|
}
|
||||||
|
|
||||||
LiInitializeServerInformation(&_serverInfo);
|
LiInitializeServerInformation(&_serverInfo);
|
||||||
_serverInfo.address = _hostString;
|
_serverInfo.address = _hostString;
|
||||||
@@ -415,6 +421,9 @@ void ClConnectionStatusUpdate(int status)
|
|||||||
if (config.gfeVersion != nil) {
|
if (config.gfeVersion != nil) {
|
||||||
_serverInfo.serverInfoGfeVersion = _gfeVersionString;
|
_serverInfo.serverInfoGfeVersion = _gfeVersionString;
|
||||||
}
|
}
|
||||||
|
if (config.rtspSessionUrl != nil) {
|
||||||
|
_serverInfo.rtspSessionUrl = _rtspSessionUrl;
|
||||||
|
}
|
||||||
|
|
||||||
renderer = myRenderer;
|
renderer = myRenderer;
|
||||||
_callbacks = callbacks;
|
_callbacks = callbacks;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
@property NSString* gfeVersion;
|
@property NSString* gfeVersion;
|
||||||
@property NSString* appID;
|
@property NSString* appID;
|
||||||
@property NSString* appName;
|
@property NSString* appName;
|
||||||
|
@property NSString* rtspSessionUrl;
|
||||||
@property int width;
|
@property int width;
|
||||||
@property int height;
|
@property int height;
|
||||||
@property int frameRate;
|
@property int frameRate;
|
||||||
|
|||||||
@@ -9,5 +9,5 @@
|
|||||||
#import "StreamConfiguration.h"
|
#import "StreamConfiguration.h"
|
||||||
|
|
||||||
@implementation StreamConfiguration
|
@implementation StreamConfiguration
|
||||||
@synthesize host, appID, width, height, frameRate, bitRate, riKeyId, riKey, gamepadMask, appName, optimizeGameSettings, playAudioOnPC, audioConfiguration, enableHdr, multiController, allowHevc, serverCert;
|
@synthesize host, appID, width, height, frameRate, bitRate, riKeyId, riKey, gamepadMask, appName, optimizeGameSettings, playAudioOnPC, audioConfiguration, enableHdr, multiController, allowHevc, serverCert, rtspSessionUrl;
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -78,18 +78,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// resumeApp and launchApp handle calling launchFailed
|
// resumeApp and launchApp handle calling launchFailed
|
||||||
|
NSString* sessionUrl;
|
||||||
if ([serverState hasSuffix:@"_SERVER_BUSY"]) {
|
if ([serverState hasSuffix:@"_SERVER_BUSY"]) {
|
||||||
// App already running, resume it
|
// App already running, resume it
|
||||||
if (![self resumeApp:hMan]) {
|
if (![self resumeApp:hMan receiveSessionUrl:&sessionUrl]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Start app
|
// Start app
|
||||||
if (![self launchApp:hMan]) {
|
if (![self launchApp:hMan receiveSessionUrl:&sessionUrl]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Populate RTSP session URL from launch/resume response
|
||||||
|
_config.rtspSessionUrl = sessionUrl;
|
||||||
|
|
||||||
// Populate the config's version fields from serverinfo
|
// Populate the config's version fields from serverinfo
|
||||||
_config.appVersion = appversion;
|
_config.appVersion = appversion;
|
||||||
_config.gfeVersion = gfeVersion;
|
_config.gfeVersion = gfeVersion;
|
||||||
@@ -108,7 +112,7 @@
|
|||||||
[_connection terminate];
|
[_connection terminate];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) launchApp:(HttpManager*)hMan {
|
- (BOOL) launchApp:(HttpManager*)hMan receiveSessionUrl:(NSString**)sessionUrl {
|
||||||
HttpResponse* launchResp = [[HttpResponse alloc] init];
|
HttpResponse* launchResp = [[HttpResponse alloc] init];
|
||||||
[hMan executeRequestSynchronously:[HttpRequest requestForResponse:launchResp withUrlRequest:[hMan newLaunchRequest:_config]]];
|
[hMan executeRequestSynchronously:[HttpRequest requestForResponse:launchResp withUrlRequest:[hMan newLaunchRequest:_config]]];
|
||||||
NSString *gameSession = [launchResp getStringTag:@"gamesession"];
|
NSString *gameSession = [launchResp getStringTag:@"gamesession"];
|
||||||
@@ -122,10 +126,11 @@
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*sessionUrl = [launchResp getStringTag:@"sessionUrl0"];
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) resumeApp:(HttpManager*)hMan {
|
- (BOOL) resumeApp:(HttpManager*)hMan receiveSessionUrl:(NSString**)sessionUrl {
|
||||||
HttpResponse* resumeResp = [[HttpResponse alloc] init];
|
HttpResponse* resumeResp = [[HttpResponse alloc] init];
|
||||||
[hMan executeRequestSynchronously:[HttpRequest requestForResponse:resumeResp withUrlRequest:[hMan newResumeRequest:_config]]];
|
[hMan executeRequestSynchronously:[HttpRequest requestForResponse:resumeResp withUrlRequest:[hMan newResumeRequest:_config]]];
|
||||||
NSString* resume = [resumeResp getStringTag:@"resume"];
|
NSString* resume = [resumeResp getStringTag:@"resume"];
|
||||||
@@ -139,6 +144,7 @@
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*sessionUrl = [resumeResp getStringTag:@"sessionUrl0"];
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Submodule moonlight-common/moonlight-common-c updated: 7c346c3104...3b9d8a3176
Reference in New Issue
Block a user