vkimagememory: add get_{width,height) functions
authorMatthew Waters <matthew@centricular.com>
Fri, 5 Feb 2016 08:09:41 +0000 (19:09 +1100)
committerMatthew Waters <matthew@centricular.com>
Tue, 16 Feb 2016 14:13:43 +0000 (01:13 +1100)
ext/vulkan/vkimagememory.c
ext/vulkan/vkimagememory.h

index 178f9f7697b41211fa4f6cffb6648a8fb96c4f63..70a0db70674a820e679ef1eec962eff068741c85 100644 (file)
@@ -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);
 
index 077c30f1da8894b3f7e199cbd9cadcc15ee15a44..de6c6cb626396d3b19a9a0a3f8689476008287f8 100644 (file)
@@ -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);