![]() |
Sunshine latest
Self-hosted game stream host for Moonlight.
|
Definitions for display device handling. More...
#include "display_device.h"
#include <boost/algorithm/string.hpp>
#include <display_device/audio_context_interface.h>
#include <display_device/file_settings_persistence.h>
#include <display_device/json.h>
#include <display_device/retry_scheduler.h>
#include <display_device/settings_manager_interface.h>
#include <mutex>
#include <regex>
#include "audio.h"
#include "platform/common.h"
#include "rtsp.h"
#include <display_device/windows/settings_manager.h>
#include <display_device/windows/win_api_layer.h>
#include <display_device/windows/win_display_device.h>
Functions | |
void | display_device::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. | |
void | display_device::configure_display (const SingleDisplayConfiguration &config) |
Configure the display device using the provided configuration. | |
std::unique_ptr< platf::deinit_t > | display_device::init (const std::filesystem::path &persistence_filepath, const config::video_t &video_config) |
Initialize the implementation and perform the initial state recovery (if needed). | |
std::string | display_device::map_output_name (const std::string &output_name) |
Map the output name to a specific display. | |
std::variant< failed_to_parse_tag_t, configuration_disabled_tag_t, SingleDisplayConfiguration > | display_device::parse_configuration (const config::video_t &video_config, const rtsp_stream::launch_session_t &session) |
Parse the user configuration and the session information. | |
bool | display_device::reset_persistence () |
Reset the persistence and currently held initial display state. | |
void | display_device::revert_configuration () |
Revert the display configuration and restore the previous state. | |
Definitions for display device handling.
void display_device::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.
video_config | User's video related configuration. |
session | Session information. |
Examples
void display_device::configure_display | ( | const SingleDisplayConfiguration & | config | ) |
Configure the display device using the provided configuration.
In some cases configuring display can fail due to transient issues and we will keep trying every 5 seconds, even if the stream has already started as there was no possibility to apply settings before the stream start.
Therefore, there is no return value as we still want to continue with the stream, so that the users can do something about it once they are connected. Otherwise, we might prevent users from logging in at all if we keep failing to apply configuration.
config | Configuration for the display. |
Examples
std::unique_ptr< platf::deinit_t > display_device::init | ( | const std::filesystem::path & | persistence_filepath, |
const config::video_t & | video_config ) |
Initialize the implementation and perform the initial state recovery (if needed).
persistence_filepath | File location for reading/saving persistent state. |
video_config | User's video related configuration. |
Examples
std::string display_device::map_output_name | ( | const std::string & | output_name | ) |
Map the output name to a specific display.
output_name | The user-configurable output name. |
Examples
std::variant< failed_to_parse_tag_t, configuration_disabled_tag_t, SingleDisplayConfiguration > display_device::parse_configuration | ( | const config::video_t & | video_config, |
const rtsp_stream::launch_session_t & | session ) |
Parse the user configuration and the session information.
video_config | User's video related configuration. |
session | Session information. |
Examples
bool display_device::reset_persistence | ( | ) |
Reset the persistence and currently held initial display state.
This is normally used to get out of the "broken" state where the algorithm wants to restore the initial display state, but it is no longer possible.
This could happen if the display is no longer available or the hardware was changed and the device ids no longer match.
The user then accepts that Sunshine is not able to restore the state and "agrees" to do it manually.
Examples
void display_device::revert_configuration | ( | ) |
Revert the display configuration and restore the previous state.
In case the state could not be restored, by default it will be retried again in 5 seconds (repeating indefinitely until success or until persistence is reset).
Examples
decltype(audio::get_audio_ctx_ref()) audio_ctx_ref {audio::get_audio_ctx_ref()} |
A reference to the audio context that will automatically extend the audio session.