mirror of
https://github.com/mpv-player/mpv
synced 2024-12-22 14:52:43 +00:00
hwdec: add a AVBufferRef(AVHWDeviceContext) field
This makes "generic" interaction with libav* components easier.
This commit is contained in:
parent
348c610b68
commit
bbdecb792a
@ -47,6 +47,9 @@ struct mp_hwdec_ctx {
|
|||||||
// HWDEC_CUDA: CUcontext*
|
// HWDEC_CUDA: CUcontext*
|
||||||
void *ctx;
|
void *ctx;
|
||||||
|
|
||||||
|
// libavutil-wrapped context, if available.
|
||||||
|
struct AVBufferRef *av_device_ref; // AVVAAPIDeviceContext*
|
||||||
|
|
||||||
// List of IMGFMT_s, terminated with 0. NULL if N/A.
|
// List of IMGFMT_s, terminated with 0. NULL if N/A.
|
||||||
int *supported_formats;
|
int *supported_formats;
|
||||||
|
|
||||||
|
@ -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)
|
if (av_hwdevice_ctx_init(ctx->av_device_ref) < 0)
|
||||||
av_buffer_unref(&ctx->av_device_ref);
|
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,
|
struct mp_vaapi_ctx *va_initialize(VADisplay *display, struct mp_log *plog,
|
||||||
|
Loading…
Reference in New Issue
Block a user