mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 08:17:01 +00:00
d3d11window: Initialize surface rect with given external window handle
Unlike internal window, resize event might not happen with external window.
This commit is contained in:
parent
a8ec409b84
commit
a400126889
1 changed files with 13 additions and 2 deletions
|
@ -1104,8 +1104,19 @@ gst_d3d11_window_prepare (GstD3D11Window * window, guint width, guint height,
|
||||||
window->render_rect.w = width;
|
window->render_rect.w = width;
|
||||||
window->render_rect.h = height;
|
window->render_rect.h = height;
|
||||||
|
|
||||||
desc.BufferDesc.Width = window->width = window->surface_width = width;
|
if (window->external_win_id) {
|
||||||
desc.BufferDesc.Height = window->height = window->surface_height = height;
|
RECT client_rect = { 0, };
|
||||||
|
GetClientRect (window->external_win_id, &client_rect);
|
||||||
|
|
||||||
|
window->surface_width = client_rect.right - client_rect.left;
|
||||||
|
window->surface_height = client_rect.bottom - client_rect.top;
|
||||||
|
} else {
|
||||||
|
window->surface_width = width;
|
||||||
|
window->surface_height = height;
|
||||||
|
}
|
||||||
|
|
||||||
|
desc.BufferDesc.Width = window->width = window->surface_width;
|
||||||
|
desc.BufferDesc.Height = window->height = window->surface_height;
|
||||||
/* don't care refresh rate */
|
/* don't care refresh rate */
|
||||||
desc.BufferDesc.RefreshRate.Numerator = 0;
|
desc.BufferDesc.RefreshRate.Numerator = 0;
|
||||||
desc.BufferDesc.RefreshRate.Denominator = 1;
|
desc.BufferDesc.RefreshRate.Denominator = 1;
|
||||||
|
|
Loading…
Reference in a new issue