diff options
author | Mark Thompson <sw@jkqxz.net> | 2017-10-08 16:54:37 +0100 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2017-10-09 00:11:53 +0100 |
commit | f3602875b3255c533900df1c7bb4e78ef5e1ce08 (patch) | |
tree | 7fd9bc9783fa4c3d048af81a65870f1e9124ed0a | |
parent | 5f3978866879ebaa1f1a1f678777df489d3d34f3 (diff) | |
download | ffmpeg-f3602875b3255c533900df1c7bb4e78ef5e1ce08.tar.gz |
hwcontext_vaapi: Set message callbacks on internally-created devices
The message callbacks are library-safe in libva2, so we can now use
them.
-rw-r--r-- | libavutil/hwcontext_vaapi.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index 2977878022..b2f2e376d8 100644 --- a/libavutil/hwcontext_vaapi.c +++ b/libavutil/hwcontext_vaapi.c @@ -1094,6 +1094,22 @@ static void vaapi_device_free(AVHWDeviceContext *ctx) av_freep(&priv); } +#if CONFIG_VAAPI_1 +static void vaapi_device_log_error(void *context, const char *message) +{ + AVHWDeviceContext *ctx = context; + + av_log(ctx, AV_LOG_ERROR, "libva: %s", message); +} + +static void vaapi_device_log_info(void *context, const char *message) +{ + AVHWDeviceContext *ctx = context; + + av_log(ctx, AV_LOG_VERBOSE, "libva: %s", message); +} +#endif + static int vaapi_device_connect(AVHWDeviceContext *ctx, VADisplay display) { @@ -1101,6 +1117,11 @@ static int vaapi_device_connect(AVHWDeviceContext *ctx, int major, minor; VAStatus vas; +#if CONFIG_VAAPI_1 + vaSetErrorCallback(display, &vaapi_device_log_error, ctx); + vaSetInfoCallback (display, &vaapi_device_log_info, ctx); +#endif + hwctx->display = display; vas = vaInitialize(display, &major, &minor); |