[vlc-commits] d3d11_fmt: do not use the custom VA_PICSYS anymore

Steve Lhomme git at videolan.org
Tue Oct 8 15:06:51 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Oct  1 10:46:10 2019 +0200| [6705ecda967701e3e8ba386b82a64e9bda96b376] | committer: Steve Lhomme

d3d11_fmt: do not use the custom VA_PICSYS anymore

There is a common common picture context for all D3D11 opaque formats.

d3d11va adds extra data around the picture context to handle the va_surface
refcounting.

We don't use any directy casts from va_pic_context anymore.

Use common picture_context_t callbacks.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6705ecda967701e3e8ba386b82a64e9bda96b376
---

 modules/codec/avcodec/d3d11va.c         | 72 +++++++++++++++++++--------------
 modules/hw/d3d11/d3d11_deinterlace.c    | 40 +++++-------------
 modules/hw/d3d11/d3d11_filters.c        |  5 +--
 modules/hw/d3d11/d3d11_instance.c       |  4 +-
 modules/hw/d3d11/d3d11_surface.c        | 38 ++++-------------
 modules/video_chroma/d3d11_fmt.c        | 27 ++++++++++++-
 modules/video_chroma/d3d11_fmt.h        | 14 +++++++
 modules/video_output/win32/direct3d11.c |  6 +--
 8 files changed, 101 insertions(+), 105 deletions(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 79d32e6f2e..3b4e89c6c0 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -50,8 +50,14 @@
 
 #include "../../video_chroma/d3d11_fmt.h"
 
-typedef picture_sys_d3d11_t VA_PICSYS;
-#include "va_surface.h"
+struct d3d11va_pic_context
+{
+    struct d3d11_pic_context  ctx;
+    struct vlc_va_surface_t   *va_surface;
+};
+
+#define D3D11VA_PICCONTEXT_FROM_PICCTX(pic_ctx)  \
+    container_of((pic_ctx), struct d3d11va_pic_context, ctx.s)
 
 #include "directx_va.h"
 
@@ -145,63 +151,66 @@ static void SetupAVCodecContext(vlc_va_sys_t *sys, unsigned surfaces)
     sys->hw.workaround = sys->selected_decoder->workaround;
 }
 
-static void d3d11_pic_context_destroy(struct picture_context_t *opaque)
+static void d3d11va_pic_context_destroy(picture_context_t *opaque)
 {
-    struct va_pic_context *pic_ctx = (struct va_pic_context*)opaque;
+    struct d3d11va_pic_context *pic_ctx = D3D11VA_PICCONTEXT_FROM_PICCTX(opaque);
     if (pic_ctx->va_surface)
+    {
+        ReleaseD3D11PictureSys(&pic_ctx->ctx.picsys);
         va_surface_Release(pic_ctx->va_surface);
-    ReleaseD3D11PictureSys(&pic_ctx->picsys);
-    free(pic_ctx);
+        free(pic_ctx);
+    }
 }
 
