mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 08:36:42 +00:00
Use the server major version pulled from serverinfo when starting a stream
This commit is contained in:
parent
02341e85e2
commit
b796b496dd
5
main.cpp
5
main.cpp
@ -156,6 +156,7 @@ void MoonlightInstance::HandleStartStream(int32_t callbackId, pp::VarArray args)
|
|||||||
std::string height = args.Get(2).AsString();
|
std::string height = args.Get(2).AsString();
|
||||||
std::string fps = args.Get(3).AsString();
|
std::string fps = args.Get(3).AsString();
|
||||||
std::string bitrate = args.Get(4).AsString();
|
std::string bitrate = args.Get(4).AsString();
|
||||||
|
std::string serverMajorVersion = args.Get(5).AsString();
|
||||||
|
|
||||||
pp::Var response("Setting stream width to: " + width);
|
pp::Var response("Setting stream width to: " + width);
|
||||||
PostMessage(response);
|
PostMessage(response);
|
||||||
@ -167,6 +168,8 @@ void MoonlightInstance::HandleStartStream(int32_t callbackId, pp::VarArray args)
|
|||||||
PostMessage(response);
|
PostMessage(response);
|
||||||
response = ("Setting stream bitrate to: " + bitrate);
|
response = ("Setting stream bitrate to: " + bitrate);
|
||||||
PostMessage(response);
|
PostMessage(response);
|
||||||
|
response = ("Setting server major version to: " + serverMajorVersion);
|
||||||
|
PostMessage(response);
|
||||||
|
|
||||||
// Populate the stream configuration
|
// Populate the stream configuration
|
||||||
m_StreamConfig.width = stoi(width);
|
m_StreamConfig.width = stoi(width);
|
||||||
@ -177,7 +180,7 @@ void MoonlightInstance::HandleStartStream(int32_t callbackId, pp::VarArray args)
|
|||||||
m_StreamConfig.streamingRemotely = 0;
|
m_StreamConfig.streamingRemotely = 0;
|
||||||
m_StreamConfig.audioConfiguration = AUDIO_CONFIGURATION_STEREO;
|
m_StreamConfig.audioConfiguration = AUDIO_CONFIGURATION_STEREO;
|
||||||
|
|
||||||
m_ServerMajorVersion = 5;
|
m_ServerMajorVersion = stoi(serverMajorVersion);
|
||||||
|
|
||||||
// Initialize the rendering surface before starting the connection
|
// Initialize the rendering surface before starting the connection
|
||||||
InitializeRenderingSurface(m_StreamConfig.width, m_StreamConfig.height);
|
InitializeRenderingSurface(m_StreamConfig.width, m_StreamConfig.height);
|
||||||
|
@ -112,7 +112,7 @@ function startPushed() {
|
|||||||
api.init().then(function (ret) {
|
api.init().then(function (ret) {
|
||||||
if (api.currentGame != 0) {
|
if (api.currentGame != 0) {
|
||||||
api.resumeApp('00000000000000000000000000000000', 0).then(function (ret) {
|
api.resumeApp('00000000000000000000000000000000', 0).then(function (ret) {
|
||||||
sendMessage('startRequest', [target, streamWidth, streamHeight, frameRate, bitrate.toString()]);
|
sendMessage('startRequest', [target, streamWidth, streamHeight, frameRate, bitrate.toString(), api.serverMajorVersion.toString()]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -41,6 +41,7 @@ NvHTTP.prototype = {
|
|||||||
if($root.attr("status_code") == 200) {
|
if($root.attr("status_code") == 200) {
|
||||||
_self.paired = $root.find("PairStatus").text().trim() == 1;
|
_self.paired = $root.find("PairStatus").text().trim() == 1;
|
||||||
_self.currentGame = parseInt($root.find("currentgame").text().trim(), 10);
|
_self.currentGame = parseInt($root.find("currentgame").text().trim(), 10);
|
||||||
|
_self.serverMajorVersion = parseInt($root.find("appversion").text().trim().substring(0, 1), 10);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user