mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-29 12:25:37 +00:00
d3d11videosink: Always clear back buffer on resize
Swapchain may not need to be resized if the size of backbuffer is equal to the previous size. Then previously rendered frame will be stay on the screen. Do clear back buffer whenever resize() is called Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3342>
This commit is contained in:
parent
c2f58cf2e3
commit
b6309a569a
1 changed files with 5 additions and 0 deletions
|
@ -290,6 +290,8 @@ gst_d3d11_window_on_resize_default (GstD3D11Window * window, guint width,
|
|||
ID3D11Texture2D *backbuffer = NULL;
|
||||
GstVideoRectangle src_rect, dst_rect, rst_rect;
|
||||
IDXGISwapChain *swap_chain;
|
||||
ID3D11DeviceContext *context;
|
||||
const FLOAT clear_color[] = { 0.0, 0.0, 0.0, 1.0 };
|
||||
|
||||
gst_d3d11_device_lock (window->device);
|
||||
if (!window->swap_chain)
|
||||
|
@ -355,6 +357,9 @@ gst_d3d11_window_on_resize_default (GstD3D11Window * window, guint width,
|
|||
goto done;
|
||||
}
|
||||
|
||||
context = gst_d3d11_device_get_device_context_handle (window->device);
|
||||
context->ClearRenderTargetView (window->rtv, clear_color);
|
||||
|
||||
if (window->processor) {
|
||||
D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC pov_desc;
|
||||
|
||||
|
|
Loading…
Reference in a new issue