fix(win): Windows.Graphics.Capture API frame rate capped at 60fps (#4424)
This commit is contained in:
parent
a2e6fc9f2a
commit
adb443f0d1
1 changed files with 9 additions and 0 deletions
|
|
@ -137,6 +137,15 @@ namespace platf::dxgi {
|
||||||
} catch (winrt::hresult_error &e) {
|
} catch (winrt::hresult_error &e) {
|
||||||
BOOST_LOG(warning) << "Screen capture may not be fully supported on this device for this release of Windows: failed to disable border around capture area: [0x"sv << util::hex(e.code()).to_string_view() << ']';
|
BOOST_LOG(warning) << "Screen capture may not be fully supported on this device for this release of Windows: failed to disable border around capture area: [0x"sv << util::hex(e.code()).to_string_view() << ']';
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
if (winrt::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Capture.GraphicsCaptureSession", L"MinUpdateInterval")) {
|
||||||
|
capture_session.MinUpdateInterval(4ms); // 250Hz
|
||||||
|
} else {
|
||||||
|
BOOST_LOG(warning) << "Can't set MinUpdateInterval on this version of Windows";
|
||||||
|
}
|
||||||
|
} catch (winrt::hresult_error &e) {
|
||||||
|
BOOST_LOG(warning) << "Screen capture may be capped to 60fps on this device for this release of Windows: failed to set MinUpdateInterval: [0x"sv << util::hex(e.code()).to_string_view() << ']';
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
capture_session.StartCapture();
|
capture_session.StartCapture();
|
||||||
} catch (winrt::hresult_error &e) {
|
} catch (winrt::hresult_error &e) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue