提交 c8155d49 编写于 作者: P pkv

UI: Enable HW acceleration switch for browser sources on Mac

This enables in Settings the checkbox for hardware acceleration for
Browser Sources in MacOs.
上级 c7b89fa3
......@@ -483,6 +483,8 @@ bool OBSApp::InitGlobalConfigDefaults()
#endif
#ifdef __APPLE__
config_set_default_bool(globalConfig, "General", "BrowserHWAccel",
true);
config_set_default_bool(globalConfig, "Video", "DisableOSXVSync", true);
config_set_default_bool(globalConfig, "Video", "ResetOSXVSyncOnExit",
true);
......@@ -1387,7 +1389,7 @@ bool OBSApp::OBSInit()
obs_set_ui_task_handler(ui_task_handler);
#ifdef _WIN32
#if defined(_WIN32) || defined(__APPLE__)
bool browserHWAccel =
config_get_bool(globalConfig, "General", "BrowserHWAccel");
......
......@@ -538,6 +538,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
#endif
#ifdef _WIN32
HookWidget(ui->disableAudioDucking, CHECK_CHANGED, ADV_CHANGED);
#endif
#if defined(_WIN32) || defined(__APPLE__)
HookWidget(ui->browserHWAccel, CHECK_CHANGED, ADV_RESTART);
#endif
HookWidget(ui->filenameFormatting, EDIT_CHANGED, ADV_CHANGED);
......@@ -627,8 +629,10 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
delete ui->advancedGeneralGroupBox;
delete ui->enableNewSocketLoop;
delete ui->enableLowLatencyMode;
#ifdef __linux__
delete ui->browserHWAccel;
delete ui->sourcesGroup;
#endif
#if defined(__APPLE__) || HAVE_PULSEAUDIO
delete ui->disableAudioDucking;
#endif
......@@ -641,8 +645,10 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
ui->advancedGeneralGroupBox = nullptr;
ui->enableNewSocketLoop = nullptr;
ui->enableLowLatencyMode = nullptr;
#ifdef __linux__
ui->browserHWAccel = nullptr;
ui->sourcesGroup = nullptr;
#endif
#if defined(__APPLE__) || HAVE_PULSEAUDIO
ui->disableAudioDucking = nullptr;
#endif
......@@ -2554,7 +2560,8 @@ void OBSBasicSettings::LoadAdvancedSettings()
ui->enableLowLatencyMode->setChecked(enableLowLatencyMode);
ui->enableLowLatencyMode->setToolTip(
QTStr("Basic.Settings.Advanced.Network.TCPPacing.Tooltip"));
#endif
#if defined(_WIN32) || defined(__APPLE__)
bool browserHWAccel = config_get_bool(App()->GlobalConfig(), "General",
"BrowserHWAccel");
ui->browserHWAccel->setChecked(browserHWAccel);
......@@ -3175,7 +3182,8 @@ void OBSBasicSettings::SaveAdvancedSettings()
SaveCheckBox(ui->enableNewSocketLoop, "Output", "NewSocketLoopEnable");
SaveCheckBox(ui->enableLowLatencyMode, "Output", "LowLatencyEnable");
#endif
#if defined(_WIN32) || defined(__APPLE__)
bool browserHWAccel = ui->browserHWAccel->isChecked();
config_set_bool(App()->GlobalConfig(), "General", "BrowserHWAccel",
browserHWAccel);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册