mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
vkimagememory: add get_{width,height) functions
This commit is contained in:
parent
08fd5c2ae5
commit
6731fad9af
2 changed files with 23 additions and 2 deletions
|
@ -127,8 +127,8 @@ _find_memory_type_index_with_type_properties (GstVulkanDevice * device,
|
|||
for (i = 0; i < 32; i++) {
|
||||
if ((typeBits & 1) == 1) {
|
||||
/* Type is available, does it match user properties? */
|
||||
if ((device->memory_properties.memoryTypes[i].
|
||||
propertyFlags & properties) == properties) {
|
||||
if ((device->memory_properties.
|
||||
memoryTypes[i].propertyFlags & properties) == properties) {
|
||||
*typeIndex = i;
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -503,6 +503,24 @@ gst_vulkan_image_memory_wrapped (GstVulkanDevice * device, VkImage image,
|
|||
return (GstMemory *) mem;
|
||||
}
|
||||
|
||||
guint32
|
||||
gst_vulkan_image_memory_get_width (GstVulkanImageMemory * image)
|
||||
{
|
||||
g_return_val_if_fail (gst_is_vulkan_image_memory (GST_MEMORY_CAST (image)),
|
||||
0);
|
||||
|
||||
return image->create_info.extent.width;
|
||||
}
|
||||
|
||||
guint32
|
||||
gst_vulkan_image_memory_get_height (GstVulkanImageMemory * image)
|
||||
{
|
||||
g_return_val_if_fail (gst_is_vulkan_image_memory (GST_MEMORY_CAST (image)),
|
||||
0);
|
||||
|
||||
return image->create_info.extent.height;
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE (GstVulkanImageMemoryAllocator, gst_vulkan_image_memory_allocator,
|
||||
GST_TYPE_ALLOCATOR);
|
||||
|
||||
|
|
|
@ -108,6 +108,9 @@ gboolean gst_vulkan_image_memory_set_layout (GstVulkanImageMemory *
|
|||
VkImageLayout,
|
||||
VkImageMemoryBarrier * barrier);
|
||||
|
||||
guint32 gst_vulkan_image_memory_get_width (GstVulkanImageMemory * image);
|
||||
guint32 gst_vulkan_image_memory_get_height (GstVulkanImageMemory * image);
|
||||
|
||||
VkFormat gst_vulkan_format_from_video_format (GstVideoFormat v_format,
|
||||
guint plane);
|
||||
|
||||
|
|
Loading…
Reference in a new issue