Codec (Vulkan): disables impl if the vulkan headers are too old to use

This commit is contained in:
李通洲
2026-06-01 00:15:27 +08:00
parent 30a8a94cd2
commit 9afa01812d
+20 -10
View File
@@ -1,14 +1,15 @@
#include "codec.h"
#ifdef FF_HAVE_VULKAN
#include "common/debug.h"
#include "common/io.h"
#include "common/library.h"
#include "common/mallocHelper.h"
#include <vulkan/vulkan.h>
#if VK_KHR_video_decode_queue && VK_KHR_video_encode_queue
#include "common/debug.h"
#include "common/io.h"
#include "common/library.h"
#include "common/mallocHelper.h"
static FFCodecType ffCodecDecodeOperationsToTypes(VkVideoCodecOperationFlagsKHR operations) {
FFCodecType types = FF_CODEC_TYPE_NONE;
@@ -58,16 +59,16 @@ const char* ffDetectCodecVulkan(FFlist* result /*list of FFCodecResult*/) {
FF_DEBUG("Starting Vulkan codec detection");
FF_LIBRARY_LOAD_MESSAGE(vulkan,
#if __APPLE__
#if __APPLE__
"libMoltenVK" FF_LIBRARY_EXTENSION,
-1
#elif _WIN32
#elif _WIN32
"vulkan-1" FF_LIBRARY_EXTENSION,
-1
#else
#else
"libvulkan" FF_LIBRARY_EXTENSION,
2
#endif
#endif
)
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(vulkan, vkGetInstanceProcAddr)
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(vulkan, vkCreateInstance)
@@ -264,4 +265,13 @@ const char* ffDetectCodecVulkan(FFlist* result /*list of FFCodecResult*/) {
: "VK_KHR_video_queue is not supported by any Vulkan physical device";
}
#else
const char* ffDetectCodecVulkan(FFlist* result) {
FF_UNUSED(result);
return "Vulkan video queue extensions are not supported by this Vulkan implementation";
}
#endif
#endif