From e11fd1abdba10df572e9ef0281068983c024ba8e Mon Sep 17 00:00:00 2001 From: Lynne Date: Tue, 14 Mar 2023 22:10:05 +0100 Subject: [PATCH] hwcontext_vulkan: do not require libdrm to map VAAPI devices VAAPI is sadly on the way of becoming multiplaform. --- libavutil/hwcontext_vulkan.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index e68c4e3535..7051c5dda8 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -42,14 +42,17 @@ #include "vulkan.h" #include "vulkan_loader.h" +#if CONFIG_VAAPI +#include "hwcontext_vaapi.h" +#endif + #if CONFIG_LIBDRM +#if CONFIG_VAAPI +#include +#endif #include #include #include "hwcontext_drm.h" -#if CONFIG_VAAPI -#include -#include "hwcontext_vaapi.h" -#endif #endif #if CONFIG_CUDA @@ -1627,7 +1630,6 @@ static int vulkan_device_derive(AVHWDeviceContext *ctx, * by the following checks (e.g. non-PCIe ARM GPU), having an empty * dev_select will mean it'll get picked. */ switch(src_ctx->type) { -#if CONFIG_LIBDRM #if CONFIG_VAAPI case AV_HWDEVICE_TYPE_VAAPI: { AVVAAPIDeviceContext *src_hwctx = src_ctx->hwctx; @@ -1644,6 +1646,7 @@ static int vulkan_device_derive(AVHWDeviceContext *ctx, return vulkan_device_create_internal(ctx, &dev_select, opts, flags); } #endif +#if CONFIG_LIBDRM case AV_HWDEVICE_TYPE_DRM: { AVDRMDeviceContext *src_hwctx = src_ctx->hwctx;