0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00

Merge pull request #5269 from jpark37/wasapi-cleanup

win-wasapi: WASAPISource improvements
This commit is contained in:
Jim 2021-10-24 02:16:40 -07:00 committed by GitHub
commit 355eb4b8df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 646 additions and 223 deletions

View File

@ -2689,6 +2689,14 @@ int main(int argc, char *argv[])
SetErrorMode(SEM_FAILCRITICALERRORS);
load_debug_privilege();
base_set_crash_handler(main_crash_handler, nullptr);
const HMODULE hRtwq = LoadLibrary(L"RTWorkQ.dll");
if (hRtwq) {
typedef HRESULT(STDAPICALLTYPE * PFN_RtwqStartup)();
PFN_RtwqStartup func =
(PFN_RtwqStartup)GetProcAddress(hRtwq, "RtwqStartup");
func();
}
#endif
base_get_log_handler(&def_log_handler, nullptr);
@ -2828,6 +2836,16 @@ int main(int argc, char *argv[])
curl_global_init(CURL_GLOBAL_ALL);
int ret = run_program(logFile, argc, argv);
#ifdef _WIN32
if (hRtwq) {
typedef HRESULT(STDAPICALLTYPE * PFN_RtwqShutdown)();
PFN_RtwqShutdown func =
(PFN_RtwqShutdown)GetProcAddress(hRtwq, "RtwqShutdown");
func();
FreeLibrary(hRtwq);
}
#endif
blog(LOG_INFO, "Number of memory leaks: %ld", bnum_allocs());
base_set_log_handler(nullptr, nullptr);
return ret;

View File

@ -15,6 +15,7 @@ add_library(win-wasapi MODULE
${win-wasapi_SOURCES}
${win-wasapi_HEADERS})
target_link_libraries(win-wasapi
Avrt
libobs)
set_target_properties(win-wasapi PROPERTIES FOLDER "plugins")

View File

@ -36,7 +36,7 @@ string GetDeviceName(IMMDevice *device)
return device_name;
}
void GetWASAPIAudioDevices_(vector<AudioDeviceInfo> &devices, bool input)
static void GetWASAPIAudioDevices_(vector<AudioDeviceInfo> &devices, bool input)
{
ComPtr<IMMDeviceEnumerator> enumerator;
ComPtr<IMMDeviceCollection> collection;

File diff suppressed because it is too large Load Diff