mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
hwcontext_vaapi: Set message callbacks on internally-created devices
The message callbacks are library-safe in libva2, so we can now use them.
This commit is contained in:
parent
5f39788668
commit
f3602875b3
@ -1094,6 +1094,22 @@ static void vaapi_device_free(AVHWDeviceContext *ctx)
|
|||||||
av_freep(&priv);
|
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,
|
static int vaapi_device_connect(AVHWDeviceContext *ctx,
|
||||||
VADisplay display)
|
VADisplay display)
|
||||||
{
|
{
|
||||||
@ -1101,6 +1117,11 @@ static int vaapi_device_connect(AVHWDeviceContext *ctx,
|
|||||||
int major, minor;
|
int major, minor;
|
||||||
VAStatus vas;
|
VAStatus vas;
|
||||||
|
|
||||||
|
#if CONFIG_VAAPI_1
|
||||||
|
vaSetErrorCallback(display, &vaapi_device_log_error, ctx);
|
||||||
|
vaSetInfoCallback (display, &vaapi_device_log_info, ctx);
|
||||||
|
#endif
|
||||||
|
|
||||||
hwctx->display = display;
|
hwctx->display = display;
|
||||||
|
|
||||||
vas = vaInitialize(display, &major, &minor);
|
vas = vaInitialize(display, &major, &minor);
|
||||||
|
Loading…
Reference in New Issue
Block a user