mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
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:
parent
296e17e3f1
commit
22d8d77b13
2 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue