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_PHYSICAL_DEVICE_H__ 22 #define __GST_VULKAN_PHYSICAL_DEVICE_H__ 23 24 #include <gst/vulkan/gstvkinstance.h> 25 #include <gst/vulkan/gstvkqueue.h> 26 27 G_BEGIN_DECLS 28 29 #define GST_TYPE_VULKAN_PHYSICAL_DEVICE (gst_vulkan_physical_device_get_type()) 30 #define GST_VULKAN_PHYSICAL_DEVICE(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_VULKAN_PHYSICAL_DEVICE, GstVulkanPhysicalDevice)) 31 #define GST_VULKAN_PHYSICAL_DEVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GST_TYPE_VULKAN_PHYSICAL_DEVICE, GstVulkanPhysicalDeviceClass)) 32 #define GST_IS_VULKAN_PHYSICAL_DEVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_VULKAN_PHYSICAL_DEVICE)) 33 #define GST_IS_VULKAN_PHYSICAL_DEVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_TYPE_VULKAN_PHYSICAL_DEVICE)) 34 #define GST_VULKAN_PHYSICAL_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_VULKAN_PHYSICAL_DEVICE, GstVulkanPhysicalDeviceClass)) 35 GST_VULKAN_API 36 GType gst_vulkan_physical_device_get_type (void); 37 38 /** 39 * GstVulkanPhysicalDevice: 40 * @parent: the parent #GstObject 41 * @instance: the parent #GstVulkanInstance for this physical device 42 * @device_index: the index into the physical device list in @instance 43 * @device: the vulkan physical device handle 44 * @properties: retrieved physical device properties 45 * @features: retrieved physical device features 46 * @memory_properties: retrieved physical device memory properties 47 * @queue_family_props: vulkan family properties 48 * @n_queue_families: number of elements in @queue_family_props 49 * 50 * Since: 1.18 51 */ 52 struct _GstVulkanPhysicalDevice 53 { 54 GstObject parent; 55 56 GstVulkanInstance *instance; 57 58 guint device_index; 59 VkPhysicalDevice device; /* hides a pointer */ 60 61 VkPhysicalDeviceProperties properties; 62 VkPhysicalDeviceFeatures features; 63 VkPhysicalDeviceMemoryProperties memory_properties; 64 65 VkQueueFamilyProperties *queue_family_props; 66 guint32 n_queue_families; 67 68 /* <private> */ 69 gpointer _reserved [GST_PADDING]; 70 }; 71 72 /** 73 * GstVulkanPhysicalDeviceClass: 74 * @parent_class: the parent #GstObjectClass 75 * 76 * Since: 1.18 77 */ 78 struct _GstVulkanPhysicalDeviceClass 79 { 80 GstObjectClass parent_class; 81 82 /* <private> */ 83 gpointer _reserved [GST_PADDING]; 84 }; 85 86 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GstVulkanPhysicalDevice, gst_object_unref) 87 88 GST_VULKAN_API 89 GstVulkanPhysicalDevice * gst_vulkan_physical_device_new (GstVulkanInstance * instance, 90 guint device_index); 91 GST_VULKAN_API 92 GstVulkanInstance * gst_vulkan_physical_device_get_instance (GstVulkanPhysicalDevice * device); 93 94 GST_VULKAN_API 95 VkPhysicalDevice gst_vulkan_physical_device_get_handle (GstVulkanPhysicalDevice * device); 96 97 GST_VULKAN_API 98 gboolean gst_vulkan_physical_device_get_extension_info (GstVulkanPhysicalDevice * device, 99 const gchar * name, 100 guint32 * spec_version); 101 GST_VULKAN_API 102 gboolean gst_vulkan_physical_device_get_layer_info (GstVulkanPhysicalDevice * device, 103 const gchar * name, 104 gchar ** description, 105 guint32 * spec_version, 106 guint32 * implementation_version); 107 108 109 G_END_DECLS 110 111 #endif /* __GST_VULKAN_PHYSICAL_DEVICE_H__ */ 112