mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
d3d11window: Change aspect-ratio mode from window thread
Call DXGI API from window thread as much as possible
This commit is contained in:
parent
187cb02d52
commit
62c8d19e01
2 changed files with 4 additions and 14 deletions
|
@ -211,10 +211,10 @@ gst_d3d11_window_set_property (GObject * object, guint prop_id,
|
||||||
gboolean force_aspect_ratio;
|
gboolean force_aspect_ratio;
|
||||||
|
|
||||||
force_aspect_ratio = g_value_get_boolean (value);
|
force_aspect_ratio = g_value_get_boolean (value);
|
||||||
if (force_aspect_ratio != self->force_aspect_ratio)
|
if (force_aspect_ratio != self->force_aspect_ratio) {
|
||||||
self->pending_resize = TRUE;
|
self->force_aspect_ratio = force_aspect_ratio;
|
||||||
|
PostMessage (self->internal_win_id, WM_SIZE, 0, 0);
|
||||||
self->force_aspect_ratio = force_aspect_ratio;
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PROP_ENABLE_NAVIGATION_EVENTS:
|
case PROP_ENABLE_NAVIGATION_EVENTS:
|
||||||
|
@ -588,8 +588,6 @@ gst_d3d11_window_on_resize (GstD3D11Window * window, gboolean redraw)
|
||||||
window->rtv = NULL;
|
window->rtv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
window->pending_resize = FALSE;
|
|
||||||
|
|
||||||
/* Set zero width and height here. dxgi will decide client area by itself */
|
/* Set zero width and height here. dxgi will decide client area by itself */
|
||||||
IDXGISwapChain_GetDesc (window->swap_chain, &swap_desc);
|
IDXGISwapChain_GetDesc (window->swap_chain, &swap_desc);
|
||||||
hr = IDXGISwapChain_ResizeBuffers (window->swap_chain,
|
hr = IDXGISwapChain_ResizeBuffers (window->swap_chain,
|
||||||
|
@ -1534,12 +1532,6 @@ gst_d3d11_window_render (GstD3D11Window * window, GstBuffer * buffer,
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&window->lock);
|
g_mutex_unlock (&window->lock);
|
||||||
|
|
||||||
GST_OBJECT_LOCK (window);
|
|
||||||
if (window->pending_resize) {
|
|
||||||
gst_d3d11_window_on_resize (window, FALSE);
|
|
||||||
}
|
|
||||||
GST_OBJECT_UNLOCK (window);
|
|
||||||
|
|
||||||
gst_d3d11_device_lock (window->device);
|
gst_d3d11_device_lock (window->device);
|
||||||
ret = gst_d3d111_window_present (window, buffer);
|
ret = gst_d3d111_window_present (window, buffer);
|
||||||
gst_d3d11_device_unlock (window->device);
|
gst_d3d11_device_unlock (window->device);
|
||||||
|
|
|
@ -111,8 +111,6 @@ struct _GstD3D11Window
|
||||||
|
|
||||||
GstD3D11Device *device;
|
GstD3D11Device *device;
|
||||||
|
|
||||||
gboolean pending_resize;
|
|
||||||
|
|
||||||
/* properties */
|
/* properties */
|
||||||
gboolean force_aspect_ratio;
|
gboolean force_aspect_ratio;
|
||||||
gboolean enable_navigation_events;
|
gboolean enable_navigation_events;
|
||||||
|
|
Loading…
Reference in a new issue