Skip to content

Commit

Permalink
win-wasapi: Add support for capturing a process
Browse files Browse the repository at this point in the history
  • Loading branch information
jpark37 committed Aug 30, 2021
1 parent 9b6cc99 commit ce3edda
Show file tree
Hide file tree
Showing 3 changed files with 304 additions and 47 deletions.
4 changes: 4 additions & 0 deletions plugins/win-wasapi/data/locale/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ AudioOutput="Audio Output Capture"
Device="Device"
Default="Default"
UseDeviceTiming="Use Device Timestamps"
Method="Method"
Method.Device="Device"
Method.Process="Process (Windows 10 2004 and up)"
ProcessId="Process ID"
14 changes: 14 additions & 0 deletions plugins/win-wasapi/plugin-main.cpp
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -10,8 +12,20 @@ MODULE_EXPORT const char *obs_module_description(void)
void RegisterWASAPIInput();
void RegisterWASAPIOutput();

bool process_filter_supported;

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;
process_filter_supported = win_version_compare(&ver, &minimum) >= 0;

RegisterWASAPIInput();
RegisterWASAPIOutput();
return true;
Expand Down
Loading

0 comments on commit ce3edda

Please sign in to comment.