summaryrefslogtreecommitdiffstats
path: root/video/decode
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-05-04 01:13:03 +0200
committerwm4 <wm4@nowhere>2017-05-04 01:13:03 +0200
commit1143f2877a70c8aa3f0b44e746360215e470dd56 (patch)
tree02715c99c0a26dc7bdec742bcab1b65424e4e5fd /video/decode
parent19bf3a72ff3fd36fbd2443f27e453d6e82b4dd2f (diff)
downloadmpv-1143f2877a70c8aa3f0b44e746360215e470dd56.tar.bz2
mpv-1143f2877a70c8aa3f0b44e746360215e470dd56.tar.xz
d3d11: change mp_image plane pointer semantics
Until now, the texture pointer was stored in plane 1, and the texture array index was in plane 2. Move this down to plane 0 and plane 1. This is to align it to the new WIP D3D11 decoding API in Libav, where we decided that there is no reason to avoid setting plane 0, and that it would be less weird to start at plane 0.
Diffstat (limited to 'video/decode')
-rw-r--r--video/decode/d3d.c4
-rw-r--r--video/decode/hw_d3d11va.c12
2 files changed, 8 insertions, 8 deletions
diff --git a/video/decode/d3d.c b/video/decode/d3d.c
index d2c2c9745b..abe8034b60 100644
--- a/video/decode/d3d.c
+++ b/video/decode/d3d.c
@@ -301,8 +301,8 @@ struct mp_image *d3d11_download_image(struct mp_hwdec_ctx *ctx,
if (mpi->imgfmt != IMGFMT_D3D11VA && mpi->imgfmt != IMGFMT_D3D11NV12)
return NULL;
- ID3D11Texture2D *texture = (void *)mpi->planes[1];
- int subindex = (intptr_t)mpi->planes[2];
+ ID3D11Texture2D *texture = (void *)mpi->planes[0];
+ int subindex = (intptr_t)mpi->planes[1];
if (!texture)
return NULL;
diff --git a/video/decode/hw_d3d11va.c b/video/decode/hw_d3d11va.c
index 1eab4b5e0b..bb59034ab0 100644
--- a/video/decode/hw_d3d11va.c
+++ b/video/decode/hw_d3d11va.c
@@ -87,9 +87,9 @@ static struct mp_image *d3d11va_new_ref(ID3D11VideoDecoderOutputView *view,
mp_image_setfmt(mpi, IMGFMT_D3D11VA);
mp_image_set_size(mpi, w, h);
- mpi->planes[0] = NULL;
- mpi->planes[1] = (void *)surface->texture;
- mpi->planes[2] = (void *)(intptr_t)surface_desc.Texture2D.ArraySlice;
+ mpi->planes[0] = (void *)surface->texture;
+ mpi->planes[1] = (void *)(intptr_t)surface_desc.Texture2D.ArraySlice;
+ mpi->planes[2] = NULL;
mpi->planes[3] = (void *)surface->surface;
return mpi;
@@ -115,8 +115,8 @@ static struct mp_image *d3d11va_retrieve_image(struct lavc_ctx *s,
if (img->imgfmt != IMGFMT_D3D11VA)
return img;
- ID3D11Texture2D *texture = (void *)img->planes[1];
- int subindex = (intptr_t)img->planes[2];
+ ID3D11Texture2D *texture = (void *)img->planes[0];
+ int subindex = (intptr_t)img->planes[1];
if (!texture) {
MP_ERR(p, "Failed to get Direct3D texture and surface from mp_image\n");
@@ -178,7 +178,7 @@ static const struct d3d_decoded_format d3d11_formats[] = {
static struct mp_image *d3d11va_update_image_attribs(struct lavc_ctx *s,
struct mp_image *img)
{
- ID3D11Texture2D *texture = (void *)img->planes[1];
+ ID3D11Texture2D *texture = (void *)img->planes[0];
if (!texture)
return img;