Sunshine v2025.118.151840
Self-hosted game stream host for Moonlight.
display_device.h
Go to the documentation of this file.
1
5#pragma once
6
7// lib includes
8#include <display_device/types.h>
9#include <filesystem>
10#include <memory>
11
12// forward declarations
13namespace platf {
14 class deinit_t;
15}
16namespace config {
17 struct video_t;
18}
19namespace rtsp_stream {
20 struct launch_session_t;
21}
22
23namespace display_device {
35 [[nodiscard]] std::unique_ptr<platf::deinit_t>
36 init(const std::filesystem::path &persistence_filepath, const config::video_t &video_config);
37
48 [[nodiscard]] std::string
49 map_output_name(const std::string &output_name);
50
65 void
66 configure_display(const config::video_t &video_config, const rtsp_stream::launch_session_t &session);
67
86 void
87 configure_display(const SingleDisplayConfiguration &config);
88
99 void
101
122 [[nodiscard]] bool
124
129
134
153 [[nodiscard]] std::variant<failed_to_parse_tag_t, configuration_disabled_tag_t, SingleDisplayConfiguration>
154 parse_configuration(const config::video_t &video_config, const rtsp_stream::launch_session_t &session);
155} // namespace display_device
std::variant< failed_to_parse_tag_t, configuration_disabled_tag_t, SingleDisplayConfiguration > parse_configuration(const config::video_t &video_config, const rtsp_stream::launch_session_t &session)
Parse the user configuration and the session information.
Definition display_device.cpp:832
void revert_configuration()
Revert the display configuration and restore the previous state.
Definition display_device.cpp:810
std::unique_ptr< platf::deinit_t > init(const std::filesystem::path &persistence_filepath, const config::video_t &video_config)
Initialize the implementation and perform the initial state recovery (if needed).
Definition display_device.cpp:721
void configure_display(const config::video_t &video_config, const rtsp_stream::launch_session_t &session)
Configure the display device based on the user configuration and the session information.
Definition display_device.cpp:775
bool reset_persistence()
Reset the persistence and currently held initial display state.
Definition display_device.cpp:816
std::string map_output_name(const std::string &output_name)
Map the output name to a specific display.
Definition display_device.cpp:764
Definition config.h:17
A tag structure indicating that configuration is disabled.
Definition display_device.h:133
A tag structure indicating that configuration parsing has failed.
Definition display_device.h:128
Definition rtsp.h:15