[vlc-commits] dxva: pass the va object to the device destroy callback

Steve Lhomme git at videolan.org
Mon Sep 2 15:43:09 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Sep  2 08:38:08 2019 +0200| [6e82ec2fa0bad4e5bfcd0aa5b966d093780c5fae] | committer: Steve Lhomme

dxva: pass the va object to the device destroy callback

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

 modules/codec/avcodec/d3d11va.c             | 5 +++--
 modules/codec/avcodec/dxva2.c               | 5 +++--
 modules/codec/avcodec/va_surface.c          | 2 +-
 modules/codec/avcodec/va_surface_internal.h | 2 +-
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 80311d27d4..a607628bba 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -126,7 +126,7 @@ struct vlc_va_sys_t
 
 /* */
 static int D3dCreateDevice(vlc_va_t *);
-static void D3dDestroyDevice(vlc_va_sys_t *);
+static void D3dDestroyDevice(vlc_va_t *);
 
 static int DxCreateVideoService(vlc_va_t *);
 static void DxDestroyVideoService(vlc_va_t *);
@@ -471,8 +471,9 @@ static int D3dCreateDevice(vlc_va_t *va)
 /**
  * It releases a Direct3D device and its resources.
  */
-static void D3dDestroyDevice(vlc_va_sys_t *sys)
+static void D3dDestroyDevice(vlc_va_t *va)
 {
+    vlc_va_sys_t *sys = va->sys;
     if (sys->d3dvidctx)
         ID3D11VideoContext_Release(sys->d3dvidctx);
     D3D11_ReleaseDevice( &sys->d3d_dev );
diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index 8257fce703..db2d0076f1 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -135,7 +135,7 @@ struct vlc_va_sys_t
 
 /* */
 static int D3dCreateDevice(vlc_va_t *);
-static void D3dDestroyDevice(vlc_va_sys_t *);
+static void D3dDestroyDevice(vlc_va_t *);
 
 static int D3dCreateDeviceManager(vlc_va_t *);
 static void D3dDestroyDeviceManager(vlc_va_t *);
@@ -373,8 +373,9 @@ static int D3dCreateDevice(vlc_va_t *va)
 /**
  * It releases a Direct3D device and its resources.
  */
-static void D3dDestroyDevice(vlc_va_sys_t *sys)
+static void D3dDestroyDevice(vlc_va_t *va)
 {
+    vlc_va_sys_t *sys = va->sys;
     D3D9_ReleaseDevice(&sys->d3d_dev);
     D3D9_Destroy( &sys->hd3d );
 }
diff --git a/modules/codec/avcodec/va_surface.c b/modules/codec/avcodec/va_surface.c
index 61bf4157ac..27684e9db3 100644
--- a/modules/codec/avcodec/va_surface.c
+++ b/modules/codec/avcodec/va_surface.c
@@ -194,7 +194,7 @@ void va_pool_Close(vlc_va_t *va, va_pool_t *va_pool)
     va_pool->callbacks->pf_destroy_video_service(va);
     if (va_pool->callbacks->pf_destroy_device_manager)
         va_pool->callbacks->pf_destroy_device_manager(va);
-    va_pool->callbacks->pf_destroy_device(va->sys);
+    va_pool->callbacks->pf_destroy_device(va);
 }
 
 int va_pool_Open(vlc_va_t *va, const struct va_pool_cfg *cbs, va_pool_t *va_pool)
diff --git a/modules/codec/avcodec/va_surface_internal.h b/modules/codec/avcodec/va_surface_internal.h
index 0ffc28c99d..5e19e765a9 100644
--- a/modules/codec/avcodec/va_surface_internal.h
+++ b/modules/codec/avcodec/va_surface_internal.h
@@ -49,7 +49,7 @@ typedef struct
 
 struct va_pool_cfg {
     int (*pf_create_device)(vlc_va_t *);
-    void (*pf_destroy_device)(vlc_va_sys_t *);
+    void (*pf_destroy_device)(vlc_va_t *);
 
     int (*pf_create_device_manager)(vlc_va_t *);
     void (*pf_destroy_device_manager)(vlc_va_t *);



More information about the vlc-commits mailing list