|
Hermes 0.7.0
Linux game streaming host
|
Definitions for the configuration of Sunshine. More...
#include <algorithm>#include <filesystem>#include <fstream>#include <functional>#include <iostream>#include <thread>#include <unordered_map>#include <utility>#include <boost/asio.hpp>#include <boost/filesystem.hpp>#include <boost/property_tree/json_parser.hpp>#include <boost/property_tree/ptree.hpp>#include "config.h"#include "entry_handler.h"#include "file_handler.h"#include "logging.h"#include "nvhttp.h"#include "platform/common.h"#include "rtsp.h"#include "video.h"#include "utility.h"#include <ffnvcodec/nvEncodeAPI.h>Go to the source code of this file.
Macros | |
| #define | CA_DIR "credentials" |
| #define | PRIVATE_KEY_FILE CA_DIR "/cakey.pem" |
| #define | CERTIFICATE_FILE CA_DIR "/cacert.pem" |
| #define | APPS_JSON_PATH platf::appdata().string() + "/apps.json" |
| #define | _CONVERT_(x, y) |
| #define | _CONVERT_(x) |
| #define | _CONVERT_2_ARG_(str, val) |
| #define | _CONVERT_(x) |
| #define | _CONVERT_2_ARG_(str, val) |
| #define | _CONVERT_(x) |
| #define | _CONVERT_2_ARG_(str, val) |
| #define | _CONVERT_(x) |
Functions | |
| nvenc::nvenc_two_pass | config::nv::twopass_from_view (const ::std::string_view &preset) |
| int | config::sw::svtav1_preset_from_view (const ::std::string_view &preset) |
| video_t::dd_t::config_option_e | config::dd::config_option_from_view (const ::std::string_view value) |
| video_t::dd_t::resolution_option_e | config::dd::resolution_option_from_view (const ::std::string_view value) |
| video_t::dd_t::refresh_rate_option_e | config::dd::refresh_rate_option_from_view (const ::std::string_view value) |
| video_t::dd_t::hdr_option_e | config::dd::hdr_option_from_view (const ::std::string_view value) |
| video_t::dd_t::mode_remapping_t | config::dd::mode_remapping_from_view (const ::std::string_view value) |
| bool | config::endline (char ch) |
| bool | config::space_tab (char ch) |
| bool | config::whitespace (char ch) |
| std::string | config::to_string (const char *begin, const char *end) |
| template<class It> | |
| It | config::skip_list (It skipper, It end) |
| std::pair< ::std::string_view::const_iterator, ::std::optional< std::pair< std::string, std::string > > > | config::parse_option (::std::string_view::const_iterator begin, ::std::string_view::const_iterator end) |
| const std::set< std::string > & | config::server_computed_keys () |
| Keys the Web UI's config response carries but that are never configuration: server-computed status, platform and version fields. | |
| std::unordered_map< std::string, std::string > | config::parse_config (const ::std::string_view &file_content) |
| void | config::string_f (std::unordered_map< std::string, std::string > &vars, const std::string &name, std::string &input) |
| template<typename T, typename F> | |
| void | config::generic_f (std::unordered_map< std::string, std::string > &vars, const std::string &name, T &input, F &&f) |
| void | config::string_restricted_f (std::unordered_map< std::string, std::string > &vars, const std::string &name, std::string &input, const std::vector<::std::string_view > &allowed_vals) |
| void | config::path_f (std::unordered_map< std::string, std::string > &vars, const std::string &name, fs::path &input) |
| void | config::path_f (std::unordered_map< std::string, std::string > &vars, const std::string &name, std::string &input) |
| void | config::int_f (std::unordered_map< std::string, std::string > &vars, const std::string &name, int &input) |
| void | config::int_f (std::unordered_map< std::string, std::string > &vars, const std::string &name, ::std::optional< int > &input) |
| template<class F> | |
| void | config::int_f (std::unordered_map< std::string, std::string > &vars, const std::string &name, int &input, F &&f) |
| template<class F> | |
| void | config::int_f (std::unordered_map< std::string, std::string > &vars, const std::string &name, ::std::optional< int > &input, F &&f) |
| void | config::int_between_f (std::unordered_map< std::string, std::string > &vars, const std::string &name, int &input, const std::pair< int, int > &range) |
| bool | config::to_bool (std::string &boolean) |
| void | config::bool_f (std::unordered_map< std::string, std::string > &vars, const std::string &name, bool &input) |
| void | config::double_f (std::unordered_map< std::string, std::string > &vars, const std::string &name, double &input) |
| void | config::double_between_f (std::unordered_map< std::string, std::string > &vars, const std::string &name, double &input, const std::pair< double, double > &range) |
| void | config::list_string_f (std::unordered_map< std::string, std::string > &vars, const std::string &name, std::vector< std::string > &input) |
| void | config::list_prep_cmd_f (std::unordered_map< std::string, std::string > &vars, const std::string &name, std::vector< prep_cmd_t > &input) |
| void | config::list_server_cmd_f (std::unordered_map< std::string, std::string > &vars, const std::string &name, std::vector< server_cmd_t > &input) |
| void | config::list_int_f (std::unordered_map< std::string, std::string > &vars, const std::string &name, std::vector< int > &input) |
| void | config::map_int_int_f (std::unordered_map< std::string, std::string > &vars, const std::string &name, std::unordered_map< int, int > &input) |
| int | config::apply_flags (const char *line) |
| std::vector<::std::string_view > & | config::get_supported_gamepad_options () |
| void | config::apply_config (std::unordered_map< std::string, std::string > &&vars) |
| int | config::parse (int argc, char *argv[]) |
Variables | |
| video_t | config::video |
| audio_t | config::audio |
| stream_t | config::stream |
| nvhttp_t | config::nvhttp |
| input_t | config::input |
| sunshine_t | config::sunshine |
Definitions for the configuration of Sunshine.
Definition in file config.cpp.
| #define _CONVERT_ | ( | x | ) |
| #define _CONVERT_ | ( | x | ) |
| #define _CONVERT_ | ( | x | ) |
| #define _CONVERT_ | ( | x | ) |
| #define _CONVERT_ | ( | x, | |
| y ) |
| #define _CONVERT_2_ARG_ | ( | str, | |
| val ) |
| #define _CONVERT_2_ARG_ | ( | str, | |
| val ) |
| #define _CONVERT_2_ARG_ | ( | str, | |
| val ) |
| #define APPS_JSON_PATH platf::appdata().string() + "/apps.json" |
Definition at line 43 of file config.cpp.
| #define CA_DIR "credentials" |
Definition at line 39 of file config.cpp.
| #define CERTIFICATE_FILE CA_DIR "/cacert.pem" |
Definition at line 41 of file config.cpp.
| #define PRIVATE_KEY_FILE CA_DIR "/cakey.pem" |
Definition at line 40 of file config.cpp.
| void config::apply_config | ( | std::unordered_map< std::string, std::string > && | vars | ) |
Definition at line 857 of file config.cpp.
| int config::apply_flags | ( | const char * | line | ) |
Definition at line 820 of file config.cpp.
| void config::bool_f | ( | std::unordered_map< std::string, std::string > & | vars, |
| const std::string & | name, | ||
| bool & | input ) |
Definition at line 637 of file config.cpp.
| video_t::dd_t::config_option_e config::dd::config_option_from_view | ( | const ::std::string_view | value | ) |
Definition at line 85 of file config.cpp.
| void config::double_between_f | ( | std::unordered_map< std::string, std::string > & | vars, |
| const std::string & | name, | ||
| double & | input, | ||
| const std::pair< double, double > & | range ) |
Definition at line 666 of file config.cpp.
| void config::double_f | ( | std::unordered_map< std::string, std::string > & | vars, |
| const std::string & | name, | ||
| double & | input ) |
Definition at line 648 of file config.cpp.
| bool config::endline | ( | char | ch | ) |
Definition at line 322 of file config.cpp.
| void config::generic_f | ( | std::unordered_map< std::string, std::string > & | vars, |
| const std::string & | name, | ||
| T & | input, | ||
| F && | f ) |
Definition at line 477 of file config.cpp.
| std::vector<::std::string_view > & config::get_supported_gamepad_options | ( | ) |
Definition at line 847 of file config.cpp.
| video_t::dd_t::hdr_option_e config::dd::hdr_option_from_view | ( | const ::std::string_view | value | ) |
Definition at line 124 of file config.cpp.
| void config::int_between_f | ( | std::unordered_map< std::string, std::string > & | vars, |
| const std::string & | name, | ||
| int & | input, | ||
| const std::pair< int, int > & | range ) |
Definition at line 613 of file config.cpp.
| void config::int_f | ( | std::unordered_map< std::string, std::string > & | vars, |
| const std::string & | name, | ||
| ::std::optional< int > & | input ) |
Definition at line 571 of file config.cpp.
| void config::int_f | ( | std::unordered_map< std::string, std::string > & | vars, |
| const std::string & | name, | ||
| ::std::optional< int > & | input, | ||
| F && | f ) |
Definition at line 605 of file config.cpp.
| void config::int_f | ( | std::unordered_map< std::string, std::string > & | vars, |
| const std::string & | name, | ||
| int & | input ) |
Definition at line 547 of file config.cpp.
| void config::int_f | ( | std::unordered_map< std::string, std::string > & | vars, |
| const std::string & | name, | ||
| int & | input, | ||
| F && | f ) |
Definition at line 596 of file config.cpp.
| void config::list_int_f | ( | std::unordered_map< std::string, std::string > & | vars, |
| const std::string & | name, | ||
| std::vector< int > & | input ) |
Definition at line 768 of file config.cpp.
| void config::list_prep_cmd_f | ( | std::unordered_map< std::string, std::string > & | vars, |
| const std::string & | name, | ||
| std::vector< prep_cmd_t > & | input ) |
Definition at line 716 of file config.cpp.
| void config::list_server_cmd_f | ( | std::unordered_map< std::string, std::string > & | vars, |
| const std::string & | name, | ||
| std::vector< server_cmd_t > & | input ) |
Definition at line 742 of file config.cpp.
| void config::list_string_f | ( | std::unordered_map< std::string, std::string > & | vars, |
| const std::string & | name, | ||
| std::vector< std::string > & | input ) |
Definition at line 677 of file config.cpp.
| void config::map_int_int_f | ( | std::unordered_map< std::string, std::string > & | vars, |
| const std::string & | name, | ||
| std::unordered_map< int, int > & | input ) |
Definition at line 801 of file config.cpp.
| video_t::dd_t::mode_remapping_t config::dd::mode_remapping_from_view | ( | const ::std::string_view | value | ) |
Definition at line 136 of file config.cpp.
| int config::parse | ( | int | argc, |
| char * | argv[] ) |
Definition at line 1138 of file config.cpp.
| std::unordered_map< std::string, std::string > config::parse_config | ( | const ::std::string_view & | file_content | ) |
Definition at line 437 of file config.cpp.
| std::pair< ::std::string_view::const_iterator, ::std::optional< std::pair< std::string, std::string > > > config::parse_option | ( | ::std::string_view::const_iterator | begin, |
| ::std::string_view::const_iterator | end ) |
Definition at line 369 of file config.cpp.
| void config::path_f | ( | std::unordered_map< std::string, std::string > & | vars, |
| const std::string & | name, | ||
| fs::path & | input ) |
Definition at line 515 of file config.cpp.
| void config::path_f | ( | std::unordered_map< std::string, std::string > & | vars, |
| const std::string & | name, | ||
| std::string & | input ) |
Definition at line 539 of file config.cpp.
| video_t::dd_t::refresh_rate_option_e config::dd::refresh_rate_option_from_view | ( | const ::std::string_view | value | ) |
Definition at line 111 of file config.cpp.
| video_t::dd_t::resolution_option_e config::dd::resolution_option_from_view | ( | const ::std::string_view | value | ) |
Definition at line 98 of file config.cpp.
| const std::set< std::string > & config::server_computed_keys | ( | ) |
Keys the Web UI's config response carries but that are never configuration: server-computed status, platform and version fields.
They end up in a real hermes.conf, because saveConfig() persists whatever the Web UI posts and the config page posts the whole response back. Two places have to know about them and used to disagree: the parser, which would otherwise report each as an unrecognized option, and the config response, where a parsed value - always a string - replaced the structured field of the same name and left the home page calling an array method on "[]". One list, so the two cannot drift apart again.
Definition at line 407 of file config.cpp.
| It config::skip_list | ( | It | skipper, |
| It | end ) |
Definition at line 350 of file config.cpp.
| bool config::space_tab | ( | char | ch | ) |
Definition at line 326 of file config.cpp.
| void config::string_f | ( | std::unordered_map< std::string, std::string > & | vars, |
| const std::string & | name, | ||
| std::string & | input ) |
Definition at line 465 of file config.cpp.
| void config::string_restricted_f | ( | std::unordered_map< std::string, std::string > & | vars, |
| const std::string & | name, | ||
| std::string & | input, | ||
| const std::vector<::std::string_view > & | allowed_vals ) |
Definition at line 485 of file config.cpp.
| int config::sw::svtav1_preset_from_view | ( | const ::std::string_view & | preset | ) |
Definition at line 66 of file config.cpp.
| bool config::to_bool | ( | std::string & | boolean | ) |
Definition at line 624 of file config.cpp.
| std::string config::to_string | ( | const char * | begin, |
| const char * | end ) |
Definition at line 334 of file config.cpp.
| nvenc::nvenc_two_pass config::nv::twopass_from_view | ( | const ::std::string_view & | preset | ) |
Definition at line 49 of file config.cpp.
| bool config::whitespace | ( | char | ch | ) |
Definition at line 330 of file config.cpp.
| audio_t config::audio |
Definition at line 224 of file config.cpp.
| input_t config::input |
Definition at line 257 of file config.cpp.
| nvhttp_t config::nvhttp |
Definition at line 246 of file config.cpp.
| stream_t config::stream |
Definition at line 232 of file config.cpp.
| sunshine_t config::sunshine |
Definition at line 289 of file config.cpp.
| video_t config::video |
Definition at line 164 of file config.cpp.