d3d11screencapturesrc: Fix HWND capture mode

Use per-monitor-aware context to cover different DPI settings per
monitor

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2425
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5485>
This commit is contained in:
Seungha Yang 2023-10-16 00:59:59 +09:00
parent 66bb9ee866
commit e2790d635c

View file

@ -697,7 +697,7 @@ gst_d3d11_winrt_capture_thread_func (GstD3D11WinRTCapture * self)
#endif
winrt_vtable.SetThreadDpiAwarenessContext
(DPI_AWARENESS_CONTEXT_SYSTEM_AWARE);
(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE);
QueryPerformanceFrequency (&self->frequency);
@ -997,7 +997,7 @@ again:
BOOL ret;
prev = winrt_vtable.SetThreadDpiAwarenessContext
(DPI_AWARENESS_CONTEXT_SYSTEM_AWARE);
(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE);
ret = GetClientRect (self->window_handle, &client_rect) &&
DwmGetWindowAttribute (self->window_handle,
DWMWA_EXTENDED_FRAME_BOUNDS, &bound_rect, sizeof (RECT)) == S_OK &&