mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 17:51:16 +00:00
vkswapper: choose color space according with format
The swapper surfaces contains the color space for each supported format. Instead of hard coding the color space, it returns the value associated with the negotiated vulkan format. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6725>
This commit is contained in:
parent
f62574cb5f
commit
d2c8593b2e
1 changed files with 12 additions and 2 deletions
|
@ -178,8 +178,18 @@ _get_function_table (GstVulkanSwapper * swapper)
|
||||||
}
|
}
|
||||||
|
|
||||||
static VkColorSpaceKHR
|
static VkColorSpaceKHR
|
||||||
_vk_color_space_from_video_info (GstVideoInfo * v_info)
|
_vk_color_space_from_vk_format (GstVulkanSwapper * swapper, VkFormat format)
|
||||||
{
|
{
|
||||||
|
GstVulkanSwapperPrivate *priv = GET_PRIV (swapper);
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < priv->n_surf_formats; i++) {
|
||||||
|
if (format != priv->surf_formats[i].format)
|
||||||
|
continue;
|
||||||
|
return priv->surf_formats[i].colorSpace;
|
||||||
|
}
|
||||||
|
|
||||||
|
GST_WARNING_OBJECT (swapper, "unsupported format for swapper's colospaces");
|
||||||
return VK_COLORSPACE_SRGB_NONLINEAR_KHR;
|
return VK_COLORSPACE_SRGB_NONLINEAR_KHR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -790,7 +800,7 @@ _allocate_swapchain (GstVulkanSwapper * swapper, GstCaps * caps,
|
||||||
}
|
}
|
||||||
|
|
||||||
format = gst_vulkan_format_from_video_info (&priv->v_info, 0);
|
format = gst_vulkan_format_from_video_info (&priv->v_info, 0);
|
||||||
color_space = _vk_color_space_from_video_info (&priv->v_info);
|
color_space = _vk_color_space_from_vk_format (swapper, format);
|
||||||
|
|
||||||
if ((priv->surf_props.supportedCompositeAlpha &
|
if ((priv->surf_props.supportedCompositeAlpha &
|
||||||
VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR) != 0) {
|
VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR) != 0) {
|
||||||
|
|
Loading…
Reference in a new issue