mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-26 07:45:34 +00:00
Handle unsupported IsBorderRequired on Windows 10 causing Native Windows capture failure
This commit is contained in:
@@ -124,7 +124,13 @@ bool WgcSession::initializeWithItem(int fps) {
|
||||
session_ = framePool_.CreateCaptureSession(captureItem_);
|
||||
|
||||
session_.IsCursorCaptureEnabled(false);
|
||||
session_.IsBorderRequired(false);
|
||||
|
||||
// IsBorderRequired is only available on Windows 11+ (build 22000). propagating an hresult_error results in Native Windows capture failure
|
||||
try {
|
||||
session_.IsBorderRequired(false);
|
||||
} catch (winrt::hresult_error const& e) {
|
||||
std::cerr << "WARNING: IsBorderRequired not supported on this OS (hr=0x" << std::hex << static_cast<uint32_t>(e.code()) << ")" << std::endl;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user