Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ if(WIN32)
enable_language(RC)
set(CMAKE_RC_COMPILER windres)
file(
DOWNLOAD "https://github.com/TheElixZammuto/sunshine-prebuilt/releases/download/1.0.0/pre-compiled.zip" "${CMAKE_CURRENT_BINARY_DIR}/pre-compiled.zip"
DOWNLOAD "https://github.com/caioavidal/sunshine-prebuilt/releases/download/1.0.0/pre-compiled.zip" "${CMAKE_CURRENT_BINARY_DIR}/pre-compiled.zip"
TIMEOUT 60
EXPECTED_HASH SHA256=5d59986bd7f619eaaf82b2dd56b5127b747c9cbe8db61e3b898ff6b485298ed6)
EXPECTED_HASH SHA256=bf0cab8832272f7e077ee87a678bfd9edfeddb6cd613c0aab25a0d893ff08eda)

file(ARCHIVE_EXTRACT
INPUT "${CMAKE_CURRENT_BINARY_DIR}/pre-compiled.zip"
Expand Down Expand Up @@ -109,6 +109,7 @@ if(WIN32)
${SUNSHINE_PREPARED_BINARIES}/lib/libx264.a
${SUNSHINE_PREPARED_BINARIES}/lib/libx265.a
${SUNSHINE_PREPARED_BINARIES}/lib/libhdr10plus.a
${SUNSHINE_PREPARED_BINARIES}/lib/libmfx.a
z lzma bcrypt libiconv.a)

list(PREPEND PLATFORM_LIBRARIES
Expand Down Expand Up @@ -379,8 +380,6 @@ include_directories(
${PLATFORM_INCLUDE_DIRS}
)

add_subdirectory(third-party/cbs)

string(TOUPPER "x${CMAKE_BUILD_TYPE}" BUILD_TYPE)
if("${BUILD_TYPE}" STREQUAL "XDEBUG")
list(APPEND SUNSHINE_COMPILE_OPTIONS -O0 -ggdb3)
Expand All @@ -404,12 +403,8 @@ if(NOT SUNSHINE_DEFAULT_DIR)
set(SUNSHINE_DEFAULT_DIR "${SUNSHINE_ASSETS_DIR}")
endif()

list(APPEND CBS_EXTERNAL_LIBRARIES
cbs)

list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
libminiupnpc-static
${CBS_EXTERNAL_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
enet
opus
Expand Down
2 changes: 1 addition & 1 deletion assets/sunshine.conf
Original file line number Diff line number Diff line change
Expand Up @@ -315,4 +315,4 @@
# To set the initial state of flags -0 and -1 to on, set the following flags:
# flags = 012
#
# See: sunshine --help for all options under the header: flags
# See: sunshine --help for all options under the header: flags
72 changes: 59 additions & 13 deletions assets/web/config.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
<div id="app" class="container">
<h1 class="my-4">Configuration</h1>
<div class="form" v-if="config">
<!--Header-->
<ul class="nav nav-tabs">
<li class="nav-item" v-for="tab in tabs" :key="tab.id">
<a
class="nav-link"
:class="{'active': tab.id === currentTab}"
href="#"
@click="currentTab = tab.id"
>{{tab.name}}</a
<h1 class="my-4">Configuration</h1>
<div class="form" v-if="config">
<!--Header-->
<ul class="nav nav-tabs">
<li class="nav-item" v-for="tab in tabs" :key="tab.id">
<a class="nav-link" :class="{'active': tab.id === currentTab}" href="#" @click="currentTab = tab.id">{{tab.name}}</a
>
</li>
</ul>
Expand Down Expand Up @@ -397,7 +392,7 @@ <h1 class="my-4">Configuration</h1>
v-model="config.output_name"
/>
<div class="form-text">
You can select the video card you want to stream:<br />
You can select the display you want to stream:<br />
The appropriate values can be found using the following command:<br />
tools\dxgi-info.exe<br />
<br />
Expand Down Expand Up @@ -501,6 +496,7 @@ <h1 class="my-4">Configuration</h1>
<option value="nvenc">nVidia NVENC</option>
<option value="amdvce">AMD AMF/VCE</option>
<option value="vaapi">VA-API</option>
<option value="quicksync">Intel QuickSync</option>
<option value="software">Software</option>
</select>
<div class="form-text">
Expand Down Expand Up @@ -629,6 +625,50 @@ <h1 class="my-4">Configuration</h1>
</div>
</div>
</div>
<!-- Intel QuickSync Settings-->
<div v-if="currentTab === 'qsv'" class="config-page">
<div class="mb-3">
<label for="qsv_preset" class="form-label">QuickSync Presets</label>
<div class="form-text">
<label for="qsv_preset" class="form-label">QuickSync Preset</label>
<select id="qsv_preset" class="form-select" v-model="config.qsv_preset">
<option value="7">Very Fast</option>
<option value="6">Faster</option>
<option value="5">Fast</option>
<option value="4">Medium</option>
<option value="3">Slow</option>
<option value="2">Slower</option>
<option value="1">Very Slow</option>
</select>
</div>
</div>
<div class="mb-3">
<label for="qsv_cavlc" class="form-label">CAVLC</label>
<div class="form-text">
<label for="qsv_cavlc" class="form-label">Enable CAVLC</label>
<select id="qsv_cavlc" class="form-select" v-model="config.qsv_cavlc">
<option value="1">Enabled</option>
<option value="0">Disabled</option>

</select>
</div>
</div>
<div class="mb-3" class="config-page">
<label for="qsv_child_device" class="form-label">Child Device</label>
<input
type="text"
class="form-control"
id="qsv_child_device"
placeholder="0"
v-model="config.qsv_child_device"
/>
<div class="form-text">
You can select your intel device index:<br />
Usually 0 or 1<br />
<br />
</div>
</div>
</div>
<!--Nvidia Encoder Settings-->
<div v-if="currentTab === 'nv'" class="config-page">
<!--NVENC SETTINGS-->
Expand Down Expand Up @@ -787,6 +827,10 @@ <h1 class="my-4">Configuration</h1>
id: "sw",
name: "Software Encoder",
},
{
id: "qsv",
name: "QuickSync Encoder",
},
{
id: "nv",
name: "NVENC Encoder",
Expand Down Expand Up @@ -839,6 +883,8 @@ <h1 class="my-4">Configuration</h1>
this.config.origin_web_manager_allowed || "lan";
this.config.hevc_mode = this.config.hevc_mode || 0;
this.config.encoder = this.config.encoder || "";
this.config.qsv_preset = this.config.qsv_preset || "4";
this.config.qsv_cavlc = this.config.qsv_cavlc || "0";
this.config.nv_preset = this.config.nv_preset || "default";
this.config.nv_rc = this.config.nv_rc || "auto";
this.config.nv_coder = this.config.nv_coder || "auto";
Expand Down Expand Up @@ -902,4 +948,4 @@ <h1 class="my-4">Configuration</h1>
font-size: 12px;
font-weight: bold;
}
</style>
</style>
33 changes: 30 additions & 3 deletions sunshine/config.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#include <algorithm>
#include <charconv>
#include <filesystem>
#include <fstream>
#include <functional>
#include <iostream>
#include <string>
#include <unordered_map>

#include <boost/asio.hpp>
Expand Down Expand Up @@ -162,6 +164,26 @@ int coder_from_view(const std::string_view &coder) {
}
} // namespace amd

