|
|
src/crypto.cpp
|
+10
−5
|
@@ -161,7 +161,8 @@
plaintext.resize(round_to_pkcs7_padded(cipher.size()));
int update_outlen, final_outlen; int final_outlen; int update_outlen;
if (EVP_DecryptUpdate(decrypt_ctx.get(), plaintext.data(), &update_outlen, (const std::uint8_t *) cipher.data(), (int) cipher.size()) != 1) { return -1; @@ -195,7 +196,8 @@ return -1; }
int update_outlen, final_outlen; int final_outlen; int update_outlen;
// Encrypt into the caller's buffer if (EVP_EncryptUpdate(encrypt_ctx.get(), ciphertext, &update_outlen, (const std::uint8_t *) plaintext.data(), (int) plaintext.size()) != 1) { @@ -232,7 +234,8 @@ EVP_CIPHER_CTX_set_padding(decrypt_ctx.get(), padding); plaintext.resize(round_to_pkcs7_padded(cipher.size()));
int final_outlen; int update_outlen; int update_outlen, final_outlen;
if (EVP_DecryptUpdate(decrypt_ctx.get(), plaintext.data(), &update_outlen, (const std::uint8_t *) cipher.data(), (int) cipher.size()) != 1) { return -1; @@ -259,7 +262,8 @@ EVP_CIPHER_CTX_set_padding(encrypt_ctx.get(), padding); cipher.resize(round_to_pkcs7_padded(plaintext.size()));
int update_outlen, final_outlen; int final_outlen; int update_outlen;
// Encrypt into the caller's buffer if (EVP_EncryptUpdate(encrypt_ctx.get(), cipher.data(), &update_outlen, (const std::uint8_t *) plaintext.data(), (int) plaintext.size()) != 1) { @@ -290,7 +294,8 @@ return false; }
int update_outlen, final_outlen; int final_outlen; int update_outlen;
// Encrypt into the caller's buffer if (EVP_EncryptUpdate(encrypt_ctx.get(), cipher, &update_outlen, (const std::uint8_t *) plaintext.data(), (int) plaintext.size()) != 1) {
|
|
|
src/input.cpp
|
+2
−1
|
@@ -1254,7 +1254,8 @@ * @return The status of the batching operation. */ batch_result_e batch(PNV_REL_MOUSE_MOVE_PACKET dest, PNV_REL_MOUSE_MOVE_PACKET src) { short deltaX, deltaY; short deltaX; short deltaY;
// Batching is safe as long as the result doesn't overflow a 16-bit integer if (!__builtin_add_overflow(util::endian::big(dest->deltaX), util::endian::big(src->deltaX), &deltaX)) {
|
|
|
src/input.h
|
+8
−4
|
@@ -25,14 +25,18 @@ std::shared_ptr<input_t> alloc(safe::mail_t mail);
struct touch_port_t: public platf::touch_port_t { int env_width, env_height; int env_height; int env_width;
// Offset x and y coordinates of the client float client_offsetX, client_offsetY; float client_offsetX; float client_offsetY;
float scalar_inv, scalar_tpcoords; float scalar_inv; float scalar_tpcoords;
int env_logical_width, env_logical_height; int env_logical_height; int env_logical_width;
explicit operator bool() const { return width != 0 && height != 0 && env_width != 0 && env_height != 0;
|
|
|
src/platform/common.h
|
+21
−8
|
@@ -268,9 +268,14 @@
// Dimensions for touchscreen input struct touch_port_t { int offset_x; int offset_y;
int height; int width;
int logical_height; int logical_width; int offset_x, offset_y; int width, height; int logical_width, logical_height; };
// These values must match Limelight-internal.h's SS_FF_* constants! @@ -534,12 +539,20 @@ virtual ~display_t() = default;
// Offsets for when streaming a specific monitor. By default, they are 0. int offset_x; int offset_y;
int env_height; int offset_x, offset_y; int env_width, env_height; int env_logical_width, env_logical_height; int env_width;
int width, height; int logical_width, logical_height; int env_logical_height; int env_logical_width;
int height; int width;
int logical_height; int logical_width;
protected: // collect capture timing data (at loglevel debug)
|
|
|
src/platform/linux/cuda.cpp
|
+6
−3
|
@@ -188,7 +188,8 @@ stream_t stream; frame_t hwframe;
int width, height; int height; int width;
// When height and width don't change, it's not necessary to use linear interpolation bool linear_interpolation; @@ -447,7 +448,8 @@ egl::nv12_t nv12; AVPixelFormat sw_format;
int height; int width; int width, height;
std::uint64_t sequence; egl::rgb_t rgb; @@ -455,7 +457,8 @@ registered_resource_t y_res; registered_resource_t uv_res;
int offset_x, offset_y; int offset_x; int offset_y; };
std::unique_ptr<platf::avcodec_encode_device_t> make_avcodec_encode_device(int width, int height, bool vram) {
|
|
|
src/platform/linux/cuda.h
|
+5
−2
|
@@ -69,8 +69,11 @@ stream_t make_stream(int flags = 0);
struct viewport_t { int width, height; int offsetX, offsetY; int height; int width;
int offsetX; int offsetY; };
class tex_t {
|
|
|
src/platform/linux/graphics.cpp
|
+2
−1
|
@@ -361,7 +361,8 @@ return nullptr; }
int major, minor; int major; int minor; if (!eglInitialize(display.get(), &major, &minor)) { BOOST_LOG(error) << "Couldn't initialize EGL display: ["sv << util::hex(eglGetError()).to_string_view() << ']'; return nullptr;
|
|
|
src/platform/linux/graphics.h
|
+10
−5
|
@@ -266,7 +266,9 @@
class cursor_t: public platf::img_t { public: int x, y; int src_w, src_h; int src_h; int src_w; int x; int y;
unsigned long serial; @@ -329,9 +331,12 @@ gl::program_t program[3]; gl::buffer_t color_matrix;
int out_height; int out_width; int out_width, out_height; int in_width, in_height; int offsetX, offsetY; int in_height; int in_width; int offsetX; int offsetY;
// Pointer to the texture to be converted to nv12 int loaded_texture;
|
|
|
src/platform/linux/kmsgrab.cpp
|
+16
−7
|
@@ -296,13 +296,19 @@ struct cursor_t { // Public properties used during blending bool visible = false; std::int32_t x, y; std::uint32_t dst_w, dst_h; std::uint32_t src_w, src_h; std::uint32_t dst_h; std::uint32_t dst_w; std::uint32_t src_h; std::uint32_t src_w; std::int32_t x; std::int32_t y; std::vector<std::uint8_t> pixels; unsigned long serial;
// Private properties used for tracking cursor changes std::uint64_t prop_src_x; std::uint64_t prop_src_y; std::uint64_t prop_src_h; std::uint64_t prop_src_x, prop_src_y, prop_src_w, prop_src_h; std::uint64_t prop_src_w; std::uint32_t fb_id; }; @@ -1133,8 +1139,10 @@
std::chrono::nanoseconds delay;
int img_height; int img_width; int img_offset_x; int img_offset_y; int img_width, img_height; int img_offset_x, img_offset_y;
int plane_id; int crtc_id; @@ -1317,7 +1325,8 @@ gl::ctx.BindTexture(GL_TEXTURE_2D, rgb->tex[0]);
// Don't remove these lines, see https://github.com/LizardByte/Sunshine/issues/453 int h; int w, h; int w; gl::ctx.GetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w); gl::ctx.GetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h); BOOST_LOG(debug) << "width and height: w "sv << w << " h "sv << h;
|
|
|
src/platform/linux/vaapi.cpp
|
+8
−4
|
@@ -398,7 +398,8 @@ egl::sws_t sws; egl::nv12_t nv12;
int width, height; int height; int width; };
class va_ram_t: public va_t { @@ -455,7 +456,8 @@ std::uint64_t sequence; egl::rgb_t rgb;
int offset_x, offset_y; int offset_x; int offset_y; };
/** @@ -531,7 +533,8 @@ vaSetErrorCallback(display.get(), __log, &error); vaSetErrorCallback(display.get(), __log, &info);
int major, minor; int major; int minor; auto status = vaInitialize(display.get(), &major, &minor); if (status) { BOOST_LOG(error) << "Couldn't initialize va display: "sv << vaErrorStr(status); @@ -595,7 +598,8 @@ return false; }
int major, minor; int major; int minor; auto status = vaInitialize(display.get(), &major, &minor); if (status) { BOOST_LOG(error) << "Couldn't initialize va display: "sv << vaErrorStr(status);
|
|
|
src/platform/linux/wlgrab.cpp
|
+2
−1
|
@@ -206,7 +206,8 @@ gl::ctx.BindTexture(GL_TEXTURE_2D, (*rgb_opt)->tex[0]);
// Don't remove these lines, see https://github.com/LizardByte/Sunshine/issues/453 int w, h; int h; int w; gl::ctx.GetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w); gl::ctx.GetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h); BOOST_LOG(debug) << "width and height: w "sv << w << " h "sv << h;
|
|
|
src/platform/windows/display.h
|
+4
−2
|
@@ -77,6 +77,7 @@ std::vector<std::uint8_t> img_data;
DXGI_OUTDUPL_POINTER_SHAPE_INFO shape_info; int x, y; int x; int y; bool visible; }; @@ -346,6 +347,7 @@ winrt::Windows::Graphics::Capture::GraphicsCaptureItem item {nullptr}; winrt::Windows::Graphics::Capture::Direct3D11CaptureFramePool frame_pool {nullptr}; winrt::Windows::Graphics::Capture::GraphicsCaptureSession capture_session {nullptr}; winrt::Windows::Graphics::Capture::Direct3D11CaptureFrame produced_frame {nullptr}, consumed_frame {nullptr}; winrt::Windows::Graphics::Capture::Direct3D11CaptureFrame consumed_frame {nullptr}; winrt::Windows::Graphics::Capture::Direct3D11CaptureFrame produced_frame {nullptr}; SRWLOCK frame_lock = SRWLOCK_INIT; CONDITION_VARIABLE frame_present_cv;
|
|
|
src/platform/windows/display_vram.cpp
|
+4
−2
|
@@ -950,7 +950,9 @@ ps_t convert_UV_ps; ps_t convert_UV_fp16_ps;
std::array<D3D11_VIEWPORT, 3> out_Y_or_YUV_viewports, out_Y_or_YUV_viewports_for_clear; D3D11_VIEWPORT out_UV_viewport, out_UV_viewport_for_clear; std::array<D3D11_VIEWPORT, 3> out_Y_or_YUV_viewports; std::array<D3D11_VIEWPORT, 3> out_Y_or_YUV_viewports_for_clear; D3D11_VIEWPORT out_UV_viewport; D3D11_VIEWPORT out_UV_viewport_for_clear;
DXGI_FORMAT format;
|
|
|
src/platform/windows/input.cpp
|
+3
−1
|
@@ -138,7 +138,9 @@ auto &report = gamepad.report.ds4.Report;
// Use int32 to process this data, so we can clamp if needed. int32_t intX, intY, intZ; int32_t intX; int32_t intY; int32_t intZ;
switch (motion_type) { case LI_MOTION_TYPE_ACCEL:
|
|
|
src/platform/windows/misc.cpp
|
+8
−6
|
@@ -74,18 +74,20 @@ std::atomic<bool> used_nt_set_timer_resolution = false;
bool nt_set_timer_resolution_max() { ULONG minimum, maximum, current; if (!NT_SUCCESS(NtQueryTimerResolution(&minimum, &maximum, ¤t)) || !NT_SUCCESS(NtSetTimerResolution(maximum, TRUE, ¤t))) { ULONG maximum; ULONG minimum; if (ULONG current; !NT_SUCCESS(NtQueryTimerResolution(&minimum, &maximum, ¤t)) || !NT_SUCCESS(NtSetTimerResolution(maximum, TRUE, ¤t))) { return false; } return true; }
bool nt_set_timer_resolution_min() { ULONG minimum, maximum, current; if (!NT_SUCCESS(NtQueryTimerResolution(&minimum, &maximum, ¤t)) || !NT_SUCCESS(NtSetTimerResolution(minimum, TRUE, ¤t))) { ULONG maximum; ULONG minimum; if (ULONG current; !NT_SUCCESS(NtQueryTimerResolution(&minimum, &maximum, ¤t)) || !NT_SUCCESS(NtSetTimerResolution(minimum, TRUE, ¤t))) { return false; } return true;
|
|
|
src/stream.cpp
|
+2
−3
|
@@ -1377,8 +1377,7 @@ }
std::array<std::string_view, MAX_FEC_BLOCKS> fec_blocks; decltype(fec_blocks)::iterator fec_blocks_begin = std::begin(fec_blocks), fec_blocks_end = std::begin(fec_blocks) + fec_blocks_needed; auto fec_blocks_begin = std::begin(fec_blocks); auto fec_blocks_end = std::begin(fec_blocks) + fec_blocks_needed;
BOOST_LOG(verbose) << "Generating "sv << fec_blocks_needed << " FEC blocks"sv;
|
|
|
src/upnp.cpp
|
+2
−1
|
@@ -118,7 +118,8 @@ }
if (data.IPv6FC.controlurl[0] != 0) { int firewallEnabled, pinholeAllowed; int firewallEnabled; int pinholeAllowed;
// Check if this firewall supports IPv6 pinholes err = UPNP_GetFirewallStatus(urls->controlURL_6FC, data.IPv6FC.servicetype, &firewallEnabled, &pinholeAllowed);
|
|
|
src/video.h
|
+15
−6
|
@@ -61,8 +61,10 @@ struct encoder_platform_formats_t { virtual ~encoder_platform_formats_t() = default; platf::mem_type_e dev_type; platf::pix_fmt_e pix_fmt_8bit, pix_fmt_10bit; platf::pix_fmt_e pix_fmt_yuv444_8bit, pix_fmt_yuv444_10bit; platf::pix_fmt_e pix_fmt_8bit; platf::pix_fmt_e pix_fmt_10bit; platf::pix_fmt_e pix_fmt_yuv444_8bit; platf::pix_fmt_e pix_fmt_yuv444_10bit; };
struct encoder_platform_formats_avcodec: encoder_platform_formats_t { @@ -93,10 +95,13 @@ pix_fmt_yuv444_10bit = map_pix_fmt(avcodec_pix_fmt_yuv444_10bit); }
AVHWDeviceType avcodec_base_dev_type, avcodec_derived_dev_type; AVHWDeviceType avcodec_base_dev_type; AVHWDeviceType avcodec_derived_dev_type; AVPixelFormat avcodec_dev_pix_fmt; AVPixelFormat avcodec_pix_fmt_8bit; AVPixelFormat avcodec_pix_fmt_10bit; AVPixelFormat avcodec_pix_fmt_8bit, avcodec_pix_fmt_10bit; AVPixelFormat avcodec_pix_fmt_yuv444_8bit; AVPixelFormat avcodec_pix_fmt_yuv444_10bit; AVPixelFormat avcodec_pix_fmt_yuv444_8bit, avcodec_pix_fmt_yuv444_10bit;
init_buffer_function_t init_avcodec_hardware_input_buffer; }; @@ -179,7 +184,11 @@ std::bitset<MAX_FLAGS>::reference operator[](flag_e flag) { return capabilities[(std::size_t) flag]; } } av1, hevc, h264; };
codec_t av1; codec_t hevc; codec_t h264;
const codec_t &codec_from_config(const config_t &config) const { switch (config.videoFormat) {
|
|
|
src/video_colorspace.cpp
|
+6
−3
|
@@ -123,7 +123,8 @@ const color_t *color_vectors_from_colorspace(const sunshine_colorspace_t &colorspace, bool unorm_output) { constexpr auto generate_color_vectors = [](const sunshine_colorspace_t &colorspace, bool unorm_output) -> color_t { // "Table 4 – Interpretation of matrix coefficients (MatrixCoefficients) value" section of ITU-T H.273 double Kr, Kb; double Kb; double Kr; switch (colorspace.colorspace) { case colorspace_e::rec601: Kr = 0.299; @@ -142,8 +143,10 @@ } double Kg = 1.0 - Kr - Kb;
double uv_add; double uv_mult; double y_mult, y_add; double uv_mult, uv_add; double y_add; double y_mult;
// "8.3 Matrix coefficients" section of ITU-T H.273 if (colorspace.full_range) {
|