[vlc-commits] D3D: the surface allocated for the pool needs to have the decoder size
Steve Lhomme
git at videolan.org
Wed Sep 9 14:50:11 CEST 2015
vlc | branch: master | Steve Lhomme <robux4 at gmail.com> | Wed Sep 9 14:32:04 2015 +0200| [b5fe304027868c9930b3b42c77d5ba43e8e13b17] | committer: 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 <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b5fe304027868c9930b3b42c77d5ba43e8e13b17
---
modules/video_output/msw/common.c | 6 +++---
modules/video_output/msw/direct3d11.c | 4 ++--
modules/video_output/msw/direct3d9.c | 14 +++++++-------
modules/video_output/msw/directdraw.c | 4 ++--
4 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/modules/video_output/msw/common.c b/modules/video_output/msw/common.c
index 1f9ee0b..e60a639 100644
--- a/modules/video_output/msw/common.c
+++ b/modules/video_output/msw/common.c
@@ -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)) {
diff --git a/modules/video_output/msw/direct3d11.c b/modules/video_output/msw/direct3d11.c
index 8185ab0..11441b3 100644
--- a/modules/video_output/msw/direct3d11.c
+++ b/modules/video_output/msw/direct3d11.c
@@ -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 = i_width;
+ texDesc.Height = i_height;
texDesc.MipLevels = texDesc.ArraySize = 1;
texDesc.Format = cfg->textureFormat;
texDesc.SampleDesc.Count = 1;
diff --git a/modules/video_output/msw/direct3d9.c b/modules/video_output/msw/direct3d9.c
index 2f5d2a9..d9fb2f7 100644
--- a/modules/video_output/msw/direct3d9.c
+++ b/modules/video_output/msw/direct3d9.c
@@ -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
/*
diff --git a/modules/video_output/msw/directdraw.c b/modules/video_output/msw/directdraw.c
index cee7d47..db06565 100644
--- a/modules/video_output/msw/directdraw.c
+++ b/modules/video_output/msw/directdraw.c
@@ -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;
More information about the vlc-commits
mailing list