1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
/*
* GStreamer
* Copyright (C) 2015 Matthew Waters <matthew@centricular.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_VULKAN_DEVICE_H__
#define __GST_VULKAN_DEVICE_H__
#include <gst/vulkan/gstvkphysicaldevice.h>
#include <gst/vulkan/gstvkqueue.h>
G_BEGIN_DECLS
#define GST_TYPE_VULKAN_DEVICE (gst_vulkan_device_get_type())
#define GST_VULKAN_DEVICE(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_VULKAN_DEVICE, GstVulkanDevice))
#define GST_VULKAN_DEVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GST_TYPE_VULKAN_DEVICE, GstVulkanDeviceClass))
#define GST_IS_VULKAN_DEVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_VULKAN_DEVICE))
#define GST_IS_VULKAN_DEVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_TYPE_VULKAN_DEVICE))
#define GST_VULKAN_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_VULKAN_DEVICE, GstVulkanDeviceClass))
GST_VULKAN_API
GType gst_vulkan_device_get_type (void);
/**
* GST_VULKAN_DEVICE_CONTEXT_TYPE_STR:
*
* Since: 1.18
*/
#define GST_VULKAN_DEVICE_CONTEXT_TYPE_STR "gst.vulkan.device"
/**
* GstVulkanDeviceForEachQueueFunc:
*
* Since: 1.18
*/
typedef gboolean (*GstVulkanDeviceForEachQueueFunc) (GstVulkanDevice * device, GstVulkanQueue * queue, gpointer user_data);
/**
* GstVulkanDevice:
* @parent: the parent #GstObject
* @instance: the #GstVulkanInstance this device was allocated with
* @physical_device: the #GstVulkanPhysicalDevice this device was allocated with
* @device: the vulkan device handle
*
* Since: 1.18
*/
struct _GstVulkanDevice
{
GstObject parent;
GstVulkanInstance *instance;
GstVulkanPhysicalDevice *physical_device;
VkDevice device; /* hides a pointer */
/* <private> */
gpointer _reserved [GST_PADDING];
};
/**
* GstVulkanDeviceClass:
* @parent_class: the parent #GstObjectClass
*
* Since: 1.18
*/
struct _GstVulkanDeviceClass
{
GstObjectClass parent_class;
/* <private> */
gpointer _reserved [GST_PADDING];
};
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GstVulkanDevice, gst_object_unref)
GST_VULKAN_API
GstVulkanDevice * gst_vulkan_device_new (GstVulkanPhysicalDevice * physical_device);
GST_VULKAN_API
GstVulkanDevice * gst_vulkan_device_new_with_index (GstVulkanInstance * instance, guint device_index);
GST_VULKAN_API
GstVulkanInstance * gst_vulkan_device_get_instance (GstVulkanDevice * device);
GST_VULKAN_API
gboolean gst_vulkan_device_open (GstVulkanDevice * device,
GError ** error);
GST_VULKAN_API
gboolean gst_vulkan_device_enable_extension (GstVulkanDevice * device,
const gchar * name);
GST_VULKAN_API
gboolean gst_vulkan_device_disable_extension (GstVulkanDevice * device,
const gchar * name);
GST_VULKAN_API
gboolean gst_vulkan_device_is_extension_enabled (GstVulkanDevice * device,
const gchar * name);
GST_VULKAN_API
gboolean gst_vulkan_device_enable_layer (GstVulkanDevice * device,
const gchar * name);
GST_VULKAN_API
gboolean gst_vulkan_device_is_layer_enabled (GstVulkanDevice * device,
const gchar * name);
GST_VULKAN_API
gpointer gst_vulkan_device_get_proc_address (GstVulkanDevice * device,
const gchar * name);
GST_VULKAN_API
void gst_vulkan_device_foreach_queue (GstVulkanDevice * device,
GstVulkanDeviceForEachQueueFunc func,
gpointer user_data);
GST_VULKAN_API
GstVulkanQueue * gst_vulkan_device_get_queue (GstVulkanDevice * device,
guint32 queue_family,
guint32 queue_i);
GST_VULKAN_API
VkPhysicalDevice gst_vulkan_device_get_physical_device (GstVulkanDevice * device);
GST_VULKAN_API
void gst_context_set_vulkan_device (GstContext * context,
GstVulkanDevice * device);
GST_VULKAN_API
gboolean gst_context_get_vulkan_device (GstContext * context,
GstVulkanDevice ** device);
GST_VULKAN_API
gboolean gst_vulkan_device_handle_context_query (GstElement * element,
GstQuery * query,
GstVulkanDevice * device);
GST_VULKAN_API
gboolean gst_vulkan_device_run_context_query (GstElement * element,
GstVulkanDevice ** device);
GST_VULKAN_API
GstVulkanFence * gst_vulkan_device_create_fence (GstVulkanDevice * device,
GError ** error);
G_END_DECLS
#endif /* __GST_VULKAN_DEVICE_H__ */
|