diff options
author | Mark Thompson <sw@jkqxz.net> | 2017-10-01 22:51:31 +0100 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2017-10-25 00:01:41 +0100 |
commit | 2708c8e8efefaad337ccab1e3bf59dcde66c6bc5 (patch) | |
tree | 0e5a77297d3581040d617cead4f41d2a47df76e9 /libavutil | |
parent | bfc83acfd6b33986480d4c6d3c571ba6a59f1d98 (diff) | |
download | ffmpeg-2708c8e8efefaad337ccab1e3bf59dcde66c6bc5.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.
Diffstat (limited to 'libavutil')
-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 2260518ca6..12f8ac93cd 100644 --- a/libavutil/hwcontext_vaapi.c +++ b/libavutil/hwcontext_vaapi.c @@ -916,6 +916,22 @@ static void vaapi_device_free(AVHWDeviceContext *ctx) av_freep(&priv); } +#if HAVE_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_create(AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags) { @@ -985,6 +1001,11 @@ static int vaapi_device_create(AVHWDeviceContext *ctx, const char *device, return AVERROR(EINVAL); } +#if HAVE_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); |