Compare commits

..

11 Commits

Author SHA1 Message Date
f705dc0ab7 Fixed some build issues with arch 2026-03-17 23:47:07 -04:00
Yukino Song
a40b179886 Merge pull request #1286 from LTe/config-parse-boolean-to-string 2025-12-17 10:35:47 +08:00
Piotr Niełacny
7ec7566ad7 Fix state file corruption when saving user credentials
Replace Boost property_tree with nlohmann::json in save_user_creds().

Boost property_tree does not preserve JSON types - it converts all values
to strings when writing JSON. This caused boolean and integer fields in
sunshine_state.json to become strings (e.g., true -> "true", 119480064 ->
"119480064") after changing the password, leading to crashes on restart.

nlohmann::json preserves the original types, matching the rest of the
codebase which already uses it for JSON operations.

Fixes #835
2025-12-16 22:25:32 +01:00
Yukino Song
8d5341b255 Merge pull request #1227 from alex-berliner/patch-1 2025-11-13 01:23:53 +08:00
Alex Berliner
a8a9059cf4 Update Apollo installation command in README 2025-11-12 09:54:55 -05:00
Yukino Song
2d8544cf67 Fix typo in README 2025-10-28 19:11:02 +08:00
Yukino Song
09e848c396 Update README for more install methods
merges #1188
2025-10-27 23:55:07 +08:00
Yukino Song
08757dcd6c Merge pull request #1170 from happyme531/frame-timestamp-assert-fix 2025-10-16 18:23:11 +08:00
快乐的我531
6d0eaa8ede Correct frame timestamp initialization and update logic
Fix frame timestamp handling to ensure it is initialized properly and update encode_frame_timestamp correctly.
2025-10-16 16:03:32 +08:00
Yukino Song
bf47fca9e4 Merge pull request #1123 from darksidemilk/patch-1
Fix typo in README regarding client devices
2025-09-29 02:18:37 +08:00
JJ Fullmer
176678ad2d Fix typo in README regarding client devices 2025-09-28 12:14:36 -06:00
5 changed files with 66 additions and 11 deletions

View File

@@ -60,7 +60,7 @@ In short, ICC color correction should be totally useless while streaming HDR. It
It's very complicated to explain why HDR is a total mess, and why enabling HDR makes the image appear dark/yellow. If it's your first time got HDR streaming working, and thinks HDR looks awful, you're right, but that's not Apollo's fault, it's your device that tone mapped SDR content to the maximum of the capability of its screen, there's no headroom for anything beyond that actual peak brightness for HDR. For details, please take a look [here](https://github.com/ClassicOldSong/Apollo/issues/164). It's very complicated to explain why HDR is a total mess, and why enabling HDR makes the image appear dark/yellow. If it's your first time got HDR streaming working, and thinks HDR looks awful, you're right, but that's not Apollo's fault, it's your device that tone mapped SDR content to the maximum of the capability of its screen, there's no headroom for anything beyond that actual peak brightness for HDR. For details, please take a look [here](https://github.com/ClassicOldSong/Apollo/issues/164).
For client devies, usually Apple products that have HDR capability can be trusted to have good results, other than that, your luck depends. For client devices, usually Apple products that have HDR capability can be trusted to have good results, other than that, your luck depends.
<details> <details>
<summary>DEPRECATION ALERT</summary> <summary>DEPRECATION ALERT</summary>
@@ -155,8 +155,41 @@ No real time chat support will ever be provided for Apollo and Artemis. Includin
## Downloads ## Downloads
### Direct Download
**Recommended**
[Releases](https://github.com/ClassicOldSong/Apollo/releases) [Releases](https://github.com/ClassicOldSong/Apollo/releases)
### WinGet
**Note:** Community maintained
In an elevated PowerShell window, run
```pwsh
winget install ClassicOldSong.Apollo
```
You'll need WinGet installed first.
### Chocolatey
**Note:** Community maintained
You can also install the apollo streaming server with chocolatey.
Install Chocolatey if you don't have it, then run the following command in an elevated PowerShell/CMD window:
```pwsh
choco upgrade apollo -y
```
Same command can be used to upgrade, add to a scheduled task to automate updates.
See more details on the chocolatey package [here](https://community.chocolatey.org/packages/apollo)
## Disclaimer ## Disclaimer
I got kicked from Moonlight and Sunshine's Discord server and banned from Sunshine's GitHub repo literally for helping people out. I got kicked from Moonlight and Sunshine's Discord server and banned from Sunshine's GitHub repo literally for helping people out.

View File

@@ -9,9 +9,8 @@ set(BOOST_COMPONENTS
locale locale
log log
program_options program_options
system
) )
# system is not used by Sunshine, but by Simple-Web-Server, added here for convenience # boost_system is header-only since Boost 1.69 and has no compiled library since 1.89+
# algorithm, preprocessor, scope, and uuid are not used by Sunshine, but by libdisplaydevice, added here for convenience # algorithm, preprocessor, scope, and uuid are not used by Sunshine, but by libdisplaydevice, added here for convenience
if(WIN32) if(WIN32)
@@ -101,3 +100,12 @@ endif()
message(STATUS "Boost include dirs: ${Boost_INCLUDE_DIRS}") message(STATUS "Boost include dirs: ${Boost_INCLUDE_DIRS}")
message(STATUS "Boost libraries: ${Boost_LIBRARIES}") message(STATUS "Boost libraries: ${Boost_LIBRARIES}")
# boost_system is header-only since Boost 1.69 and has no compiled library in 1.89+.
# Create a stub INTERFACE target for backward compatibility (e.g., Simple-Web-Server).
if(NOT TARGET Boost::system)
add_library(Boost::system IMPORTED INTERFACE GLOBAL)
if(TARGET Boost::headers)
target_link_libraries(Boost::system INTERFACE Boost::headers)
endif()
endif()

View File

@@ -22,6 +22,12 @@ macro(find_package) # cmake-lint: disable=C0103
(("${ARGV0_LOWER}" STREQUAL "libevdev") AND DEFINED EXTERNAL_PROJECT_LIBEVDEV_USED) (("${ARGV0_LOWER}" STREQUAL "libevdev") AND DEFINED EXTERNAL_PROJECT_LIBEVDEV_USED)
) )
# Do nothing, as the package has already been fetched # Do nothing, as the package has already been fetched
elseif("${ARGV0_LOWER}" STREQUAL "boost_system" AND Boost_FOUND)
# boost_system is header-only since Boost 1.69 with no compiled library in 1.89+.
# BoostConfig.cmake calls find_package(boost_system) internally; intercept it here
# and report success so BoostConfig.cmake accepts Boost::system as a valid target.
set(boost_system_FOUND TRUE) # cmake-lint: disable=C0103
set(boost_system_VERSION "${Boost_VERSION}") # cmake-lint: disable=C0103
else() else()
# Call the original find_package function # Call the original find_package function
_find_package(${ARGV}) _find_package(${ARGV})

View File

@@ -6,6 +6,7 @@
// standard includes // standard includes
#include <filesystem> #include <filesystem>
#include <fstream>
#include <utility> #include <utility>
// lib includes // lib includes
@@ -68,11 +69,12 @@ namespace http {
} }
int save_user_creds(const std::string &file, const std::string &username, const std::string &password, bool run_our_mouth) { int save_user_creds(const std::string &file, const std::string &username, const std::string &password, bool run_our_mouth) {
pt::ptree outputTree; nlohmann::json outputTree;
if (fs::exists(file)) { if (fs::exists(file)) {
try { try {
pt::read_json(file, outputTree); std::ifstream in(file);
in >> outputTree;
} catch (std::exception &e) { } catch (std::exception &e) {
BOOST_LOG(error) << "Couldn't read user credentials: "sv << e.what(); BOOST_LOG(error) << "Couldn't read user credentials: "sv << e.what();
return -1; return -1;
@@ -80,11 +82,12 @@ namespace http {
} }
auto salt = crypto::rand_alphabet(16); auto salt = crypto::rand_alphabet(16);
outputTree.put("username", username); outputTree["username"] = username;
outputTree.put("salt", salt); outputTree["salt"] = salt;
outputTree.put("password", util::hex(crypto::hash(password + salt)).to_string()); outputTree["password"] = util::hex(crypto::hash(password + salt)).to_string();
try { try {
pt::write_json(file, outputTree); std::ofstream out(file);
out << outputTree.dump(4); // Pretty-print with an indent of 4 spaces.
} catch (std::exception &e) { } catch (std::exception &e) {
BOOST_LOG(error) << "error writing to the credentials file, perhaps try this again as an administrator? Details: "sv << e.what(); BOOST_LOG(error) << "error writing to the credentials file, perhaps try this again as an administrator? Details: "sv << e.what();
return -1; return -1;

View File

@@ -2013,7 +2013,12 @@ namespace video {
if (!requested_idr_frame || images->peek()) { if (!requested_idr_frame || images->peek()) {
if (auto img = images->pop(max_frametime)) { if (auto img = images->pop(max_frametime)) {
frame_timestamp = img->frame_timestamp; frame_timestamp = img->frame_timestamp;
auto time_diff = *frame_timestamp - encode_frame_timestamp; if (!frame_timestamp) {
frame_timestamp = std::chrono::steady_clock::now();
}
auto current_timestamp = *frame_timestamp;
auto time_diff = current_timestamp - encode_frame_timestamp;
// If new frame comes in way too fast, just drop // If new frame comes in way too fast, just drop
if (time_diff < -frame_variation_threshold) { if (time_diff < -frame_variation_threshold) {
@@ -2028,7 +2033,7 @@ namespace video {
if (time_diff < frame_variation_threshold) { if (time_diff < frame_variation_threshold) {
*frame_timestamp = encode_frame_timestamp; *frame_timestamp = encode_frame_timestamp;
} else { } else {
encode_frame_timestamp = *frame_timestamp; encode_frame_timestamp = current_timestamp;
} }
encode_frame_timestamp += encode_frame_threshold; encode_frame_timestamp += encode_frame_threshold;