aboutsummaryrefslogtreecommitdiff
path: root/src/config.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-11-24 21:35:21 +0100
committerdec05eba <dec05eba@protonmail.com>2022-11-24 21:35:21 +0100
commitba21ad93a116f3a0de9421344c0e5a894a58689a (patch)
tree8688cbd9e41d165f4f5fd8ef4ac6e2c68ddce30c /src/config.hpp
parente0017b8a0200d7c1dd5c774fc01f69838fa7e93b (diff)
Add file container option (mp4, flv, mkv)
Diffstat (limited to 'src/config.hpp')
-rw-r--r--src/config.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/config.hpp b/src/config.hpp
index 1bfdfac..a08a960 100644
--- a/src/config.hpp
+++ b/src/config.hpp
@@ -25,10 +25,12 @@ struct StreamingConfig {
struct RecordConfig {
std::string save_directory;
+ std::string container;
};
struct ReplayConfig {
std::string save_directory;
+ std::string container;
int replay_time = 30;
};
@@ -216,8 +218,12 @@ static Config read_config() {
config.streaming_config.stream_key.assign(value.str, value.size);
} else if(key == "record.save_directory") {
config.record_config.save_directory.assign(value.str, value.size);
+ } else if(key == "record.container") {
+ config.record_config.container.assign(value.str, value.size);
} else if(key == "replay.save_directory") {
config.replay_config.save_directory.assign(value.str, value.size);
+ } else if(key == "replay.container") {
+ config.replay_config.container.assign(value.str, value.size);
} else if(key == "replay.time") {
if(!string_to_int(std::string(value.str, value.size), config.replay_config.replay_time)) {
fprintf(stderr, "Warning: Invalid config option replay.time\n");
@@ -262,8 +268,10 @@ static void save_config(const Config &config) {
fprintf(file, "streaming.key %s\n", config.streaming_config.stream_key.c_str());
fprintf(file, "record.save_directory %s\n", config.record_config.save_directory.c_str());
+ fprintf(file, "record.container %s\n", config.record_config.container.c_str());
fprintf(file, "replay.save_directory %s\n", config.replay_config.save_directory.c_str());
+ fprintf(file, "replay.container %s\n", config.replay_config.container.c_str());
fprintf(file, "replay.time %d\n", config.replay_config.replay_time);
fclose(file);