1 /* 2 * GStreamer 3 * Copyright (C) 2019 Matthew Waters <matthew@centricular.com> 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Library General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU Library General Public 16 * License along with this library; if not, write to the 17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 18 * Boston, MA 02110-1301, USA. 19 */ 20 21 #ifndef __GST_VULKAN_COMMAND_POOL_H__ 22 #define __GST_VULKAN_COMMAND_POOL_H__ 23 24 #include <gst/vulkan/gstvkqueue.h> 25 26 #define GST_TYPE_VULKAN_COMMAND_POOL (gst_vulkan_command_pool_get_type()) 27 #define GST_VULKAN_COMMAND_POOL(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_VULKAN_COMMAND_POOL, GstVulkanCommandPool)) 28 #define GST_VULKAN_COMMAND_POOL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GST_TYPE_VULKAN_COMMAND_POOL, GstVulkanCommandPoolClass)) 29 #define GST_IS_VULKAN_COMMAND_POOL(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_VULKAN_COMMAND_POOL)) 30 #define GST_IS_VULKAN_COMMAND_POOL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_TYPE_VULKAN_COMMAND_POOL)) 31 #define GST_VULKAN_COMMAND_POOL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_VULKAN_COMMAND_POOL, GstVulkanCommandPoolClass)) 32 GST_VULKAN_API 33 GType gst_vulkan_command_pool_get_type (void); 34 35 /** 36 * GstVulkanCommandPool: 37 * @parent: the parent #GstObject 38 * @queue: the #GstVulkanQueue to command buffers will be allocated from 39 * @pool: the vulkan command pool handle 40 * 41 * Since: 1.18 42 */ 43 struct _GstVulkanCommandPool 44 { 45 GstObject parent; 46 47 GstVulkanQueue *queue; 48 49 VkCommandPool pool; /* hides a pointer */ 50 51 /* <private> */ 52 gpointer _reserved [GST_PADDING]; 53 }; 54 55 /** 56 * GstVulkanCommandPoolClass: 57 * @parent_class: the parent #GstObjectClass 58 * 59 * Since: 1.18 60 */ 61 struct _GstVulkanCommandPoolClass 62 { 63 GstObjectClass parent_class; 64 65 /* <private> */ 66 gpointer _reserved [GST_PADDING]; 67 }; 68 69 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GstVulkanCommandPool, gst_object_unref) 70 71 GST_VULKAN_API 72 GstVulkanQueue * gst_vulkan_command_pool_get_queue (GstVulkanCommandPool * pool); 73 74 GST_VULKAN_API 75 GstVulkanCommandBuffer * gst_vulkan_command_pool_create (GstVulkanCommandPool * pool, 76 GError ** error); 77 78 GST_VULKAN_API 79 void gst_vulkan_command_pool_lock (GstVulkanCommandPool * pool); 80 GST_VULKAN_API 81 void gst_vulkan_command_pool_unlock (GstVulkanCommandPool * pool); 82 83 #endif /* __GST_VULKAN_COMMAND_POOL_H__ */ 84