From e97ef8a5629f38a138b956261480eae077c4c5db Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sat, 25 Jan 2020 18:39:52 +0900 Subject: [PATCH] d3d11window_win32: Let DXGI choose client area Don't specify the resolution of backbuffer. Then dxgi will let us know the actual client area. When upstream resolution is chagned, updating the size of backbuffer without the consideration for client size would cause mismatch between them. --- sys/d3d11/gstd3d11window.cpp | 1 - sys/d3d11/gstd3d11window_win32.cpp | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/d3d11/gstd3d11window.cpp b/sys/d3d11/gstd3d11window.cpp index 900916543e..c7e8e48a45 100644 --- a/sys/d3d11/gstd3d11window.cpp +++ b/sys/d3d11/gstd3d11window.cpp @@ -306,7 +306,6 @@ gst_d3d11_window_on_resize (GstD3D11Window * window, guint width, guint height) window->rtv = NULL; } - /* Set zero width and height here. dxgi will decide client area by itself */ swap_chain->GetDesc (&swap_desc); hr = swap_chain->ResizeBuffers (0, width, height, DXGI_FORMAT_UNKNOWN, swap_desc.Flags); diff --git a/sys/d3d11/gstd3d11window_win32.cpp b/sys/d3d11/gstd3d11window_win32.cpp index e9f63024df..565dcb7799 100644 --- a/sys/d3d11/gstd3d11window_win32.cpp +++ b/sys/d3d11/gstd3d11window_win32.cpp @@ -790,7 +790,8 @@ gst_d3d11_window_win32_create_swap_chain (GstD3D11Window * window, *swap_chain = new_swapchain; - gst_d3d11_window_on_resize (window, width, height); + /* Set zero width and height here. dxgi will decide client area by itself */ + gst_d3d11_window_on_resize (window, 0, 0); return TRUE; }