[vlc-devel] [PATCH 08/18] d3d9: set the video context in the picture context

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


---
 modules/codec/avcodec/dxva2.c       | 6 +++---
 modules/hw/d3d9/dxa9.c              | 2 +-
 modules/hw/d3d9/dxva2_deinterlace.c | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index 62b14476e43..f4eac3cd218 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -183,14 +183,14 @@ static picture_context_t *dxva2_pic_context_copy(picture_context_t *ctx)
     return &pic_ctx->ctx.s;
 }
 
-static struct dxva2_pic_context *CreatePicContext(IDirect3DSurface9 *surface)
+static struct dxva2_pic_context *CreatePicContext(IDirect3DSurface9 *surface, vlc_video_context *vctx)
 {
     struct dxva2_pic_context *pic_ctx = calloc(1, sizeof(*pic_ctx));
     if (unlikely(pic_ctx==NULL))
         return NULL;
     pic_ctx->ctx.s = (picture_context_t) {
         dxva2_pic_context_destroy, dxva2_pic_context_copy,
-        NULL /*TODO*/
+        vlc_video_context_Hold(vctx),
     };
     pic_ctx->ctx.picsys.surface = surface;
     AcquireD3D9PictureSys(&pic_ctx->ctx.picsys);
@@ -200,7 +200,7 @@ static struct dxva2_pic_context *CreatePicContext(IDirect3DSurface9 *surface)
 static picture_context_t* NewSurfacePicContext(vlc_va_t *va, vlc_va_surface_t *va_surface)
 {
     vlc_va_sys_t *sys = va->sys;
-    struct dxva2_pic_context *pic_ctx = CreatePicContext(sys->hw_surface[va_surface_GetIndex(va_surface)]);
+    struct dxva2_pic_context *pic_ctx = CreatePicContext(sys->hw_surface[va_surface_GetIndex(va_surface)], sys->vctx);
     if (unlikely(pic_ctx==NULL))
         return NULL;
     pic_ctx->va_surface = va_surface;
diff --git a/modules/hw/d3d9/dxa9.c b/modules/hw/d3d9/dxa9.c
index 4f1ea9708bb..60570a3c22e 100644
--- a/modules/hw/d3d9/dxa9.c
+++ b/modules/hw/d3d9/dxa9.c
@@ -265,7 +265,7 @@ static void YV12_D3D9(filter_t *p_filter, picture_t *src, picture_t *dst)
         {
             pic_ctx->s = (picture_context_t) {
                 d3d9_pic_context_destroy, d3d9_pic_context_copy,
-                NULL /*TODO*/
+                vlc_video_context_Hold(p_filter->vctx_out),
             };
             pic_ctx->picsys = *p_sys;
             AcquireD3D9PictureSys(&pic_ctx->picsys);
diff --git a/modules/hw/d3d9/dxva2_deinterlace.c b/modules/hw/d3d9/dxva2_deinterlace.c
index 48b59a23369..164a4bd36d6 100644
--- a/modules/hw/d3d9/dxva2_deinterlace.c
+++ b/modules/hw/d3d9/dxva2_deinterlace.c
@@ -326,7 +326,7 @@ picture_t *AllocPicture( filter_t *p_filter )
         {
             pic_ctx->s = (picture_context_t) {
                 d3d9_pic_context_destroy, d3d9_pic_context_copy,
-                NULL /*TODO*/
+                vlc_video_context_Hold(p_filter->vctx_in),
             };
             pic_ctx->picsys = *pic_sys;
             AcquireD3D9PictureSys( &pic_ctx->picsys );
-- 
2.17.1



More information about the vlc-devel mailing list