mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-01 13:08:49 +00:00
vulkan/image: expose initialization function for subclasses
This commit is contained in:
parent
1c6f3e4b84
commit
52ff97d085
2 changed files with 19 additions and 7 deletions
|
@ -155,11 +155,11 @@ _create_info_from_args (VkImageCreateInfo * info, VkFormat format, gsize width,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
gboolean
|
||||||
_vk_image_mem_init (GstVulkanImageMemory * mem, GstAllocator * allocator,
|
gst_vulkan_image_memory_init (GstVulkanImageMemory * mem,
|
||||||
GstMemory * parent, GstVulkanDevice * device, VkImageUsageFlags usage,
|
GstAllocator * allocator, GstMemory * parent, GstVulkanDevice * device,
|
||||||
GstAllocationParams * params, gsize size, gpointer user_data,
|
VkImageUsageFlags usage, GstAllocationParams * params, gsize size,
|
||||||
GDestroyNotify notify)
|
gpointer user_data, GDestroyNotify notify)
|
||||||
{
|
{
|
||||||
gsize align = gst_memory_alignment, offset = 0, maxsize = size;
|
gsize align = gst_memory_alignment, offset = 0, maxsize = size;
|
||||||
GstMemoryFlags flags = 0;
|
GstMemoryFlags flags = 0;
|
||||||
|
@ -200,6 +200,8 @@ _vk_image_mem_init (GstVulkanImageMemory * mem, GstAllocator * allocator,
|
||||||
|
|
||||||
GST_CAT_DEBUG (GST_CAT_VULKAN_IMAGE_MEMORY,
|
GST_CAT_DEBUG (GST_CAT_VULKAN_IMAGE_MEMORY,
|
||||||
"new Vulkan Image memory:%p size:%" G_GSIZE_FORMAT, mem, maxsize);
|
"new Vulkan Image memory:%p size:%" G_GSIZE_FORMAT, mem, maxsize);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstVulkanImageMemory *
|
static GstVulkanImageMemory *
|
||||||
|
@ -233,7 +235,7 @@ _vk_image_mem_new_alloc (GstAllocator * allocator, GstMemory * parent,
|
||||||
|
|
||||||
vkGetImageMemoryRequirements (device->device, image, &mem->requirements);
|
vkGetImageMemoryRequirements (device->device, image, &mem->requirements);
|
||||||
|
|
||||||
_vk_image_mem_init (mem, allocator, parent, device, usage, ¶ms,
|
gst_vulkan_image_memory_init (mem, allocator, parent, device, usage, ¶ms,
|
||||||
mem->requirements.size, user_data, notify);
|
mem->requirements.size, user_data, notify);
|
||||||
mem->create_info = image_info;
|
mem->create_info = image_info;
|
||||||
mem->image = image;
|
mem->image = image;
|
||||||
|
@ -301,7 +303,7 @@ _vk_image_mem_new_wrapped (GstAllocator * allocator, GstMemory * parent,
|
||||||
/* XXX: assumes alignment is a power of 2 */
|
/* XXX: assumes alignment is a power of 2 */
|
||||||
params.align = mem->requirements.alignment - 1;
|
params.align = mem->requirements.alignment - 1;
|
||||||
params.flags = GST_MEMORY_FLAG_NOT_MAPPABLE;
|
params.flags = GST_MEMORY_FLAG_NOT_MAPPABLE;
|
||||||
_vk_image_mem_init (mem, allocator, parent, device, usage, ¶ms,
|
gst_vulkan_image_memory_init (mem, allocator, parent, device, usage, ¶ms,
|
||||||
mem->requirements.size, user_data, notify);
|
mem->requirements.size, user_data, notify);
|
||||||
mem->wrapped = TRUE;
|
mem->wrapped = TRUE;
|
||||||
|
|
||||||
|
|
|
@ -111,6 +111,16 @@ void gst_vulkan_image_memory_init_once (void);
|
||||||
GST_VULKAN_API
|
GST_VULKAN_API
|
||||||
gboolean gst_is_vulkan_image_memory (GstMemory * mem);
|
gboolean gst_is_vulkan_image_memory (GstMemory * mem);
|
||||||
|
|
||||||
|
GST_VULKAN_API
|
||||||
|
gboolean gst_vulkan_image_memory_init (GstVulkanImageMemory * mem,
|
||||||
|
GstAllocator * allocator,
|
||||||
|
GstMemory * parent,
|
||||||
|
GstVulkanDevice * device,
|
||||||
|
VkImageUsageFlags usage,
|
||||||
|
GstAllocationParams * params,
|
||||||
|
gsize size,
|
||||||
|
gpointer user_data,
|
||||||
|
GDestroyNotify notify);
|
||||||
GST_VULKAN_API
|
GST_VULKAN_API
|
||||||
GstMemory * gst_vulkan_image_memory_alloc (GstVulkanDevice * device,
|
GstMemory * gst_vulkan_image_memory_alloc (GstVulkanDevice * device,
|
||||||
VkFormat format,
|
VkFormat format,
|
||||||
|
|
Loading…
Reference in a new issue