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

Lynne dev at lynne.ee
Sun Feb 5 07:38:00 EET 2023


5 Feb 2023, 00:17 by rcombs at rcombs.me:

> 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
>

I've fixed this and a few other issues in my vulkan branch.
Could this wait a little longer until it's merged?


More information about the ffmpeg-devel mailing list