namespace qsv {
enum preset_e : int {
_default = 4,
veryslow = 1,
slower = 2,
slow = 3,
medium = 4,
fast = 5,
faster = 6,
veryfast = 7
};

enum cavlc_e : int {
_auto = false,
enabled = true,
disabled = false
};

} // namespace qsv

namespace vt {

enum coder_e : int {
Expand Down Expand Up @@ -208,14 +230,15 @@ video_t video {
"superfast"s, // preset
"zerolatency"s, // tune
}, // software

{
nv::llhq,
std::nullopt,
-1 }, // nv

{
amd::balanced,
qsv::medium,
qsv::disabled,
"" }, //qsv
{ amd::balanced,
std::nullopt,
std::nullopt,
-1 }, // amd
Expand Down Expand Up @@ -711,6 +734,10 @@ void apply_config(std::unordered_map<std::string, std::string> &&vars) {
int_f(vars, "nv_rc", video.nv.rc, nv::rc_from_view);
int_f(vars, "nv_coder", video.nv.coder, nv::coder_from_view);

int_f(vars, "qsv_preset", video.qsv.preset);
int_f(vars, "qsv_cavlc", video.qsv.cavlc);
string_f(vars, "qsv_child_device", video.qsv.child_device);

int_f(vars, "amd_quality", video.amd.quality, amd::quality_from_view);

std::string rc;
Expand Down
6 changes: 6 additions & 0 deletions sunshine/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ struct video_t {
std::optional<int> rc;
int coder;
} nv;

struct {
std::optional<int> preset;
std::optional<int> cavlc;
std::string child_device;
} qsv;

struct {
std::optional<int> quality;
Expand Down
Loading