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 72422571dc..1c2a605113 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkformat.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkformat.c @@ -646,8 +646,8 @@ gst_vulkan_format_from_video_info_2 (GstVulkanPhysicalDevice * physical_device, } if (GST_VIDEO_INFO_IS_RGB (info)) { - if (basics_primary && GST_VIDEO_INFO_COLORIMETRY (info).transfer != - GST_VIDEO_TRANSFER_SRGB) { + if (basics_primary && (GST_VIDEO_INFO_COLORIMETRY (info).transfer == + GST_VIDEO_TRANSFER_SRGB)) { if (fmts) fmts[0] = vk_formats_map[i].vkfrmt; if (n_imgs) @@ -655,7 +655,7 @@ gst_vulkan_format_from_video_info_2 (GstVulkanPhysicalDevice * physical_device, if (usage) *usage = _get_usage (feats_primary); } else if (basics_secondary - && GST_VIDEO_INFO_COLORIMETRY (info).transfer == + && GST_VIDEO_INFO_COLORIMETRY (info).transfer != GST_VIDEO_TRANSFER_SRGB) { if (fmts) fmts[0] = vk_formats_map[i].vkfrmts[0]; @@ -667,8 +667,8 @@ gst_vulkan_format_from_video_info_2 (GstVulkanPhysicalDevice * physical_device, return FALSE; } } else { - if (basics_primary && !(no_multiplane - && GST_VIDEO_INFO_N_PLANES (info) > 1)) { + if (basics_primary && !no_multiplane + && GST_VIDEO_INFO_N_PLANES (info) > 1) { if (fmts) fmts[0] = vk_formats_map[i].vkfrmt; if (n_imgs) diff --git a/subprojects/gst-plugins-bad/tests/check/libs/vkformat.c b/subprojects/gst-plugins-bad/tests/check/libs/vkformat.c index a4ca27205c..0a04685ba3 100644 --- a/subprojects/gst-plugins-bad/tests/check/libs/vkformat.c +++ b/subprojects/gst-plugins-bad/tests/check/libs/vkformat.c @@ -69,11 +69,13 @@ GST_START_TEST (test_format_from_video_info_2) fail_unless (gst_video_info_set_format (&vinfo, GST_VIDEO_FORMAT_RGBA, 620, 480)); + fail_unless (GST_VIDEO_INFO_COLORIMETRY (&vinfo).transfer == + GST_VIDEO_TRANSFER_SRGB); fail_unless (gst_vulkan_format_from_video_info_2 (phy_dev, &vinfo, VK_IMAGE_TILING_LINEAR, TRUE, vk_fmts, &n_imgs, &supported_usage)); - fail_unless (n_imgs == 1 && vk_fmts[0] == VK_FORMAT_R8G8B8A8_UNORM); + fail_unless (n_imgs == 1 && vk_fmts[0] == VK_FORMAT_R8G8B8A8_SRGB); fail_unless (gst_video_info_set_format (&vinfo, GST_VIDEO_FORMAT_RGBA, 620, 480)); @@ -83,7 +85,7 @@ GST_START_TEST (test_format_from_video_info_2) fail_unless (gst_vulkan_format_from_video_info_2 (phy_dev, &vinfo, VK_IMAGE_TILING_LINEAR, TRUE, vk_fmts, &n_imgs, &supported_usage)); - fail_unless (n_imgs == 1 && vk_fmts[0] == VK_FORMAT_R8G8B8A8_SRGB); + fail_unless (n_imgs == 1 && vk_fmts[0] == VK_FORMAT_R8G8B8A8_UNORM); } GST_END_TEST;