[vlc-commits] d3d11: clean accesses to the picture_sys_d3d11_t

Steve Lhomme git at videolan.org
Fri Dec 13 10:13:02 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Dec 11 11:41:35 2019 +0100| [dae74a9183ff21e43e7b581366ba1fefc441df6b] | committer: Steve Lhomme

d3d11: clean accesses to the picture_sys_d3d11_t

We should not have to store the "p_sys" of the picture, it's always part of the
video context.

Don't use picture_NewFromResource() since we don't provide pixel resources.

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

 modules/hw/d3d11/d3d11_deinterlace.c |  3 +--
 modules/hw/d3d11/d3d11_filters.c     |  5 ++---
 modules/hw/d3d11/d3d11_surface.c     | 10 +++-------
 3 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c
index aea94749ce..e5e358e26b 100644
--- a/modules/hw/d3d11/d3d11_deinterlace.c
+++ b/modules/hw/d3d11/d3d11_deinterlace.c
@@ -233,8 +233,7 @@ picture_t *AllocPicture( filter_t *p_filter )
     if (unlikely(pic_ctx == NULL))
         return NULL;
 
-    picture_resource_t res = {};
-    picture_t *pic = picture_NewFromResource( &p_filter->fmt_out.video, &res );
+    picture_t *pic = picture_NewFromFormat( &p_filter->fmt_out.video );
     if (unlikely(pic == NULL))
     {
         free(pic_ctx);
diff --git a/modules/hw/d3d11/d3d11_filters.c b/modules/hw/d3d11/d3d11_filters.c
index 672322c470..892c8df165 100644
--- a/modules/hw/d3d11/d3d11_filters.c
+++ b/modules/hw/d3d11/d3d11_filters.c
@@ -213,8 +213,7 @@ static picture_t *AllocPicture( filter_t *p_filter )
     if (unlikely(pic_ctx == NULL))
         return NULL;
 
-    picture_resource_t res = {};
-    picture_t *pic = picture_NewFromResource( &p_filter->fmt_out.video, &res );
+    picture_t *pic = picture_NewFromFormat( &p_filter->fmt_out.video );
     if (unlikely(pic == NULL))
     {
         free(pic_ctx);
@@ -257,7 +256,7 @@ static picture_t *Filter(filter_t *p_filter, picture_t *p_pic)
         picture_Release( p_pic );
         return NULL;
     }
-    picture_sys_d3d11_t *p_out_sys = p_outpic->p_sys;
+    picture_sys_d3d11_t *p_out_sys = ActiveD3D11PictureSys(p_outpic);
     if (unlikely(!p_out_sys))
     {
         /* the output filter configuration may have changed since the filter
diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c
index d922ff0080..8b62663b74 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -632,14 +632,10 @@ static picture_t *AllocateCPUtoGPUTexture(filter_t *p_filter)
     if (unlikely(pic_ctx == NULL))
         goto done;
 
-    picture_resource_t res = {};
-    picture_sys_d3d11_t *res_sys = &pic_ctx->picsys;
-    res.p_sys = res_sys;
-
     video_format_Copy(&fmt_staging, &p_filter->fmt_out.video);
     fmt_staging.i_chroma = cfg->fourcc;
 
-    picture_t *p_dst = picture_NewFromResource(&fmt_staging, &res);
+    picture_t *p_dst = picture_NewFromFormat(&fmt_staging);
     if (p_dst == NULL) {
         msg_Err(p_filter, "Failed to map create the temporary picture.");
         goto done;
@@ -658,8 +654,8 @@ static picture_t *AllocateCPUtoGPUTexture(filter_t *p_filter)
         d3d11_pic_context_destroy, d3d11_pic_context_copy,
         vlc_video_context_Hold(p_filter->vctx_out),
     };
-    AcquireD3D11PictureSys(res_sys);
-    ID3D11Texture2D_Release(res_sys->texture[KNOWN_DXGI_INDEX]);
+    AcquireD3D11PictureSys(&pic_ctx->picsys);
+    ID3D11Texture2D_Release(pic_ctx->picsys.texture[KNOWN_DXGI_INDEX]);
 
     p_dst->context = &pic_ctx->s;
 



More information about the vlc-commits mailing list