aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2023-03-14 22:10:05 +0100
committerLynne <dev@lynne.ee>2023-05-29 00:41:39 +0200
commite11fd1abdba10df572e9ef0281068983c024ba8e (patch)
tree3d1817d57a517efbdeb70b665b7fab4da8d0e8a0
parentf50bc930a4fc83c7b222fcbf97e05ff9f6096c8b (diff)
downloadffmpeg-e11fd1abdba10df572e9ef0281068983c024ba8e.tar.gz
hwcontext_vulkan: do not require libdrm to map VAAPI devices
VAAPI is sadly on the way of becoming multiplaform.
-rw-r--r--libavutil/hwcontext_vulkan.c13
1 files 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
-#include <xf86drm.h>
-#include <drm_fourcc.h>
-#include "hwcontext_drm.h"
#if CONFIG_VAAPI
#include <va/va_drmcommon.h>
-#include "hwcontext_vaapi.h"
#endif
+#include <xf86drm.h>
+#include <drm_fourcc.h>
+#include "hwcontext_drm.h"
#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;