d3d11videosink: Use pixel aspect ratio to setup window draw area

... instead of calculated display ratio from given PAR and DAR.

d3d11window calculates output display ratio
to decide padding area per window resize event. In the formula,
actual PAR is required to handle both 1:1 PAR and non-1:1 PAR.
This commit is contained in:
Seungha Yang 2019-08-23 13:41:54 +09:00 committed by Sebastian Dröge
parent 296e17e3f1
commit 22d8d77b13
2 changed files with 3 additions and 2 deletions

View file

@ -348,7 +348,8 @@ gst_d3d11_video_sink_set_caps (GstBaseSink * sink, GstCaps * caps)
GST_OBJECT_UNLOCK (self);
if (!gst_d3d11_window_prepare (self->window, GST_VIDEO_SINK_WIDTH (self),
GST_VIDEO_SINK_HEIGHT (self), num, den, self->dxgi_format, caps)) {
GST_VIDEO_SINK_HEIGHT (self), video_par_n, video_par_d,
self->dxgi_format, caps)) {
GST_ERROR_OBJECT (self, "cannot create swapchain");
return FALSE;
}

View file

@ -508,7 +508,7 @@ gst_d3d11_window_on_resize (GstD3D11Device * device, GstD3D11Window * window)
src_ratio = (gdouble) width / height;
dst_ratio =
(gdouble) window->surface_width / window->surface_height * aspect_ratio;
(gdouble) window->surface_width / window->surface_height / aspect_ratio;
src_rect.x = 0;
src_rect.y = 0;