[FFmpeg-devel] [PATCH 3/3] lavu/vulkan: only request beta extensions if we detected they're present

rcombs rcombs at rcombs.me
Sun Feb 5 01:17:03 EET 2023


Fixes build on systems where vulkan_beta.h is absent (e.g. Android)
---
 libavutil/hwcontext_vulkan.c | 5 ++++-
 libavutil/vulkan_functions.h | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 589a7a7d9a..67802a850d 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -16,8 +16,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "config.h"
+
 #define VK_NO_PROTOTYPES
+#if HAVE_VULKAN_BETA
 #define VK_ENABLE_BETA_EXTENSIONS
+#endif
 
 #ifdef _WIN32
 #include <windows.h> /* Included to prevent conflicts with CreateSemaphore */
@@ -29,7 +33,6 @@
 
 #include <unistd.h>
 
-#include "config.h"
 #include "pixdesc.h"
 #include "avstring.h"
 #include "imgutils.h"
diff --git a/libavutil/vulkan_functions.h b/libavutil/vulkan_functions.h
index d15a5d9a42..4d80322540 100644
--- a/libavutil/vulkan_functions.h
+++ b/libavutil/vulkan_functions.h
@@ -19,8 +19,12 @@
 #ifndef AVUTIL_VULKAN_FUNCTIONS_H
 #define AVUTIL_VULKAN_FUNCTIONS_H
 
+#include "config.h"
+
 #define VK_NO_PROTOTYPES
+#if HAVE_VULKAN_BETA
 #define VK_ENABLE_BETA_EXTENSIONS
+#endif
 
 #include "hwcontext.h"
 #include "hwcontext_vulkan.h"
-- 
2.39.1



More information about the ffmpeg-devel mailing list