Skip to content

Commit 2e4e1bc

Browse files
committed
Merge remote-tracking branch 'frog/nightly' into nightly
2 parents be847cc + 7114784 commit 2e4e1bc

14 files changed

Lines changed: 48 additions & 26 deletions

File tree

.github/workflows/CI.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,6 @@ jobs:
729729
mingw-w64-x86_64-cmake
730730
mingw-w64-x86_64-curl
731731
mingw-w64-x86_64-miniupnpc
732-
mingw-w64-x86_64-nlohmann-json
733732
mingw-w64-x86_64-nodejs
734733
mingw-w64-x86_64-nsis
735734
mingw-w64-x86_64-onevpl

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,7 @@
4545
[submodule "src_assets/common/sunshine-control-panel"]
4646
path = src_assets/common/sunshine-control-panel
4747
url = https://github.com/qiin2333/sunshine-control-panel.git
48+
[submodule "third-party/nlohmann_json"]
49+
path = third-party/nlohmann_json
50+
url = https://github.com/nlohmann/json
4851
branch = master

cmake/compile_definitions/common.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,5 @@ list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
161161
${Boost_LIBRARIES}
162162
${OPENSSL_LIBRARIES}
163163
${CURL_LIBRARIES}
164+
${JSON_LIBRARIES}
164165
${PLATFORM_LIBRARIES})

cmake/compile_definitions/windows.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ list(PREPEND PLATFORM_LIBRARIES
9393
avrt
9494
iphlpapi
9595
shlwapi
96-
PkgConfig::NLOHMANN_JSON
9796
${CURL_STATIC_LIBRARIES})
9897

9998
if(SUNSHINE_ENABLE_TRAY)

cmake/dependencies/common.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ pkg_check_modules(CURL REQUIRED libcurl)
1919
pkg_check_modules(MINIUPNP miniupnpc REQUIRED)
2020
include_directories(SYSTEM ${MINIUPNP_INCLUDE_DIRS})
2121

22+
# nlohmann_json
23+
if(NOT SUNSHINE_SYSTEM_NLOHMANN_JSON)
24+
add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/nlohmann_json")
25+
set(JSON_LIBRARIES nlohmann_json::nlohmann_json)
26+
else()
27+
pkg_check_modules(NLOHMANN_JSON nlohmann_json>=3.9.0 REQUIRED IMPORTED_TARGET)
28+
set(JSON_LIBRARIES PkgConfig::NLOHMANN_JSON)
29+
endif()
30+
2231
# ffmpeg pre-compiled binaries
2332
if(WIN32)
2433
if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")

cmake/dependencies/windows.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@
22

33
set(Boost_USE_STATIC_LIBS ON) # cmake-lint: disable=C0103
44
find_package(Boost 1.71.0 COMPONENTS locale log filesystem program_options REQUIRED)
5-
6-
# nlohmann_json
7-
pkg_check_modules(NLOHMANN_JSON nlohmann_json REQUIRED IMPORTED_TARGET)

cmake/prep/options.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ option(SUNSHINE_CONFIGURE_ONLY "Configure special files only, then exit." OFF)
66
option(SUNSHINE_ENABLE_TRAY "Enable system tray icon. This option will be ignored on macOS." ON)
77
option(SUNSHINE_REQUIRE_TRAY "Require system tray icon. Fail the build if tray requirements are not met." ON)
88

9+
option(SUNSHINE_SYSTEM_NLOHMANN_JSON "Use system installation of nlohmann_json rather than the submodule." OFF)
910
option(SUNSHINE_SYSTEM_WAYLAND_PROTOCOLS "Use system installation of wayland-protocols rather than the submodule." OFF)
1011

