mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-10-27 16:29:04 -04:00
libobs: Add task scheduling features
(This commit also modifies the UI) Adds the ability to schedule tasks for certain threads
This commit is contained in:
1 parent
9f00350688
commit
8de20ab3be
6 files changed
+142
No files matched your search
@@ -1327,6 +1327,17 @@ void OBSApp::Exec(VoidFunc func)
|
||||
func();
|
||||
}
|
||||
|
||||
static void ui_task_handler(obs_task_t task, void *param, bool wait)
|
||||
{
|
||||
auto doTask = [=]() {
|
||||
/* to get clang-format to behave */
|
||||
task(param);
|
||||
};
|
||||
QMetaObject::invokeMethod(App(), "Exec",
|
||||
wait ? WaitConnection() : Qt::AutoConnection,
|
||||
Q_ARG(VoidFunc, doTask));
|
||||
}
|
||||
|
||||
bool OBSApp::OBSInit()
|
||||
{
|
||||
ProfileScope("OBSApp::OBSInit");
|
||||
@@ -1338,6 +1349,8 @@ bool OBSApp::OBSInit()
|
||||
if (!StartupOBS(locale.c_str(), GetProfilerNameStore()))
|
||||
return false;
|
||||
|
||||
obs_set_ui_task_handler(ui_task_handler);
|
||||
|
||||
#ifdef _WIN32
|
||||
bool browserHWAccel =
|
||||
config_get_bool(globalConfig, "General", "BrowserHWAccel");
|
||||
|
||||
Reference in new issue
Block a user