vkformat: reorder RGBA formats before RGBx formats

Fixes gst_vulkan_format_to_video_format to use the RGBA formats instead
of RGBx formats.

Fixes vulkansink exposing a RGBx/BGRx format instead of the more
relevant RGBA/BGRA formats

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5288>
This commit is contained in:
Matthew Waters 2023-09-06 12:23:57 +10:00 committed by Víctor Manuel Jáquez Leal
parent a98330636a
commit 6c534655d4

View file

@ -439,14 +439,14 @@ const static struct {
VkFormat vkfrmts[GST_VIDEO_MAX_PLANES]; VkFormat vkfrmts[GST_VIDEO_MAX_PLANES];
} vk_formats_map[] = { } vk_formats_map[] = {
/* RGB transfer sRGB */ /* RGB transfer sRGB */
{ GST_VIDEO_FORMAT_RGBx, VK_FORMAT_R8G8B8A8_SRGB, { VK_FORMAT_R8G8B8A8_UNORM, } },
{ GST_VIDEO_FORMAT_RGBA, VK_FORMAT_R8G8B8A8_SRGB, { VK_FORMAT_R8G8B8A8_UNORM, } }, { GST_VIDEO_FORMAT_RGBA, VK_FORMAT_R8G8B8A8_SRGB, { VK_FORMAT_R8G8B8A8_UNORM, } },
{ GST_VIDEO_FORMAT_BGRx, VK_FORMAT_B8G8R8A8_SRGB, { VK_FORMAT_B8G8R8A8_UNORM, } }, { GST_VIDEO_FORMAT_RGBx, VK_FORMAT_R8G8B8A8_SRGB, { VK_FORMAT_R8G8B8A8_UNORM, } },
{ GST_VIDEO_FORMAT_BGRA, VK_FORMAT_B8G8R8A8_SRGB, { VK_FORMAT_B8G8R8A8_UNORM, } }, { GST_VIDEO_FORMAT_BGRA, VK_FORMAT_B8G8R8A8_SRGB, { VK_FORMAT_B8G8R8A8_UNORM, } },
{ GST_VIDEO_FORMAT_xRGB, VK_FORMAT_UNDEFINED, { VK_FORMAT_R8G8B8A8_UNORM, } }, { GST_VIDEO_FORMAT_BGRx, VK_FORMAT_B8G8R8A8_SRGB, { VK_FORMAT_B8G8R8A8_UNORM, } },
{ GST_VIDEO_FORMAT_ARGB, VK_FORMAT_UNDEFINED, { VK_FORMAT_R8G8B8A8_UNORM, } }, { GST_VIDEO_FORMAT_ARGB, VK_FORMAT_UNDEFINED, { VK_FORMAT_R8G8B8A8_UNORM, } },
{ GST_VIDEO_FORMAT_xBGR, VK_FORMAT_UNDEFINED, { VK_FORMAT_R8G8B8A8_UNORM, } }, { GST_VIDEO_FORMAT_xRGB, VK_FORMAT_UNDEFINED, { VK_FORMAT_R8G8B8A8_UNORM, } },
{ GST_VIDEO_FORMAT_ABGR, VK_FORMAT_UNDEFINED, { VK_FORMAT_R8G8B8A8_UNORM, } }, { GST_VIDEO_FORMAT_ABGR, VK_FORMAT_UNDEFINED, { VK_FORMAT_R8G8B8A8_UNORM, } },
{ GST_VIDEO_FORMAT_xBGR, VK_FORMAT_UNDEFINED, { VK_FORMAT_R8G8B8A8_UNORM, } },
{ GST_VIDEO_FORMAT_RGB, VK_FORMAT_R8G8B8_UNORM, { VK_FORMAT_UNDEFINED, } }, { GST_VIDEO_FORMAT_RGB, VK_FORMAT_R8G8B8_UNORM, { VK_FORMAT_UNDEFINED, } },
{ GST_VIDEO_FORMAT_BGR, VK_FORMAT_B8G8R8_UNORM, { VK_FORMAT_UNDEFINED, } }, { GST_VIDEO_FORMAT_BGR, VK_FORMAT_B8G8R8_UNORM, { VK_FORMAT_UNDEFINED, } },
{ GST_VIDEO_FORMAT_RGB16, VK_FORMAT_R5G6B5_UNORM_PACK16, { VK_FORMAT_UNDEFINED, } }, { GST_VIDEO_FORMAT_RGB16, VK_FORMAT_R5G6B5_UNORM_PACK16, { VK_FORMAT_UNDEFINED, } },