UI: Add virtual camera to UI

Adds a virtual camera button to the main user interface.  If virtual
camera is not installed, it will not add the button.  On Windows, it
detects whether the virtual camera filters are properly registered, and
will only add the button if the virtual camera filter is confirmed
registered.

Also adds a virtual camera option to the auto-configuration wizard,
which will just simply set the user's resolution/scale to 1920x1080 at
30 FPS.
This commit is contained in:
jp9000
2020-06-20 07:42:14 -07:00
parent 6377fe3177
commit a72a52fa38
12 changed files with 299 additions and 8 deletions

View File

@@ -1424,6 +1424,40 @@ static bool Update(wchar_t *cmdLine)
}
}
/* ------------------------------------- *
* Install virtual camera */
if (!bIsPortable) {
wchar_t regsvr[MAX_PATH];
wchar_t src[MAX_PATH];
wchar_t tmp[MAX_PATH];
wchar_t tmp2[MAX_PATH];
SHGetFolderPathW(nullptr, CSIDL_SYSTEM, nullptr,
SHGFP_TYPE_CURRENT, regsvr);
StringCbCat(regsvr, sizeof(regsvr), L"\\regsvr32.exe");
GetCurrentDirectoryW(_countof(src), src);
StringCbCat(src, sizeof(src),
L"\\data\\obs-plugins\\win-dshow\\");
StringCbCopy(tmp, sizeof(tmp), L"\"\"");
StringCbCat(tmp, sizeof(tmp), regsvr);
StringCbCat(tmp, sizeof(tmp), L"\" /s \"");
StringCbCat(tmp, sizeof(tmp), src);
StringCbCat(tmp, sizeof(tmp), L"obs-virtualcam-module");
StringCbCopy(tmp2, sizeof(tmp2), tmp);
StringCbCat(tmp2, sizeof(tmp2), L"32.dll\"\"");
_wsystem(tmp2);
if (is_64bit_windows()) {
StringCbCopy(tmp2, sizeof(tmp2), tmp);
StringCbCat(tmp2, sizeof(tmp2), L"64.dll\"\"");
_wsystem(tmp2);
}
}
/* ------------------------------------- *
* Update hook files and vulkan registry */