diff options
author | wm4 <wm4@nowhere> | 2017-02-20 08:39:55 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-02-20 08:39:55 +0100 |
commit | 6aa4efd1e3205c9b1385865df1b5b09646d2160c (patch) | |
tree | 4a0f78718f21f7f644f9ca7de4fbcfb8a83aafa9 /video/decode/hw_vaapi_old.c | |
parent | 6e2d3d991912f230ee66448307e8e2657237ffd2 (diff) | |
download | mpv-6aa4efd1e3205c9b1385865df1b5b09646d2160c.tar.bz2 mpv-6aa4efd1e3205c9b1385865df1b5b09646d2160c.tar.xz |
vd_lavc, vaapi: move hw device creation to generic code
hw_vaapi.c didn't do much interesting anymore. Other than the function
to create a device for decoding with vaapi-copy, everything can be done
by generic code. Other libavcodec hwaccels are planned to provide the
same API as vaapi. It will be possible to drop the other hw_ files in
the future. They will use this generic code instead.
Diffstat (limited to 'video/decode/hw_vaapi_old.c')
-rw-r--r-- | video/decode/hw_vaapi_old.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/video/decode/hw_vaapi_old.c b/video/decode/hw_vaapi_old.c index 88379dfed8..fb0fc40110 100644 --- a/video/decode/hw_vaapi_old.c +++ b/video/decode/hw_vaapi_old.c @@ -327,11 +327,12 @@ static int init(struct lavc_ctx *ctx, bool direct) if (direct) { p->ctx = hwdec_devices_get(ctx->hwdec_devs, HWDEC_VAAPI)->ctx; } else { - p->ctx = va_create_standalone(ctx->log, false); - if (!p->ctx) { + struct mp_hwdec_ctx *hwctx = va_create_standalone(NULL, ctx->log, false); + if (!hwctx) { talloc_free(p); return -1; } + p->ctx = hwctx->ctx; p->own_ctx = true; } @@ -368,9 +369,10 @@ static int probe(struct lavc_ctx *ctx, struct vd_lavc_hwdec *hwdec, static int probe_copy(struct lavc_ctx *ctx, struct vd_lavc_hwdec *hwdec, const char *codec) { - struct mp_vaapi_ctx *dummy = va_create_standalone(ctx->log, true); - if (!dummy) + struct mp_hwdec_ctx *hwctx = va_create_standalone(NULL, ctx->log, true); + if (!hwctx) return HWDEC_ERR_NO_CTX; + struct mp_vaapi_ctx *dummy = hwctx->ctx; bool emulated = va_guess_if_emulated(dummy); va_destroy(dummy); if (!hwdec_check_codec_support(codec, profiles)) |