Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3faf3a2

Browse files
authored
revert "create browser source on main thread" (#1564)
* I figured out a way to do this on obs-browser plugin level however itis best to postphone this endeavor for now since it causes other issuesin this branch
1 parentddd5ac4 commit3faf3a2

File tree

5 files changed

+2
-35
lines changed

5 files changed

+2
-35
lines changed

‎obs-studio-server/source/osn-input.cpp‎

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,7 @@ void osn::Input::Create(void *data, const int64_t id, const std::vector<ipc::val
111111
break;
112112
}
113113

114-
#if defined(__APPLE__)
115-
staticbool hasInitializedBrowserSources =false;
116-
obs_source_t *source =nullptr;
117-
118-
if (!hasInitializedBrowserSources && sourceId =="browser_source") {
119-
// CEFInitialize must be invoked on main thread (first time a browser source is created)
120-
hasInitializedBrowserSources =true;
121-
122-
g_util_osx->runOnMainThreadSync(
123-
[&source, &sourceId, &name, &settings, &hotkeys]() { source =obs_source_create(sourceId.c_str(), name.c_str(), settings, hotkeys); });
124-
}else {
125-
source =obs_source_create(sourceId.c_str(), name.c_str(), settings, hotkeys);
126-
}
127-
#else
128114
obs_source_t *source =obs_source_create(sourceId.c_str(), name.c_str(), settings, hotkeys);
129-
#endif
130115
obs_data_release(hotkeys);
131116
obs_data_release(settings);
132117

@@ -675,4 +660,4 @@ void osn::Input::GetMediaState(void *data, const int64_t id, const std::vector<i
675660
rval.push_back(ipc::value((uint64_t)ErrorCode::Ok));
676661
rval.push_back(ipc::value(obs_source_media_get_state(input)));
677662
AUTO_DEBUG;
678-
}
663+
}

‎obs-studio-server/source/util-osx-impl.mm‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,4 @@ @implementation UtilImplObj
170170
NSString *workindDirPath = [[NSProcessInfoprocessInfo]environment][@"PWD"];
171171
returnstd::string([workindDirPathUTF8String]);
172172
}
173-
174-
voidUtilObjCInt::runOnMainThreadSync(std::function<void()> func)
175-
{
176-
dispatch_sync(dispatch_get_main_queue(), ^{
177-
func();
178-
});
179-
}
180173
@end

‎obs-studio-server/source/util-osx-int.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ class UtilObjCInt {
3939
std::stringgetWorkingDirectory(void);
4040
voidwait_terminate(void);
4141

42-
// Runs a function on the main thread and waits for the function to finish before proceeding.
43-
voidrunOnMainThreadSync(std::function<void()> func);
44-
4542
private:
4643
void *self;
4744
std::atomic<bool> appRunning;

‎obs-studio-server/source/util-osx.cpp‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,4 @@ std::string UtilInt::getUserDataPath(void)
7272
std::stringUtilInt::getWorkingDirectory(void)
7373
{
7474
return _impl->getWorkingDirectory();
75-
}
76-
77-
voidUtilInt::runOnMainThreadSync(std::function<void()> func)
78-
{
79-
_impl->runOnMainThreadSync(func);
80-
}
75+
}

‎obs-studio-server/source/util-osx.hpp‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#ifndef __UTIL_CLASS_H__
2020
#define__UTIL_CLASS_H__
2121

22-
#include<functional>
2322
#include<string>
2423
#include<vector>
2524

@@ -39,8 +38,6 @@ class UtilInt {
3938
std::vector<std::pair<uint32_t,uint32_t>>getAvailableScreenResolutions(void);
4039
std::stringgetUserDataPath(void);
4140
std::stringgetWorkingDirectory(void);
42-
// Runs a function on the main thread and waits for the function to finish before proceeding.
43-
voidrunOnMainThreadSync(std::function<void()> func);
4441

4542
private:
4643
UtilObjCInt *_impl;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp