[vlc-devel] [PATCH 07/18] d3d11: set the video context in the picture context

Steve Lhomme robux4 at ycbcr.xyz
Fri Nov 15 15:51:09 CET 2019


---
 modules/codec/avcodec/d3d11va.c      | 7 ++++---
 modules/hw/d3d11/d3d11_deinterlace.c | 2 +-
 modules/hw/d3d11/d3d11_surface.c     | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 174e2d0d40c..81f9d1a397b 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -170,14 +170,15 @@ static struct d3d11va_pic_context *CreatePicContext(
                                                   ID3D11Resource *p_resource,
                                                   ID3D11DeviceContext *context,
                                                   UINT slice,
-                                                  ID3D11ShaderResourceView *renderSrc[D3D11_MAX_SHADER_VIEW])
+                                                  ID3D11ShaderResourceView *renderSrc[D3D11_MAX_SHADER_VIEW],
+                                                  vlc_video_context *vctx)
 {
     struct d3d11va_pic_context *pic_ctx = calloc(1, sizeof(*pic_ctx));
     if (unlikely(pic_ctx==NULL))
         return NULL;
     pic_ctx->ctx.s = (picture_context_t) {
         d3d11va_pic_context_destroy, d3d11va_pic_context_copy,
-        NULL /*TODO*/
+        vlc_video_context_Hold(vctx),
     };
 
     D3D11_TEXTURE2D_DESC txDesc;
@@ -213,7 +214,7 @@ static picture_context_t* NewSurfacePicContext(vlc_va_t *va, vlc_va_surface_t *v
                                                   p_resource,
                                                   sys->d3d_dev.d3dcontext,
                                                   viewDesc.Texture2D.ArraySlice,
-                                                  resourceView);
+                                                  resourceView, sys->vctx);
     ID3D11Resource_Release(p_resource);
     if (unlikely(pic_ctx==NULL))
         return NULL;
diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c
index 5c58632e59e..606b4a3fdfc 100644
--- a/modules/hw/d3d11/d3d11_deinterlace.c
+++ b/modules/hw/d3d11/d3d11_deinterlace.c
@@ -266,7 +266,7 @@ picture_t *AllocPicture( filter_t *p_filter )
         {
             pic_ctx->s = (picture_context_t) {
                 d3d11_pic_context_destroy, d3d11_pic_context_copy,
-                NULL /*TODO*/
+                vlc_video_context_Hold(p_filter->vctx_in),
             };
             pic_ctx->picsys = *pic_sys;
             AcquireD3D11PictureSys( &pic_ctx->picsys );
diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c
index 93ce6377a27..0a9c2045c33 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -578,7 +578,7 @@ static void NV12_D3D11(filter_t *p_filter, picture_t *src, picture_t *dst)
         {
             pic_ctx->s = (picture_context_t) {
                 d3d11_pic_context_destroy, d3d11_pic_context_copy,
-                NULL /*TODO*/
+                vlc_video_context_Hold(p_filter->vctx_out),
             };
             pic_ctx->picsys = *p_sys;
             AcquireD3D11PictureSys(&pic_ctx->picsys);
-- 
2.17.1



More information about the vlc-devel mailing list