mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
UI: Add Profiles
Adds setting profiles to the basic user interface. For each profile, a subdirectory for the profile will be created in [config_dir]/obs-studio/basic/profiles which will contain the settings data for each profile.
This commit is contained in:
@@ -315,7 +315,7 @@ static OBSData GetDataFromJsonFile(const char *jsonFile)
|
||||
{
|
||||
char fullPath[512];
|
||||
|
||||
int ret = GetConfigPath(fullPath, sizeof(fullPath), jsonFile);
|
||||
int ret = GetProfilePath(fullPath, sizeof(fullPath), jsonFile);
|
||||
if (ret > 0) {
|
||||
BPtr<char> jsonData = os_quick_read_utf8_file(fullPath);
|
||||
if (!!jsonData) {
|
||||
@@ -341,10 +341,8 @@ AdvancedOutput::AdvancedOutput(OBSBasic *main_) : BasicOutputHandler(main_)
|
||||
ffmpegRecording = astrcmpi(recType, "FFmpeg") == 0;
|
||||
useStreamEncoder = astrcmpi(recordEncoder, "none") == 0;
|
||||
|
||||
OBSData streamEncSettings = GetDataFromJsonFile(
|
||||
"obs-studio/basic/streamEncoder.json");
|
||||
OBSData recordEncSettings = GetDataFromJsonFile(
|
||||
"obs-studio/basic/recordEncoder.json");
|
||||
OBSData streamEncSettings = GetDataFromJsonFile("streamEncoder.json");
|
||||
OBSData recordEncSettings = GetDataFromJsonFile("recordEncoder.json");
|
||||
|
||||
streamOutput = obs_output_create("rtmp_output", "adv_stream",
|
||||
nullptr, nullptr);
|
||||
@@ -411,8 +409,7 @@ void AdvancedOutput::UpdateStreamSettings()
|
||||
bool applyServiceSettings = config_get_bool(main->Config(), "AdvOut",
|
||||
"ApplyServiceSettings");
|
||||
|
||||
OBSData settings = GetDataFromJsonFile(
|
||||
"obs-studio/basic/streamEncoder.json");
|
||||
OBSData settings = GetDataFromJsonFile("streamEncoder.json");
|
||||
|
||||
if (applyServiceSettings)
|
||||
obs_service_apply_encoder_settings(main->GetService(),
|
||||
@@ -430,8 +427,7 @@ void AdvancedOutput::UpdateStreamSettings()
|
||||
|
||||
inline void AdvancedOutput::UpdateRecordingSettings()
|
||||
{
|
||||
OBSData settings = GetDataFromJsonFile(
|
||||
"obs-studio/basic/recordEncoder.json");
|
||||
OBSData settings = GetDataFromJsonFile("recordEncoder.json");
|
||||
obs_encoder_update(h264Recording, settings);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user