From 211c910aca6f1be57a73849a923a3a12863a82f4 Mon Sep 17 00:00:00 2001 From: Lynne Date: Wed, 23 Nov 2022 20:35:51 +0100 Subject: [PATCH] hwcontext_vulkan: rename and expand vk_pixfmt_map to append VK_NULL_FORMAT --- libavutil/hwcontext_vulkan.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 9eb872ca78..82790cb014 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -167,8 +167,8 @@ typedef struct AVVkFrameInternal { static const struct { enum AVPixelFormat pixfmt; - const VkFormat vkfmts[4]; -} vk_pixfmt_map[] = { + const VkFormat vkfmts[5]; +} vk_pixfmt_planar_map[] = { { AV_PIX_FMT_GRAY8, { VK_FORMAT_R8_UNORM } }, { AV_PIX_FMT_GRAY16, { VK_FORMAT_R16_UNORM } }, { AV_PIX_FMT_GRAYF32, { VK_FORMAT_R32_SFLOAT } }, @@ -244,9 +244,9 @@ static const struct { const VkFormat *av_vkfmt_from_pixfmt(enum AVPixelFormat p) { - for (enum AVPixelFormat i = 0; i < FF_ARRAY_ELEMS(vk_pixfmt_map); i++) - if (vk_pixfmt_map[i].pixfmt == p) - return vk_pixfmt_map[i].vkfmts; + for (enum AVPixelFormat i = 0; i < FF_ARRAY_ELEMS(vk_pixfmt_planar_map); i++) + if (vk_pixfmt_planar_map[i].pixfmt == p) + return vk_pixfmt_planar_map[i].vkfmts; return NULL; }