Commit 2c4f2e23 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

D3D: the surface allocated for the pool needs to have the decoder size

in the case of direct rendering picture_CopyPixels is used to transfer from
the decoder to the display and requires the same surface properties

the planes now have the same lines/pixels as the decoder, not just the visible ones

fixes #14531
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 6e0f74e7
......@@ -452,7 +452,7 @@ int CommonUpdatePicture(picture_t *picture, picture_t **fallback,
/* fill in buffer info in first plane */
picture->p->p_pixels = data;
picture->p->i_pitch = pitch;
picture->p->i_lines = picture->format.i_visible_height;
picture->p->i_lines = picture->format.i_height;
/* Fill chroma planes for biplanar YUV */
if (picture->format.i_chroma == VLC_CODEC_NV12 ||
......@@ -464,7 +464,7 @@ int CommonUpdatePicture(picture_t *picture, picture_t **fallback,
p->p_pixels = o->p_pixels + o->i_lines * o->i_pitch;
p->i_pitch = pitch;
p->i_lines = picture->format.i_visible_height;
p->i_lines = picture->format.i_height;
}
/* The dx/d3d buffer is always allocated as NV12 */
if (vlc_fourcc_AreUVPlanesSwapped(picture->format.i_chroma, VLC_CODEC_NV12)) {
......@@ -484,7 +484,7 @@ int CommonUpdatePicture(picture_t *picture, picture_t **fallback,
p->p_pixels = o->p_pixels + o->i_lines * o->i_pitch;
p->i_pitch = pitch / 2;
p->i_lines = picture->format.i_visible_height / 2;
p->i_lines = picture->format.i_height / 2;
}
/* The dx/d3d buffer is always allocated as YV12 */
if (vlc_fourcc_AreUVPlanesSwapped(picture->format.i_chroma, VLC_CODEC_YV12)) {
......
......@@ -1488,8 +1488,8 @@ static int AllocQuad(vout_display_t *vd, const video_format_t *fmt, d3d_quad_t *
D3D11_TEXTURE2D_DESC texDesc;
memset(&texDesc, 0, sizeof(texDesc));
texDesc.Width = fmt->i_visible_width;
texDesc.Height = fmt->i_visible_height;
texDesc.Width = fmt->i_width;
texDesc.Height = fmt->i_height;
texDesc.MipLevels = texDesc.ArraySize = 1;
texDesc.Format = cfg->textureFormat;
texDesc.SampleDesc.Count = 1;
......
......@@ -1032,8 +1032,8 @@ static int Direct3D9CreatePool(vout_display_t *vd, video_format_t *fmt)
/* Create a surface */
LPDIRECT3DSURFACE9 surface;
HRESULT hr = IDirect3DDevice9_CreateOffscreenPlainSurface(d3ddev,
fmt->i_visible_width,
fmt->i_visible_height,
fmt->i_width,
fmt->i_height,
d3dfmt->format,
D3DPOOL_DEFAULT,
&surface,
......@@ -1045,7 +1045,7 @@ static int Direct3D9CreatePool(vout_display_t *vd, video_format_t *fmt)
#ifndef NDEBUG
msg_Dbg(vd, "Direct3D created offscreen surface: %ix%i",
fmt->i_visible_width, fmt->i_visible_height);
fmt->i_width, fmt->i_height);
#endif
/* fill surface with black color */
......@@ -1062,7 +1062,7 @@ static int Direct3D9CreatePool(vout_display_t *vd, video_format_t *fmt)
picture_resource_t resource = { .p_sys = picsys };
for (int i = 0; i < PICTURE_PLANE_MAX; i++)
resource.p[i].i_lines = fmt->i_visible_height / (i > 0 ? 2 : 1);
resource.p[i].i_lines = fmt->i_height / (i > 0 ? 2 : 1);
picture_t *picture = picture_NewFromResource(fmt, &resource);
if (!picture) {
......@@ -1124,8 +1124,8 @@ static int Direct3D9CreateScene(vout_display_t *vd, const video_format_t *fmt)
*/
LPDIRECT3DTEXTURE9 d3dtex;
hr = IDirect3DDevice9_CreateTexture(d3ddev,
fmt->i_visible_width,
fmt->i_visible_height,
fmt->i_width,
fmt->i_height,
1,
D3DUSAGE_RENDERTARGET,
sys->d3dpp.BackBufferFormat,
......@@ -1139,7 +1139,7 @@ static int Direct3D9CreateScene(vout_display_t *vd, const video_format_t *fmt)
#ifndef NDEBUG
msg_Dbg(vd, "Direct3D created texture: %ix%i",
fmt->i_visible_width, fmt->i_visible_height);
fmt->i_width, fmt->i_height);
#endif
/*
......
......@@ -851,8 +851,8 @@ static int DirectXCreateSurface(vout_display_t *vd,
ddsd.dwSize = sizeof(ddsd);
ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
ddsd.dwFlags = DDSD_HEIGHT | DDSD_WIDTH;
ddsd.dwWidth = fmt->i_visible_width;
ddsd.dwHeight = fmt->i_visible_height;
ddsd.dwWidth = fmt->i_width;
ddsd.dwHeight = fmt->i_height;
if (fourcc) {
ddsd.dwFlags |= DDSD_PIXELFORMAT;
ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment