Plumb RTSP session URL into LiStartConnection()

This commit is contained in:
Cameron Gutman 2022-10-31 17:54:09 -05:00
parent fb2258fa34
commit b2bee37fe2
3 changed files with 10 additions and 2 deletions

View File

@ -130,6 +130,7 @@ void* MoonlightInstance::ConnectionThreadFunc(void* context) {
serverInfo.address = me->m_Host.c_str(); serverInfo.address = me->m_Host.c_str();
serverInfo.serverInfoAppVersion = me->m_AppVersion.c_str(); serverInfo.serverInfoAppVersion = me->m_AppVersion.c_str();
serverInfo.serverInfoGfeVersion = me->m_GfeVersion.c_str(); serverInfo.serverInfoGfeVersion = me->m_GfeVersion.c_str();
serverInfo.rtspSessionUrl = me->m_RtspUrl.c_str();
err = LiStartConnection(&serverInfo, err = LiStartConnection(&serverInfo,
&me->m_StreamConfig, &me->m_StreamConfig,
@ -203,6 +204,7 @@ void MoonlightInstance::HandleStartStream(int32_t callbackId, pp::VarArray args)
std::string mouse_lock = args.Get(7).AsString(); std::string mouse_lock = args.Get(7).AsString();
std::string appversion = args.Get(8).AsString(); std::string appversion = args.Get(8).AsString();
std::string gfeversion = args.Get(9).AsString(); std::string gfeversion = args.Get(9).AsString();
std::string rtspurl = args.Get(10).AsString();
pp::Var response("Setting stream width to: " + width); pp::Var response("Setting stream width to: " + width);
PostMessage(response); PostMessage(response);
@ -224,6 +226,8 @@ void MoonlightInstance::HandleStartStream(int32_t callbackId, pp::VarArray args)
PostMessage(response); PostMessage(response);
response = ("Setting mouse lock to: " + mouse_lock); response = ("Setting mouse lock to: " + mouse_lock);
PostMessage(response); PostMessage(response);
response = ("Setting RTSP URL to: " + rtspurl);
PostMessage(response);
// Populate the stream configuration // Populate the stream configuration
LiInitializeStreamConfiguration(&m_StreamConfig); LiInitializeStreamConfiguration(&m_StreamConfig);
@ -248,6 +252,7 @@ void MoonlightInstance::HandleStartStream(int32_t callbackId, pp::VarArray args)
m_Host = host; m_Host = host;
m_AppVersion = appversion; m_AppVersion = appversion;
m_GfeVersion = gfeversion; m_GfeVersion = gfeversion;
m_RtspUrl = rtspurl;
m_MouseLockingFeatureEnabled = stoi(mouse_lock); m_MouseLockingFeatureEnabled = stoi(mouse_lock);
// Initialize the rendering surface before starting the connection // Initialize the rendering surface before starting the connection

View File

@ -173,6 +173,7 @@ class MoonlightInstance : public pp::Instance, public pp::MouseLock {
std::string m_Host; std::string m_Host;
std::string m_AppVersion; std::string m_AppVersion;
std::string m_GfeVersion; std::string m_GfeVersion;
std::string m_RtspUrl;
bool m_MouseLockingFeatureEnabled; bool m_MouseLockingFeatureEnabled;
STREAM_CONFIGURATION m_StreamConfig; STREAM_CONFIGURATION m_StreamConfig;
bool m_Running; bool m_Running;

View File

@ -711,7 +711,8 @@ function startGame(host, appID) {
} }
sendMessage('startRequest', [host.address, streamWidth, streamHeight, frameRate, sendMessage('startRequest', [host.address, streamWidth, streamHeight, frameRate,
bitrate.toString(), rikey, rikeyid.toString(), mouse_lock_enabled, host.appVersion, host.gfeVersion bitrate.toString(), rikey, rikeyid.toString(), mouse_lock_enabled, host.appVersion, host.gfeVersion,
$root.find('sessionUrl0').text().trim()
]); ]);
}, function(failedResumeApp) { }, function(failedResumeApp) {
console.eror('%c[index.js, startGame]', 'color:green;', 'Failed to resume the app! Returned error was' + failedResumeApp); console.eror('%c[index.js, startGame]', 'color:green;', 'Failed to resume the app! Returned error was' + failedResumeApp);
@ -748,7 +749,8 @@ function startGame(host, appID) {
} }
sendMessage('startRequest', [host.address, streamWidth, streamHeight, frameRate, sendMessage('startRequest', [host.address, streamWidth, streamHeight, frameRate,
bitrate.toString(), rikey, rikeyid.toString(), mouse_lock_enabled, host.appVersion bitrate.toString(), rikey, rikeyid.toString(), mouse_lock_enabled, host.appVersion,
$root.find('sessionUrl0').text().trim()
]); ]);
}, function(failedLaunchApp) { }, function(failedLaunchApp) {
console.error('%c[index.js, launchApp]', 'color: green;', 'Failed to launch app width id: ' + appID + '\nReturned error was: ' + failedLaunchApp); console.error('%c[index.js, launchApp]', 'color: green;', 'Failed to launch app width id: ' + appID + '\nReturned error was: ' + failedLaunchApp);