Skip to content
Open
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
3 changes: 3 additions & 0 deletions cmake/compile_definitions/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ set(SUNSHINE_TARGET_FILES
"${CMAKE_SOURCE_DIR}/src/network.cpp"
"${CMAKE_SOURCE_DIR}/src/network.h"
"${CMAKE_SOURCE_DIR}/src/move_by_copy.h"
"${CMAKE_SOURCE_DIR}/src/platform/windows/vdd_control.h"
"${CMAKE_SOURCE_DIR}/src/platform/windows/vdd_control.cpp"
"${CMAKE_SOURCE_DIR}/src/system_tray.cpp"
"${CMAKE_SOURCE_DIR}/src/system_tray.h"
"${CMAKE_SOURCE_DIR}/src/task_pool.h"
Expand Down Expand Up @@ -139,6 +141,7 @@ include_directories(
BEFORE
SYSTEM
"${CMAKE_SOURCE_DIR}/third-party"
"${CMAKE_SOURCE_DIR}/third-party/parsec-vdd"
"${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/enet/include"
"${CMAKE_SOURCE_DIR}/third-party/nanors"
"${CMAKE_SOURCE_DIR}/third-party/nanors/deps/obl"
Expand Down
71 changes: 71 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1396,6 +1396,77 @@ editing the `conf` file in a text editor. Use the examples as reference.
</tr>
</table>

<div class="alert alert-info" role="alert">
<strong>Acknowledgement:</strong> The virtual display feature is powered by the
<a href="https://github.com/nomi-san/parsec-vdd" target="_blank">Parsec Virtual Display Driver</a>
created by <a href="https://github.com/nomi-san" target="_blank">nomi-san</a>.
</div>
Comment on lines +1399 to +1403
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<div class="alert alert-info" role="alert">
<strong>Acknowledgement:</strong> The virtual display feature is powered by the
<a href="https://github.com/nomi-san/parsec-vdd" target="_blank">Parsec Virtual Display Driver</a>
created by <a href="https://github.com/nomi-san" target="_blank">nomi-san</a>.
</div>

This doesn't match any existing patterns in the configuration.md file.


### vdd_enabled

<table>
<tr>
<td>Description</td>
<td colspan="2">Automatically create a virtual display when no physical display is detected.</td>
</tr>
<tr>
<td>Default</td>
<td colspan="2">@code{}disabled@endcode</td>
</tr>
</table>

### vdd_width

<table>
<tr>
<td>Description</td>
<td colspan="2">Width of the virtual display in pixels.</td>
</tr>
<tr>
<td>Default</td>
<td colspan="2">@code{}1920@endcode</td>
</tr>
</table>

### vdd_height

<table>
<tr>
<td>Description</td>
<td colspan="2">Height of the virtual display in pixels.</td>
</tr>
<tr>
<td>Default</td>
<td colspan="2">@code{}1080@endcode</td>
</tr>
</table>

### vdd_refresh_rate

<table>
<tr>
<td>Description</td>
<td colspan="2">Refresh rate of the virtual display in Hz.</td>
</tr>
<tr>
<td>Default</td>
<td colspan="2">@code{}144@endcode</td>
</tr>
</table>

### vdd_display_count

<table>
<tr>
<td>Description</td>
<td colspan="2">Number of virtual displays to restore on startup. This value is set automatically when adding or removing displays via the tray or web UI.</td>
</tr>
<tr>
<td>Default</td>
<td colspan="2">@code{}0@endcode</td>
</tr>
</table>

### max_bitrate

<table>
Expand Down
16 changes: 16 additions & 0 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,15 @@ namespace config {
{} // wa
}, // display_device

{
false, // virtual_display_enabled
1920, // virtual_display_width
1080, // virtual_display_height
144, // virtual_display_refresh_rate
0, // virtual_display_count
Comment on lines +529 to +532
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just set these based on what Moonlight requests?

{}, // virtual_display_configs
}, // vdd

0, // max_bitrate
0 // minimum_fps_target (0 = framerate)
};
Expand Down Expand Up @@ -1190,6 +1199,13 @@ namespace config {
}
bool_f(vars, "dd_config_revert_on_disconnect", video.dd.config_revert_on_disconnect);
generic_f(vars, "dd_mode_remapping", video.dd.mode_remapping, dd::mode_remapping_from_view);

bool_f(vars, "vdd_enabled", video.vdd.virtual_display_enabled);
int_f(vars, "vdd_width", video.vdd.virtual_display_width);
int_f(vars, "vdd_height", video.vdd.virtual_display_height);
int_f(vars, "vdd_refresh_rate", video.vdd.virtual_display_refresh_rate);
int_f(vars, "vdd_display_count", video.vdd.virtual_display_count);
string_f(vars, "vdd_display_configs", video.vdd.virtual_display_configs);
{
int value = 0;
int_between_f(vars, "dd_wa_hdr_toggle_delay", value, {0, 3000});
Expand Down
9 changes: 9 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ namespace config {
workarounds_t wa;
} dd;

struct {
bool virtual_display_enabled; ///< Enable virtual display creation when no display detected
int virtual_display_width; ///< Virtual display width
int virtual_display_height; ///< Virtual display height
int virtual_display_refresh_rate; ///< Virtual display refresh rate
int virtual_display_count; ///< Number of persisted virtual displays to restore on startup
std::string virtual_display_configs; ///< Persisted virtual display configurations (JSON array)
} vdd;

int max_bitrate; // Maximum bitrate, sets ceiling in kbps for bitrate requested from client
double minimum_fps_target; ///< Lowest framerate that will be used when streaming. Range 0-1000, 0 = half of client's requested framerate.
};
Expand Down
Loading