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:
parent
9f00350688
commit
8de20ab3be
6 changed files with 142 additions and 0 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue