mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-16 16:16:44 +00:00
now choosing video parameters makes a difference
This commit is contained in:
parent
8dfa196a13
commit
acfe4d8be6
@ -19,7 +19,7 @@
|
||||
<!-- Navigation. We hide it in small screens. -->
|
||||
<ul class='mdl-list'>
|
||||
<li>Chrome App Status: <code id="statusField">NO-STATUS</code></li>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
</header>
|
||||
<main id="main-content" class="mdl-layout__content">
|
||||
@ -28,9 +28,8 @@
|
||||
<div class="mdl-select">
|
||||
<select id="selectResolution">
|
||||
<option selected="NONE">Stream Resolution</option>
|
||||
<option value="720">1280x720</option>
|
||||
<option value="768">1366x768</option>
|
||||
<option value="1280">1920x1080</option>
|
||||
<option value="1280:720">1280x720</option>
|
||||
<option value="1920:1080">1920x1080</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mdl-select">
|
||||
|
34
main.cpp
34
main.cpp
@ -135,11 +135,37 @@ void MoonlightInstance::HandleMessage(const pp::Var& var_message) {
|
||||
}
|
||||
}
|
||||
|
||||
void split(const std::string& s, char c, std::vector<std::string>& v) {
|
||||
std::string::size_type i = 0;
|
||||
std::string::size_type j = s.find(c);
|
||||
|
||||
while (j != std::string::npos) {
|
||||
v.push_back(s.substr(i, j-i));
|
||||
i = ++j;
|
||||
j = s.find(c, j);
|
||||
|
||||
if (j == std::string::npos) v.push_back(s.substr(i, s.length()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void MoonlightInstance::handleStartStream(std::string startStreamMessage) {
|
||||
// request:host:width:height:fps:bitrate
|
||||
std::vector<std::string> splitString;
|
||||
split(startStreamMessage, ':', splitString);
|
||||
|
||||
pp::Var response("Setting stream width to: " + splitString.at(2));
|
||||
PostMessage(response);
|
||||
response = ("Setting stream height to: " + splitString.at(3));
|
||||
PostMessage(response);
|
||||
response = ("Setting stream fps to: " + splitString.at(4));
|
||||
PostMessage(response);
|
||||
response = ("Setting stream host to: " + splitString.at(1));
|
||||
PostMessage(response);
|
||||
// Populate the stream configuration
|
||||
m_StreamConfig.width = 1280;
|
||||
m_StreamConfig.height = 720;
|
||||
m_StreamConfig.fps = 60;
|
||||
m_StreamConfig.width = stoi(splitString.at(2));
|
||||
m_StreamConfig.height = stoi(splitString.at(3));
|
||||
m_StreamConfig.fps = stoi(splitString.at(4));
|
||||
m_StreamConfig.bitrate = 15000; // kilobits per second
|
||||
m_StreamConfig.packetSize = 1024;
|
||||
m_StreamConfig.streamingRemotely = 0;
|
||||
@ -148,7 +174,7 @@ void MoonlightInstance::handleStartStream(std::string startStreamMessage) {
|
||||
m_ServerMajorVersion = 4;
|
||||
|
||||
// Store the host from the start message
|
||||
m_Host = startStreamMessage.substr(strlen(MSG_START_REQUEST));
|
||||
m_Host = splitString.at(1);
|
||||
|
||||
// Start the worker thread to establish the connection
|
||||
pthread_create(&m_ConnectionThread, NULL, MoonlightInstance::ConnectionThreadFunc, this);
|
||||
|
@ -63,7 +63,10 @@ function startPushed() {
|
||||
var e = document.getElementById("selectHost");
|
||||
target = e.options[e.selectedIndex].value;
|
||||
}
|
||||
common.naclModule.postMessage('startRequest:' + target);
|
||||
var frameRate = document.getElementById('selectFramerate').value;
|
||||
var resolution = document.getElementById('selectResolution').value;
|
||||
console.log('startRequest:' + target + ":" + resolution + ":" + frameRate);
|
||||
common.naclModule.postMessage('startRequest:' + target + ":" + resolution + ":" + frameRate + ":");
|
||||
// we just finished the gameSelection section. only expose the NaCl section
|
||||
playGameMode();
|
||||
}
|
||||
@ -133,7 +136,7 @@ function readData(key, callbackFunction) {
|
||||
}
|
||||
|
||||
function loadResolution(previousValue) {
|
||||
document.getElementById('selectResolution').value = previousValue.resolution != null ? previousValue.resolution : '720';
|
||||
document.getElementById('selectResolution').value = previousValue.resolution != null ? previousValue.resolution : '1280:720';
|
||||
}
|
||||
|
||||
function saveResolution() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user