d3d11window: Change aspect-ratio mode from window thread

Call DXGI API from window thread as much as possible
This commit is contained in:
Seungha Yang 2019-12-19 21:47:57 +09:00
parent 187cb02d52
commit 62c8d19e01
2 changed files with 4 additions and 14 deletions

View file

@ -211,10 +211,10 @@ gst_d3d11_window_set_property (GObject * object, guint prop_id,
gboolean force_aspect_ratio;
force_aspect_ratio = g_value_get_boolean (value);
if (force_aspect_ratio != self->force_aspect_ratio)
self->pending_resize = TRUE;
self->force_aspect_ratio = force_aspect_ratio;
if (force_aspect_ratio != self->force_aspect_ratio) {
self->force_aspect_ratio = force_aspect_ratio;
PostMessage (self->internal_win_id, WM_SIZE, 0, 0);
}
break;
}
case PROP_ENABLE_NAVIGATION_EVENTS:
@ -588,8 +588,6 @@ gst_d3d11_window_on_resize (GstD3D11Window * window, gboolean redraw)
window->rtv = NULL;
}
window->pending_resize = FALSE;
/* Set zero width and height here. dxgi will decide client area by itself */
IDXGISwapChain_GetDesc (window->swap_chain, &swap_desc);
hr = IDXGISwapChain_ResizeBuffers (window->swap_chain,
@ -1534,12 +1532,6 @@ gst_d3d11_window_render (GstD3D11Window * window, GstBuffer * buffer,
}
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);
ret = gst_d3d111_window_present (window, buffer);
gst_d3d11_device_unlock (window->device);

View file

@ -111,8 +111,6 @@ struct _GstD3D11Window
GstD3D11Device *device;
gboolean pending_resize;
/* properties */
gboolean force_aspect_ratio;
gboolean enable_navigation_events;