Skip to content

Commit adb443f

Browse files
authored
fix(win): Windows.Graphics.Capture API frame rate capped at 60fps (#4424)
1 parent a2e6fc9 commit adb443f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/platform/windows/display_wgc.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,15 @@ namespace platf::dxgi {
137137
} catch (winrt::hresult_error &e) {
138138
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() << ']';
139139
}
140+
try {
141+
if (winrt::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Capture.GraphicsCaptureSession", L"MinUpdateInterval")) {
142+
capture_session.MinUpdateInterval(4ms); // 250Hz
143+
} else {
144+
BOOST_LOG(warning) << "Can't set MinUpdateInterval on this version of Windows";
145+
}
146+
} catch (winrt::hresult_error &e) {
147+
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() << ']';
148+
}
140149
try {
141150
capture_session.StartCapture();
142151
} catch (winrt::hresult_error &e) {

0 commit comments

Comments
 (0)