From c5fac0c2b048b695bf217ae77530269605eebfb9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 1 Dec 2017 06:47:37 +0100 Subject: vd_lavc: move entrypoint for hwframes_refine The idea is to get rid of vd_lavc_hwdec, so special functionality like this has to go somewhere else. At this point, hwframes_refine is only needed for d3d11, and it doesn't do much, so for now the new callback has no context. In can be made more fancy if really needed. --- video/decode/vd_lavc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'video/decode/vd_lavc.c') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 5b5a7c47fb..90217f5b8d 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -754,8 +754,11 @@ static int init_generic_hwaccel(struct dec_video *vd, enum AVPixelFormat hw_fmt) if (new_fctx->initial_pool_size) new_fctx->initial_pool_size += HWDEC_EXTRA_SURFACES - 1; - if (ctx->hwdec->hwframes_refine) - ctx->hwdec->hwframes_refine(ctx, new_frames_ctx); + const struct hwcontext_fns *fns = + hwdec_get_hwcontext_fns(new_fctx->device_ctx->type); + + if (fns && fns->refine_hwframes) + fns->refine_hwframes(new_frames_ctx); // We might be able to reuse a previously allocated frame pool. if (ctx->cached_hw_frames_ctx) { -- cgit v1.2.3