0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

hwdec: add a AVBufferRef(AVHWDeviceContext) field

This makes "generic" interaction with libav* components easier.
This commit is contained in:
wm4 2017-01-16 15:31:54 +01:00
parent 348c610b68
commit bbdecb792a
2 changed files with 5 additions and 0 deletions

View File

@ -47,6 +47,9 @@ struct mp_hwdec_ctx {
// HWDEC_CUDA: CUcontext*
void *ctx;
// libavutil-wrapped context, if available.
struct AVBufferRef *av_device_ref; // AVVAAPIDeviceContext*
// List of IMGFMT_s, terminated with 0. NULL if N/A.
int *supported_formats;

View File

@ -164,6 +164,8 @@ static void open_lavu_vaapi_device(struct mp_vaapi_ctx *ctx)
if (av_hwdevice_ctx_init(ctx->av_device_ref) < 0)
av_buffer_unref(&ctx->av_device_ref);
ctx->hwctx.av_device_ref = ctx->av_device_ref;
}
struct mp_vaapi_ctx *va_initialize(VADisplay *display, struct mp_log *plog,