[vlc-commits] directx_va: add a way to lock/unlock a surface
Steve Lhomme
git at videolan.org
Tue Jun 13 14:59:46 CEST 2017
vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Mon May 22 13:22:31 2017 +0200| [570c797ebf0e0ac8273c2da7a51ba7d316ce62a4] | committer: Jean-Baptiste Kempf
directx_va: add a way to lock/unlock a surface
The surface may not be used by the decoder but still being used for display/filter.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=570c797ebf0e0ac8273c2da7a51ba7d316ce62a4
---
modules/codec/avcodec/directx_va.c | 7 +++++++
modules/codec/avcodec/directx_va.h | 1 +
2 files changed, 8 insertions(+)
diff --git a/modules/codec/avcodec/directx_va.c b/modules/codec/avcodec/directx_va.c
index 664e686d39..4c86ad10a5 100644
--- a/modules/codec/avcodec/directx_va.c
+++ b/modules/codec/avcodec/directx_va.c
@@ -420,6 +420,13 @@ vlc_va_surface_t *directx_va_Get(vlc_va_t *va, directx_sys_t *dx_sys, uint8_t **
return surface;
}
+void directx_va_AddRef(vlc_va_surface_t *surface)
+{
+ vlc_mutex_lock( surface->p_lock );
+ surface->refcount++;
+ vlc_mutex_unlock( surface->p_lock );
+}
+
void directx_va_Release(vlc_va_surface_t *surface)
{
vlc_mutex_lock( surface->p_lock );
diff --git a/modules/codec/avcodec/directx_va.h b/modules/codec/avcodec/directx_va.h
index a7e20d39ea..8bc296550e 100644
--- a/modules/codec/avcodec/directx_va.h
+++ b/modules/codec/avcodec/directx_va.h
@@ -138,6 +138,7 @@ int directx_va_Open(vlc_va_t *, directx_sys_t *, AVCodecContext *ctx, const es_f
void directx_va_Close(vlc_va_t *, directx_sys_t *);
int directx_va_Setup(vlc_va_t *, directx_sys_t *, AVCodecContext *avctx);
vlc_va_surface_t *directx_va_Get(vlc_va_t *, directx_sys_t *, uint8_t **data);
+void directx_va_AddRef(vlc_va_surface_t *surface);
void directx_va_Release(vlc_va_surface_t *surface);
char *directx_va_GetDecoderName(const GUID *guid);
More information about the vlc-commits
mailing list