summaryrefslogtreecommitdiffstats
path: root/video/decode/vd_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-06-08 21:16:11 +0200
committerwm4 <wm4@nowhere>2017-06-08 21:51:25 +0200
commit0754cbc83eb030ed3c0f0666e8b7c2481631e513 (patch)
treeb4df7e128e0e65704ae62e5a19a73651def4f284 /video/decode/vd_lavc.c
parent79dc1834f5932b36b0a2b48388654d2c4dcd2817 (diff)
downloadmpv-0754cbc83eb030ed3c0f0666e8b7c2481631e513.tar.bz2
mpv-0754cbc83eb030ed3c0f0666e8b7c2481631e513.tar.xz
d3d: add support for new libavcodec hwaccel API
Unfortunately quite a mess, in particular due to the need to have some compatibility with the old API. (The old API will be supported only in short term.)
Diffstat (limited to 'video/decode/vd_lavc.c')
-rw-r--r--video/decode/vd_lavc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index 6dda6302f3..581f50979b 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -399,7 +399,7 @@ static int hwdec_probe(struct dec_video *vd, struct vd_lavc_hwdec *hwdec,
r = hwdec->probe(ctx, hwdec, codec);
if (hwdec->generic_hwaccel) {
assert(!hwdec->probe && !hwdec->init && !hwdec->init_decoder &&
- !hwdec->uninit && !hwdec->allocate_image && !hwdec->process_image);
+ !hwdec->uninit && !hwdec->allocate_image);
struct mp_hwdec_ctx *dev = hwdec_create_dev(vd, hwdec, autoprobe);
if (!dev)
return hwdec->copying ? -1 : HWDEC_ERR_NO_CTX;
@@ -779,6 +779,9 @@ int hwdec_setup_hw_frames_ctx(struct lavc_ctx *ctx, AVBufferRef *device_ctx,
fctx->initial_pool_size = initial_pool_size;
+ if (ctx->hwdec->hwframes_refine)
+ ctx->hwdec->hwframes_refine(ctx, ctx->cached_hw_frames_ctx);
+
int res = av_hwframe_ctx_init(ctx->cached_hw_frames_ctx);
if (res < 0) {
MP_ERR(ctx, "Failed to allocate hw frames.\n");