1112
option(CUDA_INHERIT_COMPILE_OPTIONS

docs/source/building/windows.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Install dependencies:
2626
mingw-w64-x86_64-cmake \
2727
mingw-w64-x86_64-curl \
2828
mingw-w64-x86_64-miniupnpc \
29-
mingw-w64-x86_64-nlohmann-json \
3029
mingw-w64-x86_64-nodejs \
3130
mingw-w64-x86_64-onevpl \
3231
mingw-w64-x86_64-openssl \

src/display_device/display_device.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ namespace display_device {
101101

102102
/**
103103
* @brief A LIST[LIST[DEVICE_ID]] structure which represents an active topology.
104-
*
104+
*
105105
* Single display:
106106
* [[DISPLAY_1]]
107107
* 2 extended displays:
@@ -110,7 +110,7 @@ namespace display_device {
110110
* [[DISPLAY_1, DISPLAY_2]]
111111
* Mixed displays:
112112
* [[EXTENDED_DISPLAY_1], [DUPLICATED_DISPLAY_1, DUPLICATED_DISPLAY_2], [EXTENDED_DISPLAY_2]]
113-
*
113+
*
114114
* @note On Windows the order does not matter of both device ids or the inner lists.
115115
*/
116116
using active_topology_t = std::vector<std::vector<std::string>>;
@@ -119,7 +119,7 @@ namespace display_device {
119119
* @brief Enumerate the available (active and inactive) devices.
120120
* @returns A map of available devices.
121121
* Empty map can also be returned if an error has occurred.
122-
*
122+
*
123123
* EXAMPLES:
124124
* ```cpp
125125
* const auto devices { enum_available_devices() };
@@ -134,7 +134,7 @@ namespace display_device {
134134
* @returns A display name for the device, or an empty string if the device is inactive or not found.
135135
* Empty string can also be returned if an error has occurred.
136136
* @see device_info_t
137-
*
137+
*
138138
* EXAMPLES:
139139
* ```cpp
140140
* const std::string device_name { "MY_DEVICE_ID" };
@@ -149,7 +149,7 @@ namespace display_device {
149149
* @param device_ids A list of devices to get the modes for.
150150
* @returns A map of device modes per a device or an empty map if a mode could not be found (e.g. device is inactive).
151151
* Empty map can also be returned if an error has occurred.
152-
*
152+
*
153153
* EXAMPLES:
154154
* ```cpp
155155
* const std::unordered_set<std::string> device_ids { "DEVICE_ID_1", "DEVICE_ID_2" };
@@ -165,7 +165,7 @@ namespace display_device {
165165
* @returns True if modes were set, false otherwise.
166166
* @warning if any of the specified devices are duplicated, modes modes be provided
167167
* for duplicates too!
168-
*
168+
*
169169
* EXAMPLES:
170170
* ```cpp
171171
* const std::string display_a { "MY_ID_1" };
@@ -182,7 +182,7 @@ namespace display_device {
182182
* @param device_id A device to perform the check for.
183183
* @returns True if the device is primary, false otherwise.
184184
* @see device_state_e
185-
*
185+
*
186186
* EXAMPLES:
187187
* ```cpp
188188
* const std::string device_id { "MY_DEVICE_ID" };
@@ -197,7 +197,7 @@ namespace display_device {
197197
* @param device_id A device to set as primary.
198198
* @returns True if the device is or was set as primary, false otherwise.
199199
* @note On Windows if the device is duplicated, the other duplicated device(-s) will also become a primary device.
200-
*
200+
*
201201
* EXAMPLES:
202202
* ```cpp
203203
* const std::string device_id { "MY_DEVICE_ID" };
@@ -212,7 +212,7 @@ namespace display_device {
212212
* @param device_ids A list of devices to get the HDR states for.
213213
* @returns A map of HDR states per a device or an empty map if an error has occurred.
214214
* @note On Windows the state cannot be retrieved until the device is active even if it supports it.
215-
*
215+
*
216216
* EXAMPLES:
217217
* ```cpp
218218
* const std::unordered_set<std::string> device_ids { "DEVICE_ID_1", "DEVICE_ID_2" };
@@ -228,7 +228,7 @@ namespace display_device {
228228
* @returns True if HDR states were set, false otherwise.
229229
* @note If `unknown` states are provided, they will be silently ignored
230230
* and current state will not be changed.
231-
*
231+
*
232232
* EXAMPLES:
233233
* ```cpp
234234
* const std::string display_a { "MY_ID_1" };
@@ -244,7 +244,7 @@ namespace display_device {
244244
* @brief Get the active (current) topology.
245245
* @returns A list representing the current topology.
246246
* Empty list can also be returned if an error has occurred.
247-
*
247+
*
248248
* EXAMPLES:
249249
* ```cpp
250250
* const auto current_topology { get_current_topology() };
@@ -261,7 +261,7 @@ namespace display_device {
261261
*
262262
* @param topology Topology to validated.
263263
* @returns True if it is valid, false otherwise.
264-
*
264+
*
265265
* EXAMPLES:
266266
* ```cpp
267267
* auto current_topology { get_current_topology() };
@@ -277,7 +277,7 @@ namespace display_device {
277277
* @param topology_a First topology to compare.
278278
* @param topology_b Second topology to compare.
279279
* @returns True if topologies are close enough, false otherwise.
280-
*
280+
*
281281
* EXAMPLES:
282282
* ```cpp
283283
* auto current_topology { get_current_topology() };
@@ -293,7 +293,7 @@ namespace display_device {
293293
* @brief Set the a new active topology for the OS.
294294
* @param new_topology New device topology to set.
295295
* @returns True if the new topology has been set, false otherwise.
296-
*
296+
*
297297
* EXAMPLES:
298298
* ```cpp
299299
* auto current_topology { get_current_topology() };

src/display_device/session.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ namespace display_device {
6363

6464
/**
6565
* @brief Configure the display device based on the user configuration and the session information.
66-
*
66+
*
6767
* Upon failing to completely apply configuration, the applied settings will be reverted.
6868
* Or, in some cases, we will keep retrying even when the stream has already started as there
6969
* is no possibility to apply settings before the stream start.
70-
*
70+
*
7171
* @param config User's video related configuration.
7272
* @param session Session information.
7373
* @note There is no return value as we still want to continue with the stream, so that

0 commit comments

Comments
 (0)