From d20d94cc48742f4306a4a41987ab072f0cbc37f6 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Tue, 12 Sep 2023 12:36:55 +1000 Subject: [PATCH] vkformat: also use the correct srgb vs unorm when using older gst_video_info_from_video_info() Fixes sRGB colorspace chosen by GstVulkanSwapper and therefore used for display. Part-of: --- .../gst-plugins-bad/gst-libs/gst/vulkan/gstvkformat.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkformat.c b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkformat.c index 7c30590c04..7713c4d2f2 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkformat.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkformat.c @@ -493,10 +493,13 @@ gst_vulkan_format_from_video_info (GstVideoInfo * v_info, guint plane) if (vk_formats_map[i].format != GST_VIDEO_INFO_FORMAT (v_info)) continue; - if (GST_VIDEO_INFO_IS_RGB (v_info) && - (GST_VIDEO_INFO_COLORIMETRY (v_info).transfer == - GST_VIDEO_TRANSFER_SRGB)) { - return vk_formats_map[i].vkfrmts[0]; + if (GST_VIDEO_INFO_IS_RGB (v_info)) { + if (GST_VIDEO_INFO_COLORIMETRY (v_info).transfer == + GST_VIDEO_TRANSFER_SRGB) { + return vk_formats_map[i].vkfrmt; + } else { + return vk_formats_map[i].vkfrmts[0]; + } } else if (GST_VIDEO_INFO_IS_YUV (v_info) && GST_VIDEO_INFO_N_PLANES (v_info) > plane) { return vk_formats_map[i].vkfrmts[plane];