diff --git a/CMakeLists.txt b/CMakeLists.txt index 04171a47..f1b74111 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,18 +5,18 @@ cmake_minimum_required(VERSION 3.20) # todo - set this conditionally project(Apollo VERSION 0.0.0 - DESCRIPTION "Self-hosted game stream host for Moonlight" - HOMEPAGE_URL "https://app.lizardbyte.dev/Sunshine") + DESCRIPTION "Self-hosted game stream host for Artemis" + HOMEPAGE_URL "https://github.com/ClassicOldSong/Apollo") set(PROJECT_LICENSE "GPL-3.0-only") -set(PROJECT_FQDN "dev.lizardbyte.app.Sunshine") +set(PROJECT_FQDN "com.SudoMaker.dev.Apollo") -set(PROJECT_BRIEF_DESCRIPTION "GameStream host for Moonlight") # must be <= 35 characters +set(PROJECT_BRIEF_DESCRIPTION "GameStream host for Artemis") # must be <= 35 characters set(PROJECT_LONG_DESCRIPTION "Offering low latency, cloud gaming server capabilities with support for AMD, Intel, \ and Nvidia GPUs for hardware encoding. Software encoding is also available. You can connect to Apollo from any \ -Moonlight client on a variety of devices. A web UI is provided to allow configuration, and client pairing, from \ +Artemis client on a variety of devices. A web UI is provided to allow configuration, and client pairing, from \ your favorite web browser. Pair from the local server or any mobile device.") if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) diff --git a/cmake/compile_definitions/windows.cmake b/cmake/compile_definitions/windows.cmake index 5bd34f1b..7fe81436 100644 --- a/cmake/compile_definitions/windows.cmake +++ b/cmake/compile_definitions/windows.cmake @@ -34,8 +34,8 @@ file(GLOB NVPREFS_FILES CONFIGURE_DEPENDS include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/include") # apollo icon -if(NOT DEFINED SUNSHINE_ICON_PATH) - set(SUNSHINE_ICON_PATH "${CMAKE_SOURCE_DIR}/apollo.ico") +if(NOT DEFINED PROJECT_ICON_PATH) + set(PROJECT_ICON_PATH "${CMAKE_SOURCE_DIR}/apollo.ico") endif() # Create a separate object library for the RC file with minimal includes @@ -44,7 +44,7 @@ add_library(sunshine_rc_object OBJECT "${CMAKE_SOURCE_DIR}/src/platform/windows/ # Set minimal properties for RC compilation - only what's needed for the resource file # Otherwise compilation can fail due to "line too long" errors set_target_properties(sunshine_rc_object PROPERTIES - COMPILE_DEFINITIONS "PROJECT_ICON_PATH=${SUNSHINE_ICON_PATH};PROJECT_NAME=${PROJECT_NAME};PROJECT_VENDOR=${SUNSHINE_PUBLISHER_NAME};PROJECT_VERSION=${PROJECT_VERSION};PROJECT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR};PROJECT_VERSION_MINOR=${PROJECT_VERSION_MINOR};PROJECT_VERSION_PATCH=${PROJECT_VERSION_PATCH}" # cmake-lint: disable=C0301 + COMPILE_DEFINITIONS "PROJECT_ICON_PATH=${PROJECT_ICON_PATH};PROJECT_NAME=${PROJECT_NAME};PROJECT_VENDOR=${SUNSHINE_PUBLISHER_NAME};PROJECT_VERSION=${PROJECT_VERSION};PROJECT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR};PROJECT_VERSION_MINOR=${PROJECT_VERSION_MINOR};PROJECT_VERSION_PATCH=${PROJECT_VERSION_PATCH}" # cmake-lint: disable=C0301 INCLUDE_DIRECTORIES "" ) diff --git a/src/confighttp.cpp b/src/confighttp.cpp index 56719aa5..e270dd76 100644 --- a/src/confighttp.cpp +++ b/src/confighttp.cpp @@ -624,7 +624,7 @@ namespace confighttp { * @api_examples{/api/apps| POST| {"name":"Hello, World!","uuid": "aaaa-bbbb"}} */ void saveApp(resp_https_t response, req_https_t request) { - if (!authenticate(response, request) || !validateContentType(response, request, "application/json"sv)) { + if (!validateContentType(response, request, "application/json") || !authenticate(response, request)) { return; } @@ -670,10 +670,7 @@ namespace confighttp { * @api_examples{/api/apps/close| POST| null} */ void closeApp(resp_https_t response, req_https_t request) { - if (!check_content_type(response, request, "application/json")) { - return; - } - if (!authenticate(response, request)) { + if (!validateContentType(response, request, "application/json") || !authenticate(response, request)) { return; } @@ -693,7 +690,7 @@ namespace confighttp { * @api_examples{/api/apps/reorder| POST| {"order": ["aaaa-bbbb", "cccc-dddd"]}} */ void reorderApps(resp_https_t response, req_https_t request) { - if (!authenticate(response, request) || !validateContentType(response, request, "application/json"sv)) { + if (!validateContentType(response, request, "application/json") || !authenticate(response, request)) { return; } @@ -807,7 +804,7 @@ namespace confighttp { * @api_examples{/api/apps/delete | POST| { uuid: 'aaaa-bbbb' }} */ void deleteApp(resp_https_t response, req_https_t request) { - if (!authenticate(response, request) || !validateContentType(response, request, "application/json"sv)) { + if (!validateContentType(response, request, "application/json") || !authenticate(response, request)) { return; } @@ -897,7 +894,7 @@ namespace confighttp { * @endcode */ void updateClient(resp_https_t response, req_https_t request) { - if (!authenticate(response, request) || !validateContentType(response, request, "application/json"sv)) { + if (!validateContentType(response, request, "application/json") || !authenticate(response, request)) { return; } @@ -950,7 +947,7 @@ namespace confighttp { * @api_examples{/api/clients/unpair| POST| {"uuid":"1234"}} */ void unpair(resp_https_t response, req_https_t request) { - if (!authenticate(response, request) || !validateContentType(response, request, "application/json"sv)) { + if (!validateContentType(response, request, "application/json") || !authenticate(response, request)) { return; } @@ -978,7 +975,7 @@ namespace confighttp { * @api_examples{/api/clients/unpair-all| POST| null} */ void unpairAll(resp_https_t response, req_https_t request) { - if (!validateContentType(response, request, "application/json"sv) || !authenticate(response, request)) { + if (!validateContentType(response, request, "application/json") || !authenticate(response, request)) { return; } @@ -1049,7 +1046,7 @@ namespace confighttp { * @api_examples{/api/config| POST| {"key":"value"}} */ void saveConfig(resp_https_t response, req_https_t request) { - if (!authenticate(response, request) || !validateContentType(response, request, "application/json"sv)) { + if (!validateContentType(response, request, "application/json") || !authenticate(response, request)) { return; } @@ -1088,7 +1085,7 @@ namespace confighttp { * @api_examples{/api/covers/upload| POST| {"key":"igdb_1234","url":"https://images.igdb.com/igdb/image/upload/t_cover_big_2x/abc123.png"}} */ void uploadCover(resp_https_t response, req_https_t request) { - if (!authenticate(response, request) || !validateContentType(response, request, "application/json"sv)) { + if (!validateContentType(response, request, "application/json") || !authenticate(response, request)) { return; } @@ -1175,7 +1172,7 @@ namespace confighttp { * @api_examples{/api/password| POST| {"currentUsername":"admin","currentPassword":"admin","newUsername":"admin","newPassword":"admin","confirmNewPassword":"admin"}} */ void savePassword(resp_https_t response, req_https_t request) { - if ((!config::sunshine.username.empty() && !authenticate(response, request)) || !validateContentType(response, request, "application/json"sv)) + if ((!config::sunshine.username.empty() && !authenticate(response, request)) || !validateContentType(response, request, "application/json")) return; print_req(request); std::vector errors; @@ -1232,7 +1229,7 @@ namespace confighttp { * @api_examples{/api/otp| GET| null} */ void getOTP(resp_https_t response, req_https_t request) { - if (!authenticate(response, request) || !validateContentType(response, request, "application/json"sv)) { + if (!validateContentType(response, request, "application/json") || !authenticate(response, request)) { return; } @@ -1279,7 +1276,7 @@ namespace confighttp { * @api_examples{/api/pin| POST| {"pin":"1234","name":"My PC"}} */ void savePin(resp_https_t response, req_https_t request) { - if (!authenticate(response, request) || !validateContentType(response, request, "application/json"sv)) { + if (!validateContentType(response, request, "application/json") || !authenticate(response, request)) { return; } @@ -1308,7 +1305,7 @@ namespace confighttp { * @api_examples{/api/reset-display-device-persistence| POST| null} */ void resetDisplayDevicePersistence(resp_https_t response, req_https_t request) { - if (!validateContentType(response, request, "application/json"sv) || !authenticate(response, request)) { + if (!validateContentType(response, request, "application/json") || !authenticate(response, request)) { return; } @@ -1327,7 +1324,7 @@ namespace confighttp { * @api_examples{/api/restart| POST| null} */ void restart(resp_https_t response, req_https_t request) { - if (!validateContentType(response, request, "application/json"sv) || !authenticate(response, request)) { + if (!validateContentType(response, request, "application/json") || !authenticate(response, request)) { return; } @@ -1379,7 +1376,7 @@ namespace confighttp { * @param request The HTTP request object. */ void launchApp(resp_https_t response, req_https_t request) { - if (!authenticate(response, request) || !validateContentType(response, request, "application/json"sv)) { + if (!validateContentType(response, request, "application/json") || !authenticate(response, request)) { return; } @@ -1435,7 +1432,7 @@ namespace confighttp { * @param request The HTTP request object. */ void disconnect(resp_https_t response, req_https_t request) { - if (!authenticate(response, request) || !validateContentType(response, request, "application/json"sv)) { + if (!validateContentType(response, request, "application/json") || !authenticate(response, request)) { return; } @@ -1469,7 +1466,7 @@ namespace confighttp { * @endcode */ void login(resp_https_t response, req_https_t request) { - if (!checkIPOrigin(response, request) || !validateContentType(response, request, "application/json"sv)) { + if (!checkIPOrigin(response, request) || !validateContentType(response, request, "application/json")) { return; } diff --git a/src/main.cpp b/src/main.cpp index 911adb1f..8f71582d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,7 +21,6 @@ #include "system_tray.h" #include "upnp.h" #include "uuid.h" -#include "version.h" #include "video.h" #ifdef _WIN32 diff --git a/src/rtsp.cpp b/src/rtsp.cpp index 09d724a1..c81687de 100644 --- a/src/rtsp.cpp +++ b/src/rtsp.cpp @@ -600,6 +600,8 @@ namespace rtsp_stream { acceptor.close(); io_context.stop(); clear(); + } + std::shared_ptr find_session(const std::string_view& uuid) { auto lg = _session_slots.lock(); diff --git a/src/video.cpp b/src/video.cpp index c02c0b73..b287dfc9 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -1925,7 +1925,6 @@ namespace video { // set minimum frame time based on client-requested target framerate auto minimum_frame_time = std::chrono::milliseconds(1000 / config.framerate); auto frame_threshold = std::chrono::microseconds(1000ms * 1000 / config.encodingFramerate); - BOOST_LOG(debug) << "Minimum frame time set to "sv << minimum_frame_time.count() << "ms, based on min fps factor of "sv << config::video.min_fps_factor << "."sv; BOOST_LOG(info) << "Frame threshold: "sv << frame_threshold; auto shutdown_event = mail->event(mail::shutdown); diff --git a/third-party/build-deps b/third-party/build-deps index a9a7f863..cf5dffaf 160000 --- a/third-party/build-deps +++ b/third-party/build-deps @@ -1 +1 @@ -Subproject commit a9a7f86328963837e30e21c8901faba00fe81542 +Subproject commit cf5dffaf4c62a5e5e2949c37b642cfc5ad962b98