• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* GStreamer
2  * Copyright (C) 2019 Matthew Waters <matthew@centricular.com>
3  *
4  * vkdeviceprovider.h: Device probing and monitoring
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
22 
23 #ifndef __GST_VULKAN_DEVICE_PROVIDER_H__
24 #define __GST_VULKAN_DEVICE_PROVIDER_H__
25 
26 #ifdef HAVE_CONFIG_H
27 #include "config.h"
28 #endif
29 
30 #include <gst/vulkan/vulkan.h>
31 
32 #include <gst/gst.h>
33 
34 G_BEGIN_DECLS
35 
36 typedef struct _GstVulkanDeviceProvider GstVulkanDeviceProvider;
37 typedef struct _GstVulkanDeviceProviderClass GstVulkanDeviceProviderClass;
38 
39 #define GST_TYPE_VULKAN_DEVICE_PROVIDER                 (gst_vulkan_device_provider_get_type())
40 #define GST_IS_VULKAN_DEVICE_PROVIDER(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VULKAN_DEVICE_PROVIDER))
41 #define GST_IS_VULKAN_DEVICE_PROVIDER_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VULKAN_DEVICE_PROVIDER))
42 #define GST_VULKAN_DEVICE_PROVIDER_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VULKAN_DEVICE_PROVIDER, GstVulkanDeviceProviderClass))
43 #define GST_VULKAN_DEVICE_PROVIDER(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VULKAN_DEVICE_PROVIDER, GstVulkanDeviceProvider))
44 #define GST_VULKAN_DEVICE_PROVIDER_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE_PROVIDER, GstVulkanDeviceProviderClass))
45 #define GST_VULKAN_DEVICE_PROVIDER_CAST(obj)            ((GstVulkanDeviceProvider *)(obj))
46 
47 struct _GstVulkanDeviceProvider {
48   GstDeviceProvider         parent;
49 };
50 
51 typedef enum {
52   GST_VULKAN_DEVICE_TYPE_SINK
53 } GstVulkanDeviceType;
54 
55 struct _GstVulkanDeviceProviderClass {
56   GstDeviceProviderClass    parent_class;
57 };
58 
59 GType gst_vulkan_device_provider_get_type (void);
60 
61 typedef struct _GstVulkanDeviceObject GstVulkanDeviceObject;
62 typedef struct _GstVulkanDeviceObjectClass GstVulkanDeviceObjectClass;
63 
64 #define GST_TYPE_VULKAN_DEVICE_OBJECT                 (gst_vulkan_device_object_get_type())
65 #define GST_IS_VULKAN_DEVICE_OBJECT(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VULKAN_DEVICE_OBJECT))
66 #define GST_IS_VULKAN_DEVICE_OBJECT_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VULKAN_DEVICE_OBJECT))
67 #define GST_VULKAN_DEVICE_OBJECT_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VULKAN_DEVICE_OBJECT, GstVulkanDeviceObjectClass))
68 #define GST_VULKAN_DEVICE_OBJECT(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VULKAN_DEVICE_OBJECT, GstVulkanDeviceObject))
69 #define GST_VULKAN_DEVICE_OBJECT_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VULKAN_DEVICE_OBJECT, GstVulkanDeviceObjectClass))
70 #define GST_VULKAN_DEVICE_OBJECT_CAST(obj)            ((GstVulkanDevice *)(obj))
71 
72 struct _GstVulkanDeviceObject {
73   GstDevice                 parent;
74 
75   GstVulkanDeviceType       type;
76   guint                     device_index;
77   gboolean                  is_default;
78   const gchar              *element;
79   GstVulkanPhysicalDevice  *physical_device;
80 };
81 
82 struct _GstVulkanDeviceObjectClass {
83   GstDeviceClass            parent_class;
84 };
85 
86 GType        gst_vulkan_device_object_get_type (void);
87 
88 G_END_DECLS
89 
90 #endif /* __GST_VULKAN_DEVICE_PROVIDER_H__ */
91