mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-04-19 09:46:37 +02:00
win-wasapi: Add support for capturing a process
Use new process output API, and retrofit existing WASAPI abstractions. Marked as "(BETA)" until we figure out the crackling at 60 minutes.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include <obs-module.h>
|
||||
|
||||
#include <util/windows/win-version.h>
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("win-wasapi", "en-US")
|
||||
MODULE_EXPORT const char *obs_module_description(void)
|
||||
@@ -8,11 +10,25 @@ MODULE_EXPORT const char *obs_module_description(void)
|
||||
}
|
||||
|
||||
void RegisterWASAPIInput();
|
||||
void RegisterWASAPIOutput();
|
||||
void RegisterWASAPIDeviceOutput();
|
||||
void RegisterWASAPIProcessOutput();
|
||||
|
||||
bool obs_module_load(void)
|
||||
{
|
||||
/* MS says 20348, but process filtering seems to work earlier */
|
||||
struct win_version_info ver;
|
||||
get_win_ver(&ver);
|
||||
struct win_version_info minimum;
|
||||
minimum.major = 10;
|
||||
minimum.minor = 0;
|
||||
minimum.build = 19041;
|
||||
minimum.revis = 0;
|
||||
const bool process_filter_supported =
|
||||
win_version_compare(&ver, &minimum) >= 0;
|
||||
|
||||
RegisterWASAPIInput();
|
||||
RegisterWASAPIOutput();
|
||||
RegisterWASAPIDeviceOutput();
|
||||
if (process_filter_supported)
|
||||
RegisterWASAPIProcessOutput();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user