Skip to content

Commit

Permalink
check the availability of Windows Graphics Capture using ApiInfo #26.
Browse files Browse the repository at this point in the history
  • Loading branch information
hecomi committed May 4, 2021
1 parent c5dc39c commit ffb1338
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Binary file modified Assets/uWindowCapture/Plugins/x86/uWindowCapture.dll
Binary file not shown.
Binary file modified Assets/uWindowCapture/Plugins/x86_64/uWindowCapture.dll
Binary file not shown.
17 changes: 16 additions & 1 deletion Plugins/uWindowCapture/uWindowCapture/WindowsGraphicsCapture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,22 @@ bool CallWinRtApiWithExceptionCheck(const std::function<void()> &func, const std

bool WindowsGraphicsCapture::IsSupported()
{
return GraphicsCaptureSession::IsSupported();
using ApiInfo = winrt::Windows::Foundation::Metadata::ApiInformation;

static bool isChecked = false;
static bool isAvailable = false;
if (isChecked) return isAvailable;
isChecked = true;

if (!CallWinRtApiWithExceptionCheck([&]
{
isAvailable = ApiInfo::IsApiContractPresent(L"Windows.Foundation.UniversalApiContract", 8);
}, "WindowsGraphicsCapture::IsSupported()"))
{
return false;
}

return isAvailable;
}


Expand Down

0 comments on commit ffb1338

Please sign in to comment.