[vlc-commits] hw:d3d11: use D3D11_ReleaseProcessor()

Steve Lhomme git at videolan.org
Mon May 28 13:24:57 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Thu Nov 30 10:00:35 2017 +0100| [63351fb2f98b806d70861fa75d8e04631dc3c354] | committer: Steve Lhomme

hw:d3d11: use D3D11_ReleaseProcessor()

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

 modules/hw/d3d11/d3d11_deinterlace.c | 15 ++-------------
 modules/hw/d3d11/d3d11_filters.c     | 16 ++--------------
 modules/hw/d3d11/d3d11_surface.c     | 16 ++--------------
 3 files changed, 6 insertions(+), 41 deletions(-)

diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c
index fbe473d7f2..2ad06e6d75 100644
--- a/modules/hw/d3d11/d3d11_deinterlace.c
+++ b/modules/hw/d3d11/d3d11_deinterlace.c
@@ -32,7 +32,6 @@
 #include <vlc_picture.h>
 
 #define COBJMACROS
-#include <initguid.h>
 #include <d3d11.h>
 
 #include "d3d11_filters.h"
@@ -542,14 +541,7 @@ error:
         ID3D11VideoProcessorOutputView_Release(sys->processorOutput);
     if (sys->outTexture)
         ID3D11Texture2D_Release(sys->outTexture);
-    if (sys->d3d_proc.videoProcessor)
-        ID3D11VideoProcessor_Release(sys->d3d_proc.videoProcessor);
-    if (sys->d3d_proc.procEnumerator)
-        ID3D11VideoProcessorEnumerator_Release(sys->d3d_proc.procEnumerator);
-    if (sys->d3d_proc.d3dvidctx)
-        ID3D11VideoContext_Release(sys->d3d_proc.d3dvidctx);
-    if (sys->d3d_proc.d3dviddev)
-        ID3D11VideoDevice_Release(sys->d3d_proc.d3dviddev);
+    D3D11_ReleaseProcessor(&sys->d3d_proc);
     if (sys->d3d_dev.d3dcontext)
         D3D11_FilterReleaseInstance(&sys->d3d_dev);
     D3D11_Destroy(&sys->hd3d);
@@ -566,10 +558,7 @@ void D3D11CloseDeinterlace(vlc_object_t *obj)
     if (likely(sys->processorOutput))
         ID3D11VideoProcessorOutputView_Release(sys->processorOutput);
     ID3D11Texture2D_Release(sys->outTexture);
-    ID3D11VideoProcessor_Release(sys->d3d_proc.videoProcessor);
-    ID3D11VideoProcessorEnumerator_Release(sys->d3d_proc.procEnumerator);
-    ID3D11VideoContext_Release(sys->d3d_proc.d3dvidctx);
-    ID3D11VideoDevice_Release(sys->d3d_proc.d3dviddev);
+    D3D11_ReleaseProcessor( &sys->d3d_proc );
     D3D11_FilterReleaseInstance(&sys->d3d_dev);
     D3D11_Destroy(&sys->hd3d);
 
diff --git a/modules/hw/d3d11/d3d11_filters.c b/modules/hw/d3d11/d3d11_filters.c
index 0d45c19b29..ba97a99bfc 100644
--- a/modules/hw/d3d11/d3d11_filters.c
+++ b/modules/hw/d3d11/d3d11_filters.c
@@ -35,7 +35,6 @@
 #include <vlc_picture.h>
 
 #define COBJMACROS
-#include <initguid.h>
 #include <d3d11.h>
 
 #include "d3d11_filters.h"
@@ -565,14 +564,7 @@ error:
         ID3D11Texture2D_Release(sys->out[0].texture);
     if (sys->out[1].texture)
         ID3D11Texture2D_Release(sys->out[1].texture);
-    if (sys->d3d_proc.videoProcessor)
-        ID3D11VideoProcessor_Release(sys->d3d_proc.videoProcessor);
-    if (sys->d3d_proc.procEnumerator)
-        ID3D11VideoProcessorEnumerator_Release(sys->d3d_proc.procEnumerator);
-    if (sys->d3d_proc.d3dvidctx)
-        ID3D11VideoContext_Release(sys->d3d_proc.d3dvidctx);
-    if (sys->d3d_proc.d3dviddev)
-        ID3D11VideoDevice_Release(sys->d3d_proc.d3dviddev);
+    D3D11_ReleaseProcessor(&sys->d3d_proc);
     if (sys->d3d_dev.d3dcontext)
         D3D11_FilterReleaseInstance(&sys->d3d_dev);
     free(sys);
@@ -600,11 +592,7 @@ static void D3D11CloseAdjust(vlc_object_t *obj)
     }
     ID3D11Texture2D_Release(sys->out[0].texture);
     ID3D11Texture2D_Release(sys->out[1].texture);
-    ID3D11VideoProcessor_Release(sys->d3d_proc.videoProcessor);
-    ID3D11VideoProcessorEnumerator_Release(sys->d3d_proc.procEnumerator);
-    ID3D11VideoContext_Release(sys->d3d_proc.d3dvidctx);
-    ID3D11VideoDevice_Release(sys->d3d_proc.d3dviddev);
-
+    D3D11_ReleaseProcessor( &sys->d3d_proc );
     D3D11_FilterReleaseInstance(&sys->d3d_dev);
 
     free(sys);
diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c
index 1dbf14d0d1..001a1c2c90 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -163,12 +163,7 @@ static int SetupProcessor(filter_t *p_filter, d3d11_device_t *d3d_dev,
     }
 
 error:
-    if (sys->d3d_proc.procEnumerator)
-        ID3D11VideoProcessorEnumerator_Release(sys->d3d_proc.procEnumerator);
-    if (sys->d3d_proc.d3dvidctx)
-        ID3D11VideoContext_Release(sys->d3d_proc.d3dvidctx);
-    if (sys->d3d_proc.d3dviddev)
-        ID3D11VideoDevice_Release(sys->d3d_proc.d3dviddev);
+    D3D11_ReleaseProcessor(&sys->d3d_proc);
     return VLC_EGENERIC;
 }
 #endif
@@ -895,14 +890,7 @@ void D3D11CloseConverter( vlc_object_t *obj )
     filter_t *p_filter = (filter_t *)obj;
     filter_sys_t *p_sys = p_filter->p_sys;
 #if CAN_PROCESSOR
-    if (p_sys->d3d_proc.d3dviddev)
-        ID3D11VideoDevice_Release(p_sys->d3d_proc.d3dviddev);
-    if (p_sys->d3d_proc.d3dvidctx)
-        ID3D11VideoContext_Release(p_sys->d3d_proc.d3dvidctx);
-    if (p_sys->d3d_proc.procEnumerator)
-        ID3D11VideoProcessorEnumerator_Release(p_sys->d3d_proc.procEnumerator);
-    if (p_sys->d3d_proc.videoProcessor)
-        ID3D11VideoProcessor_Release(p_sys->d3d_proc.videoProcessor);
+    D3D11_ReleaseProcessor( &p_sys->d3d_proc );
 #endif
     CopyCleanCache(&p_sys->cache);
     vlc_mutex_destroy(&p_sys->staging_lock);



More information about the vlc-commits mailing list