Sunshine master
Self-hosted game stream host for Moonlight.
display_device.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <chrono>
9#include <filesystem>
10#include <memory>
11#include <string>
12
13// lib includes
14#include <display_device/display_power_interface.h>
15#include <display_device/types.h>
16
17// forward declarations
18namespace platf {
19 class deinit_t;
20}
21
22namespace config {
23 struct video_t;
24}
25
26namespace rtsp_stream {
27 struct launch_session_t;
28}
29
30namespace display_device {
42 [[nodiscard]] std::unique_ptr<platf::deinit_t> init(const std::filesystem::path &persistence_filepath, const config::video_t &video_config);
43
54 [[nodiscard]] std::string map_output_name(const std::string &output_name);
55
62 [[nodiscard]] bool wake_display(const std::string &display_name, std::chrono::milliseconds timeout);
63
69 [[nodiscard]] std::unique_ptr<DisplayPowerGuardInterface> keep_display_awake(const std::string &reason);
70
85 void configure_display(const config::video_t &video_config, const rtsp_stream::launch_session_t &session);
86
105 void configure_display(const SingleDisplayConfiguration &config);
106
118
139 [[nodiscard]] bool reset_persistence();
140
149 [[nodiscard]] EnumeratedDeviceList enumerate_devices();
150
155
160
179 [[nodiscard]] 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);
180} // 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:927
void revert_configuration()
Revert the display configuration and restore the previous state.
Definition display_device.cpp:895
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:764
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:846
bool wake_display(const std::string &display_name, std::chrono::milliseconds timeout)
Ask the platform to wake displays before detection or capture.
Definition display_device.cpp:808
EnumeratedDeviceList enumerate_devices()
Enumerate the available devices.
Definition display_device.cpp:915
bool reset_persistence()
Reset persisted display state and the captured initial state.
Definition display_device.cpp:900
std::unique_ptr< DisplayPowerGuardInterface > keep_display_awake(const std::string &reason)
Keep displays awake until the returned guard is destroyed.
Definition display_device.cpp:817
std::string map_output_name(const std::string &output_name)
Map the output name to a specific display.
Definition display_device.cpp:826
Video encoder, capture, and color settings loaded from configuration.
Definition config.h:47
A tag structure indicating that configuration is disabled.
Definition display_device.h:159
A tag structure indicating that configuration parsing has failed.
Definition display_device.h:154
RTSP launch session state shared with stream setup.
Definition rtsp.h:20