-static struct va_pic_context *CreatePicContext(ID3D11VideoDecoderOutputView *,
+static struct d3d11va_pic_context *CreatePicContext(ID3D11VideoDecoderOutputView *,
                                                ID3D11Resource *,
                                                ID3D11DeviceContext *,
                                                UINT slice,
                                                ID3D11ShaderResourceView *resourceView[D3D11_MAX_SHADER_VIEW]);
 
-static struct picture_context_t *d3d11_pic_context_copy(struct picture_context_t *ctx)
+static picture_context_t *d3d11va_pic_context_copy(picture_context_t *ctx)
 {
-    struct va_pic_context *src_ctx = (struct va_pic_context*)ctx;
-    struct va_pic_context *pic_ctx = CreatePicContext(src_ctx->picsys.decoder,
-                                                      src_ctx->picsys.resource[0], src_ctx->picsys.context,
-                                                      src_ctx->picsys.slice_index, src_ctx->picsys.renderSrc);
+    struct d3d11va_pic_context *src_ctx = D3D11VA_PICCONTEXT_FROM_PICCTX(ctx);
+    struct d3d11va_pic_context *pic_ctx = CreatePicContext(src_ctx->ctx.picsys.decoder,
+                                                      src_ctx->ctx.picsys.resource[0], src_ctx->ctx.picsys.context,
+                                                      src_ctx->ctx.picsys.slice_index, src_ctx->ctx.picsys.renderSrc);
     if (unlikely(pic_ctx==NULL))
         return NULL;
     if (src_ctx->va_surface) {
         pic_ctx->va_surface = src_ctx->va_surface;
         va_surface_AddRef(pic_ctx->va_surface);
     }
-    return &pic_ctx->s;
+    return &pic_ctx->ctx.s;
 }
 
-static struct va_pic_context *CreatePicContext(
+static struct d3d11va_pic_context *CreatePicContext(
                                                   ID3D11VideoDecoderOutputView *decoderSurface,
                                                   ID3D11Resource *p_resource,
                                                   ID3D11DeviceContext *context,
                                                   UINT slice,
                                                   ID3D11ShaderResourceView *renderSrc[D3D11_MAX_SHADER_VIEW])
 {
-    struct va_pic_context *pic_ctx = calloc(1, sizeof(*pic_ctx));
+    struct d3d11va_pic_context *pic_ctx = calloc(1, sizeof(*pic_ctx));
     if (unlikely(pic_ctx==NULL))
         goto done;
-    pic_ctx->s.destroy = d3d11_pic_context_destroy;
-    pic_ctx->s.copy    = d3d11_pic_context_copy;
+    pic_ctx->ctx.s = (picture_context_t) {
+        d3d11va_pic_context_destroy, d3d11va_pic_context_copy,
+    };
 
     D3D11_TEXTURE2D_DESC txDesc;
     ID3D11Texture2D_GetDesc((ID3D11Texture2D*)p_resource, &txDesc);
 
-    pic_ctx->picsys.formatTexture = txDesc.Format;
-    pic_ctx->picsys.context = context;
-    pic_ctx->picsys.slice_index = slice;
-    pic_ctx->picsys.decoder = decoderSurface;
+    pic_ctx->ctx.picsys.formatTexture = txDesc.Format;
+    pic_ctx->ctx.picsys.context = context;
+    pic_ctx->ctx.picsys.slice_index = slice;
+    pic_ctx->ctx.picsys.decoder = decoderSurface;
     for (int i=0;i<D3D11_MAX_SHADER_VIEW; i++)
     {
-        pic_ctx->picsys.resource[i] = p_resource;
-        pic_ctx->picsys.renderSrc[i] = renderSrc[i];
+        pic_ctx->ctx.picsys.resource[i] = p_resource;
+        pic_ctx->ctx.picsys.renderSrc[i] = renderSrc[i];
     }
-    AcquireD3D11PictureSys(&pic_ctx->picsys);
-    pic_ctx->picsys.context = context;
+    AcquireD3D11PictureSys(&pic_ctx->ctx.picsys);
+    pic_ctx->ctx.picsys.context = context;
 done:
     return pic_ctx;
 }
@@ -220,7 +229,7 @@ static picture_context_t* NewSurfacePicContext(vlc_va_t *va, int surface_index,
     for (int i=0; i<D3D11_MAX_SHADER_VIEW; i++)
         resourceView[i] = sys->renderSrc[viewDesc.Texture2D.ArraySlice*D3D11_MAX_SHADER_VIEW + i];
 
-    struct va_pic_context *pic_ctx = CreatePicContext(
+    struct d3d11va_pic_context *pic_ctx = CreatePicContext(
                                                   surface,
                                                   p_resource,
                                                   sys->d3d_dev.d3dcontext,
@@ -232,9 +241,9 @@ static picture_context_t* NewSurfacePicContext(vlc_va_t *va, int surface_index,
     /* all the resources are acquired during surfaces init, and a second time in
      * CreatePicContext(), undo one of them otherwise we need an extra release
      * when the pool is emptied */
-    ReleaseD3D11PictureSys(&pic_ctx->picsys);
+    ReleaseD3D11PictureSys(&pic_ctx->ctx.picsys);
     pic_ctx->va_surface = va_surface;
-    return &pic_ctx->s;
+    return &pic_ctx->ctx.s;
 }
 
 static int Get(vlc_va_t *va, picture_t *pic, uint8_t **data)
@@ -265,14 +274,15 @@ static int Get(vlc_va_t *va, picture_t *pic, uint8_t **data)
                     return VLC_EGENERIC;
             }
 
-            pic->context = (picture_context_t*)CreatePicContext(
+            struct d3d11va_pic_context *pic_ctx = CreatePicContext(
                                              p_sys->decoder,
                                              p_sys->resource[KNOWN_DXGI_INDEX],
                                              sys->d3d_dev.d3dcontext,
                                              p_sys->slice_index,
                                              p_sys->renderSrc );
-            if (pic->context == NULL)
+            if (pic_ctx == NULL)
                 return VLC_EGENERIC;
+            pic->context = &pic_ctx->ctx.s;
         }
     }
     else
@@ -283,7 +293,7 @@ static int Get(vlc_va_t *va, picture_t *pic, uint8_t **data)
             return VLC_ENOITEM;
         pic->context = pic_ctx;
     }
-    *data = (uint8_t*)((struct va_pic_context *)pic->context)->picsys.decoder;
+    *data = (uint8_t*)D3D11VA_PICCONTEXT_FROM_PICCTX(pic->context)->ctx.picsys.decoder;
     return VLC_SUCCESS;
 }
 
diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c
index a2a83a9104..90215efbd7 100644
--- a/modules/hw/d3d11/d3d11_deinterlace.c
+++ b/modules/hw/d3d11/d3d11_deinterlace.c
@@ -39,9 +39,6 @@
 #include "../../video_chroma/d3d11_fmt.h"
 #include "../../video_filter/deinterlace/common.h"
 
-typedef picture_sys_d3d11_t VA_PICSYS;
-#include "../../codec/avcodec/va_surface.h"
-
 typedef struct
 {
     d3d11_handle_t                 hd3d;
@@ -88,7 +85,7 @@ static int RenderPic( filter_t *p_filter, picture_t *p_outpic, picture_t *p_pic,
     VLC_UNUSED(order);
     HRESULT hr;
     filter_sys_t *p_sys = p_filter->p_sys;
-    picture_sys_d3d11_t *p_out_sys = p_outpic->p_sys;
+    picture_sys_d3d11_t *p_out_sys = ActiveD3D11PictureSys(p_outpic);
 
     picture_t *p_prev = p_sys->context.pp_history[0];
     picture_t *p_cur  = p_sys->context.pp_history[1];
@@ -108,17 +105,17 @@ static int RenderPic( filter_t *p_filter, picture_t *p_outpic, picture_t *p_pic,
 
     if( p_cur && p_next )
     {
-        picture_sys_d3d11_t *picsys_next = ActivePictureSys(p_next);
+        picture_sys_d3d11_t *picsys_next = ActiveD3D11PictureSys(p_next);
         if ( unlikely(!picsys_next) || FAILED(D3D11_Assert_ProcessorInput(p_filter, &p_sys->d3d_proc, picsys_next) ))
             return VLC_EGENERIC;
 
-        picture_sys_d3d11_t *picsys_cur = ActivePictureSys(p_cur);
+        picture_sys_d3d11_t *picsys_cur = ActiveD3D11PictureSys(p_cur);
         if ( unlikely(!picsys_cur) || FAILED( D3D11_Assert_ProcessorInput(p_filter, &p_sys->d3d_proc, picsys_cur) ))
             return VLC_EGENERIC;
 
         if ( p_prev )
         {
-            picture_sys_d3d11_t *picsys_prev = ActivePictureSys(p_prev);
+            picture_sys_d3d11_t *picsys_prev = ActiveD3D11PictureSys(p_prev);
             if ( unlikely(!picsys_prev) || FAILED( D3D11_Assert_ProcessorInput(p_filter, &p_sys->d3d_proc, picsys_prev) ))
                 return VLC_EGENERIC;
 
@@ -139,7 +136,7 @@ static int RenderPic( filter_t *p_filter, picture_t *p_outpic, picture_t *p_pic,
     }
     else
     {
-        picture_sys_d3d11_t *p_sys_src = ActivePictureSys(p_pic);
+        picture_sys_d3d11_t *p_sys_src = ActiveD3D11PictureSys(p_pic);
         if ( unlikely(!p_sys_src) || FAILED( D3D11_Assert_ProcessorInput(p_filter, &p_sys->d3d_proc, p_sys_src) ))
             return VLC_EGENERIC;
 
@@ -211,26 +208,6 @@ static const struct filter_mode_t *GetFilterMode(const char *mode)
     return NULL;
 }
 
-static void d3d11_pic_context_destroy(struct picture_context_t *opaque)
-{
-    struct va_pic_context *pic_ctx = (struct va_pic_context*)opaque;
-    ReleaseD3D11PictureSys(&pic_ctx->picsys);
-    free(pic_ctx);
-}
-
-static struct picture_context_t *d3d11_pic_context_copy(struct picture_context_t *ctx)
-{
-    struct va_pic_context *src_ctx = (struct va_pic_context*)ctx;
-    struct va_pic_context *pic_ctx = calloc(1, sizeof(*pic_ctx));
-    if (unlikely(pic_ctx==NULL))
-        return NULL;
-    pic_ctx->s.destroy = d3d11_pic_context_destroy;
-    pic_ctx->s.copy    = d3d11_pic_context_copy;
-    pic_ctx->picsys = src_ctx->picsys;
-    AcquireD3D11PictureSys(&pic_ctx->picsys);
-    return &pic_ctx->s;
-}
-
 picture_t *AllocPicture( filter_t *p_filter )
 {
     filter_sys_t *p_sys = p_filter->p_sys;
@@ -284,11 +261,12 @@ picture_t *AllocPicture( filter_t *p_filter )
 
         }
         /* the picture might be duplicated for snapshots so it needs a context */
-        struct va_pic_context *pic_ctx = calloc(1, sizeof(*pic_ctx));
+        struct d3d11_pic_context *pic_ctx = calloc(1, sizeof(*pic_ctx));
         if (likely(pic_ctx!=NULL))
         {
-            pic_ctx->s.destroy = d3d11_pic_context_destroy;
-            pic_ctx->s.copy    = d3d11_pic_context_copy;
+            pic_ctx->s = (picture_context_t) {
+                d3d11_pic_context_destroy, d3d11_pic_context_copy,
+            };
             pic_ctx->picsys = *pic_sys;
             AcquireD3D11PictureSys( &pic_ctx->picsys );
             pic->context = &pic_ctx->s;
diff --git a/modules/hw/d3d11/d3d11_filters.c b/modules/hw/d3d11/d3d11_filters.c
index 233b78c649..7857628639 100644
--- a/modules/hw/d3d11/d3d11_filters.c
+++ b/modules/hw/d3d11/d3d11_filters.c
@@ -42,9 +42,6 @@
 #include "d3d11_processor.h"
 #include "../../video_chroma/d3d11_fmt.h"
 
-typedef picture_sys_d3d11_t VA_PICSYS;
-#include "../../codec/avcodec/va_surface.h"
-
 #ifdef __MINGW32__
 #define D3D11_VIDEO_PROCESSOR_FILTER_CAPS_BRIGHTNESS   0x1
 #define D3D11_VIDEO_PROCESSOR_FILTER_CAPS_CONTRAST     0x2
@@ -197,7 +194,7 @@ static picture_t *Filter(filter_t *p_filter, picture_t *p_pic)
 {
     filter_sys_t *p_sys = p_filter->p_sys;
 
-    picture_sys_d3d11_t *p_src_sys = ActivePictureSys(p_pic);
+    picture_sys_d3d11_t *p_src_sys = ActiveD3D11PictureSys(p_pic);
     if (FAILED( D3D11_Assert_ProcessorInput(p_filter, &p_sys->d3d_proc, p_src_sys) ))
     {
         picture_Release( p_pic );
diff --git a/modules/hw/d3d11/d3d11_instance.c b/modules/hw/d3d11/d3d11_instance.c
index f751f98938..e27a7a3790 100644
--- a/modules/hw/d3d11/d3d11_instance.c
+++ b/modules/hw/d3d11/d3d11_instance.c
@@ -33,8 +33,6 @@
 #include <d3d11.h>
 
 #include "d3d11_filters.h"
-typedef picture_sys_d3d11_t VA_PICSYS;
-#include "../../codec/avcodec/va_surface.h"
 
 static vlc_mutex_t inst_lock = VLC_STATIC_MUTEX;
 static d3d11_device_t device = { .context_mutex = INVALID_HANDLE_VALUE };
@@ -47,7 +45,7 @@ void D3D11_FilterHoldInstance(filter_t *filter, d3d11_device_t *out, D3D11_TEXTU
     if (!pic)
         return;
 
-    picture_sys_d3d11_t *p_sys = ActivePictureSys(pic);
+    picture_sys_d3d11_t *p_sys = ActiveD3D11PictureSys(pic);
 
     vlc_mutex_lock(&inst_lock);
     if (p_sys)
diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c
index a1d9cbc10f..132a9cab33 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -45,9 +45,6 @@
 #include "d3d11_processor.h"
 #include "../../video_chroma/d3d11_fmt.h"
 
-typedef picture_sys_d3d11_t VA_PICSYS;
-#include "../../codec/avcodec/va_surface.h"
-
 #ifdef ID3D11VideoContext_VideoProcessorBlt
 #define CAN_PROCESSOR 1
 #else
@@ -238,7 +235,7 @@ static void D3D11_YUY2(filter_t *p_filter, picture_t *src, picture_t *dst)
     }
 
     filter_sys_t *sys = p_filter->p_sys;
-    picture_sys_d3d11_t *p_sys = &((struct va_pic_context*)src->context)->picsys;
+    picture_sys_d3d11_t *p_sys = ActiveD3D11PictureSys(src);
 
     D3D11_TEXTURE2D_DESC desc;
     D3D11_MAPPED_SUBRESOURCE lock;
@@ -367,7 +364,7 @@ static void D3D11_NV12(filter_t *p_filter, picture_t *src, picture_t *dst)
     }
 
     filter_sys_t *sys = p_filter->p_sys;
-    picture_sys_d3d11_t *p_sys = &((struct va_pic_context*)src->context)->picsys;
+    picture_sys_d3d11_t *p_sys = ActiveD3D11PictureSys(src);
 
     D3D11_TEXTURE2D_DESC desc;
     D3D11_MAPPED_SUBRESOURCE lock;
@@ -457,7 +454,7 @@ static void D3D11_RGBA(filter_t *p_filter, picture_t *src, picture_t *dst)
 {
     filter_sys_t *sys = p_filter->p_sys;
     assert(src->context != NULL);
-    picture_sys_d3d11_t *p_sys = &((struct va_pic_context*)src->context)->picsys;
+    picture_sys_d3d11_t *p_sys = ActiveD3D11PictureSys(src);
 
     D3D11_TEXTURE2D_DESC desc;
     D3D11_MAPPED_SUBRESOURCE lock;
@@ -551,30 +548,10 @@ static filter_t *CreateCPUtoGPUFilter( vlc_object_t *p_this, const es_format_t *
     return p_filter;
 }
 
-static void d3d11_pic_context_destroy(struct picture_context_t *opaque)
-{
-    struct va_pic_context *pic_ctx = (struct va_pic_context*)opaque;
-    ReleaseD3D11PictureSys(&pic_ctx->picsys);
-    free(pic_ctx);
-}
-
-static struct picture_context_t *d3d11_pic_context_copy(struct picture_context_t *ctx)
-{
-    struct va_pic_context *src_ctx = (struct va_pic_context*)ctx;
-    struct va_pic_context *pic_ctx = calloc(1, sizeof(*pic_ctx));
-    if (unlikely(pic_ctx==NULL))
-        return NULL;
-    pic_ctx->s.destroy = d3d11_pic_context_destroy;
-    pic_ctx->s.copy    = d3d11_pic_context_copy;
-    pic_ctx->picsys = src_ctx->picsys;
-    AcquireD3D11PictureSys(&pic_ctx->picsys);
-    return &pic_ctx->s;
-}
-
 static void NV12_D3D11(filter_t *p_filter, picture_t *src, picture_t *dst)
 {
     filter_sys_t *sys = p_filter->p_sys;
-    picture_sys_d3d11_t *p_sys = dst->p_sys;
+    picture_sys_d3d11_t *p_sys = ActiveD3D11PictureSys(dst);
     if (unlikely(p_sys==NULL))
     {
         /* the output filter configuration may have changed since the filter
@@ -613,11 +590,12 @@ static void NV12_D3D11(filter_t *p_filter, picture_t *src, picture_t *dst)
                                               &copyBox);
     if (dst->context == NULL)
     {
-        struct va_pic_context *pic_ctx = calloc(1, sizeof(*pic_ctx));
+        struct d3d11_pic_context *pic_ctx = calloc(1, sizeof(*pic_ctx));
         if (likely(pic_ctx))
         {
-            pic_ctx->s.destroy = d3d11_pic_context_destroy;
-            pic_ctx->s.copy    = d3d11_pic_context_copy;
+            pic_ctx->s = (picture_context_t) {
+                d3d11_pic_context_destroy, d3d11_pic_context_copy,
+            };
             pic_ctx->picsys = *p_sys;
             AcquireD3D11PictureSys(&pic_ctx->picsys);
             dst->context = &pic_ctx->s;
diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c
index f2157e94d4..542149002d 100644
--- a/modules/video_chroma/d3d11_fmt.c
+++ b/modules/video_chroma/d3d11_fmt.c
@@ -38,8 +38,14 @@
 
 #include "d3d11_fmt.h"
 
-typedef picture_sys_d3d11_t VA_PICSYS;
-#include "../codec/avcodec/va_surface.h"
+picture_sys_d3d11_t *ActiveD3D11PictureSys(picture_t *pic)
+{
+    if (unlikely(pic->context == NULL))
+        return pic->p_sys;
+
+    struct d3d11_pic_context *pic_ctx = D3D11_PICCONTEXT_FROM_PICCTX(pic->context);
+    return &pic_ctx->picsys;
+}
 
 void AcquireD3D11PictureSys(picture_sys_d3d11_t *p_sys)
 {
@@ -785,3 +791,20 @@ void D3D11_Destroy(d3d11_handle_t *hd3d)
 #endif
 #endif
 }
+
+void d3d11_pic_context_destroy(picture_context_t *ctx)
+{
+    struct d3d11_pic_context *pic_ctx = D3D11_PICCONTEXT_FROM_PICCTX(ctx);
+    ReleaseD3D11PictureSys(&pic_ctx->picsys);
+    free(pic_ctx);
+}
+
+picture_context_t *d3d11_pic_context_copy(picture_context_t *ctx)
+{
+    struct d3d11_pic_context *pic_ctx = calloc(1, sizeof(*pic_ctx));
+    if (unlikely(pic_ctx==NULL))
+        return NULL;
+    *pic_ctx = *D3D11_PICCONTEXT_FROM_PICCTX(ctx);
+    AcquireD3D11PictureSys(&pic_ctx->picsys);
+    return &pic_ctx->s;
+}
diff --git a/modules/video_chroma/d3d11_fmt.h b/modules/video_chroma/d3d11_fmt.h
index 8afe82bd80..d9b661ddce 100644
--- a/modules/video_chroma/d3d11_fmt.h
+++ b/modules/video_chroma/d3d11_fmt.h
@@ -81,6 +81,12 @@ typedef struct
     DXGI_FORMAT                   formatTexture;
 } picture_sys_d3d11_t;
 
+struct d3d11_pic_context
+{
+    picture_context_t         s;
+    picture_sys_d3d11_t       picsys;
+};
+
 typedef struct
 {
     ID3D11DeviceContext *device;
@@ -98,6 +104,11 @@ static inline bool is_d3d11_opaque(vlc_fourcc_t chroma)
            chroma == VLC_CODEC_D3D11_OPAQUE_BGRA;
 }
 
+#define D3D11_PICCONTEXT_FROM_PICCTX(pic_ctx)  \
+    container_of((pic_ctx), struct d3d11_pic_context, s)
+
+picture_sys_d3d11_t *ActiveD3D11PictureSys(picture_t *);
+
 static inline d3d11_decoder_device_t *GetD3D11OpaqueDevice(vlc_decoder_device *device)
 {
     if (device == NULL || device->type != VLC_DECODER_DEVICE_D3D11VA)
@@ -191,4 +202,7 @@ static inline void d3d11_device_unlock(d3d11_device_t *d3d_dev)
         ReleaseMutex( d3d_dev->context_mutex );
 }
 
+void d3d11_pic_context_destroy(picture_context_t *);
+picture_context_t *d3d11_pic_context_copy(picture_context_t *);
+
 #endif /* include-guard */
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 853ad742c7..803d2ee463 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -51,8 +51,6 @@
 # include <windows.ui.xaml.media.dxinterop.h> */
 
 #include "../../video_chroma/d3d11_fmt.h"
-typedef picture_sys_d3d11_t VA_PICSYS;
-#include "../../codec/avcodec/va_surface.h"
 
 #include "d3d11_quad.h"
 #include "d3d11_shaders.h"
@@ -689,7 +687,7 @@ static void PreparePicture(vout_display_t *vd, picture_t *picture, subpicture_t
     }
     else
     {
-        picture_sys_d3d11_t *p_sys = ActivePictureSys(picture);
+        picture_sys_d3d11_t *p_sys = ActiveD3D11PictureSys(picture);
 
         d3d11_device_lock( &sys->d3d_dev );
 
@@ -753,7 +751,7 @@ static void PreparePicture(vout_display_t *vd, picture_t *picture, subpicture_t
     if (!is_d3d11_opaque(picture->format.i_chroma) || sys->legacy_shader)
         renderSrc = sys->stagingSys.renderSrc;
     else {
-        picture_sys_d3d11_t *p_sys = ActivePictureSys(picture);
+        picture_sys_d3d11_t *p_sys = ActiveD3D11PictureSys(picture);
         renderSrc = p_sys->renderSrc;
     }
     D3D11_RenderQuad(&sys->d3d_dev, &sys->picQuad,



More information about the vlc-commits mailing list