From 58299fbb24f4b44c9d11ec8b4d9a1878d2280dea Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 17 Mar 2023 18:35:16 +0100 Subject: Add overclocking option to workaround a NVIDIA driver bug (forcefully set to p2 state when using cuda) --- src/config.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/config.hpp') diff --git a/src/config.hpp b/src/config.hpp index bd43166..275f9f9 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -26,6 +26,8 @@ struct MainConfig { std::string quality; std::string codec; // Video codec std::string audio_codec; + bool advanced_view = false; + bool overclock = false; }; struct StreamingConfig { @@ -245,6 +247,16 @@ static Config read_config() { config.main_config.codec.assign(value.str, value.size); } else if(key == "main.audio_codec") { config.main_config.audio_codec.assign(value.str, value.size); + } else if(key == "main.advanced_view") { + if(value == "true") + config.main_config.advanced_view = true; + else if(value == "false") + config.main_config.advanced_view = false; + } else if(key == "main.overclock") { + if(value == "true") + config.main_config.overclock = true; + else if(value == "false") + config.main_config.overclock = false; } else if(key == "streaming.service") { config.streaming_config.streaming_service.assign(value.str, value.size); } else if(key == "streaming.key") { @@ -329,6 +341,8 @@ static void save_config(const Config &config) { fprintf(file, "main.quality %s\n", config.main_config.quality.c_str()); fprintf(file, "main.codec %s\n", config.main_config.codec.c_str()); fprintf(file, "main.audio_codec %s\n", config.main_config.audio_codec.c_str()); + fprintf(file, "main.advanced_view %s\n", config.main_config.advanced_view ? "true" : "false"); + fprintf(file, "main.overclock %s\n", config.main_config.overclock ? "true" : "false"); fprintf(file, "streaming.service %s\n", config.streaming_config.streaming_service.c_str()); fprintf(file, "streaming.key %s\n", config.streaming_config.stream_key.c_str()); -- cgit v1.2.3