From 478fb29974dec7595c5db50e45655e8121cd4ad7 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Wed, 5 Feb 2020 22:12:15 +0900 Subject: [PATCH] d3d11window: Clear cached buffer per new caps d3d11window holds one buffer to redraw client area per resize event. When the input format is being changed, this buffer should be cleared to avoid mismatch beween newly configured shader/videoprocessor and the format of previously cached buffer. --- sys/d3d11/gstd3d11window.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/d3d11/gstd3d11window.cpp b/sys/d3d11/gstd3d11window.cpp index d64d9e2c9b..8d11375eab 100644 --- a/sys/d3d11/gstd3d11window.cpp +++ b/sys/d3d11/gstd3d11window.cpp @@ -443,6 +443,8 @@ gst_d3d11_window_prepare (GstD3D11Window * window, guint width, guint height, GST_DEBUG_OBJECT (window, "Prepare window with %dx%d caps %" GST_PTR_FORMAT, width, height, caps); + gst_clear_buffer (&window->cached_buffer); + render_caps = gst_d3d11_device_get_supported_caps (window->device, (D3D11_FORMAT_SUPPORT) (D3D11_FORMAT_SUPPORT_TEXTURE2D | D3D11_FORMAT_SUPPORT_DISPLAY));