• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * GStreamer
3  * Copyright (C) 2015 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_QUEUE_H__
22 #define __GST_VULKAN_QUEUE_H__
23 
24 #include <gst/vulkan/gstvkdevice.h>
25 #include <gst/vulkan/gstvkcommandpool.h>
26 
27 #define GST_TYPE_VULKAN_QUEUE         (gst_vulkan_queue_get_type())
28 #define GST_VULKAN_QUEUE(o)           (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_VULKAN_QUEUE, GstVulkanQueue))
29 #define GST_VULKAN_QUEUE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), GST_TYPE_VULKAN_QUEUE, GstVulkanQueueClass))
30 #define GST_IS_VULKAN_QUEUE(o)        (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_VULKAN_QUEUE))
31 #define GST_IS_VULKAN_QUEUE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE((k), GST_TYPE_VULKAN_QUEUE))
32 #define GST_VULKAN_QUEUE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_VULKAN_QUEUE, GstVulkanQueueClass))
33 GST_VULKAN_API
34 GType gst_vulkan_queue_get_type       (void);
35 
36 /**
37  * GST_VULKAN_QUEUE_CONTEXT_TYPE_STR:
38  *
39  * Since: 1.18
40  */
41 #define GST_VULKAN_QUEUE_CONTEXT_TYPE_STR "gst.vulkan.queue"
42 
43 /**
44  * GstVulkanQueue:
45  * @parent: the parent #GstObject
46  * @device: the #GstVulkanDevice this queue was allocated from
47  * @queue: the vulkan queue handle
48  * @family: the vulkan queue family
49  * @index: the vulkan queue index
50  *
51  * Since: 1.18
52  */
53 struct _GstVulkanQueue
54 {
55   GstObject parent;
56 
57   GstVulkanDevice *device;
58 
59   VkQueue queue; /* hides a pointer */
60   guint32 family;
61   guint32 index;
62 
63   /* <private> */
64   gpointer _reserved        [GST_PADDING];
65 };
66 
67 /**
68  * GstVulkanQueueClass:
69  * @parent_class: the parent #GstObjectClass
70  *
71  * Since: 1.18
72  */
73 struct _GstVulkanQueueClass
74 {
75   GstObjectClass parent_class;
76 
77   /* <private> */
78   gpointer _reserved        [GST_PADDING];
79 };
80 
81 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GstVulkanQueue, gst_object_unref)
82 
83   GST_VULKAN_API
84 GstVulkanDevice *   gst_vulkan_queue_get_device (GstVulkanQueue * queue);
85 
86 GST_VULKAN_API
87 GstVulkanCommandPool *  gst_vulkan_queue_create_command_pool    (GstVulkanQueue * queue,
88                                                                  GError ** error);
89 
90 GST_VULKAN_API
91 void                gst_vulkan_queue_submit_lock                (GstVulkanQueue * queue);
92 GST_VULKAN_API
93 void                gst_vulkan_queue_submit_unlock              (GstVulkanQueue * queue);
94 
95 GST_VULKAN_API
96 void                gst_context_set_vulkan_queue                (GstContext * context,
97                                                                  GstVulkanQueue * queue);
98 GST_VULKAN_API
99 gboolean            gst_context_get_vulkan_queue                (GstContext * context,
100                                                                  GstVulkanQueue ** queue);
101 GST_VULKAN_API
102 gboolean            gst_vulkan_queue_handle_context_query       (GstElement * element,
103                                                                  GstQuery * query,
104                                                                  GstVulkanQueue * queue);
105 GST_VULKAN_API
106 gboolean            gst_vulkan_queue_run_context_query          (GstElement * element,
107                                                                  GstVulkanQueue ** queue);
108 
109 #endif /* __GST_VULKAN_QUEUE_H__ */
110