docs: improvements to source code documentation (#1236)
This commit is contained in:
@@ -52,7 +52,7 @@ NamespaceIndentation: All
|
|||||||
ObjCSpaceAfterProperty: true
|
ObjCSpaceAfterProperty: true
|
||||||
ObjCSpaceBeforeProtocolList: true
|
ObjCSpaceBeforeProtocolList: true
|
||||||
PointerAlignment: Right
|
PointerAlignment: Right
|
||||||
ReflowComments: false
|
ReflowComments: true
|
||||||
SpaceAfterCStyleCast: true
|
SpaceAfterCStyleCast: true
|
||||||
SpaceAfterLogicalNot: false
|
SpaceAfterLogicalNot: false
|
||||||
SpaceAfterTemplateKeyword: true
|
SpaceAfterTemplateKeyword: true
|
||||||
|
|||||||
@@ -8,16 +8,16 @@ version: 2
|
|||||||
|
|
||||||
# Set the version of Python
|
# Set the version of Python
|
||||||
build:
|
build:
|
||||||
os: ubuntu-20.04
|
os: ubuntu-22.04
|
||||||
tools:
|
tools:
|
||||||
python: "3.10"
|
python: "3.11"
|
||||||
apt_packages:
|
apt_packages:
|
||||||
- graphviz
|
- graphviz
|
||||||
|
|
||||||
## Include the submodules, required for cmake
|
# submodules required for include statements
|
||||||
# submodules:
|
submodules:
|
||||||
# include: all
|
include: all
|
||||||
# recursive: true
|
recursive: true
|
||||||
|
|
||||||
# Build documentation in the docs/ directory with Sphinx
|
# Build documentation in the docs/ directory with Sphinx
|
||||||
sphinx:
|
sphinx:
|
||||||
|
|||||||
@@ -878,6 +878,7 @@ WARN_IF_UNDOC_ENUM_VAL = NO
|
|||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
WARN_AS_ERROR = NO
|
WARN_AS_ERROR = NO
|
||||||
|
# todo - ideally this will eventually become FAIL_ON_WARNINGS
|
||||||
|
|
||||||
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
|
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
|
||||||
# can produce. The string should contain the $file, $line, and $text tags, which
|
# can produce. The string should contain the $file, $line, and $text tags, which
|
||||||
@@ -2354,7 +2355,7 @@ SEARCH_INCLUDES = YES
|
|||||||
# RECURSIVE has no effect here.
|
# RECURSIVE has no effect here.
|
||||||
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
|
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
|
||||||
|
|
||||||
INCLUDE_PATH =
|
INCLUDE_PATH = ../third-party/ffmpeg-linux-x86_64/include/
|
||||||
|
|
||||||
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
|
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
|
||||||
# patterns (like *.h and *.hpp) to filter out the header-files in the
|
# patterns (like *.h and *.hpp) to filter out the header-files in the
|
||||||
|
|||||||
@@ -95,8 +95,16 @@ breathe_projects = dict(
|
|||||||
)
|
)
|
||||||
todo_include_todos = True
|
todo_include_todos = True
|
||||||
|
|
||||||
subprocess.run('doxygen', shell=True, cwd=source_dir)
|
|
||||||
|
|
||||||
# disable epub mimetype warnings
|
# disable epub mimetype warnings
|
||||||
# https://github.com/readthedocs/readthedocs.org/blob/eadf6ac6dc6abc760a91e1cb147cc3c5f37d1ea8/docs/conf.py#L235-L236
|
# https://github.com/readthedocs/readthedocs.org/blob/eadf6ac6dc6abc760a91e1cb147cc3c5f37d1ea8/docs/conf.py#L235-L236
|
||||||
suppress_warnings = ["epub.unknown_project_files"]
|
suppress_warnings = ["epub.unknown_project_files"]
|
||||||
|
|
||||||
|
# get doxygen version
|
||||||
|
doxy_proc = subprocess.run('doxygen --version', shell=True, cwd=source_dir, capture_output=True)
|
||||||
|
doxy_version = doxy_proc.stdout.decode('utf-8').strip()
|
||||||
|
print('doxygen version: ' + doxy_version)
|
||||||
|
|
||||||
|
# run doxygen
|
||||||
|
doxy_proc = subprocess.run('doxygen Doxyfile', shell=True, cwd=source_dir)
|
||||||
|
if doxy_proc.returncode != 0:
|
||||||
|
raise RuntimeError('doxygen failed with return code ' + str(doxy_proc.returncode))
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef SUNSHINE_AUDIO_H
|
#pragma once
|
||||||
#define SUNSHINE_AUDIO_H
|
|
||||||
|
|
||||||
#include "thread_safe.h"
|
#include "thread_safe.h"
|
||||||
#include "utility.h"
|
#include "utility.h"
|
||||||
@@ -44,5 +43,3 @@ namespace audio {
|
|||||||
void
|
void
|
||||||
capture(safe::mail_t mail, config_t config, void *channel_data);
|
capture(safe::mail_t mail, config_t config, void *channel_data);
|
||||||
} // namespace audio
|
} // namespace audio
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -87,9 +87,9 @@ namespace cbs {
|
|||||||
make_sps_h264(const AVCodecContext *ctx) {
|
make_sps_h264(const AVCodecContext *ctx) {
|
||||||
H264RawSPS sps {};
|
H264RawSPS sps {};
|
||||||
|
|
||||||
/* b_per_p == ctx->max_b_frames for h264 */
|
// b_per_p == ctx->max_b_frames for h264
|
||||||
/* desired_b_depth == avoption("b_depth") == 1 */
|
// desired_b_depth == avoption("b_depth") == 1
|
||||||
/* max_b_depth == std::min(av_log2(ctx->b_per_p) + 1, desired_b_depth) ==> 1 */
|
// max_b_depth == std::min(av_log2(ctx->b_per_p) + 1, desired_b_depth) ==> 1
|
||||||
auto max_b_depth = 1;
|
auto max_b_depth = 1;
|
||||||
auto dpb_frame = ctx->gop_size == 1 ? 0 : 1 + max_b_depth;
|
auto dpb_frame = ctx->gop_size == 1 ? 0 : 1 + max_b_depth;
|
||||||
auto mb_width = (FFALIGN(ctx->width, 16) / 16) * 16;
|
auto mb_width = (FFALIGN(ctx->width, 16) / 16) * 16;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef SUNSHINE_CBS_H
|
#pragma once
|
||||||
#define SUNSHINE_CBS_H
|
|
||||||
|
|
||||||
#include "utility.h"
|
#include "utility.h"
|
||||||
|
|
||||||
@@ -33,5 +32,3 @@ namespace cbs {
|
|||||||
bool
|
bool
|
||||||
validate_sps(const AVPacket *packet, int codec_id);
|
validate_sps(const AVPacket *packet, int codec_id);
|
||||||
} // namespace cbs
|
} // namespace cbs
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef SUNSHINE_CONFIG_H
|
#pragma once
|
||||||
#define SUNSHINE_CONFIG_H
|
|
||||||
|
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
@@ -162,4 +161,3 @@ namespace config {
|
|||||||
std::unordered_map<std::string, std::string>
|
std::unordered_map<std::string, std::string>
|
||||||
parse_config(const std::string_view &file_content);
|
parse_config(const std::string_view &file_content);
|
||||||
} // namespace config
|
} // namespace config
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// Created by TheElixZammuto on 2021-05-09.
|
|
||||||
// TODO: Authentication, better handling of routes common to nvhttp, cleanup
|
// TODO: Authentication, better handling of routes common to nvhttp, cleanup
|
||||||
|
|
||||||
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
// Created by loki on 6/3/19.
|
#pragma once
|
||||||
|
|
||||||
#ifndef SUNSHINE_CONFIGHTTP_H
|
|
||||||
#define SUNSHINE_CONFIGHTTP_H
|
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -34,5 +31,3 @@ const std::map<std::string, std::string> mime_types = {
|
|||||||
{ "woff2", "font/woff2" },
|
{ "woff2", "font/woff2" },
|
||||||
{ "xml", "text/xml" },
|
{ "xml", "text/xml" },
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SUNSHINE_CONFIGHTTP_H
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// Created by loki on 5/31/19.
|
|
||||||
|
|
||||||
#include "crypto.h"
|
#include "crypto.h"
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
@@ -35,7 +33,7 @@ namespace crypto {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* When certificates from two or more instances of Moonlight have been added to x509_store_t,
|
* When certificates from two or more instances of Moonlight have been added to x509_store_t,
|
||||||
* only one of them will be verified by X509_verify_cert, resulting in only a single instance of
|
* only one of them will be verified by X509_verify_cert, resulting in only a single instance of
|
||||||
* Moonlight to be able to use Sunshine
|
* Moonlight to be able to use Sunshine
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
// Created by loki on 6/1/19.
|
#pragma once
|
||||||
|
|
||||||
#ifndef SUNSHINE_CRYPTO_H
|
|
||||||
#define SUNSHINE_CRYPTO_H
|
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
@@ -155,5 +152,3 @@ namespace crypto {
|
|||||||
};
|
};
|
||||||
} // namespace cipher
|
} // namespace cipher
|
||||||
} // namespace crypto
|
} // namespace crypto
|
||||||
|
|
||||||
#endif //SUNSHINE_CRYPTO_H
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
#include "thread_safe.h"
|
#include "thread_safe.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// Created by loki on 6/20/19.
|
|
||||||
|
|
||||||
// define uint32_t for <moonlight-common-c/src/Input.h>
|
// define uint32_t for <moonlight-common-c/src/Input.h>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@@ -366,8 +364,7 @@ namespace input {
|
|||||||
|
|
||||||
mouse_press[button] = !release;
|
mouse_press[button] = !release;
|
||||||
}
|
}
|
||||||
///////////////////////////////////
|
/**
|
||||||
/*/
|
|
||||||
* When Moonlight sends mouse input through absolute coordinates,
|
* When Moonlight sends mouse input through absolute coordinates,
|
||||||
* it's possible that BUTTON_RIGHT is pressed down immediately after releasing BUTTON_LEFT.
|
* 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
|
||||||
@@ -380,7 +377,7 @@ namespace input {
|
|||||||
*
|
*
|
||||||
* input->mouse_left_button_timeout can only be nullptr
|
* input->mouse_left_button_timeout can only be nullptr
|
||||||
* when the last mouse coordinates were absolute
|
* when the last mouse coordinates were absolute
|
||||||
/*/
|
*/
|
||||||
if (button == BUTTON_LEFT && release && !input->mouse_left_button_timeout) {
|
if (button == BUTTON_LEFT && release && !input->mouse_left_button_timeout) {
|
||||||
auto f = [=]() {
|
auto f = [=]() {
|
||||||
auto left_released = mouse_press[BUTTON_LEFT];
|
auto left_released = mouse_press[BUTTON_LEFT];
|
||||||
@@ -408,7 +405,6 @@ namespace input {
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
///////////////////////////////////
|
|
||||||
|
|
||||||
platf::button_mouse(platf_input, button, release);
|
platf::button_mouse(platf_input, button, release);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
// Created by loki on 6/20/19.
|
#pragma once
|
||||||
|
|
||||||
#ifndef SUNSHINE_INPUT_H
|
|
||||||
#define SUNSHINE_INPUT_H
|
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
@@ -33,5 +30,3 @@ namespace input {
|
|||||||
float scalar_inv;
|
float scalar_inv;
|
||||||
};
|
};
|
||||||
} // namespace input
|
} // namespace input
|
||||||
|
|
||||||
#endif // SUNSHINE_INPUT_H
|
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// macros
|
// macros
|
||||||
#ifndef SUNSHINE_MAIN_H
|
#pragma once
|
||||||
#define SUNSHINE_MAIN_H
|
|
||||||
|
|
||||||
// standard includes
|
// standard includes
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
@@ -87,5 +86,3 @@ namespace service_ctrl {
|
|||||||
wait_for_ui_ready();
|
wait_for_ui_ready();
|
||||||
} // namespace service_ctrl
|
} // namespace service_ctrl
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // SUNSHINE_MAIN_H
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
#ifndef DOSSIER_MOVE_BY_COPY_H
|
#pragma once
|
||||||
#define DOSSIER_MOVE_BY_COPY_H
|
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
namespace move_by_copy_util {
|
namespace move_by_copy_util {
|
||||||
/*
|
/**
|
||||||
* When a copy is made, it moves the object
|
* When a copy is made, it moves the object
|
||||||
* This allows you to move an object when a move can't be done.
|
* This allows you to move an object when a move can't be done.
|
||||||
*/
|
*/
|
||||||
@@ -53,4 +52,3 @@ namespace move_by_copy_util {
|
|||||||
return MoveByCopy<T>(std::move(const_cast<T &>(movable)));
|
return MoveByCopy<T>(std::move(const_cast<T &>(movable)));
|
||||||
}
|
}
|
||||||
} // namespace move_by_copy_util
|
} // namespace move_by_copy_util
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// Created by loki on 12/27/19.
|
|
||||||
|
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
#include "utility.h"
|
#include "utility.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
// Created by loki on 12/27/19.
|
#pragma once
|
||||||
|
|
||||||
#ifndef SUNSHINE_NETWORK_H
|
|
||||||
#define SUNSHINE_NETWORK_H
|
|
||||||
|
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
@@ -34,5 +31,3 @@ namespace net {
|
|||||||
host_t
|
host_t
|
||||||
host_create(ENetAddress &addr, std::size_t peers, std::uint16_t port);
|
host_create(ENetAddress &addr, std::size_t peers, std::uint16_t port);
|
||||||
} // namespace net
|
} // namespace net
|
||||||
|
|
||||||
#endif // SUNSHINE_NETWORK_H
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @file nvhttp.h
|
* @file nvhttp.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// macros
|
// macros
|
||||||
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
/**
|
/**
|
||||||
* @file nvhttp.h
|
* @file nvhttp.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// macros
|
// macros
|
||||||
#ifndef SUNSHINE_NVHTTP_H
|
#pragma once
|
||||||
#define SUNSHINE_NVHTTP_H
|
|
||||||
|
|
||||||
// standard includes
|
// standard includes
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -46,5 +45,3 @@ namespace nvhttp {
|
|||||||
void
|
void
|
||||||
erase_all_clients();
|
erase_all_clients();
|
||||||
} // namespace nvhttp
|
} // namespace nvhttp
|
||||||
|
|
||||||
#endif // SUNSHINE_NVHTTP_H
|
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
//
|
#pragma once
|
||||||
// Created by loki on 6/21/19.
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef SUNSHINE_COMMON_H
|
|
||||||
#define SUNSHINE_COMMON_H
|
|
||||||
|
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
@@ -468,5 +463,3 @@ namespace platf {
|
|||||||
std::vector<std::string_view> &
|
std::vector<std::string_view> &
|
||||||
supported_gamepads();
|
supported_gamepads();
|
||||||
} // namespace platf
|
} // namespace platf
|
||||||
|
|
||||||
#endif //SUNSHINE_COMMON_H
|
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
//
|
|
||||||
// Created by loki on 5/16/21.
|
|
||||||
//
|
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ using namespace std::literals;
|
|||||||
|
|
||||||
using namespace std::literals;
|
using namespace std::literals;
|
||||||
|
|
||||||
//////////////////// Special desclarations
|
// Special declarations
|
||||||
/**
|
/**
|
||||||
* NVCC tends to have problems with standard headers.
|
* NVCC tends to have problems with standard headers.
|
||||||
* Don't include common.h, instead use bare minimum
|
* Don't include common.h, instead use bare minimum
|
||||||
@@ -78,7 +78,7 @@ static_assert(sizeof(video::color_t) == sizeof(video::color_extern_t), "color ma
|
|||||||
extern color_t colors[6];
|
extern color_t colors[6];
|
||||||
} // namespace video
|
} // namespace video
|
||||||
|
|
||||||
//////////////////// End special declarations
|
// End special declarations
|
||||||
|
|
||||||
namespace cuda {
|
namespace cuda {
|
||||||
auto constexpr INVALID_TEXTURE = std::numeric_limits<cudaTextureObject_t>::max();
|
auto constexpr INVALID_TEXTURE = std::numeric_limits<cudaTextureObject_t>::max();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#if !defined(SUNSHINE_PLATFORM_CUDA_H) && defined(SUNSHINE_BUILD_CUDA)
|
#pragma once
|
||||||
#define SUNSHINE_PLATFORM_CUDA_H
|
|
||||||
|
#if defined(SUNSHINE_BUILD_CUDA)
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef SUNSHINE_PLATFORM_LINUX_OPENGL_H
|
#pragma once
|
||||||
#define SUNSHINE_PLATFORM_LINUX_OPENGL_H
|
|
||||||
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
@@ -352,5 +351,3 @@ namespace egl {
|
|||||||
bool
|
bool
|
||||||
fail();
|
fail();
|
||||||
} // namespace egl
|
} // namespace egl
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ namespace platf {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initializes the keycode constants for translating
|
* @brief Initializes the keycode constants for translating
|
||||||
* moonlight keycodes to linux/X11 keycodes
|
* moonlight keycodes to linux/X11 keycodes.
|
||||||
*/
|
*/
|
||||||
static constexpr std::array<keycode_t, 0xE3>
|
static constexpr std::array<keycode_t, 0xE3>
|
||||||
init_keycodes() {
|
init_keycodes() {
|
||||||
@@ -1247,7 +1247,7 @@ namespace platf {
|
|||||||
/**
|
/**
|
||||||
* @brief XTest mouse scroll.
|
* @brief XTest mouse scroll.
|
||||||
* @param input The input_t instance to use.
|
* @param input The input_t instance to use.
|
||||||
* @param distance How far to scroll
|
* @param distance How far to scroll.
|
||||||
* @param button_pos Which mouse button to emulate for positive scroll.
|
* @param button_pos Which mouse button to emulate for positive scroll.
|
||||||
* @param button_neg Which mouse button to emulate for negative scroll.
|
* @param button_neg Which mouse button to emulate for negative scroll.
|
||||||
*
|
*
|
||||||
@@ -1276,7 +1276,7 @@ namespace platf {
|
|||||||
/**
|
/**
|
||||||
* @brief Vertical mouse scroll.
|
* @brief Vertical mouse scroll.
|
||||||
* @param input The input_t instance to use.
|
* @param input The input_t instance to use.
|
||||||
* @param high_res_distance How far to scroll
|
* @param high_res_distance How far to scroll.
|
||||||
*
|
*
|
||||||
* EXAMPLES:
|
* EXAMPLES:
|
||||||
* ```cpp
|
* ```cpp
|
||||||
@@ -1301,7 +1301,7 @@ namespace platf {
|
|||||||
/**
|
/**
|
||||||
* @brief Horizontal mouse scroll.
|
* @brief Horizontal mouse scroll.
|
||||||
* @param input The input_t instance to use.
|
* @param input The input_t instance to use.
|
||||||
* @param high_res_distance How far to scroll
|
* @param high_res_distance How far to scroll.
|
||||||
*
|
*
|
||||||
* EXAMPLES:
|
* EXAMPLES:
|
||||||
* ```cpp
|
* ```cpp
|
||||||
@@ -1428,7 +1428,7 @@ namespace platf {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Here we receive a single UTF-8 encoded char at a time,
|
* Here we receive a single UTF-8 encoded char at a time,
|
||||||
* the trick is to convert it to UTF-32 then send CTRL+SHIFT+U+<HEXCODE> in order to produce any
|
* the trick is to convert it to UTF-32 then send CTRL+SHIFT+U+{HEXCODE} in order to produce any
|
||||||
* unicode character, see: https://en.wikipedia.org/wiki/Unicode_input
|
* unicode character, see: https://en.wikipedia.org/wiki/Unicode_input
|
||||||
*
|
*
|
||||||
* ex:
|
* ex:
|
||||||
@@ -1549,7 +1549,7 @@ namespace platf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initalize a new keyboard and return it.
|
* @brief Initialize a new keyboard and return it.
|
||||||
*
|
*
|
||||||
* EXAMPLES:
|
* EXAMPLES:
|
||||||
* ```cpp
|
* ```cpp
|
||||||
@@ -1578,7 +1578,7 @@ namespace platf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initalize a new uinput virtual mouse and return it.
|
* @brief Initialize a new `uinput` virtual mouse and return it.
|
||||||
*
|
*
|
||||||
* EXAMPLES:
|
* EXAMPLES:
|
||||||
* ```cpp
|
* ```cpp
|
||||||
@@ -1629,7 +1629,7 @@ namespace platf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initalize a new uinput virtual touchscreen and return it.
|
* @brief Initialize a new `uinput` virtual touchscreen and return it.
|
||||||
*
|
*
|
||||||
* EXAMPLES:
|
* EXAMPLES:
|
||||||
* ```cpp
|
* ```cpp
|
||||||
@@ -1679,7 +1679,7 @@ namespace platf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initalize a new uinput virtual X360 gamepad and return it.
|
* @brief Initialize a new `uinput` virtual X360 gamepad and return it.
|
||||||
*
|
*
|
||||||
* EXAMPLES:
|
* EXAMPLES:
|
||||||
* ```cpp
|
* ```cpp
|
||||||
@@ -1756,7 +1756,7 @@ namespace platf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initalize the input system and return it.
|
* @brief Initialize the input system and return it.
|
||||||
*
|
*
|
||||||
* EXAMPLES:
|
* EXAMPLES:
|
||||||
* ```cpp
|
* ```cpp
|
||||||
|
|||||||
@@ -552,7 +552,7 @@ namespace platf {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: surf_sd = fb->to_sd();
|
// TODO: surf_sd = fb->to_sd();
|
||||||
|
|
||||||
auto crct = card.crtc(plane->crtc_id);
|
auto crct = card.crtc(plane->crtc_id);
|
||||||
kms::print(plane.get(), fb.get(), crct.get());
|
kms::print(plane.get(), fb.get(), crct.get());
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef SUNSHINE_PLATFORM_MISC_H
|
#pragma once
|
||||||
#define SUNSHINE_PLATFORM_MISC_H
|
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -29,5 +28,3 @@ namespace dyn {
|
|||||||
handle(const std::vector<const char *> &libs);
|
handle(const std::vector<const char *> &libs);
|
||||||
|
|
||||||
} // namespace dyn
|
} // namespace dyn
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -12,7 +12,9 @@ using namespace std::literals;
|
|||||||
|
|
||||||
namespace avahi {
|
namespace avahi {
|
||||||
|
|
||||||
/** Error codes used by avahi */
|
/**
|
||||||
|
* @brief Error codes used by avahi
|
||||||
|
*/
|
||||||
enum err_e {
|
enum err_e {
|
||||||
OK = 0, /**< OK */
|
OK = 0, /**< OK */
|
||||||
ERR_FAILURE = -1, /**< Generic error code */
|
ERR_FAILURE = -1, /**< Generic error code */
|
||||||
@@ -113,7 +115,9 @@ namespace avahi {
|
|||||||
CLIENT_NO_FAIL = 2 /**< Don't fail if the daemon is not available when avahi_client_new() is called, instead enter CLIENT_CONNECTING state and wait for the daemon to appear */
|
CLIENT_NO_FAIL = 2 /**< Don't fail if the daemon is not available when avahi_client_new() is called, instead enter CLIENT_CONNECTING state and wait for the daemon to appear */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Some flags for publishing functions */
|
/**
|
||||||
|
* @brief Some flags for publishing functions
|
||||||
|
*/
|
||||||
enum PublishFlags {
|
enum PublishFlags {
|
||||||
PUBLISH_UNIQUE = 1, /**< For raw records: The RRset is intended to be unique */
|
PUBLISH_UNIQUE = 1, /**< For raw records: The RRset is intended to be unique */
|
||||||
PUBLISH_NO_PROBE = 2, /**< For raw records: Though the RRset is intended to be unique no probes shall be sent */
|
PUBLISH_NO_PROBE = 2, /**< For raw records: Though the RRset is intended to be unique no probes shall be sent */
|
||||||
|
|||||||
@@ -7,8 +7,7 @@ extern "C" {
|
|||||||
#include <libavcodec/avcodec.h>
|
#include <libavcodec/avcodec.h>
|
||||||
#include <va/va.h>
|
#include <va/va.h>
|
||||||
#if !VA_CHECK_VERSION(1, 9, 0)
|
#if !VA_CHECK_VERSION(1, 9, 0)
|
||||||
/* vaSyncBuffer stub allows Sunshine built against libva <2.9.0
|
// vaSyncBuffer stub allows Sunshine built against libva <2.9.0 to link against ffmpeg on libva 2.9.0 or later
|
||||||
to link against ffmpeg on libva 2.9.0 or later */
|
|
||||||
VAStatus
|
VAStatus
|
||||||
vaSyncBuffer(
|
vaSyncBuffer(
|
||||||
VADisplay dpy,
|
VADisplay dpy,
|
||||||
@@ -56,10 +55,7 @@ namespace va {
|
|||||||
// Needs to be closed manually
|
// Needs to be closed manually
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
/*
|
// Total size of this object (may include regions which are not part of the surface)
|
||||||
* Total size of this object (may include regions which are
|
|
||||||
* not part of the surface).
|
|
||||||
*/
|
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
// Format modifier applied to this object, not sure what that means
|
// Format modifier applied to this object, not sure what that means
|
||||||
uint64_t drm_format_modifier;
|
uint64_t drm_format_modifier;
|
||||||
@@ -85,7 +81,9 @@ namespace va {
|
|||||||
} layers[4];
|
} layers[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Currently defined profiles */
|
/**
|
||||||
|
* @brief Currently defined profiles
|
||||||
|
*/
|
||||||
enum class profile_e {
|
enum class profile_e {
|
||||||
// Profile ID used for video processing.
|
// Profile ID used for video processing.
|
||||||
ProfileNone = -1,
|
ProfileNone = -1,
|
||||||
@@ -135,9 +133,9 @@ namespace va {
|
|||||||
IDCT = 3,
|
IDCT = 3,
|
||||||
MoComp = 4,
|
MoComp = 4,
|
||||||
Deblocking = 5,
|
Deblocking = 5,
|
||||||
EncSlice = 6, /* slice level encode */
|
EncSlice = 6, /** slice level encode */
|
||||||
EncPicture = 7, /* pictuer encode, JPEG, etc */
|
EncPicture = 7, /** picture encode, JPEG, etc */
|
||||||
/*
|
/**
|
||||||
* For an implementation that supports a low power/high performance variant
|
* For an implementation that supports a low power/high performance variant
|
||||||
* for slice level encode, it can choose to expose the
|
* for slice level encode, it can choose to expose the
|
||||||
* VAEntrypointEncSliceLP entrypoint. Certain encoding tools may not be
|
* VAEntrypointEncSliceLP entrypoint. Certain encoding tools may not be
|
||||||
@@ -148,7 +146,7 @@ namespace va {
|
|||||||
EncSliceLP = 8,
|
EncSliceLP = 8,
|
||||||
VideoProc = 10, /**< Video pre/post-processing. */
|
VideoProc = 10, /**< Video pre/post-processing. */
|
||||||
/**
|
/**
|
||||||
* \brief FEI
|
* @brief FEI
|
||||||
*
|
*
|
||||||
* The purpose of FEI (Flexible Encoding Infrastructure) is to allow applications to
|
* The purpose of FEI (Flexible Encoding Infrastructure) is to allow applications to
|
||||||
* have more controls and trade off quality for speed with their own IPs.
|
* have more controls and trade off quality for speed with their own IPs.
|
||||||
@@ -162,10 +160,10 @@ namespace va {
|
|||||||
* and VAEncFEIDistortionBufferType) for FEI entry function.
|
* and VAEncFEIDistortionBufferType) for FEI entry function.
|
||||||
* If separate PAK is set, two extra input buffers
|
* If separate PAK is set, two extra input buffers
|
||||||
* (VAEncFEIMVBufferType, VAEncFEIMBModeBufferType) are needed for PAK input.
|
* (VAEncFEIMVBufferType, VAEncFEIMBModeBufferType) are needed for PAK input.
|
||||||
**/
|
*/
|
||||||
FEI = 11,
|
FEI = 11,
|
||||||
/**
|
/**
|
||||||
* \brief Stats
|
* @brief Stats
|
||||||
*
|
*
|
||||||
* A pre-processing function for getting some statistics and motion vectors is added,
|
* A pre-processing function for getting some statistics and motion vectors is added,
|
||||||
* and some extra controls for Encode pipeline are provided. The application can
|
* and some extra controls for Encode pipeline are provided. The application can
|
||||||
@@ -179,19 +177,19 @@ namespace va {
|
|||||||
* (VAStatsStatisticsParameterBufferType) and one or two output buffers
|
* (VAStatsStatisticsParameterBufferType) and one or two output buffers
|
||||||
* (VAStatsStatisticsBufferType, VAStatsStatisticsBottomFieldBufferType (for interlace only)
|
* (VAStatsStatisticsBufferType, VAStatsStatisticsBottomFieldBufferType (for interlace only)
|
||||||
* and VAStatsMVBufferType) are needed for this entry point.
|
* and VAStatsMVBufferType) are needed for this entry point.
|
||||||
**/
|
*/
|
||||||
Stats = 12,
|
Stats = 12,
|
||||||
/**
|
/**
|
||||||
* \brief ProtectedTEEComm
|
* @brief ProtectedTEEComm
|
||||||
*
|
*
|
||||||
* A function for communicating with TEE (Trusted Execution Environment).
|
* A function for communicating with TEE (Trusted Execution Environment).
|
||||||
**/
|
*/
|
||||||
ProtectedTEEComm = 13,
|
ProtectedTEEComm = 13,
|
||||||
/**
|
/**
|
||||||
* \brief ProtectedContent
|
* @brief ProtectedContent
|
||||||
*
|
*
|
||||||
* A function for protected content to decrypt encrypted content.
|
* A function for protected content to decrypt encrypted content.
|
||||||
**/
|
*/
|
||||||
ProtectedContent = 14,
|
ProtectedContent = 14,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef SUNSHINE_VAAPI_H
|
#pragma once
|
||||||
#define SUNSHINE_VAAPI_H
|
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "src/platform/common.h"
|
#include "src/platform/common.h"
|
||||||
@@ -29,4 +28,3 @@ namespace va {
|
|||||||
int
|
int
|
||||||
init();
|
init();
|
||||||
} // namespace va
|
} // namespace va
|
||||||
#endif
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef SUNSHINE_WAYLAND_H
|
#pragma once
|
||||||
#define SUNSHINE_WAYLAND_H
|
|
||||||
|
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
|
|
||||||
@@ -246,5 +245,3 @@ namespace wl {
|
|||||||
init() { return -1; }
|
init() { return -1; }
|
||||||
} // namespace wl
|
} // namespace wl
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,7 +1,3 @@
|
|||||||
//
|
|
||||||
// Created by loki on 6/21/19.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "src/platform/common.h"
|
#include "src/platform/common.h"
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
@@ -389,7 +385,7 @@ namespace platf {
|
|||||||
|
|
||||||
mem_type_e mem_type;
|
mem_type_e mem_type;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Last X (NOT the streamed monitor!) size.
|
* Last X (NOT the streamed monitor!) size.
|
||||||
* This way we can trigger reinitialization if the dimensions changed while streaming
|
* This way we can trigger reinitialization if the dimensions changed while streaming
|
||||||
*/
|
*/
|
||||||
@@ -472,7 +468,7 @@ namespace platf {
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
refresh() {
|
refresh() {
|
||||||
x11::GetWindowAttributes(xdisplay.get(), xwindow, &xattr); //Update xattr's
|
x11::GetWindowAttributes(xdisplay.get(), xwindow, &xattr); // Update xattr's
|
||||||
}
|
}
|
||||||
|
|
||||||
capture_e
|
capture_e
|
||||||
@@ -521,7 +517,7 @@ namespace platf {
|
|||||||
snapshot(const pull_free_image_cb_t &pull_free_image_cb, std::shared_ptr<platf::img_t> &img_out, std::chrono::milliseconds timeout, bool cursor) {
|
snapshot(const pull_free_image_cb_t &pull_free_image_cb, std::shared_ptr<platf::img_t> &img_out, std::chrono::milliseconds timeout, bool cursor) {
|
||||||
refresh();
|
refresh();
|
||||||
|
|
||||||
//The whole X server changed, so we must reinit everything
|
// The whole X server changed, so we must reinit everything
|
||||||
if (xattr.width != env_width || xattr.height != env_height) {
|
if (xattr.width != env_width || xattr.height != env_height) {
|
||||||
BOOST_LOG(warning) << "X dimensions changed in non-SHM mode, request reinit"sv;
|
BOOST_LOG(warning) << "X dimensions changed in non-SHM mode, request reinit"sv;
|
||||||
return capture_e::reinit;
|
return capture_e::reinit;
|
||||||
@@ -657,7 +653,7 @@ namespace platf {
|
|||||||
|
|
||||||
capture_e
|
capture_e
|
||||||
snapshot(const pull_free_image_cb_t &pull_free_image_cb, std::shared_ptr<platf::img_t> &img_out, std::chrono::milliseconds timeout, bool cursor) {
|
snapshot(const pull_free_image_cb_t &pull_free_image_cb, std::shared_ptr<platf::img_t> &img_out, std::chrono::milliseconds timeout, bool cursor) {
|
||||||
//The whole X server changed, so we must reinit everything
|
// The whole X server changed, so we must reinit everything
|
||||||
if (xattr.width != env_width || xattr.height != env_height) {
|
if (xattr.width != env_width || xattr.height != env_height) {
|
||||||
BOOST_LOG(warning) << "X dimensions changed in SHM mode, request reinit"sv;
|
BOOST_LOG(warning) << "X dimensions changed in SHM mode, request reinit"sv;
|
||||||
return capture_e::reinit;
|
return capture_e::reinit;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef SUNSHINE_X11_GRAB
|
#pragma once
|
||||||
#define SUNSHINE_X11_GRAB
|
|
||||||
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
|
||||||
@@ -66,5 +65,3 @@ namespace platf::x11 {
|
|||||||
make_display() { return nullptr; }
|
make_display() { return nullptr; }
|
||||||
#endif
|
#endif
|
||||||
} // namespace platf::x11
|
} // namespace platf::x11
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef SUNSHINE_PLATFORM_AV_AUDIO_H
|
#pragma once
|
||||||
#define SUNSHINE_PLATFORM_AV_AUDIO_H
|
|
||||||
|
|
||||||
#import <AVFoundation/AVFoundation.h>
|
#import <AVFoundation/AVFoundation.h>
|
||||||
|
|
||||||
@@ -22,5 +21,3 @@
|
|||||||
- (int)setupMicrophone:(AVCaptureDevice *)device sampleRate:(UInt32)sampleRate frameSize:(UInt32)frameSize channels:(UInt8)channels;
|
- (int)setupMicrophone:(AVCaptureDevice *)device sampleRate:(UInt32)sampleRate frameSize:(UInt32)frameSize channels:(UInt8)channels;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif //SUNSHINE_PLATFORM_AV_AUDIO_H
|
|
||||||
|
|||||||
@@ -126,7 +126,7 @@
|
|||||||
|
|
||||||
CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer(sampleBuffer, NULL, &audioBufferList, sizeof(audioBufferList), NULL, NULL, 0, &blockBuffer);
|
CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer(sampleBuffer, NULL, &audioBufferList, sizeof(audioBufferList), NULL, NULL, 0, &blockBuffer);
|
||||||
|
|
||||||
//NSAssert(audioBufferList.mNumberBuffers == 1, @"Expected interlveaved PCM format but buffer contained %u streams", audioBufferList.mNumberBuffers);
|
// NSAssert(audioBufferList.mNumberBuffers == 1, @"Expected interlveaved PCM format but buffer contained %u streams", audioBufferList.mNumberBuffers);
|
||||||
|
|
||||||
// this is safe, because an interleaved PCM stream has exactly one buffer
|
// this is safe, because an interleaved PCM stream has exactly one buffer
|
||||||
// and we don't want to do sanity checks in a performance critical exec path
|
// and we don't want to do sanity checks in a performance critical exec path
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef av_img_t_h
|
#pragma once
|
||||||
#define av_img_t_h
|
|
||||||
|
|
||||||
#include "src/platform/common.h"
|
#include "src/platform/common.h"
|
||||||
|
|
||||||
@@ -14,5 +13,3 @@ namespace platf {
|
|||||||
~av_img_t();
|
~av_img_t();
|
||||||
};
|
};
|
||||||
} // namespace platf
|
} // namespace platf
|
||||||
|
|
||||||
#endif /* av_img_t_h */
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef SUNSHINE_PLATFORM_AV_VIDEO_H
|
#pragma once
|
||||||
#define SUNSHINE_PLATFORM_AV_VIDEO_H
|
|
||||||
|
|
||||||
#import <AVFoundation/AVFoundation.h>
|
#import <AVFoundation/AVFoundation.h>
|
||||||
|
|
||||||
@@ -38,5 +37,3 @@ typedef bool (^FrameCallbackBlock)(CMSampleBufferRef);
|
|||||||
- (dispatch_semaphore_t)capture:(FrameCallbackBlock)frameCallback;
|
- (dispatch_semaphore_t)capture:(FrameCallbackBlock)frameCallback;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif //SUNSHINE_PLATFORM_AV_VIDEO_H
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef SUNSHINE_PLATFORM_MISC_H
|
#pragma once
|
||||||
#define SUNSHINE_PLATFORM_MISC_H
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@@ -14,5 +13,3 @@ namespace dyn {
|
|||||||
handle(const std::vector<const char *> &libs);
|
handle(const std::vector<const char *> &libs);
|
||||||
|
|
||||||
} // namespace dyn
|
} // namespace dyn
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef vtdevice_h
|
#pragma once
|
||||||
#define vtdevice_h
|
|
||||||
|
|
||||||
#include "src/platform/common.h"
|
#include "src/platform/common.h"
|
||||||
|
|
||||||
@@ -29,5 +28,3 @@ namespace platf {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace platf
|
} // namespace platf
|
||||||
|
|
||||||
#endif /* vtdevice_h */
|
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ using namespace std::literals;
|
|||||||
|
|
||||||
namespace avahi {
|
namespace avahi {
|
||||||
|
|
||||||
/** Error codes used by avahi */
|
/**
|
||||||
|
* @brief Error codes used by avahi
|
||||||
|
*/
|
||||||
enum err_e {
|
enum err_e {
|
||||||
OK = 0, /**< OK */
|
OK = 0, /**< OK */
|
||||||
ERR_FAILURE = -1, /**< Generic error code */
|
ERR_FAILURE = -1, /**< Generic error code */
|
||||||
@@ -113,7 +115,9 @@ namespace avahi {
|
|||||||
CLIENT_NO_FAIL = 2 /**< Don't fail if the daemon is not available when avahi_client_new() is called, instead enter CLIENT_CONNECTING state and wait for the daemon to appear */
|
CLIENT_NO_FAIL = 2 /**< Don't fail if the daemon is not available when avahi_client_new() is called, instead enter CLIENT_CONNECTING state and wait for the daemon to appear */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Some flags for publishing functions */
|
/**
|
||||||
|
* @brief Some flags for publishing functions
|
||||||
|
*/
|
||||||
enum PublishFlags {
|
enum PublishFlags {
|
||||||
PUBLISH_UNIQUE = 1, /**< For raw records: The RRset is intended to be unique */
|
PUBLISH_UNIQUE = 1, /**< For raw records: The RRset is intended to be unique */
|
||||||
PUBLISH_NO_PROBE = 2, /**< For raw records: Though the RRset is intended to be unique no probes shall be sent */
|
PUBLISH_NO_PROBE = 2, /**< For raw records: Though the RRset is intended to be unique no probes shall be sent */
|
||||||
@@ -434,4 +438,4 @@ namespace platf::publish {
|
|||||||
|
|
||||||
return std::make_unique<deinit_t>(std::thread { avahi::simple_poll_loop, poll.get() });
|
return std::make_unique<deinit_t>(std::thread { avahi::simple_poll_loop, poll.get() });
|
||||||
}
|
}
|
||||||
}; // namespace platf::publish
|
} // namespace platf::publish
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
//
|
|
||||||
// Created by loki on 1/12/20.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include <audioclient.h>
|
#include <audioclient.h>
|
||||||
#include <mmdeviceapi.h>
|
#include <mmdeviceapi.h>
|
||||||
#include <roapi.h>
|
#include <roapi.h>
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
//
|
#pragma once
|
||||||
// Created by loki on 4/23/20.
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef SUNSHINE_DISPLAY_H
|
|
||||||
#define SUNSHINE_DISPLAY_H
|
|
||||||
|
|
||||||
#include <d3d11.h>
|
#include <d3d11.h>
|
||||||
#include <d3d11_4.h>
|
#include <d3d11_4.h>
|
||||||
@@ -237,5 +232,3 @@ namespace platf::dxgi {
|
|||||||
std::atomic<uint32_t> next_image_id;
|
std::atomic<uint32_t> next_image_id;
|
||||||
};
|
};
|
||||||
} // namespace platf::dxgi
|
} // namespace platf::dxgi
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
//
|
|
||||||
// Created by loki on 1/12/20.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <codecvt>
|
#include <codecvt>
|
||||||
#include <initguid.h>
|
#include <initguid.h>
|
||||||
@@ -537,7 +533,7 @@ namespace platf::dxgi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME: Duplicate output on RX580 in combination with DOOM (2016) --> BSOD
|
// FIXME: Duplicate output on RX580 in combination with DOOM (2016) --> BSOD
|
||||||
{
|
{
|
||||||
// IDXGIOutput5 is optional, but can provide improved performance and wide color support
|
// IDXGIOutput5 is optional, but can provide improved performance and wide color support
|
||||||
dxgi::output5_t output5 {};
|
dxgi::output5_t output5 {};
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ namespace platf::dxgi {
|
|||||||
auto colors_out = (std::uint8_t *) &cursor_pixel;
|
auto colors_out = (std::uint8_t *) &cursor_pixel;
|
||||||
auto colors_in = (std::uint8_t *) img_pixel_p;
|
auto colors_in = (std::uint8_t *) img_pixel_p;
|
||||||
|
|
||||||
//TODO: When use of IDXGIOutput5 is implemented, support different color formats
|
// TODO: When use of IDXGIOutput5 is implemented, support different color formats
|
||||||
auto alpha = colors_out[3];
|
auto alpha = colors_out[3];
|
||||||
if (alpha == 255) {
|
if (alpha == 255) {
|
||||||
*img_pixel_p = cursor_pixel;
|
*img_pixel_p = cursor_pixel;
|
||||||
@@ -97,7 +97,7 @@ namespace platf::dxgi {
|
|||||||
|
|
||||||
void
|
void
|
||||||
apply_color_masked(int *img_pixel_p, int cursor_pixel) {
|
apply_color_masked(int *img_pixel_p, int cursor_pixel) {
|
||||||
//TODO: When use of IDXGIOutput5 is implemented, support different color formats
|
// TODO: When use of IDXGIOutput5 is implemented, support different color formats
|
||||||
auto alpha = ((std::uint8_t *) &cursor_pixel)[3];
|
auto alpha = ((std::uint8_t *) &cursor_pixel)[3];
|
||||||
if (alpha == 0xFF) {
|
if (alpha == 0xFF) {
|
||||||
*img_pixel_p ^= cursor_pixel;
|
*img_pixel_p ^= cursor_pixel;
|
||||||
@@ -270,7 +270,7 @@ namespace platf::dxgi {
|
|||||||
return capture_e::reinit;
|
return capture_e::reinit;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Copy from GPU to CPU
|
// Copy from GPU to CPU
|
||||||
device_ctx->CopyResource(texture.get(), src.get());
|
device_ctx->CopyResource(texture.get(), src.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -533,7 +533,7 @@ namespace platf::dxgi {
|
|||||||
frame_texture->AddRef();
|
frame_texture->AddRef();
|
||||||
hwframe_texture.reset(frame_texture);
|
hwframe_texture.reset(frame_texture);
|
||||||
|
|
||||||
float info_in[16 / sizeof(float)] { 1.0f / (float) out_width_f }; //aligned to 16-byte
|
float info_in[16 / sizeof(float)] { 1.0f / (float) out_width_f }; // aligned to 16-byte
|
||||||
info_scene = make_buffer(device.get(), info_in);
|
info_scene = make_buffer(device.get(), info_in);
|
||||||
|
|
||||||
if (!info_scene) {
|
if (!info_scene) {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef SUNSHINE_WINDOWS_MISC_H
|
#pragma once
|
||||||
#define SUNSHINE_WINDOWS_MISC_H
|
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
@@ -18,5 +17,3 @@ namespace platf {
|
|||||||
std::chrono::nanoseconds
|
std::chrono::nanoseconds
|
||||||
qpc_time_difference(int64_t performance_counter1, int64_t performance_counter2);
|
qpc_time_difference(int64_t performance_counter1, int64_t performance_counter2);
|
||||||
} // namespace platf
|
} // namespace platf
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
// Created by loki on 12/14/19.
|
|
||||||
|
|
||||||
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
||||||
|
|
||||||
#include "process.h"
|
#include "process.h"
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
// Created by loki on 12/14/19.
|
#pragma once
|
||||||
|
|
||||||
#ifndef SUNSHINE_PROCESS_H
|
|
||||||
#define SUNSHINE_PROCESS_H
|
|
||||||
|
|
||||||
#ifndef __kernel_entry
|
#ifndef __kernel_entry
|
||||||
#define __kernel_entry
|
#define __kernel_entry
|
||||||
@@ -19,7 +16,7 @@ namespace proc {
|
|||||||
using file_t = util::safe_ptr_v2<FILE, int, fclose>;
|
using file_t = util::safe_ptr_v2<FILE, int, fclose>;
|
||||||
|
|
||||||
typedef config::prep_cmd_t cmd_t;
|
typedef config::prep_cmd_t cmd_t;
|
||||||
/*
|
/**
|
||||||
* pre_cmds -- guaranteed to be executed unless any of the commands fail.
|
* pre_cmds -- guaranteed to be executed unless any of the commands fail.
|
||||||
* detached -- commands detached from Sunshine
|
* detached -- commands detached from Sunshine
|
||||||
* cmd -- Runs indefinitely until:
|
* cmd -- Runs indefinitely until:
|
||||||
@@ -104,7 +101,7 @@ namespace proc {
|
|||||||
/**
|
/**
|
||||||
* Calculate a stable id based on name and image data
|
* Calculate a stable id based on name and image data
|
||||||
* @return tuple of id calculated without index (for use if no collision) and one with
|
* @return tuple of id calculated without index (for use if no collision) and one with
|
||||||
*/
|
*/
|
||||||
std::tuple<std::string, std::string>
|
std::tuple<std::string, std::string>
|
||||||
calculate_app_id(const std::string &app_name, std::string app_image_path, int index);
|
calculate_app_id(const std::string &app_name, std::string app_image_path, int index);
|
||||||
|
|
||||||
@@ -117,4 +114,3 @@ namespace proc {
|
|||||||
|
|
||||||
extern proc_t proc;
|
extern proc_t proc;
|
||||||
} // namespace proc
|
} // namespace proc
|
||||||
#endif // SUNSHINE_PROCESS_H
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef KITTY_UTIL_ITERATOR_H
|
#pragma once
|
||||||
#define KITTY_UTIL_ITERATOR_H
|
|
||||||
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
||||||
@@ -180,5 +179,3 @@ namespace round_robin_util {
|
|||||||
return round_robin_t<V, It>(begin, end);
|
return round_robin_t<V, It>(begin, end);
|
||||||
}
|
}
|
||||||
} // namespace round_robin_util
|
} // namespace round_robin_util
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// Created by loki on 2/2/20.
|
|
||||||
|
|
||||||
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
// Created by loki on 2/2/20.
|
#pragma once
|
||||||
|
|
||||||
#ifndef SUNSHINE_RTSP_H
|
|
||||||
#define SUNSHINE_RTSP_H
|
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
||||||
@@ -27,5 +24,3 @@ namespace rtsp_stream {
|
|||||||
rtpThread();
|
rtpThread();
|
||||||
|
|
||||||
} // namespace rtsp_stream
|
} // namespace rtsp_stream
|
||||||
|
|
||||||
#endif // SUNSHINE_RTSP_H
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// Created by loki on 6/5/19.
|
|
||||||
|
|
||||||
#include "process.h"
|
#include "process.h"
|
||||||
|
|
||||||
#include <future>
|
#include <future>
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
// Created by loki on 6/5/19.
|
#pragma once
|
||||||
|
|
||||||
#ifndef SUNSHINE_STREAM_H
|
|
||||||
#define SUNSHINE_STREAM_H
|
|
||||||
|
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
|
|
||||||
@@ -49,5 +46,3 @@ namespace stream {
|
|||||||
state(session_t &session);
|
state(session_t &session);
|
||||||
} // namespace session
|
} // namespace session
|
||||||
} // namespace stream
|
} // namespace stream
|
||||||
|
|
||||||
#endif // SUNSHINE_STREAM_H
|
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
// Created by loki on 16-4-19.
|
#pragma once
|
||||||
|
|
||||||
#ifndef SUNSHINE_SYNC_H
|
|
||||||
#define SUNSHINE_SYNC_H
|
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
@@ -98,5 +95,3 @@ namespace sync_util {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sync_util
|
} // namespace sync_util
|
||||||
|
|
||||||
#endif // SUNSHINE_SYNC_H
|
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
* @file system_tray.h
|
* @file system_tray.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SUNSHINE_SYSTEM_TRAY_H
|
#pragma once
|
||||||
#define SUNSHINE_SYSTEM_TRAY_H
|
|
||||||
|
|
||||||
// system_tray namespace
|
// system_tray namespace
|
||||||
namespace system_tray {
|
namespace system_tray {
|
||||||
@@ -31,4 +30,3 @@ namespace system_tray {
|
|||||||
end_tray();
|
end_tray();
|
||||||
|
|
||||||
} // namespace system_tray
|
} // namespace system_tray
|
||||||
#endif // SUNSHINE_SYSTEM_TRAY_H
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef KITTY_TASK_POOL_H
|
#pragma once
|
||||||
#define KITTY_TASK_POOL_H
|
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
@@ -111,7 +110,7 @@ namespace task_pool_util {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return an id to potentially delay the task
|
* @return an id to potentially delay the task.
|
||||||
*/
|
*/
|
||||||
template <class Function, class X, class Y, class... Args>
|
template <class Function, class X, class Y, class... Args>
|
||||||
auto
|
auto
|
||||||
@@ -146,7 +145,8 @@ namespace task_pool_util {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param duration The delay before executing the task
|
* @param task_id The id of the task to delay.
|
||||||
|
* @param duration The delay before executing the task.
|
||||||
*/
|
*/
|
||||||
template <class X, class Y>
|
template <class X, class Y>
|
||||||
void
|
void
|
||||||
@@ -257,4 +257,3 @@ namespace task_pool_util {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace task_pool_util
|
} // namespace task_pool_util
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
#ifndef KITTY_THREAD_POOL_H
|
#pragma once
|
||||||
#define KITTY_THREAD_POOL_H
|
|
||||||
|
|
||||||
#include "task_pool.h"
|
#include "task_pool.h"
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
namespace thread_pool_util {
|
namespace thread_pool_util {
|
||||||
/*
|
/**
|
||||||
* Allow threads to execute unhindered
|
* Allow threads to execute unhindered while keeping full control over the threads.
|
||||||
* while keeping full control over the threads.
|
|
||||||
*/
|
*/
|
||||||
class ThreadPool: public task_pool_util::TaskPool {
|
class ThreadPool: public task_pool_util::TaskPool {
|
||||||
public:
|
public:
|
||||||
@@ -127,4 +125,3 @@ namespace thread_pool_util {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace thread_pool_util
|
} // namespace thread_pool_util
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
// Created by loki on 6/10/19.
|
#pragma once
|
||||||
|
|
||||||
#ifndef SUNSHINE_THREAD_SAFE_H
|
|
||||||
#define SUNSHINE_THREAD_SAFE_H
|
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
@@ -574,5 +571,3 @@ namespace safe {
|
|||||||
mail->cleanup();
|
mail->cleanup();
|
||||||
}
|
}
|
||||||
} // namespace safe
|
} // namespace safe
|
||||||
|
|
||||||
#endif // SUNSHINE_THREAD_SAFE_H
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef SUNSHINE_UPNP_H
|
#pragma once
|
||||||
#define SUNSHINE_UPNP_H
|
|
||||||
|
|
||||||
#include "platform/common.h"
|
#include "platform/common.h"
|
||||||
|
|
||||||
@@ -7,5 +6,3 @@ namespace upnp {
|
|||||||
[[nodiscard]] std::unique_ptr<platf::deinit_t>
|
[[nodiscard]] std::unique_ptr<platf::deinit_t>
|
||||||
start();
|
start();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef UTILITY_H
|
#pragma once
|
||||||
#define UTILITY_H
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
@@ -1030,4 +1029,3 @@ namespace util {
|
|||||||
big(T x) { return endian_helper<T>::big(x); }
|
big(T x) { return endian_helper<T>::big(x); }
|
||||||
} // namespace endian
|
} // namespace endian
|
||||||
} // namespace util
|
} // namespace util
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
// Created by loki on 8-2-19.
|
#pragma once
|
||||||
|
|
||||||
#ifndef T_MAN_UUID_H
|
|
||||||
#define T_MAN_UUID_H
|
|
||||||
|
|
||||||
#include <random>
|
#include <random>
|
||||||
|
|
||||||
@@ -80,4 +77,3 @@ namespace uuid_util {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace uuid_util
|
} // namespace uuid_util
|
||||||
#endif // T_MAN_UUID_H
|
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
#ifndef INCLUDE_GUARD
|
#pragma once
|
||||||
#define INCLUDE_GUARD
|
|
||||||
|
|
||||||
#define PROJECT_NAME "@PROJECT_NAME@"
|
#define PROJECT_NAME "@PROJECT_NAME@"
|
||||||
#define PROJECT_VER "@PROJECT_VERSION@"
|
#define PROJECT_VER "@PROJECT_VERSION@"
|
||||||
#define PROJECT_VER_MAJOR "@PROJECT_VERSION_MAJOR@"
|
#define PROJECT_VER_MAJOR "@PROJECT_VERSION_MAJOR@"
|
||||||
#define PROJECT_VER_MINOR "@PROJECT_VERSION_MINOR@"
|
#define PROJECT_VER_MINOR "@PROJECT_VERSION_MINOR@"
|
||||||
#define PROJECT_VER_PATCH "@PROJECT_VERSION_PATCH@"
|
#define PROJECT_VER_PATCH "@PROJECT_VERSION_PATCH@"
|
||||||
|
|
||||||
#endif // INCLUDE_GUARD
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// Created by loki on 6/6/19.
|
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -1001,7 +999,7 @@ namespace video {
|
|||||||
auto &sps = session.sps;
|
auto &sps = session.sps;
|
||||||
auto &vps = session.vps;
|
auto &vps = session.vps;
|
||||||
|
|
||||||
/* send the frame to the encoder */
|
// send the frame to the encoder
|
||||||
auto ret = avcodec_send_frame(ctx.get(), frame);
|
auto ret = avcodec_send_frame(ctx.get(), frame);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
char err_str[AV_ERROR_MAX_STRING_SIZE] { 0 };
|
char err_str[AV_ERROR_MAX_STRING_SIZE] { 0 };
|
||||||
@@ -1962,12 +1960,12 @@ namespace video {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
This is called once at startup and each time a stream is launched to
|
* This is called once at startup and each time a stream is launched to
|
||||||
ensure the best encoder is selected. Encoder availablility can change
|
* ensure the best encoder is selected. Encoder availablility can change
|
||||||
at runtime due to all sorts of things from driver updates to eGPUs.
|
* at runtime due to all sorts of things from driver updates to eGPUs.
|
||||||
|
*
|
||||||
This is only safe to call when there is no client actively streaming.
|
* This is only safe to call when there is no client actively streaming.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
probe_encoders() {
|
probe_encoders() {
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
// Created by loki on 6/9/19.
|
#pragma once
|
||||||
|
|
||||||
#ifndef SUNSHINE_VIDEO_H
|
|
||||||
#define SUNSHINE_VIDEO_H
|
|
||||||
|
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "platform/common.h"
|
#include "platform/common.h"
|
||||||
@@ -103,5 +100,3 @@ namespace video {
|
|||||||
int
|
int
|
||||||
probe_encoders();
|
probe_encoders();
|
||||||
} // namespace video
|
} // namespace video
|
||||||
|
|
||||||
#endif // SUNSHINE_VIDEO_H
|
|
||||||
|
|||||||
Reference in New Issue
Block a user