mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 13:11:06 +00:00
vkformat: add gst_vulkan_format_to_video_format()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4351>
This commit is contained in:
parent
ce7256e0d3
commit
d84926b60f
2 changed files with 26 additions and 0 deletions
|
@ -656,3 +656,26 @@ gst_vulkan_format_from_video_info_2 (GstVulkanPhysicalDevice * physical_device,
|
|||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_format_to_video_format:
|
||||
* @vk_format: the Vulkan format to convert
|
||||
*
|
||||
* Returns: the #GstVideoFormat that maps to @vk_format
|
||||
*
|
||||
* Since: 1.24
|
||||
*/
|
||||
GstVideoFormat
|
||||
gst_vulkan_format_to_video_format (VkFormat vk_format)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (vk_formats_map); i++) {
|
||||
if (vk_formats_map[i].vkfrmt != vk_format)
|
||||
continue;
|
||||
|
||||
return vk_formats_map[i].format;
|
||||
}
|
||||
|
||||
return GST_VIDEO_FORMAT_UNKNOWN;
|
||||
}
|
||||
|
|
|
@ -149,6 +149,9 @@ gboolean gst_vulkan_format_from_video_info_2 (
|
|||
int * n_imgs,
|
||||
VkImageUsageFlags * usage);
|
||||
|
||||
GST_VULKAN_API
|
||||
GstVideoFormat gst_vulkan_format_to_video_format (VkFormat vk_format);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_VULKAN_FORMAT_H__ */
|
||||
|
|
Loading…
Reference in a new issue