|
Sunshine master
Self-hosted game stream host for Moonlight.
|
Definitions for the startup and shutdown of the apps started by a streaming Session. More...
#include <filesystem>#include <string>#include <thread>#include <vector>#include <boost/algorithm/string.hpp>#include <boost/crc.hpp>#include <boost/filesystem.hpp>#include <boost/program_options/parsers.hpp>#include <boost/property_tree/json_parser.hpp>#include <boost/property_tree/ptree.hpp>#include <boost/token_functions.hpp>#include <openssl/evp.h>#include <openssl/sha.h>#include "config.h"#include "crypto.h"#include "display_device.h"#include "logging.h"#include "platform/common.h"#include "process.h"#include "system_tray.h"#include "utility.h"#include "platform/windows/utf_utils.h"#include <share.h>Classes | |
| class | proc::deinit_t |
| RAII helper that runs shutdown cleanup when destroyed. More... | |
Functions | |
| std::tuple< std::string, std::string > | proc::calculate_app_id (const std::string &app_name, std::string app_image_path, int index) |
| Calculate a stable id based on name and image data. | |
| uint32_t | proc::calculate_crc32 (const std::string &input) |
| Calculate the CRC-32 checksum for a string. | |
| std::optional< std::string > | proc::calculate_sha256 (const std::string &filename) |
| Calculate the SHA-256 digest for a file. | |
| bool | proc::check_valid_png (const std::filesystem::path &path) |
| Validates a path whether it is a valid PNG. | |
| std::string_view::iterator | proc::find_match (std::string_view::iterator begin, std::string_view::iterator end) |
| Find the closing parenthesis for an environment-variable expression. | |
| boost::filesystem::path | proc::find_working_directory (const std::string &cmd, boost::process::v1::environment &env) |
| Resolve the working directory for a configured command. | |
| std::unique_ptr< platf::deinit_t > | proc::init () |
| Initialize proc functions. | |
| std::optional< proc::proc_t > | proc::parse (const std::string &file_name) |
| Parse serialized text into the corresponding runtime representation. | |
| std::string | proc::parse_env_val (boost::process::v1::native_environment &env, const std::string_view &val_raw) |
| Parse env val. | |
| void | proc::refresh (const std::string &file_name) |
| Refresh cached platform state from the operating system. | |
| void | proc::terminate_process_group (boost::process::v1::child &proc, boost::process::v1::group &group, std::chrono::seconds exit_timeout) |
| Terminates all child processes in a process group. | |
| std::string | proc::validate_app_image_path (std::string app_image_path) |
| Validate app image path. | |
Variables | |
| proc_t | proc::proc |
| Global process registry used to track and terminate child processes. | |
Definitions for the startup and shutdown of the apps started by a streaming Session.
| std::tuple< std::string, std::string > proc::calculate_app_id | ( | const std::string & | app_name, |
| std::string | app_image_path, | ||
| int | index ) |
Calculate a stable id based on name and image data.
| app_name | App name. |
| app_image_path | App image path. |
| index | Zero-based index of the item being addressed. |
| uint32_t proc::calculate_crc32 | ( | const std::string & | input | ) |
Calculate the CRC-32 checksum for a string.
| input | Bytes to include in the checksum. |
| std::optional< std::string > proc::calculate_sha256 | ( | const std::string & | filename | ) |
Calculate the SHA-256 digest for a file.
| filename | File path whose contents should be hashed. |
| bool proc::check_valid_png | ( | const std::filesystem::path & | path | ) |
Validates a path whether it is a valid PNG.
| path | The path to the PNG file. |
| std::string_view::iterator proc::find_match | ( | std::string_view::iterator | begin, |
| std::string_view::iterator | end ) |
Find the closing parenthesis for an environment-variable expression.
| begin | Iterator positioned at the opening parenthesis. |
| end | End iterator for the expression being scanned. |
| boost::filesystem::path proc::find_working_directory | ( | const std::string & | cmd, |
| boost::process::v1::environment & | env ) |
Resolve the working directory for a configured command.
| cmd | Command line to execute or inspect. |
| env | Environment variables for the child process. |
| std::unique_ptr< platf::deinit_t > proc::init | ( | ) |
Initialize proc functions.
deinit_t to manage cleanup | std::optional< proc::proc_t > proc::parse | ( | const std::string & | file_name | ) |
Parse serialized text into the corresponding runtime representation.
| file_name | File name. |
| std::string proc::parse_env_val | ( | boost::process::v1::native_environment & | env, |
| const std::string_view & | val_raw ) |
Parse env val.
| env | Environment variables for the child process. |
| val_raw | Raw value that may contain substitutions. |
| void proc::refresh | ( | const std::string & | file_name | ) |
Refresh cached platform state from the operating system.
| file_name | File name. |
| void proc::terminate_process_group | ( | boost::process::v1::child & | proc, |
| boost::process::v1::group & | group, | ||
| std::chrono::seconds | exit_timeout ) |
Terminates all child processes in a process group.
| proc | The child process itself. |
| group | The group of all children in the process tree. |
| exit_timeout | The timeout to wait for the process group to gracefully exit. |
| std::string proc::validate_app_image_path | ( | std::string | app_image_path | ) |
Validate app image path.
| app_image_path | Candidate image path from the application configuration. |