Commit 03c4b4f7 authored by Steve Lhomme's avatar Steve Lhomme

dxva: setup the surface directly in va_pool_SetupDecoder()

parent e7c103ed
......@@ -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)
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment