[vlc-commits] dxva: setup the surface directly in va_pool_SetupDecoder()
Steve Lhomme
git at videolan.org
Mon Sep 2 15:43:20 CEST 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Sep 2 11:39:44 2019 +0200| [03c4b4f79a3b3238cd50ea36c8fdc6e7adf35668] | committer: Steve Lhomme
dxva: setup the surface directly in va_pool_SetupDecoder()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=03c4b4f79a3b3238cd50ea36c8fdc6e7adf35668
---
modules/codec/avcodec/directx_va.c | 7 +------
modules/codec/avcodec/va_surface.c | 6 ++++--
modules/codec/avcodec/va_surface_internal.h | 1 -
3 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/modules/codec/avcodec/directx_va.c b/modules/codec/avcodec/directx_va.c
index 918813af93..1ba95945a4 100644
--- a/modules/codec/avcodec/directx_va.c
+++ b/modules/codec/avcodec/directx_va.c
@@ -323,12 +323,7 @@ int directx_va_Setup(vlc_va_t *va, directx_sys_t *dx_sys, const AVCodecContext *
if ( avctx->active_thread_type & FF_THREAD_FRAME )
surface_count += avctx->thread_count;
- int err = va_pool_SetupDecoder(va, &dx_sys->va_pool, avctx, surface_count, surface_alignment);
- if (err != VLC_SUCCESS)
- return err;
- if (dx_sys->va_pool.can_extern_pool)
- return VLC_SUCCESS;
- return va_pool_SetupSurfaces(va, &dx_sys->va_pool, surface_count);
+ return va_pool_SetupDecoder(va, &dx_sys->va_pool, avctx, surface_count, surface_alignment);
}
void directx_va_Close(vlc_va_t *va, directx_sys_t *dx_sys)
diff --git a/modules/codec/avcodec/va_surface.c b/modules/codec/avcodec/va_surface.c
index 6311d39491..c3ea01efaa 100644
--- a/modules/codec/avcodec/va_surface.c
+++ b/modules/codec/avcodec/va_surface.c
@@ -52,6 +52,8 @@ static void DestroyVideoDecoder(vlc_va_sys_t *sys, va_pool_t *va_pool)
va_pool->surface_count = 0;
}
+static int SetupSurfaces(vlc_va_t *, va_pool_t *, unsigned count);
+
/* */
int va_pool_SetupDecoder(vlc_va_t *va, va_pool_t *va_pool, const AVCodecContext *avctx, unsigned count, int alignment)
{
@@ -107,12 +109,12 @@ int va_pool_SetupDecoder(vlc_va_t *va, va_pool_t *va_pool, const AVCodecContext
done:
va_pool->surface_count = i;
if (err == VLC_SUCCESS)
- va_pool->callbacks->pf_setup_avcodec_ctx(va->sys, count);
+ err = SetupSurfaces(va, va_pool, count);
return err;
}
-int va_pool_SetupSurfaces(vlc_va_t *va, va_pool_t *va_pool, unsigned count)
+static int SetupSurfaces(vlc_va_t *va, va_pool_t *va_pool, unsigned count)
{
int err = VLC_ENOMEM;
diff --git a/modules/codec/avcodec/va_surface_internal.h b/modules/codec/avcodec/va_surface_internal.h
index efbf772eb3..f875862258 100644
--- a/modules/codec/avcodec/va_surface_internal.h
+++ b/modules/codec/avcodec/va_surface_internal.h
@@ -77,7 +77,6 @@ struct va_pool_cfg {
int va_pool_Open(vlc_va_t *, const struct va_pool_cfg *, va_pool_t *);
void va_pool_Close(vlc_va_t *va, va_pool_t *);
int va_pool_SetupDecoder(vlc_va_t *, va_pool_t *, const AVCodecContext *, unsigned count, int alignment);
-int va_pool_SetupSurfaces(vlc_va_t *, va_pool_t *, unsigned count);
picture_context_t *va_pool_Get(va_pool_t *);
void va_surface_AddRef(vlc_va_surface_t *surface);
void va_surface_Release(vlc_va_surface_t *surface);
More information about the vlc-commits
mailing list