mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-02-22 21:40:42 +00:00
fix typos and comment formatting
This commit is contained in:
parent
f7d4f49809
commit
58ed5ba3ce
@ -135,7 +135,7 @@ void capture(safe::mail_t mail, config_t config, void *channel_data) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Order of priorty:
|
||||
// Order of priority:
|
||||
// 1. Config
|
||||
// 2. Virtual if available
|
||||
// 3. Host
|
||||
|
@ -105,14 +105,14 @@ enum quality_e : int {
|
||||
enum class rc_hevc_e : int {
|
||||
constqp, /**< Constant QP mode */
|
||||
vbr_latency, /**< Latency Constrained Variable Bitrate */
|
||||
vbr_peak, /**< Peak Contrained Variable Bitrate */
|
||||
vbr_peak, /**< Peak Constrained Variable Bitrate */
|
||||
cbr, /**< Constant bitrate mode */
|
||||
};
|
||||
|
||||
enum class rc_h264_e : int {
|
||||
constqp, /**< Constant QP mode */
|
||||
cbr, /**< Constant bitrate mode */
|
||||
vbr_peak, /**< Peak Contrained Variable Bitrate */
|
||||
vbr_peak, /**< Peak Constrained Variable Bitrate */
|
||||
vbr_latency, /**< Latency Constrained Variable Bitrate */
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
//
|
||||
// Created by TheElixZammuto on 2021-05-09.
|
||||
// TODO: Authentication, better handling of routes common to nvhttp, cleanup
|
||||
|
||||
@ -335,7 +334,7 @@ void saveApp(resp_https_t response, req_https_t request) {
|
||||
apps_node.push_back(std::make_pair("", inputTree));
|
||||
}
|
||||
else {
|
||||
//Unfortuantely Boost PT does not allow to directly edit the array, copy should do the trick
|
||||
// Unfortunately Boost PT does not allow to directly edit the array, copy should do the trick
|
||||
pt::ptree newApps;
|
||||
int i = 0;
|
||||
for(const auto &kv : apps_node) {
|
||||
@ -388,7 +387,7 @@ void deleteApp(resp_https_t response, req_https_t request) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
//Unfortuantely Boost PT does not allow to directly edit the array, copy should do the trick
|
||||
// Unfortunately Boost PT does not allow to directly edit the array, copy should do the trick
|
||||
pt::ptree newApps;
|
||||
int i = 0;
|
||||
for(const auto &kv : apps_node) {
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 6/3/19.
|
||||
//
|
||||
|
||||
#ifndef SUNSHINE_CONFIGHTTP_H
|
||||
#define SUNSHINE_CONFIGHTTP_H
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 5/31/19.
|
||||
//
|
||||
|
||||
#include "crypto.h"
|
||||
#include <openssl/pem.h>
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 6/1/19.
|
||||
//
|
||||
|
||||
#ifndef SUNSHINE_CRYPTO_H
|
||||
#define SUNSHINE_CRYPTO_H
|
||||
|
@ -44,7 +44,7 @@ int init() {
|
||||
|
||||
if(clean_slate) {
|
||||
unique_id = util::uuid_t::generate().string();
|
||||
auto dir = std::filesystem::temp_directory_path() / "Sushine"sv;
|
||||
auto dir = std::filesystem::temp_directory_path() / "Sunshine"sv;
|
||||
config::nvhttp.cert = (dir / ("cert-"s + unique_id)).string();
|
||||
config::nvhttp.pkey = (dir / ("pkey-"s + unique_id)).string();
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 6/20/19.
|
||||
//
|
||||
|
||||
// define uint32_t for <moonlight-common-c/src/Input.h>
|
||||
#include <cstdint>
|
||||
@ -89,7 +87,7 @@ struct gamepad_t {
|
||||
|
||||
// When emulating the HOME button, we may need to artificially release the back button.
|
||||
// Afterwards, the gamepad state on sunshine won't match the state on Moonlight.
|
||||
// To prevent Sunshine from sending erronious input data to the active application,
|
||||
// To prevent Sunshine from sending erroneous input data to the active application,
|
||||
// Sunshine forces the button to be in a specific state until the gamepad state matches that of
|
||||
// Moonlight once more.
|
||||
button_state_e back_button_state;
|
||||
@ -316,11 +314,11 @@ void passthrough(std::shared_ptr<input_t> &input, PNV_MOUSE_BUTTON_PACKET packet
|
||||
/*/
|
||||
* When Moonlight sends mouse input through absolute coordinates,
|
||||
* it's possible that BUTTON_RIGHT is pressed down immediately after releasing BUTTON_LEFT.
|
||||
* As a result, Sunshine will left click on hyperlinks in the browser before right clicking
|
||||
* As a result, Sunshine will left-click on hyperlinks in the browser before right-clicking
|
||||
*
|
||||
* This can be solved by delaying BUTTON_LEFT, however, any delay on input is undesirable during gaming
|
||||
* As a compromise, Sunshine will only put delays on BUTTON_LEFT when
|
||||
* absolute mouse coordinates have been send.
|
||||
* absolute mouse coordinates have been sent.
|
||||
*
|
||||
* Try to make sure BUTTON_RIGHT gets called before BUTTON_LEFT is released.
|
||||
*
|
||||
@ -428,7 +426,7 @@ void passthrough(std::shared_ptr<input_t> &input, PNV_KEYBOARD_PACKET packet) {
|
||||
if(!pressed) {
|
||||
if(!release) {
|
||||
// A new key has been pressed down, we need to check for key combo's
|
||||
// If a keycombo has been pressed down, don't pass it through
|
||||
// If a key-combo has been pressed down, don't pass it through
|
||||
if(input->shortcutFlags == input_t::SHORTCUT && apply_shortcut(keyCode) > 0) {
|
||||
return;
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 6/20/19.
|
||||
//
|
||||
|
||||
#ifndef SUNSHINE_INPUT_H
|
||||
#define SUNSHINE_INPUT_H
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 5/30/19.
|
||||
//
|
||||
|
||||
#include "process.h"
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 12/22/19.
|
||||
//
|
||||
|
||||
#ifndef SUNSHINE_MAIN_H
|
||||
#define SUNSHINE_MAIN_H
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 12/27/19.
|
||||
//
|
||||
|
||||
#include "network.h"
|
||||
#include "utility.h"
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 12/27/19.
|
||||
//
|
||||
|
||||
#ifndef SUNSHINE_NETWORK_H
|
||||
#define SUNSHINE_NETWORK_H
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 6/3/19.
|
||||
//
|
||||
|
||||
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 6/3/19.
|
||||
//
|
||||
|
||||
#ifndef SUNSHINE_NVHTTP_H
|
||||
#define SUNSHINE_NVHTTP_H
|
||||
|
@ -167,7 +167,7 @@ static std::uint32_t from_view(const std::string_view &string) {
|
||||
_CONVERT("eDP"sv, eDP);
|
||||
_CONVERT("DSI"sv, DSI);
|
||||
|
||||
BOOST_LOG(error) << "Unknown Monitor connector type ["sv << string << "]: Please report this to the Github issue tracker"sv;
|
||||
BOOST_LOG(error) << "Unknown Monitor connector type ["sv << string << "]: Please report this to the GitHub issue tracker"sv;
|
||||
return DRM_MODE_CONNECTOR_Unknown;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 12/14/19.
|
||||
//
|
||||
|
||||
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
||||
|
||||
@ -47,7 +45,7 @@ int exe(const std::string &cmd, bp::environment &env, file_t &file, std::error_c
|
||||
|
||||
int proc_t::execute(int app_id) {
|
||||
if(!running() && _app_id != -1) {
|
||||
// previous process exited on it's own, reset _process_handle
|
||||
// previous process exited on its own, reset _process_handle
|
||||
_process_handle = bp::group();
|
||||
|
||||
_app_id = -1;
|
||||
@ -193,9 +191,9 @@ std::vector<ctx_t> &proc_t::get_apps() {
|
||||
return _apps;
|
||||
}
|
||||
|
||||
/// Gets application image from application list.
|
||||
/// Returns default image if image configuration is not set.
|
||||
/// returns http content-type header compatible image type
|
||||
// Gets application image from application list.
|
||||
// Returns default image if image configuration is not set.
|
||||
// returns http content-type header compatible image type
|
||||
std::string proc_t::get_app_image(int app_id) {
|
||||
auto app_index = app_id - 1;
|
||||
if(app_index < 0 || app_index >= _apps.size()) {
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 12/14/19.
|
||||
//
|
||||
|
||||
#ifndef SUNSHINE_PROCESS_H
|
||||
#define SUNSHINE_PROCESS_H
|
||||
|
14
src/rtsp.cpp
14
src/rtsp.cpp
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 2/2/20.
|
||||
//
|
||||
|
||||
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
||||
|
||||
@ -123,7 +121,7 @@ public:
|
||||
socket->read_payload();
|
||||
});
|
||||
|
||||
auto content_lenght = 0;
|
||||
auto content_length = 0;
|
||||
for(auto option = req->options; option != nullptr; option = option->next) {
|
||||
if("Content-length"sv == option->option) {
|
||||
BOOST_LOG(debug) << "Found Content-Length: "sv << option->content << " bytes"sv;
|
||||
@ -133,14 +131,14 @@ public:
|
||||
std::string_view content { option->content };
|
||||
auto begin = std::find_if(std::begin(content), std::end(content), [](auto ch) { return (bool)std::isdigit(ch); });
|
||||
|
||||
content_lenght = util::from_chars(begin, std::end(content));
|
||||
content_length = util::from_chars(begin, std::end(content));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(end - socket->crlf >= content_lenght) {
|
||||
if(end - socket->crlf > content_lenght) {
|
||||
BOOST_LOG(warning) << "(end - socket->crlf) > content_lenght -- "sv << (std::size_t)(end - socket->crlf) << " > "sv << content_lenght;
|
||||
if(end - socket->crlf >= content_length) {
|
||||
if(end - socket->crlf > content_length) {
|
||||
BOOST_LOG(warning) << "(end - socket->crlf) > content_length -- "sv << (std::size_t)(end - socket->crlf) << " > "sv << content_length;
|
||||
}
|
||||
|
||||
fg.disable();
|
||||
@ -380,7 +378,7 @@ void launch_session_raise(launch_session_t launch_session) {
|
||||
}
|
||||
|
||||
int session_count() {
|
||||
// Ensure session_count is up to date
|
||||
// Ensure session_count is up-to-date
|
||||
server.clear(false);
|
||||
|
||||
return server.session_count();
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 2/2/20.
|
||||
//
|
||||
|
||||
#ifndef SUNSHINE_RTSP_H
|
||||
#define SUNSHINE_RTSP_H
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 6/5/19.
|
||||
//
|
||||
|
||||
#include "process.h"
|
||||
|
||||
@ -240,8 +238,7 @@ struct broadcast_ctx_t {
|
||||
udp::socket video_sock { io };
|
||||
udp::socket audio_sock { io };
|
||||
|
||||
// This is purely for adminitrative purposes.
|
||||
//
|
||||
// This is purely for administrative purposes.
|
||||
// It's possible two instances of Moonlight are behind a NAT.
|
||||
// From Sunshine's point of view, the ip addresses are identical
|
||||
// We need some way to know what ports are already used for different streams
|
||||
@ -767,7 +764,7 @@ void controlBroadcastThread(control_server_t *server) {
|
||||
}
|
||||
|
||||
// Let all remaining connections know the server is shutting down
|
||||
// reason: gracefull termination
|
||||
// reason: graceful termination
|
||||
std::uint32_t reason = 0x80030023;
|
||||
|
||||
control_terminate_t plaintext;
|
||||
@ -932,7 +929,7 @@ void videoBroadcastThread(udp::socket &sock) {
|
||||
|
||||
// With a fecpercentage of 255, if payload_new is broken up into more than a 100 data_shards
|
||||
// it will generate greater than DATA_SHARDS_MAX shards.
|
||||
// Therefore, we start breaking the data up into three seperate fec blocks.
|
||||
// Therefore, we start breaking the data up into three separate fec blocks.
|
||||
auto multi_fec_threshold = 90 * blocksize;
|
||||
|
||||
// We can go up to 4 fec blocks, but 3 is plenty
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 6/5/19.
|
||||
//
|
||||
|
||||
#ifndef SUNSHINE_STREAM_H
|
||||
#define SUNSHINE_STREAM_H
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 16-4-19.
|
||||
//
|
||||
|
||||
#ifndef SUNSHINE_SYNC_H
|
||||
#define SUNSHINE_SYNC_H
|
||||
@ -92,4 +90,4 @@ private:
|
||||
} // namespace util
|
||||
|
||||
|
||||
#endif //T_MAN_SYNC_H
|
||||
#endif // SUNSHINE_SYNC_H
|
||||
|
@ -7,7 +7,7 @@
|
||||
namespace util {
|
||||
/*
|
||||
* Allow threads to execute unhindered
|
||||
* while keeping full controll over the threads.
|
||||
* while keeping full control over the threads.
|
||||
*/
|
||||
class ThreadPool : public TaskPool {
|
||||
public:
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 6/10/19.
|
||||
//
|
||||
|
||||
#ifndef SUNSHINE_THREAD_SAFE_H
|
||||
#define SUNSHINE_THREAD_SAFE_H
|
||||
@ -37,7 +35,7 @@ public:
|
||||
_cv.notify_all();
|
||||
}
|
||||
|
||||
// pop and view shoud not be used interchangebly
|
||||
// pop and view shoud not be used interchangeably
|
||||
status_t pop() {
|
||||
std::unique_lock ul { _lock };
|
||||
|
||||
@ -58,7 +56,7 @@ public:
|
||||
return val;
|
||||
}
|
||||
|
||||
// pop and view shoud not be used interchangebly
|
||||
// pop and view shoud not be used interchangeably
|
||||
template<class Rep, class Period>
|
||||
status_t pop(std::chrono::duration<Rep, Period> delay) {
|
||||
std::unique_lock ul { _lock };
|
||||
@ -78,7 +76,7 @@ public:
|
||||
return val;
|
||||
}
|
||||
|
||||
// pop and view shoud not be used interchangebly
|
||||
// pop and view shoud not be used interchangeably
|
||||
const status_t &view() {
|
||||
std::unique_lock ul { _lock };
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 8-2-19.
|
||||
//
|
||||
|
||||
#ifndef T_MAN_UUID_H
|
||||
#define T_MAN_UUID_H
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 6/6/19.
|
||||
//
|
||||
|
||||
#include <atomic>
|
||||
#include <bitset>
|
||||
@ -225,7 +223,7 @@ public:
|
||||
|
||||
~swdevice_t() override {}
|
||||
|
||||
// Store ownsership when frame is hw_frame
|
||||
// Store ownership when frame is hw_frame
|
||||
frame_t hw_frame;
|
||||
|
||||
frame_t sw_frame;
|
||||
@ -239,7 +237,7 @@ public:
|
||||
enum flag_e {
|
||||
DEFAULT = 0x00,
|
||||
PARALLEL_ENCODING = 0x01,
|
||||
H264_ONLY = 0x02, // When HEVC is to heavy
|
||||
H264_ONLY = 0x02, // When HEVC is too heavy
|
||||
LIMITED_GOP_SIZE = 0x04, // Some encoders don't like it when you have an infinite GOP_SIZE. *cough* VAAPI *cough*
|
||||
SINGLE_SLICE_ONLY = 0x08, // Never use multiple slices <-- Older intel iGPU's ruin it for everyone else :P
|
||||
};
|
||||
@ -1622,12 +1620,7 @@ retry:
|
||||
}
|
||||
|
||||
int init() {
|
||||
BOOST_LOG(info) << "//////////////////////////////////////////////////////////////////"sv;
|
||||
BOOST_LOG(info) << "// //"sv;
|
||||
BOOST_LOG(info) << "// Testing for available encoders, this may generate errors. //"sv;
|
||||
BOOST_LOG(info) << "// You can safely ignore those errors. //"sv;
|
||||
BOOST_LOG(info) << "// //"sv;
|
||||
BOOST_LOG(info) << "//////////////////////////////////////////////////////////////////"sv;
|
||||
BOOST_LOG(info) << "// Testing for available encoders, this may generate errors. You can safely ignore those errors. //"sv;
|
||||
|
||||
KITTY_WHILE_LOOP(auto pos = std::begin(encoders), pos != std::end(encoders), {
|
||||
if(
|
||||
@ -1643,11 +1636,7 @@ int init() {
|
||||
})
|
||||
|
||||
BOOST_LOG(info);
|
||||
BOOST_LOG(info) << "//////////////////////////////////////////////////////////////"sv;
|
||||
BOOST_LOG(info) << "// //"sv;
|
||||
BOOST_LOG(info) << "// Ignore any errors mentioned above, they are not relevant //"sv;
|
||||
BOOST_LOG(info) << "// //"sv;
|
||||
BOOST_LOG(info) << "//////////////////////////////////////////////////////////////"sv;
|
||||
BOOST_LOG(info) << "// Ignore any errors mentioned above, they are not relevant. //"sv;
|
||||
BOOST_LOG(info);
|
||||
|
||||
if(encoders.empty()) {
|
||||
|
@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 6/9/19.
|
||||
//
|
||||
|
||||
#ifndef SUNSHINE_VIDEO_H
|
||||
#define SUNSHINE_VIDEO_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user