[vlc-devel] [PATCH 04/23] d3d11: add a video context similarity check callback

Steve Lhomme robux4 at ycbcr.xyz
Thu Nov 7 10:31:17 CET 2019


---
 modules/video_chroma/d3d11_fmt.c | 2 +-
 modules/video_chroma/d3d11_fmt.h | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c
index edb39244a33..127f958f74a 100644
--- a/modules/video_chroma/d3d11_fmt.c
+++ b/modules/video_chroma/d3d11_fmt.c
@@ -771,7 +771,7 @@ static void ReleaseD3D11ContextPrivate(void *private)
 }
 
 const struct vlc_video_context_operations d3d11_vctx_ops = {
-    ReleaseD3D11ContextPrivate, NULL // TODO
+    ReleaseD3D11ContextPrivate, D3D11ContextSimilar,
 };
 
 void d3d11_pic_context_destroy(picture_context_t *ctx)
diff --git a/modules/video_chroma/d3d11_fmt.h b/modules/video_chroma/d3d11_fmt.h
index b69f0ffd225..5692fe49c6d 100644
--- a/modules/video_chroma/d3d11_fmt.h
+++ b/modules/video_chroma/d3d11_fmt.h
@@ -140,6 +140,13 @@ static inline d3d11_video_context_t *GetD3D11ContextPrivate(vlc_video_context *v
     return (d3d11_video_context_t *) vlc_video_context_GetPrivate( vctx, VLC_VIDEO_CONTEXT_D3D11VA );
 }
 
+static inline bool D3D11ContextSimilar(const vlc_video_context *a, const vlc_video_context *b)
+{
+    d3d11_video_context_t *actx = GetD3D11ContextPrivate( (vlc_video_context *)a );
+    d3d11_video_context_t *bctx = GetD3D11ContextPrivate( (vlc_video_context *)b );
+    return actx->device == bctx->device && actx->format == bctx->format;
+}
+
 void AcquireD3D11PictureSys(picture_sys_d3d11_t *p_sys);
 
 void ReleaseD3D11PictureSys(picture_sys_d3d11_t *p_sys);
-- 
2.17.1



More information about the vlc-devel mailing list