From: Matthew Waters Date: Fri, 5 Feb 2016 08:09:41 +0000 (+1100) Subject: vkimagememory: add get_{width,height) functions X-Git-Tag: 1.10.4~1161 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6731fad9affa1295278fa3ad2b00f2154a28adda;p=platform%2Fupstream%2Fgst-plugins-bad.git vkimagememory: add get_{width,height) functions --- diff --git a/ext/vulkan/vkimagememory.c b/ext/vulkan/vkimagememory.c index 178f9f7..70a0db7 100644 --- a/ext/vulkan/vkimagememory.c +++ b/ext/vulkan/vkimagememory.c @@ -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); diff --git a/ext/vulkan/vkimagememory.h b/ext/vulkan/vkimagememory.h index 077c30f..de6c6cb 100644 --- a/ext/vulkan/vkimagememory.h +++ b/ext/vulkan/vkimagememory.h @@ -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);