From b2bee37fe2b2d721a20a026289c299240c6a23da Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 31 Oct 2022 17:54:09 -0500 Subject: [PATCH] Plumb RTSP session URL into LiStartConnection() --- main.cpp | 5 +++++ moonlight.hpp | 1 + static/js/index.js | 6 ++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 5ac7fae..8dd7ed5 100644 --- a/main.cpp +++ b/main.cpp @@ -130,6 +130,7 @@ void* MoonlightInstance::ConnectionThreadFunc(void* context) { serverInfo.address = me->m_Host.c_str(); serverInfo.serverInfoAppVersion = me->m_AppVersion.c_str(); serverInfo.serverInfoGfeVersion = me->m_GfeVersion.c_str(); + serverInfo.rtspSessionUrl = me->m_RtspUrl.c_str(); err = LiStartConnection(&serverInfo, &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 appversion = args.Get(8).AsString(); std::string gfeversion = args.Get(9).AsString(); + std::string rtspurl = args.Get(10).AsString(); pp::Var response("Setting stream width to: " + width); PostMessage(response); @@ -224,6 +226,8 @@ void MoonlightInstance::HandleStartStream(int32_t callbackId, pp::VarArray args) PostMessage(response); response = ("Setting mouse lock to: " + mouse_lock); PostMessage(response); + response = ("Setting RTSP URL to: " + rtspurl); + PostMessage(response); // Populate the stream configuration LiInitializeStreamConfiguration(&m_StreamConfig); @@ -248,6 +252,7 @@ void MoonlightInstance::HandleStartStream(int32_t callbackId, pp::VarArray args) m_Host = host; m_AppVersion = appversion; m_GfeVersion = gfeversion; + m_RtspUrl = rtspurl; m_MouseLockingFeatureEnabled = stoi(mouse_lock); // Initialize the rendering surface before starting the connection diff --git a/moonlight.hpp b/moonlight.hpp index 452aad6..656b0c0 100644 --- a/moonlight.hpp +++ b/moonlight.hpp @@ -173,6 +173,7 @@ class MoonlightInstance : public pp::Instance, public pp::MouseLock { std::string m_Host; std::string m_AppVersion; std::string m_GfeVersion; + std::string m_RtspUrl; bool m_MouseLockingFeatureEnabled; STREAM_CONFIGURATION m_StreamConfig; bool m_Running; diff --git a/static/js/index.js b/static/js/index.js index 0840825..0cd3d64 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -711,7 +711,8 @@ function startGame(host, appID) { } 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) { 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, - 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) { console.error('%c[index.js, launchApp]', 'color: green;', 'Failed to launch app width id: ' + appID + '\nReturned error was: ' + failedLaunchApp);